long instanceField; staticlong myLongField1; staticlong myLongField2;
publicstaticvoid main(String[] args) throws Exception {
Unsafe unsafe = getUnsafe();
Main f = new Main(); long offset = unsafe.objectFieldOffset(Main.class.getDeclaredField("instanceField"));
getUnsafe(); // spill offset long a = myLongField1; // We used the hinted register for the low part of b, which is EBX, as requested // by the intrinsic below. Allocating EBX for the low part, would put ESP as the high // part, and we did not check that ESP was blocked. long b = myLongField2;
unsafe.compareAndSwapLong(f, offset, a, b);
}
privatestatic Unsafe getUnsafe() throws Exception {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true); return (Unsafe) f.get(null);
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.