Changeset 249418 in webkit


Ignore:
Timestamp:
Sep 3, 2019 12:26:55 AM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Remove BytecodeGenerator::emitPopScope
https://bugs.webkit.org/show_bug.cgi?id=201395

Reviewed by Saam Barati.

Use emitGetParentScope. And this patch also removes several unnecessary mov bytecode emissions.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::emitPopScope): Deleted.

  • bytecompiler/BytecodeGenerator.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r249372 r249418  
     12019-09-03  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Remove BytecodeGenerator::emitPopScope
     4        https://bugs.webkit.org/show_bug.cgi?id=201395
     5
     6        Reviewed by Saam Barati.
     7
     8        Use emitGetParentScope. And this patch also removes several unnecessary mov bytecode emissions.
     9
     10        * bytecompiler/BytecodeGenerator.cpp:
     11        (JSC::BytecodeGenerator::popLexicalScopeInternal):
     12        (JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
     13        (JSC::BytecodeGenerator::emitPopWithScope):
     14        (JSC::BytecodeGenerator::emitPopScope): Deleted.
     15        * bytecompiler/BytecodeGenerator.h:
     16
    1172019-09-01  Yusuke Suzuki  <ysuzuki@apple.com>
    218
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r249372 r249418  
    22202220    if (hasCapturedVariables) {
    22212221        RELEASE_ASSERT(stackEntry.m_scope);
    2222         emitPopScope(scopeRegister(), stackEntry.m_scope);
     2222        emitGetParentScope(scopeRegister(), stackEntry.m_scope);
    22232223        popLocalControlFlowScope();
    22242224        stackEntry.m_scope->deref();
     
    22782278    // the assumption that the scope's register index is constant even
    22792279    // though the value in that register will change on each loop iteration.
    2280     RefPtr<RegisterID> parentScope = emitGetParentScope(newTemporary(), loopScope);
    2281     move(scopeRegister(), parentScope.get());
     2280    emitGetParentScope(scopeRegister(), loopScope);
    22822281
    22832282    OpCreateLexicalEnvironment::emit(this, loopScope, scopeRegister(), loopSymbolTable, addConstantValue(jsTDZValue()));
     
    35123511}
    35133512
    3514 void BytecodeGenerator::emitPopScope(RegisterID* dst, RegisterID* scope)
    3515 {
    3516     RefPtr<RegisterID> parentScope = emitGetParentScope(newTemporary(), scope);
    3517     move(dst, parentScope.get());
    3518 }
    3519 
    35203513void BytecodeGenerator::emitPopWithScope()
    35213514{
    3522     emitPopScope(scopeRegister(), scopeRegister());
     3515    emitGetParentScope(scopeRegister(), scopeRegister());
    35233516    popLocalControlFlowScope();
    35243517    auto stackEntry = m_lexicalScopeStack.takeLast();
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r249372 r249418  
    10191019        bool instantiateLexicalVariables(const VariableEnvironment&, SymbolTable*, ScopeRegisterType, LookUpVarKindFunctor);
    10201020        void emitPrefillStackTDZVariables(const VariableEnvironment&, SymbolTable*);
    1021         void emitPopScope(RegisterID* dst, RegisterID* scope);
    10221021        RegisterID* emitGetParentScope(RegisterID* dst, RegisterID* scope);
    10231022        void emitPushFunctionNameScope(const Identifier& property, RegisterID* value, bool isCaptured);
Note: See TracChangeset for help on using the changeset viewer.