From 642b68b31b06f1309690dec99d40b722ff7c3aee Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Wed, 28 Mar 2018 09:12:45 +0200 Subject: [PATCH] 8200290: Scratch buffer creation fails with "assert(!current_thread_in_native()) failed: must not be in native" on SPARC The code needs to be changed after JDK-8167372 to transition from native. Reviewed-by: kvn --- src/hotspot/cpu/sparc/macroAssembler_sparc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp index d13c73ea18e..631b77a1a34 100644 --- a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp +++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp @@ -998,8 +998,13 @@ AddressLiteral MacroAssembler::constant_metadata_address(Metadata* obj) { 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)); }