Changeset 108036 in webkit for trunk/Source/JavaScriptCore/interpreter/Interpreter.h
- Timestamp:
- Feb 16, 2012, 10:43:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/interpreter/Interpreter.h
r108020 r108036 32 32 #include "ArgList.h" 33 33 #include "JSCell.h" 34 #include "JSFunction.h"35 34 #include "JSValue.h" 36 35 #include "JSObject.h" … … 44 43 class CodeBlock; 45 44 class EvalExecutable; 46 class ExecutableBase;47 45 class FunctionExecutable; 46 class JSFunction; 48 47 class JSGlobalObject; 49 48 class ProgramExecutable; … … 64 63 }; 65 64 66 enum StackFrameCodeType {67 StackFrameGlobalCode,68 StackFrameEvalCode,69 StackFrameFunctionCode,70 StackFrameNativeCode71 };72 73 struct StackFrame {74 Strong<JSObject> callee;75 StackFrameCodeType codeType;76 Strong<ExecutableBase> executable;77 int line;78 UString sourceURL;79 UString toString(CallFrame* callFrame) const80 {81 bool hasSourceURLInfo = !sourceURL.isNull() && !sourceURL.isEmpty();82 bool hasLineInfo = line > -1;83 String traceLine;84 JSObject* stackFrameCallee = callee.get();85 86 switch (codeType) {87 case StackFrameEvalCode:88 if (hasSourceURLInfo) {89 traceLine = hasLineInfo ? String::format("eval code@%s:%d", sourceURL.ascii().data(), line)90 : String::format("eval code@%s", sourceURL.ascii().data());91 } else92 traceLine = String::format("eval code");93 break;94 case StackFrameNativeCode: {95 if (callee) {96 UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee);97 traceLine = String::format("%s@[native code]", functionName.ascii().data());98 } else99 traceLine = "[native code]";100 break;101 }102 case StackFrameFunctionCode: {103 UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee);104 if (hasSourceURLInfo) {105 traceLine = hasLineInfo ? String::format("%s@%s:%d", functionName.ascii().data(), sourceURL.ascii().data(), line)106 : String::format("%s@%s", functionName.ascii().data(), sourceURL.ascii().data());107 } else108 traceLine = String::format("%s\n", functionName.ascii().data());109 break;110 }111 case StackFrameGlobalCode:112 if (hasSourceURLInfo) {113 traceLine = hasLineInfo ? String::format("global code@%s:%d", sourceURL.ascii().data(), line)114 : String::format("global code@%s", sourceURL.ascii().data());115 } else116 traceLine = String::format("global code");117 118 }119 return traceLine.impl();120 }121 };122 123 65 class TopCallFrameSetter { 124 66 public: … … 210 152 NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset); 211 153 NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine); 212 static const UString getTraceLine(CallFrame*, StackFrameCodeType, const UString&, int);213 JS_EXPORT_PRIVATE static void getStackTrace(JSGlobalData*, int line, Vector<StackFrame>& results);214 154 215 155 void dumpSampleData(ExecState* exec);
Note:
See TracChangeset
for help on using the changeset viewer.