< prev index next >

src/share/vm/asm/codeBuffer.cpp

Print this page
rev 12037 : 8166562: C2: Suppress relocations in scratch emit.


 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);
 331 }
 332 
 333 void CodeSection::relocate(address at, RelocationHolder const& spec, int format) {


 334   Relocation* reloc = spec.reloc();
 335   relocInfo::relocType rtype = (relocInfo::relocType) reloc->type();
 336   if (rtype == relocInfo::none)  return;
 337 
 338   // The assertion below has been adjusted, to also work for
 339   // relocation for fixup.  Sometimes we want to put relocation
 340   // information for the next instruction, since it will be patched
 341   // with a call.
 342   assert(start() <= at && at <= end()+1,
 343          "cannot relocate data outside code boundaries");
 344 
 345   if (!has_locs()) {
 346     // no space for relocation information provided => code cannot be
 347     // relocated.  Make sure that relocate is only called with rtypes
 348     // that can be ignored for this kind of code.
 349     assert(rtype == relocInfo::none              ||
 350            rtype == relocInfo::runtime_call_type ||
 351            rtype == relocInfo::internal_word_type||
 352            rtype == relocInfo::section_word_type ||
 353            rtype == relocInfo::external_word_type,




 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);
 331 }
 332 
 333 void CodeSection::relocate(address at, RelocationHolder const& spec, int format) {
 334   // Do not relocate in scratch buffers.
 335   if (scratch_emit()) { return; }
 336   Relocation* reloc = spec.reloc();
 337   relocInfo::relocType rtype = (relocInfo::relocType) reloc->type();
 338   if (rtype == relocInfo::none)  return;
 339 
 340   // The assertion below has been adjusted, to also work for
 341   // relocation for fixup.  Sometimes we want to put relocation
 342   // information for the next instruction, since it will be patched
 343   // with a call.
 344   assert(start() <= at && at <= end()+1,
 345          "cannot relocate data outside code boundaries");
 346 
 347   if (!has_locs()) {
 348     // no space for relocation information provided => code cannot be
 349     // relocated.  Make sure that relocate is only called with rtypes
 350     // that can be ignored for this kind of code.
 351     assert(rtype == relocInfo::none              ||
 352            rtype == relocInfo::runtime_call_type ||
 353            rtype == relocInfo::internal_word_type||
 354            rtype == relocInfo::section_word_type ||
 355            rtype == relocInfo::external_word_type,


< prev index next >