85 address a1 = MacroAssembler::get_target_addr_pcrel(orig_addr+MacroAssembler::nop_size());
86 #ifdef ASSERT
87 address a2 = MacroAssembler::get_target_addr_pcrel(inst_addr+MacroAssembler::nop_size());
88 address a3 = nativeFarCall_at(orig_addr)->destination();
89 address a4 = nativeFarCall_at(inst_addr)->destination();
90 if ((a1 != a3) || (a2 != a4)) {
91 unsigned int range = 128;
92 Assembler::dump_code_range(tty, inst_addr, range, "pc-relative call w/o ShortenBranches?");
93 Assembler::dump_code_range(tty, orig_addr, range, "pc-relative call w/o ShortenBranches?");
94 assert(false, "pc-relative call w/o ShortenBranches?");
95 }
96 #endif
97 return a1;
98 }
99 return (address)(-1);
100 }
101 NativeFarCall* call;
102 if (orig_addr == NULL) {
103 call = nativeFarCall_at(inst_addr);
104 } else {
105 if (MacroAssembler::is_call_far_patchable_pcrelative_at(inst_addr)) {
106 call = nativeFarCall_at(orig_addr);
107 } else {
108 call = nativeFarCall_at(orig_addr); // must access location (in CP) where destination is stored in unmoved code, because load from CP is pc-relative
109 }
110 }
111 return call->destination();
112 }
113
114 if (NativeCall::is_call_at(inst_addr)) {
115 NativeCall* call = nativeCall_at(inst_addr);
116 if (call->is_pcrelative()) {
117 intptr_t off = inst_addr - orig_addr;
118 return (address) (call->destination()-off);
119 }
120 }
121
122 return (address) nativeMovConstReg_at(inst_addr)->data();
123 }
124
125 void Relocation::pd_set_call_destination(address x) {
126 address inst_addr = addr();
127
128 if (NativeFarCall::is_far_call_at(inst_addr)) {
129 if (!ShortenBranches) {
|
85 address a1 = MacroAssembler::get_target_addr_pcrel(orig_addr+MacroAssembler::nop_size());
86 #ifdef ASSERT
87 address a2 = MacroAssembler::get_target_addr_pcrel(inst_addr+MacroAssembler::nop_size());
88 address a3 = nativeFarCall_at(orig_addr)->destination();
89 address a4 = nativeFarCall_at(inst_addr)->destination();
90 if ((a1 != a3) || (a2 != a4)) {
91 unsigned int range = 128;
92 Assembler::dump_code_range(tty, inst_addr, range, "pc-relative call w/o ShortenBranches?");
93 Assembler::dump_code_range(tty, orig_addr, range, "pc-relative call w/o ShortenBranches?");
94 assert(false, "pc-relative call w/o ShortenBranches?");
95 }
96 #endif
97 return a1;
98 }
99 return (address)(-1);
100 }
101 NativeFarCall* call;
102 if (orig_addr == NULL) {
103 call = nativeFarCall_at(inst_addr);
104 } else {
105 // must access location (in CP) where destination is stored in unmoved code, because load from CP is pc-relative
106 call = nativeFarCall_at(orig_addr);
107 }
108 return call->destination();
109 }
110
111 if (NativeCall::is_call_at(inst_addr)) {
112 NativeCall* call = nativeCall_at(inst_addr);
113 if (call->is_pcrelative()) {
114 intptr_t off = inst_addr - orig_addr;
115 return (address) (call->destination()-off);
116 }
117 }
118
119 return (address) nativeMovConstReg_at(inst_addr)->data();
120 }
121
122 void Relocation::pd_set_call_destination(address x) {
123 address inst_addr = addr();
124
125 if (NativeFarCall::is_far_call_at(inst_addr)) {
126 if (!ShortenBranches) {
|