< prev index next >

src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp

Print this page




 392   }
 393 
 394   int offset = code_offset();
 395   AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
 396   __ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp
 397   __ delayed()->nop();
 398   guarantee(code_offset() - offset <= deopt_handler_size(), "overflow");
 399   __ end_a_stub();
 400 
 401   return offset;
 402 }
 403 
 404 
 405 void LIR_Assembler::jobject2reg(jobject o, Register reg) {
 406   if (o == NULL) {
 407     __ set(NULL_WORD, reg);
 408   } else {
 409 #ifdef ASSERT
 410     {
 411       ThreadInVMfromNative tiv(JavaThread::current());
 412       assert(Universe::heap()->is_in(JNIHandles::resolve(o)), "should be real oop");
 413     }
 414 #endif
 415     int oop_index = __ oop_recorder()->find_index(o);
 416     RelocationHolder rspec = oop_Relocation::spec(oop_index);
 417     __ set(NULL_WORD, reg, rspec); // Will be set when the nmethod is created
 418   }
 419 }
 420 
 421 
 422 void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info) {
 423   // Allocate a new index in table to hold the object once it's been patched
 424   int oop_index = __ oop_recorder()->allocate_oop_index(NULL);
 425   PatchingStub* patch = new PatchingStub(_masm, patching_id(info), oop_index);
 426 
 427   AddressLiteral addrlit(NULL, oop_Relocation::spec(oop_index));
 428   assert(addrlit.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
 429   // It may not seem necessary to use a sethi/add pair to load a NULL into dest, but the
 430   // NULL will be dynamically patched later and the patched value may be large.  We must
 431   // therefore generate the sethi/add as a placeholders
 432   __ patchable_set(addrlit, reg);




 392   }
 393 
 394   int offset = code_offset();
 395   AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
 396   __ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp
 397   __ delayed()->nop();
 398   guarantee(code_offset() - offset <= deopt_handler_size(), "overflow");
 399   __ end_a_stub();
 400 
 401   return offset;
 402 }
 403 
 404 
 405 void LIR_Assembler::jobject2reg(jobject o, Register reg) {
 406   if (o == NULL) {
 407     __ set(NULL_WORD, reg);
 408   } else {
 409 #ifdef ASSERT
 410     {
 411       ThreadInVMfromNative tiv(JavaThread::current());
 412       assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(o)), "should be real oop");
 413     }
 414 #endif
 415     int oop_index = __ oop_recorder()->find_index(o);
 416     RelocationHolder rspec = oop_Relocation::spec(oop_index);
 417     __ set(NULL_WORD, reg, rspec); // Will be set when the nmethod is created
 418   }
 419 }
 420 
 421 
 422 void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info) {
 423   // Allocate a new index in table to hold the object once it's been patched
 424   int oop_index = __ oop_recorder()->allocate_oop_index(NULL);
 425   PatchingStub* patch = new PatchingStub(_masm, patching_id(info), oop_index);
 426 
 427   AddressLiteral addrlit(NULL, oop_Relocation::spec(oop_index));
 428   assert(addrlit.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
 429   // It may not seem necessary to use a sethi/add pair to load a NULL into dest, but the
 430   // NULL will be dynamically patched later and the patched value may be large.  We must
 431   // therefore generate the sethi/add as a placeholders
 432   __ patchable_set(addrlit, reg);


< prev index next >