Ignore:
Timestamp:
Apr 6, 2013, 3:47:56 PM (12 years ago)
Author:
[email protected]
Message:

Unify the many and varied stack trace mechanisms, and make the result sane.
https://bugs.webkit.org/show_bug.cgi?id=114072

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Makes JSC::StackFrame record the bytecode offset and other necessary data
rather than requiring us to perform eager evaluation of the line number, etc.
Then remove most of the users of retrieveLastCaller, as most of them were
using it to create a stack trace in a fairly incomplete and inefficient way.

StackFrame now also has a couple of helpers to get the line and column info.

  • API/JSContextRef.cpp:

(JSContextCreateBacktrace):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitDebugHook):

  • interpreter/Interpreter.cpp:

(JSC):
(JSC::Interpreter::dumpRegisters):
(JSC::Interpreter::unwindCallFrame):
(JSC::getBytecodeOffsetForCallFrame):
(JSC::getCallerInfo):
(JSC::StackFrame::line):
(JSC::StackFrame::column):
(JSC::StackFrame::expressionInfo):
(JSC::StackFrame::toString):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::addStackTraceIfNecessary):
(JSC::Interpreter::retrieveCallerFromVMCode):

  • interpreter/Interpreter.h:

(StackFrame):
(Interpreter):

  • runtime/Error.cpp:

(JSC::throwError):

  • runtime/JSGlobalData.h:

(JSC):
(JSGlobalData):

  • runtime/JSGlobalObject.cpp:

(JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):

Source/WebCore:

Now that we've fleshed out the StackFrames from Interpreter::getStackTrace
WebCore can just ask us for a stack trace rather than implementing its own
stack walking.

  • bindings/js/ScriptCallStackFactory.cpp:

(WebCore::createScriptCallStack):

  • inspector/ScriptCallFrame.cpp:

(WebCore::ScriptCallFrame::isEqual):

  • inspector/ScriptCallFrame.h:

(ScriptCallFrame):
(WebCore::ScriptCallFrame::columnNumber):

Tools:

The commandline jsc executable no longer requires arguments, so
I've made run-jsc work without them.

  • Scripts/run-jsc:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r147857 r147858  
     12013-04-06  Oliver Hunt  <[email protected]>
     2
     3        Unify the many and varied stack trace mechanisms, and make the result sane.
     4        https://bugs.webkit.org/show_bug.cgi?id=114072
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Makes JSC::StackFrame record the bytecode offset and other necessary data
     9        rather than requiring us to perform eager evaluation of the line number, etc.
     10        Then remove most of the users of retrieveLastCaller, as most of them were
     11        using it to create a stack trace in a fairly incomplete and inefficient way.
     12
     13        StackFrame now also has a couple of helpers to get the line and column info.
     14
     15        * API/JSContextRef.cpp:
     16        (JSContextCreateBacktrace):
     17        * bytecompiler/BytecodeGenerator.cpp:
     18        (JSC::BytecodeGenerator::emitDebugHook):
     19        * interpreter/Interpreter.cpp:
     20        (JSC):
     21        (JSC::Interpreter::dumpRegisters):
     22        (JSC::Interpreter::unwindCallFrame):
     23        (JSC::getBytecodeOffsetForCallFrame):
     24        (JSC::getCallerInfo):
     25        (JSC::StackFrame::line):
     26        (JSC::StackFrame::column):
     27        (JSC::StackFrame::expressionInfo):
     28        (JSC::StackFrame::toString):
     29        (JSC::Interpreter::getStackTrace):
     30        (JSC::Interpreter::addStackTraceIfNecessary):
     31        (JSC::Interpreter::retrieveCallerFromVMCode):
     32        * interpreter/Interpreter.h:
     33        (StackFrame):
     34        (Interpreter):
     35        * runtime/Error.cpp:
     36        (JSC::throwError):
     37        * runtime/JSGlobalData.h:
     38        (JSC):
     39        (JSGlobalData):
     40        * runtime/JSGlobalObject.cpp:
     41        (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
     42
    1432013-04-06  Geoffrey Garen  <[email protected]>
    244
Note: See TracChangeset for help on using the changeset viewer.