301 // Don't return NULL or badAddress, since branches shouldn't overflow. |
301 // Don't return NULL or badAddress, since branches shouldn't overflow. |
302 // Don't return base either because that could overflow displacements |
302 // Don't return base either because that could overflow displacements |
303 // for shorter branches. It will get checked when bound. |
303 // for shorter branches. It will get checked when bound. |
304 return branch_pc; |
304 return branch_pc; |
305 } |
305 } |
|
306 } |
|
307 |
|
308 void CodeSection::relocate(address at, relocInfo::relocType rtype, int format, jint method_index) { |
|
309 RelocationHolder rh; |
|
310 switch (rtype) { |
|
311 case relocInfo::none: return; |
|
312 case relocInfo::opt_virtual_call_type: { |
|
313 rh = opt_virtual_call_Relocation::spec(method_index); |
|
314 break; |
|
315 } |
|
316 case relocInfo::static_call_type: { |
|
317 rh = static_call_Relocation::spec(method_index); |
|
318 break; |
|
319 } |
|
320 case relocInfo::virtual_call_type: { |
|
321 assert(method_index == 0, "resolved method overriding is not supported"); |
|
322 rh = Relocation::spec_simple(rtype); |
|
323 break; |
|
324 } |
|
325 default: { |
|
326 rh = Relocation::spec_simple(rtype); |
|
327 break; |
|
328 } |
|
329 } |
|
330 relocate(at, rh, format); |
306 } |
331 } |
307 |
332 |
308 void CodeSection::relocate(address at, RelocationHolder const& spec, int format) { |
333 void CodeSection::relocate(address at, RelocationHolder const& spec, int format) { |
309 Relocation* reloc = spec.reloc(); |
334 Relocation* reloc = spec.reloc(); |
310 relocInfo::relocType rtype = (relocInfo::relocType) reloc->type(); |
335 relocInfo::relocType rtype = (relocInfo::relocType) reloc->type(); |