--- old/src/cpu/sparc/vm/sharedRuntime_sparc.cpp 2017-04-25 16:43:45.055176933 +0200 +++ new/src/cpu/sparc/vm/sharedRuntime_sparc.cpp 2017-04-25 16:43:44.907176938 +0200 @@ -2521,28 +2521,9 @@ // Unbox oop result, e.g. JNIHandles::resolve value in I0. if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - Label done, not_weak; - __ br_null(I0, false, Assembler::pn, done); // Use NULL as-is. - __ delayed()->andcc(I0, JNIHandles::weak_tag_mask, G0); // Test for jweak - __ brx(Assembler::zero, true, Assembler::pt, not_weak); - __ delayed()->ld_ptr(I0, 0, I0); // Maybe resolve (untagged) jobject. - // Resolve jweak. - __ ld_ptr(I0, -JNIHandles::weak_tag_value, I0); -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // Copy to O0 because macro doesn't allow pre_val in input reg. - __ mov(I0, O0); - __ g1_write_barrier_pre(noreg /* obj */, - noreg /* index */, - 0 /* offset */, - O0 /* pre_val */, - G3_scratch /* tmp */, - true /* preserve_o_regs */); - } -#endif // INCLUDE_ALL_GCS - __ bind(not_weak); - __ verify_oop(I0); - __ bind(done); + __ mov(I0, O0); + __ resolve_jobject(O0, G3_scratch); + __ mov(O0, I0); } if (CheckJNICalls) {