< prev index next >

src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp

Print this page
@@ -64,11 +64,11 @@
    return base;
  }
  #undef __
  
  int CompiledDirectCall::to_interp_stub_size() {
-   return MacroAssembler::static_call_stub_size();
+   return MacroAssembler::max_static_call_stub_size();
  }
  
  int CompiledDirectCall::to_trampoline_stub_size() {
    // Somewhat pessimistically, we count 3 instructions here (although
    // there are only two) because we sometimes emit an alignment nop.

@@ -87,20 +87,25 @@
  
    // Creation also verifies the object.
    NativeMovConstReg* method_holder
      = nativeMovConstReg_at(stub + NativeInstruction::instruction_size);
  
+   // In AOT "production" run we have mixture of AOTed and normal JITed code.
+   // Static call stub in AOTed nmethod always has far jump.
+   // Normal JITed nmethod may have short or far jump depending on distance.
+   // Determine actual jump instruction we have in code.
+   address next_instr = method_holder->next_instruction_address();
+   bool is_general_jump = nativeInstruction_at(next_instr)->is_general_jump();
+ 
  #ifdef ASSERT
-   NativeJump* jump = MacroAssembler::codestub_branch_needs_far_jump()
-                          ? nativeGeneralJump_at(method_holder->next_instruction_address())
-                          : nativeJump_at(method_holder->next_instruction_address());
+   NativeJump* jump = is_general_jump ? nativeGeneralJump_at(next_instr) : nativeJump_at(next_instr);
    verify_mt_safe(callee, entry, method_holder, jump);
  #endif
  
    // Update stub.
    method_holder->set_data((intptr_t)callee());
-   MacroAssembler::pd_patch_instruction(method_holder->next_instruction_address(), entry);
+   MacroAssembler::pd_patch_instruction(next_instr, entry);
    ICache::invalidate_range(stub, to_interp_stub_size());
    // Update jump to call.
    set_destination_mt_safe(stub);
  }
  
< prev index next >