--- a/hotspot/src/share/vm/asm/assembler.cpp Wed Jul 05 16:39:00 2017 +0200
+++ b/hotspot/src/share/vm/asm/assembler.cpp Sat Jul 19 17:38:22 2008 -0400
@@ -246,6 +246,24 @@
}
}
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
+ // Exception handler checks the nmethod's implicit null checks table
+ // only when this method returns false.
+#ifndef SPARC
+ // Sparc does not have based addressing
+ if (UseCompressedOops) {
+ // 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 heap_base = (uintptr_t)Universe::heap_base();
+ if ((uintptr_t)offset >= heap_base) {
+ // Normalize offset for the next check.
+ offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
+ }
+ }
+#endif // SPARC
+ return offset < 0 || os::vm_page_size() <= offset;
+}
#ifndef PRODUCT
void Label::print_instructions(MacroAssembler* masm) const {