Changeset 263619 in webkit


Ignore:
Timestamp:
Jun 27, 2020 8:53:41 AM (4 years ago)
Author:
sbarati@apple.com
Message:

BytecodeBasicBlock::addSuccessor should check if the successor already exists
https://bugs.webkit.org/show_bug.cgi?id=213670

Reviewed by Yusuke Suzuki.

It makes it nicer for algorithms using BytecodeGraph to not have to consider
whether or not there are duplicates in the successor list. Also, because of
this, bytecode liveness was doing extra work since it walked the successor list,
including any duplicates in it.

  • bytecode/BytecodeBasicBlock.h:

(JSC::BytecodeBasicBlock::addSuccessor):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r263618 r263619  
     12020-06-27  Saam Barati  <sbarati@apple.com>
     2
     3        BytecodeBasicBlock::addSuccessor should check if the  successor already exists
     4        https://bugs.webkit.org/show_bug.cgi?id=213670
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        It makes it nicer for algorithms using BytecodeGraph to not have to consider
     9        whether or not there are duplicates in the successor list. Also, because of
     10        this, bytecode liveness was doing extra work since it walked the successor list,
     11        including any duplicates in it.
     12
     13        * bytecode/BytecodeBasicBlock.h:
     14        (JSC::BytecodeBasicBlock::addSuccessor):
     15
    1162020-06-27  Saam Barati  <sbarati@apple.com>
    217
  • trunk/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h

    r255687 r263619  
    7878    void shrinkToFit();
    7979
    80     void addSuccessor(BytecodeBasicBlock& block) { m_successors.append(block.index()); }
     80    void addSuccessor(BytecodeBasicBlock& block)
     81    {
     82        if (!m_successors.contains(block.index()))
     83            m_successors.append(block.index());
     84    }
    8185
    8286    inline void addLength(unsigned);
Note: See TracChangeset for help on using the changeset viewer.