8204341: AArch64: AOT runtime does not need a workaround for far calls
authoraph
Tue, 05 Jun 2018 16:12:57 +0100
changeset 50411 0191ac1da300
parent 50401 bf7eb61349d2
child 50412 3d658c910e83
8204341: AArch64: AOT runtime does not need a workaround for far calls Reviewed-by: kvn
src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Tue Jun 05 09:15:03 2018 -0400
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Tue Jun 05 16:12:57 2018 +0100
@@ -1020,7 +1020,7 @@
   address trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
 
   static bool far_branches() {
-    return ReservedCodeCacheSize > branch_range;
+    return ReservedCodeCacheSize > branch_range || UseAOT;
   }
 
   // Jumps that can reach anywhere in the code cache.
--- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp	Tue Jun 05 09:15:03 2018 -0400
+++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp	Tue Jun 05 16:12:57 2018 +0100
@@ -234,8 +234,12 @@
   }
 
 #if INCLUDE_AOT
+  // Return true iff a call from instr to target is out of range.
+  // Used for calls from JIT- to AOT-compiled code.
   static bool is_far_call(address instr, address target) {
-    return !Assembler::reachable_from_branch_at(instr, target);
+    // On AArch64 we use trampolines which can reach anywhere in the
+    // address space, so calls are never out of range.
+    return false;
   }
 #endif