Mercurial > hg > truffle
diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java @ 1449:8cfe3537a0d3
Pointer verification stub. Two loose oop fixes in C1X C++ part. Logging which methods have been compiled.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Thu, 11 Nov 2010 14:09:37 +0100 |
parents | a7b84a5e16c6 |
children | 1845386f5403 |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Tue Nov 09 13:42:06 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Thu Nov 11 14:09:37 2010 +0100 @@ -23,6 +23,7 @@ import java.io.*; import java.lang.reflect.*; +import java.util.*; import com.sun.c1x.*; import com.sun.cri.ci.*; @@ -38,6 +39,16 @@ public static boolean compileMethods = true; + /** + * Default option configuration for C1X. + */ + static { + C1XOptions.setOptimizationLevel(3); + C1XOptions.OptInlineExcept = false; + C1XOptions.OptInlineSynchronized = false; + C1XOptions.UseDeopt = false; + } + @Override public boolean setOption(String option) { if (option.length() == 0) { @@ -102,6 +113,8 @@ return true; } + private static Set<String> compiledMethods = new HashSet<String>(); + @Override public void compileMethod(long methodVmId, String name, int entryBCI) throws Throwable { @@ -113,11 +126,25 @@ Compiler compiler = Compiler.getInstance(); HotSpotMethodResolved riMethod = new HotSpotMethodResolved(methodVmId, name); CiResult result = compiler.getCompiler().compileMethod(riMethod, -1, null); + String qualifiedName = CiUtil.toJavaName(riMethod.holder()) + "::" + riMethod.name(); + compiledMethods.add(qualifiedName); if (result.bailout() != null) { StringWriter out = new StringWriter(); result.bailout().printStackTrace(new PrintWriter(out)); + Throwable cause = result.bailout().getCause(); Logger.info("Bailout:\n" + out.toString()); + if (cause != null) { + Logger.info("Trace for cause: "); + for (StackTraceElement e : cause.getStackTrace()) { + String current = e.getClassName() + "::" + e.getMethodName(); + String type = ""; + if (compiledMethods.contains(current)) { + type = "compiled"; + } + Logger.info(String.format("%-10s %3d %s", type, e.getLineNumber(), current)); + } + } Compiler.getVMEntries().recordBailout(result.bailout().getMessage()); } else { Logger.log("Compilation result: " + result.targetMethod());