@@ -2272,7 +2272,9 @@ void TemplateTable::load_resolved_field_entry(Register obj,
22722272 __ load_unsigned_byte (flags, Address (cache, in_bytes (ResolvedFieldEntry::flags_offset ())));
22732273
22742274 // TOS state
2275- __ load_unsigned_byte (tos_state, Address (cache, in_bytes (ResolvedFieldEntry::type_offset ())));
2275+ if (tos_state != noreg) {
2276+ __ load_unsigned_byte (tos_state, Address (cache, in_bytes (ResolvedFieldEntry::type_offset ())));
2277+ }
22762278
22772279 // Klass overwrite register
22782280 if (is_static) {
@@ -3036,13 +3038,9 @@ void TemplateTable::fast_storefield(TosState state) {
30363038
30373039 // access constant pool cache
30383040 __ load_field_entry (x12, x11);
3039- __ push_reg (x10);
3040- // X11: field offset, X12: TOS, X13: flags
3041- load_resolved_field_entry (x12, x12, x10, x11, x13);
3042- __ pop_reg (x10);
30433041
3044- // Must prevent reordering of the following cp cache loads with bytecode load
3045- __ membar (MacroAssembler::LoadLoad );
3042+ // X11: field offset, X12: field holder, X13: flags
3043+ load_resolved_field_entry (x12, x12, noreg, x11, x13 );
30463044
30473045 {
30483046 Label notVolatile;
@@ -3133,9 +3131,6 @@ void TemplateTable::fast_accessfield(TosState state) {
31333131 // access constant pool cache
31343132 __ load_field_entry (x12, x11);
31353133
3136- // Must prevent reordering of the following cp cache loads with bytecode load
3137- __ membar (MacroAssembler::LoadLoad);
3138-
31393134 __ load_sized_value (x11, Address (x12, in_bytes (ResolvedFieldEntry::field_offset_offset ())), sizeof (int ), true /* is_signed*/ );
31403135 __ load_unsigned_byte (x13, Address (x12, in_bytes (ResolvedFieldEntry::flags_offset ())));
31413136
0 commit comments