@@ -148,7 +148,9 @@ void TemplateTable::patch_bytecode(Bytecodes::Code new_bc, Register Rnew_bc, Reg
148148 __ bind (L_fast_patch);
149149 }
150150
151- // Patch bytecode.
151+ // Patch bytecode with release store to coordinate with ResolvedFieldEntry
152+ // and ResolvedMethodEntry loads in fast bytecode codelets.
153+ __ release ();
152154 __ stb (Rnew_bc, 0 , R14_bcp);
153155
154156 __ bind (L_patch_done);
@@ -312,6 +314,7 @@ void TemplateTable::fast_aldc(LdcType type) {
312314 // We are resolved if the resolved reference cache entry contains a
313315 // non-null object (CallSite, etc.)
314316 __ get_cache_index_at_bcp (R31, 1 , index_size); // Load index.
317+ // Only rewritten during link time. So, no need for memory barriers for accessing resolved info.
315318 __ load_resolved_reference_at_index (R17_tos, R31, R11_scratch1, R12_scratch2, &is_null);
316319
317320 // Convert null sentinel to null
@@ -3109,7 +3112,7 @@ void TemplateTable::fast_storefield(TosState state) {
31093112 const ConditionRegister CR_is_vol = CR2; // Non-volatile condition register (survives runtime call in do_oop_store).
31103113
31113114 // Constant pool already resolved => Load flags and offset of field.
3112- __ load_field_entry (Rcache, Rscratch);
3115+ __ load_field_entry (Rcache, Rscratch, 1 , /* for_fast_bytecode */ true );
31133116 jvmti_post_field_mod (Rcache, Rscratch, false /* not static */ );
31143117 load_resolved_field_entry (noreg, Rcache, noreg, Roffset, Rflags, false ); // Uses R11, R12
31153118
@@ -3190,7 +3193,7 @@ void TemplateTable::fast_accessfield(TosState state) {
31903193 // R12_scratch2 used by load_field_cp_cache_entry
31913194
31923195 // Constant pool already resolved. Get the field offset.
3193- __ load_field_entry (Rcache, Rscratch);
3196+ __ load_field_entry (Rcache, Rscratch, 1 , /* for_fast_bytecode */ true );
31943197 load_resolved_field_entry (noreg, Rcache, noreg, Roffset, Rflags, false ); // Uses R11, R12
31953198
31963199 // JVMTI support
@@ -3329,7 +3332,7 @@ void TemplateTable::fast_xaccess(TosState state) {
33293332 __ ld (Rclass_or_obj, 0 , R18_locals);
33303333
33313334 // Constant pool already resolved. Get the field offset.
3332- __ load_field_entry (Rcache, Rscratch, 2 );
3335+ __ load_field_entry (Rcache, Rscratch, 2 , /* for_fast_bytecode */ true );
33333336 load_resolved_field_entry (noreg, Rcache, noreg, Roffset, Rflags, false ); // Uses R11, R12
33343337
33353338 // JVMTI support not needed, since we switch back to single bytecode as soon as debugger attaches.
@@ -3490,7 +3493,7 @@ void TemplateTable::fast_invokevfinal(int byte_no) {
34903493
34913494 assert (byte_no == f2_byte, " use this argument" );
34923495 Register Rcache = R31;
3493- __ load_method_entry (Rcache, R11_scratch1);
3496+ __ load_method_entry (Rcache, R11_scratch1, 1 , /* for_fast_bytecode */ true );
34943497 invokevfinal_helper (Rcache, R11_scratch1, R12_scratch2, R22_tmp2, R23_tmp3);
34953498}
34963499
0 commit comments