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

Changeset 276290 in webkit


Ignore:
Timestamp:
Apr 20, 2021, 12:26:08 AM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Use FixedVector for LLIntPrototypeLoadAdaptiveStructureWatchpoint vector
https://bugs.webkit.org/show_bug.cgi?id=224729

Reviewed by Darin Adler.

Replace Vector<LLIntPrototypeLoadAdaptiveStructureWatchpoint> with FixedVector.

  • bytecode/CodeBlock.h:
  • bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:

(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::LLIntPrototypeLoadAdaptiveStructureWatchpoint):
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::initialize):

  • bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::setupGetByIdPrototypeCache):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r276259 r276290  
     12021-04-20  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Use FixedVector for LLIntPrototypeLoadAdaptiveStructureWatchpoint vector
     4        https://bugs.webkit.org/show_bug.cgi?id=224729
     5
     6        Reviewed by Darin Adler.
     7
     8        Replace Vector<LLIntPrototypeLoadAdaptiveStructureWatchpoint> with FixedVector.
     9
     10        * bytecode/CodeBlock.h:
     11        * bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
     12        (JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::LLIntPrototypeLoadAdaptiveStructureWatchpoint):
     13        (JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::initialize):
     14        * bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:
     15        * llint/LLIntSlowPaths.cpp:
     16        (JSC::LLInt::setupGetByIdPrototypeCache):
     17
    1182021-04-19  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r276102 r276290  
    670670    }
    671671
    672     typedef HashMap<std::tuple<StructureID, unsigned>, Vector<LLIntPrototypeLoadAdaptiveStructureWatchpoint>> StructureWatchpointMap;
     672    typedef HashMap<std::tuple<StructureID, unsigned>, FixedVector<LLIntPrototypeLoadAdaptiveStructureWatchpoint>> StructureWatchpointMap;
    673673    StructureWatchpointMap& llintGetByIdWatchpointMap() { return m_llintGetByIdWatchpointMap; }
    674674
  • trunk/Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp

    r261895 r276290  
    4141    RELEASE_ASSERT(key.watchingRequiresStructureTransitionWatchpoint());
    4242    RELEASE_ASSERT(!key.watchingRequiresReplacementWatchpoint());
     43}
     44
     45LLIntPrototypeLoadAdaptiveStructureWatchpoint::LLIntPrototypeLoadAdaptiveStructureWatchpoint()
     46    : Watchpoint(Watchpoint::Type::LLIntPrototypeLoadAdaptiveStructure)
     47    , m_owner(nullptr)
     48    , m_bytecodeOffset(0)
     49{
     50}
     51
     52void LLIntPrototypeLoadAdaptiveStructureWatchpoint::initialize(CodeBlock* codeBlock, const ObjectPropertyCondition& key, unsigned bytecodeOffset)
     53{
     54    m_owner = codeBlock;
     55    m_bytecodeOffset = bytecodeOffset;
     56    m_key = key;
    4357}
    4458
  • trunk/Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h

    r260323 r276290  
    3737public:
    3838    LLIntPrototypeLoadAdaptiveStructureWatchpoint(CodeBlock*, const ObjectPropertyCondition&, unsigned bytecodeOffset);
     39    LLIntPrototypeLoadAdaptiveStructureWatchpoint();
     40
     41    void initialize(CodeBlock*, const ObjectPropertyCondition&, unsigned bytecodeOffset);
    3942
    4043    void install(VM&);
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r275995 r276290  
    724724    PropertyOffset offset = invalidOffset;
    725725    CodeBlock::StructureWatchpointMap& watchpointMap = codeBlock->llintGetByIdWatchpointMap();
    726     Vector<LLIntPrototypeLoadAdaptiveStructureWatchpoint> watchpoints;
    727     watchpoints.reserveInitialCapacity(conditions.size());
     726    FixedVector<LLIntPrototypeLoadAdaptiveStructureWatchpoint> watchpoints(conditions.size());
     727    unsigned index = 0;
    728728    for (ObjectPropertyCondition condition : conditions) {
     729        auto& watchpoint = watchpoints[index++];
    729730        if (!condition.isWatchable())
    730731            return;
    731732        if (condition.condition().kind() == PropertyCondition::Presence)
    732733            offset = condition.condition().offset();
    733         watchpoints.uncheckedConstructAndAppend(codeBlock, condition, bytecodeOffset);
    734         watchpoints.last().install(vm);
     734        watchpoint.initialize(codeBlock, condition, bytecodeOffset);
     735        watchpoint.install(vm);
    735736    }
    736737
Note: See TracChangeset for help on using the changeset viewer.