diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java @ 15064:f675818d9ad0

new getStackTrace and getCurrentFrame functionality in TruffleRuntime
author Lukas Stadler <lukas.stadler@oracle.com>
date Fri, 11 Apr 2014 11:53:11 +0200
parents 64dcb92ee75a
children 607e33885130
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java	Fri Apr 11 11:52:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleRuntime.java	Fri Apr 11 11:53:11 2014 +0200
@@ -25,6 +25,7 @@
 package com.oracle.truffle.api;
 
 import com.oracle.truffle.api.frame.*;
+import com.oracle.truffle.api.impl.*;
 import com.oracle.truffle.api.nodes.*;
 
 /**
@@ -90,4 +91,20 @@
      * @return the newly created materialized frame object
      */
     MaterializedFrame createMaterializedFrame(Object[] arguments, FrameDescriptor frameDescriptor);
+
+    /**
+     * Accesses the current stack, i.e., the contents of the {@link Frame}s and the associated
+     * {@link CallTarget}s. For this functionality to work each call needs to go through
+     * {@link DefaultCallNode#callProxy(MaterializedFrameNotify, CallTarget, VirtualFrame, Object[])}
+     * instead of calling {@link CallTarget#call(Object[])} directly.
+     *
+     * @return a lazy collection of {@link FrameInstance}.
+     */
+    Iterable<FrameInstance> getStackTrace();
+
+    /**
+     * Accesses the current frame, i.e., the frame of the closest {@link CallTarget}. It is
+     * important to note that this {@link FrameInstance} supports only slow path access.
+     */
+    FrameInstance getCurrentFrame();
 }