changeset 1439:d0c8d3a2a7e8

Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'. Added c1x4hotspotsrc/hotspot/java as indirect launcher for $JRE7/bin/java that can be referenced from Eclipse launch configuration. Copied .checkstyle_checks.xml from C1X project to c1x4hotspotsrc/HotSpotVM so that it can be used by HotSpotVM project without hard coded path to C1X in another Eclipse workspace. Various other changes to reflect changes in CRI and C1X.
author Doug Simon <doug.simon@oracle.com>
date Fri, 29 Oct 2010 18:14:17 +0200
parents a7a0ef3c6858
children 4d1d3bd140f9
files c1x4hotspotsrc/HotSpotTest/src/C1XTest.java c1x4hotspotsrc/HotSpotVM/.checkstyle c1x4hotspotsrc/HotSpotVM/.checkstyle_checks.xml c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodUnresolved.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTarget.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java c1x4hotspotsrc/hotspot/hotspot Default.launch c1x4hotspotsrc/hotspot/hotspot SciMark.launch c1x4hotspotsrc/hotspot/hotspot jtt.launch c1x4hotspotsrc/hotspot/java domake src/share/vm/c1x/c1x_CodeInstaller.cpp
diffstat 18 files changed, 319 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotTest/src/C1XTest.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotTest/src/C1XTest.java	Fri Oct 29 18:14:17 2010 +0200
@@ -1,4 +1,4 @@
-import java.io.IOException;
+import java.io.*;
 
 public class C1XTest {
 
@@ -25,6 +25,18 @@
 		}
 		System.out.println("exit");
 	}
