Ignore:
Timestamp:
Aug 8, 2017, 5:26:04 PM (8 years ago)
Author:
[email protected]
Message:

Make JSC_validateExceptionChecks=1 succeed on JSTests/slowMicrobenchmarks/spread-small-array.js.
https://bugs.webkit.org/show_bug.cgi?id=175347

Patch by Robin Morisset <[email protected]> on 2017-08-08
Reviewed by Saam Barati.

This is done by making finishCreation explicitely check for exceptions after setConstantRegister and setConstantIdentifiersSetRegisters.
I chose to have this check replace the boolean returned previously by these functions for readability. The performance impact should be
negligible considering how much more finishCreation does.
This fix then caused another issue to appear as it was now clear that finishCreation can throw. And since it is called by ProgramCodeBlock::create(),
FunctionCodeBlock::create() and friends, that are in turn called by ScriptExecutable::newCodeBlockFor, this last function also required a few tweaks.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
(JSC::CodeBlock::setConstantRegisters):

  • bytecode/CodeBlock.h:
  • runtime/ScriptExecutable.cpp:

(JSC::ScriptExecutable::newCodeBlockFor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ScriptExecutable.cpp

    r217108 r220432  
    188188            executable, executable->m_unlinkedEvalCodeBlock.get(), scope,
    189189            executable->source().provider());
     190        ASSERT(throwScope.exception() || codeBlock);
    190191        if (!codeBlock) {
    191192            exception = throwException(
     
    205206            executable, executable->m_unlinkedProgramCodeBlock.get(), scope,
    206207            executable->source().provider(), startColumn());
     208        ASSERT(throwScope.exception() || codeBlock);
    207209        if (!codeBlock) {
    208210            exception = throwException(
     
    222224            executable, executable->m_unlinkedModuleProgramCodeBlock.get(), scope,
    223225            executable->source().provider(), startColumn());
     226        ASSERT(throwScope.exception() || codeBlock);
    224227        if (!codeBlock) {
    225228            exception = throwException(
     
    252255    }
    253256
     257    throwScope.release();
    254258    return FunctionCodeBlock::create(vm, executable, unlinkedCodeBlock, scope,
    255259        source().provider(), source().startOffset(), startColumn());
Note: See TracChangeset for help on using the changeset viewer.