# HG changeset patch # User Christian Humer # Date 1397494016 -7200 # Node ID 607e33885130073578fe842d7110d55ff5a27bee # Parent 07e7aae059830e6edb354139813fb4c291c3394a Truffle: Merge context sensitive inlining removal with stack trace support. diff -r 07e7aae05983 -r 607e33885130 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotFrameInstance.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotFrameInstance.java Mon Apr 14 18:25:23 2014 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotFrameInstance.java Mon Apr 14 18:46:56 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.code.stack.*; import com.oracle.graal.graph.*; +import com.oracle.graal.truffle.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.SlowPath; import com.oracle.truffle.api.frame.*; @@ -99,14 +100,14 @@ /** * This class represents a frame that is taken from the - * {@link DefaultCallNode#callProxy(MaterializedFrameNotify, CallTarget, VirtualFrame, Object[])} + * {@link OptimizedCallNode#callProxy(MaterializedFrameNotify, OptimizedCallTarget, VirtualFrame, Object[], boolean)} * method. */ public static final class CallNodeFrame extends HotSpotFrameInstance { public static final Method METHOD; static { try { - METHOD = DefaultCallNode.class.getDeclaredMethod("callProxy", MaterializedFrameNotify.class, CallTarget.class, VirtualFrame.class, Object[].class); + METHOD = OptimizedCallNode.class.getDeclaredMethod("callProxy", MaterializedFrameNotify.class, OptimizedCallTarget.class, VirtualFrame.class, Object[].class, boolean.class); } catch (NoSuchMethodException | SecurityException e) { throw new GraalInternalError(e); } diff -r 07e7aae05983 -r 607e33885130 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallNode.java Mon Apr 14 18:25:23 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallNode.java Mon Apr 14 18:46:56 2014 +0200 @@ -25,6 +25,7 @@ import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.frame.*; +import com.oracle.truffle.api.frame.FrameInstance.*; import com.oracle.truffle.api.impl.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.nodes.NodeUtil.NodeCountFilter; @@ -73,11 +74,22 @@ if (CompilerDirectives.inInterpreter()) { onInterpreterCall(); } - OptimizedCallTarget target = getCurrentCallTarget(); - if (inlined) { - return target.callInlined(arguments); - } else { - return super.call(frame, arguments); + return callProxy(this, getCurrentCallTarget(), frame, arguments, inlined); + } + + public static Object callProxy(MaterializedFrameNotify notify, OptimizedCallTarget callTarget, VirtualFrame frame, Object[] arguments, boolean inlined) { + try { + if (notify.getOutsideFrameAccess() != FrameAccess.NONE) { + CompilerDirectives.materialize(frame); + } + if (inlined) { + return callTarget.callInlined(arguments); + } else { + return callTarget.call(arguments); + } + } finally { + // this assertion is needed to keep the values from being cleared as non-live locals + assert notify != null & callTarget != null & frame != null; } } diff -r 07e7aae05983 -r 607e33885130 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Mon Apr 14 18:25:23 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Mon Apr 14 18:46:56 2014 +0200 @@ -44,7 +44,7 @@ @Option(help = "Restrict compilation to comma-separated list of includes (or excludes prefixed with tilde)") public static final OptionValue TruffleCompileOnly = new OptionValue<>(null); @Option(help = "Compile call target when call count exceeds this threshold") - public static final OptionValue TruffleCompilationThreshold = new OptionValue<>(1000); + public static final OptionValue TruffleCompilationThreshold = new OptionValue<>(3); @Option(help = "Minimum number of calls before a call target is compiled") public static final OptionValue TruffleMinInvokeThreshold = new OptionValue<>(3); @Option(help = "Delay compilation after an invalidation to allow for reprofiling") @@ -70,7 +70,7 @@ @Option(help = "Number of most recently used methods in truffle cache") public static final OptionValue TruffleMaxCompilationCacheSize = new OptionValue<>(512); @Option(help = "Enable asynchronous truffle compilation in background thread") - public static final OptionValue TruffleBackgroundCompilation = new OptionValue<>(true); + public static final OptionValue TruffleBackgroundCompilation = new OptionValue<>(false); @Option(help = "") public static final OptionValue TruffleUseTimeForCompilationDecision = new OptionValue<>(false); @Option(help = "") diff -r 07e7aae05983 -r 607e33885130 graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java Mon Apr 14 18:25:23 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java Mon Apr 14 18:46:56 2014 +0200 @@ -25,7 +25,6 @@ package com.oracle.truffle.api; import com.oracle.truffle.api.frame.*; -import com.oracle.truffle.api.impl.*; import com.oracle.truffle.api.nodes.*; /** @@ -94,9 +93,7 @@ /** * Accesses the current stack, i.e., the contents of the {@link Frame}s and the associated - * {@link CallTarget}s. For this functionality to work each call needs to go through - * {@link DefaultCallNode#callProxy(MaterializedFrameNotify, CallTarget, VirtualFrame, Object[])} - * instead of calling {@link CallTarget#call(Object[])} directly. + * {@link CallTarget}s. * * @return a lazy collection of {@link FrameInstance}. */ diff -r 07e7aae05983 -r 607e33885130 graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultCallNode.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultCallNode.java Mon Apr 14 18:25:23 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultCallNode.java Mon Apr 14 18:46:56 2014 +0200 @@ -42,19 +42,7 @@ @Override public Object call(VirtualFrame frame, Object[] arguments) { - return callProxy(this, getCurrentCallTarget(), frame, arguments); - } - - public static Object callProxy(MaterializedFrameNotify notify, CallTarget callTarget, VirtualFrame frame, Object[] arguments) { - try { - if (notify.getOutsideFrameAccess() != FrameAccess.NONE) { - CompilerDirectives.materialize(frame); - } - return callTarget.call(arguments); - } finally { - // this assertion is needed to keep the values from being cleared as non-live locals - assert notify != null & callTarget != null & frame != null; - } + return getCurrentCallTarget().call(arguments); } @Override