changeset 13253:4d1cd29cceb0

make SPARC run again
author twisti
date Thu, 05 Dec 2013 11:57:11 -0800
parents 5d2bc83e9d22
children 42aaf7306707
files graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCodeCacheProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java	Thu Dec 05 15:55:19 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java	Thu Dec 05 11:57:11 2013 -0800
@@ -25,7 +25,6 @@
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.api.runtime.*;
-import com.oracle.graal.graph.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.meta.*;
 import com.oracle.graal.nodes.spi.*;
@@ -71,7 +70,12 @@
 
     @SuppressWarnings("unused")
     private static Value[] createNativeABICallerSaveRegisters(HotSpotVMConfig config, RegisterConfig regConfig) {
-        throw GraalInternalError.unimplemented();
+        CalleeSaveLayout csl = regConfig.getCalleeSaveLayout();
+        Value[] nativeABICallerSaveRegisters = new Value[csl.registers.length];
+        for (int i = 0; i < csl.registers.length; i++) {
+            nativeABICallerSaveRegisters[i] = csl.registers[i].asValue();
+        }
+        return nativeABICallerSaveRegisters;
     }
 
     public String getArchitecture() {
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCodeCacheProvider.java	Thu Dec 05 15:55:19 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCodeCacheProvider.java	Thu Dec 05 11:57:11 2013 -0800
@@ -23,7 +23,6 @@
 package com.oracle.graal.hotspot.sparc;
 
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.graph.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.meta.*;
 
@@ -35,7 +34,6 @@
 
     @Override
     protected RegisterConfig createRegisterConfig() {
-        throw GraalInternalError.unimplemented();
+        return new SPARCHotSpotRegisterConfig(getTarget().arch, runtime.getConfig());
     }
-
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Thu Dec 05 15:55:19 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Thu Dec 05 11:57:11 2013 -0800
@@ -255,9 +255,11 @@
         String arch = System.getProperty("os.arch");
         switch (arch) {
             case "x86_64":
-                // This is what Mac OS X reports;
                 arch = "amd64";
                 break;
+            case "sparcv9":
+                arch = "sparc";
+                break;
         }
         return arch;
     }