@@ -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
@@ -3114,7 +3117,7 @@ void TemplateTable::fast_storefield(TosState state) {
31143117 const ConditionRegister CR_is_vol = CR2; // Non-volatile condition register (survives runtime call in do_oop_store).
31153118
31163119 // Constant pool already resolved => Load flags and offset of field.
3117- __ load_field_entry (Rcache, Rscratch);
3120+ __ load_field_entry (Rcache, Rscratch, 1 , /* for_fast_bytecode */ true );
31183121 jvmti_post_field_mod (Rcache, Rscratch, false /* not static */ );
31193122 load_resolved_field_entry (noreg, Rcache, noreg, Roffset, Rflags, false ); // Uses R11, R12
31203123
@@ -3195,7 +3198,7 @@ void TemplateTable::fast_accessfield(TosState state) {
31953198 // R12_scratch2 used by load_field_cp_cache_entry
31963199
31973200 // Constant pool already resolved. Get the field offset.
3198- __ load_field_entry (Rcache, Rscratch);
3201+ __ load_field_entry (Rcache, Rscratch, 1 , /* for_fast_bytecode */ true );
31993202 load_resolved_field_entry (noreg, Rcache, noreg, Roffset, Rflags, false ); // Uses R11, R12
32003203
32013204 // JVMTI support
@@ -3334,7 +3337,7 @@ void TemplateTable::fast_xaccess(TosState state) {
33343337 __ ld (Rclass_or_obj, 0 , R18_locals);
33353338
33363339 // Constant pool already resolved. Get the field offset.
3337- __ load_field_entry (Rcache, Rscratch, 2 );
3340+ __ load_field_entry (Rcache, Rscratch, 2 , /* for_fast_bytecode */ true );
33383341 load_resolved_field_entry (noreg, Rcache, noreg, Roffset, Rflags, false ); // Uses R11, R12
33393342
33403343 // JVMTI support not needed, since we switch back to single bytecode as soon as debugger attaches.
@@ -3495,7 +3498,7 @@ void TemplateTable::fast_invokevfinal(int byte_no) {
34953498
34963499 assert (byte_no == f2_byte, " use this argument" );
34973500 Register Rcache = R31;
3498- __ load_method_entry (Rcache, R11_scratch1);
3501+ __ load_method_entry (Rcache, R11_scratch1, 1 , /* for_fast_bytecode */ true );
34993502 invokevfinal_helper (Rcache, R11_scratch1, R12_scratch2, R22_tmp2, R23_tmp3);
35003503}
35013504
0 commit comments