|
From: <ans...@us...> - 2006-12-16 15:26:34
|
Revision: 2934
http://jnode.svn.sourceforge.net/jnode/?rev=2934&view=rev
Author: ansari82
Date: 2006-12-16 07:26:32 -0800 (Sat, 16 Dec 2006)
Log Message:
-----------
Changes to make build more stable by removing opt, opt.ir from compiler packages in JikesRVMOptCompiler.java, adding a default compiler command, and cleaning up X86stackframe to have cleaner declarations, and fix spelling mistake in x86stubcompiler
Modified Paths:
--------------
branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java
branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java
branches/jikesRVM/core/src/core/org/jnode/vm/x86/VmX86Architecture.java
branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java
branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java
branches/jikesRVM/dbuild.sh
branches/jikesRVM/shell/descriptors/org.jnode.shell.command.xml
Added Paths:
-----------
branches/jikesRVM/shell/src/shell/org/jnode/shell/command/DefaultCompilerCommand.java
Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java
===================================================================
--- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-16 15:26:32 UTC (rev 2934)
@@ -50,7 +50,6 @@
public static OPT_Options options;
public static OPT_OptimizationPlanElement[] optimizationPlan;
- private boolean init = false;
public JikesRVMOptCompiler() {
options = new OPT_Options();
@@ -157,15 +156,17 @@
@Override
public String[] getCompilerPackages() {
- return new String[] { "org.jnode.vm.x86.compiler",
- "com.ibm.JikesRVM",
- "com.ibm.JikesRVM.adaptive",
- "com.ibm.JikesRVM.classloader",
- "com.ibm.JikesRVM.memoryManagers.mmInterface",
- "com.ibm.JikesRVM.opt",
- "com.ibm.JikesRVM.opt.ir",
- "com.ibm.JikesRVM.OSR",
- "com.ibm.JikesRVM.util"};
+ return new String[] {
+ "org.jnode.vm.x86.compiler",
+ "com.ibm.JikesRVM",
+ "com.ibm.JikesRVM.adaptive",
+ "com.ibm.JikesRVM.classloader",
+ "com.ibm.JikesRVM.memoryManagers.mmInterface",
+ //"com.ibm.JikesRVM.opt",
+ //"com.ibm.JikesRVM.opt.ir",
+ "com.ibm.JikesRVM.OSR",
+ "com.ibm.JikesRVM.util",
+ };
}
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java 2006-12-16 15:26:32 UTC (rev 2934)
@@ -182,13 +182,13 @@
final NativeCodeCompiler cmps[];
- int index;
- if (optLevel == 0)
- index = 0;
- else if (defaultCompiler == 0)
- index = optLevel;
- else
- index = defaultCompiler;
+ int index;
+ if (optLevel == 0)
+ index = 0;
+ else if (defaultCompiler == 0)
+ index = optLevel;
+ else
+ index = defaultCompiler;
if (enableTestCompilers) {
optLevel += compilers.length;
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/x86/VmX86Architecture.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/x86/VmX86Architecture.java 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/x86/VmX86Architecture.java 2006-12-16 15:26:32 UTC (rev 2934)
@@ -140,6 +140,8 @@
public VmX86Architecture(int referenceSize, String compiler) {
super(referenceSize, new VmX86StackReader(referenceSize));
this.compilers = new NativeCodeCompiler[4];
+
+ // Production system compiler list
this.compilers[0] = new X86StubCompiler();
if ("L1B".equals(compiler)) {
this.compilers[1] = new X86Level1BCompiler();
@@ -147,8 +149,10 @@
this.compilers[1] = new X86Level1ACompiler();
}
this.compilers[2] = new JikesRVMOptCompiler();
- //this.compilers[3] = this.compilers[2];
- this.compilers[3] = this.compilers[1];
+
+ //this.compilers[3] = this.compilers[2];
+ this.compilers[3] = this.compilers[1];
+
this.testCompilers = null;
}
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java 2006-12-16 15:26:32 UTC (rev 2934)
@@ -28,6 +28,7 @@
import org.jnode.assembler.x86.X86Constants;
import org.jnode.assembler.x86.X86Register;
import org.jnode.assembler.x86.X86Register.GPR;
+import org.jnode.vm.Vm;
import org.jnode.vm.classmgr.TypeSizeInfo;
import org.jnode.vm.classmgr.VmByteCode;
import org.jnode.vm.classmgr.VmInterpretedExceptionHandler;
@@ -80,7 +81,7 @@
* Number of byte on the stack occupied by saved registers. See
* {@link #saveRegisters()}
*/
- private static final int SAVED_REGISTERSPACE = 2 * 4;
+ private static final int SAVED_REGISTERSPACE = 2 * Vm.getArch().getReferenceSize();
/**
* Create a new instance
@@ -368,9 +369,9 @@
* @see org.jnode.vm.x86.VmX86StackReader
*/
private final void saveRegisters() {
- os.writePUSH(X86Register.EBX);
- //os.writePUSH(Register.EDI);
- os.writePUSH(X86Register.ESI);
+ os.writePUSH(os.isCode32() ? (GPR)X86Register.EBX : X86Register.RBX);
+ //os.writePUSH(os.isCode32() ? (GPR)X86Register.EDI : X86Register.RDI);
+ os.writePUSH(os.isCode32() ? (GPR)X86Register.ESI : X86Register.RSI);
}
/**
@@ -380,8 +381,8 @@
* @see org.jnode.vm.x86.VmX86StackReader
*/
private final void restoreRegisters() {
- os.writePOP(X86Register.ESI);
- //os.writePOP(Register.EDI);
- os.writePOP(X86Register.EBX);
+ os.writePOP(os.isCode32() ? (GPR)X86Register.ESI : X86Register.RSI);
+ //os.writePOP(os.isCode32() ? (GPR)X86Register.EDI : X86Register.RDI);
+ os.writePOP(os.isCode32() ? (GPR)X86Register.EBX : X86Register.RBX);
}
}
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java 2006-12-16 15:26:32 UTC (rev 2934)
@@ -146,6 +146,6 @@
*/
@Override
public String[] getCompilerPackages() {
- return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stup" };
+ return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stub" };
}
}
Modified: branches/jikesRVM/dbuild.sh
===================================================================
--- branches/jikesRVM/dbuild.sh 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/dbuild.sh 2006-12-16 15:26:32 UTC (rev 2934)
@@ -1,6 +1,6 @@
#!/bin/sh
dir=`dirname $0`
-java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Xmx1576M -Xms128M -jar $dir/core/lib/ant-launcher.jar -lib $JAVA_HOME/lib -lib $dir/core/lib -f $dir/all/build.xml $*
+java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Xmx1024M -Xms512M -jar $dir/core/lib/ant-launcher.jar -lib $JAVA_HOME/lib -lib $dir/core/lib -f $dir/all/build.xml $*
Modified: branches/jikesRVM/shell/descriptors/org.jnode.shell.command.xml
===================================================================
--- branches/jikesRVM/shell/descriptors/org.jnode.shell.command.xml 2006-12-16 15:06:27 UTC (rev 2933)
+++ branches/jikesRVM/shell/descriptors/org.jnode.shell.command.xml 2006-12-16 15:26:32 UTC (rev 2934)
@@ -25,6 +25,7 @@
<alias name="class" class="org.jnode.shell.command.ClassCommand"/>
<alias name="classpath" class="org.jnode.shell.command.ClasspathCommand" internal="yes"/>
<alias name="compile" class="org.jnode.shell.command.CompileCommand"/>
+ <alias name="defcomp" class="org.jnode.shell.command.DefaultCompilerCommand"/>
<alias name="disasm" class="org.jnode.shell.command.DisassembleCommand"/>
<alias name="date" class="org.jnode.shell.command.DateCommand"/>
<alias name="echo" class="org.jnode.shell.command.EchoCommand"/>
Added: branches/jikesRVM/shell/src/shell/org/jnode/shell/command/DefaultCompilerCommand.java
===================================================================
--- branches/jikesRVM/shell/src/shell/org/jnode/shell/command/DefaultCompilerCommand.java (rev 0)
+++ branches/jikesRVM/shell/src/shell/org/jnode/shell/command/DefaultCompilerCommand.java 2006-12-16 15:26:32 UTC (rev 2934)
@@ -0,0 +1,49 @@
+/*
+ * $Id: CompileCommand.java 2224 2006-01-01 12:49:03Z epr $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.shell.command;
+
+import org.jnode.shell.help.Help;
+import org.jnode.shell.help.IntegerArgument;
+import org.jnode.shell.help.Parameter;
+import org.jnode.shell.help.ParsedArguments;
+import org.jnode.vm.LoadCompileService;
+
+/**
+ * @author Mohammad Ansari (ans...@us...)
+ */
+
+public class DefaultCompilerCommand {
+
+ static final IntegerArgument ARG_LEVEL = new IntegerArgument("number", "the compiler number (usually JikesOpt is 2");
+
+ public static Help.Info HELP_INFO = new Help.Info("defcomp", "Set default compiler", new Parameter[] { new Parameter(ARG_LEVEL, Parameter.MANDATORY)});
+
+ public static void main(String[] args) throws Exception {
+ final ParsedArguments cmdLine = HELP_INFO.parse(args);
+
+ final int level = ARG_LEVEL.getInteger(cmdLine);
+
+ LoadCompileService.setDefaultCompiler(level);
+ System.out.println("Default compiler id now: " + level);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|