Changeset 155219 in webkit for trunk/Source/JavaScriptCore/runtime
- Timestamp:
- Sep 6, 2013, 3:32:08 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r154459 r155219 145 145 146 146 struct ClassInfo { 147 /** 148 * A string denoting the class name. Example: "Window". 149 */ 147 // A string denoting the class name. Example: "Window". 150 148 const char* className; 151 149 152 /** 153 * Pointer to the class information of the base class. 154 * 0L if there is none. 155 */ 150 // Pointer to the class information of the base class. 151 // nullptrif there is none. 156 152 const ClassInfo* parentClass; 157 /** 158 *Static hash-table of properties.159 * For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value.160 */153 154 // Static hash-table of properties. 155 // For classes that can be used from multiple threads, it is accessed via a getter function 156 // that would typically return a pointer to a thread-specific value. 161 157 const HashTable* propHashTable(ExecState* exec) const 162 158 { 163 159 if (classPropHashTableGetterFunction) 164 return classPropHashTableGetterFunction(exec); 160 return &classPropHashTableGetterFunction(exec); 161 165 162 return staticPropHashTable; 166 163 } … … 185 182 186 183 const HashTable* staticPropHashTable; 187 typedef const HashTable *(*ClassPropHashTableGetterFunction)(ExecState*);184 typedef const HashTable& (*ClassPropHashTableGetterFunction)(ExecState*); 188 185 const ClassPropHashTableGetterFunction classPropHashTableGetterFunction; 189 186 -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r154336 r155219 242 242 */ 243 243 template <class ThisImp, class ParentImp> 244 inline bool getStaticPropertySlot(ExecState* exec, const HashTable *table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)245 { 246 const HashEntry* entry = table ->entry(exec, propertyName);244 inline bool getStaticPropertySlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot) 245 { 246 const HashEntry* entry = table.entry(exec, propertyName); 247 247 248 248 if (!entry) // not found, forward to parent … … 262 262 */ 263 263 template <class ParentImp> 264 inline bool getStaticFunctionSlot(ExecState* exec, const HashTable *table, JSObject* thisObj, PropertyName propertyName, PropertySlot& slot)264 inline bool getStaticFunctionSlot(ExecState* exec, const HashTable& table, JSObject* thisObj, PropertyName propertyName, PropertySlot& slot) 265 265 { 266 266 if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot)) 267 267 return true; 268 268 269 const HashEntry* entry = table ->entry(exec, propertyName);269 const HashEntry* entry = table.entry(exec, propertyName); 270 270 if (!entry) 271 271 return false; … … 279 279 */ 280 280 template <class ThisImp, class ParentImp> 281 inline bool getStaticValueSlot(ExecState* exec, const HashTable *table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)282 { 283 const HashEntry* entry = table ->entry(exec, propertyName);281 inline bool getStaticValueSlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot) 282 { 283 const HashEntry* entry = table.entry(exec, propertyName); 284 284 285 285 if (!entry) // not found, forward to parent … … 310 310 */ 311 311 template <class ThisImp> 312 inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable *table, ThisImp* thisObj, bool shouldThrow = false)313 { 314 const HashEntry* entry = table ->entry(exec, propertyName);312 inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, bool shouldThrow = false) 313 { 314 const HashEntry* entry = table.entry(exec, propertyName); 315 315 316 316 if (!entry) … … 328 328 */ 329 329 template <class ThisImp, class ParentImp> 330 inline void lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable *table, ThisImp* thisObj, PutPropertySlot& slot)330 inline void lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, PutPropertySlot& slot) 331 331 { 332 332 if (!lookupPut<ThisImp>(exec, propertyName, value, table, thisObj, slot.isStrictMode())) -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r155023 r155219 156 156 , clientData(0) 157 157 , topCallFrame(CallFrame::noCaller()->removeHostCallFrameFlag()) 158 , arrayConstructorTable( fastNew<HashTable>(JSC::arrayConstructorTable))159 , arrayPrototypeTable( fastNew<HashTable>(JSC::arrayPrototypeTable))160 , booleanPrototypeTable( fastNew<HashTable>(JSC::booleanPrototypeTable))161 , dataViewTable( fastNew<HashTable>(JSC::dataViewTable))162 , dateTable( fastNew<HashTable>(JSC::dateTable))163 , dateConstructorTable( fastNew<HashTable>(JSC::dateConstructorTable))164 , errorPrototypeTable( fastNew<HashTable>(JSC::errorPrototypeTable))165 , globalObjectTable( fastNew<HashTable>(JSC::globalObjectTable))166 , jsonTable( fastNew<HashTable>(JSC::jsonTable))167 , numberConstructorTable( fastNew<HashTable>(JSC::numberConstructorTable))168 , numberPrototypeTable( fastNew<HashTable>(JSC::numberPrototypeTable))169 , objectConstructorTable( fastNew<HashTable>(JSC::objectConstructorTable))170 , privateNamePrototypeTable( fastNew<HashTable>(JSC::privateNamePrototypeTable))171 , regExpTable( fastNew<HashTable>(JSC::regExpTable))172 , regExpConstructorTable( fastNew<HashTable>(JSC::regExpConstructorTable))173 , regExpPrototypeTable( fastNew<HashTable>(JSC::regExpPrototypeTable))174 , stringConstructorTable( fastNew<HashTable>(JSC::stringConstructorTable))158 , arrayConstructorTable(adoptPtr(new HashTable(JSC::arrayConstructorTable))) 159 , arrayPrototypeTable(adoptPtr(new HashTable(JSC::arrayPrototypeTable))) 160 , booleanPrototypeTable(adoptPtr(new HashTable(JSC::booleanPrototypeTable))) 161 , dataViewTable(adoptPtr(new HashTable(JSC::dataViewTable))) 162 , dateTable(adoptPtr(new HashTable(JSC::dateTable))) 163 , dateConstructorTable(adoptPtr(new HashTable(JSC::dateConstructorTable))) 164 , errorPrototypeTable(adoptPtr(new HashTable(JSC::errorPrototypeTable))) 165 , globalObjectTable(adoptPtr(new HashTable(JSC::globalObjectTable))) 166 , jsonTable(adoptPtr(new HashTable(JSC::jsonTable))) 167 , numberConstructorTable(adoptPtr(new HashTable(JSC::numberConstructorTable))) 168 , numberPrototypeTable(adoptPtr(new HashTable(JSC::numberPrototypeTable))) 169 , objectConstructorTable(adoptPtr(new HashTable(JSC::objectConstructorTable))) 170 , privateNamePrototypeTable(adoptPtr(new HashTable(JSC::privateNamePrototypeTable))) 171 , regExpTable(adoptPtr(new HashTable(JSC::regExpTable))) 172 , regExpConstructorTable(adoptPtr(new HashTable(JSC::regExpConstructorTable))) 173 , regExpPrototypeTable(adoptPtr(new HashTable(JSC::regExpPrototypeTable))) 174 , stringConstructorTable(adoptPtr(new HashTable(JSC::stringConstructorTable))) 175 175 #if ENABLE(PROMISES) 176 , promisePrototypeTable( fastNew<HashTable>(JSC::promisePrototypeTable))177 , promiseConstructorTable( fastNew<HashTable>(JSC::promiseConstructorTable))178 , promiseResolverPrototypeTable( fastNew<HashTable>(JSC::promiseResolverPrototypeTable))176 , promisePrototypeTable(adoptPtr(new HashTable(JSC::promisePrototypeTable))) 177 , promiseConstructorTable(adoptPtr(new HashTable(JSC::promiseConstructorTable))) 178 , promiseResolverPrototypeTable(adoptPtr(new HashTable(JSC::promiseResolverPrototypeTable))) 179 179 #endif 180 180 , identifierTable(vmType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable()) … … 333 333 #endif 334 334 335 fastDelete(const_cast<HashTable*>(arrayConstructorTable));336 fastDelete(const_cast<HashTable*>(arrayPrototypeTable));337 fastDelete(const_cast<HashTable*>(booleanPrototypeTable));338 fastDelete(const_cast<HashTable*>(dataViewTable));339 fastDelete(const_cast<HashTable*>(dateTable));340 fastDelete(const_cast<HashTable*>(dateConstructorTable));341 fastDelete(const_cast<HashTable*>(errorPrototypeTable));342 fastDelete(const_cast<HashTable*>(globalObjectTable));343 fastDelete(const_cast<HashTable*>(jsonTable));344 fastDelete(const_cast<HashTable*>(numberConstructorTable));345 fastDelete(const_cast<HashTable*>(numberPrototypeTable));346 fastDelete(const_cast<HashTable*>(objectConstructorTable));347 fastDelete(const_cast<HashTable*>(privateNamePrototypeTable));348 fastDelete(const_cast<HashTable*>(regExpTable));349 fastDelete(const_cast<HashTable*>(regExpConstructorTable));350 fastDelete(const_cast<HashTable*>(regExpPrototypeTable));351 fastDelete(const_cast<HashTable*>(stringConstructorTable));352 #if ENABLE(PROMISES)353 fastDelete(const_cast<HashTable*>(promisePrototypeTable));354 fastDelete(const_cast<HashTable*>(promiseConstructorTable));355 fastDelete(const_cast<HashTable*>(promiseResolverPrototypeTable));356 #endif357 358 335 delete emptyList; 359 336 -
trunk/Source/JavaScriptCore/runtime/VM.h
r155023 r155219 223 223 Watchdog watchdog; 224 224 225 const HashTable*arrayConstructorTable;226 const HashTable*arrayPrototypeTable;227 const HashTable*booleanPrototypeTable;228 const HashTable*dataViewTable;229 const HashTable*dateTable;230 const HashTable*dateConstructorTable;231 const HashTable*errorPrototypeTable;232 const HashTable*globalObjectTable;233 const HashTable*jsonTable;234 const HashTable*numberConstructorTable;235 const HashTable*numberPrototypeTable;236 const HashTable*objectConstructorTable;237 const HashTable*privateNamePrototypeTable;238 const HashTable*regExpTable;239 const HashTable*regExpConstructorTable;240 const HashTable*regExpPrototypeTable;241 const HashTable*stringConstructorTable;225 const OwnPtr<const HashTable> arrayConstructorTable; 226 const OwnPtr<const HashTable> arrayPrototypeTable; 227 const OwnPtr<const HashTable> booleanPrototypeTable; 228 const OwnPtr<const HashTable> dataViewTable; 229 const OwnPtr<const HashTable> dateTable; 230 const OwnPtr<const HashTable> dateConstructorTable; 231 const OwnPtr<const HashTable> errorPrototypeTable; 232 const OwnPtr<const HashTable> globalObjectTable; 233 const OwnPtr<const HashTable> jsonTable; 234 const OwnPtr<const HashTable> numberConstructorTable; 235 const OwnPtr<const HashTable> numberPrototypeTable; 236 const OwnPtr<const HashTable> objectConstructorTable; 237 const OwnPtr<const HashTable> privateNamePrototypeTable; 238 const OwnPtr<const HashTable> regExpTable; 239 const OwnPtr<const HashTable> regExpConstructorTable; 240 const OwnPtr<const HashTable> regExpPrototypeTable; 241 const OwnPtr<const HashTable> stringConstructorTable; 242 242 #if ENABLE(PROMISES) 243 const HashTable*promisePrototypeTable;244 const HashTable*promiseConstructorTable;245 const HashTable*promiseResolverPrototypeTable;243 const OwnPtr<const HashTable> promisePrototypeTable; 244 const OwnPtr<const HashTable> promiseConstructorTable; 245 const OwnPtr<const HashTable> promiseResolverPrototypeTable; 246 246 #endif 247 247
Note:
See TracChangeset
for help on using the changeset viewer.