< prev index next >
src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp
Print this page
rev 53052 : [mq]: asm.patch
@@ -964,5 +964,28 @@
StubCodeGenerator cgen(&buf);
_shenandoah_wb = generate_shenandoah_wb(&cgen, false, true);
_shenandoah_wb_C = generate_shenandoah_wb(&cgen, true, !ShenandoahWriteBarrierCsetTestInIR);
}
}
+
+bool ShenandoahBarrierSetAssembler::needs_explicit_null_check(intptr_t offset) {
+ // Exception handler checks the nmethod's implicit null checks table
+ // only when this method returns false.
+#ifdef _LP64
+ if (UseCompressedOops && Universe::narrow_oop_base() != NULL) {
+ assert (Universe::heap() != NULL, "java heap should be initialized");
+ // The first page after heap_base is unmapped and
+ // the 'offset' is equal to [heap_base + offset] for
+ // narrow oop implicit null checks.
+ uintptr_t base = (uintptr_t)Universe::narrow_oop_base();
+ int adj = BrooksPointer::byte_offset();
+ if ((uintptr_t)(offset - adj) >= base) {
+ // Normalize offset for the next check.
+ offset = (intptr_t)(pointer_delta((void*)offset, (void*)base, 1));
+ }
+ }
+#endif
+ if (offset == BrooksPointer::byte_offset()) {
+ return false;
+ }
+ return offset < 0 || os::vm_page_size() <= offset;
+}
< prev index next >