changeset 1418:55ac38887415

modifications for linux: argument register layout, makefile
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 09 Jul 2010 16:33:03 -0700
parents 2c41834aa270
children 7bf6a77b9c5a
files c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java make/Makefile src/share/vm/c1/c1_globals.hpp src/share/vm/c1x/c1x_Compiler.cpp src/share/vm/c1x/c1x_Compiler.hpp src/share/vm/classfile/classLoader.cpp
diffstat 7 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Wed Jun 23 17:20:40 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Fri Jul 09 16:33:03 2010 -0700
@@ -56,7 +56,7 @@
 		final int wordSize = 8;
 		final int stackFrameAlignment = 8;
 		final int pageSize = 1024;
-		final RiRegisterConfig config = new HotSpotRegisterConfig();
+		final RiRegisterConfig config = new HotSpotRegisterConfig(System.getProperty("os.name").startsWith("Windows"));
         final CiTarget target = new CiTarget(new AMD64(), config, true, wordSize, wordSize, wordSize, stackFrameAlignment, pageSize, wordSize, wordSize, 16);
         final CiCompiler compiler = new C1XCompiler(runtime, target, generator);
         
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java	Wed Jun 23 17:20:40 2010 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java	Fri Jul 09 16:33:03 2010 -0700
@@ -41,9 +41,16 @@
 		return new CiRegister[]{ AMD64.rax, AMD64.rbx, AMD64.rcx, AMD64.rdx, AMD64.rsi, AMD64.rdi, AMD64.r10, AMD64.r11} ;
 	}
 	
+    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[] generalParameterRegisters = new CiRegister[]{AMD64.rdx, AMD64.r8, AMD64.r9, AMD64.rdi, AMD64.rsi, AMD64.rcx};
-    private final CiRegister[] xmmParameterRegisters = new CiRegister[]{AMD64.xmm0, AMD64.xmm1, AMD64.xmm2, AMD64.xmm3, AMD64.xmm4, AMD64.xmm5, AMD64.xmm6, AMD64.xmm7};
+	public HotSpotRegisterConfig(boolean windowsRegisterLayout) {
+		if(windowsRegisterLayout) {
+		    generalParameterRegisters = new CiRegister[]{AMD64.rdx, AMD64.r8, AMD64.r9, AMD64.rdi, AMD64.rsi, AMD64.rcx};
+		} else {
+		    generalParameterRegisters = new CiRegister[]{AMD64.rsi, AMD64.rdx, AMD64.rcx, AMD64.r8, AMD64.r9, AMD64.rdi};
+		}
+	}
 
 	@Override
 	public int getCalleeSaveRegisterOffset(CiRegister register) {
--- a/make/Makefile	Wed Jun 23 17:20:40 2010 +0200
+++ b/make/Makefile	Fri Jul 09 16:33:03 2010 -0700
@@ -147,13 +147,13 @@
 	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
   endif
 else
-  ifeq ($(ARCH_DATA_MODEL), 32)
+#  ifeq ($(ARCH_DATA_MODEL), 32)
 	$(CD) $(OUTPUTDIR); \
 	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
 		      $(MAKE_ARGS) $(VM_TARGET)
-  else
-	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
-  endif
+#  else
+#	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
+#  endif
 endif
 
 # Build compiler2 (server) rule, different for platforms
--- a/src/share/vm/c1/c1_globals.hpp	Wed Jun 23 17:20:40 2010 +0200
+++ b/src/share/vm/c1/c1_globals.hpp	Fri Jul 09 16:33:03 2010 -0700
@@ -33,9 +33,9 @@
 
 #define C1_FLAGS(develop, develop_pd, product, product_pd, notproduct)      \
                                                                             \
-  product(bool, UseC1X, true,						                        \
+  product(bool, UseC1X, false,                                              \
           "Use C1X instead of C1")                                          \
-  product(intx, TraceC1X, 0,						                        \
+  product(intx, TraceC1X, 0,                                                \
           "Trace level for C1X")                                            \
   /* Printing */                                                            \
   notproduct(bool, PrintC1Statistics, false,                                \
@@ -59,7 +59,7 @@
   notproduct(bool, PrintIRDuringConstruction, false,                        \
           "Print IR as it's being constructed (helpful for debugging frontend)")\
                                                                             \
-  notproduct(bool, PrintPhiFunctions, false,                                   \
+  notproduct(bool, PrintPhiFunctions, false,                                \
           "Print phi functions when they are created and simplified")       \
                                                                             \
   notproduct(bool, PrintIR, false,                                          \
--- a/src/share/vm/c1x/c1x_Compiler.cpp	Wed Jun 23 17:20:40 2010 +0200
+++ b/src/share/vm/c1x/c1x_Compiler.cpp	Fri Jul 09 16:33:03 2010 -0700
@@ -35,6 +35,7 @@
 
   JNIEnv *env = ((JavaThread *)Thread::current())->jni_environment();
   jclass klass = env->FindClass("com/sun/hotspot/c1x/VMEntries");
+  assert(klass != NULL, "c1x VMEntries class not found");
   env->RegisterNatives(klass, VMEntries_methods, VMEntries_methods_count() );
   
   if (Thread::current()->has_pending_exception()) {
--- a/src/share/vm/c1x/c1x_Compiler.hpp	Wed Jun 23 17:20:40 2010 +0200
+++ b/src/share/vm/c1x/c1x_Compiler.hpp	Fri Jul 09 16:33:03 2010 -0700
@@ -26,7 +26,7 @@
 
 private:
 
-  boolean _initialized;
+  bool _initialized;
 
 public:
 
@@ -74,4 +74,4 @@
 #define TRACE_C1X_2 if (TraceC1X >= 2) tty->print("   TraceC1X-2: "); if (TraceC1X >= 2) tty->print_cr
 #define TRACE_C1X_3 if (TraceC1X >= 3) tty->print("      TraceC1X-3: "); if (TraceC1X >= 3) tty->print_cr
 #define TRACE_C1X_4 if (TraceC1X >= 4) tty->print("         TraceC1X-4: "); if (TraceC1X >= 4) tty->print_cr
-#define TRACE_C1X_5 if (TraceC1X >= 5) tty->print("            TraceC1X-5: "); if (TraceC1X >= 5) tty->print_cr
\ No newline at end of file
+#define TRACE_C1X_5 if (TraceC1X >= 5) tty->print("            TraceC1X-5: "); if (TraceC1X >= 5) tty->print_cr
--- a/src/share/vm/classfile/classLoader.cpp	Wed Jun 23 17:20:40 2010 +0200
+++ b/src/share/vm/classfile/classLoader.cpp	Fri Jul 09 16:33:03 2010 -0700
@@ -164,7 +164,7 @@
     if (file_handle != -1) {
       // read contents into resource array
       u1* buffer = NEW_RESOURCE_ARRAY(u1, st.st_size);
-      size_t num_read = hpi::read(file_handle, (char*) buffer, st.st_size);
+      size_t num_read = os::read(file_handle, (char*) buffer, st.st_size);
       // close file
       hpi::close(file_handle);
       // construct ClassFileStream