changeset 22011:95d5d6a93968

add more truffle boundaries
author Andreas Woess <andreas.woess@oracle.com>
date Thu, 23 Jul 2015 17:23:05 +0200
parents f410818cdec8
children 09531c471176
files truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/Debugger.java truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/LineBreakpointFactory.java truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/TagBreakpointFactory.java
diffstat 3 files changed, 26 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/Debugger.java	Thu Jul 23 16:28:48 2015 +0200
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/Debugger.java	Thu Jul 23 17:23:05 2015 +0200
@@ -399,7 +399,7 @@
         @Override
         protected void setStrategy(final int stackDepth) {
             Probe.setBeforeTagTrap(new SyntaxTagTrap(STEPPING_TAG) {
-
+                @TruffleBoundary
                 @Override
                 public void tagTrappedAt(Node node, MaterializedFrame mFrame) {
                     // HALT: just before statement
@@ -413,7 +413,7 @@
                 }
             });
             Probe.setAfterTagTrap(new SyntaxTagTrap(CALL_TAG) {
-
+                @TruffleBoundary
                 @Override
                 public void tagTrappedAt(Node node, MaterializedFrame mFrame) {
                     --unfinishedStepCount;
@@ -500,7 +500,7 @@
         @Override
         protected void setStrategy(final int stackDepth) {
             Probe.setBeforeTagTrap(new SyntaxTagTrap(STEPPING_TAG) {
-
+                @TruffleBoundary
                 @Override
                 public void tagTrappedAt(Node node, MaterializedFrame mFrame) {
                     final int currentStackDepth = currentStackDepth();
@@ -525,7 +525,7 @@
             });
 
             Probe.setAfterTagTrap(new SyntaxTagTrap(CALL_TAG) {
-
+                @TruffleBoundary
                 @Override
                 public void tagTrappedAt(Node node, MaterializedFrame mFrame) {
                     final int currentStackDepth = currentStackDepth();
@@ -575,7 +575,7 @@
         @Override
         protected void setStrategy(final int stackDepth) {
             Probe.setBeforeTagTrap(new SyntaxTagTrap(STEPPING_TAG) {
-
+                @TruffleBoundary
                 @Override
                 public void tagTrappedAt(Node node, MaterializedFrame mFrame) {
                     final int currentStackDepth = currentStackDepth();
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/LineBreakpointFactory.java	Thu Jul 23 16:28:48 2015 +0200
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/LineBreakpointFactory.java	Thu Jul 23 17:23:05 2015 +0200
@@ -69,6 +69,7 @@
 
     private static final String BREAKPOINT_NAME = "LINE BREAKPOINT";
 
+    @TruffleBoundary
     private static void trace(String format, Object... args) {
         if (TRACE) {
             OUT.println(String.format("%s: %s", BREAKPOINT_NAME, String.format(format, args)));
@@ -344,6 +345,7 @@
             return conditionExpr;
         }
 
+        @TruffleBoundary
         @Override
         public void dispose() {
             if (getState() != DISPOSED) {
@@ -377,6 +379,7 @@
             }
         }
 
+        @TruffleBoundary
         private String getShortDescription() {
             return BREAKPOINT_NAME + "@" + getLineLocation().getShortDescription();
         }
@@ -433,16 +436,20 @@
             }
         }
 
-        @TruffleBoundary
         public void notifyFailure(Node node, VirtualFrame vFrame, RuntimeException ex) {
-            warningLog.addWarning(String.format("Exception in %s:  %s", getShortDescription(), ex.getMessage()));
+            addExceptionWarning(ex);
             if (TRACE) {
-                trace("breakpoint failure = %s  %s", ex.toString(), getShortDescription());
+                trace("breakpoint failure = %s  %s", ex, getShortDescription());
             }
             // Take the breakpoint if evaluation fails.
             nodeEnter(node, vFrame);
         }
 
+        @TruffleBoundary
+        private void addExceptionWarning(RuntimeException ex) {
+            warningLog.addWarning(String.format("Exception in %s:  %s", getShortDescription(), ex.getMessage()));
+        }
+
         @Override
         public String getLocationDescription() {
             return "Line: " + lineLocation.getShortDescription();
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/TagBreakpointFactory.java	Thu Jul 23 16:28:48 2015 +0200
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/TagBreakpointFactory.java	Thu Jul 23 17:23:05 2015 +0200
@@ -32,6 +32,7 @@
 
 import com.oracle.truffle.api.*;
 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
+import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
 import com.oracle.truffle.api.debug.Debugger.BreakpointCallback;
 import com.oracle.truffle.api.debug.Debugger.WarningLog;
 import com.oracle.truffle.api.frame.*;
@@ -72,6 +73,7 @@
 
     private static final String BREAKPOINT_NAME = "TAG BREAKPOINT";
 
+    @TruffleBoundary
     private static void trace(String format, Object... args) {
         if (TRACE) {
             OUT.println(String.format("%s: %s", BREAKPOINT_NAME, String.format(format, args)));
@@ -307,6 +309,7 @@
             return conditionExpr;
         }
 
+        @TruffleBoundary
         @Override
         public void dispose() {
             if (getState() != DISPOSED) {
@@ -340,6 +343,7 @@
             }
         }
 
+        @TruffleBoundary
         private String getShortDescription() {
             return BREAKPOINT_NAME + "@" + tag.name();
         }
@@ -398,14 +402,19 @@
         }
 
         public void notifyFailure(Node node, VirtualFrame vFrame, RuntimeException ex) {
-            warningLog.addWarning(String.format("Exception in %s:  %s", getShortDescription(), ex.getMessage()));
+            addExceptionWarning(ex);
             if (TRACE) {
-                trace("breakpoint failure = %s  %s", ex.toString(), getShortDescription());
+                trace("breakpoint failure = %s  %s", ex, getShortDescription());
             }
             // Take the breakpoint if evaluation fails.
             nodeEnter(node, vFrame);
         }
 
+        @TruffleBoundary
+        private void addExceptionWarning(RuntimeException ex) {
+            warningLog.addWarning(String.format("Exception in %s:  %s", getShortDescription(), ex.getMessage()));
+        }
+
         @Override
         public String getLocationDescription() {
             return "Tag " + tag.name();