# HG changeset patch # User Thomas Wuerthinger # Date 1425988083 -3600 # Node ID 2a21ea0ec141e924f2fc9e16bb3356b33d1c7703 # Parent 095ddb9421d0a2b44dc75f34e356cff1799fd45f Profile exceptions on OptimizeCallTarget#doInvoke. diff -r 095ddb9421d0 -r 2a21ea0ec141 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 Tue Mar 10 11:33:30 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Tue Mar 10 12:48:03 2015 +0100 @@ -56,6 +56,7 @@ protected final CompilationPolicy compilationPolicy; private final OptimizedCallTarget sourceCallTarget; private final AtomicInteger callSitesKnown = new AtomicInteger(0); + private final ValueProfile exceptionProfile = ValueProfile.createClassProfile(); @CompilationFinal private Class[] profiledArgumentTypes; @CompilationFinal private Assumption profiledArgumentTypesAssumption; @@ -232,7 +233,16 @@ } protected Object doInvoke(Object[] args) { - return callBoundary(args); + try { + return callBoundary(args); + } catch (Throwable t) { + t = exceptionProfile.profile(t); + if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } else { + throw new RuntimeException(t); + } + } } @TruffleCallBoundary