Ignore:
Timestamp:
Nov 4, 2013, 1:28:38 PM (12 years ago)
Author:
[email protected]
Message:

Eliminate HostCall bit from JSC Stack CallerFrame
https://bugs.webkit.org/show_bug.cgi?id=123642

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Replace the HostCallFrame bit or'ed to the CallerFrame value in a CallFrame with
a VM entry sentinel CallFrame. Logically, the VM entry sentinel call frame is
pushed on the stack before the callee frame when calling from native to JavaScript
code. The callee frame's CallerFrame points at the VM entry sentinel call frame
and the VM entry sentinel call frame's CallerFrame points to the real caller.
The VM entry sentinel call frame has a sentinel (1) in the CodeBlock to indicate
its a VM entry sentinel call frame. It's ScopeChain has vm.topCallFrame at the
time of the call. This allows for a complete stack walk as well as walking just
the contiguous JS frames.

The VM entry sentinel call frame and callee frame are currently allocated and
initialized in ExecState::init(), but this initialization will be moved to
ctiTrampoline when we actually move onto the native stack.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::noticeIncomingCall):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::callerFrame):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileExceptionHandlers):

  • interpreter/CallFrame.h:

(JSC::ExecState::frameExtent):
(JSC::ExecState::currentVPC):
(JSC::ExecState::setCurrentVPC):
(JSC::ExecState::init):
(JSC::ExecState::noCaller):
(JSC::ExecState::isVMEntrySentinel):
(JSC::ExecState::vmEntrySentinelCallerFrame):
(JSC::ExecState::initializeVMEntrySentinelFrame):
(JSC::ExecState::callerFrameSkippingVMEntrySentinel):
(JSC::ExecState::vmEntrySentinelCodeBlock):

  • interpreter/Interpreter.cpp:

(JSC::unwindCallFrame):
(JSC::Interpreter::getStackTrace):

  • interpreter/Interpreter.h:

(JSC::TopCallFrameSetter::TopCallFrameSetter):
(JSC::TopCallFrameSetter::~TopCallFrameSetter):
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):

  • interpreter/JSStack.cpp:

(JSC::JSStack::~JSStack):

  • interpreter/JSStackInlines.h:

(JSC::JSStack::getStartOfFrame):
(JSC::JSStack::pushFrame):
(JSC::JSStack::popFrame):

  • interpreter/Register.h:

(JSC::Register::operator=):
(JSC::Register::callFrame):

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::readFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::readInlinedFrame):
(JSC::StackVisitor::Frame::print):

  • interpreter/VMInspector.cpp:

(JSC::VMInspector::countFrames):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileExceptionHandlers):

  • jit/JITOperations.cpp:
  • jit/JITStubsARM.h:

(JSC::ctiTrampoline):

  • jit/JITStubsARM64.h:
  • jit/JITStubsARMv7.h:

(JSC::ctiTrampoline):

  • jit/JITStubsMIPS.h:
  • jit/JITStubsMSVC64.asm:
  • jit/JITStubsSH4.h:
  • jit/JITStubsX86.h:
  • jit/JITStubsX86_64.h:
  • jsc.cpp:

(functionDumpCallFrame):

  • llint/LowLevelInterpreter.cpp:

(JSC::CLoop::execute):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::throwException):

Source/WebCore:

Updated JavaScript stack walking as a result of the corresponding changes made in
JavaScriptCore.

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):

  • bindings/js/ScriptDebugServer.cpp:

(WebCore::ScriptDebugServer::stepOutOfFunction):
(WebCore::ScriptDebugServer::returnEvent):
(WebCore::ScriptDebugServer::didExecuteProgram):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r158492 r158586  
    307307EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState* exec)
    308308{
    309     if (!exec->callerFrame()->hasHostCallFrameFlag())
     309    if (!exec->callerFrame()->isVMEntrySentinel())
    310310        exec->vm().interpreter->dumpCallFrame(exec->callerFrame());
    311311    return JSValue::encode(jsUndefined());
Note: See TracChangeset for help on using the changeset viewer.