Changeset 59941 in webkit
- Timestamp:
- May 21, 2010 11:19:42 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 114 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackConstructor.cpp
r52751 r59941 38 38 const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0, 0 }; 39 39 40 JSCallbackConstructor::JSCallbackConstructor( NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)41 : JSObject (structure)40 JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) 41 : JSObjectWithGlobalObject(globalObject, structure) 42 42 , m_class(jsClass) 43 43 , m_callback(callback) -
trunk/JavaScriptCore/API/JSCallbackConstructor.h
r54022 r59941 28 28 29 29 #include "JSObjectRef.h" 30 #include <runtime/JSObject .h>30 #include <runtime/JSObjectWithGlobalObject.h> 31 31 32 32 namespace JSC { 33 33 34 class JSCallbackConstructor : public JSObject {34 class JSCallbackConstructor : public JSObjectWithGlobalObject { 35 35 public: 36 JSCallbackConstructor( NonNullPassRefPtr<Structure>, JSClassRef, JSObjectCallAsConstructorCallback);36 JSCallbackConstructor(JSGlobalObject*, NonNullPassRefPtr<Structure>, JSClassRef, JSObjectCallAsConstructorCallback); 37 37 virtual ~JSCallbackConstructor(); 38 38 JSClassRef classRef() const { return m_class; } -
trunk/JavaScriptCore/API/JSCallbackFunction.cpp
r55633 r59941 42 42 const ClassInfo JSCallbackFunction::info = { "CallbackFunction", &InternalFunction::info, 0, 0 }; 43 43 44 JSCallbackFunction::JSCallbackFunction(ExecState* exec, JS ObjectCallAsFunctionCallback callback, const Identifier& name)45 : InternalFunction(&exec->globalData(), exec->lexicalGlobalObject()->callbackFunctionStructure(), name)44 JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name) 45 : InternalFunction(&exec->globalData(), globalObject, globalObject->callbackFunctionStructure(), name) 46 46 , m_callback(callback) 47 47 { -
trunk/JavaScriptCore/API/JSCallbackFunction.h
r54022 r59941 34 34 class JSCallbackFunction : public InternalFunction { 35 35 public: 36 JSCallbackFunction(ExecState*, JS ObjectCallAsFunctionCallback, const Identifier& name);36 JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name); 37 37 38 38 static const ClassInfo info; -
trunk/JavaScriptCore/API/JSCallbackObject.cpp
r58115 r59941 33 33 namespace JSC { 34 34 35 ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSObject >);35 ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSObjectWithGlobalObject>); 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<JSObject >::info = { "CallbackObject", 0, 0, 0 };39 template <> const ClassInfo JSCallbackObject<JSObjectWithGlobalObject>::info = { "CallbackObject", 0, 0, 0 }; 40 40 template <> const ClassInfo JSCallbackObject<JSGlobalObject>::info = { "CallbackGlobalObject", 0, 0, 0 }; 41 41 -
trunk/JavaScriptCore/API/JSCallbackObject.h
r56314 r59941 115 115 class JSCallbackObject : public Base { 116 116 public: 117 JSCallbackObject(ExecState*, NonNullPassRefPtr<Structure>, JSClassRef, void* data);118 JSCallbackObject(JSClassRef );117 JSCallbackObject(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, JSClassRef, void* data); 118 JSCallbackObject(JSClassRef, NonNullPassRefPtr<Structure>); 119 119 virtual ~JSCallbackObject(); 120 120 -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r55401 r59941 49 49 50 50 template <class Base> 51 JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, void* data)52 : Base( structure)51 JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, void* data) 52 : Base(globalObject, structure) 53 53 , m_callbackObjectData(new JSCallbackObjectData(data, jsClass)) 54 54 { … … 59 59 // FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one. 60 60 template <class Base> 61 JSCallbackObject<Base>::JSCallbackObject(JSClassRef jsClass )62 : Base( )61 JSCallbackObject<Base>::JSCallbackObject(JSClassRef jsClass, NonNullPassRefPtr<Structure> structure) 62 : Base(structure) 63 63 , m_callbackObjectData(new JSCallbackObjectData(0, jsClass)) 64 64 { … … 561 561 if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) { 562 562 if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { 563 JSObject* o = new (exec) JSCallbackFunction(exec, callAsFunction, propertyName); 563 564 JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName); 564 565 thisObj->putDirect(propertyName, o, entry->attributes); 565 566 return o; -
trunk/JavaScriptCore/API/JSClassRef.cpp
r58001 r59941 257 257 if (!jsClassData.cachedPrototype) { 258 258 // Recursive, but should be good enough for our purposes 259 jsClassData.cachedPrototype = new (exec) JSCallbackObject<JSObject >(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction259 jsClassData.cachedPrototype = new (exec) JSCallbackObject<JSObjectWithGlobalObject>(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction 260 260 if (parentClass) { 261 261 if (JSObject* prototype = parentClass->prototype(exec)) -
trunk/JavaScriptCore/API/JSContextRef.cpp
r58133 r59941 98 98 } 99 99 100 JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(globalObjectClass );100 JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(jsNull())); 101 101 ExecState* exec = globalObject->globalExec(); 102 102 JSValue prototype = globalObjectClass->prototype(exec); -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r56314 r59941 82 82 return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure())); // slightly more efficient 83 83 84 JSCallbackObject<JSObject >* object = new (exec) JSCallbackObject<JSObject>(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data);84 JSCallbackObject<JSObjectWithGlobalObject>* object = new (exec) JSCallbackObject<JSObjectWithGlobalObject>(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); 85 85 if (JSObject* prototype = jsClass->prototype(exec)) 86 86 object->setPrototype(prototype); … … 96 96 Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); 97 97 98 return toRef(new (exec) JSCallbackFunction(exec, callAsFunction, nameID));98 return toRef(new (exec) JSCallbackFunction(exec, exec->lexicalGlobalObject(), callAsFunction, nameID)); 99 99 } 100 100 … … 108 108 jsPrototype = exec->lexicalGlobalObject()->objectPrototype(); 109 109 110 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject() ->callbackConstructorStructure(), jsClass, callAsConstructor);110 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); 111 111 constructor->putDirect(exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); 112 112 return toRef(constructor); … … 344 344 if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) 345 345 return static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivate(); 346 else if (jsObject->inherits(&JSCallbackObject<JSObject >::info))347 return static_cast<JSCallbackObject<JSObject >*>(jsObject)->getPrivate();346 else if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) 347 return static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->getPrivate(); 348 348 349 349 return 0; … … 357 357 static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivate(data); 358 358 return true; 359 } else if (jsObject->inherits(&JSCallbackObject<JSObject >::info)) {360 static_cast<JSCallbackObject<JSObject >*>(jsObject)->setPrivate(data);359 } else if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) { 360 static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->setPrivate(data); 361 361 return true; 362 362 } … … 374 374 if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) 375 375 result = static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivateProperty(name); 376 else if (jsObject->inherits(&JSCallbackObject<JSObject >::info))377 result = static_cast<JSCallbackObject<JSObject >*>(jsObject)->getPrivateProperty(name);376 else if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) 377 result = static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->getPrivateProperty(name); 378 378 return toRef(exec, result); 379 379 } … … 390 390 return true; 391 391 } 392 if (jsObject->inherits(&JSCallbackObject<JSObject >::info)) {393 static_cast<JSCallbackObject<JSObject >*>(jsObject)->setPrivateProperty(name, jsValue);392 if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) { 393 static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->setPrivateProperty(name, jsValue); 394 394 return true; 395 395 } … … 407 407 return true; 408 408 } 409 if (jsObject->inherits(&JSCallbackObject<JSObject >::info)) {410 static_cast<JSCallbackObject<JSObject >*>(jsObject)->deletePrivateProperty(name);409 if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) { 410 static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->deletePrivateProperty(name); 411 411 return true; 412 412 } -
trunk/JavaScriptCore/API/JSValueRef.cpp
r58003 r59941 132 132 if (o->inherits(&JSCallbackObject<JSGlobalObject>::info)) 133 133 return static_cast<JSCallbackObject<JSGlobalObject>*>(o)->inherits(jsClass); 134 else if (o->inherits(&JSCallbackObject<JSObject >::info))135 return static_cast<JSCallbackObject<JSObject >*>(o)->inherits(jsClass);134 else if (o->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) 135 return static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(o)->inherits(jsClass); 136 136 } 137 137 return false; -
trunk/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
r58116 r59941 59 59 if (!obj) 60 60 return; 61 ASSERT(obj->inherits(&JSCallbackObject<JSGlobalObject>::info) || obj->inherits(&JSCallbackObject<JSObject >::info));61 ASSERT(obj->inherits(&JSCallbackObject<JSGlobalObject>::info) || obj->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)); 62 62 map->map().set(key, obj); 63 63 } -
trunk/JavaScriptCore/CMakeLists.txt
r59537 r59941 123 123 runtime/JSNumberCell.cpp 124 124 runtime/JSObject.cpp 125 runtime/JSObjectWithGlobalObject.cpp 125 126 runtime/JSONObject.cpp 126 127 runtime/JSPropertyNameIterator.cpp -
trunk/JavaScriptCore/ChangeLog
r59939 r59941 1 2010-05-21 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 All callable objects should have a global object reference 6 https://bugs.webkit.org/show_bug.cgi?id=39495 7 8 All objects that may ever return a value other CallTypeNone 9 or ConstructTypeNone now get a global object in their constructor 10 and store that in their first anonymous slot. We add a new type 11 JSObjectWithGlobalObject to allow us to share this logic as much 12 as possible, however some objects have specific inheritance 13 requirements so we can't just use it universally. 14 15 To enforce this requirement JSValue::getCallData and getConstructData 16 make use of a new "isValidCallee" function to assert that any object 17 that returns a value other than CallType/ConstructTypeNone has a 18 global object in anonymous slot 0. 19 20 In order to ensure that static function slots are converted into 21 function objects with the correct global object, all prototype objects 22 and other classes with static function slots also gain a global object 23 reference. Happily this fixes the long standing issue where host 24 function objects get a prototype from the lexical global object of the 25 first function that calls them, instead of the global object that they 26 are defined on. 27 28 * API/JSCallbackConstructor.cpp: 29 (JSC::JSCallbackConstructor::JSCallbackConstructor): 30 * API/JSCallbackConstructor.h: 31 * API/JSCallbackFunction.cpp: 32 (JSC::JSCallbackFunction::JSCallbackFunction): 33 * API/JSCallbackFunction.h: 34 * API/JSCallbackObject.cpp: 35 (JSC::): 36 * API/JSCallbackObject.h: 37 * API/JSCallbackObjectFunctions.h: 38 (JSC::::JSCallbackObject): 39 (JSC::::staticFunctionGetter): 40 * API/JSClassRef.cpp: 41 (OpaqueJSClass::prototype): 42 * API/JSContextRef.cpp: 43 * API/JSObjectRef.cpp: 44 (JSObjectMake): 45 (JSObjectMakeFunctionWithCallback): 46 (JSObjectMakeConstructor): 47 (JSObjectGetPrivate): 48 (JSObjectSetPrivate): 49 (JSObjectGetPrivateProperty): 50 (JSObjectSetPrivateProperty): 51 (JSObjectDeletePrivateProperty): 52 * API/JSValueRef.cpp: 53 (JSValueIsObjectOfClass): 54 * API/JSWeakObjectMapRefPrivate.cpp: 55 * CMakeLists.txt: 56 * GNUmakefile.am: 57 * JavaScriptCore.exp: 58 * JavaScriptCore.gypi: 59 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 60 * JavaScriptCore.xcodeproj/project.pbxproj: 61 * interpreter/Interpreter.cpp: 62 (JSC::Interpreter::privateExecute): 63 * jit/JITStubs.cpp: 64 (JSC::DEFINE_STUB_FUNCTION): 65 * jsc.cpp: 66 (GlobalObject::GlobalObject): 67 * runtime/ArrayConstructor.cpp: 68 (JSC::ArrayConstructor::ArrayConstructor): 69 * runtime/ArrayConstructor.h: 70 * runtime/ArrayPrototype.cpp: 71 (JSC::ArrayPrototype::ArrayPrototype): 72 * runtime/ArrayPrototype.h: 73 (JSC::ArrayPrototype::createStructure): 74 * runtime/BooleanConstructor.cpp: 75 (JSC::BooleanConstructor::BooleanConstructor): 76 * runtime/BooleanConstructor.h: 77 * runtime/BooleanPrototype.cpp: 78 (JSC::BooleanPrototype::BooleanPrototype): 79 * runtime/BooleanPrototype.h: 80 * runtime/DateConstructor.cpp: 81 (JSC::DateConstructor::DateConstructor): 82 * runtime/DateConstructor.h: 83 * runtime/DatePrototype.cpp: 84 (JSC::DatePrototype::DatePrototype): 85 * runtime/DatePrototype.h: 86 * runtime/ErrorConstructor.cpp: 87 (JSC::ErrorConstructor::ErrorConstructor): 88 * runtime/ErrorConstructor.h: 89 * runtime/ErrorPrototype.cpp: 90 (JSC::ErrorPrototype::ErrorPrototype): 91 * runtime/ErrorPrototype.h: 92 * runtime/FunctionConstructor.cpp: 93 (JSC::FunctionConstructor::FunctionConstructor): 94 * runtime/FunctionConstructor.h: 95 * runtime/FunctionPrototype.cpp: 96 (JSC::FunctionPrototype::FunctionPrototype): 97 (JSC::FunctionPrototype::addFunctionProperties): 98 * runtime/FunctionPrototype.h: 99 * runtime/GlobalEvalFunction.cpp: 100 (JSC::GlobalEvalFunction::GlobalEvalFunction): 101 * runtime/GlobalEvalFunction.h: 102 * runtime/InternalFunction.cpp: 103 (JSC::InternalFunction::InternalFunction): 104 * runtime/InternalFunction.h: 105 * runtime/JSCell.h: 106 (JSC::JSValue::getCallData): 107 (JSC::JSValue::getConstructData): 108 * runtime/JSFunction.cpp: 109 (JSC::JSFunction::JSFunction): 110 * runtime/JSFunction.h: 111 * runtime/JSGlobalObject.cpp: 112 (JSC::JSGlobalObject::reset): 113 * runtime/JSGlobalObject.h: 114 (JSC::JSGlobalObject::JSGlobalObject): 115 * runtime/JSONObject.cpp: 116 (JSC::JSONObject::JSONObject): 117 * runtime/JSONObject.h: 118 * runtime/JSObject.h: 119 * runtime/JSObjectWithGlobalObject.cpp: Added. 120 (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject): 121 * runtime/JSObjectWithGlobalObject.h: Added. 122 (JSC::JSObjectWithGlobalObject::createStructure): 123 (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject): 124 * runtime/JSValue.cpp: 125 (JSC::JSValue::isValidCallee): 126 * runtime/JSValue.h: 127 * runtime/Lookup.cpp: 128 (JSC::setUpStaticFunctionSlot): 129 * runtime/MathObject.cpp: 130 (JSC::MathObject::MathObject): 131 * runtime/MathObject.h: 132 * runtime/NativeErrorConstructor.cpp: 133 (JSC::NativeErrorConstructor::NativeErrorConstructor): 134 * runtime/NativeErrorConstructor.h: 135 * runtime/NativeErrorPrototype.cpp: 136 (JSC::NativeErrorPrototype::NativeErrorPrototype): 137 * runtime/NativeErrorPrototype.h: 138 * runtime/NumberConstructor.cpp: 139 (JSC::NumberConstructor::NumberConstructor): 140 * runtime/NumberConstructor.h: 141 * runtime/NumberPrototype.cpp: 142 (JSC::NumberPrototype::NumberPrototype): 143 * runtime/NumberPrototype.h: 144 * runtime/ObjectConstructor.cpp: 145 (JSC::ObjectConstructor::ObjectConstructor): 146 * runtime/ObjectConstructor.h: 147 * runtime/ObjectPrototype.cpp: 148 (JSC::ObjectPrototype::ObjectPrototype): 149 * runtime/ObjectPrototype.h: 150 * runtime/PrototypeFunction.cpp: 151 (JSC::PrototypeFunction::PrototypeFunction): 152 * runtime/PrototypeFunction.h: 153 * runtime/RegExpConstructor.cpp: 154 (JSC::RegExpConstructor::RegExpConstructor): 155 (JSC::constructRegExp): 156 * runtime/RegExpConstructor.h: 157 * runtime/RegExpObject.cpp: 158 (JSC::RegExpObject::RegExpObject): 159 * runtime/RegExpObject.h: 160 * runtime/RegExpPrototype.cpp: 161 (JSC::RegExpPrototype::RegExpPrototype): 162 * runtime/RegExpPrototype.h: 163 * runtime/StringConstructor.cpp: 164 (JSC::StringConstructor::StringConstructor): 165 * runtime/StringConstructor.h: 166 * runtime/StringPrototype.cpp: 167 (JSC::StringPrototype::StringPrototype): 168 * runtime/StringPrototype.h: 169 1 170 2010-05-21 Geoffrey Garen <ggaren@apple.com> 2 171 -
trunk/JavaScriptCore/GNUmakefile.am
r59187 r59941 464 464 JavaScriptCore/runtime/JSNumberCell.h \ 465 465 JavaScriptCore/runtime/JSObject.cpp \ 466 JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp \ 466 467 JavaScriptCore/runtime/JSObject.h \ 467 468 JavaScriptCore/runtime/JSStaticScopeObject.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.exp
r59811 r59941 102 102 __Z15jsRegExpExecutePK8JSRegExpPKtiiPii 103 103 __ZN14OpaqueJSString6createERKN3JSC7UStringE 104 __ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESC_RKNS_7ArgListEE 104 105 __ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPN7WebCore10StringImplE 105 106 __ZN3JSC10Identifier11addSlowCaseEPNS_9ExecStateEPN7WebCore10StringImplE … … 112 113 __ZN3JSC10JSFunction4infoE 113 114 __ZN3JSC10JSFunction4nameEPNS_9ExecStateE 114 __ZN3JSC10JSFunctionC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESA_RKNS_7ArgListEE115 115 __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeE 116 116 __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc … … 170 170 __ZN3JSC16InternalFunction4infoE 171 171 __ZN3JSC16InternalFunction4nameEPNS_9ExecStateE 172 __ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataE N3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_10IdentifierE172 __ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_10IdentifierE 173 173 __ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 174 174 __ZN3JSC16JSVariableObject14symbolTableGetERKNS_10IdentifierERNS_18PropertyDescriptorE … … 177 177 __ZN3JSC17BytecodeGenerator21setDumpsGeneratedCodeEb 178 178 __ZN3JSC17PropertyNameArray3addEPN7WebCore10StringImplE 179 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESA_RKNS_7ArgListEE 180 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectES6_RKNS_7ArgListEE 179 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESC_RKNS_7ArgListEE 181 180 __ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi 182 181 __ZN3JSC18DebuggerActivationC1EPNS_8JSObjectE … … 196 195 __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE 197 196 __ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE 197 __ZN3JSC24JSObjectWithGlobalObjectC2EPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEE 198 198 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE 199 199 __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE … … 241 241 __ZN3JSC7JSArrayC2EN3WTF17NonNullPassRefPtrINS_9StructureEEE 242 242 __ZN3JSC7JSArrayD2Ev 243 __ZN3JSC7JSValue13isValidCalleeEv 243 244 __ZN3JSC7Profile10restoreAllEv 244 245 __ZN3JSC7Profile5focusEPKNS_11ProfileNodeE -
trunk/JavaScriptCore/JavaScriptCore.gypi
r59187 r59941 248 248 'runtime/JSObject.cpp', 249 249 'runtime/JSObject.h', 250 'runtime/JSObjectWithGlobalObject.cpp', 251 'runtime/JSObjectWithGlobalObject.h', 250 252 'runtime/JSONObject.cpp', 251 253 'runtime/JSONObject.h', -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r59187 r59941 851 851 <File 852 852 RelativePath="..\..\runtime\JSObject.h" 853 > 854 </File> 855 <File 856 RelativePath="..\..\runtime\JSObjectWithGlobalObject.cpp" 857 > 858 </File> 859 <File 860 RelativePath="..\..\runtime\JSObjectWithGlobalObject.h" 853 861 > 854 862 </File> -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r59637 r59941 310 310 A7795590101A74D500114E55 /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A779558F101A74D500114E55 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; 311 311 A782F1A50EEC9FA20036273F /* ExecutableAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */; }; 312 A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 313 A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */; }; 312 314 A791EF280F11E07900AE1F68 /* JSByteArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A791EF260F11E07900AE1F68 /* JSByteArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; 313 315 A791EF290F11E07900AE1F68 /* JSByteArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A791EF270F11E07900AE1F68 /* JSByteArray.cpp */; }; … … 899 901 A779558F101A74D500114E55 /* MarkStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkStack.h; sourceTree = "<group>"; }; 900 902 A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorPosix.cpp; sourceTree = "<group>"; }; 903 A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectWithGlobalObject.h; sourceTree = "<group>"; }; 904 A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObjectWithGlobalObject.cpp; sourceTree = "<group>"; }; 901 905 A791EF260F11E07900AE1F68 /* JSByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSByteArray.h; sourceTree = "<group>"; }; 902 906 A791EF270F11E07900AE1F68 /* JSByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSByteArray.cpp; sourceTree = "<group>"; }; … … 1711 1715 14035DB010DBFB2A00FFFFE7 /* WeakGCPtr.h */, 1712 1716 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */, 1717 A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */, 1718 A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */, 1713 1719 ); 1714 1720 path = runtime; … … 2148 2154 86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */, 2149 2155 86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */, 2156 A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */, 2150 2157 ); 2151 2158 runOnlyForDeploymentPostprocessing = 0; … … 2601 2608 A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */, 2602 2609 86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */, 2610 A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */, 2603 2611 ); 2604 2612 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/jit/JITStubs.cpp
r59777 r59941 2960 2960 STUB_INIT_STACK_FRAME(stackFrame); 2961 2961 2962 return new (stackFrame.globalData) RegExpObject(stackFrame.callFrame->lexicalGlobalObject() ->regExpStructure(), stackFrame.args[0].regExp());2962 return new (stackFrame.globalData) RegExpObject(stackFrame.callFrame->lexicalGlobalObject(), stackFrame.callFrame->lexicalGlobalObject()->regExpStructure(), stackFrame.args[0].regExp()); 2963 2963 } 2964 2964 -
trunk/JavaScriptCore/jsc.cpp
r58012 r59941 151 151 : JSGlobalObject() 152 152 { 153 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug));154 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "print"), functionPrint));155 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "quit"), functionQuit));156 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "gc"), functionGC));157 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "version"), functionVersion));158 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "run"), functionRun));159 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "load"), functionLoad));160 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax));161 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline));153 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug)); 154 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "print"), functionPrint)); 155 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 0, Identifier(globalExec(), "quit"), functionQuit)); 156 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 0, Identifier(globalExec(), "gc"), functionGC)); 157 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "version"), functionVersion)); 158 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "run"), functionRun)); 159 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "load"), functionLoad)); 160 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax)); 161 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline)); 162 162 163 163 #if ENABLE(SAMPLING_FLAGS) 164 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "setSamplingFlags"), functionSetSamplingFlags));165 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "clearSamplingFlags"), functionClearSamplingFlags));164 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "setSamplingFlags"), functionSetSamplingFlags)); 165 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), this, prototypeFunctionStructure(), 1, Identifier(globalExec(), "clearSamplingFlags"), functionClearSamplingFlags)); 166 166 #endif 167 167 -
trunk/JavaScriptCore/runtime/ArrayConstructor.cpp
r49365 r59941 38 38 static JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*, JSObject*, JSValue, const ArgList&); 39 39 40 ArrayConstructor::ArrayConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, ArrayPrototype* arrayPrototype, Structure* prototypeFunctionStructure)41 : InternalFunction(&exec->globalData(), structure, Identifier(exec, arrayPrototype->classInfo()->className))40 ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, ArrayPrototype* arrayPrototype, Structure* prototypeFunctionStructure) 41 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className)) 42 42 { 43 43 // ECMA 15.4.3.1 Array.prototype … … 48 48 49 49 // ES5 50 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum);50 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum); 51 51 } 52 52 -
trunk/JavaScriptCore/runtime/ArrayConstructor.h
r48836 r59941 30 30 class ArrayConstructor : public InternalFunction { 31 31 public: 32 ArrayConstructor(ExecState*, NonNullPassRefPtr<Structure>, ArrayPrototype*, Structure*);32 ArrayConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, ArrayPrototype*, Structure*); 33 33 34 34 virtual ConstructType getConstructData(ConstructData&); -
trunk/JavaScriptCore/runtime/ArrayPrototype.cpp
r59355 r59941 117 117 118 118 // ECMA 15.4.4 119 ArrayPrototype::ArrayPrototype( NonNullPassRefPtr<Structure> structure)119 ArrayPrototype::ArrayPrototype(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) 120 120 : JSArray(structure) 121 121 { 122 putAnonymousValue(0, globalObject); 122 123 } 123 124 -
trunk/JavaScriptCore/runtime/ArrayPrototype.h
r48836 r59941 29 29 class ArrayPrototype : public JSArray { 30 30 public: 31 explicit ArrayPrototype( NonNullPassRefPtr<Structure>);31 explicit ArrayPrototype(JSGlobalObject*, NonNullPassRefPtr<Structure>); 32 32 33 33 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); … … 36 36 virtual const ClassInfo* classInfo() const { return &info; } 37 37 static const ClassInfo info; 38 39 static PassRefPtr<Structure> createStructure(JSValue prototype) 40 { 41 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); 42 } 43 44 protected: 45 static const unsigned AnonymousSlotCount = JSArray::AnonymousSlotCount + 1; 38 46 }; 39 47 -
trunk/JavaScriptCore/runtime/BooleanConstructor.cpp
r48836 r59941 29 29 ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor); 30 30 31 BooleanConstructor::BooleanConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, BooleanPrototype* booleanPrototype)32 : InternalFunction(&exec->globalData(), structure, Identifier(exec, booleanPrototype->classInfo()->className))31 BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, BooleanPrototype* booleanPrototype) 32 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, booleanPrototype->classInfo()->className)) 33 33 { 34 34 putDirectWithoutTransition(exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly); -
trunk/JavaScriptCore/runtime/BooleanConstructor.h
r48836 r59941 30 30 class BooleanConstructor : public InternalFunction { 31 31 public: 32 BooleanConstructor(ExecState*, NonNullPassRefPtr<Structure>, BooleanPrototype*);32 BooleanConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, BooleanPrototype*); 33 33 34 34 private: -
trunk/JavaScriptCore/runtime/BooleanPrototype.cpp
r48836 r59941 38 38 // ECMA 15.6.4 39 39 40 BooleanPrototype::BooleanPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure)40 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure) 41 41 : BooleanObject(structure) 42 42 { 43 43 setInternalValue(jsBoolean(false)); 44 44 45 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum);46 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum);45 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum); 46 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum); 47 47 } 48 48 -
trunk/JavaScriptCore/runtime/BooleanPrototype.h
r48836 r59941 28 28 class BooleanPrototype : public BooleanObject { 29 29 public: 30 BooleanPrototype(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure);30 BooleanPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure); 31 31 }; 32 32 -
trunk/JavaScriptCore/runtime/DateConstructor.cpp
r54394 r59941 59 59 static JSValue JSC_HOST_CALL dateUTC(ExecState*, JSObject*, JSValue, const ArgList&); 60 60 61 DateConstructor::DateConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure, DatePrototype* datePrototype)62 : InternalFunction(&exec->globalData(), structure, Identifier(exec, datePrototype->classInfo()->className))61 DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure, DatePrototype* datePrototype) 62 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className)) 63 63 { 64 64 putDirectWithoutTransition(exec->propertyNames().prototype, datePrototype, DontEnum|DontDelete|ReadOnly); 65 65 66 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().parse, dateParse), DontEnum);67 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 7, exec->propertyNames().UTC, dateUTC), DontEnum);68 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().now, dateNow), DontEnum);66 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().parse, dateParse), DontEnum); 67 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 7, exec->propertyNames().UTC, dateUTC), DontEnum); 68 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().now, dateNow), DontEnum); 69 69 70 70 putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 7), ReadOnly | DontEnum | DontDelete); -
trunk/JavaScriptCore/runtime/DateConstructor.h
r48836 r59941 30 30 class DateConstructor : public InternalFunction { 31 31 public: 32 DateConstructor(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure, DatePrototype*);32 DateConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure, DatePrototype*); 33 33 34 34 private: -
trunk/JavaScriptCore/runtime/DatePrototype.cpp
r59545 r59941 419 419 // ECMA 15.9.4 420 420 421 DatePrototype::DatePrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure)421 DatePrototype::DatePrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) 422 422 : DateInstance(exec, structure) 423 423 { 424 424 // The constructor will be added later, after DateConstructor has been built. 425 putAnonymousValue(0, globalObject); 425 426 } 426 427 -
trunk/JavaScriptCore/runtime/DatePrototype.h
r54022 r59941 30 30 class DatePrototype : public DateInstance { 31 31 public: 32 DatePrototype(ExecState*, NonNullPassRefPtr<Structure>);32 DatePrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>); 33 33 34 34 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/JavaScriptCore/runtime/ErrorConstructor.cpp
r48836 r59941 30 30 ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor); 31 31 32 ErrorConstructor::ErrorConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, ErrorPrototype* errorPrototype)33 : InternalFunction(&exec->globalData(), structure, Identifier(exec, errorPrototype->classInfo()->className))32 ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, ErrorPrototype* errorPrototype) 33 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, errorPrototype->classInfo()->className)) 34 34 { 35 35 // ECMA 15.11.3.1 Error.prototype -
trunk/JavaScriptCore/runtime/ErrorConstructor.h
r48836 r59941 31 31 class ErrorConstructor : public InternalFunction { 32 32 public: 33 ErrorConstructor(ExecState*, NonNullPassRefPtr<Structure>, ErrorPrototype*);33 ErrorConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, ErrorPrototype*); 34 34 35 35 private: -
trunk/JavaScriptCore/runtime/ErrorPrototype.cpp
r54394 r59941 36 36 37 37 // ECMA 15.9.4 38 ErrorPrototype::ErrorPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure)38 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure) 39 39 : ErrorInstance(structure) 40 40 { … … 44 44 putDirectWithoutTransition(exec->propertyNames().message, jsNontrivialString(exec, "Unknown error"), DontEnum); 45 45 46 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum);46 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum); 47 47 } 48 48 -
trunk/JavaScriptCore/runtime/ErrorPrototype.h
r48836 r59941 30 30 class ErrorPrototype : public ErrorInstance { 31 31 public: 32 ErrorPrototype(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure);32 ErrorPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure); 33 33 }; 34 34 -
trunk/JavaScriptCore/runtime/FunctionConstructor.cpp
r54571 r59941 36 36 ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor); 37 37 38 FunctionConstructor::FunctionConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, FunctionPrototype* functionPrototype)39 : InternalFunction(&exec->globalData(), structure, Identifier(exec, functionPrototype->classInfo()->className))38 FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, FunctionPrototype* functionPrototype) 39 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, functionPrototype->classInfo()->className)) 40 40 { 41 41 putDirectWithoutTransition(exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly); -
trunk/JavaScriptCore/runtime/FunctionConstructor.h
r48836 r59941 30 30 class FunctionConstructor : public InternalFunction { 31 31 public: 32 FunctionConstructor(ExecState*, NonNullPassRefPtr<Structure>, FunctionPrototype*);32 FunctionConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, FunctionPrototype*); 33 33 34 34 private: -
trunk/JavaScriptCore/runtime/FunctionPrototype.cpp
r59811 r59941 39 39 static JSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*, JSObject*, JSValue, const ArgList&); 40 40 41 FunctionPrototype::FunctionPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure)42 : InternalFunction(&exec->globalData(), structure, exec->propertyNames().nullIdentifier)41 FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) 42 : InternalFunction(&exec->globalData(), globalObject, structure, exec->propertyNames().nullIdentifier) 43 43 { 44 44 putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum); 45 45 } 46 46 47 void FunctionPrototype::addFunctionProperties(ExecState* exec, Structure* prototypeFunctionStructure, NativeFunctionWrapper** callFunction, NativeFunctionWrapper** applyFunction)47 void FunctionPrototype::addFunctionProperties(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeFunctionStructure, NativeFunctionWrapper** callFunction, NativeFunctionWrapper** applyFunction) 48 48 { 49 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);50 *applyFunction = new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().apply, functionProtoFuncApply);49 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum); 50 *applyFunction = new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().apply, functionProtoFuncApply); 51 51 putDirectFunctionWithoutTransition(exec, *applyFunction, DontEnum); 52 *callFunction = new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().call, functionProtoFuncCall);52 *callFunction = new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().call, functionProtoFuncCall); 53 53 putDirectFunctionWithoutTransition(exec, *callFunction, DontEnum); 54 54 } -
trunk/JavaScriptCore/runtime/FunctionPrototype.h
r54022 r59941 30 30 class FunctionPrototype : public InternalFunction { 31 31 public: 32 FunctionPrototype(ExecState*, NonNullPassRefPtr<Structure>);33 void addFunctionProperties(ExecState*, Structure* prototypeFunctionStructure, NativeFunctionWrapper** callFunction, NativeFunctionWrapper** applyFunction);32 FunctionPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>); 33 void addFunctionProperties(ExecState*, JSGlobalObject*, Structure* prototypeFunctionStructure, NativeFunctionWrapper** callFunction, NativeFunctionWrapper** applyFunction); 34 34 35 35 static PassRefPtr<Structure> createStructure(JSValue proto) -
trunk/JavaScriptCore/runtime/GlobalEvalFunction.cpp
r48836 r59941 33 33 ASSERT_CLASS_FITS_IN_CELL(GlobalEvalFunction); 34 34 35 GlobalEvalFunction::GlobalEvalFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int len, const Identifier& name, NativeFunction function, JSGlobalObject* cachedGlobalObject)36 : PrototypeFunction(exec, structure, len, name, function)35 GlobalEvalFunction::GlobalEvalFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, int len, const Identifier& name, NativeFunction function, JSGlobalObject* cachedGlobalObject) 36 : PrototypeFunction(exec, globalObject, structure, len, name, function) 37 37 , m_cachedGlobalObject(cachedGlobalObject) 38 38 { -
trunk/JavaScriptCore/runtime/GlobalEvalFunction.h
r54022 r59941 33 33 class GlobalEvalFunction : public PrototypeFunction { 34 34 public: 35 GlobalEvalFunction(ExecState*, NonNullPassRefPtr<Structure>, int len, const Identifier&, NativeFunction, JSGlobalObject* expectedThisObject);35 GlobalEvalFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int len, const Identifier&, NativeFunction, JSGlobalObject* expectedThisObject); 36 36 JSGlobalObject* cachedGlobalObject() const { return m_cachedGlobalObject; } 37 37 -
trunk/JavaScriptCore/runtime/InternalFunction.cpp
r57055 r59941 25 25 26 26 #include "FunctionPrototype.h" 27 #include "JSGlobalObject.h" 27 28 #include "JSString.h" 28 29 … … 38 39 } 39 40 40 InternalFunction::InternalFunction(JSGlobalData* globalData, NonNullPassRefPtr<Structure> structure, const Identifier& name) 41 : JSObject(structure) 41 InternalFunction::InternalFunction(NonNullPassRefPtr<Structure> structure) 42 : JSObjectWithGlobalObject(structure) 43 { 44 } 45 46 InternalFunction::InternalFunction(JSGlobalData* globalData, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, const Identifier& name) 47 : JSObjectWithGlobalObject(globalObject, structure) 42 48 { 43 49 putDirect(globalData->propertyNames->name, jsString(globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); -
trunk/JavaScriptCore/runtime/InternalFunction.h
r54022 r59941 25 25 #define InternalFunction_h 26 26 27 #include "JSObject .h"27 #include "JSObjectWithGlobalObject.h" 28 28 #include "Identifier.h" 29 29 … … 32 32 class FunctionPrototype; 33 33 34 class InternalFunction : public JSObject {34 class InternalFunction : public JSObjectWithGlobalObject { 35 35 public: 36 36 virtual const ClassInfo* classInfo() const; … … 49 49 static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; 50 50 51 InternalFunction(NonNullPassRefPtr<Structure> structure) : JSObject(structure) { } 52 InternalFunction(JSGlobalData*, NonNullPassRefPtr<Structure>, const Identifier&); 51 // Only used to allow us to determine the JSFunction vptr 52 InternalFunction(NonNullPassRefPtr<Structure> structure); 53 54 InternalFunction(JSGlobalData*, JSGlobalObject*, NonNullPassRefPtr<Structure>, const Identifier&); 53 55 54 56 private: -
trunk/JavaScriptCore/runtime/JSCell.h
r59055 r59941 208 208 inline CallType JSValue::getCallData(CallData& callData) 209 209 { 210 return isCell() ? asCell()->getCallData(callData) : CallTypeNone; 210 CallType result = isCell() ? asCell()->getCallData(callData) : CallTypeNone; 211 ASSERT(result == CallTypeNone || isValidCallee()); 212 return result; 211 213 } 212 214 213 215 inline ConstructType JSValue::getConstructData(ConstructData& constructData) 214 216 { 215 return isCell() ? asCell()->getConstructData(constructData) : ConstructTypeNone; 217 ConstructType result = isCell() ? asCell()->getConstructData(constructData) : ConstructTypeNone; 218 ASSERT(result == ConstructTypeNone || isValidCallee()); 219 return result; 216 220 } 217 221 -
trunk/JavaScriptCore/runtime/JSFunction.cpp
r59811 r59941 58 58 } 59 59 60 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, PassRefPtr<NativeExecutable> thunk)61 : Base( structure)60 JSFunction::JSFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, PassRefPtr<NativeExecutable> thunk) 61 : Base(globalObject, structure) 62 62 #if ENABLE(JIT) 63 63 , m_executable(thunk) 64 64 #endif 65 , m_scopeChain( NoScopeChain())65 , m_scopeChain(globalObject->globalScopeChain()) 66 66 { 67 67 putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); … … 75 75 } 76 76 77 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, NativeFunction func)78 : Base( structure)77 JSFunction::JSFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, NativeFunction func) 78 : Base(globalObject, structure) 79 79 #if ENABLE(JIT) 80 80 , m_executable(exec->globalData().getHostFunction(func)) 81 81 #endif 82 , m_scopeChain( NoScopeChain())82 , m_scopeChain(globalObject->globalScopeChain()) 83 83 { 84 84 putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum); … … 93 93 94 94 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<FunctionExecutable> executable, ScopeChainNode* scopeChainNode) 95 : Base( exec->lexicalGlobalObject()->functionStructure())95 : Base(scopeChainNode->globalObject, scopeChainNode->globalObject->functionStructure()) 96 96 , m_executable(executable) 97 97 , m_scopeChain(scopeChainNode) -
trunk/JavaScriptCore/runtime/JSFunction.h
r59811 r59941 25 25 #define JSFunction_h 26 26 27 #include "JSObject .h"27 #include "JSObjectWithGlobalObject.h" 28 28 29 29 namespace JSC { … … 36 36 class NativeExecutable; 37 37 38 class JSFunction : public JSObject {38 class JSFunction : public JSObjectWithGlobalObject { 39 39 friend class JIT; 40 40 friend class JSGlobalData; 41 41 42 typedef JSObject Base;42 typedef JSObjectWithGlobalObject Base; 43 43 44 44 public: 45 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction);46 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, PassRefPtr<NativeExecutable>);45 JSFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction); 46 JSFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int length, const Identifier&, PassRefPtr<NativeExecutable>); 47 47 JSFunction(ExecState*, NonNullPassRefPtr<FunctionExecutable>, ScopeChainNode*); 48 48 virtual ~JSFunction(); -
trunk/JavaScriptCore/runtime/JSGlobalObject.cpp
r58986 r59941 204 204 // Prototypes 205 205 206 d()->functionPrototype = new (exec) FunctionPrototype(exec, FunctionPrototype::createStructure(jsNull())); // The real prototype will be set once ObjectPrototype is created.206 d()->functionPrototype = new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(jsNull())); // The real prototype will be set once ObjectPrototype is created. 207 207 d()->prototypeFunctionStructure = PrototypeFunction::createStructure(d()->functionPrototype); 208 208 NativeFunctionWrapper* callFunction = 0; 209 209 NativeFunctionWrapper* applyFunction = 0; 210 d()->functionPrototype->addFunctionProperties(exec, d()->prototypeFunctionStructure.get(), &callFunction, &applyFunction);210 d()->functionPrototype->addFunctionProperties(exec, this, d()->prototypeFunctionStructure.get(), &callFunction, &applyFunction); 211 211 d()->callFunction = callFunction; 212 212 d()->applyFunction = applyFunction; 213 d()->objectPrototype = new (exec) ObjectPrototype(exec, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get());213 d()->objectPrototype = new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get()); 214 214 d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype); 215 215 … … 220 220 d()->argumentsStructure = Arguments::createStructure(d()->objectPrototype); 221 221 d()->callbackConstructorStructure = JSCallbackConstructor::createStructure(d()->objectPrototype); 222 d()->callbackObjectStructure = JSCallbackObject<JSObject >::createStructure(d()->objectPrototype);223 224 d()->arrayPrototype = new (exec) ArrayPrototype( ArrayPrototype::createStructure(d()->objectPrototype));222 d()->callbackObjectStructure = JSCallbackObject<JSObjectWithGlobalObject>::createStructure(d()->objectPrototype); 223 224 d()->arrayPrototype = new (exec) ArrayPrototype(this, ArrayPrototype::createStructure(d()->objectPrototype)); 225 225 d()->arrayStructure = JSArray::createStructure(d()->arrayPrototype); 226 226 d()->regExpMatchesArrayStructure = RegExpMatchesArray::createStructure(d()->arrayPrototype); 227 227 228 d()->stringPrototype = new (exec) StringPrototype(exec, StringPrototype::createStructure(d()->objectPrototype));228 d()->stringPrototype = new (exec) StringPrototype(exec, this, StringPrototype::createStructure(d()->objectPrototype)); 229 229 d()->stringObjectStructure = StringObject::createStructure(d()->stringPrototype); 230 230 231 d()->booleanPrototype = new (exec) BooleanPrototype(exec, BooleanPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());231 d()->booleanPrototype = new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get()); 232 232 d()->booleanObjectStructure = BooleanObject::createStructure(d()->booleanPrototype); 233 233 234 d()->numberPrototype = new (exec) NumberPrototype(exec, NumberPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());234 d()->numberPrototype = new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get()); 235 235 d()->numberObjectStructure = NumberObject::createStructure(d()->numberPrototype); 236 236 237 d()->datePrototype = new (exec) DatePrototype(exec, DatePrototype::createStructure(d()->objectPrototype));237 d()->datePrototype = new (exec) DatePrototype(exec, this, DatePrototype::createStructure(d()->objectPrototype)); 238 238 d()->dateStructure = DateInstance::createStructure(d()->datePrototype); 239 239 240 d()->regExpPrototype = new (exec) RegExpPrototype(exec, RegExpPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());240 d()->regExpPrototype = new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get()); 241 241 d()->regExpStructure = RegExpObject::createStructure(d()->regExpPrototype); 242 242 243 243 d()->methodCallDummy = constructEmptyObject(exec); 244 244 245 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, ErrorPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());245 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get()); 246 246 d()->errorStructure = ErrorInstance::createStructure(errorPrototype); 247 247 248 248 RefPtr<Structure> nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(errorPrototype); 249 249 250 NativeErrorPrototype* evalErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "EvalError", "EvalError");251 NativeErrorPrototype* rangeErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "RangeError", "RangeError");252 NativeErrorPrototype* referenceErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "ReferenceError", "ReferenceError");253 NativeErrorPrototype* syntaxErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "SyntaxError", "SyntaxError");254 NativeErrorPrototype* typeErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "TypeError", "TypeError");255 NativeErrorPrototype* URIErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "URIError", "URIError");250 NativeErrorPrototype* evalErrorPrototype = new (exec) NativeErrorPrototype(exec, this, nativeErrorPrototypeStructure, "EvalError", "EvalError"); 251 NativeErrorPrototype* rangeErrorPrototype = new (exec) NativeErrorPrototype(exec, this, nativeErrorPrototypeStructure, "RangeError", "RangeError"); 252 NativeErrorPrototype* referenceErrorPrototype = new (exec) NativeErrorPrototype(exec, this, nativeErrorPrototypeStructure, "ReferenceError", "ReferenceError"); 253 NativeErrorPrototype* syntaxErrorPrototype = new (exec) NativeErrorPrototype(exec, this, nativeErrorPrototypeStructure, "SyntaxError", "SyntaxError"); 254 NativeErrorPrototype* typeErrorPrototype = new (exec) NativeErrorPrototype(exec, this, nativeErrorPrototypeStructure, "TypeError", "TypeError"); 255 NativeErrorPrototype* URIErrorPrototype = new (exec) NativeErrorPrototype(exec, this, nativeErrorPrototypeStructure, "URIError", "URIError"); 256 256 257 257 // Constructors 258 258 259 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, ObjectConstructor::createStructure(d()->functionPrototype), d()->objectPrototype, d()->prototypeFunctionStructure.get());260 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, FunctionConstructor::createStructure(d()->functionPrototype), d()->functionPrototype);261 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, ArrayConstructor::createStructure(d()->functionPrototype), d()->arrayPrototype, d()->prototypeFunctionStructure.get());262 JSCell* stringConstructor = new (exec) StringConstructor(exec, StringConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->stringPrototype);263 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, BooleanConstructor::createStructure(d()->functionPrototype), d()->booleanPrototype);264 JSCell* numberConstructor = new (exec) NumberConstructor(exec, NumberConstructor::createStructure(d()->functionPrototype), d()->numberPrototype);265 JSCell* dateConstructor = new (exec) DateConstructor(exec, DateConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->datePrototype);266 267 d()->regExpConstructor = new (exec) RegExpConstructor(exec, RegExpConstructor::createStructure(d()->functionPrototype), d()->regExpPrototype);268 269 d()->errorConstructor = new (exec) ErrorConstructor(exec, ErrorConstructor::createStructure(d()->functionPrototype), errorPrototype);259 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(d()->functionPrototype), d()->objectPrototype, d()->prototypeFunctionStructure.get()); 260 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(d()->functionPrototype), d()->functionPrototype); 261 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(d()->functionPrototype), d()->arrayPrototype, d()->prototypeFunctionStructure.get()); 262 JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->stringPrototype); 263 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(d()->functionPrototype), d()->booleanPrototype); 264 JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(d()->functionPrototype), d()->numberPrototype); 265 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->datePrototype); 266 267 d()->regExpConstructor = new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(d()->functionPrototype), d()->regExpPrototype); 268 269 d()->errorConstructor = new (exec) ErrorConstructor(exec, this, ErrorConstructor::createStructure(d()->functionPrototype), errorPrototype); 270 270 271 271 RefPtr<Structure> nativeErrorStructure = NativeErrorConstructor::createStructure(d()->functionPrototype); 272 272 273 d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, evalErrorPrototype);274 d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, rangeErrorPrototype);275 d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, referenceErrorPrototype);276 d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, syntaxErrorPrototype);277 d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, typeErrorPrototype);278 d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, URIErrorPrototype);273 d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, evalErrorPrototype); 274 d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, rangeErrorPrototype); 275 d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, referenceErrorPrototype); 276 d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, syntaxErrorPrototype); 277 d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, typeErrorPrototype); 278 d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, URIErrorPrototype); 279 279 280 280 d()->objectPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, objectConstructor, DontEnum); … … 317 317 // Set global values. 318 318 GlobalPropertyInfo staticGlobals[] = { 319 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, MathObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete),319 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete), 320 320 GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete | ReadOnly), 321 321 GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete | ReadOnly), 322 322 GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete | ReadOnly), 323 GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject( JSONObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete)323 GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete) 324 324 }; 325 325 … … 328 328 // Set global functions. 329 329 330 d()->evalFunction = new (exec) GlobalEvalFunction(exec, GlobalEvalFunction::createStructure(d()->functionPrototype), 1, exec->propertyNames().eval, globalFuncEval, this);330 d()->evalFunction = new (exec) GlobalEvalFunction(exec, this, GlobalEvalFunction::createStructure(d()->functionPrototype), 1, exec->propertyNames().eval, globalFuncEval, this); 331 331 putDirectFunctionWithoutTransition(exec, d()->evalFunction, DontEnum); 332 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum);333 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum);334 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "isNaN"), globalFuncIsNaN), DontEnum);335 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "isFinite"), globalFuncIsFinite), DontEnum);336 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "escape"), globalFuncEscape), DontEnum);337 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "unescape"), globalFuncUnescape), DontEnum);338 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "decodeURI"), globalFuncDecodeURI), DontEnum);339 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "decodeURIComponent"), globalFuncDecodeURIComponent), DontEnum);340 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "encodeURI"), globalFuncEncodeURI), DontEnum);341 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "encodeURIComponent"), globalFuncEncodeURIComponent), DontEnum);332 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum); 333 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum); 334 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "isNaN"), globalFuncIsNaN), DontEnum); 335 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "isFinite"), globalFuncIsFinite), DontEnum); 336 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "escape"), globalFuncEscape), DontEnum); 337 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "unescape"), globalFuncUnescape), DontEnum); 338 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "decodeURI"), globalFuncDecodeURI), DontEnum); 339 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "decodeURIComponent"), globalFuncDecodeURIComponent), DontEnum); 340 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "encodeURI"), globalFuncEncodeURI), DontEnum); 341 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "encodeURIComponent"), globalFuncEncodeURIComponent), DontEnum); 342 342 #ifndef NDEBUG 343 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "jscprint"), globalFuncJSCPrint), DontEnum);343 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "jscprint"), globalFuncJSCPrint), DontEnum); 344 344 #endif 345 345 -
trunk/JavaScriptCore/runtime/JSGlobalObject.h
r58986 r59941 161 161 public: 162 162 void* operator new(size_t, JSGlobalData*); 163 163 164 164 explicit JSGlobalObject() 165 165 : JSVariableObject(JSGlobalObject::createStructure(jsNull()), new JSGlobalObjectData(destroyJSGlobalObjectData)) 166 166 { 167 COMPILE_ASSERT(JSGlobalObject::AnonymousSlotCount == 1, JSGlobalObject_has_only_a_single_slot); 168 putAnonymousValue(0, this); 169 init(this); 170 } 171 172 explicit JSGlobalObject(NonNullPassRefPtr<Structure> structure) 173 : JSVariableObject(structure, new JSGlobalObjectData(destroyJSGlobalObjectData)) 174 { 175 COMPILE_ASSERT(JSGlobalObject::AnonymousSlotCount == 1, JSGlobalObject_has_only_a_single_slot); 176 putAnonymousValue(0, this); 167 177 init(this); 168 178 } … … 172 182 : JSVariableObject(structure, data) 173 183 { 184 COMPILE_ASSERT(JSGlobalObject::AnonymousSlotCount == 1, JSGlobalObject_has_only_a_single_slot); 185 putAnonymousValue(0, this); 174 186 init(thisValue); 175 187 } … … 286 298 protected: 287 299 300 static const unsigned AnonymousSlotCount = JSVariableObject::AnonymousSlotCount + 1; 288 301 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags; 289 302 -
trunk/JavaScriptCore/runtime/JSONObject.cpp
r57978 r59941 31 31 #include "ExceptionHelpers.h" 32 32 #include "JSArray.h" 33 #include "JSGlobalObject.h" 33 34 #include "LiteralParser.h" 34 35 #include "Lookup.h" … … 49 50 50 51 namespace JSC { 52 53 JSONObject::JSONObject(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) 54 : JSObjectWithGlobalObject(globalObject, structure) 55 { 56 } 51 57 52 58 // PropertyNameForFunctionCall objects must be on the stack, since the JSValue that they create is not marked. -
trunk/JavaScriptCore/runtime/JSONObject.h
r56189 r59941 27 27 #define JSONObject_h 28 28 29 #include "JSObject .h"29 #include "JSObjectWithGlobalObject.h" 30 30 31 31 namespace JSC { … … 33 33 class Stringifier; 34 34 35 class JSONObject : public JSObject {35 class JSONObject : public JSObjectWithGlobalObject { 36 36 public: 37 JSONObject(NonNullPassRefPtr<Structure> structure) 38 : JSObject(structure) 39 { 40 } 37 JSONObject(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure); 41 38 42 39 static PassRefPtr<Structure> createStructure(JSValue prototype) -
trunk/JavaScriptCore/runtime/JSObject.h
r59811 r59941 75 75 friend class JIT; 76 76 friend class JSCell; 77 friend void setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot); 77 78 78 79 public: … … 220 221 } 221 222 223 void putAnonymousValue(unsigned index, JSValue value) 224 { 225 ASSERT(index < m_structure->anonymousSlotCount()); 226 *locationForOffset(index) = value; 227 } 228 JSValue getAnonymousValue(unsigned index) const 229 { 230 ASSERT(index < m_structure->anonymousSlotCount()); 231 return *locationForOffset(index); 232 } 233 222 234 protected: 223 235 static const unsigned StructureFlags = 0; 224 225 void putAnonymousValue(unsigned index, JSValue value) 226 { 227 ASSERT(index < m_structure->anonymousSlotCount()); 228 *locationForOffset(index) = value; 229 } 230 JSValue getAnonymousValue(unsigned index) const 231 { 232 ASSERT(index < m_structure->anonymousSlotCount()); 233 return *locationForOffset(index); 234 } 235 236 236 237 private: 237 238 // Nobody should ever ask any of these questions on something already known to be a JSObject. -
trunk/JavaScriptCore/runtime/JSValue.cpp
r54539 r59941 182 182 } 183 183 184 bool JSValue::isValidCallee() 185 { 186 return asObject(asObject(asCell())->getAnonymousValue(0))->isGlobalObject(); 187 } 188 184 189 } // namespace JSC -
trunk/JavaScriptCore/runtime/JSValue.h
r58286 r59941 204 204 bool isCell() const; 205 205 JSCell* asCell() const; 206 bool isValidCallee(); 206 207 207 208 #ifndef NDEBUG -
trunk/JavaScriptCore/runtime/Lookup.cpp
r59811 r59941 72 72 void setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot) 73 73 { 74 ASSERT(thisObj->structure()->anonymousSlotCount() > 0); 75 ASSERT(thisObj->getAnonymousValue(0).isCell() && asObject(thisObj->getAnonymousValue(0).asCell())->isGlobalObject()); 74 76 ASSERT(entry->attributes() & Function); 75 77 JSValue* location = thisObj->getDirectLocation(propertyName); … … 77 79 if (!location) { 78 80 NativeFunctionWrapper* function; 81 JSGlobalObject* globalObject = asGlobalObject(thisObj->getAnonymousValue(0).asCell()); 79 82 #if ENABLE(JIT) 80 83 if (entry->generator()) 81 function = new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), entry->functionLength(), propertyName, exec->globalData().getHostFunction(entry->function(), entry->generator()));84 function = new (exec) NativeFunctionWrapper(exec, globalObject, globalObject->prototypeFunctionStructure(), entry->functionLength(), propertyName, exec->globalData().getHostFunction(entry->function(), entry->generator())); 82 85 else 83 86 #endif 84 function = new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), entry->functionLength(), propertyName, entry->function());87 function = new (exec) NativeFunctionWrapper(exec, globalObject, globalObject->prototypeFunctionStructure(), entry->functionLength(), propertyName, entry->function()); 85 88 86 89 thisObj->putDirectFunction(propertyName, function, entry->attributes()); -
trunk/JavaScriptCore/runtime/MathObject.cpp
r58935 r59941 87 87 */ 88 88 89 MathObject::MathObject(ExecState* exec, NonNullPassRefPtr<Structure> structure)90 : JSObject (structure)89 MathObject::MathObject(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) 90 : JSObjectWithGlobalObject(globalObject, structure) 91 91 { 92 92 putDirectWithoutTransition(Identifier(exec, "E"), jsNumber(exec, exp(1.0)), DontDelete | DontEnum | ReadOnly); -
trunk/JavaScriptCore/runtime/MathObject.h
r54022 r59941 22 22 #define MathObject_h 23 23 24 #include "JSObject .h"24 #include "JSObjectWithGlobalObject.h" 25 25 26 26 namespace JSC { 27 27 28 class MathObject : public JSObject {28 class MathObject : public JSObjectWithGlobalObject { 29 29 public: 30 MathObject(ExecState*, NonNullPassRefPtr<Structure>);30 MathObject(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>); 31 31 32 32 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r51801 r59941 33 33 const ClassInfo NativeErrorConstructor::info = { "Function", &InternalFunction::info, 0, 0 }; 34 34 35 NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, NativeErrorPrototype* nativeErrorPrototype)36 : InternalFunction(&exec->globalData(), structure, Identifier(exec, nativeErrorPrototype->getDirect(exec->propertyNames().name).getString(exec)))35 NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, NativeErrorPrototype* nativeErrorPrototype) 36 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, nativeErrorPrototype->getDirect(exec->propertyNames().name).getString(exec))) 37 37 , m_errorStructure(ErrorInstance::createStructure(nativeErrorPrototype)) 38 38 { -
trunk/JavaScriptCore/runtime/NativeErrorConstructor.h
r48836 r59941 32 32 class NativeErrorConstructor : public InternalFunction { 33 33 public: 34 NativeErrorConstructor(ExecState*, NonNullPassRefPtr<Structure>, NativeErrorPrototype*);34 NativeErrorConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, NativeErrorPrototype*); 35 35 36 36 static const ClassInfo info; -
trunk/JavaScriptCore/runtime/NativeErrorPrototype.cpp
r48836 r59941 23 23 24 24 #include "ErrorPrototype.h" 25 #include "JSGlobalObject.h" 25 26 #include "JSString.h" 26 27 #include "UString.h" … … 30 31 ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype); 31 32 32 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure, const UString& name, const UString& message)33 : JSObject (structure)33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, const UString& name, const UString& message) 34 : JSObjectWithGlobalObject(globalObject, structure) 34 35 { 35 36 putDirect(exec->propertyNames().name, jsString(exec, name), 0); -
trunk/JavaScriptCore/runtime/NativeErrorPrototype.h
r48836 r59941 22 22 #define NativeErrorPrototype_h 23 23 24 #include "JSObject .h"24 #include "JSObjectWithGlobalObject.h" 25 25 26 26 namespace JSC { 27 27 28 class NativeErrorPrototype : public JSObject {28 class NativeErrorPrototype : public JSObjectWithGlobalObject { 29 29 public: 30 NativeErrorPrototype(ExecState*, NonNullPassRefPtr<Structure>, const UString& name, const UString& message);30 NativeErrorPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, const UString& name, const UString& message); 31 31 }; 32 32 -
trunk/JavaScriptCore/runtime/NumberConstructor.cpp
r57978 r59941 55 55 */ 56 56 57 NumberConstructor::NumberConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, NumberPrototype* numberPrototype)58 : InternalFunction(&exec->globalData(), structure, Identifier(exec, numberPrototype->info.className))57 NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, NumberPrototype* numberPrototype) 58 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, numberPrototype->info.className)) 59 59 { 60 60 // Number.Prototype -
trunk/JavaScriptCore/runtime/NumberConstructor.h
r54022 r59941 30 30 class NumberConstructor : public InternalFunction { 31 31 public: 32 NumberConstructor(ExecState*, NonNullPassRefPtr<Structure>, NumberPrototype*);32 NumberConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, NumberPrototype*); 33 33 34 34 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/JavaScriptCore/runtime/NumberPrototype.cpp
r58974 r59941 48 48 // ECMA 15.7.4 49 49 50 NumberPrototype::NumberPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure)50 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure) 51 51 : NumberObject(structure) 52 52 { … … 55 55 // The constructor will be added later, after NumberConstructor has been constructed 56 56 57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum);58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum);59 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum);60 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum);61 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum);62 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum);57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum); 58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum); 59 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum); 60 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum); 61 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum); 62 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum); 63 63 } 64 64 -
trunk/JavaScriptCore/runtime/NumberPrototype.h
r48836 r59941 28 28 class NumberPrototype : public NumberObject { 29 29 public: 30 NumberPrototype(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure);30 NumberPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure); 31 31 }; 32 32 -
trunk/JavaScriptCore/runtime/ObjectConstructor.cpp
r53170 r59941 43 43 static JSValue JSC_HOST_CALL objectConstructorCreate(ExecState*, JSObject*, JSValue, const ArgList&); 44 44 45 ObjectConstructor::ObjectConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, ObjectPrototype* objectPrototype, Structure* prototypeFunctionStructure)46 : InternalFunction(&exec->globalData(), structure, Identifier(exec, "Object"))45 ObjectConstructor::ObjectConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, ObjectPrototype* objectPrototype, Structure* prototypeFunctionStructure) 46 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, "Object")) 47 47 { 48 48 // ECMA 15.2.3.1 … … 52 52 putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete); 53 53 54 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().getPrototypeOf, objectConstructorGetPrototypeOf), DontEnum);55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().getOwnPropertyDescriptor, objectConstructorGetOwnPropertyDescriptor), DontEnum);56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().getOwnPropertyNames, objectConstructorGetOwnPropertyNames), DontEnum);57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().keys, objectConstructorKeys), DontEnum);58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 3, exec->propertyNames().defineProperty, objectConstructorDefineProperty), DontEnum);59 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().defineProperties, objectConstructorDefineProperties), DontEnum);60 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().create, objectConstructorCreate), DontEnum);54 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().getPrototypeOf, objectConstructorGetPrototypeOf), DontEnum); 55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().getOwnPropertyDescriptor, objectConstructorGetOwnPropertyDescriptor), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().getOwnPropertyNames, objectConstructorGetOwnPropertyNames), DontEnum); 57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().keys, objectConstructorKeys), DontEnum); 58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 3, exec->propertyNames().defineProperty, objectConstructorDefineProperty), DontEnum); 59 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().defineProperties, objectConstructorDefineProperties), DontEnum); 60 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().create, objectConstructorCreate), DontEnum); 61 61 } 62 62 -
trunk/JavaScriptCore/runtime/ObjectConstructor.h
r48836 r59941 30 30 class ObjectConstructor : public InternalFunction { 31 31 public: 32 ObjectConstructor(ExecState*, NonNullPassRefPtr<Structure>, ObjectPrototype*, Structure* prototypeFunctionStructure);32 ObjectConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, ObjectPrototype*, Structure* prototypeFunctionStructure); 33 33 34 34 private: -
trunk/JavaScriptCore/runtime/ObjectPrototype.cpp
r54394 r59941 42 42 static JSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*, JSObject*, JSValue, const ArgList&); 43 43 44 ObjectPrototype::ObjectPrototype(ExecState* exec, NonNullPassRefPtr<Structure> stucture, Structure* prototypeFunctionStructure)44 ObjectPrototype::ObjectPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> stucture, Structure* prototypeFunctionStructure) 45 45 : JSObject(stucture) 46 46 , m_hasNoPropertiesWithUInt32Names(true) 47 47 { 48 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, objectProtoFuncToString), DontEnum);49 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum);50 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum);51 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum);52 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum);53 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum);48 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, objectProtoFuncToString), DontEnum); 49 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum); 50 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum); 51 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum); 52 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum); 53 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum); 54 54 55 55 // Mozilla extensions 56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().__defineGetter__, objectProtoFuncDefineGetter), DontEnum);57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().__defineSetter__, objectProtoFuncDefineSetter), DontEnum);58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().__lookupGetter__, objectProtoFuncLookupGetter), DontEnum);59 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().__lookupSetter__, objectProtoFuncLookupSetter), DontEnum);56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().__defineGetter__, objectProtoFuncDefineGetter), DontEnum); 57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().__defineSetter__, objectProtoFuncDefineSetter), DontEnum); 58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().__lookupGetter__, objectProtoFuncLookupGetter), DontEnum); 59 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().__lookupSetter__, objectProtoFuncLookupSetter), DontEnum); 60 60 } 61 61 -
trunk/JavaScriptCore/runtime/ObjectPrototype.h
r48836 r59941 28 28 class ObjectPrototype : public JSObject { 29 29 public: 30 ObjectPrototype(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure);30 ObjectPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure); 31 31 32 32 private: -
trunk/JavaScriptCore/runtime/PrototypeFunction.cpp
r48836 r59941 33 33 ASSERT_CLASS_FITS_IN_CELL(PrototypeFunction); 34 34 35 PrototypeFunction::PrototypeFunction(ExecState* exec, int length, const Identifier& name, NativeFunction function)36 : InternalFunction(&exec->globalData(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), name)35 PrototypeFunction::PrototypeFunction(ExecState* exec, JSGlobalObject* globalObject, int length, const Identifier& name, NativeFunction function) 36 : InternalFunction(&exec->globalData(), globalObject, exec->lexicalGlobalObject()->prototypeFunctionStructure(), name) 37 37 , m_function(function) 38 38 { … … 41 41 } 42 42 43 PrototypeFunction::PrototypeFunction(ExecState* exec, NonNullPassRefPtr<Structure> prototypeFunctionStructure, int length, const Identifier& name, NativeFunction function)44 : InternalFunction(&exec->globalData(), prototypeFunctionStructure, name)43 PrototypeFunction::PrototypeFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> prototypeFunctionStructure, int length, const Identifier& name, NativeFunction function) 44 : InternalFunction(&exec->globalData(), globalObject, prototypeFunctionStructure, name) 45 45 , m_function(function) 46 46 { -
trunk/JavaScriptCore/runtime/PrototypeFunction.h
r48836 r59941 32 32 class PrototypeFunction : public InternalFunction { 33 33 public: 34 PrototypeFunction(ExecState*, int length, const Identifier&, NativeFunction);35 PrototypeFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction);34 PrototypeFunction(ExecState*, JSGlobalObject*, int length, const Identifier&, NativeFunction); 35 PrototypeFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction); 36 36 37 37 private: -
trunk/JavaScriptCore/runtime/RegExpConstructor.cpp
r57978 r59941 92 92 */ 93 93 94 RegExpConstructor::RegExpConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, RegExpPrototype* regExpPrototype)95 : InternalFunction(&exec->globalData(), structure, Identifier(exec, "RegExp"))94 RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, RegExpPrototype* regExpPrototype) 95 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, "RegExp")) 96 96 , d(new RegExpConstructorPrivate) 97 97 { … … 305 305 if (!regExp->isValid()) 306 306 return throwError(exec, SyntaxError, makeString("Invalid regular expression: ", regExp->errorMessage())); 307 return new (exec) RegExpObject(exec->lexicalGlobalObject() ->regExpStructure(), regExp.release());307 return new (exec) RegExpObject(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp.release()); 308 308 } 309 309 -
trunk/JavaScriptCore/runtime/RegExpConstructor.h
r59355 r59941 56 56 class RegExpConstructor : public InternalFunction { 57 57 public: 58 RegExpConstructor(ExecState*, NonNullPassRefPtr<Structure>, RegExpPrototype*);58 RegExpConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, RegExpPrototype*); 59 59 60 60 static PassRefPtr<Structure> createStructure(JSValue prototype) -
trunk/JavaScriptCore/runtime/RegExpObject.cpp
r57978 r59941 59 59 */ 60 60 61 RegExpObject::RegExpObject( NonNullPassRefPtr<Structure> structure, NonNullPassRefPtr<RegExp> regExp)62 : JSObject (structure)61 RegExpObject::RegExpObject(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, NonNullPassRefPtr<RegExp> regExp) 62 : JSObjectWithGlobalObject(globalObject, structure) 63 63 , d(new RegExpObjectData(regExp, 0)) 64 64 { -
trunk/JavaScriptCore/runtime/RegExpObject.h
r54022 r59941 22 22 #define RegExpObject_h 23 23 24 #include "JSObject .h"24 #include "JSObjectWithGlobalObject.h" 25 25 #include "RegExp.h" 26 26 27 27 namespace JSC { 28 28 29 class RegExpObject : public JSObject {29 class RegExpObject : public JSObjectWithGlobalObject { 30 30 public: 31 RegExpObject( NonNullPassRefPtr<Structure>, NonNullPassRefPtr<RegExp>);31 RegExpObject(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure>, NonNullPassRefPtr<RegExp>); 32 32 virtual ~RegExpObject(); 33 33 … … 54 54 55 55 protected: 56 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject ::StructureFlags;57 56 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObjectWithGlobalObject::StructureFlags; 57 58 58 private: 59 59 bool match(ExecState*, const ArgList&); -
trunk/JavaScriptCore/runtime/RegExpPrototype.cpp
r54394 r59941 48 48 const ClassInfo RegExpPrototype::info = { "RegExpPrototype", 0, 0, 0 }; 49 49 50 RegExpPrototype::RegExpPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure)50 RegExpPrototype::RegExpPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure) 51 51 : JSObject(structure) 52 52 { 53 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().compile, regExpProtoFuncCompile), DontEnum);54 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().exec, regExpProtoFuncExec), DontEnum);55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().test, regExpProtoFuncTest), DontEnum);56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, regExpProtoFuncToString), DontEnum);53 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().compile, regExpProtoFuncCompile), DontEnum); 54 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().exec, regExpProtoFuncExec), DontEnum); 55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().test, regExpProtoFuncTest), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().toString, regExpProtoFuncToString), DontEnum); 57 57 } 58 58 -
trunk/JavaScriptCore/runtime/RegExpPrototype.h
r48836 r59941 28 28 class RegExpPrototype : public JSObject { 29 29 public: 30 RegExpPrototype(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure);30 RegExpPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure); 31 31 32 32 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/runtime/StringConstructor.cpp
r59746 r59941 50 50 ASSERT_CLASS_FITS_IN_CELL(StringConstructor); 51 51 52 StringConstructor::StringConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure, StringPrototype* stringPrototype)53 : InternalFunction(&exec->globalData(), structure, Identifier(exec, stringPrototype->classInfo()->className))52 StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure, StringPrototype* stringPrototype) 53 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, stringPrototype->classInfo()->className)) 54 54 { 55 55 // ECMA 15.5.3.1 String.prototype … … 58 58 // ECMA 15.5.3.2 fromCharCode() 59 59 #if ENABLE(JIT) 60 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, exec->globalData().getHostFunction(stringFromCharCode, fromCharCodeThunkGenerator)), DontEnum);60 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, exec->globalData().getHostFunction(stringFromCharCode, fromCharCodeThunkGenerator)), DontEnum); 61 61 #else 62 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum);62 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum); 63 63 #endif 64 64 // no. of arguments for constructor -
trunk/JavaScriptCore/runtime/StringConstructor.h
r48836 r59941 30 30 class StringConstructor : public InternalFunction { 31 31 public: 32 StringConstructor(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure, StringPrototype*);32 StringConstructor(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure, StringPrototype*); 33 33 34 34 virtual ConstructType getConstructData(ConstructData&); -
trunk/JavaScriptCore/runtime/StringPrototype.cpp
r59355 r59941 133 133 134 134 // ECMA 15.5.4 135 StringPrototype::StringPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure)135 StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) 136 136 : StringObject(exec, structure) 137 137 { 138 putAnonymousValue(0, globalObject); 138 139 // The constructor will be added later, after StringConstructor has been built 139 140 putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum); -
trunk/JavaScriptCore/runtime/StringPrototype.h
r48836 r59941 30 30 class StringPrototype : public StringObject { 31 31 public: 32 StringPrototype(ExecState*, NonNullPassRefPtr<Structure>);32 StringPrototype(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>); 33 33 34 34 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); -
trunk/LayoutTests/ChangeLog
r59940 r59941 1 2010-05-21 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 All callable objects should have a global object reference 6 https://bugs.webkit.org/show_bug.cgi?id=39495 7 8 Update expected results as we now give all function objects 9 get their prototypes from the correct global object. 10 11 * fast/dom/prototype-inheritance-expected.txt: 12 1 13 2010-05-21 Victor Wang <victorw@chromium.org> 2 14 -
trunk/LayoutTests/fast/dom/prototype-inheritance-expected.txt
r59010 r59941 606 606 PASS inner.XSLTProcessor.isInner is true 607 607 PASS inner.XSLTProcessor.constructor.isInner is true 608 FAIL inner.addEventListener.isInner should be true. Was false. 609 FAIL inner.addEventListener.constructor.isInner should be true. Was false. 610 FAIL inner.alert.isInner should be true. Was false. 611 FAIL inner.alert.constructor.isInner should be true. Was false. 608 PASS inner.addEventListener.isInner is true 609 PASS inner.addEventListener.constructor.isInner is true 610 PASS inner.alert.isInner is true 611 PASS inner.alert.constructor.isInner is true 612 612 PASS inner.applicationCache.isInner is true 613 613 PASS inner.applicationCache.constructor.isInner is true 614 FAIL inner.atob.isInner should be true. Was false. 615 FAIL inner.atob.constructor.isInner should be true. Was false. 616 FAIL inner.blur.isInner should be true. Was false. 617 FAIL inner.blur.constructor.isInner should be true. Was false. 618 FAIL inner.btoa.isInner should be true. Was false. 619 FAIL inner.btoa.constructor.isInner should be true. Was false. 620 FAIL inner.captureEvents.isInner should be true. Was false. 621 FAIL inner.captureEvents.constructor.isInner should be true. Was false. 622 FAIL inner.clearInterval.isInner should be true. Was false. 623 FAIL inner.clearInterval.constructor.isInner should be true. Was false. 624 FAIL inner.clearTimeout.isInner should be true. Was false. 625 FAIL inner.clearTimeout.constructor.isInner should be true. Was false. 614 PASS inner.atob.isInner is true 615 PASS inner.atob.constructor.isInner is true 616 PASS inner.blur.isInner is true 617 PASS inner.blur.constructor.isInner is true 618 PASS inner.btoa.isInner is true 619 PASS inner.btoa.constructor.isInner is true 620 PASS inner.captureEvents.isInner is true 621 PASS inner.captureEvents.constructor.isInner is true 622 PASS inner.clearInterval.isInner is true 623 PASS inner.clearInterval.constructor.isInner is true 624 PASS inner.clearTimeout.isInner is true 625 PASS inner.clearTimeout.constructor.isInner is true 626 626 PASS inner.clientInformation.isInner is true 627 627 PASS inner.clientInformation.constructor.isInner is true 628 FAIL inner.close.isInner should be true. Was false. 629 FAIL inner.close.constructor.isInner should be true. Was false. 628 PASS inner.close.isInner is true 629 PASS inner.close.constructor.isInner is true 630 630 FAIL inner.closed.isInner should be true. Was false. 631 631 FAIL inner.closed.constructor.isInner should be true. Was false. 632 FAIL inner.confirm.isInner should be true. Was false. 633 FAIL inner.confirm.constructor.isInner should be true. Was false. 632 PASS inner.confirm.isInner is true 633 PASS inner.confirm.constructor.isInner is true 634 634 PASS inner.console.isInner is true 635 635 PASS inner.console.constructor.isInner is true … … 640 640 FAIL inner.devicePixelRatio.isInner should be true. Was false. 641 641 FAIL inner.devicePixelRatio.constructor.isInner should be true. Was false. 642 FAIL inner.dispatchEvent.isInner should be true. Was false. 643 FAIL inner.dispatchEvent.constructor.isInner should be true. Was false. 642 PASS inner.dispatchEvent.isInner is true 643 PASS inner.dispatchEvent.constructor.isInner is true 644 644 PASS inner.document.isInner is true 645 645 PASS inner.document.constructor.isInner is true 646 FAIL inner.find.isInner should be true. Was false. 647 FAIL inner.find.constructor.isInner should be true. Was false. 648 FAIL inner.focus.isInner should be true. Was false. 649 FAIL inner.focus.constructor.isInner should be true. Was false. 646 PASS inner.find.isInner is true 647 PASS inner.find.constructor.isInner is true 648 PASS inner.focus.isInner is true 649 PASS inner.focus.constructor.isInner is true 650 650 FAIL inner.frameElement.isInner should be true. Was false. 651 651 FAIL inner.frameElement.constructor.isInner should be true. Was false. 652 652 PASS inner.frames.isInner is true 653 653 PASS inner.frames.constructor.isInner is true 654 FAIL inner.getComputedStyle.isInner should be true. Was false. 655 FAIL inner.getComputedStyle.constructor.isInner should be true. Was false. 656 FAIL inner.getMatchedCSSRules.isInner should be true. Was false. 657 FAIL inner.getMatchedCSSRules.constructor.isInner should be true. Was false. 658 FAIL inner.getSelection.isInner should be true. Was false. 659 FAIL inner.getSelection.constructor.isInner should be true. Was false. 654 PASS inner.getComputedStyle.isInner is true 655 PASS inner.getComputedStyle.constructor.isInner is true 656 PASS inner.getMatchedCSSRules.isInner is true 657 PASS inner.getMatchedCSSRules.constructor.isInner is true 658 PASS inner.getSelection.isInner is true 659 PASS inner.getSelection.constructor.isInner is true 660 660 PASS inner.history.isInner is true 661 661 PASS inner.history.constructor.isInner is true … … 676 676 PASS inner.menubar.isInner is true 677 677 PASS inner.menubar.constructor.isInner is true 678 FAIL inner.moveBy.isInner should be true. Was false. 679 FAIL inner.moveBy.constructor.isInner should be true. Was false. 680 FAIL inner.moveTo.isInner should be true. Was false. 681 FAIL inner.moveTo.constructor.isInner should be true. Was false. 678 PASS inner.moveBy.isInner is true 679 PASS inner.moveBy.constructor.isInner is true 680 PASS inner.moveTo.isInner is true 681 PASS inner.moveTo.constructor.isInner is true 682 682 FAIL inner.name.isInner should be true. Was false. 683 683 FAIL inner.name.constructor.isInner should be true. Was false. … … 686 686 FAIL inner.offscreenBuffering.isInner should be true. Was false. 687 687 FAIL inner.offscreenBuffering.constructor.isInner should be true. Was false. 688 FAIL inner.open.isInner should be true. Was false. 689 FAIL inner.open.constructor.isInner should be true. Was false. 690 FAIL inner.openDatabase.isInner should be true. Was false. 691 FAIL inner.openDatabase.constructor.isInner should be true. Was false. 688 PASS inner.open.isInner is true 689 PASS inner.open.constructor.isInner is true 690 PASS inner.openDatabase.isInner is true 691 PASS inner.openDatabase.constructor.isInner is true 692 692 FAIL inner.outerHeight.isInner should be true. Was false. 693 693 FAIL inner.outerHeight.constructor.isInner should be true. Was false. … … 700 700 PASS inner.personalbar.isInner is true 701 701 PASS inner.personalbar.constructor.isInner is true 702 FAIL inner.postMessage.isInner should be true. Was false. 703 FAIL inner.postMessage.constructor.isInner should be true. Was false. 704 FAIL inner.print.isInner should be true. Was false. 705 FAIL inner.print.constructor.isInner should be true. Was false. 706 FAIL inner.prompt.isInner should be true. Was false. 707 FAIL inner.prompt.constructor.isInner should be true. Was false. 708 FAIL inner.releaseEvents.isInner should be true. Was false. 709 FAIL inner.releaseEvents.constructor.isInner should be true. Was false. 710 FAIL inner.removeEventListener.isInner should be true. Was false. 711 FAIL inner.removeEventListener.constructor.isInner should be true. Was false. 712 FAIL inner.resizeBy.isInner should be true. Was false. 713 FAIL inner.resizeBy.constructor.isInner should be true. Was false. 714 FAIL inner.resizeTo.isInner should be true. Was false. 715 FAIL inner.resizeTo.constructor.isInner should be true. Was false. 702 PASS inner.postMessage.isInner is true 703 PASS inner.postMessage.constructor.isInner is true 704 PASS inner.print.isInner is true 705 PASS inner.print.constructor.isInner is true 706 PASS inner.prompt.isInner is true 707 PASS inner.prompt.constructor.isInner is true 708 PASS inner.releaseEvents.isInner is true 709 PASS inner.releaseEvents.constructor.isInner is true 710 PASS inner.removeEventListener.isInner is true 711 PASS inner.removeEventListener.constructor.isInner is true 712 PASS inner.resizeBy.isInner is true 713 PASS inner.resizeBy.constructor.isInner is true 714 PASS inner.resizeTo.isInner is true 715 PASS inner.resizeTo.constructor.isInner is true 716 716 PASS inner.screen.isInner is true 717 717 PASS inner.screen.constructor.isInner is true … … 724 724 FAIL inner.screenY.isInner should be true. Was false. 725 725 FAIL inner.screenY.constructor.isInner should be true. Was false. 726 FAIL inner.scroll.isInner should be true. Was false. 727 FAIL inner.scroll.constructor.isInner should be true. Was false. 728 FAIL inner.scrollBy.isInner should be true. Was false. 729 FAIL inner.scrollBy.constructor.isInner should be true. Was false. 730 FAIL inner.scrollTo.isInner should be true. Was false. 731 FAIL inner.scrollTo.constructor.isInner should be true. Was false. 726 PASS inner.scroll.isInner is true 727 PASS inner.scroll.constructor.isInner is true 728 PASS inner.scrollBy.isInner is true 729 PASS inner.scrollBy.constructor.isInner is true 730 PASS inner.scrollTo.isInner is true 731 PASS inner.scrollTo.constructor.isInner is true 732 732 FAIL inner.scrollX.isInner should be true. Was false. 733 733 FAIL inner.scrollX.constructor.isInner should be true. Was false. … … 740 740 PASS inner.sessionStorage.isInner is true 741 741 PASS inner.sessionStorage.constructor.isInner is true 742 FAIL inner.setInterval.isInner should be true. Was false. 743 FAIL inner.setInterval.constructor.isInner should be true. Was false. 744 FAIL inner.setTimeout.isInner should be true. Was false. 745 FAIL inner.setTimeout.constructor.isInner should be true. Was false. 742 PASS inner.setInterval.isInner is true 743 PASS inner.setInterval.constructor.isInner is true 744 PASS inner.setTimeout.isInner is true 745 PASS inner.setTimeout.constructor.isInner is true 746 746 FAIL inner.status.isInner should be true. Was false. 747 747 FAIL inner.status.constructor.isInner should be true. Was false. 748 748 PASS inner.statusbar.isInner is true 749 749 PASS inner.statusbar.constructor.isInner is true 750 FAIL inner.stop.isInner should be true. Was false. 751 FAIL inner.stop.constructor.isInner should be true. Was false. 750 PASS inner.stop.isInner is true 751 PASS inner.stop.constructor.isInner is true 752 752 PASS inner.styleMedia.isInner is true 753 753 PASS inner.styleMedia.constructor.isInner is true 754 754 PASS inner.toolbar.isInner is true 755 755 PASS inner.toolbar.constructor.isInner is true 756 FAIL inner.webkitConvertPointFromNodeToPage.isInner should be true. Was false. 757 FAIL inner.webkitConvertPointFromNodeToPage.constructor.isInner should be true. Was false. 758 FAIL inner.webkitConvertPointFromPageToNode.isInner should be true. Was false. 759 FAIL inner.webkitConvertPointFromPageToNode.constructor.isInner should be true. Was false. 756 PASS inner.webkitConvertPointFromNodeToPage.isInner is true 757 PASS inner.webkitConvertPointFromNodeToPage.constructor.isInner is true 758 PASS inner.webkitConvertPointFromPageToNode.isInner is true 759 PASS inner.webkitConvertPointFromPageToNode.constructor.isInner is true 760 760 PASS inner.window.isInner is true 761 761 PASS inner.window.constructor.isInner is true -
trunk/WebCore/ChangeLog
r59935 r59941 1 2010-05-21 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 All callable objects should have a global object reference 6 https://bugs.webkit.org/show_bug.cgi?id=39495 7 8 Update the bindings generator to give prototype objects a 9 global object. Update all the manually written JSObject 10 subclasses to pass a global object. 11 12 * ForwardingHeaders/runtime/JSObjectWithGlobalObject.h: Added. 13 * WebCore.PluginHostProcess.exp: 14 * bindings/js/JSDOMBinding.cpp: 15 (WebCore::objectToStringFunctionGetter): 16 * bindings/js/JSDOMWindowCustom.cpp: 17 (WebCore::nonCachingStaticFunctionGetter): 18 * bindings/js/JSDOMWindowShell.cpp: 19 (WebCore::JSDOMWindowShell::setWindow): 20 * bindings/js/JSHistoryCustom.cpp: 21 (WebCore::nonCachingStaticBackFunctionGetter): 22 (WebCore::nonCachingStaticForwardFunctionGetter): 23 (WebCore::nonCachingStaticGoFunctionGetter): 24 * bindings/js/JSLocationCustom.cpp: 25 (WebCore::nonCachingStaticReplaceFunctionGetter): 26 (WebCore::nonCachingStaticReloadFunctionGetter): 27 (WebCore::nonCachingStaticAssignFunctionGetter): 28 * bindings/js/WorkerScriptController.cpp: 29 (WebCore::WorkerScriptController::initScript): 30 * bindings/scripts/CodeGeneratorJS.pm: 31 * bridge/c/CRuntimeObject.cpp: 32 (JSC::Bindings::CRuntimeObject::CRuntimeObject): 33 * bridge/c/CRuntimeObject.h: 34 * bridge/c/c_instance.cpp: 35 (JSC::Bindings::CInstance::newRuntimeObject): 36 (JSC::Bindings::CRuntimeMethod::CRuntimeMethod): 37 (JSC::Bindings::CInstance::getMethod): 38 * bridge/jni/jsc/JavaInstanceJSC.cpp: 39 (JavaInstance::newRuntimeObject): 40 (JavaRuntimeMethod::JavaRuntimeMethod): 41 (JavaInstance::getMethod): 42 * bridge/jni/jsc/JavaRuntimeObject.cpp: 43 (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject): 44 * bridge/jni/jsc/JavaRuntimeObject.h: 45 * bridge/jsc/BridgeJSC.cpp: 46 (JSC::Bindings::Instance::newRuntimeObject): 47 * bridge/objc/ObjCRuntimeObject.h: 48 * bridge/objc/ObjCRuntimeObject.mm: 49 (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject): 50 * bridge/objc/objc_class.mm: 51 (JSC::Bindings::ObjcClass::fallbackObject): 52 * bridge/objc/objc_instance.mm: 53 (ObjcInstance::newRuntimeObject): 54 (ObjCRuntimeMethod::ObjCRuntimeMethod): 55 (ObjcInstance::getMethod): 56 * bridge/objc/objc_runtime.h: 57 * bridge/objc/objc_runtime.mm: 58 (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp): 59 * bridge/runtime_method.cpp: 60 (JSC::RuntimeMethod::RuntimeMethod): 61 * bridge/runtime_method.h: 62 * bridge/runtime_object.cpp: 63 (JSC::Bindings::RuntimeObject::RuntimeObject): 64 * bridge/runtime_object.h: 65 1 66 2010-05-21 Steve Block <steveblock@google.com> 2 67 -
trunk/WebCore/WebCore.PluginHostProcess.exp
r57911 r59941 5 5 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 6 6 __ZN3JSC13RuntimeMethod6s_infoE 7 __ZN3JSC13RuntimeMethodC1EPNS_9ExecStateERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE 8 __ZN3JSC13RuntimeMethodC2EPNS_9ExecStateERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE 7 __ZN3JSC13RuntimeMethodC2EPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE 9 8 __ZN3JSC8Bindings10RootObjectD1Ev 10 9 __ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE … … 16 15 __ZN3JSC8Bindings13RuntimeObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 17 16 __ZN3JSC8Bindings13RuntimeObject6s_infoE 18 __ZN3JSC8Bindings13RuntimeObjectC2EPNS_9ExecStateE N3WTF10PassRefPtrINS0_8InstanceEEE17 __ZN3JSC8Bindings13RuntimeObjectC2EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF10PassRefPtrINS0_8InstanceEEE 19 18 __ZN3JSC8Bindings13RuntimeObjectD2Ev 20 19 __ZN3JSC8Bindings8Instance19createRuntimeObjectEPNS_9ExecStateE -
trunk/WebCore/bindings/js/JSDOMBinding.cpp
r58027 r59941 687 687 JSValue objectToStringFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 688 688 { 689 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 0, propertyName, objectProtoFuncToString);689 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, objectProtoFuncToString); 690 690 } 691 691 -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r59499 r59941 131 131 JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 132 132 { 133 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), length, propertyName, nativeFunction);133 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), length, propertyName, nativeFunction); 134 134 } 135 135 -
trunk/WebCore/bindings/js/JSDOMWindowShell.cpp
r53170 r59941 62 62 // constructed, it can mark its own prototype.) 63 63 RefPtr<Structure> prototypeStructure = JSDOMWindowPrototype::createStructure(jsNull()); 64 ProtectedPtr<JSDOMWindowPrototype> prototype = new JSDOMWindowPrototype( prototypeStructure.release());64 ProtectedPtr<JSDOMWindowPrototype> prototype = new JSDOMWindowPrototype(0, prototypeStructure.release()); 65 65 66 66 RefPtr<Structure> structure = JSDOMWindow::createStructure(prototype); 67 67 JSDOMWindow* jsDOMWindow = new (JSDOMWindow::commonJSGlobalData()) JSDOMWindow(structure.release(), domWindow, this); 68 prototype->putAnonymousValue(0, jsDOMWindow); 68 69 setWindow(jsDOMWindow); 69 70 } -
trunk/WebCore/bindings/js/JSHistoryCustom.cpp
r55401 r59941 41 41 static JSValue nonCachingStaticBackFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 42 42 { 43 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 0, propertyName, jsHistoryPrototypeFunctionBack);43 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, jsHistoryPrototypeFunctionBack); 44 44 } 45 45 46 46 static JSValue nonCachingStaticForwardFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 47 47 { 48 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 0, propertyName, jsHistoryPrototypeFunctionForward);48 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, jsHistoryPrototypeFunctionForward); 49 49 } 50 50 51 51 static JSValue nonCachingStaticGoFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 52 52 { 53 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 1, propertyName, jsHistoryPrototypeFunctionGo);53 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 1, propertyName, jsHistoryPrototypeFunctionGo); 54 54 } 55 55 -
trunk/WebCore/bindings/js/JSLocationCustom.cpp
r57738 r59941 42 42 static JSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 43 43 { 44 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 1, propertyName, jsLocationPrototypeFunctionReplace);44 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 1, propertyName, jsLocationPrototypeFunctionReplace); 45 45 } 46 46 47 47 static JSValue nonCachingStaticReloadFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 48 48 { 49 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 0, propertyName, jsLocationPrototypeFunctionReload);49 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, jsLocationPrototypeFunctionReload); 50 50 } 51 51 52 52 static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName) 53 53 { 54 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject() ->prototypeFunctionStructure(), 1, propertyName, jsLocationPrototypeFunctionAssign);54 return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->prototypeFunctionStructure(), 1, propertyName, jsLocationPrototypeFunctionAssign); 55 55 } 56 56 -
trunk/WebCore/bindings/js/WorkerScriptController.cpp
r58012 r59941 72 72 // constructed, it can mark its own prototype.) 73 73 RefPtr<Structure> workerContextPrototypeStructure = JSWorkerContextPrototype::createStructure(jsNull()); 74 ProtectedPtr<JSWorkerContextPrototype> workerContextPrototype = new (m_globalData.get()) JSWorkerContextPrototype( workerContextPrototypeStructure.release());74 ProtectedPtr<JSWorkerContextPrototype> workerContextPrototype = new (m_globalData.get()) JSWorkerContextPrototype(0, workerContextPrototypeStructure.release()); 75 75 76 76 if (m_workerContext->isDedicatedWorkerContext()) { 77 77 RefPtr<Structure> dedicatedContextPrototypeStructure = JSDedicatedWorkerContextPrototype::createStructure(workerContextPrototype); 78 ProtectedPtr<JSDedicatedWorkerContextPrototype> dedicatedContextPrototype = new (m_globalData.get()) JSDedicatedWorkerContextPrototype( dedicatedContextPrototypeStructure.release());78 ProtectedPtr<JSDedicatedWorkerContextPrototype> dedicatedContextPrototype = new (m_globalData.get()) JSDedicatedWorkerContextPrototype(0, dedicatedContextPrototypeStructure.release()); 79 79 RefPtr<Structure> structure = JSDedicatedWorkerContext::createStructure(dedicatedContextPrototype); 80 80 81 81 m_workerContextWrapper = new (m_globalData.get()) JSDedicatedWorkerContext(structure.release(), m_workerContext->toDedicatedWorkerContext()); 82 workerContextPrototype->putAnonymousValue(0, m_workerContextWrapper); 83 dedicatedContextPrototype->putAnonymousValue(0, m_workerContextWrapper); 82 84 #if ENABLE(SHARED_WORKERS) 83 85 } else { 84 86 ASSERT(m_workerContext->isSharedWorkerContext()); 85 87 RefPtr<Structure> sharedContextPrototypeStructure = JSSharedWorkerContextPrototype::createStructure(workerContextPrototype); 86 ProtectedPtr<JSSharedWorkerContextPrototype> sharedContextPrototype = new (m_globalData.get()) JSSharedWorkerContextPrototype( sharedContextPrototypeStructure.release());88 ProtectedPtr<JSSharedWorkerContextPrototype> sharedContextPrototype = new (m_globalData.get()) JSSharedWorkerContextPrototype(0, sharedContextPrototypeStructure.release()); 87 89 RefPtr<Structure> structure = JSSharedWorkerContext::createStructure(sharedContextPrototype); 88 90 89 91 m_workerContextWrapper = new (m_globalData.get()) JSSharedWorkerContext(structure.release(), m_workerContext->toSharedWorkerContext()); 92 workerContextPrototype->putAnonymousValue(0, m_workerContextWrapper); 93 sharedContextPrototype->putAnonymousValue(0, m_workerContextWrapper); 90 94 #endif 91 95 } -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r59794 r59941 644 644 $headerIncludes{"$implClassName.h"} = 1; 645 645 } 646 647 $headerIncludes{"<runtime/JSObjectWithGlobalObject.h>"} = 1; 646 648 647 649 $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; … … 936 938 # Add prototype declaration. 937 939 %structureFlags = (); 938 push(@headerContent, "class ${className}Prototype : public JSC::JSObject {\n");939 push(@headerContent, " typedef JSC::JSObject Base;\n");940 push(@headerContent, "class ${className}Prototype : public JSC::JSObjectWithGlobalObject {\n"); 941 push(@headerContent, " typedef JSC::JSObjectWithGlobalObject Base;\n"); 940 942 push(@headerContent, "public:\n"); 941 943 if ($interfaceName eq "DOMWindow") { … … 971 973 push(@headerContent, " virtual void defineGetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes);\n") if $dataNode->extendedAttributes->{"CustomPrototypeDefineGetter"}; 972 974 973 push(@headerContent, " ${className}Prototype( NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }\n");975 push(@headerContent, " ${className}Prototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }\n"); 974 976 975 977 # structure flags … … 1441 1443 push(@implContent, "{\n"); 1442 1444 if ($hasParent && $parentClassName ne "JSC::DOMNodeFilter") { 1443 push(@implContent, " return new (exec) ${className}Prototype( ${className}Prototype::createStructure(${parentClassName}Prototype::self(exec, globalObject)));\n");1445 push(@implContent, " return new (exec) ${className}Prototype(globalObject, ${className}Prototype::createStructure(${parentClassName}Prototype::self(exec, globalObject)));\n"); 1444 1446 } else { 1445 push(@implContent, " return new (exec) ${className}Prototype( ${className}Prototype::createStructure(globalObject->objectPrototype()));\n");1447 push(@implContent, " return new (exec) ${className}Prototype(globalObject, ${className}Prototype::createStructure(globalObject->objectPrototype()));\n"); 1446 1448 } 1447 1449 push(@implContent, "}\n\n"); -
trunk/WebCore/bridge/c/CRuntimeObject.cpp
r55250 r59941 36 36 const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_info, 0, 0 }; 37 37 38 CRuntimeObject::CRuntimeObject(ExecState* exec, PassRefPtr<CInstance> instance)39 : RuntimeObject(exec, instance)38 CRuntimeObject::CRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<CInstance> instance) 39 : RuntimeObject(exec, globalObject, instance) 40 40 { 41 41 } -
trunk/WebCore/bridge/c/CRuntimeObject.h
r55250 r59941 38 38 class CRuntimeObject : public RuntimeObject { 39 39 public: 40 CRuntimeObject(ExecState*, PassRefPtr<CInstance>);40 CRuntimeObject(ExecState*, JSGlobalObject*, PassRefPtr<CInstance>); 41 41 virtual ~CRuntimeObject(); 42 42 -
trunk/WebCore/bridge/c/c_instance.cpp
r57227 r59941 94 94 RuntimeObject* CInstance::newRuntimeObject(ExecState* exec) 95 95 { 96 return new (exec) CRuntimeObject(exec, this);96 return new (exec) CRuntimeObject(exec, exec->lexicalGlobalObject(), this); 97 97 } 98 98 … … 111 111 class CRuntimeMethod : public RuntimeMethod { 112 112 public: 113 CRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)114 : RuntimeMethod(exec, name, list)113 CRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list) 114 : RuntimeMethod(exec, globalObject, name, list) 115 115 { 116 116 } … … 126 126 { 127 127 MethodList methodList = getClass()->methodsNamed(propertyName, this); 128 return new (exec) CRuntimeMethod(exec, propertyName, methodList);128 return new (exec) CRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); 129 129 } 130 130 -
trunk/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
r59918 r59941 61 61 RuntimeObject* JavaInstance::newRuntimeObject(ExecState* exec) 62 62 { 63 return new (exec) JavaRuntimeObject(exec, this);63 return new (exec) JavaRuntimeObject(exec, exec->lexicalGlobalObject(), this); 64 64 } 65 65 … … 114 114 class JavaRuntimeMethod : public RuntimeMethod { 115 115 public: 116 JavaRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)117 : RuntimeMethod(exec, name, list)116 JavaRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list) 117 : RuntimeMethod(exec, globalObject, name, list) 118 118 { 119 119 } … … 129 129 { 130 130 MethodList methodList = getClass()->methodsNamed(propertyName, this); 131 return new (exec) JavaRuntimeMethod(exec, propertyName, methodList);131 return new (exec) JavaRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); 132 132 } 133 133 -
trunk/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp
r55250 r59941 34 34 const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObject::s_info, 0, 0 }; 35 35 36 JavaRuntimeObject::JavaRuntimeObject(ExecState* exec, PassRefPtr<JavaInstance> instance)37 : RuntimeObject(exec, instance)36 JavaRuntimeObject::JavaRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> instance) 37 : RuntimeObject(exec, globalObject, instance) 38 38 { 39 39 } -
trunk/WebCore/bridge/jni/jsc/JavaRuntimeObject.h
r55250 r59941 36 36 class JavaRuntimeObject : public RuntimeObject { 37 37 public: 38 JavaRuntimeObject(ExecState*, PassRefPtr<JavaInstance>);38 JavaRuntimeObject(ExecState*, JSGlobalObject*, PassRefPtr<JavaInstance>); 39 39 virtual ~JavaRuntimeObject(); 40 40 -
trunk/WebCore/bridge/jsc/BridgeJSC.cpp
r55109 r59941 99 99 { 100 100 JSLock lock(SilenceAssertionsOnly); 101 return new (exec)RuntimeObject(exec, this);101 return new (exec)RuntimeObject(exec, exec->lexicalGlobalObject(), this); 102 102 } 103 103 -
trunk/WebCore/bridge/objc/ObjCRuntimeObject.h
r55250 r59941 36 36 class ObjCRuntimeObject : public RuntimeObject { 37 37 public: 38 ObjCRuntimeObject(ExecState*, PassRefPtr<ObjcInstance>);38 ObjCRuntimeObject(ExecState*, JSGlobalObject*, PassRefPtr<ObjcInstance>); 39 39 virtual ~ObjCRuntimeObject(); 40 40 -
trunk/WebCore/bridge/objc/ObjCRuntimeObject.mm
r55250 r59941 34 34 const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObject::s_info, 0, 0 }; 35 35 36 ObjCRuntimeObject::ObjCRuntimeObject(ExecState* exec, PassRefPtr<ObjcInstance> instance)37 : RuntimeObject(exec, instance)36 ObjCRuntimeObject::ObjCRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ObjcInstance> instance) 37 : RuntimeObject(exec, globalObject, instance) 38 38 { 39 39 } -
trunk/WebCore/bridge/objc/objc_class.mm
r43122 r59941 247 247 if (![targetObject respondsToSelector:@selector(invokeUndefinedMethodFromWebScript:withArguments:)]) 248 248 return jsUndefined(); 249 return new (exec) ObjcFallbackObjectImp(exec, objcInstance, propertyName);250 } 251 252 } 253 } 249 return new (exec) ObjcFallbackObjectImp(exec, exec->lexicalGlobalObject(), objcInstance, propertyName); 250 } 251 252 } 253 } -
trunk/WebCore/bridge/objc/objc_instance.mm
r55760 r59941 66 66 RuntimeObject* ObjcInstance::newRuntimeObject(ExecState* exec) 67 67 { 68 return new (exec) ObjCRuntimeObject(exec, this);68 return new (exec) ObjCRuntimeObject(exec, exec->lexicalGlobalObject(), this); 69 69 } 70 70 … … 177 177 class ObjCRuntimeMethod : public RuntimeMethod { 178 178 public: 179 ObjCRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)180 : RuntimeMethod(exec, name, list)179 ObjCRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list) 180 : RuntimeMethod(exec, globalObject, name, list) 181 181 { 182 182 } … … 192 192 { 193 193 MethodList methodList = getClass()->methodsNamed(propertyName, this); 194 return new (exec) ObjCRuntimeMethod(exec, propertyName, methodList);194 return new (exec) ObjCRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); 195 195 } 196 196 -
trunk/WebCore/bridge/objc/objc_runtime.h
r54022 r59941 30 30 #include "objc_header.h" 31 31 #include <runtime/JSGlobalObject.h> 32 #include <runtime/JSObjectWithGlobalObject.h> 32 33 #include <wtf/RetainPtr.h> 33 34 … … 90 91 }; 91 92 92 class ObjcFallbackObjectImp : public JSObject {93 class ObjcFallbackObjectImp : public JSObjectWithGlobalObject { 93 94 public: 94 ObjcFallbackObjectImp(ExecState*, ObjcInstance*, const Identifier& propertyName);95 ObjcFallbackObjectImp(ExecState*, JSGlobalObject*, ObjcInstance*, const Identifier& propertyName); 95 96 96 97 static const ClassInfo s_info; -
trunk/WebCore/bridge/objc/objc_runtime.mm
r55312 r59941 190 190 const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", 0, 0, 0 }; 191 191 192 ObjcFallbackObjectImp::ObjcFallbackObjectImp(ExecState* exec, ObjcInstance* i, const Identifier& propertyName)192 ObjcFallbackObjectImp::ObjcFallbackObjectImp(ExecState* exec, JSGlobalObject* globalObject, ObjcInstance* i, const Identifier& propertyName) 193 193 // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object 194 : JSObject (deprecatedGetDOMStructure<ObjcFallbackObjectImp>(exec))194 : JSObjectWithGlobalObject(globalObject, deprecatedGetDOMStructure<ObjcFallbackObjectImp>(exec)) 195 195 , _instance(i) 196 196 , _item(propertyName) -
trunk/WebCore/bridge/runtime_method.cpp
r55564 r59941 44 44 const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::info, 0, 0 }; 45 45 46 RuntimeMethod::RuntimeMethod(ExecState* exec, const Identifier& ident, Bindings::MethodList& m)46 RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& ident, Bindings::MethodList& m) 47 47 // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object 48 48 // exec-globalData() is also likely wrong. 49 49 // Callers will need to pass in the right global object corresponding to this native object "m". 50 : InternalFunction(&exec->globalData(), deprecatedGetDOMStructure<RuntimeMethod>(exec), ident)50 : InternalFunction(&exec->globalData(), globalObject, deprecatedGetDOMStructure<RuntimeMethod>(exec), ident) 51 51 , _methodList(new MethodList(m)) 52 52 { -
trunk/WebCore/bridge/runtime_method.h
r55401 r59941 36 36 class RuntimeMethod : public InternalFunction { 37 37 public: 38 RuntimeMethod(ExecState*, const Identifier& name, Bindings::MethodList&);38 RuntimeMethod(ExecState*, JSGlobalObject*, const Identifier& name, Bindings::MethodList&); 39 39 Bindings::MethodList* methods() const { return _methodList.get(); } 40 40 -
trunk/WebCore/bridge/runtime_object.cpp
r55401 r59941 39 39 const ClassInfo RuntimeObject::s_info = { "RuntimeObject", 0, 0, 0 }; 40 40 41 RuntimeObject::RuntimeObject(ExecState* exec, PassRefPtr<Instance> instance)41 RuntimeObject::RuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance) 42 42 // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object 43 43 // We need to pass in the right global object for "i". 44 : JSObject (deprecatedGetDOMStructure<RuntimeObject>(exec))44 : JSObjectWithGlobalObject(globalObject, deprecatedGetDOMStructure<RuntimeObject>(exec)) 45 45 , m_instance(instance) 46 46 { 47 47 } 48 48 49 RuntimeObject::RuntimeObject(ExecState*, NonNullPassRefPtr<Structure> structure, PassRefPtr<Instance> instance)50 : JSObject (structure)49 RuntimeObject::RuntimeObject(ExecState*, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, PassRefPtr<Instance> instance) 50 : JSObjectWithGlobalObject(globalObject, structure) 51 51 , m_instance(instance) 52 52 { -
trunk/WebCore/bridge/runtime_object.h
r55401 r59941 29 29 #include "Bridge.h" 30 30 #include <runtime/JSGlobalObject.h> 31 #include <runtime/JSObjectWithGlobalObject.h> 31 32 32 33 namespace JSC { 33 34 namespace Bindings { 34 35 35 class RuntimeObject : public JSObject {36 class RuntimeObject : public JSObjectWithGlobalObject { 36 37 public: 37 RuntimeObject(ExecState*, PassRefPtr<Instance>);38 RuntimeObject(ExecState*, JSGlobalObject*, PassRefPtr<Instance>); 38 39 virtual ~RuntimeObject(); 39 40 … … 68 69 protected: 69 70 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags; 70 RuntimeObject(ExecState*, NonNullPassRefPtr<Structure>, PassRefPtr<Instance>);71 RuntimeObject(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, PassRefPtr<Instance>); 71 72 72 73 private: -
trunk/WebKit/mac/ChangeLog
r59935 r59941 1 2010-05-21 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 All callable objects should have a global object reference 6 https://bugs.webkit.org/show_bug.cgi?id=39495 7 8 Update the plugin proxy to handle the need for global object. 9 10 * Plugins/Hosted/ProxyInstance.mm: 11 (WebKit::ProxyInstance::newRuntimeObject): 12 (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod): 13 (WebKit::ProxyInstance::getMethod): 14 * Plugins/Hosted/ProxyRuntimeObject.h: 15 * Plugins/Hosted/ProxyRuntimeObject.mm: 16 (WebKit::ProxyRuntimeObject::ProxyRuntimeObject): 17 1 18 2010-05-21 Steve Block <steveblock@google.com> 2 19 -
trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
r57738 r59941 134 134 RuntimeObject* ProxyInstance::newRuntimeObject(ExecState* exec) 135 135 { 136 return new (exec) ProxyRuntimeObject(exec, this);136 return new (exec) ProxyRuntimeObject(exec, exec->lexicalGlobalObject(), this); 137 137 } 138 138 … … 179 179 class ProxyRuntimeMethod : public RuntimeMethod { 180 180 public: 181 ProxyRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)182 : RuntimeMethod(exec, name, list)181 ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list) 182 : RuntimeMethod(exec, globalObject, name, list) 183 183 { 184 184 } … … 194 194 { 195 195 MethodList methodList = getClass()->methodsNamed(propertyName, this); 196 return new (exec) ProxyRuntimeMethod(exec, propertyName, methodList);196 return new (exec) ProxyRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); 197 197 } 198 198 -
trunk/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
r55250 r59941 37 37 class ProxyRuntimeObject : public JSC::Bindings::RuntimeObject { 38 38 public: 39 ProxyRuntimeObject(JSC::ExecState*, PassRefPtr<ProxyInstance>);39 ProxyRuntimeObject(JSC::ExecState*, JSC::JSGlobalObject*, PassRefPtr<ProxyInstance>); 40 40 virtual ~ProxyRuntimeObject(); 41 41 -
trunk/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
r55250 r59941 36 36 const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0 }; 37 37 38 ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, PassRefPtr<ProxyInstance> instance)39 : RuntimeObject(exec, instance)38 ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ProxyInstance> instance) 39 : RuntimeObject(exec, globalObject, instance) 40 40 { 41 41 }
Note: See TracChangeset
for help on using the changeset viewer.