707 Bytecode_field field_access(caller, bci); |
707 Bytecode_field field_access(caller, bci); |
708 // This can be static or non-static field access |
708 // This can be static or non-static field access |
709 Bytecodes::Code code = field_access.code(); |
709 Bytecodes::Code code = field_access.code(); |
710 |
710 |
711 // We must load class, initialize class and resolvethe field |
711 // We must load class, initialize class and resolvethe field |
712 FieldAccessInfo result; // initialize class if needed |
712 fieldDescriptor result; // initialize class if needed |
713 constantPoolHandle constants(THREAD, caller->constants()); |
713 constantPoolHandle constants(THREAD, caller->constants()); |
714 LinkResolver::resolve_field(result, constants, field_access.index(), Bytecodes::java_code(code), false, CHECK_NULL); |
714 LinkResolver::resolve_field_access(result, constants, field_access.index(), Bytecodes::java_code(code), CHECK_NULL); |
715 return result.klass()(); |
715 return result.field_holder(); |
716 } |
716 } |
717 |
717 |
718 |
718 |
719 // |
719 // |
720 // This routine patches sites where a class wasn't loaded or |
720 // This routine patches sites where a class wasn't loaded or |
824 (stub_id == Runtime1::load_klass_patching_id || stub_id == Runtime1::load_mirror_patching_id); |
824 (stub_id == Runtime1::load_klass_patching_id || stub_id == Runtime1::load_mirror_patching_id); |
825 |
825 |
826 if (stub_id == Runtime1::access_field_patching_id) { |
826 if (stub_id == Runtime1::access_field_patching_id) { |
827 |
827 |
828 Bytecode_field field_access(caller_method, bci); |
828 Bytecode_field field_access(caller_method, bci); |
829 FieldAccessInfo result; // initialize class if needed |
829 fieldDescriptor result; // initialize class if needed |
830 Bytecodes::Code code = field_access.code(); |
830 Bytecodes::Code code = field_access.code(); |
831 constantPoolHandle constants(THREAD, caller_method->constants()); |
831 constantPoolHandle constants(THREAD, caller_method->constants()); |
832 LinkResolver::resolve_field(result, constants, field_access.index(), Bytecodes::java_code(code), false, CHECK); |
832 LinkResolver::resolve_field_access(result, constants, field_access.index(), Bytecodes::java_code(code), CHECK); |
833 patch_field_offset = result.field_offset(); |
833 patch_field_offset = result.offset(); |
834 |
834 |
835 // If we're patching a field which is volatile then at compile it |
835 // If we're patching a field which is volatile then at compile it |
836 // must not have been know to be volatile, so the generated code |
836 // must not have been know to be volatile, so the generated code |
837 // isn't correct for a volatile reference. The nmethod has to be |
837 // isn't correct for a volatile reference. The nmethod has to be |
838 // deoptimized so that the code can be regenerated correctly. |
838 // deoptimized so that the code can be regenerated correctly. |