Changeset 48883 in webkit for trunk/JavaScriptCore/runtime/JSGlobalObject.h
- Timestamp:
- Sep 29, 2009, 10:54:39 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSGlobalObject.h
r48836 r48883 53 53 54 54 typedef Vector<ExecState*, 16> ExecStateStack; 55 55 56 56 class JSGlobalObject : public JSVariableObject { 57 57 protected: … … 59 59 60 60 struct JSGlobalObjectData : public JSVariableObjectData { 61 JSGlobalObjectData() 61 // We use an explicit destructor function pointer instead of a 62 // virtual destructor because we want to avoid adding a vtable 63 // pointer to this struct. Adding a vtable pointer would force the 64 // compiler to emit costly pointer fixup code when casting from 65 // JSVariableObjectData* to JSGlobalObjectData*. 66 typedef void (*Destructor)(void*); 67 68 JSGlobalObjectData(Destructor destructor) 62 69 : JSVariableObjectData(&symbolTable, 0) 70 , destructor(destructor) 63 71 , registerArraySize(0) 64 72 , globalScopeChain(NoScopeChain()) … … 86 94 } 87 95 88 virtual ~JSGlobalObjectData() 89 { 90 } 91 96 Destructor destructor; 97 92 98 size_t registerArraySize; 93 99 … … 154 160 155 161 explicit JSGlobalObject() 156 : JSVariableObject(JSGlobalObject::createStructure(jsNull()), new JSGlobalObjectData )162 : JSVariableObject(JSGlobalObject::createStructure(jsNull()), new JSGlobalObjectData(destroyJSGlobalObjectData)) 157 163 { 158 164 init(this); … … 281 287 282 288 private: 289 static void destroyJSGlobalObjectData(void*); 290 283 291 // FIXME: Fold reset into init. 284 292 void init(JSObject* thisValue);
Note:
See TracChangeset
for help on using the changeset viewer.