Changeset 55397 in webkit for trunk/JavaScriptCore/runtime/PropertySlot.h
- Timestamp:
- Mar 1, 2010, 8:08:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/PropertySlot.h
r55002 r55397 35 35 #define JSC_VALUE_SLOT_MARKER 0 36 36 #define JSC_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1) 37 #define INDEX_GETTER_MARKER reinterpret_cast<GetValueFunc>(2) 37 38 38 39 class PropertySlot { … … 53 54 54 55 typedef JSValue (*GetValueFunc)(ExecState*, const Identifier&, const PropertySlot&); 56 typedef JSValue (*GetIndexValueFunc)(ExecState*, JSValue slotBase, unsigned); 55 57 56 58 JSValue getValue(ExecState* exec, const Identifier& propertyName) const … … 60 62 if (m_getValue == JSC_REGISTER_SLOT_MARKER) 61 63 return (*m_data.registerSlot).jsValue(); 64 if (m_getValue == INDEX_GETTER_MARKER) 65 return m_getIndexValue(exec, slotBase(), index()); 62 66 return m_getValue(exec, propertyName, *this); 63 67 } … … 69 73 if (m_getValue == JSC_REGISTER_SLOT_MARKER) 70 74 return (*m_data.registerSlot).jsValue(); 75 if (m_getValue == INDEX_GETTER_MARKER) 76 return m_getIndexValue(exec, m_slotBase, m_data.index); 71 77 return m_getValue(exec, Identifier::from(exec, propertyName), *this); 72 78 } … … 133 139 ASSERT(getValue); 134 140 m_getValue = getValue; 135 m_slotBase = slotBase; 136 } 137 138 void setCustomIndex(JSValue slotBase, unsigned index, GetValueFunc getValue) 141 m_getIndexValue = 0; 142 m_slotBase = slotBase; 143 } 144 145 void setCustomIndex(JSValue slotBase, unsigned index, GetIndexValueFunc getIndexValue) 139 146 { 140 147 ASSERT(slotBase); 141 ASSERT(getValue); 142 m_getValue = getValue; 148 ASSERT(getIndexValue); 149 m_getValue = INDEX_GETTER_MARKER; 150 m_getIndexValue = getIndexValue; 143 151 m_slotBase = slotBase; 144 152 m_data.index = index; … … 213 221 214 222 GetValueFunc m_getValue; 223 GetIndexValueFunc m_getIndexValue; 215 224 216 225 JSValue m_slotBase;
Note:
See TracChangeset
for help on using the changeset viewer.