changeset 13344:e01fe53ec4b7

Merge
author Erik Eckstein <erik.eckstein@oracle.com>
date Fri, 13 Dec 2013 16:12:29 +0100
parents 5dd9670009df (diff) 79ed7180745c (current diff)
children 0393767ae0fc
files
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java	Fri Dec 13 09:36:16 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java	Fri Dec 13 16:12:29 2013 +0100
@@ -40,6 +40,13 @@
 
     private final Register[] allocatable;
 
+    /**
+     * The same as {@link #allocatable}, except if parameter registers are removed with the
+     * {@link #RegisterPressure} option. The caller saved registers always include all parameter
+     * registers.
+     */
+    private final Register[] callerSaved;
+
     private final HashMap<PlatformKind, Register[]> categorized = new HashMap<>();
 
     private final RegisterAttributes[] attributesMap;
@@ -129,12 +136,20 @@
 
         csl = null;
         allocatable = initAllocatable(config.useCompressedOops);
+        Set<Register> callerSaveSet = new HashSet<>();
+        Collections.addAll(callerSaveSet, allocatable);
+        Collections.addAll(callerSaveSet, xmmParameterRegisters);
+        Collections.addAll(callerSaveSet, javaGeneralParameterRegisters);
+        Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters);
+        callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]);
+        assert callerSaved.length == allocatable.length || RegisterPressure.getValue() != null;
+
         attributesMap = RegisterAttributes.createMap(this, AMD64.allRegisters);
     }
 
     @Override
     public Register[] getCallerSaveRegisters() {
-        return getAllocatableRegisters();
+        return callerSaved;
     }
 
     @Override
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Fri Dec 13 09:36:16 2013 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Fri Dec 13 16:12:29 2013 +0100
@@ -217,7 +217,7 @@
             TTY.println(MetaUtil.indent(MetaUtil.profileToString(profilingInfo, method, CodeUtil.NEW_LINE), "  "));
         }
 
-        Indent indent = Debug.logAndIndent(false, "build graph for %s", method.toString());
+        Indent indent = Debug.logAndIndent(false, "build graph for %s", method);
 
         // compute the block map, setup exception handlers and get the entrypoint(s)
         BciBlockMapping blockMap = createBlockMap();