< prev index next >

src/cpu/x86/vm/stubGenerator_x86_64.cpp

Print this page

        

@@ -993,11 +993,11 @@
   //  * = popped on exit
   address generate_verify_oop() {
     StubCodeMark mark(this, "StubRoutines", "verify_oop");
     address start = __ pc();
 
-    Label exit, error;
+    Label exit, error, in_Java_heap;
 
     __ pushf();
     __ incrementl(ExternalAddress((address) StubRoutines::verify_oop_count_addr()));
 
     __ push(r12);

@@ -1027,11 +1027,18 @@
     __ movptr(c_rarg2, rax);
     __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_mask());
     __ andptr(c_rarg2, c_rarg3);
     __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_bits());
     __ cmpptr(c_rarg2, c_rarg3);
-    __ jcc(Assembler::notZero, error);
+    __ jcc(Assembler::zero, in_Java_heap);
+    // Not in Java heap, but could be valid if it's a bufferable value type
+    __ load_klass(c_rarg2, rax);
+    __ movbool(c_rarg2, Address(c_rarg2, InstanceKlass::extra_flags_offset()));
+    __ andptr(c_rarg2, InstanceKlass::_extra_is_bufferable);
+    __ testbool(c_rarg2);
+    __ jcc(Assembler::zero, error);
+    __ bind(in_Java_heap);
 
     // set r12 to heapbase for load_klass()
     __ reinit_heapbase();
 
     // make sure klass is 'reasonable', which is not zero.
< prev index next >