Ignore:
Timestamp:
Feb 3, 2020, 8:22:29 PM (5 years ago)
Author:
[email protected]
Message:

[JSC] Use PackedPtr for VariableEnvironment
https://bugs.webkit.org/show_bug.cgi?id=207172

Reviewed by Mark Lam.

Since VariableEnvironment's KeyValue is key: pointer + value: 2 byte, using PackedPtr can make it 8 bytes, 50% reduction.

  • parser/VariableEnvironment.h:
  • runtime/CachedTypes.cpp:

(JSC::CachedRefPtr::encode):
(JSC::CachedRefPtr::decode const): CachedTypes should handle PackedPtr too since VariableEnvironment starts using it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/VariableEnvironment.h

    r250005 r255659  
    8686class VariableEnvironment {
    8787private:
    88     typedef HashMap<RefPtr<UniquedStringImpl>, VariableEnvironmentEntry, IdentifierRepHash, HashTraits<RefPtr<UniquedStringImpl>>, VariableEnvironmentEntryHashTraits> Map;
     88    typedef HashMap<PackedRefPtr<UniquedStringImpl>, VariableEnvironmentEntry, IdentifierRepHash, HashTraits<RefPtr<UniquedStringImpl>>, VariableEnvironmentEntryHashTraits> Map;
    8989public:
    9090    VariableEnvironment() = default;
     
    140140    CompactVariableEnvironment() = default;
    141141
    142     Vector<RefPtr<UniquedStringImpl>> m_variables;
     142    Vector<PackedRefPtr<UniquedStringImpl>> m_variables;
    143143    Vector<VariableEnvironmentEntry> m_variableMetadata;
    144144    unsigned m_hash;
Note: See TracChangeset for help on using the changeset viewer.