Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLStackTraceBuiltin.java @ 22251:8dddde8b20d4
Truffle/SL: provide an "unavailable" SourceSection for every RootNode, using a newly defined static name that identifies "SL Builtin" RootNodes.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Thu, 24 Sep 2015 13:16:52 -0700 |
parents | dc83cc1f94f2 |
children |
comparison
equal
deleted
inserted
replaced
22250:0fb3522e5b72 | 22251:8dddde8b20d4 |
---|---|
52 import com.oracle.truffle.api.frame.FrameInstanceVisitor; | 52 import com.oracle.truffle.api.frame.FrameInstanceVisitor; |
53 import com.oracle.truffle.api.frame.FrameSlot; | 53 import com.oracle.truffle.api.frame.FrameSlot; |
54 import com.oracle.truffle.api.nodes.NodeInfo; | 54 import com.oracle.truffle.api.nodes.NodeInfo; |
55 import com.oracle.truffle.api.nodes.RootNode; | 55 import com.oracle.truffle.api.nodes.RootNode; |
56 import com.oracle.truffle.api.source.SourceSection; | 56 import com.oracle.truffle.api.source.SourceSection; |
57 import com.oracle.truffle.sl.SLLanguage; | |
57 | 58 |
58 /** | 59 /** |
59 * Returns a string representation of the current stack. This includes the {@link CallTarget}s and | 60 * Returns a string representation of the current stack. This includes the {@link CallTarget}s and |
60 * the contents of the {@link Frame}. Note that this is implemented as a slow path by passing | 61 * the contents of the {@link Frame}. Note that this is implemented as a slow path by passing |
61 * {@code true} to {@link FrameInstance#getFrame(FrameAccess, boolean)}. | 62 * {@code true} to {@link FrameInstance#getFrame(FrameAccess, boolean)}. |
62 */ | 63 */ |
63 @NodeInfo(shortName = "stacktrace") | 64 @NodeInfo(shortName = "stacktrace") |
64 public abstract class SLStackTraceBuiltin extends SLBuiltinNode { | 65 public abstract class SLStackTraceBuiltin extends SLBuiltinNode { |
65 | 66 |
66 public SLStackTraceBuiltin() { | 67 public SLStackTraceBuiltin() { |
67 super(SourceSection.createUnavailable("SL builtin", "stacktrace")); | 68 super(SourceSection.createUnavailable(SLLanguage.builtinKind, "stacktrace")); |
68 } | 69 } |
69 | 70 |
70 @Specialization | 71 @Specialization |
71 public String trace() { | 72 public String trace() { |
72 return createStackTrace(); | 73 return createStackTrace(); |