< prev index next >

src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp

Print this page

527 // Generate a trampoline for a branch to dest.  If there's no need for a
528 // trampoline, simply patch the call directly to dest.
529 address NativeCall::trampoline_jump(CodeBuffer &cbuf, address dest) {
530   MacroAssembler a(&cbuf);
531   address stub = NULL;
532 
533   if (a.far_branches()
534       && ! is_NativeCallTrampolineStub_at(instruction_address() + displacement())) {
535     stub = a.emit_trampoline_stub(instruction_address() - cbuf.insts()->start(), dest);
536   }
537 
538   if (stub == NULL) {
539     // If we generated no stub, patch this call directly to dest.
540     // This will happen if we don't need far branches or if there
541     // already was a trampoline.
542     set_destination(dest);
543   }
544 
545   return stub;
546 }



























527 // Generate a trampoline for a branch to dest.  If there's no need for a
528 // trampoline, simply patch the call directly to dest.
529 address NativeCall::trampoline_jump(CodeBuffer &cbuf, address dest) {
530   MacroAssembler a(&cbuf);
531   address stub = NULL;
532 
533   if (a.far_branches()
534       && ! is_NativeCallTrampolineStub_at(instruction_address() + displacement())) {
535     stub = a.emit_trampoline_stub(instruction_address() - cbuf.insts()->start(), dest);
536   }
537 
538   if (stub == NULL) {
539     // If we generated no stub, patch this call directly to dest.
540     // This will happen if we don't need far branches or if there
541     // already was a trampoline.
542     set_destination(dest);
543   }
544 
545   return stub;
546 }
547 
548 void NativePostCallNop::make_deopt() {
549   NativeDeoptInstruction::insert(addr_at(0));
550 }
551 
552 void NativePostCallNop::patch(jint diff) {
553   // unsupported for now
554 }
555 
556 void NativeDeoptInstruction::verify() {
557 }
558 
559 // Inserts an undefined instruction at a given pc
560 void NativeDeoptInstruction::insert(address code_pos) {
561   // 1 1 0 1 | 0 1 0 0 | 1 0 1 imm16 0 0 0 0 1
562   // d       | 4       | a      | de | 0 | 0 |
563   // 0xd4, 0x20, 0x00, 0x00
564   uint32_t insn = 0xd4ade001;
565   uint32_t *pos = (uint32_t *) code_pos;
566   *pos = insn;
567   /**code_pos = 0xd4;
568   *(code_pos+1) = 0x60;
569   *(code_pos+2) = 0x00;
570   *(code_pos+3) = 0x00;*/
571   ICache::invalidate_range(code_pos, 4);
572 }
< prev index next >