8193699: aarch64 fails to build after 8167372
authorrraghavan
Fri, 22 Dec 2017 09:51:16 -0800
changeset 48478 f3907e64eea2
parent 48477 b7af6f568d00
child 48479 7b5c930b878c
8193699: aarch64 fails to build after 8167372 Summary: added ThreadInVMfromUnknown support Reviewed-by: smonteith, vlivanov
src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Fri Dec 22 15:55:29 2017 +0000
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Fri Dec 22 09:51:16 2017 -0800
@@ -3742,13 +3742,16 @@
 }
 
 void  MacroAssembler::set_narrow_oop(Register dst, jobject obj) {
-  assert (UseCompressedOops, "should only be used for compressed oops");
-  assert (Universe::heap() != NULL, "java heap should be initialized");
-  assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
-
+#ifdef ASSERT
+  {
+    ThreadInVMfromUnknown tiv;
+    assert (UseCompressedOops, "should only be used for compressed oops");
+    assert (Universe::heap() != NULL, "java heap should be initialized");
+    assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+    assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
+  }
+#endif
   int oop_index = oop_recorder()->find_index(obj);
-  assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
-
   InstructionMark im(this);
   RelocationHolder rspec = oop_Relocation::spec(oop_index);
   code_section()->relocate(inst_mark(), rspec);
@@ -4006,8 +4009,13 @@
   if (obj == NULL) {
     oop_index = oop_recorder()->allocate_oop_index(obj);
   } else {
+#ifdef ASSERT
+    {
+      ThreadInVMfromUnknown tiv;
+      assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
+    }
+#endif
     oop_index = oop_recorder()->find_index(obj);
-    assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
   }
   RelocationHolder rspec = oop_Relocation::spec(oop_index);
   if (! immediate) {
@@ -4030,8 +4038,13 @@
 }
 
 Address MacroAssembler::constant_oop_address(jobject obj) {
-  assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
-  assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "not an oop");
+#ifdef ASSERT
+  {
+    ThreadInVMfromUnknown tiv;
+    assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
+    assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "not an oop");
+  }
+#endif
   int oop_index = oop_recorder()->find_index(obj);
   return Address((address)obj, oop_Relocation::spec(oop_index));
 }