src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp

Print this page
rev 5100 : 7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
Summary: Do patching rather bailing out for unlinked call with appendix
Reviewed-by: twisti, kvn


 503 
 504   return offset;
 505 }
 506 
 507 
 508 void LIR_Assembler::jobject2reg(jobject o, Register reg) {
 509   if (o == NULL) {
 510     __ set(NULL_WORD, reg);
 511   } else {
 512     int oop_index = __ oop_recorder()->find_index(o);
 513     assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(o)), "should be real oop");
 514     RelocationHolder rspec = oop_Relocation::spec(oop_index);
 515     __ set(NULL_WORD, reg, rspec); // Will be set when the nmethod is created
 516   }
 517 }
 518 
 519 
 520 void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info) {
 521   // Allocate a new index in table to hold the object once it's been patched
 522   int oop_index = __ oop_recorder()->allocate_oop_index(NULL);
 523   PatchingStub* patch = new PatchingStub(_masm, PatchingStub::load_mirror_id, oop_index);
 524 
 525   AddressLiteral addrlit(NULL, oop_Relocation::spec(oop_index));
 526   assert(addrlit.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
 527   // It may not seem necessary to use a sethi/add pair to load a NULL into dest, but the
 528   // NULL will be dynamically patched later and the patched value may be large.  We must
 529   // therefore generate the sethi/add as a placeholders
 530   __ patchable_set(addrlit, reg);
 531 
 532   patching_epilog(patch, lir_patch_normal, reg, info);
 533 }
 534 
 535 
 536 void LIR_Assembler::metadata2reg(Metadata* o, Register reg) {
 537   __ set_metadata_constant(o, reg);
 538 }
 539 
 540 void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo *info) {
 541   // Allocate a new index in table to hold the klass once it's been patched
 542   int index = __ oop_recorder()->allocate_metadata_index(NULL);
 543   PatchingStub* patch = new PatchingStub(_masm, PatchingStub::load_klass_id, index);




 503 
 504   return offset;
 505 }
 506 
 507 
 508 void LIR_Assembler::jobject2reg(jobject o, Register reg) {
 509   if (o == NULL) {
 510     __ set(NULL_WORD, reg);
 511   } else {
 512     int oop_index = __ oop_recorder()->find_index(o);
 513     assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(o)), "should be real oop");
 514     RelocationHolder rspec = oop_Relocation::spec(oop_index);
 515     __ set(NULL_WORD, reg, rspec); // Will be set when the nmethod is created
 516   }
 517 }
 518 
 519 
 520 void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info) {
 521   // Allocate a new index in table to hold the object once it's been patched
 522   int oop_index = __ oop_recorder()->allocate_oop_index(NULL);
 523   PatchingStub* patch = new PatchingStub(_masm, patching_id(info), oop_index);
 524 
 525   AddressLiteral addrlit(NULL, oop_Relocation::spec(oop_index));
 526   assert(addrlit.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
 527   // It may not seem necessary to use a sethi/add pair to load a NULL into dest, but the
 528   // NULL will be dynamically patched later and the patched value may be large.  We must
 529   // therefore generate the sethi/add as a placeholders
 530   __ patchable_set(addrlit, reg);
 531 
 532   patching_epilog(patch, lir_patch_normal, reg, info);
 533 }
 534 
 535 
 536 void LIR_Assembler::metadata2reg(Metadata* o, Register reg) {
 537   __ set_metadata_constant(o, reg);
 538 }
 539 
 540 void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo *info) {
 541   // Allocate a new index in table to hold the klass once it's been patched
 542   int index = __ oop_recorder()->allocate_metadata_index(NULL);
 543   PatchingStub* patch = new PatchingStub(_masm, PatchingStub::load_klass_id, index);


src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File