changeset 17191:be733832464d

Allow subclasses to intercept Truffle call boundaries
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 23 Sep 2014 19:22:45 -0700
parents 9ff6aee72c8b
children d0d76deeacb9
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java	Tue Sep 23 19:22:01 2014 -0700
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java	Tue Sep 23 19:22:45 2014 -0700
@@ -118,12 +118,12 @@
             profiledArgumentTypesAssumption.invalidate();
             profiledArgumentTypes = null;
         }
-        return callBoundary(args);
+        return doInvoke(args);
     }
 
     public Object callDirect(Object... args) {
         profileArguments(args);
-        Object result = callBoundary(args);
+        Object result = doInvoke(args);
         Class<?> klass = profiledReturnType;
         if (klass != null && CompilerDirectives.inCompiledCode() && profiledReturnTypeAssumption.isValid()) {
             result = CompilerDirectives.unsafeCast(result, klass, true, true);
@@ -191,8 +191,12 @@
         }
     }
 
+    protected Object doInvoke(Object[] args) {
+        return callBoundary(args);
+    }
+
     @TruffleCallBoundary
-    private Object callBoundary(Object[] args) {
+    protected final Object callBoundary(Object[] args) {
         if (CompilerDirectives.inInterpreter()) {
             // We are called and we are still in Truffle interpreter mode.
             interpreterCall();