src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp
changeset 49929 f38329fe8055
parent 49898 4745598b307f
child 50164 88bf53770be5
--- a/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp	Mon Apr 30 09:49:08 2018 -0700
+++ b/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp	Mon Apr 30 21:17:37 2018 +0200
@@ -44,6 +44,7 @@
 // c_rarg1:    obj
 // c_rarg2:    jfield id
 
+static const Register rtmp          = r8;
 static const Register robj          = r9;
 static const Register rcounter      = r10;
 static const Register roffset       = r11;
@@ -86,8 +87,10 @@
   __ mov   (roffset, c_rarg2);
   __ shrptr(roffset, 2);                         // offset
 
+  // Both robj and rtmp are clobbered by try_resolve_jobject_in_native.
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
-  bs->try_resolve_jobject_in_native(masm, robj, rscratch1, slow);
+  bs->try_resolve_jobject_in_native(masm, /* jni_env */ c_rarg0, robj, rtmp, slow);
+  DEBUG_ONLY(__ movl(rtmp, 0xDEADC0DE);)
 
   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
   speculative_load_pclist[count] = __ pc();