Skip to content

Commit a75299c

Browse files
committed
8287686: Add assertion to ensure that disarm value offset < 128
Reviewed-by: tschatzl, shade
1 parent 407abf5 commit a75299c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hotspot/share/runtime/thread.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ class Thread: public ThreadShadow {
158158
}
159159

160160
static ByteSize nmethod_disarmed_offset() {
161-
return byte_offset_of(Thread, _nmethod_disarm_value);
161+
ByteSize offset = byte_offset_of(Thread, _nmethod_disarm_value);
162+
// At least on x86_64, nmethod entry barrier encodes disarmed value offset
163+
// in instruction as disp8 immed
164+
assert(in_bytes(offset) < 128, "Offset >= 128");
165+
return offset;
162166
}
163167

164168
private:

0 commit comments

Comments
 (0)