+	
+	public static void main2(String[] args) {
+//		Other.I[] array = new Other.I[] { new Other.A(), new Other.B(),
+//				new Other.C(), new Other.A(), new Other.B(), new Other.C() };
+//
+//		int sum = 0;
+//		for (int i = 0; i < 20; i++)
+//			for (Other.I o : array) {
+//				sum += o.v();
+//			}
+//		System.out.println(sum);
+	}
 
 	public static void main(String[] args) throws IOException, Exception {
 		for (int i = 0; i < 10000; i++) {
--- a/c1x4hotspotsrc/HotSpotVM/.checkstyle	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/.checkstyle	Fri Oct 29 18:14:17 2010 +0200
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
-  <local-check-config name="C1X Checkstyle" location="/home/tw/Projects/maxine/C1X/.checkstyle_checks.xml" type="external" description="">
+  <local-check-config name="C1X Checkstyle checks" location=".checkstyle_checks.xml" type="project" description="">
     <additional-data name="protect-config-file" value="false"/>
   </local-check-config>
-  <fileset name="all" enabled="true" check-config-name="C1X Checkstyle" local="true">
+  <fileset name="all" enabled="true" check-config-name="C1X Checkstyle checks" local="true">
     <file-match-pattern match-pattern="." include-pattern="true"/>
   </fileset>
 </fileset-config>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/c1x4hotspotsrc/HotSpotVM/.checkstyle_checks.xml	Fri Oct 29 18:14:17 2010 +0200
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+    Checkstyle-Configuration: C1X Checkstyle checks
+    Description: none
+-->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+    <property name="severity" value="warning"/>
+    <module name="RegexpHeader">
+        <property name="header" value="\*\n\* Copyright \(c\) 20[0-9][0-9] Sun Microsystems, Inc.  *All rights reserved.\n \*\n \* Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product\n \* that is described in this document. In particular, and without limitation, these intellectual property\n \* rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or\n \* more additional patents or pending patent applications in the U.S. and in other countries.\n *\n \* U.S. Government Rights - Commercial software. Government users are subject to the Sun\n \* Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its\n \* supplements.\n \*\n \* Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or\n \* registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks\n \* are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the\n \* U.S. and other countries.\n \*\n \* UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open\n \* Company, Ltd.\n \*/"/>
+    </module>
+    <module name="FileTabCharacter">
+        <property name="severity" value="error"/>
+    </module>
+    <module name="TreeWalker">
+        <property name="tabWidth" value="4"/>
+        <module name="FileContentsHolder"/>
+        <module name="JavadocStyle">
+            <property name="checkHtml" value="false"/>
+        </module>
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+        <module name="MemberName">
+            <property name="format" value="^(([a-z][a-zA-Z0-9]*$)|(_[A-Z][a-zA-Z0-9]*_[a-z][a-zA-Z0-9]*$))"/>
+        </module>
+        <module name="MethodName">
+            <property name="format" value="^[a-z][a-z_A-Z0-9]*$"/>
+        </module>
+        <module name="PackageName"/>
+        <module name="ParameterName"/>
+        <module name="TypeName">
+            <property name="format" value="^[A-Z][_a-zA-Z0-9]*$"/>
+        </module>
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+        <module name="LineLength">
+            <property name="max" value="250"/>
+        </module>
+        <module name="MethodParamPad"/>
+        <module name="NoWhitespaceAfter">
+            <property name="tokens" value="ARRAY_INIT,BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
+        </module>
+        <module name="NoWhitespaceBefore">
+            <property name="tokens" value="SEMI,DOT,POST_DEC,POST_INC"/>
+        </module>
+        <module name="ParenPad"/>
+        <module name="TypecastParenPad">
+            <property name="tokens" value="RPAREN,TYPECAST"/>
+        </module>
+        <module name="WhitespaceAfter"/>
+        <module name="WhitespaceAround">
+            <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
+        </module>
+        <module name="RedundantModifier"/>
+        <module name="AvoidNestedBlocks">
+            <property name="allowInSwitchCase" value="true"/>
+        </module>
+        <module name="EmptyBlock">
+            <property name="option" value="text"/>
+            <property name="tokens" value="LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_IF,LITERAL_TRY,LITERAL_WHILE,STATIC_INIT"/>
+        </module>
+        <module name="LeftCurly"/>
+        <module name="NeedBraces"/>
+        <module name="RightCurly"/>
+        <module name="DoubleCheckedLocking">
+            <property name="severity" value="error"/>
+        </module>
+        <module name="EmptyStatement"/>
+        <module name="HiddenField">
+            <property name="severity" value="ignore"/>
+            <property name="ignoreConstructorParameter" value="true"/>
+        </module>
+        <module name="FinalClass"/>
+        <module name="HideUtilityClassConstructor">
+            <property name="severity" value="ignore"/>
+        </module>
+        <module name="ArrayTypeStyle"/>
+        <module name="UpperEll"/>
+        <module name="FallThrough"/>
+        <module name="FinalLocalVariable">
+            <property name="severity" value="ignore"/>
+        </module>
+        <module name="MultipleVariableDeclarations"/>
+        <module name="StringLiteralEquality">
+            <property name="severity" value="error"/>
+        </module>
+        <module name="SuperFinalize"/>
+        <module name="UnnecessaryParentheses">
+            <property name="severity" value="ignore"/>
+        </module>
+        <module name="Indentation">
+            <property name="severity" value="ignore"/>
+        </module>
+        <module name="StaticVariableName">
+            <property name="format" value="^[A-Za-z][a-zA-Z0-9]*$"/>
+        </module>
+        <module name="EmptyForInitializerPad"/>
+        <module name="EmptyForIteratorPad"/>
+        <module name="ModifierOrder"/>
+        <module name="DefaultComesLast"/>
+        <module name="InnerAssignment">
+            <property name="severity" value="ignore"/>
+        </module>
+        <module name="JUnitTestCase"/>
+        <module name="ModifiedControlVariable"/>
+        <module name="MutableException"/>
+        <module name="ParameterAssignment">
+            <property name="severity" value="ignore"/>
+        </module>
+        <module name="RegexpSinglelineJava">
+            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for trailing spaces at the end of a line"/>
+            <property name="format" value="\s$"/>
+            <property name="message" value="Illegal trailing whitespace(s) at the end of the line."/>
+            <property name="ignoreComments" value="true"/>
+        </module>
+        <module name="RegexpSinglelineJava">
+            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for whitespace before a comma."/>
+            <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Illegal whitespace before a comma."/>
+            <property name="format" value=" ,"/>
+            <property name="ignoreComments" value="true"/>
+        </module>
+    </module>
+    <module name="NewlineAtEndOfFile"/>
+    <module name="Translation"/>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Allow non-conforming constant names"/>
+        <property name="offCommentFormat" value="Checkstyle: stop constant name check"/>
+        <property name="onCommentFormat" value="Checkstyle: resume constant name check"/>
+        <property name="checkFormat" value="ConstantNameCheck"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable method name checks"/>
+        <property name="offCommentFormat" value="Checkstyle: stop method name check"/>
+        <property name="onCommentFormat" value="Checkstyle: resume method name check"/>
+        <property name="checkFormat" value="MethodName"/>
+        <property name="checkC" value="false"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable Parameter Assignment"/>
+        <property name="offCommentFormat" value="CheckStyle: stop parameter assignment check"/>
+        <property name="onCommentFormat" value="CheckStyle: resume parameter assignment check"/>
+        <property name="checkFormat" value="ParameterAssignment"/>
+        <property name="checkC" value="false"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable final variable checks"/>
+        <property name="offCommentFormat" value="Checkstyle: stop final variable check"/>
+        <property name="onCommentFormat" value="Checkstyle: resume final variable check"/>
+        <property name="checkFormat" value="FinalLocalVariable"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable all checks"/>
+        <property name="offCommentFormat" value="Checkstyle: stop"/>
+        <property name="onCommentFormat" value="Checkstyle: resume"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable all checks for generated raw assembler methods"/>
+        <property name="offCommentFormat" value="// START GENERATED RAW ASSEMBLER METHODS"/>
+        <property name="onCommentFormat" value="// END GENERATED RAW ASSEMBLER METHODS"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable all checks for generated label assembler methods"/>
+        <property name="offCommentFormat" value="// START GENERATED LABEL ASSEMBLER METHODS"/>
+        <property name="onCommentFormat" value="// END GENERATED LABEL ASSEMBLER METHODS"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable inner assignment checks"/>
+        <property name="offCommentFormat" value="CheckStyle: stop inner assignment check"/>
+        <property name="onCommentFormat" value="CheckStyle: resume inner assignment check"/>
+        <property name="checkFormat" value="InnerAssignment"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+        <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable field name checks"/>
+        <property name="offCommentFormat" value="Checkstyle: stop field name check"/>
+        <property name="onCommentFormat" value="Checkstyle: resume field name check"/>
+        <property name="checkFormat" value="MemberName"/>
+        <property name="checkC" value="false"/>
+    </module>
+</module>
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Fri Oct 29 18:14:17 2010 +0200
@@ -20,8 +20,11 @@
  */
 package com.sun.hotspot.c1x;
 
+import static com.sun.c1x.target.amd64.AMD64.*;
+
 import java.lang.reflect.Proxy;
 import java.net.*;
+import java.util.*;
 
 import com.sun.c1x.*;
 import com.sun.c1x.target.amd64.*;
@@ -137,6 +140,23 @@
     private final CiTarget target;
     private final RiXirGenerator generator;
 
+    public static final CiRegisterSaveArea RSA;
+    static {
+        int offset = 0;
+        CiRegister[] rsaRegs = {
+            rax,  rcx,  rdx,   rbx,   rsp,   rbp,   rsi,   rdi,
+            r8,   r9,   r10,   r11,   r12,   r13,   r14,   r15,
+            xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
+            xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
+        };
+        Map<CiRegister, Integer> registerOffsets = new HashMap<CiRegister, Integer>(rsaRegs.length);
+        for (CiRegister reg : rsaRegs) {
+            registerOffsets.put(reg, offset);
+            offset += reg.isFpu() ? 16 : 8;
+        }
+        RSA = new CiRegisterSaveArea(offset, registerOffsets, 8, rax, r15);
+    }
+
     private Compiler() {
         config = getVMEntries().getConfiguration();
         config.check();
@@ -144,15 +164,15 @@
         runtime = new HotSpotRuntime(config);
         final int wordSize = 8;
         final int stackFrameAlignment = 16;
-        registerConfig = new HotSpotRegisterConfig(config);
-        target = new HotSpotTarget(new AMD64(), registerConfig, true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true);
+        registerConfig = runtime.regConfig;
+        target = new HotSpotTarget(new AMD64(), RSA, true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true);
 
         if (Logger.ENABLED) {
             generator = LoggingProxy.getProxy(RiXirGenerator.class, new HotSpotXirGenerator(config, target, registerConfig));
         } else {
             generator = new HotSpotXirGenerator(config, target, registerConfig);
         }
-        compiler = new C1XCompiler(runtime, target, generator);
+        compiler = new C1XCompiler(runtime, target, generator, registerConfig);
 
         C1XOptions.setOptimizationLevel(3);
         C1XOptions.OptInlineExcept = false;
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java	Fri Oct 29 18:14:17 2010 +0200
@@ -170,14 +170,11 @@
 
     @Override
     public Class<?> accessor() {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public int intrinsic() {
-        // TODO Auto-generated method stub
         return 0;
     }
-
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodUnresolved.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodUnresolved.java	Fri Oct 29 18:14:17 2010 +0200
@@ -140,14 +140,11 @@
 
     @Override
     public Class<?> accessor() {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public int intrinsic() {
-        // TODO Auto-generated method stub
         return 0;
     }
-
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java	Fri Oct 29 18:14:17 2010 +0200
@@ -20,6 +20,10 @@
  */
 package com.sun.hotspot.c1x;
 
+import static com.sun.c1x.target.amd64.AMD64.*;
+
+import java.util.*;
+
 import com.sun.c1x.target.amd64.AMD64;
 import com.sun.c1x.util.Util;
 import com.sun.cri.ci.CiCallingConvention;
@@ -28,7 +32,8 @@
 import com.sun.cri.ci.CiStackSlot;
 import com.sun.cri.ci.CiTarget;
 import com.sun.cri.ci.CiValue;
-import com.sun.cri.ri.RiRegisterConfig;
+import com.sun.cri.ci.CiRegister.*;
+import com.sun.cri.ri.*;
 
 /**
  * @author Thomas Wuerthinger
@@ -37,26 +42,41 @@
 public class HotSpotRegisterConfig implements RiRegisterConfig {
 
     // be careful - the contents of this array are duplicated in c1x_CodeInstaller.cpp
+    private final CiRegister[] allocatable = {
+        rax, rbx, rcx, rdx, rsi, rdi, r8, r9, /* r10, */r11, r12, r13, r14,
+        xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
+        xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
+    };
+
+    private final EnumMap<RegisterFlag, CiRegister[]> categorized = CiRegister.categorize(allocatable);
+
+    private final RiRegisterAttributes[] attributesMap;
+
     @Override
     public CiRegister[] getAllocatableRegisters() {
-        return new CiRegister[] {AMD64.rax, AMD64.rbx, AMD64.rcx, AMD64.rdx, AMD64.rsi, AMD64.rdi, AMD64.r8, AMD64.r9, /* AMD64.r10, */AMD64.r11, AMD64.r12, AMD64.r13, AMD64.r14, AMD64.xmm0, AMD64.xmm1, AMD64.xmm2,
-                        AMD64.xmm3, AMD64.xmm4, AMD64.xmm5, AMD64.xmm6, AMD64.xmm7, AMD64.xmm8, AMD64.xmm9, AMD64.xmm10, AMD64.xmm11, AMD64.xmm12, AMD64.xmm13, AMD64.xmm14, AMD64.xmm15};
+        return allocatable;
+    }
+
+    @Override
+    public EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters() {
+        return categorized;
+    }
+
+    @Override
+    public RiRegisterAttributes[] getAttributesMap() {
+        return attributesMap;
     }
 
     private final CiRegister[] generalParameterRegisters;
-    private final CiRegister[] xmmParameterRegisters = new CiRegister[] {AMD64.xmm0, AMD64.xmm1, AMD64.xmm2, AMD64.xmm3, AMD64.xmm4, AMD64.xmm5, AMD64.xmm6, AMD64.xmm7};
+    private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
 
     public HotSpotRegisterConfig(HotSpotVMConfig config) {
         if (config.windowsOs) {
-            generalParameterRegisters = new CiRegister[] {AMD64.rdx, AMD64.r8, AMD64.r9, AMD64.rdi, AMD64.rsi, AMD64.rcx};
+            generalParameterRegisters = new CiRegister[] {rdx, r8, r9, rdi, rsi, rcx};
         } else {
-            generalParameterRegisters = new CiRegister[] {AMD64.rsi, AMD64.rdx, AMD64.rcx, AMD64.r8, AMD64.r9, AMD64.rdi};
+            generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi};
         }
-    }
-
-    @Override
-    public int getCalleeSaveRegisterOffset(CiRegister register) {
-        return 0;
+        attributesMap = RiRegisterAttributes.createMap(this, AMD64.allRegisters);
     }
 
     @Override
@@ -64,13 +84,15 @@
         return getAllocatableRegisters();
     }
 
+    private final CiRegister[] none = {};
+
     @Override
-    public CiRegister getFramePointerRegister() {
-        return AMD64.rbp;
+    public CiRegister[] getCalleeSaveRegisters() {
+        return none;
     }
 
     @Override
-    public CiRegister getIntegerRegister(int index) {
+    public CiRegister getRegister(int index) {
         throw new UnsupportedOperationException();
     }
 
@@ -125,21 +147,11 @@
     }
 
     @Override
-    public int getMinimumCalleeSaveFrameSize() {
-        return 0;
-    }
-
-    @Override
     public CiCallingConvention getNativeCallingConvention(CiKind[] parameters, boolean outgoing, CiTarget target) {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public CiRegister[] getRegisterReferenceMapOrder() {
-        return getAllocatableRegisters();
-    }
-
-    @Override
     public CiRegister getReturnRegister(CiKind kind) {
         switch (kind) {
             case Boolean:
@@ -150,10 +162,10 @@
             case Long:
             case Object:
             case Word:
-                return AMD64.rax;
+                return rax;
             case Float:
             case Double:
-                return AMD64.xmm0;
+                return xmm0;
             case Void:
             case Illegal:
                 return null;
@@ -169,12 +181,21 @@
 
     @Override
     public CiRegister getScratchRegister() {
-        return AMD64.r10;
+        return r10;
+    }
+
+    @Override
+    public CiRegister getFrameRegister() {
+        return rsp;
     }
 
     @Override
-    public CiRegister getStackPointerRegister() {
-        return AMD64.rsp;
+    public String toString() {
+        String res = String.format(
+             "Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" +
+             "CallerSave:  " + Arrays.toString(getCallerSaveRegisters()) + "%n" +
+             "CalleeSave:  " + Arrays.toString(getCalleeSaveRegisters()) + "%n" +
+             "Scratch:     " + getScratchRegister() + "%n");
+        return res;
     }
-
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java	Fri Oct 29 18:14:17 2010 +0200
@@ -39,10 +39,13 @@
  */
 public class HotSpotRuntime implements RiRuntime {
 
-    private final HotSpotVMConfig config;
+    final HotSpotVMConfig config;
+    final HotSpotRegisterConfig regConfig;
+
 
     public HotSpotRuntime(HotSpotVMConfig config) {
         this.config = config;
+        regConfig = new HotSpotRegisterConfig(config);
     }
 
     @Override
@@ -57,7 +60,7 @@
 
     private String disassemble(byte[] code, DisassemblyPrinter disassemblyPrinter) {
         final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        final InstructionSet instructionSet = InstructionSet.AMD64;
+        final ISA instructionSet = ISA.AMD64;
         Disassembler.disassemble(byteArrayOutputStream, code, instructionSet, WordWidth.BITS_64, 0, null, disassemblyPrinter);
         return byteArrayOutputStream.toString();
     }
@@ -218,4 +221,8 @@
         return false;
     }
 
+    @Override
+    public RiRegisterConfig getRegisterConfig(RiMethod method) {
+        return regConfig;
+    }
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTarget.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTarget.java	Fri Oct 29 18:14:17 2010 +0200
@@ -21,7 +21,6 @@
 package com.sun.hotspot.c1x;
 
 import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * HotSpot-specific CiTarget that provides the correct stack frame size alignment.
@@ -30,9 +29,9 @@
  */
 public class HotSpotTarget extends CiTarget {
 
-    public HotSpotTarget(CiArchitecture arch, RiRegisterConfig registerConfig, boolean isMP, int spillSlotSize, int wordSize, int referenceSize, int stackAlignment, int pageSize, int cacheAlignment,
+    public HotSpotTarget(CiArchitecture arch, CiRegisterSaveArea rsa, boolean isMP, int spillSlotSize, int wordSize, int referenceSize, int stackAlignment, int pageSize, int cacheAlignment,
                     int heapAlignment, int codeAlignment, boolean inlineObjects) {
-        super(arch, registerConfig, isMP, spillSlotSize, wordSize, referenceSize, stackAlignment, pageSize, cacheAlignment, heapAlignment, codeAlignment, inlineObjects);
+        super(arch, rsa, isMP, spillSlotSize, wordSize, referenceSize, stackAlignment, pageSize, cacheAlignment, heapAlignment, codeAlignment, inlineObjects);
     }
 
     @Override
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java	Fri Oct 29 18:14:17 2010 +0200
@@ -31,7 +31,7 @@
  */
 public interface VMEntries {
 
-    // CHECKSTYLE:OFF
+    // Checkstyle: stop
 
     byte[] RiMethod_code(long vmId);
 
@@ -81,5 +81,5 @@
 
     boolean RiMethod_hasBalancedMonitors(long vmId);
 
-    // CHECKSTYLE:ON
+    // Checkstyle: resume
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java	Fri Oct 29 18:14:17 2010 +0200
@@ -31,6 +31,7 @@
  */
 public class VMEntriesNative implements VMEntries {
 
+    // Checkstyle: stop
     @Override
     public native byte[] RiMethod_code(long vmId);
 
@@ -102,5 +103,5 @@
 
     @Override
     public native boolean RiMethod_hasBalancedMonitors(long vmId);
-
+    // Checkstyle: resume
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java	Fri Oct 29 18:14:17 2010 +0200
@@ -110,7 +110,7 @@
         try {
             Compiler compiler = Compiler.getInstance();
             HotSpotMethodResolved riMethod = new HotSpotMethodResolved(methodVmId, name);
-            CiResult result = compiler.getCompiler().compileMethod(riMethod, null);
+            CiResult result = compiler.getCompiler().compileMethod(riMethod, -1, null);
 
             if (result.bailout() != null) {
                 StringWriter out = new StringWriter();
--- a/c1x4hotspotsrc/hotspot/hotspot Default.launch	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/hotspot/hotspot Default.launch	Fri Oct 29 18:14:17 2010 +0200
@@ -3,7 +3,7 @@
 <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
 <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
 <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-client -XX:+UseC1X -XX:+PrintGC -Xms1g -Xmx1g -Xbootclasspath/p:${workspace_loc:hotspot}/../../../maxine/C1X/bin:${workspace_loc:hotspot}/../../../maxine/CRI/bin:${workspace_loc:hotspot}/../../../maxine/Base/bin:${workspace_loc:hotspot}/../../../maxine/Assembler/bin:${workspace_loc:hotspot}/../HotSpotVM/bin -classpath ${workspace_loc:hotspot}/../HotSpotTest/bin C1XTest"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="/home/tw/Projects/jre1.7.0/bin/java"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="java"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="hotspot"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.solaris.base.945602881"/>
 <booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
--- a/c1x4hotspotsrc/hotspot/hotspot SciMark.launch	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/hotspot/hotspot SciMark.launch	Fri Oct 29 18:14:17 2010 +0200
@@ -16,7 +16,7 @@
 <booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
 <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-client -XX:+UseC1X -XX:+PrintGC -Xms1g -Xmx1g -Xbootclasspath/p:${workspace_loc:hotspot}/../../../maxine/C1X/bin:${workspace_loc:hotspot}/../../../maxine/CRI/bin:${workspace_loc:hotspot}/../../../maxine/Base/bin:${workspace_loc:hotspot}/../../../maxine/Assembler/bin:${workspace_loc:hotspot}/../HotSpotVM/bin -Xbootclasspath/a:/home/tw/Benchmarks/scimark/ -classpath &quot;/home/tw/Benchmarks/scimark&quot; -C1X:+PrintCompilation -XX:+BackgroundCompilation -C1X:-PrintAssembly -C1X:+PrintTimers jnt.scimark2.commandline"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="/home/tw/Projects/jre1.7.0/bin/java"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="java"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="hotspot"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.solaris.base.945602881"/>
 <booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
--- a/c1x4hotspotsrc/hotspot/hotspot jtt.launch	Mon Oct 25 18:35:34 2010 +0200
+++ b/c1x4hotspotsrc/hotspot/hotspot jtt.launch	Fri Oct 29 18:14:17 2010 +0200
@@ -2,8 +2,8 @@
 <launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
 <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
 <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-client -XX:+UseC1X -Xcomp -XX:CompileOnly=jtt -XX:+PrintCompilation -Xbootclasspath/p:${workspace_loc:hotspot}/../../../maxine/C1X/bin:${workspace_loc:hotspot}/../../../maxine/CRI/bin:${workspace_loc:hotspot}/../../../maxine/Base/bin:${workspace_loc:hotspot}/../../../maxine/Assembler/bin:${workspace_loc:hotspot}/../HotSpotVM/bin -classpath ${workspace_loc:hotspot}/../../../maxine/VM/bin:${workspace_loc:hotspot}/../HotSpotTest/bin -C1X:+PrintCompilation JavaTester 575"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="/home/tw/Projects/jre1.7.0/bin/java"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-client -XX:+UseC1X -Xcomp -XX:CompileOnly=jtt -XX:+PrintCompilation -Xbootclasspath/p:${workspace_loc:hotspot}/../../../maxine/C1X/bin:${workspace_loc:hotspot}/../../../maxine/CRI/bin:${workspace_loc:hotspot}/../../../maxine/Base/bin:${workspace_loc:hotspot}/../../../maxine/Assembler/bin:${workspace_loc:hotspot}/../HotSpotVM/bin -classpath ${workspace_loc:hotspot}/../../../maxine/VM/bin:${workspace_loc:hotspot}/../HotSpotTest/bin -C1X:+PrintCompilation JavaTester"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="java"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="hotspot"/>
 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.solaris.base.945602881"/>
 <booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/c1x4hotspotsrc/hotspot/java	Fri Oct 29 18:14:17 2010 +0200
@@ -0,0 +1,6 @@
+#!/bin/bash
+# Launcher for JRE7 modified to run the HotSpotX compiler
+
+test -n "$JRE7" || { echo "Need to set JRE7 environment variable to the base of a JRE 1.7"; exit 1; }
+exec $JRE7/bin/java "$@"
+
--- a/domake	Mon Oct 25 18:35:34 2010 +0200
+++ b/domake	Fri Oct 29 18:14:17 2010 +0200
@@ -1,7 +1,25 @@
 #!/bin/bash
-pushd make
+
+test -n "$JRE7" || { echo "Need to set JRE7 environment variable to the base of a JRE 1.7"; exit 1; }
+
+# Resolve location of this script
+me="${BASH_SOURCE[0]}"
+while [ -h "$me" ]; do
+    me=`readlink -e "$me"`
+done
+
+grep '-client KNOWN' $JRE7/lib/amd64/jvm.cfg >/dev/null
+if [ $? -ne 0 ] ; then
+    echo "The setting for -client in $JRE7/lib/amd64/jvm.cfg must be:"
+    echo
+    echo "  -client KNOWN"
+    echo
+    exit 1
+fi
+
+pushd $(dirname "$me")/make
 ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk/ LANG=C ARCH_DATA_MODEL=64 HOTSPOT_BUILD_JOBS=2 make jvmg1
-cp ../build/linux/linux_amd64_compiler1/jvmg/libjvm.so ../../jre1.7.0/lib/amd64/client
-cp ../build/linux/linux_amd64_compiler1/jvmg/libjsig.so ../../jre1.7.0/lib/amd64/client
+cp ../build/linux/linux_amd64_compiler1/jvmg/libjvm.so $JRE7/lib/amd64/client
+cp ../build/linux/linux_amd64_compiler1/jvmg/libjsig.so $JRE7/lib/amd64/client
 popd
 
--- a/src/share/vm/c1x/c1x_CodeInstaller.cpp	Mon Oct 25 18:35:34 2010 +0200
+++ b/src/share/vm/c1x/c1x_CodeInstaller.cpp	Fri Oct 29 18:14:17 2010 +0200
@@ -50,7 +50,7 @@
   arrayOop register_map = (arrayOop) CiDebugInfo::registerRefMap(debug_info);
   arrayOop frame_map = (arrayOop) CiDebugInfo::frameRefMap(debug_info);
 
-  assert(register_map->length() == (NUM_REGS + 7) / 8, "unexpected register_map length");
+  assert(register_map->length() == (NUM_CPU_REGS + 7) / 8, "unexpected register_map length");
 
   for (jint i = 0; i < NUM_REGS; i++) {
     unsigned char byte = ((unsigned char*) register_map->base(T_BYTE))[i / 8];