8200290: Scratch buffer creation fails with "assert(!current_thread_in_native()) failed: must not be in native" on SPARC
authorthartmann
Wed, 28 Mar 2018 09:12:45 +0200
changeset 49623 5555ba8fcc5c
parent 49622 c96f6f8984f7
child 49624 cfde7ece3113
8200290: Scratch buffer creation fails with "assert(!current_thread_in_native()) failed: must not be in native" on SPARC Summary: The code needs to be changed after JDK-8167372 to transition from native. Reviewed-by: kvn
src/hotspot/cpu/sparc/macroAssembler_sparc.cpp
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Tue Mar 27 18:31:25 2018 +0200
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Wed Mar 28 09:12:45 2018 +0200
@@ -998,8 +998,13 @@
 
 
 AddressLiteral 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 AddressLiteral(obj, oop_Relocation::spec(oop_index));
 }