diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 16535:ada0a7729b6f

Truffle: introduce debug option to print the stack trace when transferring to the interpreter
author Andreas Woess <andreas.woess@jku.at>
date Wed, 16 Jul 2014 15:18:48 +0200
parents df724f63f776
children 2834b4432586
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java	Tue Jul 15 11:52:45 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java	Wed Jul 16 15:18:48 2014 +0200
@@ -65,6 +65,9 @@
      * insert a transfer to the interpreter.
      */
     public static void transferToInterpreter() {
+        if (inInterpreter()) {
+            Truffle.getRuntime().notifyTransferToInterpreter();
+        }
     }
 
     /**
@@ -72,6 +75,9 @@
      * insert a transfer to the interpreter, invalidating the currently executing machine code.
      */
     public static void transferToInterpreterAndInvalidate() {
+        if (inInterpreter()) {
+            Truffle.getRuntime().notifyTransferToInterpreter();
+        }
     }
 
     /**