Changeset 49721 in webkit
- Timestamp:
- Oct 16, 2009, 6:06:40 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackConstructor.h
r49694 r49721 42 42 static PassRefPtr<Structure> createStructure(JSValue proto) 43 43 { 44 return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));44 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 45 45 } 46 47 protected: 48 static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; 46 49 47 50 private: -
trunk/JavaScriptCore/API/JSCallbackFunction.h
r49649 r49721 42 42 static PassRefPtr<Structure> createStructure(JSValue proto) 43 43 { 44 return Structure::create(proto, TypeInfo(ObjectType ));44 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 45 45 } 46 46 -
trunk/JavaScriptCore/API/JSCallbackObject.h
r49694 r49721 51 51 static PassRefPtr<Structure> createStructure(JSValue proto) 52 52 { 53 return Structure::create(proto, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesMarkChildren | OverridesGetPropertyNames));53 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 54 54 } 55 56 protected: 57 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | Base::StructureFlags; 55 58 56 59 private: -
trunk/JavaScriptCore/ChangeLog
r49717 r49721 1 2009-10-16 Oliver Hunt <[email protected]> 2 3 Reviewed by Gavin Barraclough. 4 5 structure typeinfo flags should be inherited. 6 https://bugs.webkit.org/show_bug.cgi?id=30468 7 8 Add StructureFlag constant to the various JSC classes and use 9 it for the TypeInfo construction. This allows us to simply 10 accumulate flags by basing each classes StructureInfo on its parents. 11 12 * API/JSCallbackConstructor.h: 13 (JSC::JSCallbackConstructor::createStructure): 14 * API/JSCallbackFunction.h: 15 (JSC::JSCallbackFunction::createStructure): 16 * API/JSCallbackObject.h: 17 (JSC::JSCallbackObject::createStructure): 18 * debugger/DebuggerActivation.h: 19 (JSC::DebuggerActivation::createStructure): 20 * runtime/Arguments.h: 21 (JSC::Arguments::createStructure): 22 * runtime/BooleanObject.h: 23 (JSC::BooleanObject::createStructure): 24 * runtime/DatePrototype.h: 25 (JSC::DatePrototype::createStructure): 26 * runtime/FunctionPrototype.h: 27 (JSC::FunctionPrototype::createStructure): 28 * runtime/GlobalEvalFunction.h: 29 (JSC::GlobalEvalFunction::createStructure): 30 * runtime/InternalFunction.h: 31 (JSC::InternalFunction::createStructure): 32 * runtime/JSActivation.h: 33 (JSC::JSActivation::createStructure): 34 * runtime/JSArray.h: 35 (JSC::JSArray::createStructure): 36 * runtime/JSByteArray.cpp: 37 (JSC::JSByteArray::createStructure): 38 * runtime/JSByteArray.h: 39 * runtime/JSFunction.h: 40 (JSC::JSFunction::createStructure): 41 * runtime/JSGlobalObject.h: 42 (JSC::JSGlobalObject::createStructure): 43 * runtime/JSNotAnObject.h: 44 (JSC::JSNotAnObject::createStructure): 45 * runtime/JSONObject.h: 46 (JSC::JSONObject::createStructure): 47 * runtime/JSObject.h: 48 (JSC::JSObject::createStructure): 49 * runtime/JSStaticScopeObject.h: 50 (JSC::JSStaticScopeObject::createStructure): 51 * runtime/JSVariableObject.h: 52 (JSC::JSVariableObject::createStructure): 53 * runtime/JSWrapperObject.h: 54 (JSC::JSWrapperObject::createStructure): 55 * runtime/MathObject.h: 56 (JSC::MathObject::createStructure): 57 * runtime/NumberConstructor.h: 58 (JSC::NumberConstructor::createStructure): 59 * runtime/NumberObject.h: 60 (JSC::NumberObject::createStructure): 61 * runtime/RegExpConstructor.h: 62 (JSC::RegExpConstructor::createStructure): 63 * runtime/RegExpObject.h: 64 (JSC::RegExpObject::createStructure): 65 * runtime/StringObject.h: 66 (JSC::StringObject::createStructure): 67 * runtime/StringObjectThatMasqueradesAsUndefined.h: 68 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): 69 1 70 2009-10-16 Geoffrey Garen <[email protected]> 2 71 -
trunk/JavaScriptCore/debugger/DebuggerActivation.h
r49694 r49721 52 52 static PassRefPtr<Structure> createStructure(JSValue prototype) 53 53 { 54 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren));54 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 55 55 } 56 57 protected: 58 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | JSObject::StructureFlags; 56 59 57 60 private: -
trunk/JavaScriptCore/runtime/Arguments.h
r49694 r49721 86 86 static PassRefPtr<Structure> createStructure(JSValue prototype) 87 87 { 88 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames)); 89 } 88 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 89 } 90 91 protected: 92 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags; 90 93 91 94 private: -
trunk/JavaScriptCore/runtime/BooleanObject.h
r49694 r49721 35 35 static PassRefPtr<Structure> createStructure(JSValue prototype) 36 36 { 37 return Structure::create(prototype, TypeInfo(ObjectType ));37 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 38 38 } 39 39 }; -
trunk/JavaScriptCore/runtime/DatePrototype.h
r49694 r49721 40 40 static PassRefPtr<Structure> createStructure(JSValue prototype) 41 41 { 42 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren));42 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 43 43 } 44 45 protected: 46 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | DateInstance::StructureFlags; 47 44 48 }; 45 49 -
trunk/JavaScriptCore/runtime/FunctionPrototype.h
r49694 r49721 35 35 static PassRefPtr<Structure> createStructure(JSValue proto) 36 36 { 37 return Structure::create(proto, TypeInfo(ObjectType ));37 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 38 38 } 39 39 -
trunk/JavaScriptCore/runtime/GlobalEvalFunction.h
r49694 r49721 38 38 static PassRefPtr<Structure> createStructure(JSValue prototype) 39 39 { 40 return Structure::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames));40 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 41 41 } 42 43 protected: 44 static const unsigned StructureFlags = ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | PrototypeFunction::StructureFlags; 42 45 43 46 private: -
trunk/JavaScriptCore/runtime/InternalFunction.h
r49649 r49721 43 43 static PassRefPtr<Structure> createStructure(JSValue proto) 44 44 { 45 return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));45 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 46 46 } 47 47 48 48 protected: 49 static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; 50 49 51 InternalFunction(NonNullPassRefPtr<Structure> structure) : JSObject(structure) { } 50 52 InternalFunction(JSGlobalData*, NonNullPassRefPtr<Structure>, const Identifier&); -
trunk/JavaScriptCore/runtime/JSActivation.h
r49694 r49721 67 67 static const ClassInfo info; 68 68 69 static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesMarkChildren | OverridesGetPropertyNames)); } 69 static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); } 70 71 protected: 72 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags; 70 73 71 74 private: -
trunk/JavaScriptCore/runtime/JSArray.h
r49694 r49721 88 88 static PassRefPtr<Structure> createStructure(JSValue prototype) 89 89 { 90 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames));90 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 91 91 } 92 92 … … 94 94 95 95 protected: 96 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags; 96 97 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 97 98 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); -
trunk/JavaScriptCore/runtime/JSByteArray.cpp
r49694 r49721 46 46 PassRefPtr<Structure> JSByteArray::createStructure(JSValue prototype) 47 47 { 48 PassRefPtr<Structure> result = Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesGetPropertyNames));48 PassRefPtr<Structure> result = Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 49 49 return result; 50 50 } -
trunk/JavaScriptCore/runtime/JSByteArray.h
r48836 r49721 92 92 WTF::ByteArray* storage() const { return m_storage.get(); } 93 93 94 protected: 95 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags; 96 94 97 private: 95 98 enum VPtrStealingHackType { VPtrStealingHack }; -
trunk/JavaScriptCore/runtime/JSFunction.h
r49694 r49721 62 62 static PassRefPtr<Structure> createStructure(JSValue prototype) 63 63 { 64 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames));64 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 65 65 } 66 66 … … 72 72 virtual ConstructType getConstructData(ConstructData&); 73 73 virtual CallType getCallData(CallData&); 74 75 protected: 76 const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | InternalFunction::StructureFlags; 74 77 75 78 private: -
trunk/JavaScriptCore/runtime/JSGlobalObject.h
r49694 r49721 268 268 static PassRefPtr<Structure> createStructure(JSValue prototype) 269 269 { 270 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames));270 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 271 271 } 272 272 273 273 protected: 274 275 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags; 276 274 277 struct GlobalPropertyInfo { 275 278 GlobalPropertyInfo(const Identifier& i, JSValue v, unsigned a) -
trunk/JavaScriptCore/runtime/JSNotAnObject.h
r49694 r49721 63 63 static PassRefPtr<Structure> createStructure(JSValue prototype) 64 64 { 65 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames));65 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 66 66 } 67 67 68 68 private: 69 70 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags; 71 69 72 // JSValue methods 70 73 virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const; -
trunk/JavaScriptCore/runtime/JSONObject.h
r49694 r49721 42 42 static PassRefPtr<Structure> createStructure(JSValue prototype) 43 43 { 44 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot));44 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 45 45 } 46 46 47 47 static void markStringifiers(MarkStack&, Stringifier*); 48 49 protected: 50 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 48 51 49 52 private: -
trunk/JavaScriptCore/runtime/JSObject.h
r49694 r49721 208 208 static PassRefPtr<Structure> createStructure(JSValue prototype) 209 209 { 210 return Structure::create(prototype, TypeInfo(ObjectType ));210 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 211 211 } 212 212 213 213 protected: 214 static const unsigned StructureFlags = 0; 215 214 216 void addAnonymousSlots(unsigned count); 215 217 void putAnonymousValue(unsigned index, JSValue value) -
trunk/JavaScriptCore/runtime/JSStaticScopeObject.h
r49694 r49721 58 58 void putWithAttributes(ExecState*, const Identifier&, JSValue, unsigned attributes); 59 59 60 static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesMarkChildren | OverridesGetPropertyNames)); } 60 static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); } 61 62 protected: 63 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags; 61 64 62 65 private: -
trunk/JavaScriptCore/runtime/JSVariableObject.h
r49694 r49721 61 61 static PassRefPtr<Structure> createStructure(JSValue prototype) 62 62 { 63 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetPropertyNames));63 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 64 64 } 65 65 66 66 protected: 67 static const unsigned StructureFlags = OverridesGetPropertyNames | JSObject::StructureFlags; 67 68 // Subclasses of JSVariableObject can subclass this struct to add data 68 69 // without increasing their own size (since there's a hard limit on the -
trunk/JavaScriptCore/runtime/JSWrapperObject.h
r49694 r49721 39 39 static PassRefPtr<Structure> createStructure(JSValue prototype) 40 40 { 41 return Structure::create(prototype, TypeInfo(ObjectType ));41 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 42 42 } 43 43 -
trunk/JavaScriptCore/runtime/MathObject.h
r49694 r49721 38 38 static PassRefPtr<Structure> createStructure(JSValue prototype) 39 39 { 40 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot));40 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 41 41 } 42 43 protected: 44 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 42 45 }; 43 46 -
trunk/JavaScriptCore/runtime/NumberConstructor.h
r49694 r49721 40 40 static PassRefPtr<Structure> createStructure(JSValue proto) 41 41 { 42 return Structure::create(proto, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | ImplementsHasInstance));42 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 43 43 } 44 44 45 45 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue }; 46 47 protected: 48 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags; 46 49 47 50 private: -
trunk/JavaScriptCore/runtime/NumberObject.h
r49694 r49721 31 31 32 32 static const ClassInfo info; 33 #if USE(JSVALUE32) 33 34 34 static PassRefPtr<Structure> createStructure(JSValue prototype) 35 35 { 36 return Structure::create(prototype, TypeInfo(ObjectType, OverridesMarkChildren));36 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 37 37 } 38 39 protected: 40 #if USE(JSVALUE32) 41 static const unsigned StructureFlags = OverridesMarkChildren | JSWrapperObject::StructureFlags; 38 42 #else 39 static PassRefPtr<Structure> createStructure(JSValue prototype) 40 { 41 return Structure::create(prototype, TypeInfo(ObjectType)); 42 } 43 static const unsigned StructureFlags = JSWrapperObject::StructureFlags; 43 44 #endif 45 44 46 private: 45 47 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/runtime/RegExpConstructor.h
r49694 r49721 60 60 static PassRefPtr<Structure> createStructure(JSValue prototype) 61 61 { 62 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | ImplementsHasInstance));62 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 63 63 } 64 64 … … 82 82 JSValue getLeftContext(ExecState*) const; 83 83 JSValue getRightContext(ExecState*) const; 84 85 protected: 86 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags; 84 87 85 88 private: -
trunk/JavaScriptCore/runtime/RegExpObject.h
r49694 r49721 50 50 static PassRefPtr<Structure> createStructure(JSValue prototype) 51 51 { 52 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot));52 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 53 53 } 54 55 protected: 56 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 54 57 55 58 private: -
trunk/JavaScriptCore/runtime/StringObject.h
r49694 r49721 49 49 static PassRefPtr<Structure> createStructure(JSValue prototype) 50 50 { 51 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames));51 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 52 52 } 53 53 54 54 protected: 55 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSWrapperObject::StructureFlags; 55 56 StringObject(NonNullPassRefPtr<Structure>, JSString*); 56 57 }; -
trunk/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h
r49694 r49721 45 45 static PassRefPtr<Structure> createStructure(JSValue proto) 46 46 { 47 return Structure::create(proto, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | MasqueradesAsUndefined | OverridesGetPropertyNames));47 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 48 48 } 49 50 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | MasqueradesAsUndefined | OverridesGetPropertyNames | StringObject::StructureFlags; 49 51 50 52 virtual bool toBoolean(ExecState*) const { return false; }
Note:
See TracChangeset
for help on using the changeset viewer.