Changeset 48331 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 11, 2009, 9:52:39 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackConstructor.h
r47267 r48331 42 42 static PassRefPtr<Structure> createStructure(JSValue proto) 43 43 { 44 return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot | HasDefaultMark ));44 return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot | HasDefaultMark | HasDefaultGetPropertyNames)); 45 45 } 46 46 -
trunk/JavaScriptCore/ChangeLog
r48315 r48331 1 2009-09-11 Oliver Hunt <[email protected]> 2 3 Reviewed by Sam Weinig. 4 5 getPropertyNames caching is invalid when the prototype chain contains objects with custom getPropertyNames 6 https://bugs.webkit.org/show_bug.cgi?id=29214 7 8 Add a flag to TypeInfo to indicate whether a type overrides getPropertyNames. 9 This flag is used to make sure that caching of the property name data is safe. 10 11 * API/JSCallbackConstructor.h: 12 (JSC::JSCallbackConstructor::createStructure): 13 * debugger/DebuggerActivation.h: 14 (JSC::DebuggerActivation::createStructure): 15 * runtime/BooleanObject.h: 16 (JSC::BooleanObject::createStructure): 17 * runtime/DatePrototype.h: 18 (JSC::DatePrototype::createStructure): 19 * runtime/FunctionPrototype.h: 20 (JSC::FunctionPrototype::createStructure): 21 * runtime/JSONObject.h: 22 (JSC::JSONObject::createStructure): 23 * runtime/JSObject.h: 24 (JSC::JSObject::createStructure): 25 * runtime/JSTypeInfo.h: 26 (JSC::TypeInfo::hasDefaultGetPropertyNames): 27 * runtime/JSVariableObject.h: 28 (JSC::JSVariableObject::createStructure): 29 * runtime/JSWrapperObject.h: 30 (JSC::JSWrapperObject::createStructure): 31 * runtime/MathObject.h: 32 (JSC::MathObject::createStructure): 33 * runtime/NumberConstructor.h: 34 (JSC::NumberConstructor::createStructure): 35 * runtime/NumberObject.h: 36 (JSC::NumberObject::createStructure): 37 * runtime/RegExpConstructor.h: 38 (JSC::RegExpConstructor::createStructure): 39 * runtime/RegExpObject.h: 40 (JSC::RegExpObject::createStructure): 41 * runtime/StructureChain.cpp: 42 (JSC::StructureChain::isCacheable): 43 1 44 2009-09-11 Alexey Proskuryakov <[email protected]> 2 45 -
trunk/JavaScriptCore/debugger/DebuggerActivation.h
r47022 r48331 52 52 static PassRefPtr<Structure> createStructure(JSValue prototype) 53 53 { 54 return Structure::create(prototype, TypeInfo(ObjectType ));54 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultGetPropertyNames)); 55 55 } 56 56 -
trunk/JavaScriptCore/runtime/BooleanObject.h
r47267 r48331 35 35 static PassRefPtr<Structure> createStructure(JSValue prototype) 36 36 { 37 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark ));37 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark | HasDefaultGetPropertyNames)); 38 38 } 39 39 }; -
trunk/JavaScriptCore/runtime/DatePrototype.h
r47780 r48331 40 40 static PassRefPtr<Structure> createStructure(JSValue prototype) 41 41 { 42 return Structure::create(prototype, TypeInfo(ObjectType ));42 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultGetPropertyNames)); 43 43 } 44 44 }; -
trunk/JavaScriptCore/runtime/FunctionPrototype.h
r47267 r48331 35 35 static PassRefPtr<Structure> createStructure(JSValue proto) 36 36 { 37 return Structure::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark ));37 return Structure::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark | HasDefaultGetPropertyNames)); 38 38 } 39 39 -
trunk/JavaScriptCore/runtime/JSONObject.h
r47780 r48331 42 42 static PassRefPtr<Structure> createStructure(JSValue prototype) 43 43 { 44 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultMark ));44 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultMark | HasDefaultGetPropertyNames)); 45 45 } 46 46 -
trunk/JavaScriptCore/runtime/JSObject.h
r48067 r48331 206 206 static PassRefPtr<Structure> createStructure(JSValue prototype) 207 207 { 208 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark ));208 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark | HasDefaultGetPropertyNames)); 209 209 } 210 210 -
trunk/JavaScriptCore/runtime/JSTypeInfo.h
r48207 r48331 43 43 static const unsigned HasStandardGetOwnPropertySlot = 1 << 5; 44 44 static const unsigned HasDefaultMark = 1 << 6; 45 static const unsigned HasDefaultGetPropertyNames = 1 << 7; 45 46 46 47 class TypeInfo { … … 65 66 bool hasStandardGetOwnPropertySlot() const { return m_flags & HasStandardGetOwnPropertySlot; } 66 67 bool hasDefaultMark() const { return m_flags & HasDefaultMark; } 68 bool hasDefaultGetPropertyNames() const { return m_flags & HasDefaultGetPropertyNames; } 67 69 unsigned flags() const { return m_flags; } 68 70 -
trunk/JavaScriptCore/runtime/JSVariableObject.h
r47780 r48331 59 59 Register& registerAt(int index) const { return d->registers[index]; } 60 60 61 static PassRefPtr<Structure> createStructure(JSValue prototype) 62 { 63 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark)); 64 } 65 61 66 protected: 62 67 // Subclasses of JSVariableObject can subclass this struct to add data -
trunk/JavaScriptCore/runtime/JSWrapperObject.h
r48067 r48331 39 39 static PassRefPtr<Structure> createStructure(JSValue prototype) 40 40 { 41 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot ));41 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultGetPropertyNames)); 42 42 } 43 43 -
trunk/JavaScriptCore/runtime/MathObject.h
r47780 r48331 38 38 static PassRefPtr<Structure> createStructure(JSValue prototype) 39 39 { 40 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultMark ));40 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultMark | HasDefaultGetPropertyNames)); 41 41 } 42 42 }; -
trunk/JavaScriptCore/runtime/NumberConstructor.h
r47780 r48331 40 40 static PassRefPtr<Structure> createStructure(JSValue proto) 41 41 { 42 return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasDefaultMark ));42 return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasDefaultMark | HasDefaultGetPropertyNames)); 43 43 } 44 44 -
trunk/JavaScriptCore/runtime/NumberObject.h
r47522 r48331 34 34 static PassRefPtr<Structure> createStructure(JSValue prototype) 35 35 { 36 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot ));36 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultGetPropertyNames)); 37 37 } 38 38 #else 39 39 static PassRefPtr<Structure> createStructure(JSValue prototype) 40 40 { 41 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark ));41 return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark | HasDefaultGetPropertyNames)); 42 42 } 43 43 #endif -
trunk/JavaScriptCore/runtime/RegExpConstructor.h
r47780 r48331 37 37 static PassRefPtr<Structure> createStructure(JSValue prototype) 38 38 { 39 return Structure::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance | HasDefaultMark ));39 return Structure::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance | HasDefaultMark | HasDefaultGetPropertyNames)); 40 40 } 41 41 -
trunk/JavaScriptCore/runtime/RegExpObject.h
r47780 r48331 50 50 static PassRefPtr<Structure> createStructure(JSValue prototype) 51 51 { 52 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultMark ));52 return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultMark | HasDefaultGetPropertyNames)); 53 53 } 54 54 -
trunk/JavaScriptCore/runtime/StructureChain.cpp
r45039 r48331 52 52 53 53 while (m_vector[i]) { 54 if (m_vector[i++]->isDictionary()) 54 if (m_vector[i]->isDictionary()) 55 return false; 56 if (!m_vector[i++]->typeInfo().hasDefaultGetPropertyNames()) 55 57 return false; 56 58 }
Note:
See TracChangeset
for help on using the changeset viewer.