# HG changeset patch # User Doug Simon # Date 1411683523 -7200 # Node ID 5d03b4a472c679f2d10607192e091bc28b8be0e5 # Parent a552dd335bde4930cd1e8ddb8a985908d4849c9a# Parent 26d07b31c4a867c3b39113bece86ea1816ad63fc Merge. diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Fri Sep 26 00:18:43 2014 +0200 @@ -707,6 +707,8 @@ StructuredGraph graph = new StructuredGraph(javaMethod); graphBuilderSuite.apply(graph, new HighTierContext(providers, null, null, graphBuilderSuite, OptimisticOptimizations.ALL)); return graph; + } catch (Throwable e) { + throw Debug.handle(e); } } diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Sep 26 00:18:43 2014 +0200 @@ -970,6 +970,8 @@ } } } + } catch (Throwable e) { + throw Debug.handle(e); } } diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Fri Sep 26 00:18:43 2014 +0200 @@ -217,9 +217,26 @@ * * * @param name the name of the new scope + * @param contextObjects an array of object to be appended to the {@linkplain #context() + * current} debug context + * @throws Throwable used to enforce a catch block. * @return the scope entered by this method which will be exited when its {@link Scope#close()} * method is called */ + public static Scope scope(Object name, Object[] contextObjects) throws Throwable { + if (ENABLED) { + return DebugScope.getInstance().scope(convertFormatArg(name).toString(), null, contextObjects); + } else { + return null; + } + } + + /** + * Similar to {@link #scope(Object, Object[])} but without context objects. Therefore the catch + * block can be omitted. + * + * @see #scope(Object, Object[]) + */ public static Scope scope(Object name) { if (ENABLED) { return DebugScope.getInstance().scope(convertFormatArg(name).toString(), null); @@ -229,23 +246,10 @@ } /** - * @see #scope(Object) - * @param contextObjects an array of object to be appended to the {@linkplain #context() - * current} debug context - */ - public static Scope scope(Object name, Object[] contextObjects) { - if (ENABLED) { - return DebugScope.getInstance().scope(convertFormatArg(name).toString(), null, contextObjects); - } else { - return null; - } - } - - /** - * @see #scope(Object) + * @see #scope(Object, Object[]) * @param context an object to be appended to the {@linkplain #context() current} debug context */ - public static Scope scope(Object name, Object context) { + public static Scope scope(Object name, Object context) throws Throwable { if (ENABLED) { return DebugScope.getInstance().scope(convertFormatArg(name).toString(), null, context); } else { @@ -254,13 +258,13 @@ } /** - * @see #scope(Object) + * @see #scope(Object, Object[]) * @param context1 first object to be appended to the {@linkplain #context() current} debug * context * @param context2 second object to be appended to the {@linkplain #context() current} debug * context */ - public static Scope scope(Object name, Object context1, Object context2) { + public static Scope scope(Object name, Object context1, Object context2) throws Throwable { if (ENABLED) { return DebugScope.getInstance().scope(convertFormatArg(name).toString(), null, context1, context2); } else { @@ -269,7 +273,7 @@ } /** - * @see #scope(Object) + * @see #scope(Object, Object[]) * @param context1 first object to be appended to the {@linkplain #context() current} debug * context * @param context2 second object to be appended to the {@linkplain #context() current} debug @@ -277,7 +281,7 @@ * @param context3 third object to be appended to the {@linkplain #context() current} debug * context */ - public static Scope scope(Object name, Object context1, Object context2, Object context3) { + public static Scope scope(Object name, Object context1, Object context2, Object context3) throws Throwable { if (ENABLED) { return DebugScope.getInstance().scope(convertFormatArg(name).toString(), null, context1, context2, context3); } else { @@ -305,7 +309,7 @@ * @return the scope entered by this method which will be exited when its {@link Scope#close()} * method is called */ - public static Scope sandbox(CharSequence name, DebugConfig config, Object... context) { + public static Scope sandbox(CharSequence name, DebugConfig config, Object... context) throws Throwable { if (ENABLED) { DebugConfig sandboxConfig = config == null ? silentConfig() : config; return DebugScope.getInstance().scope(name, sandboxConfig, context); @@ -314,7 +318,7 @@ } } - public static Scope forceLog() { + public static Scope forceLog() throws Throwable { ArrayList context = new ArrayList<>(); for (Object obj : context()) { context.add(obj); @@ -346,7 +350,7 @@ * pattern recommended by {@link #scope(Object)} and * {@link #sandbox(CharSequence, DebugConfig, Object...)} is used * - * @see #scope(Object) + * @see #scope(Object, Object[]) * @see #sandbox(CharSequence, DebugConfig, Object...) */ public static RuntimeException handle(Throwable exception) { diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/HotSpotNativeFunctionInterface.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/HotSpotNativeFunctionInterface.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/HotSpotNativeFunctionInterface.java Fri Sep 26 00:18:43 2014 +0200 @@ -167,6 +167,8 @@ InstalledCode installedCode; try (Scope s = Debug.scope("CodeInstall", providers.getCodeCache(), g.method())) { installedCode = providers.getCodeCache().addMethod(g.method(), compResult, null, null); + } catch (Throwable e) { + throw Debug.handle(e); } return installedCode; } diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java Fri Sep 26 00:18:43 2014 +0200 @@ -64,12 +64,12 @@ private BlockMap> blockMap; private BlockMap insertionBuffers; - private static DebugMetric constantsTotal = Debug.metric("ConstantLoadOptimization[total]"); - private static DebugMetric phiConstantsSkipped = Debug.metric("ConstantLoadOptimization[PhisSkipped]"); - private static DebugMetric singleUsageConstantsSkipped = Debug.metric("ConstantLoadOptimization[SingleUsageSkipped]"); - private static DebugMetric usageAtDefinitionSkipped = Debug.metric("ConstantLoadOptimization[UsageAtDefinitionSkipped]"); - private static DebugMetric materializeAtDefinitionSkipped = Debug.metric("ConstantLoadOptimization[MaterializeAtDefinitionSkipped]"); - private static DebugMetric constantsOptimized = Debug.metric("ConstantLoadOptimization[optimized]"); + private static final DebugMetric constantsTotal = Debug.metric("ConstantLoadOptimization[total]"); + private static final DebugMetric phiConstantsSkipped = Debug.metric("ConstantLoadOptimization[PhisSkipped]"); + private static final DebugMetric singleUsageConstantsSkipped = Debug.metric("ConstantLoadOptimization[SingleUsageSkipped]"); + private static final DebugMetric usageAtDefinitionSkipped = Debug.metric("ConstantLoadOptimization[UsageAtDefinitionSkipped]"); + private static final DebugMetric materializeAtDefinitionSkipped = Debug.metric("ConstantLoadOptimization[MaterializeAtDefinitionSkipped]"); + private static final DebugMetric constantsOptimized = Debug.metric("ConstantLoadOptimization[optimized]"); private ConstantLoadOptimization(LIR lir, LIRGeneratorTool lirGen) { this.lir = lir; diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Fri Sep 26 00:18:43 2014 +0200 @@ -399,6 +399,8 @@ throw new GraalInternalError(e).addContext(calleeInfo.toString()); } catch (GraalInternalError e) { throw e.addContext(calleeInfo.toString()); + } catch (Throwable e) { + throw Debug.handle(e); } } diff -r a552dd335bde -r 5d03b4a472c6 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Fri Sep 26 00:18:15 2014 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Fri Sep 26 00:18:43 2014 +0200 @@ -130,6 +130,8 @@ CodeCacheProvider codeCache = providers.getCodeCache(); try (Scope s = Debug.scope("CodeInstall", codeCache, method)) { codeCache.setDefaultMethod(method, compResult); + } catch (Throwable e) { + throw Debug.handle(e); } } }