Ignore:
Timestamp:
Nov 13, 2018, 8:57:33 PM (7 years ago)
Author:
[email protected]
Message:

TypeProfileLog::processLogEntries should stash away any pending exceptions and re-apply them to the VM
https://bugs.webkit.org/show_bug.cgi?id=191600

Reviewed by Mark Lam.

JSTests:

  • stress/type-profiler-log-should-defer-pending-exceptions.js: Added.

(foo):
(test):
(bar):

Source/JavaScriptCore:

processLogEntries will call into calculatedClassName, which will clear
any exceptions it encounters (it assumes that they're stack overflow exceptions).
However, this code may be called when an exception is already pending on the
VM (e.g, when we throw an exception in the DFG, we compile an OSR exit
offramp, which may compile a baseline codeblock, which will process
the type profiler log). To get around this, processLogEntires should stash
away and re-apply any pending exceptions.

  • dfg/DFGDriver.cpp:

(JSC::DFG::compileImpl):

  • dfg/DFGOperations.cpp:
  • inspector/agents/InspectorRuntimeAgent.cpp:

(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):

  • jit/JIT.cpp:

(JSC::JIT::doMainThreadPreparationBeforeCompile):

  • jit/JITOperations.cpp:
  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/TypeProfilerLog.cpp:

(JSC::TypeProfilerLog::processLogEntries):

  • runtime/TypeProfilerLog.h:
  • runtime/VM.cpp:

(JSC::VM::dumpTypeProfilerData):

  • runtime/VM.h:

(JSC::VM::DeferExceptionScope::DeferExceptionScope):

  • tools/JSDollarVM.cpp:

(JSC::functionFindTypeForExpression):
(JSC::functionReturnTypeFor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp

    r237469 r238162  
    19471947    VM& vm = exec->vm();
    19481948    RELEASE_ASSERT(vm.typeProfiler());
    1949     vm.typeProfilerLog()->processLogEntries("jsc Testing API: functionFindTypeForExpression"_s);
     1949    vm.typeProfilerLog()->processLogEntries(vm, "jsc Testing API: functionFindTypeForExpression"_s);
    19501950
    19511951    JSValue functionValue = exec->argument(0);
     
    19661966    VM& vm = exec->vm();
    19671967    RELEASE_ASSERT(vm.typeProfiler());
    1968     vm.typeProfilerLog()->processLogEntries("jsc Testing API: functionReturnTypeFor"_s);
     1968    vm.typeProfilerLog()->processLogEntries(vm, "jsc Testing API: functionReturnTypeFor"_s);
    19691969
    19701970    JSValue functionValue = exec->argument(0);
Note: See TracChangeset for help on using the changeset viewer.