Changeset 96674 in webkit
- Timestamp:
- Oct 4, 2011 7:47:42 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r96673 r96674 1 2011-10-04 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static ClassInfo structs to classes that override JSCell::getCallData 4 https://bugs.webkit.org/show_bug.cgi?id=69311 5 6 Reviewed by Darin Adler. 7 8 Added ClassInfo structs to each class that defined its own getCallData 9 function but did not already have its own ClassInfo struct. This is a 10 necessary addition for when we switch over to looking up getCallData from 11 the MethodTable in ClassInfo rather than doing the virtual call (which we 12 are removing). These new ClassInfo structs are public because we often 13 use these structs in other areas of the code to uniquely identify JSC classes and 14 to enforce runtime invariants based on those class identities using ASSERTs. 15 Also added new createStructure methods to those classes that didn't have 16 them so that the new ClassInfo structs would be used when creating the Structures 17 in these classes. 18 19 * runtime/BooleanConstructor.cpp: 20 * runtime/BooleanConstructor.h: 21 (JSC::BooleanConstructor::createStructure): 22 23 getCallData was not marked as static in StrictModeTypeErrorFunction. 24 * runtime/Error.cpp: 25 (JSC::StrictModeTypeErrorFunction::getCallDataVirtual): 26 (JSC::StrictModeTypeErrorFunction::getCallData): 27 (JSC::StrictModeTypeErrorFunction::createStructure): 28 * runtime/ErrorConstructor.cpp: 29 * runtime/ErrorConstructor.h: 30 (JSC::ErrorConstructor::createStructure): 31 * runtime/FunctionConstructor.cpp: 32 * runtime/FunctionConstructor.h: 33 (JSC::FunctionConstructor::createStructure): 34 * runtime/FunctionPrototype.cpp: 35 * runtime/FunctionPrototype.h: 36 1 37 2011-10-03 Geoffrey Garen <ggaren@apple.com> 2 38 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r96637 r96674 28 28 29 29 ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor); 30 31 const ClassInfo BooleanConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(BooleanConstructor) }; 30 32 31 33 BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure) -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h
r96637 r96674 39 39 } 40 40 41 static const ClassInfo s_info; 42 43 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) 44 { 45 return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); 46 } 47 41 48 protected: 42 49 void finishCreation(ExecState*, BooleanPrototype*); -
trunk/Source/JavaScriptCore/runtime/Error.cpp
r96637 r96674 202 202 } 203 203 204 CallType getCallDataVirtual(CallData& callData)204 virtual CallType getCallDataVirtual(CallData& callData) 205 205 { 206 206 return getCallData(this, callData); 207 207 } 208 208 209 CallType getCallData(JSCell*, CallData& callData)209 static CallType getCallData(JSCell*, CallData& callData) 210 210 { 211 211 callData.native.function = callThrowTypeError; 212 212 return CallTypeHost; 213 } 214 215 static const ClassInfo s_info; 216 217 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) 218 { 219 return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); 213 220 } 214 221 … … 219 226 ASSERT_CLASS_FITS_IN_CELL(StrictModeTypeErrorFunction); 220 227 228 const ClassInfo StrictModeTypeErrorFunction::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(StrictModeTypeErrorFunction) }; 229 221 230 JSValue createTypeErrorFunction(ExecState* exec, const UString& message) 222 231 { -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r96637 r96674 29 29 30 30 ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor); 31 32 const ClassInfo ErrorConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorConstructor) }; 31 33 32 34 ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure) -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h
r96637 r96674 40 40 } 41 41 42 static const ClassInfo s_info; 43 44 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) 45 { 46 return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); 47 } 48 42 49 protected: 43 50 void finishCreation(ExecState*, ErrorPrototype*); -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r96637 r96674 37 37 38 38 ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor); 39 40 const ClassInfo FunctionConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionConstructor) }; 39 41 40 42 FunctionConstructor::FunctionConstructor(JSGlobalObject* globalObject, Structure* structure) -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h
r96637 r96674 39 39 } 40 40 41 static const ClassInfo s_info; 42 43 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) 44 { 45 return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); 46 } 47 41 48 private: 42 49 FunctionConstructor(JSGlobalObject*, Structure*); -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r96673 r96674 39 39 static EncodedJSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*); 40 40 static EncodedJSValue JSC_HOST_CALL functionProtoFuncBind(ExecState*); 41 42 const ClassInfo FunctionPrototype::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionPrototype) }; 41 43 42 44 FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure) -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h
r96637 r96674 44 44 } 45 45 46 static const ClassInfo s_info; 47 46 48 protected: 47 49 void finishCreation(ExecState*, const Identifier& name); -
trunk/Source/WebCore/ChangeLog
r96673 r96674 1 2011-10-04 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static ClassInfo structs to classes that override JSCell::getCallData 4 https://bugs.webkit.org/show_bug.cgi?id=69311 5 6 Reviewed by Darin Adler. 7 8 No new tests. 9 10 Added ClassInfo structs to each class that defined its own getCallData 11 function but did not already have its own ClassInfo struct. This is a 12 necessary addition for when we switch over to looking up getCallData from 13 the MethodTable in ClassInfo rather than doing the virtual call (which we 14 are removing). These new ClassInfo structs are public because we often 15 use these structs in other areas of the code to uniquely identify JSC classes and 16 to enforce runtime invariants based on those class identities using ASSERTs. 17 Also added new createStructure methods to those classes that didn't have 18 them so that the new ClassInfo structs would be used when creating the Structures 19 in these classes. 20 21 * bridge/qt/qt_runtime.cpp: 22 * bridge/qt/qt_runtime.h: 23 1 24 2011-10-03 Geoffrey Garen <ggaren@apple.com> 2 25 -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r96637 r96674 1426 1426 } 1427 1427 1428 const ClassInfo QtRuntimeMetaMethod::s_info = { "QtRuntimeMethod", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMetaMethod) }; 1429 1428 1430 QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier) 1429 1431 : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier) … … 1580 1582 1581 1583 QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections; 1584 1585 const ClassInfo QtRuntimeConnectionMethod::s_info = { "QtRuntimeMethod", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeConnectionMethod) }; 1582 1586 1583 1587 QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier) -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r96637 r96674 171 171 static void visitChildren(JSCell*, SlotVisitor&); 172 172 173 static const ClassInfo s_info; 174 173 175 protected: 174 176 QtRuntimeMetaMethodData* d_func() const {return reinterpret_cast<QtRuntimeMetaMethodData*>(d_ptr);} … … 202 204 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 203 205 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 206 207 static const ClassInfo s_info; 204 208 205 209 protected:
Note: See TracChangeset
for help on using the changeset viewer.