Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLStackTraceBuiltin.java @ 17122:5a260e749bca
Fixes for SimpleLanguage when compiling
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Tue, 16 Sep 2014 18:35:22 -0700 |
parents | fb1c21844758 |
children | d45951ac3ce9 |
comparison
equal
deleted
inserted
replaced
17114:8ca5e41dde86 | 17122:5a260e749bca |
---|---|
50 @SlowPath | 50 @SlowPath |
51 private static String createStackTrace() { | 51 private static String createStackTrace() { |
52 StringBuilder str = new StringBuilder(); | 52 StringBuilder str = new StringBuilder(); |
53 | 53 |
54 Truffle.getRuntime().iterateFrames(frameInstance -> { | 54 Truffle.getRuntime().iterateFrames(frameInstance -> { |
55 dumpFrame(str, frameInstance.getCallTarget(), frameInstance.getFrame(FrameAccess.READ_ONLY, true), frameInstance.isVirtualFrame()); | 55 dumpFrame(str, frameInstance.getCallTarget(), frameInstance.getFrame(FrameAccess.READ_ONLY, true)); |
56 return null; | 56 return null; |
57 }); | 57 }); |
58 return str.toString(); | 58 return str.toString(); |
59 } | 59 } |
60 | 60 |
61 private static void dumpFrame(StringBuilder str, CallTarget callTarget, Frame frame, boolean isVirtual) { | 61 private static void dumpFrame(StringBuilder str, CallTarget callTarget, Frame frame) { |
62 if (str.length() > 0) { | 62 if (str.length() > 0) { |
63 str.append("\n"); | 63 str.append("\n"); |
64 } | 64 } |
65 str.append("Frame: ").append(callTarget).append(isVirtual ? " (virtual)" : ""); | 65 str.append("Frame: ").append(((RootCallTarget) callTarget).getRootNode().toString()); |
66 FrameDescriptor frameDescriptor = frame.getFrameDescriptor(); | 66 FrameDescriptor frameDescriptor = frame.getFrameDescriptor(); |
67 for (FrameSlot s : frameDescriptor.getSlots()) { | 67 for (FrameSlot s : frameDescriptor.getSlots()) { |
68 str.append(", ").append(s.getIdentifier()).append("=").append(frame.getValue(s)); | 68 str.append(", ").append(s.getIdentifier()).append("=").append(frame.getValue(s)); |
69 } | 69 } |
70 } | 70 } |