src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp
changeset 48487 abf1d797e380
parent 48127 efc459cf351e
child 49845 c508fda31759
equal deleted inserted replaced
48486:bda5211e7876 48487:abf1d797e380
   365 
   365 
   366 void NativeCallTrampolineStub::set_destination(address new_destination) {
   366 void NativeCallTrampolineStub::set_destination(address new_destination) {
   367   set_ptr_at(data_offset, new_destination);
   367   set_ptr_at(data_offset, new_destination);
   368   OrderAccess::release();
   368   OrderAccess::release();
   369 }
   369 }
       
   370 
       
   371 // Generate a trampoline for a branch to dest.  If there's no need for a
       
   372 // trampoline, simply patch the call directly to dest.
       
   373 address NativeCall::trampoline_jump(CodeBuffer &cbuf, address dest) {
       
   374   MacroAssembler a(&cbuf);
       
   375   address stub = NULL;
       
   376 
       
   377   if (a.far_branches()
       
   378       && ! is_NativeCallTrampolineStub_at(instruction_address() + displacement())) {
       
   379     stub = a.emit_trampoline_stub(instruction_address() - cbuf.insts()->start(), dest);
       
   380   }
       
   381 
       
   382   if (stub == NULL) {
       
   383     // If we generated no stub, patch this call directly to dest.
       
   384     // This will happen if we don't need far branches or if there
       
   385     // already was a trampoline.
       
   386     set_destination(dest);
       
   387   }
       
   388 
       
   389   return stub;
       
   390 }