Changeset 94701 in webkit
- Timestamp:
- Sep 7, 2011 12:40:41 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 55 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackConstructor.cpp
r94644 r94701 37 37 namespace JSC { 38 38 39 const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JS ObjectWithGlobalObject::s_info, 0, 0 };39 const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSNonFinalObject::s_info, 0, 0 }; 40 40 41 41 JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) 42 : JS ObjectWithGlobalObject(globalObject, structure)42 : JSNonFinalObject(globalObject->globalData(), structure) 43 43 , m_class(jsClass) 44 44 , m_callback(callback) … … 49 49 void JSCallbackConstructor::finishCreation(JSGlobalObject* globalObject, JSClassRef jsClass) 50 50 { 51 Base::finishCreation(globalObject->globalData() , globalObject);51 Base::finishCreation(globalObject->globalData()); 52 52 ASSERT(inherits(&s_info)); 53 53 if (m_class) -
trunk/Source/JavaScriptCore/API/JSCallbackConstructor.h
r94644 r94701 28 28 29 29 #include "JSObjectRef.h" 30 #include <runtime/JSObject WithGlobalObject.h>30 #include <runtime/JSObject.h> 31 31 32 32 namespace JSC { 33 33 34 class JSCallbackConstructor : public JS ObjectWithGlobalObject {34 class JSCallbackConstructor : public JSNonFinalObject { 35 35 public: 36 typedef JS ObjectWithGlobalObject Base;36 typedef JSNonFinalObject Base; 37 37 38 38 static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback) -
trunk/Source/JavaScriptCore/API/JSCallbackObject.cpp
r83661 r94701 33 33 namespace JSC { 34 34 35 ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JS ObjectWithGlobalObject>);35 ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSNonFinalObject>); 36 36 ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSGlobalObject>); 37 37 38 38 // Define the two types of JSCallbackObjects we support. 39 template <> const ClassInfo JSCallbackObject<JS ObjectWithGlobalObject>::s_info = { "CallbackObject", &JSObjectWithGlobalObject::s_info, 0, 0 };39 template <> const ClassInfo JSCallbackObject<JSNonFinalObject>::s_info = { "CallbackObject", &JSNonFinalObject::s_info, 0, 0 }; 40 40 template <> const ClassInfo JSCallbackObject<JSGlobalObject>::s_info = { "CallbackGlobalObject", &JSGlobalObject::s_info, 0, 0 }; 41 41 -
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r94599 r94701 118 118 class JSCallbackObject : public Parent { 119 119 protected: 120 JSCallbackObject(ExecState*, JSGlobalObject*,Structure*, JSClassRef, void* data);120 JSCallbackObject(ExecState*, Structure*, JSClassRef, void* data); 121 121 JSCallbackObject(JSGlobalData&, JSClassRef, Structure*); 122 122 // We'd like to use the placement version of operator new defined in JSCell, but … … 125 125 void* operator new(size_t, void* ptr) { return ptr; } 126 126 127 void finishCreation(ExecState* , JSGlobalObject*);127 void finishCreation(ExecState*); 128 128 void finishCreation(); 129 129 … … 133 133 static JSCallbackObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, void* data) 134 134 { 135 JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, globalObject, structure, classRef, data); 135 ASSERT(!structure->globalObject() || structure->globalObject() == globalObject); 136 JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data); 136 137 return callbackObject; 137 138 } -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r94364 r94701 51 51 52 52 template <class Parent> 53 JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject,Structure* structure, JSClassRef jsClass, void* data)54 : Parent( globalObject, structure)53 JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, Structure* structure, JSClassRef jsClass, void* data) 54 : Parent(exec->globalData(), structure) 55 55 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass))) 56 56 { 57 finishCreation(exec , globalObject);57 finishCreation(exec); 58 58 } 59 59 … … 69 69 70 70 template <class Parent> 71 void JSCallbackObject<Parent>::finishCreation(ExecState* exec , JSGlobalObject* globalObject)72 { 73 Base::finishCreation( globalObject->globalData(), globalObject);71 void JSCallbackObject<Parent>::finishCreation(ExecState* exec) 72 { 73 Base::finishCreation(exec->globalData()); 74 74 ASSERT(Parent::inherits(&s_info)); 75 75 init(exec); … … 575 575 if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { 576 576 577 JSObject* o = JSCallbackFunction::create(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);577 JSObject* o = JSCallbackFunction::create(exec, thisObj->globalObject(), callAsFunction, propertyName); 578 578 thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes); 579 579 return o; -
trunk/Source/JavaScriptCore/API/JSClassRef.cpp
r91194 r94701 252 252 if (!jsClassData.cachedPrototype) { 253 253 // Recursive, but should be good enough for our purposes 254 jsClassData.cachedPrototype.set(exec->globalData(), JSCallbackObject<JS ObjectWithGlobalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction254 jsClassData.cachedPrototype.set(exec->globalData(), JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction 255 255 if (parentClass) { 256 256 if (JSObject* prototype = parentClass->prototype(exec)) -
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r91194 r94701 82 82 return toRef(constructEmptyObject(exec)); 83 83 84 JSCallbackObject<JS ObjectWithGlobalObject>* object = JSCallbackObject<JSObjectWithGlobalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data);84 JSCallbackObject<JSNonFinalObject>* object = JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); 85 85 if (JSObject* prototype = jsClass->prototype(exec)) 86 86 object->setPrototype(exec->globalData(), prototype); … … 343 343 if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::s_info)) 344 344 return static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivate(); 345 if (jsObject->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info))346 return static_cast<JSCallbackObject<JS ObjectWithGlobalObject>*>(jsObject)->getPrivate();345 if (jsObject->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)) 346 return static_cast<JSCallbackObject<JSNonFinalObject>*>(jsObject)->getPrivate(); 347 347 348 348 return 0; … … 357 357 return true; 358 358 } 359 if (jsObject->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info)) {360 static_cast<JSCallbackObject<JS ObjectWithGlobalObject>*>(jsObject)->setPrivate(data);359 if (jsObject->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)) { 360 static_cast<JSCallbackObject<JSNonFinalObject>*>(jsObject)->setPrivate(data); 361 361 return true; 362 362 } … … 374 374 if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::s_info)) 375 375 result = static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivateProperty(name); 376 else if (jsObject->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info))377 result = static_cast<JSCallbackObject<JS ObjectWithGlobalObject>*>(jsObject)->getPrivateProperty(name);376 else if (jsObject->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)) 377 result = static_cast<JSCallbackObject<JSNonFinalObject>*>(jsObject)->getPrivateProperty(name); 378 378 return toRef(exec, result); 379 379 } … … 390 390 return true; 391 391 } 392 if (jsObject->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info)) {393 static_cast<JSCallbackObject<JS ObjectWithGlobalObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue);392 if (jsObject->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)) { 393 static_cast<JSCallbackObject<JSNonFinalObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue); 394 394 return true; 395 395 } … … 407 407 return true; 408 408 } 409 if (jsObject->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info)) {410 static_cast<JSCallbackObject<JS ObjectWithGlobalObject>*>(jsObject)->deletePrivateProperty(name);409 if (jsObject->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)) { 410 static_cast<JSCallbackObject<JSNonFinalObject>*>(jsObject)->deletePrivateProperty(name); 411 411 return true; 412 412 } -
trunk/Source/JavaScriptCore/API/JSValueRef.cpp
r89219 r94701 132 132 if (o->inherits(&JSCallbackObject<JSGlobalObject>::s_info)) 133 133 return static_cast<JSCallbackObject<JSGlobalObject>*>(o)->inherits(jsClass); 134 if (o->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info))135 return static_cast<JSCallbackObject<JS ObjectWithGlobalObject>*>(o)->inherits(jsClass);134 if (o->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)) 135 return static_cast<JSCallbackObject<JSNonFinalObject>*>(o)->inherits(jsClass); 136 136 } 137 137 return false; -
trunk/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
r85117 r94701 58 58 if (!obj) 59 59 return; 60 ASSERT(obj->inherits(&JSCallbackObject<JSGlobalObject>::s_info) || obj->inherits(&JSCallbackObject<JS ObjectWithGlobalObject>::s_info));60 ASSERT(obj->inherits(&JSCallbackObject<JSGlobalObject>::s_info) || obj->inherits(&JSCallbackObject<JSNonFinalObject>::s_info)); 61 61 map->map().set(exec->globalData(), key, obj); 62 62 } -
trunk/Source/JavaScriptCore/CMakeLists.txt
r94559 r94701 126 126 runtime/JSNotAnObject.cpp 127 127 runtime/JSObject.cpp 128 runtime/JSObjectWithGlobalObject.cpp129 128 runtime/JSONObject.cpp 130 129 runtime/JSPropertyNameIterator.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r94688 r94701 1 2011-09-06 Oliver Hunt <oliver@apple.com> 2 3 Remove JSObjectWithGlobalObject 4 https://bugs.webkit.org/show_bug.cgi?id=67689 5 6 Reviewed by Geoff Garen. 7 8 Remove JSObjectWithGlobalObject, and update code to stop using anonymous 9 storage to access the global object that a JSObject comes from. Largely 10 mechanical change to remove the use of anonymous storage and JSObjectWithGlobalObject. 11 12 * API/JSCallbackConstructor.cpp: 13 (JSC::JSCallbackConstructor::JSCallbackConstructor): 14 (JSC::JSCallbackConstructor::finishCreation): 15 * API/JSCallbackConstructor.h: 16 * API/JSCallbackObject.cpp: 17 * API/JSCallbackObject.h: 18 (JSC::JSCallbackObject::create): 19 * API/JSCallbackObjectFunctions.h: 20 (JSC::::JSCallbackObject): 21 (JSC::::finishCreation): 22 (JSC::::staticFunctionGetter): 23 * API/JSClassRef.cpp: 24 (OpaqueJSClass::prototype): 25 * API/JSObjectRef.cpp: 26 (JSObjectMake): 27 (JSObjectGetPrivate): 28 (JSObjectSetPrivate): 29 (JSObjectGetPrivateProperty): 30 (JSObjectSetPrivateProperty): 31 (JSObjectDeletePrivateProperty): 32 * API/JSValueRef.cpp: 33 (JSValueIsObjectOfClass): 34 * API/JSWeakObjectMapRefPrivate.cpp: 35 * JavaScriptCore.exp: 36 * JavaScriptCore.xcodeproj/project.pbxproj: 37 * bytecode/CodeBlock.h: 38 * dfg/DFGRepatch.cpp: 39 (JSC::DFG::dfgRepatchGetMethodFast): 40 (JSC::DFG::tryCacheGetMethod): 41 * jit/JIT.h: 42 * jit/JITInlineMethods.h: 43 (JSC::JIT::emitAllocateJSFunction): 44 * jit/JITPropertyAccess.cpp: 45 (JSC::JIT::patchMethodCallProto): 46 * jit/JITStubs.cpp: 47 (JSC::DEFINE_STUB_FUNCTION): 48 * runtime/DatePrototype.cpp: 49 * runtime/InternalFunction.cpp: 50 (JSC::InternalFunction::InternalFunction): 51 (JSC::InternalFunction::finishCreation): 52 * runtime/InternalFunction.h: 53 * runtime/JSFunction.cpp: 54 (JSC::JSFunction::JSFunction): 55 (JSC::JSFunction::finishCreation): 56 * runtime/JSFunction.h: 57 (JSC::JSFunction::create): 58 (JSC::JSFunction::createStructure): 59 * runtime/JSGlobalObject.cpp: 60 (JSC::JSGlobalObject::reset): 61 * runtime/JSONObject.cpp: 62 (JSC::JSONObject::JSONObject): 63 (JSC::JSONObject::finishCreation): 64 * runtime/JSONObject.h: 65 * runtime/JSObject.h: 66 (JSC::JSObject::globalObject): 67 * runtime/JSObjectWithGlobalObject.cpp: Removed. 68 * runtime/JSObjectWithGlobalObject.h: Removed. 69 * runtime/JSValue.cpp: 70 (JSC::JSValue::isValidCallee): 71 * runtime/Lookup.cpp: 72 (JSC::setUpStaticFunctionSlot): 73 * runtime/Lookup.h: 74 * runtime/MathObject.cpp: 75 (JSC::MathObject::MathObject): 76 (JSC::MathObject::finishCreation): 77 * runtime/MathObject.h: 78 * runtime/NumberPrototype.cpp: 79 * runtime/RegExpObject.cpp: 80 (JSC::RegExpObject::RegExpObject): 81 (JSC::RegExpObject::finishCreation): 82 * runtime/RegExpObject.h: 83 * runtime/Structure.cpp: 84 (JSC::Structure::Structure): 85 * runtime/Structure.h: 86 (JSC::Structure::create): 87 (JSC::Structure::globalObject): 88 1 89 2011-09-07 Gavin Barraclough <barraclough@apple.com> 2 90 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r94559 r94701 347 347 Source/JavaScriptCore/runtime/JSObject.cpp \ 348 348 Source/JavaScriptCore/runtime/JSObject.h \ 349 Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp \350 Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.h \351 349 Source/JavaScriptCore/runtime/JSONObject.cpp \ 352 350 Source/JavaScriptCore/runtime/JSONObject.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r94644 r94701 110 110 __ZN3JSC10Identifier4fromEPNS_9ExecStateEj 111 111 __ZN3JSC10Identifier8toUInt32ERKNS_7UStringERb 112 __ZN3JSC10JSFunction14finishCreationEPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_18FunctionExecutableEPNS_14ScopeChainNodeE 113 __ZN3JSC10JSFunction14finishCreationEPNS_9ExecStateEPNS_14JSGlobalObjectEiRKNS_10IdentifierEPNS_14ExecutableBaseE 112 __ZN3JSC10JSFunction14finishCreationEPNS_9ExecStateEiRKNS_10IdentifierEPNS_14ExecutableBaseE 114 113 __ZN3JSC10JSFunction4nameEPNS_9ExecStateE 115 114 __ZN3JSC10JSFunction6s_infoE … … 219 218 __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE 220 219 __ZN3JSC24DynamicGlobalObjectScopeC1ERNS_12JSGlobalDataEPNS_14JSGlobalObjectE 221 __ZN3JSC24JSObjectWithGlobalObject14finishCreationERNS_12JSGlobalDataEPNS_14JSGlobalObjectE222 __ZN3JSC24JSObjectWithGlobalObjectC2EPNS_14JSGlobalObjectEPNS_9StructureE223 __ZN3JSC24JSObjectWithGlobalObjectC2ERNS_12JSGlobalDataEPNS_9StructureE224 220 __ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE 225 221 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE … … 344 340 __ZN3JSC9Structure40addPropertyTransitionToExistingStructureEPS0_RKNS_10IdentifierEjPNS_6JSCellERm 345 341 __ZN3JSC9Structure6s_infoE 346 __ZN3JSC9StructureC1ERNS_12JSGlobalDataE NS_7JSValueERKNS_8TypeInfoEjPKNS_9ClassInfoE342 __ZN3JSC9StructureC1ERNS_12JSGlobalDataEPNS_14JSGlobalObjectENS_7JSValueERKNS_8TypeInfoEjPKNS_9ClassInfoE 347 343 __ZN3JSC9StructureD1Ev 348 344 __ZN3JSC9constructEPNS_9ExecStateENS_7JSValueENS_13ConstructTypeERKNS_13ConstructDataERKNS_7ArgListE -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r94461 r94701 87 87 'runtime/JSLock.h', 88 88 'runtime/JSObject.h', 89 'runtime/JSObjectWithGlobalObject.h',90 89 'runtime/JSString.h', 91 90 'runtime/JSType.h', … … 529 528 'runtime/JSONObject.h', 530 529 'runtime/JSObject.cpp', 531 'runtime/JSObjectWithGlobalObject.cpp',532 530 'runtime/JSPropertyNameIterator.cpp', 533 531 'runtime/JSPropertyNameIterator.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.pro
r94461 r94701 157 157 runtime/JSNotAnObject.cpp \ 158 158 runtime/JSObject.cpp \ 159 runtime/JSObjectWithGlobalObject.cpp \160 159 runtime/JSONObject.cpp \ 161 160 runtime/JSPropertyNameIterator.cpp \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r94644 r94701 13 13 ??0JSFunction@JSC@@AAE@PAVExecState@1@PAVJSGlobalObject@1@PAVStructure@1@@Z 14 14 ??0JSLock@JSC@@QAE@PAVExecState@1@@Z 15 ??0JSObjectWithGlobalObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@@Z16 ??0JSObjectWithGlobalObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z17 15 ??0MD5@WTF@@QAE@XZ 18 16 ??0Mutex@WTF@@QAE@XZ … … 21 19 ??0SHA1@WTF@@QAE@XZ 22 20 ??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@PAVJSString@1@@Z 23 ??0Structure@JSC@@AAE@AAVJSGlobalData@1@ VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z21 ??0Structure@JSC@@AAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z 24 22 ??0ThreadCondition@WTF@@QAE@XZ 25 23 ??0UString@JSC@@QAE@PBD@Z … … 178 176 ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@@Z 179 177 ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@ABVArgList@2@@Z 180 ?finishCreation@JSFunction@JSC@@IAEXPAVExecState@2@PAVJSGlobalObject@2@HABVIdentifier@2@PAVExecutableBase@2@@Z 181 ?finishCreation@JSObjectWithGlobalObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSGlobalObject@2@@Z 178 ?finishCreation@JSFunction@JSC@@IAEXPAVExecState@2@HABVIdentifier@2@PAVExecutableBase@2@@Z 182 179 ?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z 183 180 ?from@Identifier@JSC@@SA?AV12@PAVExecState@2@H@Z … … 219 216 ?getter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ 220 217 ?globalExec@JSGlobalObject@JSC@@QAEPAVExecState@2@XZ 221 ?globalObject@JSObjectWithGlobalObject@JSC@@QBEPAVJSGlobalObject@2@XZ222 218 ?globalObjectCount@Heap@JSC@@QAEIXZ 223 219 ?grow@HandleHeap@JSC@@AAEXXZ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r94559 r94701 847 847 </File> 848 848 <File 849 RelativePath="..\..\runtime\JSObjectWithGlobalObject.cpp"850 >851 </File>852 <File853 RelativePath="..\..\runtime\JSObjectWithGlobalObject.h"854 >855 </File>856 <File857 849 RelativePath="..\..\runtime\JSONObject.cpp" 858 850 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r94559 r94701 416 416 A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; }; 417 417 A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */; }; 418 A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };419 A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */; };420 418 A784A26111D16622005776AC /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; }; 421 419 A784A26211D16622005776AC /* JSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A7EE7511B98B8D0065A14F /* JSParser.cpp */; }; … … 1182 1180 A76C51741182748D00715B05 /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = "<group>"; }; 1183 1181 A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITWriteBarrier.h; sourceTree = "<group>"; }; 1184 A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectWithGlobalObject.h; sourceTree = "<group>"; };1185 A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObjectWithGlobalObject.cpp; sourceTree = "<group>"; };1186 1182 A791EF260F11E07900AE1F68 /* JSByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSByteArray.h; sourceTree = "<group>"; }; 1187 1183 A791EF270F11E07900AE1F68 /* JSByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSByteArray.cpp; sourceTree = "<group>"; }; … … 2035 2031 BC22A3980E16E14800AF21C8 /* JSObject.cpp */, 2036 2032 BC22A3990E16E14800AF21C8 /* JSObject.h */, 2037 A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */,2038 A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */,2039 2033 A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */, 2040 2034 A7F9935D0FD7325100A0B2D0 /* JSONObject.h */, … … 2519 2513 BC18C4250E16F5CD00B34460 /* JSObjectRef.h in Headers */, 2520 2514 A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */, 2521 A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */,2522 2515 A7F9935F0FD7325100A0B2D0 /* JSONObject.h in Headers */, 2523 2516 BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */, … … 3144 3137 147F39D4107EC37600427A48 /* JSObject.cpp in Sources */, 3145 3138 1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */, 3146 A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */,3147 3139 A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */, 3148 3140 A784A26211D16622005776AC /* JSParser.cpp in Sources */, -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r94559 r94701 157 157 // We'd like this to actually be JSFunction, but InternalFunction and JSFunction 158 158 // don't have a common parent class and we allow specialisation on both 159 JITWriteBarrier<JSObject WithGlobalObject> cachedFunction;159 JITWriteBarrier<JSObject> cachedFunction; 160 160 JITWriteBarrier<JSObject> cachedPrototype; 161 161 bool seen; -
trunk/Source/JavaScriptCore/dfg/DFGRepatch.cpp
r94559 r94701 246 246 } 247 247 248 static void dfgRepatchGetMethodFast(JSGlobalData* globalData, CodeBlock* codeBlock, MethodCallLinkInfo& methodInfo, JSObject WithGlobalObject* callee, Structure* structure, JSObject* slotBaseObject)248 static void dfgRepatchGetMethodFast(JSGlobalData* globalData, CodeBlock* codeBlock, MethodCallLinkInfo& methodInfo, JSObject* callee, Structure* structure, JSObject* slotBaseObject) 249 249 { 250 250 ScriptExecutable* owner = codeBlock->ownerExecutable(); … … 275 275 && specific) { 276 276 277 JSObject WithGlobalObject* callee = (JSObjectWithGlobalObject*)specific;277 JSObject* callee = asObject(specific); 278 278 279 279 // Since we're accessing a prototype in a loop, it's a good bet that it -
trunk/Source/JavaScriptCore/jit/JIT.h
r94688 r94701 240 240 static void patchGetByIdSelf(CodeBlock* codeblock, StructureStubInfo*, Structure*, size_t cachedOffset, ReturnAddressPtr returnAddress); 241 241 static void patchPutByIdReplace(CodeBlock* codeblock, StructureStubInfo*, Structure*, size_t cachedOffset, ReturnAddressPtr returnAddress, bool direct); 242 static void patchMethodCallProto(JSGlobalData&, CodeBlock* codeblock, MethodCallLinkInfo&, JSObject WithGlobalObject*, Structure*, JSObject*, ReturnAddressPtr);242 static void patchMethodCallProto(JSGlobalData&, CodeBlock* codeblock, MethodCallLinkInfo&, JSObject*, Structure*, JSObject*, ReturnAddressPtr); 243 243 244 244 static void compilePatchGetArrayLength(JSGlobalData* globalData, CodeBlock* codeBlock, ReturnAddressPtr returnAddress) -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r94688 r94701 424 424 storePtr(TrustedImmPtr(executable), Address(result, JSFunction::offsetOfExecutable())); 425 425 426 427 // store the function's global object428 int globalObjectOffset = sizeof(JSValue) * JSFunction::GlobalObjectSlot;429 storePtr(TrustedImmPtr(m_codeBlock->globalObject()), Address(regT1, globalObjectOffset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));430 #if USE(JSVALUE32_64)431 store32(TrustedImm32(JSValue::CellTag), Address(regT1, globalObjectOffset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));432 #endif433 434 426 // store the function's name 435 427 ASSERT(executable->nameValue()); -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r93698 r94701 1048 1048 } 1049 1049 1050 void JIT::patchMethodCallProto(JSGlobalData& globalData, CodeBlock* codeBlock, MethodCallLinkInfo& methodCallLinkInfo, JSObject WithGlobalObject* callee, Structure* structure, JSObject* proto, ReturnAddressPtr returnAddress)1050 void JIT::patchMethodCallProto(JSGlobalData& globalData, CodeBlock* codeBlock, MethodCallLinkInfo& methodCallLinkInfo, JSObject* callee, Structure* structure, JSObject* proto, ReturnAddressPtr returnAddress) 1051 1051 { 1052 1052 RepatchBuffer repatchBuffer(codeBlock); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r94559 r94701 1527 1527 ) { 1528 1528 1529 JSObject WithGlobalObject* callee = (JSObjectWithGlobalObject*)specific;1529 JSObject* callee = asObject(specific); 1530 1530 1531 1531 // Since we're accessing a prototype in a loop, it's a good bet that it -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r94644 r94701 28 28 #include "DateInstance.h" 29 29 #include "Error.h" 30 #include "JSGlobalObject.h" 30 31 #include "JSString.h" 31 32 #include "JSStringBuilder.h" -
trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
r94644 r94701 35 35 ASSERT_CLASS_FITS_IN_CELL(InternalFunction); 36 36 37 const ClassInfo InternalFunction::s_info = { "Function", &JS ObjectWithGlobalObject::s_info, 0, 0 };37 const ClassInfo InternalFunction::s_info = { "Function", &JSNonFinalObject::s_info, 0, 0 }; 38 38 39 39 InternalFunction::InternalFunction(VPtrStealingHackType) 40 : JS ObjectWithGlobalObject(VPtrStealingHack)40 : JSNonFinalObject(VPtrStealingHack) 41 41 { 42 42 } 43 43 44 InternalFunction::InternalFunction(JSGlobalData* globalData, JSGlobalObject* globalObject, Structure* structure, const Identifier& name)45 : JS ObjectWithGlobalObject(globalObject, structure)44 InternalFunction::InternalFunction(JSGlobalData* globalData, JSGlobalObject*, Structure* structure, const Identifier& name) 45 : JSNonFinalObject(*globalData, structure) 46 46 { 47 finishCreation(*globalData, globalObject,name);47 finishCreation(*globalData, name); 48 48 } 49 49 50 void InternalFunction::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject,const Identifier& name)50 void InternalFunction::finishCreation(JSGlobalData& globalData, const Identifier& name) 51 51 { 52 Base::finishCreation(globalData , globalObject);52 Base::finishCreation(globalData); 53 53 ASSERT(inherits(&s_info)); 54 54 putDirect(globalData, globalData.propertyNames->name, jsString(&globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); -
trunk/Source/JavaScriptCore/runtime/InternalFunction.h
r94644 r94701 25 25 #define InternalFunction_h 26 26 27 #include "JSObject WithGlobalObject.h"27 #include "JSObject.h" 28 28 #include "Identifier.h" 29 29 … … 32 32 class FunctionPrototype; 33 33 34 class InternalFunction : public JS ObjectWithGlobalObject {34 class InternalFunction : public JSNonFinalObject { 35 35 public: 36 typedef JS ObjectWithGlobalObject Base;36 typedef JSNonFinalObject Base; 37 37 38 38 static JS_EXPORTDATA const ClassInfo s_info; … … 55 55 InternalFunction(JSGlobalData*, JSGlobalObject*, Structure*, const Identifier&); 56 56 57 void finishCreation(JSGlobalData&, JSGlobalObject*,const Identifier& name);57 void finishCreation(JSGlobalData&, const Identifier& name); 58 58 59 59 private: -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r94364 r94701 63 63 64 64 JSFunction::JSFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 65 : Base( globalObject, structure)65 : Base(exec->globalData(), structure) 66 66 , m_executable() 67 67 , m_scopeChain(exec->globalData(), this, globalObject->globalScopeChain()) … … 70 70 71 71 JSFunction::JSFunction(ExecState* exec, FunctionExecutable* executable, ScopeChainNode* scopeChainNode) 72 : Base( scopeChainNode->globalObject.get(), scopeChainNode->globalObject->functionStructure())72 : Base(exec->globalData(), scopeChainNode->globalObject->functionStructure()) 73 73 , m_executable(exec->globalData(), this, executable) 74 74 , m_scopeChain(exec->globalData(), this, scopeChainNode) … … 76 76 } 77 77 78 void JSFunction::finishCreation(ExecState* exec, JSGlobalObject* globalObject,int length, const Identifier& name, ExecutableBase* executable)79 { 80 Base::finishCreation( globalObject->globalData(), globalObject);78 void JSFunction::finishCreation(ExecState* exec, int length, const Identifier& name, ExecutableBase* executable) 79 { 80 Base::finishCreation(exec->globalData()); 81 81 ASSERT(inherits(&s_info)); 82 82 m_executable.set(exec->globalData(), this, executable); … … 85 85 } 86 86 87 void JSFunction::finishCreation(ExecState* exec, JSGlobalObject* globalObject,FunctionExecutable* executable, ScopeChainNode* scopeChainNode)88 { 89 Base::finishCreation( globalObject->globalData(), globalObject);87 void JSFunction::finishCreation(ExecState* exec, FunctionExecutable* executable, ScopeChainNode* scopeChainNode) 88 { 89 Base::finishCreation(exec->globalData()); 90 90 ASSERT(inherits(&s_info)); 91 91 setStructure(exec->globalData(), scopeChainNode->globalObject->namedFunctionStructure()); -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r94599 r94701 25 25 #define JSFunction_h 26 26 27 #include "JSObject WithGlobalObject.h"27 #include "JSObject.h" 28 28 29 29 namespace JSC { … … 42 42 EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState*); 43 43 44 class JSFunction : public JS ObjectWithGlobalObject {44 class JSFunction : public JSNonFinalObject { 45 45 friend class JIT; 46 46 friend class DFG::JITCodeGenerator; … … 51 51 52 52 public: 53 typedef JS ObjectWithGlobalObject Base;53 typedef JSNonFinalObject Base; 54 54 55 55 static JSFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, int length, const Identifier& name, NativeFunction nativeFunction) 56 56 { 57 ASSERT(structure->globalObject()); 58 ASSERT(structure->globalObject() == globalObject); 59 57 60 ExecutableBase* executable = (ExecutableBase*)exec->globalData().getHostFunction(nativeFunction); 58 61 JSFunction* function = new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, structure); 59 62 // Can't do this during initialization because getHostFunction might do a GC allocation. 60 function->finishCreation(exec, globalObject,length, name, executable);63 function->finishCreation(exec, length, name, executable); 61 64 return function; 62 65 } … … 64 67 static JSFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, int length, const Identifier& name, NativeExecutable* nativeExecutable) 65 68 { 69 ASSERT(structure->globalObject()); 70 ASSERT(structure->globalObject() == globalObject); 71 66 72 JSFunction* function = new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, structure); 67 function->finishCreation(exec, globalObject,length, name, (ExecutableBase*)nativeExecutable);73 function->finishCreation(exec, length, name, (ExecutableBase*)nativeExecutable); 68 74 return function; 69 75 } … … 72 78 { 73 79 JSFunction* function = new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, executable, scopeChain); 74 function->finishCreation(exec, scopeChain->globalObject.get(), executable, scopeChain); 80 ASSERT(function->structure()->globalObject()); 81 function->finishCreation(exec, executable, scopeChain); 75 82 return function; 76 83 } … … 111 118 112 119 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) 113 { 120 { 121 ASSERT(globalObject); 114 122 return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 115 123 } … … 133 141 const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags; 134 142 135 void finishCreation(ExecState*, JSGlobalObject*,int length, const Identifier& name, ExecutableBase*);136 void finishCreation(ExecState*, JSGlobalObject*,FunctionExecutable*, ScopeChainNode*);143 void finishCreation(ExecState*, int length, const Identifier& name, ExecutableBase*); 144 void finishCreation(ExecState*, FunctionExecutable*, ScopeChainNode*); 137 145 138 146 private: -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r94599 r94701 204 204 m_argumentsStructure.set(exec->globalData(), this, Arguments::createStructure(exec->globalData(), this, m_objectPrototype.get())); 205 205 m_callbackConstructorStructure.set(exec->globalData(), this, JSCallbackConstructor::createStructure(exec->globalData(), this, m_objectPrototype.get())); 206 m_callbackObjectStructure.set(exec->globalData(), this, JSCallbackObject<JS ObjectWithGlobalObject>::createStructure(exec->globalData(), this, m_objectPrototype.get()));206 m_callbackObjectStructure.set(exec->globalData(), this, JSCallbackObject<JSNonFinalObject>::createStructure(exec->globalData(), this, m_objectPrototype.get())); 207 207 208 208 m_arrayPrototype.set(exec->globalData(), this, ArrayPrototype::create(exec, this, ArrayPrototype::createStructure(exec->globalData(), this, m_objectPrototype.get()))); -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r94644 r94701 55 55 56 56 JSONObject::JSONObject(JSGlobalObject* globalObject, Structure* structure) 57 : JS ObjectWithGlobalObject(globalObject, structure)57 : JSNonFinalObject(globalObject->globalData(), structure) 58 58 { 59 59 finishCreation(globalObject); … … 62 62 void JSONObject::finishCreation(JSGlobalObject* globalObject) 63 63 { 64 Base::finishCreation(globalObject->globalData() , globalObject);64 Base::finishCreation(globalObject->globalData()); 65 65 ASSERT(inherits(&s_info)); 66 66 } … … 590 590 // ------------------------------ JSONObject -------------------------------- 591 591 592 const ClassInfo JSONObject::s_info = { "JSON", &JS ObjectWithGlobalObject::s_info, 0, ExecState::jsonTable };592 const ClassInfo JSONObject::s_info = { "JSON", &JSNonFinalObject::s_info, 0, ExecState::jsonTable }; 593 593 594 594 /* Source for JSONObject.lut.h -
trunk/Source/JavaScriptCore/runtime/JSONObject.h
r94644 r94701 27 27 #define JSONObject_h 28 28 29 #include "JSObject WithGlobalObject.h"29 #include "JSObject.h" 30 30 31 31 namespace JSC { … … 33 33 class Stringifier; 34 34 35 class JSONObject : public JS ObjectWithGlobalObject {35 class JSONObject : public JSNonFinalObject { 36 36 public: 37 typedef JS ObjectWithGlobalObject Base;37 typedef JSNonFinalObject Base; 38 38 39 39 static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r94599 r94701 253 253 } 254 254 255 JSGlobalObject* globalObject() const 256 { 257 ASSERT(structure()->globalObject()); 258 ASSERT(!isGlobalObject() || ((JSObject*)structure()->globalObject()) == this); 259 return structure()->globalObject(); 260 } 261 255 262 static size_t offsetOfInlineStorage(); 256 263 static size_t offsetOfPropertyStorage(); -
trunk/Source/JavaScriptCore/runtime/JSValue.cpp
r94629 r94701 202 202 bool JSValue::isValidCallee() 203 203 { 204 return asObject(as Object(asCell())->getAnonymousValue(0))->isGlobalObject();204 return asObject(asCell())->globalObject(); 205 205 } 206 206 -
trunk/Source/JavaScriptCore/runtime/Lookup.cpp
r91194 r94701 71 71 void setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot) 72 72 { 73 ASSERT(thisObj->structure()->anonymousSlotCount() > 0); 74 ASSERT(thisObj->getAnonymousValue(0).isCell() && asObject(thisObj->getAnonymousValue(0).asCell())->isGlobalObject()); 73 ASSERT(thisObj->globalObject()); 75 74 ASSERT(entry->attributes() & Function); 76 75 WriteBarrierBase<Unknown>* location = thisObj->getDirectLocation(exec->globalData(), propertyName); … … 78 77 if (!location) { 79 78 JSFunction* function; 80 JSGlobalObject* globalObject = asGlobalObject(thisObj->getAnonymousValue(0).asCell());79 JSGlobalObject* globalObject = thisObj->globalObject(); 81 80 #if ENABLE(JIT) 82 81 if (entry->generator()) -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r88604 r94701 25 25 #include "Identifier.h" 26 26 #include "JSGlobalObject.h" 27 #include "JSObject.h"28 27 #include "PropertySlot.h" 29 28 #include <stdio.h> -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r94644 r94701 60 60 namespace JSC { 61 61 62 const ClassInfo MathObject::s_info = { "Math", &JS ObjectWithGlobalObject::s_info, 0, ExecState::mathTable };62 const ClassInfo MathObject::s_info = { "Math", &JSNonFinalObject::s_info, 0, ExecState::mathTable }; 63 63 64 64 /* Source for MathObject.lut.h … … 86 86 87 87 MathObject::MathObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 88 : JS ObjectWithGlobalObject(globalObject, structure)88 : JSNonFinalObject(globalObject->globalData(), structure) 89 89 { 90 90 finishCreation(exec, globalObject); … … 93 93 void MathObject::finishCreation(ExecState* exec, JSGlobalObject* globalObject) 94 94 { 95 Base::finishCreation(globalObject->globalData() , globalObject);95 Base::finishCreation(globalObject->globalData()); 96 96 ASSERT(inherits(&s_info)); 97 97 -
trunk/Source/JavaScriptCore/runtime/MathObject.h
r94644 r94701 22 22 #define MathObject_h 23 23 24 #include "JSObject WithGlobalObject.h"24 #include "JSObject.h" 25 25 26 26 namespace JSC { 27 27 28 class MathObject : public JS ObjectWithGlobalObject {28 class MathObject : public JSNonFinalObject { 29 29 private: 30 30 MathObject(ExecState*, JSGlobalObject*, Structure*); 31 31 32 32 public: 33 typedef JS ObjectWithGlobalObject Base;33 typedef JSNonFinalObject Base; 34 34 35 35 static MathObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r94644 r94701 26 26 #include "Error.h" 27 27 #include "JSFunction.h" 28 #include "JSGlobalObject.h" 28 29 #include "JSString.h" 29 30 #include "Operations.h" -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r94644 r94701 51 51 ASSERT_CLASS_FITS_IN_CELL(RegExpObject); 52 52 53 const ClassInfo RegExpObject::s_info = { "RegExp", &JS ObjectWithGlobalObject::s_info, 0, ExecState::regExpTable };53 const ClassInfo RegExpObject::s_info = { "RegExp", &JSNonFinalObject::s_info, 0, ExecState::regExpTable }; 54 54 55 55 /* Source for RegExpObject.lut.h … … 64 64 65 65 RegExpObject::RegExpObject(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp) 66 : JS ObjectWithGlobalObject(globalObject, structure)66 : JSNonFinalObject(globalObject->globalData(), structure) 67 67 , d(adoptPtr(new RegExpObjectData(globalObject->globalData(), this, regExp))) 68 68 { … … 72 72 void RegExpObject::finishCreation(JSGlobalObject* globalObject) 73 73 { 74 Base::finishCreation(globalObject->globalData() , globalObject);74 Base::finishCreation(globalObject->globalData()); 75 75 ASSERT(inherits(&s_info)); 76 76 } -
trunk/Source/JavaScriptCore/runtime/RegExpObject.h
r94644 r94701 22 22 #define RegExpObject_h 23 23 24 #include "JSObject WithGlobalObject.h"24 #include "JSObject.h" 25 25 #include "RegExp.h" 26 26 27 27 namespace JSC { 28 28 29 class RegExpObject : public JS ObjectWithGlobalObject {29 class RegExpObject : public JSNonFinalObject { 30 30 public: 31 typedef JS ObjectWithGlobalObject Base;31 typedef JSNonFinalObject Base; 32 32 33 33 static RegExpObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp) … … 76 76 RegExpObject(JSGlobalObject*, Structure*, RegExp*); 77 77 void finishCreation(JSGlobalObject*); 78 static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | JSObjectWithGlobalObject::StructureFlags;78 static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | Base::StructureFlags; 79 79 80 80 private: -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r94599 r94701 160 160 } 161 161 162 Structure::Structure(JSGlobalData& globalData, JS Value prototype, const TypeInfo& typeInfo, unsigned anonymousSlotCount, const ClassInfo* classInfo)162 Structure::Structure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, unsigned anonymousSlotCount, const ClassInfo* classInfo) 163 163 : JSCell(globalData, globalData.structureStructure.get()) 164 164 , m_typeInfo(typeInfo) 165 , m_globalObject(globalData, this, globalObject, WriteBarrier<JSGlobalObject>::MayBeNull) 165 166 , m_prototype(globalData, this, prototype) 166 167 , m_classInfo(classInfo) -
trunk/Source/JavaScriptCore/runtime/Structure.h
r94599 r94701 63 63 typedef JSCell Base; 64 64 65 static Structure* create(JSGlobalData& globalData, JSGlobalObject* , JSValue prototype, const TypeInfo& typeInfo, unsigned anonymousSlotCount, const ClassInfo* classInfo)65 static Structure* create(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, unsigned anonymousSlotCount, const ClassInfo* classInfo) 66 66 { 67 67 ASSERT(globalData.structureStructure); 68 68 ASSERT(classInfo); 69 Structure* structure = new (allocateCell<Structure>(globalData.heap)) Structure(globalData, prototype, typeInfo, anonymousSlotCount, classInfo);69 Structure* structure = new (allocateCell<Structure>(globalData.heap)) Structure(globalData, globalObject, prototype, typeInfo, anonymousSlotCount, classInfo); 70 70 structure->finishCreation(globalData); 71 71 return structure; … … 122 122 const TypeInfo& typeInfo() const { ASSERT(structure()->classInfo() == &s_info); return m_typeInfo; } 123 123 124 JSGlobalObject* globalObject() { return m_globalObject.get(); }124 JSGlobalObject* globalObject() const { return m_globalObject.get(); } 125 125 void setGlobalObject(JSGlobalData& globalData, JSGlobalObject* globalObject) { m_globalObject.set(globalData, this, globalObject); } 126 126 … … 192 192 193 193 private: 194 Structure(JSGlobalData&, JS Value prototype, const TypeInfo&, unsigned anonymousSlotCount, const ClassInfo*);194 Structure(JSGlobalData&, JSGlobalObject*, JSValue prototype, const TypeInfo&, unsigned anonymousSlotCount, const ClassInfo*); 195 195 Structure(JSGlobalData&); 196 196 Structure(JSGlobalData&, const Structure*); -
trunk/Source/WebCore/ChangeLog
r94699 r94701 1 2011-09-06 Oliver Hunt <oliver@apple.com> 2 3 Remove JSObjectWithGlobalObject 4 https://bugs.webkit.org/show_bug.cgi?id=67689 5 6 Reviewed by Geoff Garen. 7 8 Remove use of anonymous storage and JSObjectWithGlobalObject for 9 accessing a JSObject's global object now that they're available 10 on the object's structure. 11 12 * bindings/js/JSDOMWindowShell.cpp: 13 (WebCore::JSDOMWindowShell::setWindow): 14 * bindings/js/JSDOMWrapper.h: 15 (WebCore::JSDOMWrapper::globalObject): 16 (WebCore::JSDOMWrapper::JSDOMWrapper): 17 * bindings/js/WorkerScriptController.cpp: 18 (WebCore::WorkerScriptController::initScript): 19 * bindings/scripts/CodeGeneratorJS.pm: 20 (GenerateHeader): 21 (GenerateImplementation): 22 * bridge/objc/objc_runtime.h: 23 * bridge/objc/objc_runtime.mm: 24 (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp): 25 (JSC::Bindings::ObjcFallbackObjectImp::finishCreation): 26 * bridge/runtime_object.cpp: 27 (JSC::Bindings::RuntimeObject::RuntimeObject): 28 (JSC::Bindings::RuntimeObject::finishCreation): 29 * bridge/runtime_object.h: 30 1 31 2011-09-07 Ryosuke Niwa <rniwa@webkit.org> 2 32 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r94644 r94701 74 74 Structure* structure = JSDOMWindow::createStructure(*JSDOMWindow::commonJSGlobalData(), 0, prototype.get()); 75 75 JSDOMWindow* jsDOMWindow = JSDOMWindow::create(*JSDOMWindow::commonJSGlobalData(), structure, domWindow, this); 76 prototypeStructure->setGlobalObject(*JSDOMWindow::commonJSGlobalData(), jsDOMWindow); 77 prototype->putAnonymousValue(*JSDOMWindow::commonJSGlobalData(), 0, jsDOMWindow); 76 prototype->structure()->setGlobalObject(*JSDOMWindow::commonJSGlobalData(), jsDOMWindow); 78 77 setWindow(*JSDOMWindow::commonJSGlobalData(), jsDOMWindow); 78 ASSERT(jsDOMWindow->globalObject() == jsDOMWindow); 79 ASSERT(prototype->globalObject() == jsDOMWindow); 79 80 } 80 81 -
trunk/Source/WebCore/bindings/js/JSDOMWrapper.h
r94644 r94701 24 24 25 25 #include "JSDOMGlobalObject.h" 26 #include <runtime/JSObject WithGlobalObject.h>26 #include <runtime/JSObject.h> 27 27 28 28 namespace WebCore { … … 30 30 class ScriptExecutionContext; 31 31 32 class JSDOMWrapper : public JSC::JS ObjectWithGlobalObject {32 class JSDOMWrapper : public JSC::JSNonFinalObject { 33 33 public: 34 34 JSDOMGlobalObject* globalObject() const 35 35 { 36 return static_cast<JSDOMGlobalObject*>(JSC::JS ObjectWithGlobalObject::globalObject());36 return static_cast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject()); 37 37 } 38 38 … … 54 54 55 55 explicit JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject) 56 : JS ObjectWithGlobalObject(globalObject, structure)56 : JSNonFinalObject(globalObject->globalData(), structure) 57 57 { 58 58 // FIXME: This ASSERT is valid, but fires in fast/dom/gc-6.html when trying to create … … 60 60 // needing to reach through the frame to get to the Document*. See bug 27640. 61 61 // ASSERT(globalObject->scriptExecutionContext()); 62 finishCreation(globalObject->globalData() , globalObject);62 finishCreation(globalObject->globalData()); 63 63 } 64 64 }; -
trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp
r94599 r94701 93 93 workerContextPrototype->structure()->setGlobalObject(*m_globalData, m_workerContextWrapper.get()); 94 94 dedicatedContextPrototype->structure()->setGlobalObject(*m_globalData, m_workerContextWrapper.get()); 95 workerContextPrototype->putAnonymousValue(*m_globalData, 0, m_workerContextWrapper.get());96 dedicatedContextPrototype->putAnonymousValue(*m_globalData, 0, m_workerContextWrapper.get());97 95 #if ENABLE(SHARED_WORKERS) 98 96 } else { … … 103 101 104 102 m_workerContextWrapper.set(*m_globalData, JSSharedWorkerContext::create(*m_globalData, structure, m_workerContext->toSharedWorkerContext())); 105 m_workerContextWrapper->structure()->setGlobalObject(*m_globalData, m_workerContextWrapper.get());103 workerContextPrototype->structure()->setGlobalObject(*m_globalData, m_workerContextWrapper.get()); 106 104 sharedContextPrototype->structure()->setGlobalObject(*m_globalData, m_workerContextWrapper.get()); 107 workerContextPrototype->putAnonymousValue(*m_globalData, 0, m_workerContextWrapper.get());108 sharedContextPrototype->putAnonymousValue(*m_globalData, 0, m_workerContextWrapper.get());109 105 #endif 110 106 } 107 ASSERT(m_workerContextWrapper->globalObject() == m_workerContextWrapper); 108 ASSERT(asObject(m_workerContextWrapper->prototype())->globalObject() == m_workerContextWrapper); 111 109 } 112 110 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r94644 r94701 694 694 } 695 695 696 $headerIncludes{"<runtime/JSObject WithGlobalObject.h>"} = 1;696 $headerIncludes{"<runtime/JSObject.h>"} = 1; 697 697 $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; 698 698 … … 1021 1021 # Add prototype declaration. 1022 1022 %structureFlags = (); 1023 push(@headerContent, "class ${className}Prototype : public JSC::JS ObjectWithGlobalObject {\n");1023 push(@headerContent, "class ${className}Prototype : public JSC::JSNonFinalObject {\n"); 1024 1024 push(@headerContent, "public:\n"); 1025 push(@headerContent, " typedef JSC::JS ObjectWithGlobalObject Base;\n");1025 push(@headerContent, " typedef JSC::JSNonFinalObject Base;\n"); 1026 1026 if ($interfaceName ne "DOMWindow" && !$dataNode->extendedAttributes->{"IsWorkerContext"}) { 1027 1027 push(@headerContent, " static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);\n"); … … 1058 1058 1059 1059 push(@headerContent, "\nprivate:\n"); 1060 push(@headerContent, " ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) : JSC::JSObjectWithGlobalObject(globalData, structure) { finishCreation(globalData, globalObject); }\n");1060 push(@headerContent, " ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }\n"); 1061 1061 1062 1062 # structure flags … … 1421 1421 push(@implContent, " return getHashTableForGlobalData(exec->globalData(), &${className}PrototypeTable);\n"); 1422 1422 push(@implContent, "}\n\n"); 1423 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JS ObjectWithGlobalObject::s_info, 0, get${className}PrototypeTable };\n\n");1423 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, 0, get${className}PrototypeTable };\n\n"); 1424 1424 } else { 1425 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JS ObjectWithGlobalObject::s_info, &${className}PrototypeTable, 0 };\n\n");1425 push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, &${className}PrototypeTable, 0 };\n\n"); 1426 1426 } 1427 1427 if ($interfaceName ne "DOMWindow" && !$dataNode->extendedAttributes->{"IsWorkerContext"}) { -
trunk/Source/WebCore/bridge/objc/objc_runtime.h
r94644 r94701 31 31 #include "objc_header.h" 32 32 #include <runtime/JSGlobalObject.h> 33 #include <runtime/JSObjectWithGlobalObject.h>34 33 #include <wtf/RetainPtr.h> 35 34 … … 92 91 }; 93 92 94 class ObjcFallbackObjectImp : public JS ObjectWithGlobalObject {93 class ObjcFallbackObjectImp : public JSNonFinalObject { 95 94 public: 96 typedef JS ObjectWithGlobalObject Base;95 typedef JSNonFinalObject Base; 97 96 98 97 static ObjcFallbackObjectImp* create(ExecState* exec, JSGlobalObject* globalObject, ObjcInstance* instance, const Identifier& propertyName) -
trunk/Source/WebCore/bridge/objc/objc_runtime.mm
r94644 r94701 195 195 } 196 196 197 const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JS ObjectWithGlobalObject::s_info, 0, 0 };197 const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JSNonFinalObject::s_info, 0, 0 }; 198 198 199 199 ObjcFallbackObjectImp::ObjcFallbackObjectImp(JSGlobalObject* globalObject, Structure* structure, ObjcInstance* i, const Identifier& propertyName) 200 : JS ObjectWithGlobalObject(globalObject, structure)200 : JSNonFinalObject(globalObject->globalData(), structure) 201 201 , _instance(i) 202 202 , _item(propertyName) 203 203 { 204 204 finishCreation(globalObject); 205 ASSERT(structure->globalObject() == globalObject); 205 206 } 206 207 207 208 void ObjcFallbackObjectImp::finishCreation(JSGlobalObject* globalObject) 208 209 { 209 Base::finishCreation(globalObject->globalData() , globalObject);210 Base::finishCreation(globalObject->globalData()); 210 211 ASSERT(inherits(&s_info)); 211 212 } -
trunk/Source/WebCore/bridge/runtime_object.cpp
r94644 r94701 36 36 namespace Bindings { 37 37 38 const ClassInfo RuntimeObject::s_info = { "RuntimeObject", &JS ObjectWithGlobalObject::s_info, 0, 0 };38 const ClassInfo RuntimeObject::s_info = { "RuntimeObject", &JSNonFinalObject::s_info, 0, 0 }; 39 39 40 40 RuntimeObject::RuntimeObject(ExecState*, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance) 41 : JS ObjectWithGlobalObject(globalObject, structure)41 : JSNonFinalObject(globalObject->globalData(), structure) 42 42 , m_instance(instance) 43 43 { 44 ASSERT(structure->globalObject() == globalObject); 44 45 finishCreation(globalObject); 45 46 } … … 47 48 void RuntimeObject::finishCreation(JSGlobalObject* globalObject) 48 49 { 49 Base::finishCreation(globalObject->globalData() , globalObject);50 Base::finishCreation(globalObject->globalData()); 50 51 ASSERT(inherits(&s_info)); 51 52 } -
trunk/Source/WebCore/bridge/runtime_object.h
r94644 r94701 29 29 #include "BridgeJSC.h" 30 30 #include <runtime/JSGlobalObject.h> 31 #include <runtime/JSObjectWithGlobalObject.h>32 31 33 32 namespace JSC { 34 33 namespace Bindings { 35 34 36 class RuntimeObject : public JS ObjectWithGlobalObject {35 class RuntimeObject : public JSNonFinalObject { 37 36 public: 38 typedef JS ObjectWithGlobalObject Base;37 typedef JSNonFinalObject Base; 39 38 40 39 static RuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance) … … 76 75 RuntimeObject(ExecState*, JSGlobalObject*, Structure*, PassRefPtr<Instance>); 77 76 void finishCreation(JSGlobalObject*); 78 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObjectWithGlobalObject::StructureFlags;77 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | Base::StructureFlags; 79 78 80 79 private: -
trunk/Source/WebKit2/ChangeLog
r94685 r94701 1 2011-09-06 Oliver Hunt <oliver@apple.com> 2 3 Remove JSObjectWithGlobalObject 4 https://bugs.webkit.org/show_bug.cgi?id=67689 5 6 Reviewed by Geoff Garen. 7 8 Remove JSObjectWithGlobalObject usage. 9 10 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 11 (WebKit::JSNPObject::JSNPObject): 12 (WebKit::JSNPObject::finishCreation): 13 * WebProcess/Plugins/Netscape/JSNPObject.h: 14 1 15 2011-09-05 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 16 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r94644 r94701 49 49 } 50 50 51 const ClassInfo JSNPObject::s_info = { "NPObject", &JS ObjectWithGlobalObject::s_info, 0, 0 };51 const ClassInfo JSNPObject::s_info = { "NPObject", &JSNonFinalObject::s_info, 0, 0 }; 52 52 53 53 JSNPObject::JSNPObject(JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject, Structure* structure) 54 : JS ObjectWithGlobalObject(globalObject, structure)54 : JSNonFinalObject(globalObject->globalData(), structure) 55 55 , m_objectMap(objectMap) 56 56 , m_npObject(npObject) 57 57 { 58 ASSERT(globalObject == structure->globalObject()); 58 59 finishCreation(globalObject); 59 60 } … … 61 62 void JSNPObject::finishCreation(JSGlobalObject* globalObject) 62 63 { 63 Base::finishCreation(globalObject->globalData() , globalObject);64 Base::finishCreation(globalObject->globalData()); 64 65 ASSERT(inherits(&s_info)); 65 66 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r94644 r94701 27 27 #define JSNPObject_h 28 28 29 #include <JavaScriptCore/JSObject WithGlobalObject.h>29 #include <JavaScriptCore/JSObject.h> 30 30 31 31 typedef void* NPIdentifier; … … 38 38 // JSNPObject is a JSObject that wraps an NPObject. 39 39 40 class JSNPObject : public JSC::JS ObjectWithGlobalObject {40 class JSNPObject : public JSC::JSNonFinalObject { 41 41 public: 42 typedef JSC::JS ObjectWithGlobalObject Base;42 typedef JSC::JSNonFinalObject Base; 43 43 44 44 static JSNPObject* create(JSC::JSGlobalObject*, NPRuntimeObjectMap*, NPObject*);
Note: See TracChangeset
for help on using the changeset viewer.