# HG changeset patch # User Thomas Wuerthinger # Date 1373314441 -7200 # Node ID 63083745d39093932fd03ce1071c2a103d852509 # Parent c79cf526508ea6aee313960820b870620b93ba0b Clean up OptimizedCallTarget and HotSpotNmethod.execute. diff -r c79cf526508e -r 63083745d390 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Mon Jul 08 22:12:41 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Mon Jul 08 22:14:01 2013 +0200 @@ -97,15 +97,16 @@ @Override public Object execute(Object arg1, Object arg2, Object arg3) throws InvalidInstalledCodeException { + assert checkThreeObjectArgs(); + return CompilerToVMImpl.executeCompiledMethodIntrinsic(arg1, arg2, arg3, this); + } + + protected boolean checkThreeObjectArgs() { assert method.getSignature().getParameterCount(!Modifier.isStatic(method.getModifiers())) == 3; assert method.getSignature().getParameterKind(0) == Kind.Object; assert method.getSignature().getParameterKind(1) == Kind.Object; assert !Modifier.isStatic(method.getModifiers()) || method.getSignature().getParameterKind(2) == Kind.Object; - return executeHelper(arg1, arg2, arg3, this); - } - - private static Object executeHelper(Object arg1, Object arg2, Object arg3, HotSpotInstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException { - return CompilerToVMImpl.executeCompiledMethodIntrinsic(arg1, arg2, arg3, hotspotInstalledCode); + return true; } private boolean checkArgs(Object... args) { diff -r c79cf526508e -r 63083745d390 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Mon Jul 08 22:12:41 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Mon Jul 08 22:14:01 2013 +0200 @@ -71,25 +71,29 @@ @Override public Object call(PackedFrame caller, Arguments args) { - if (compiledMethod != null) { + if (CompilerDirectives.injectBranchProbability(CompilerDirectives.FASTPATH_PROBABILITY, compiledMethod != null)) { try { return compiledMethod.execute(this, caller, args); } catch (InvalidInstalledCodeException ex) { - compiledMethod = null; - invokeCounter = invalidationReprofileCount; - if (TruffleFunctionInlining.getValue()) { - originalInvokeCounter += invalidationReprofileCount; - } - if (TraceTruffleCompilation.getValue()) { - OUT.printf("[truffle] invalidated %-48s |Alive %5.0fms\n", rootNode, (System.nanoTime() - timeCompilationFinished) / 1e6); - } - return call(caller, args); + return compiledCodeInvalidated(caller, args); } } else { return interpreterCall(caller, args); } } + protected Object compiledCodeInvalidated(PackedFrame caller, Arguments args) { + compiledMethod = null; + invokeCounter = invalidationReprofileCount; + if (TruffleFunctionInlining.getValue()) { + originalInvokeCounter += invalidationReprofileCount; + } + if (TraceTruffleCompilation.getValue()) { + OUT.printf("[truffle] invalidated %-48s |Alive %5.0fms\n", rootNode, (System.nanoTime() - timeCompilationFinished) / 1e6); + } + return call(caller, args); + } + private Object interpreterCall(PackedFrame caller, Arguments args) { invokeCounter--; loopAndInvokeCounter--;