1068 r->fix_oop_relocation();
1069 found = true;
1070 } else if (mds.type() == relocInfo::metadata_type) {
1071 assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id");
1072 metadata_Relocation* r = mds.metadata_reloc();
1073 Metadata** metadata_adr = r->metadata_addr();
1074 *metadata_adr = load_klass();
1075 r->fix_metadata_relocation();
1076 found = true;
1077 }
1078 }
1079 assert(found, "the metadata must exist!");
1080 }
1081 #endif
1082 if (do_patch) {
1083 // replace instructions
1084 // first replace the tail, then the call
1085 #ifdef ARM
1086 if((load_klass_or_mirror_patch_id ||
1087 stub_id == Runtime1::load_appendix_patching_id) &&
1088 !VM_Version::supports_movw()) {
1089 nmethod* nm = CodeCache::find_nmethod(instr_pc);
1090 address addr = NULL;
1091 assert(nm != NULL, "invalid nmethod_pc");
1092 RelocIterator mds(nm, copy_buff, copy_buff + 1);
1093 while (mds.next()) {
1094 if (mds.type() == relocInfo::oop_type) {
1095 assert(stub_id == Runtime1::load_mirror_patching_id ||
1096 stub_id == Runtime1::load_appendix_patching_id, "wrong stub id");
1097 oop_Relocation* r = mds.oop_reloc();
1098 addr = (address)r->oop_addr();
1099 break;
1100 } else if (mds.type() == relocInfo::metadata_type) {
1101 assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id");
1102 metadata_Relocation* r = mds.metadata_reloc();
1103 addr = (address)r->metadata_addr();
1104 break;
1105 }
1106 }
1107 assert(addr != NULL, "metadata relocation must exist");
1108 copy_buff -= *byte_count;
|
1068 r->fix_oop_relocation();
1069 found = true;
1070 } else if (mds.type() == relocInfo::metadata_type) {
1071 assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id");
1072 metadata_Relocation* r = mds.metadata_reloc();
1073 Metadata** metadata_adr = r->metadata_addr();
1074 *metadata_adr = load_klass();
1075 r->fix_metadata_relocation();
1076 found = true;
1077 }
1078 }
1079 assert(found, "the metadata must exist!");
1080 }
1081 #endif
1082 if (do_patch) {
1083 // replace instructions
1084 // first replace the tail, then the call
1085 #ifdef ARM
1086 if((load_klass_or_mirror_patch_id ||
1087 stub_id == Runtime1::load_appendix_patching_id) &&
1088 nativeMovConstReg_at(copy_buff)->is_pc_relative()) {
1089 nmethod* nm = CodeCache::find_nmethod(instr_pc);
1090 address addr = NULL;
1091 assert(nm != NULL, "invalid nmethod_pc");
1092 RelocIterator mds(nm, copy_buff, copy_buff + 1);
1093 while (mds.next()) {
1094 if (mds.type() == relocInfo::oop_type) {
1095 assert(stub_id == Runtime1::load_mirror_patching_id ||
1096 stub_id == Runtime1::load_appendix_patching_id, "wrong stub id");
1097 oop_Relocation* r = mds.oop_reloc();
1098 addr = (address)r->oop_addr();
1099 break;
1100 } else if (mds.type() == relocInfo::metadata_type) {
1101 assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id");
1102 metadata_Relocation* r = mds.metadata_reloc();
1103 addr = (address)r->metadata_addr();
1104 break;
1105 }
1106 }
1107 assert(addr != NULL, "metadata relocation must exist");
1108 copy_buff -= *byte_count;
|