Changeset 210119 in webkit


Ignore:
Timestamp:
Dec 22, 2016, 3:23:51 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

BytecodeGenerator::m_finallyDepth should be unsigned.
https://bugs.webkit.org/show_bug.cgi?id=166438

Reviewed by Saam Barati.

Also removed FinallyContext::m_finallyDepth because it is not used.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::pushFinallyControlFlowScope):
(JSC::BytecodeGenerator::labelScopeDepth):

  • bytecompiler/BytecodeGenerator.h:

(JSC::FinallyContext::FinallyContext):
(JSC::FinallyContext::finallyLabel):
(JSC::FinallyContext::depth): Deleted.

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/JavaScriptCore/ChangeLog

    r210116 r210119  
     12016-12-22  Mark Lam  <mark.lam@apple.com>
     2
     3        BytecodeGenerator::m_finallyDepth should be unsigned.
     4        https://bugs.webkit.org/show_bug.cgi?id=166438
     5
     6        Reviewed by Saam Barati.
     7
     8        Also removed FinallyContext::m_finallyDepth because it is not used.
     9
     10        * bytecompiler/BytecodeGenerator.cpp:
     11        (JSC::BytecodeGenerator::pushFinallyControlFlowScope):
     12        (JSC::BytecodeGenerator::labelScopeDepth):
     13        * bytecompiler/BytecodeGenerator.h:
     14        (JSC::FinallyContext::FinallyContext):
     15        (JSC::FinallyContext::finallyLabel):
     16        (JSC::FinallyContext::depth): Deleted.
     17
    1182016-12-22  Mark Lam  <mark.lam@apple.com>
    219
  • TabularUnified trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r210116 r210119  
    36883688        m_labelScopes.removeLast();
    36893689
    3690     ControlFlowScope scope(ControlFlowScope::Finally, currentLexicalScopeIndex(), FinallyContext(m_currentFinallyContext, finallyLabel, m_finallyDepth));
     3690    ControlFlowScope scope(ControlFlowScope::Finally, currentLexicalScopeIndex(), FinallyContext(m_currentFinallyContext, finallyLabel));
    36913691    m_controlFlowScopeStack.append(WTFMove(scope));
    36923692
     
    38873887int BytecodeGenerator::labelScopeDepth() const
    38883888{
    3889     int depth = localScopeDepth() + m_finallyDepth;
    3890     ASSERT(depth == static_cast<int>(m_controlFlowScopeStack.size()));
     3889    unsigned depth = localScopeDepth() + m_finallyDepth;
     3890    ASSERT(depth == m_controlFlowScopeStack.size());
    38913891    return depth;
    38923892}
  • TabularUnified trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r210116 r210119  
    122122    struct FinallyContext {
    123123        FinallyContext() { }
    124         FinallyContext(FinallyContext* outerContext, Label* finallyLabel, int finallyDepth)
     124        FinallyContext(FinallyContext* outerContext, Label* finallyLabel)
    125125            : m_outerContext(outerContext)
    126126            , m_finallyLabel(finallyLabel)
    127             , m_finallyDepth(finallyDepth)
    128         {
    129             ASSERT(m_finallyDepth >= 0);
     127        {
    130128            ASSERT(m_jumps.isEmpty());
    131129        }
     
    133131        FinallyContext* outerContext() const { return m_outerContext; }
    134132        Label* finallyLabel() const { return m_finallyLabel; }
    135         int depth() const { return m_finallyDepth; }
    136133
    137134        uint32_t numberOfBreaksOrContinues() const { return m_numberOfBreaksOrContinues.unsafeGet(); }
     
    152149        FinallyContext* m_outerContext { nullptr };
    153150        Label* m_finallyLabel { nullptr };
    154         int m_finallyDepth { 0 };
    155151        Checked<uint32_t, WTF::CrashOnOverflow> m_numberOfBreaksOrContinues;
    156152        bool m_handlesReturns { false };
     
    10921088        SegmentedVector<Label, 32> m_labels;
    10931089        LabelScopeStore m_labelScopes;
    1094         int m_finallyDepth { 0 };
     1090        unsigned m_finallyDepth { 0 };
    10951091        int m_localScopeDepth { 0 };
    10961092        const CodeType m_codeType;
Note: See TracChangeset for help on using the changeset viewer.