1024 if (do_patch) { |
1024 if (do_patch) { |
1025 // replace instructions |
1025 // replace instructions |
1026 // first replace the tail, then the call |
1026 // first replace the tail, then the call |
1027 #ifdef ARM |
1027 #ifdef ARM |
1028 if(stub_id == Runtime1::load_klass_patching_id && !VM_Version::supports_movw()) { |
1028 if(stub_id == Runtime1::load_klass_patching_id && !VM_Version::supports_movw()) { |
|
1029 nmethod* nm = CodeCache::find_nmethod(instr_pc); |
|
1030 oop* oop_addr = NULL; |
|
1031 assert(nm != NULL, "invalid nmethod_pc"); |
|
1032 RelocIterator oops(nm, copy_buff, copy_buff + 1); |
|
1033 while (oops.next()) { |
|
1034 if (oops.type() == relocInfo::oop_type) { |
|
1035 oop_Relocation* r = oops.oop_reloc(); |
|
1036 oop_addr = r->oop_addr(); |
|
1037 break; |
|
1038 } |
|
1039 } |
|
1040 assert(oop_addr != NULL, "oop relocation must exist"); |
1029 copy_buff -= *byte_count; |
1041 copy_buff -= *byte_count; |
1030 NativeMovConstReg* n_copy2 = nativeMovConstReg_at(copy_buff); |
1042 NativeMovConstReg* n_copy2 = nativeMovConstReg_at(copy_buff); |
1031 n_copy2->set_data((intx) (load_klass()), instr_pc); |
1043 n_copy2->set_pc_relative_offset((address)oop_addr, instr_pc); |
1032 } |
1044 } |
1033 #endif |
1045 #endif |
1034 |
1046 |
1035 for (int i = NativeCall::instruction_size; i < *byte_count; i++) { |
1047 for (int i = NativeCall::instruction_size; i < *byte_count; i++) { |
1036 address ptr = copy_buff + i; |
1048 address ptr = copy_buff + i; |