Ignore:
Timestamp:
Dec 8, 2018, 3:53:29 PM (7 years ago)
Author:
[email protected]
Message:

Reduce size of PropertySlot and PutPropertySlot.
https://bugs.webkit.org/show_bug.cgi?id=192526

Reviewed by Keith Miller.

With some minor adjustments, we can reduce the size of PropertySlot from 80 bytes
(19 padding bytes) to 64 bytes (3 padding bytes), and PutPropertySlot from 40
bytes (4 padding bytes) to 32 bytes (0 padding bytes but with 6 unused bits).
These measurements are for a 64-bit build.

  • runtime/PropertySlot.h:
  • runtime/PutPropertySlot.h:

(JSC::PutPropertySlot::PutPropertySlot):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/PutPropertySlot.h

    r230748 r239013  
    3737class PutPropertySlot {
    3838public:
    39     enum Type { Uncachable, ExistingProperty, NewProperty, SetterProperty, CustomValue, CustomAccessor };
     39    enum Type : uint8_t { Uncachable, ExistingProperty, NewProperty, SetterProperty, CustomValue, CustomAccessor };
    4040    enum Context { UnknownContext, PutById, PutByIdEval };
    4141    typedef bool (*PutValueFunc)(ExecState*, EncodedJSValue thisObject, EncodedJSValue value);
    4242
    4343    PutPropertySlot(JSValue thisValue, bool isStrictMode = false, Context context = UnknownContext, bool isInitialization = false)
    44         : m_type(Uncachable)
    45         , m_base(0)
     44        : m_base(0)
    4645        , m_thisValue(thisValue)
    4746        , m_offset(invalidOffset)
    4847        , m_isStrictMode(isStrictMode)
    4948        , m_isInitialization(isInitialization)
     49        , m_type(Uncachable)
    5050        , m_context(context)
    5151        , m_cacheability(CachingAllowed)
     
    130130    bool isCacheable() const { return m_cacheability == CachingAllowed; }
    131131
    132     Type m_type;
    133132    JSObject* m_base;
    134133    JSValue m_thisValue;
    135134    PropertyOffset m_offset;
    136     bool m_isStrictMode;
    137     bool m_isInitialization;
     135    bool m_isStrictMode : 1;
     136    bool m_isInitialization : 1;
     137    Type m_type;
    138138    uint8_t m_context;
    139139    CacheabilityType m_cacheability;
Note: See TracChangeset for help on using the changeset viewer.