changeset 7645:f3fcc94f7120

Clean up and remove TODO.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 31 Jan 2013 16:10:56 +0100
parents 64f41765b3d2
children 16b5195c5f30
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java
diffstat 4 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java	Thu Jan 31 15:56:27 2013 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java	Thu Jan 31 16:10:56 2013 +0100
@@ -237,7 +237,6 @@
      *         otherwise
      */
     public boolean recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) {
-        // TODO (thomaswue): Record that assumption correctly.
         assert useOptimisticAssumptions;
         return false;
     }
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java	Thu Jan 31 15:56:27 2013 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java	Thu Jan 31 16:10:56 2013 +0100
@@ -91,18 +91,14 @@
      */
     public final boolean debugInfoDoubleWordsInSecondSlot;
 
-    public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int pageSize, int cacheAlignment, boolean inlineObjects, boolean debugInfoDoubleWordsInSecondSlot) {
+    public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int stackBias, int pageSize, int cacheAlignment, boolean inlineObjects, boolean debugInfoDoubleWordsInSecondSlot) {
         this.arch = arch;
         this.pageSize = pageSize;
         this.isMP = isMP;
         this.wordSize = arch.getWordSize();
-        if (wordSize == 8) {
-            this.wordKind = Kind.Long;
-        } else {
-            this.wordKind = Kind.Int;
-        }
+        this.wordKind = Kind.fromWordSize(wordSize);
         this.stackAlignment = stackAlignment;
-        this.stackBias = 0; // TODO: configure with param once SPARC port exists
+        this.stackBias = stackBias;
         this.cacheAlignment = cacheAlignment;
         this.inlineObjects = inlineObjects;
         this.debugInfoDoubleWordsInSecondSlot = debugInfoDoubleWordsInSecondSlot;
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Thu Jan 31 15:56:27 2013 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Thu Jan 31 16:10:56 2013 +0100
@@ -135,6 +135,21 @@
     }
 
     /**
+     * Returns the kind of a word given the size of a word in bytes.
+     * 
+     * @param wordSizeInBytes the size of a word in bytes
+     * @return the kind representing a word value
+     */
+    public static Kind fromWordSize(int wordSizeInBytes) {
+        if (wordSizeInBytes == 8) {
+            return Kind.Long;
+        } else {
+            assert wordSizeInBytes == 4 : "Unsupported word size!";
+            return Kind.Int;
+        }
+    }
+
+    /**
      * Returns the kind from the character describing a primitive or void.
      * 
      * @param ch the character
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java	Thu Jan 31 15:56:27 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java	Thu Jan 31 16:10:56 2013 +0100
@@ -49,7 +49,7 @@
     protected TargetDescription createTarget() {
         final int wordSize = 8;
         final int stackFrameAlignment = 16;
-        return new TargetDescription(new AMD64(), true, stackFrameAlignment, config.vmPageSize, wordSize, true, true);
+        return new TargetDescription(new AMD64(), true, stackFrameAlignment, 0, config.vmPageSize, wordSize, true, true);
     }
 
     @Override