diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java @ 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 c0e244017dad
line wrap: on
line diff
--- 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;