< prev index next >

src/cpu/x86/vm/x86.ad

Print this page




 533     // a call be deoptimization.  (4932387)
 534     // Note that this value is also credited (in output.cpp) to
 535     // the size of the code section.
 536     return 5 + NativeJump::instruction_size; // pushl(); jmp;
 537   }
 538 #endif
 539 };
 540 
 541 %} // end source_hpp
 542 
 543 source %{
 544 
 545 // Emit exception handler code.
 546 // Stuff framesize into a register and call a VM stub routine.
 547 int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
 548 
 549   // Note that the code buffer's insts_mark is always relative to insts.
 550   // That's why we must use the macroassembler to generate a handler.
 551   MacroAssembler _masm(&cbuf);
 552   address base = __ start_a_stub(size_exception_handler());
 553   if (base == NULL)  return 0;  // CodeBuffer::expand failed



 554   int offset = __ offset();
 555   __ jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
 556   assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
 557   __ end_a_stub();
 558   return offset;
 559 }
 560 
 561 // Emit deopt handler code.
 562 int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
 563 
 564   // Note that the code buffer's insts_mark is always relative to insts.
 565   // That's why we must use the macroassembler to generate a handler.
 566   MacroAssembler _masm(&cbuf);
 567   address base = __ start_a_stub(size_deopt_handler());
 568   if (base == NULL)  return 0;  // CodeBuffer::expand failed



 569   int offset = __ offset();
 570 
 571 #ifdef _LP64
 572   address the_pc = (address) __ pc();
 573   Label next;
 574   // push a "the_pc" on the stack without destroying any registers
 575   // as they all may be live.
 576 
 577   // push address of "next"
 578   __ call(next, relocInfo::none); // reloc none is fine since it is a disp32
 579   __ bind(next);
 580   // adjust it so it matches "the_pc"
 581   __ subptr(Address(rsp, 0), __ offset() - offset);
 582 #else
 583   InternalAddress here(__ pc());
 584   __ pushptr(here.addr());
 585 #endif
 586 
 587   __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
 588   assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow");




 533     // a call be deoptimization.  (4932387)
 534     // Note that this value is also credited (in output.cpp) to
 535     // the size of the code section.
 536     return 5 + NativeJump::instruction_size; // pushl(); jmp;
 537   }
 538 #endif
 539 };
 540 
 541 %} // end source_hpp
 542 
 543 source %{
 544 
 545 // Emit exception handler code.
 546 // Stuff framesize into a register and call a VM stub routine.
 547 int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
 548 
 549   // Note that the code buffer's insts_mark is always relative to insts.
 550   // That's why we must use the macroassembler to generate a handler.
 551   MacroAssembler _masm(&cbuf);
 552   address base = __ start_a_stub(size_exception_handler());
 553   if (base == NULL) {
 554     ciEnv::current()->record_failure("CodeCache is full");
 555     return 0;  // CodeBuffer::expand failed
 556   }
 557   int offset = __ offset();
 558   __ jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
 559   assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
 560   __ end_a_stub();
 561   return offset;
 562 }
 563 
 564 // Emit deopt handler code.
 565 int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
 566 
 567   // Note that the code buffer's insts_mark is always relative to insts.
 568   // That's why we must use the macroassembler to generate a handler.
 569   MacroAssembler _masm(&cbuf);
 570   address base = __ start_a_stub(size_deopt_handler());
 571   if (base == NULL) {
 572     ciEnv::current()->record_failure("CodeCache is full");
 573     return 0;  // CodeBuffer::expand failed
 574   }
 575   int offset = __ offset();
 576 
 577 #ifdef _LP64
 578   address the_pc = (address) __ pc();
 579   Label next;
 580   // push a "the_pc" on the stack without destroying any registers
 581   // as they all may be live.
 582 
 583   // push address of "next"
 584   __ call(next, relocInfo::none); // reloc none is fine since it is a disp32
 585   __ bind(next);
 586   // adjust it so it matches "the_pc"
 587   __ subptr(Address(rsp, 0), __ offset() - offset);
 588 #else
 589   InternalAddress here(__ pc());
 590   __ pushptr(here.addr());
 591 #endif
 592 
 593   __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
 594   assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow");


< prev index next >