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):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCall):
(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::privateCompileCTINativeCall):
(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):
(JSC::addErrorInfo):
(JSC::throwError):
(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: