changeset 22628:2e71226319da

added CodeCacheProvider.getMaxCallTargetOffset and made CompilerToVM.getMaxCallTargetOffset package-private
author Doug Simon <doug.simon@oracle.com>
date Tue, 29 Sep 2015 16:37:09 +0200
parents b6b46b741102
children f53dfbf08c71
files jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/CodeCacheProvider.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/CodeCacheProvider.java	Tue Sep 29 15:55:37 2015 +0200
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/CodeCacheProvider.java	Tue Sep 29 16:37:09 2015 +0200
@@ -136,4 +136,11 @@
      * Create a new speculation log for the target runtime.
      */
     SpeculationLog createSpeculationLog();
+
+    /**
+     * Returns the maximum absolute offset of a PC relative call to a given address from any
+     * position in the code cache or -1 when not applicable. Intended for determining the required
+     * size of address/offset fields.
+     */
+    long getMaxCallTargetOffset(long address);
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java	Tue Sep 29 15:55:37 2015 +0200
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java	Tue Sep 29 16:37:09 2015 +0200
@@ -391,7 +391,7 @@
      * @param address an address that may be called from any code in the code cache
      * @return -1 if {@code address == 0}
      */
-    public long getMaxCallTargetOffset(long address) {
+    long getMaxCallTargetOffset(long address) {
         return getMaxCallTargetOffsetImpl(address);
     }
 
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java	Tue Sep 29 15:55:37 2015 +0200
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java	Tue Sep 29 16:37:09 2015 +0200
@@ -256,4 +256,8 @@
     public SpeculationLog createSpeculationLog() {
         return new HotSpotSpeculationLog();
     }
+
+    public long getMaxCallTargetOffset(long address) {
+        return runtime.getCompilerToVM().getMaxCallTargetOffset(address);
+    }
 }