Ignore:
Timestamp:
Apr 19, 2012, 5:17:41 PM (13 years ago)
Author:
[email protected]
Message:

Exception stack traces aren't complete when the exception starts in native code
https://bugs.webkit.org/show_bug.cgi?id=84073

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Refactored building the stack trace to so that we can construct
it earlier, and don't rely on any prior work performed in the
exception handling machinery. Also updated LLInt and the DFG to
completely initialise the callframes of host function calls.

Also fixed a few LLInt paths that failed to correctly update the
topCallFrame.

  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • dfg/DFGJITCompiler.h:
  • dfg/DFGOperations.cpp:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • interpreter/Interpreter.cpp:

(JSC::eval):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::addStackTraceIfNecessary):
(JSC):
(JSC::Interpreter::throwException):

  • interpreter/Interpreter.h:

(Interpreter):

  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jsc.cpp:

(functionJSCStack):

  • llint/LLIntExceptions.cpp:

(JSC::LLInt::interpreterThrowInCaller):
(JSC::LLInt::returnToThrow):
(JSC::LLInt::callToThrow):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::handleHostCall):

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • parser/Parser.h:

(JSC::::parse):

  • runtime/Error.cpp:

(JSC::addErrorInfo):
(JSC::throwError):

  • runtime/Error.h:

(JSC):

LayoutTests:

Update tests to show complete trace information

  • fast/js/exception-properties-expected.txt:
  • fast/js/script-tests/exception-properties.js:
  • fast/js/script-tests/stack-trace.js:

(selfRecursive1):

  • fast/js/stack-trace-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r114664 r114702  
    15141514macro nativeCallTrampoline(executableOffsetToFunction)
    15151515    storep 0, CodeBlock[cfr]
     1516    loadp JITStackFrame::globalData + 8[sp], t0
     1517    storep cfr, JSGlobalData::topCallFrame[t0]
    15161518    loadp CallerFrame[cfr], t0
    15171519    loadp ScopeChain[t0], t1
     
    15341536    loadp CodeBlock[cfr], PB
    15351537    loadp CodeBlock::m_instructions[PB], PB
     1538    loadp JITStackFrame::globalData[sp], t0
     1539    storep cfr, JSGlobalData::topCallFrame[t0]
    15361540    callSlowPath(_llint_throw_from_native_call)
    15371541    jmp _llint_throw_from_slow_path_trampoline
Note: See TracChangeset for help on using the changeset viewer.