changeset 7646:16b5195c5f30

Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 31 Jan 2013 16:28:12 +0100
parents f3fcc94f7120
children 017f9c2bcb6b
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java
diffstat 4 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java	Thu Jan 31 16:10:56 2013 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java	Thu Jan 31 16:28:12 2013 +0100
@@ -82,6 +82,12 @@
     public final int cacheAlignment;
 
     /**
+     * Maximum constant displacement at which a memory access can no longer be an implicit null
+     * check.
+     */
+    public final int implicitNullCheckLimit;
+
+    /**
      * Specifies how {@code long} and {@code double} constants are to be stored in
      * {@linkplain BytecodeFrame frames}. This is useful for VMs such as HotSpot where convention
      * the interpreter uses is that the second local holds the first raw word of the native long or
@@ -91,7 +97,8 @@
      */
     public final boolean debugInfoDoubleWordsInSecondSlot;
 
-    public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int stackBias, int pageSize, int cacheAlignment, boolean inlineObjects, boolean debugInfoDoubleWordsInSecondSlot) {
+    public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int stackBias, int implicitNullCheckLimit, int pageSize, int cacheAlignment, boolean inlineObjects,
+                    boolean debugInfoDoubleWordsInSecondSlot) {
         this.arch = arch;
         this.pageSize = pageSize;
         this.isMP = isMP;
@@ -99,6 +106,7 @@
         this.wordKind = Kind.fromWordSize(wordSize);
         this.stackAlignment = stackAlignment;
         this.stackBias = stackBias;
+        this.implicitNullCheckLimit = implicitNullCheckLimit;
         this.cacheAlignment = cacheAlignment;
         this.inlineObjects = inlineObjects;
         this.debugInfoDoubleWordsInSecondSlot = debugInfoDoubleWordsInSecondSlot;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Jan 31 16:10:56 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Jan 31 16:28:12 2013 +0100
@@ -1056,7 +1056,6 @@
         changeSpillDefinitionPos(interval, defPos);
         if (registerPriority == RegisterPriority.None && interval.spillState().ordinal() <= SpillState.StartInMemory.ordinal()) {
             // detection of method-parameters and roundfp-results
-            // TODO: move this directly to position where use-kind is computed
             interval.setSpillState(SpillState.StartInMemory);
         }
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Thu Jan 31 16:10:56 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Thu Jan 31 16:28:12 2013 +0100
@@ -467,9 +467,9 @@
         ((LIRLowerable) node).generate(this);
     }
 
-    private static boolean canBeNullCheck(LocationNode location) {
+    private boolean canBeNullCheck(LocationNode location) {
         // TODO: Make this part of TargetDescription
-        return !(location instanceof IndexedLocationNode) && location.displacement() < 4096;
+        return !(location instanceof IndexedLocationNode) && location.displacement() < this.target().implicitNullCheckLimit;
     }
 
     protected CallingConvention createCallingConvention() {
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java	Thu Jan 31 16:10:56 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java	Thu Jan 31 16:28:12 2013 +0100
@@ -49,7 +49,7 @@
     protected TargetDescription createTarget() {
         final int wordSize = 8;
         final int stackFrameAlignment = 16;
-        return new TargetDescription(new AMD64(), true, stackFrameAlignment, 0, config.vmPageSize, wordSize, true, true);
+        return new TargetDescription(new AMD64(), true, stackFrameAlignment, 0, 4096, config.vmPageSize, wordSize, true, true);
     }
 
     @Override