775 void LinkResolver::resolve_field(fieldDescriptor& fd, KlassHandle resolved_klass, Symbol* field, Symbol* sig, |
775 void LinkResolver::resolve_field(fieldDescriptor& fd, KlassHandle resolved_klass, Symbol* field, Symbol* sig, |
776 KlassHandle current_klass, Bytecodes::Code byte, bool check_access, bool initialize_class, |
776 KlassHandle current_klass, Bytecodes::Code byte, bool check_access, bool initialize_class, |
777 TRAPS) { |
777 TRAPS) { |
778 assert(byte == Bytecodes::_getstatic || byte == Bytecodes::_putstatic || |
778 assert(byte == Bytecodes::_getstatic || byte == Bytecodes::_putstatic || |
779 byte == Bytecodes::_getfield || byte == Bytecodes::_putfield || |
779 byte == Bytecodes::_getfield || byte == Bytecodes::_putfield || |
|
780 byte == Bytecodes::_nofast_getfield || byte == Bytecodes::_nofast_putfield || |
780 (byte == Bytecodes::_nop && !check_access), "bad field access bytecode"); |
781 (byte == Bytecodes::_nop && !check_access), "bad field access bytecode"); |
781 |
782 |
782 bool is_static = (byte == Bytecodes::_getstatic || byte == Bytecodes::_putstatic); |
783 bool is_static = (byte == Bytecodes::_getstatic || byte == Bytecodes::_putstatic); |
783 bool is_put = (byte == Bytecodes::_putfield || byte == Bytecodes::_putstatic); |
784 bool is_put = (byte == Bytecodes::_putfield || byte == Bytecodes::_putstatic || byte == Bytecodes::_nofast_putfield); |
784 |
|
785 // Check if there's a resolved klass containing the field |
785 // Check if there's a resolved klass containing the field |
786 if (resolved_klass.is_null()) { |
786 if (resolved_klass.is_null()) { |
787 ResourceMark rm(THREAD); |
787 ResourceMark rm(THREAD); |
788 THROW_MSG(vmSymbols::java_lang_NoSuchFieldError(), field->as_C_string()); |
788 THROW_MSG(vmSymbols::java_lang_NoSuchFieldError(), field->as_C_string()); |
789 } |
789 } |