⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 239898 in webkit


Ignore:
Timestamp:
Jan 12, 2019, 1:49:17 AM (8 years ago)
Author:
yusukesuzuki@slowstart.org
Message:

Unreviewed, fix scope check assertions
​https://bugs.webkit.org/show_bug.cgi?id=193308

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::notifyLexicalBindingShadowing):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::notifyLexicalBindingShadowing):

  • runtime/ProgramExecutable.cpp:

(JSC::ProgramExecutable::initializeGlobalProperties):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r239888 r239898  
     12019-01-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
     2
     3        Unreviewed, fix scope check assertions
     4        https://bugs.webkit.org/show_bug.cgi?id=193308
     5
     6        * bytecode/CodeBlock.cpp:
     7        (JSC::CodeBlock::notifyLexicalBindingShadowing):
     8        * runtime/JSGlobalObject.cpp:
     9        (JSC::JSGlobalObject::notifyLexicalBindingShadowing):
     10        * runtime/ProgramExecutable.cpp:
     11        (JSC::ProgramExecutable::initializeGlobalProperties):
     12
    1132019-01-11  John Wilander  <wilander@apple.com>
    214
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r239879 r239898  
    26772677    JSGlobalObject* globalObject = m_globalObject.get();
    26782678
    2679     auto throwScope = DECLARE_THROW_SCOPE(vm);
     2679    auto scope = DECLARE_THROW_SCOPE(vm);
    26802680
    26812681    ConcurrentJSLocker locker(m_lock);
    … …  
    26942694                    // It should immediately find the lexical binding because that's the reason why we perform this rewriting now.
    26952695                    ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), bytecode.localScopeDepth, globalObject->globalScope(), ident, Get, bytecode.resolveType, InitializationMode::NotInitialization);
    2696                     EXCEPTION_ASSERT_UNUSED(throwScope, !throwScope.exception());
     2696                    scope.releaseAssertNoException();
    26972697                    ASSERT(op.type == GlobalLexicalVarWithVarInjectionChecks || op.type == GlobalLexicalVar);
    26982698                    metadata.resolveType = needsVarInjectionChecks(originalResolveType) ? GlobalLexicalVarWithVarInjectionChecks : GlobalLexicalVar;
    … …  
    27182718                    // It should immediately find the lexical binding because that's the reason why we perform this rewriting now.
    27192719                    ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), bytecode.localScopeDepth, globalObject->globalScope(), ident, Get, bytecode.getPutInfo.resolveType(), InitializationMode::NotInitialization);
    2720                     EXCEPTION_ASSERT_UNUSED(throwScope, !throwScope.exception());
     2720                    scope.releaseAssertNoException();
    27212721                    ASSERT(op.type == GlobalLexicalVarWithVarInjectionChecks || op.type == GlobalLexicalVar);
    27222722                    metadata.getPutInfo = GetPutInfo(bytecode.getPutInfo.resolveMode(), needsVarInjectionChecks(originalResolveType) ? GlobalLexicalVarWithVarInjectionChecks : GlobalLexicalVar, bytecode.getPutInfo.initializationMode());
    … …  
    27392739                    // It should immediately find the lexical binding because that's the reason why we perform this rewriting now.
    27402740                    ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), bytecode.symbolTableOrScopeDepth, globalObject->globalScope(), ident, Put, bytecode.getPutInfo.resolveType(), bytecode.getPutInfo.initializationMode());
    2741                     EXCEPTION_ASSERT_UNUSED(throwScope, !throwScope.exception());
     2741                    scope.releaseAssertNoException();
    27422742                    ASSERT(op.type == GlobalLexicalVarWithVarInjectionChecks || op.type == GlobalLexicalVar || op.type == Dynamic);
    27432743
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r239879 r239898  
    18541854void JSGlobalObject::notifyLexicalBindingShadowing(VM& vm, const IdentifierSet& set)
    18551855{
     1856    auto scope = DECLARE_THROW_SCOPE(vm);
    18561857#if ENABLE(DFG_JIT)
    18571858    for (const auto& key : set)
    … …  
    18621863            return;
    18631864        codeBlock->notifyLexicalBindingShadowing(vm, set);
     1865        scope.assertNoException();
    18641866    });
     1867    scope.release();
    18651868}
    18661869
  • trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp

    r239879 r239898  
    208208    }
    209209
    210     if (!shadowedProperties.isEmpty())
     210    if (!shadowedProperties.isEmpty()) {
    211211        globalObject->notifyLexicalBindingShadowing(vm, WTFMove(shadowedProperties));
     212        throwScope.assertNoException();
     213    }
    212214
    213215    return nullptr;
Note: See TracChangeset for help on using the changeset viewer.