| Differences between
and this patch
- Source/JavaScriptCore/ChangeLog +23 lines
Lines 1-3 Source/JavaScriptCore/ChangeLog_sec1
1
2015-08-29  Filip Pizlo  <fpizlo@apple.com>
2
3
        JSC property attributes should fit in a byte
4
        https://bugs.webkit.org/show_bug.cgi?id=148611
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        In order to do some other useful things with properties, we need some more room in
9
        PropertyMapEntry. So, I made attributes take a byte. To do this, I needed to remove an old unused
10
        attribute, called ConstantInteger.
11
12
        * runtime/Lookup.h:
13
        (JSC::HashTableValue::accessorGetter):
14
        (JSC::HashTableValue::accessorSetter):
15
        (JSC::HashTableValue::lexerValue):
16
        (JSC::getStaticPropertySlot):
17
        (JSC::getStaticValueSlot):
18
        (JSC::reifyStaticProperties):
19
        (JSC::HashTableValue::constantInteger): Deleted.
20
        * runtime/PropertySlot.h:
21
        * runtime/Structure.h:
22
        (JSC::PropertyMapEntry::PropertyMapEntry):
23
1
2015-08-28  Commit Queue  <commit-queue@webkit.org>
24
2015-08-28  Commit Queue  <commit-queue@webkit.org>
2
25
3
        Unreviewed, rolling out r189136.
26
        Unreviewed, rolling out r189136.
- Source/JavaScriptCore/runtime/Lookup.h -17 lines
Lines 66-73 struct HashTableValue { Source/JavaScriptCore/runtime/Lookup.h_sec1
66
    NativeFunction accessorGetter() const { ASSERT(m_attributes & Accessor); return reinterpret_cast<NativeFunction>(m_value1); }
66
    NativeFunction accessorGetter() const { ASSERT(m_attributes & Accessor); return reinterpret_cast<NativeFunction>(m_value1); }
67
    NativeFunction accessorSetter() const { ASSERT(m_attributes & Accessor); return reinterpret_cast<NativeFunction>(m_value2); }
67
    NativeFunction accessorSetter() const { ASSERT(m_attributes & Accessor); return reinterpret_cast<NativeFunction>(m_value2); }
68
68
69
    intptr_t constantInteger() const { ASSERT(m_attributes & ConstantInteger); return m_value1; }
70
71
    intptr_t lexerValue() const { ASSERT(!m_attributes); return m_value1; }
69
    intptr_t lexerValue() const { ASSERT(!m_attributes); return m_value1; }
72
};
70
};
73
71
Lines 187-197 inline bool getStaticPropertySlot(ExecSt Source/JavaScriptCore/runtime/Lookup.h_sec2
187
    if (entry->attributes() & BuiltinOrFunctionOrAccessor)
185
    if (entry->attributes() & BuiltinOrFunctionOrAccessor)
188
        return setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
186
        return setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
189
187
190
    if (entry->attributes() & ConstantInteger) {
191
        slot.setValue(thisObj, entry->attributes(), jsNumber(entry->constantInteger()));
192
        return true;
193
    }
194
195
    slot.setCacheableCustom(thisObj, entry->attributes(), entry->propertyGetter());
188
    slot.setCacheableCustom(thisObj, entry->attributes(), entry->propertyGetter());
196
    return true;
189
    return true;
197
}
190
}
Lines 228-238 inline bool getStaticValueSlot(ExecState Source/JavaScriptCore/runtime/Lookup.h_sec3
228
221
229
    ASSERT(!(entry->attributes() & BuiltinOrFunctionOrAccessor));
222
    ASSERT(!(entry->attributes() & BuiltinOrFunctionOrAccessor));
230
223
231
    if (entry->attributes() & ConstantInteger) {
232
        slot.setValue(thisObj, entry->attributes(), jsNumber(entry->constantInteger()));
233
        return true;
234
    }
235
236
    slot.setCacheableCustom(thisObj, entry->attributes(), entry->propertyGetter());
224
    slot.setCacheableCustom(thisObj, entry->attributes(), entry->propertyGetter());
237
    return true;
225
    return true;
238
}
226
}
Lines 289-299 inline void reifyStaticProperties(VM& vm Source/JavaScriptCore/runtime/Lookup.h_sec4
289
            continue;
277
            continue;
290
        }
278
        }
291
279
292
        if (value.attributes() & ConstantInteger) {
293
            thisObj.putDirect(vm, propertyName, jsNumber(value.constantInteger()), value.attributes());
294
            continue;
295
        }
296
297
        if (value.attributes() & Accessor) {
280
        if (value.attributes() & Accessor) {
298
            reifyStaticAccessor(vm, value, thisObj, propertyName);
281
            reifyStaticAccessor(vm, value, thisObj, propertyName);
299
            continue;
282
            continue;
- Source/JavaScriptCore/runtime/PropertySlot.h -2 / +1 lines
Lines 44-53 enum Attribute { Source/JavaScriptCore/runtime/PropertySlot.h_sec1
44
    Accessor          = 1 << 5,  // property is a getter/setter
44
    Accessor          = 1 << 5,  // property is a getter/setter
45
    CustomAccessor    = 1 << 6,
45
    CustomAccessor    = 1 << 6,
46
    Builtin           = 1 << 7, // property is a builtin function - only used by static hashtables
46
    Builtin           = 1 << 7, // property is a builtin function - only used by static hashtables
47
    ConstantInteger   = 1 << 8, // property is a constant integer - only used by static hashtables
48
    BuiltinOrFunction = Builtin | Function, // helper only used by static hashtables
47
    BuiltinOrFunction = Builtin | Function, // helper only used by static hashtables
49
    BuiltinOrFunctionOrAccessor = Builtin | Function | Accessor, // helper only used by static hashtables
48
    BuiltinOrFunctionOrAccessor = Builtin | Function | Accessor, // helper only used by static hashtables
50
    BuiltinOrFunctionOrAccessorOrConstant = Builtin | Function | Accessor | ConstantInteger, // helper only used by static hashtables
49
    BuiltinOrFunctionOrAccessorOrConstant = Builtin | Function | Accessor, // helper only used by static hashtables
51
};
50
};
52
51
53
class PropertySlot {
52
class PropertySlot {
- Source/JavaScriptCore/runtime/Structure.h -2 / +3 lines
Lines 80-86 static const unsigned outOfLineGrowthFac Source/JavaScriptCore/runtime/Structure.h_sec1
80
struct PropertyMapEntry {
80
struct PropertyMapEntry {
81
    UniquedStringImpl* key;
81
    UniquedStringImpl* key;
82
    PropertyOffset offset;
82
    PropertyOffset offset;
83
    unsigned attributes;
83
    uint8_t attributes;
84
84
85
    PropertyMapEntry()
85
    PropertyMapEntry()
86
        : key(nullptr)
86
        : key(nullptr)
Lines 92-99 struct PropertyMapEntry { Source/JavaScriptCore/runtime/Structure.h_sec2
92
    PropertyMapEntry(UniquedStringImpl* key, PropertyOffset offset, unsigned attributes)
92
    PropertyMapEntry(UniquedStringImpl* key, PropertyOffset offset, unsigned attributes)
93
        : key(key)
93
        : key(key)
94
        , offset(offset)
94
        , offset(offset)
95
        , attributes(attributes)
95
        , attributes(static_cast<uint8_t>(attributes))
96
    {
96
    {
97
        ASSERT(this->attributes == attributes);
97
    }
98
    }
98
};
99
};
99
100

Return to Bug 148611