|
From: <kon...@us...> - 2006-12-16 15:06:30
|
Revision: 2933
http://jnode.svn.sourceforge.net/jnode/?rev=2933&view=rev
Author: konkubinaten
Date: 2006-12-16 07:06:27 -0800 (Sat, 16 Dec 2006)
Log Message:
-----------
Update to support the setting of default compiler
Modified Paths:
--------------
branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java
branches/jikesRVM/core/src/core/org/jnode/vm/x86/VmX86Architecture.java
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java 2006-12-15 16:55:41 UTC (rev 2932)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/LoadCompileService.java 2006-12-16 15:06:27 UTC (rev 2933)
@@ -39,6 +39,8 @@
private final NativeCodeCompiler[] testCompilers;
private static boolean started = false;
+
+ private static int defaultCompiler = 0;
/**
* Default ctor
@@ -177,14 +179,21 @@
*/
private void doCompile(VmMethod vmMethod, int optLevel,
boolean enableTestCompilers) {
+
final NativeCodeCompiler cmps[];
- int index;
+
+ int index;
+ if (optLevel == 0)
+ index = 0;
+ else if (defaultCompiler == 0)
+ index = optLevel;
+ else
+ index = defaultCompiler;
+
if (enableTestCompilers) {
- index = optLevel;
optLevel += compilers.length;
cmps = testCompilers;
} else {
- index = optLevel;
cmps = compilers;
}
@@ -342,4 +351,8 @@
return "Error in class loading: ";
}
}
+
+ public static void setDefaultCompiler(int defaultCompiler) {
+ LoadCompileService.defaultCompiler = defaultCompiler;
+ }
}
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-15 16:55:41 UTC (rev 2932)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/x86/VmX86Architecture.java 2006-12-16 15:06:27 UTC (rev 2933)
@@ -147,7 +147,8 @@
this.compilers[1] = new X86Level1ACompiler();
}
this.compilers[2] = new JikesRVMOptCompiler();
- this.compilers[3] = new X86Level1ACompiler();
+ //this.compilers[3] = this.compilers[2];
+ this.compilers[3] = this.compilers[1];
this.testCompilers = null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ans...@us...> - 2007-01-16 23:17:34
|
Revision: 3081
http://jnode.svn.sourceforge.net/jnode/?rev=3081&view=rev
Author: ansari82
Date: 2007-01-16 15:17:32 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
Made methods that use Unsafe.pushxxx() set to NoOptCompile as this can confuse JikesOpt generated code
Modified Paths:
--------------
branches/jikesRVM/core/src/core/org/jnode/vm/HeapHelperImpl.java
branches/jikesRVM/core/src/core/org/jnode/vm/VmReflection.java
branches/jikesRVM/core/src/core/org/jnode/vm/VmSystemClassLoader.java
branches/jikesRVM/core/src/core/org/jnode/vm/compiler/CompiledMethod.java
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/HeapHelperImpl.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/HeapHelperImpl.java 2007-01-16 23:16:49 UTC (rev 3080)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/HeapHelperImpl.java 2007-01-16 23:17:32 UTC (rev 3081)
@@ -22,6 +22,7 @@
package org.jnode.vm;
import org.jnode.vm.annotation.MagicPermission;
+import org.jnode.vm.annotation.NoOptCompile;
import org.jnode.vm.annotation.Uninterruptible;
import org.jnode.vm.classmgr.ObjectFlags;
import org.jnode.vm.classmgr.ObjectLayout;
@@ -199,6 +200,7 @@
* @see org.jnode.vm.memmgr.HeapHelper#invokeFinalizer(org.jnode.vm.classmgr.VmMethod,
* java.lang.Object)
*/
+ @NoOptCompile //Uses Unsafe.pushxxx() which is bad for JikesOpt
public final void invokeFinalizer(VmMethod finalizer, Object object) {
Unsafe.pushObject(object);
Unsafe.invokeVoid(finalizer);
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/VmReflection.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/VmReflection.java 2007-01-16 23:16:49 UTC (rev 3080)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/VmReflection.java 2007-01-16 23:17:32 UTC (rev 3081)
@@ -24,6 +24,7 @@
import java.lang.reflect.InvocationTargetException;
import org.jnode.vm.annotation.MagicPermission;
+import org.jnode.vm.annotation.NoOptCompile;
import org.jnode.vm.classmgr.VmField;
import org.jnode.vm.classmgr.VmInstanceField;
import org.jnode.vm.classmgr.VmMethod;
@@ -309,6 +310,7 @@
* @return Object
* @throws InvocationTargetException
*/
+ @NoOptCompile //Uses Unsafe.pushxxx() which is bad for JikesOpt
public static Object invoke(VmMethod method, Object o, Object[] args)
throws InvocationTargetException {
int argCount = method.getNoArguments();
@@ -440,6 +442,7 @@
* @throws IllegalAccessException
* @throws InvocationTargetException
*/
+ @NoOptCompile //Uses Unsafe.pushxxx() which is bad for JikesOpt
public static Object newInstance(VmMethod constructor)
throws InstantiationException, IllegalAccessException,
InvocationTargetException {
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/VmSystemClassLoader.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2007-01-16 23:16:49 UTC (rev 3080)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2007-01-16 23:17:32 UTC (rev 3081)
@@ -297,8 +297,7 @@
@PrivilegedActionPragma
public VmType< ? > loadClass(String name, boolean resolve)
throws ClassNotFoundException {
-
- // Also implement the java.lang.ClassLoader principals here
+// Also implement the java.lang.ClassLoader principals here
// otherwise they cannot work in java.lang.ClassLoader.
if ((parent != null) && !parent.skipParentLoader(name)) {
try {
@@ -308,7 +307,6 @@
// Don't care, try it ourselves.
}
}
-
VmType cls = findLoadedClass(name);
if (cls != null) {
return cls;
@@ -316,11 +314,7 @@
if (classInfos == null) {
// Unsafe.debug("classInfos==null");
throw new ClassNotFoundException(name);
- }
-
- // BootLog.debug("load class" + name);
-
- if (name.indexOf('/') >= 0) {
+ }if (name.indexOf('/') >= 0) {
//throw new IllegalArgumentException("name contains '/'");
//throw CNFE here
throw new ClassNotFoundException(name);
@@ -329,39 +323,53 @@
if ((failedClassNames != null) && (failedClassNames.contains(name))) {
throw new ClassNotFoundException(name);
}
-
+
final ClassInfo ci = getClassInfo(name, true);
-
+
if (!ci.isLoaded()) {
- try {
- if (name.charAt(0) == '[') {
- ci.setVmClass(loadArrayClass(name, resolve));
- } else {
- ci.setVmClass(loadNormalClass(name));
+ if (name.charAt(0) == '[') {
+ try {
+ ci.setVmClass(loadArrayClass(name, resolve));
+ if (failOnNewLoad) {
+ throw new RuntimeException(
+ "Cannot load a new class when failOnNewLoad is set ("
+ + name + ")");
+ }
+ }catch (ClassNotFoundException ex) {
+ ci.setLoadError(ex.toString());
+ classInfos.remove(ci.getName());
+ addFailedClassName(name);
+ throw new ClassNotFoundException(name, ex);
}
- if (failOnNewLoad) {
- throw new RuntimeException(
- "Cannot load a new class when failOnNewLoad is set ("
- + name + ")");
- }
- } catch (ClassNotFoundException ex) {
- ci.setLoadError(ex.toString());
- classInfos.remove(ci.getName());
- addFailedClassName(name);
- throw new ClassNotFoundException(name, ex);
- } catch (IOException ex) {
- ci.setLoadError(ex.toString());
- classInfos.remove(ci.getName());
- addFailedClassName(name);
- throw new ClassNotFoundException(name, ex);
+ } else {
+ try {
+ ci.setVmClass(loadNormalClass(name));
+ if (failOnNewLoad) {
+ throw new RuntimeException(
+ "Cannot load a new class when failOnNewLoad is set ("
+ + name + ")");
+ }
+ } catch (ClassNotFoundException ex) {
+ ci.setLoadError(ex.toString());
+ classInfos.remove(ci.getName());
+ addFailedClassName(name);
+ throw new ClassNotFoundException(name, ex);
+ } catch (IOException ex) {
+ ci.setLoadError(ex.toString());
+ classInfos.remove(ci.getName());
+ addFailedClassName(name);
+ throw new ClassNotFoundException(name, ex);
+ }
}
- if (resolve) {
+ if (resolve) {
ci.getVmClass().link();
}
}
return ci.getVmClass();
}
+
+
private final void addFailedClassName(String name) {
if (failedClassNames == null) {
failedClassNames = new HashSet<String>();
Modified: branches/jikesRVM/core/src/core/org/jnode/vm/compiler/CompiledMethod.java
===================================================================
--- branches/jikesRVM/core/src/core/org/jnode/vm/compiler/CompiledMethod.java 2007-01-16 23:16:49 UTC (rev 3080)
+++ branches/jikesRVM/core/src/core/org/jnode/vm/compiler/CompiledMethod.java 2007-01-16 23:17:32 UTC (rev 3081)
@@ -31,7 +31,7 @@
/**
* @author Ewout Prangsma (ep...@us...)
*/
-public final class CompiledMethod {
+public class CompiledMethod {
private NativeStream.ObjectRef codeStart;
private NativeStream.ObjectRef codeEnd;
@@ -40,7 +40,7 @@
private final VmAddressMap addressTable;
private final int optLevel;
private int ccId = -1;
- private VM_CompiledMethod jikesCM;
+// private VM_CompiledMethod jikesCM;
/**
* Initialize this instance
@@ -147,11 +147,11 @@
return ccId;
}
- public VM_CompiledMethod getJikesCM() {
- return jikesCM;
- }
-
- public void setJikesCM(VM_CompiledMethod method) {
- jikesCM = method;
- }
+// public VM_CompiledMethod getJikesCM() {
+// return jikesCM;
+// }
+//
+// public void setJikesCM(VM_CompiledMethod method) {
+// jikesCM = method;
+// }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|