Ignore:
Timestamp:
Sep 6, 2011, 2:51:00 PM (14 years ago)
Author:
[email protected]
Message:

An object's structure should reference the global object responsible for its creation
https://bugs.webkit.org/show_bug.cgi?id=67624

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

Add a reference to a GlobalObject to Structure, and update all calls to
Structure::create() to pass the global object that is the origin for that
structure. For objects where the appropriate global object isn't available
at construction time (global object prototypes, etc), or objects that
logically don't have a global object (strings, etc) we just pass null.

This change is largely mechanical (passing a new globalObject parameter
around).

  • API/JSCallbackConstructor.h:

(JSC::JSCallbackConstructor::createStructure):

  • API/JSCallbackFunction.h:

(JSC::JSCallbackFunction::createStructure):

  • API/JSCallbackObject.h:

(JSC::JSCallbackObject::createStructure):

  • API/JSContextRef.cpp:
  • JavaScriptCore.exp:
  • debugger/DebuggerActivation.h:

(JSC::DebuggerActivation::createStructure):

  • runtime/Arguments.h:

(JSC::Arguments::createStructure):

  • runtime/ArrayConstructor.h:

(JSC::ArrayConstructor::createStructure):

  • runtime/ArrayPrototype.h:

(JSC::ArrayPrototype::createStructure):

  • runtime/BooleanObject.h:

(JSC::BooleanObject::createStructure):

  • runtime/BooleanPrototype.h:

(JSC::BooleanPrototype::createStructure):

  • runtime/DateConstructor.h:

(JSC::DateConstructor::createStructure):

  • runtime/DateInstance.h:

(JSC::DateInstance::createStructure):

  • runtime/DatePrototype.h:

(JSC::DatePrototype::createStructure):

  • runtime/ErrorInstance.h:

(JSC::ErrorInstance::createStructure):

  • runtime/ErrorPrototype.h:

(JSC::ErrorPrototype::createStructure):

  • runtime/Executable.h:

(JSC::ExecutableBase::createStructure):
(JSC::NativeExecutable::createStructure):
(JSC::EvalExecutable::createStructure):
(JSC::ProgramExecutable::createStructure):
(JSC::FunctionExecutable::createStructure):

  • runtime/FunctionPrototype.h:

(JSC::FunctionPrototype::createStructure):

  • runtime/GetterSetter.h:

(JSC::GetterSetter::createStructure):

  • runtime/InternalFunction.h:

(JSC::InternalFunction::createStructure):

  • runtime/JSAPIValueWrapper.h:

(JSC::JSAPIValueWrapper::createStructure):

  • runtime/JSActivation.h:

(JSC::JSActivation::createStructure):

  • runtime/JSArray.h:

(JSC::JSArray::createStructure):

  • runtime/JSByteArray.cpp:

(JSC::JSByteArray::createStructure):

  • runtime/JSByteArray.h:
  • runtime/JSFunction.h:

(JSC::JSFunction::createStructure):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::finishCreation):
(JSC::JSGlobalObject::createStructure):

  • runtime/JSNotAnObject.h:

(JSC::JSNotAnObject::createStructure):

  • runtime/JSONObject.h:

(JSC::JSONObject::createStructure):

  • runtime/JSObject.cpp:

(JSC::JSObject::createInheritorID):

  • runtime/JSObject.h:

(JSC::JSObject::createStructure):
(JSC::JSNonFinalObject::createStructure):
(JSC::JSFinalObject::createStructure):
(JSC::createEmptyObjectStructure):

  • runtime/JSObjectWithGlobalObject.h:

(JSC::JSObjectWithGlobalObject::createStructure):

  • runtime/JSPropertyNameIterator.h:

(JSC::JSPropertyNameIterator::createStructure):

  • runtime/JSStaticScopeObject.h:

(JSC::JSStaticScopeObject::createStructure):

  • runtime/JSString.h:

(JSC::RopeBuilder::createStructure):

  • runtime/JSVariableObject.h:

(JSC::JSVariableObject::createStructure):

  • runtime/JSWrapperObject.h:

(JSC::JSWrapperObject::createStructure):

  • runtime/MathObject.h:

(JSC::MathObject::createStructure):

  • runtime/NativeErrorConstructor.h:

(JSC::NativeErrorConstructor::createStructure):
(JSC::NativeErrorConstructor::constructorBody):

  • runtime/NumberConstructor.h:

(JSC::NumberConstructor::createStructure):

  • runtime/NumberObject.h:

(JSC::NumberObject::createStructure):

  • runtime/NumberPrototype.h:

(JSC::NumberPrototype::createStructure):

  • runtime/ObjectConstructor.h:

(JSC::ObjectConstructor::createStructure):

  • runtime/ObjectPrototype.h:

(JSC::ObjectPrototype::createStructure):

  • runtime/RegExp.h:

(JSC::RegExp::createStructure):

  • runtime/RegExpConstructor.h:

(JSC::RegExpConstructor::createStructure):

  • runtime/RegExpObject.h:

(JSC::RegExpObject::createStructure):

  • runtime/RegExpPrototype.h:

(JSC::RegExpPrototype::createStructure):

  • runtime/ScopeChain.h:

(JSC::ScopeChainNode::createStructure):

  • runtime/StrictEvalActivation.h:

(JSC::StrictEvalActivation::createStructure):

  • runtime/StringConstructor.h:

(JSC::StringConstructor::createStructure):

  • runtime/StringObject.h:

(JSC::StringObject::createStructure):

  • runtime/StringObjectThatMasqueradesAsUndefined.h:

(JSC::StringObjectThatMasqueradesAsUndefined::create):
(JSC::StringObjectThatMasqueradesAsUndefined::createStructure):

  • runtime/StringPrototype.h:

(JSC::StringPrototype::createStructure):

  • runtime/Structure.cpp:

(JSC::Structure::Structure):
(JSC::Structure::visitChildren):

  • runtime/Structure.h:

(JSC::Structure::create):
(JSC::Structure::globalObject):
(JSC::Structure::setGlobalObject):

  • runtime/StructureChain.h:

(JSC::StructureChain::createStructure):

Source/JavaScriptGlue:

Update for Structure::create() requiring a global object.

  • JSRun.h:

(JSGlueGlobalObject::create):

  • UserObjectImp.h:

(UserObjectImp::createStructure):

Source/WebCore:

Update calls to Structure::create() to pass the globalObject in,
and update the CodeGenerator to generate appropriate createStructure
methods.

  • bindings/js/JSAudioConstructor.h:

(WebCore::JSAudioConstructor::createStructure):

  • bindings/js/JSDOMBinding.h:

(WebCore::DOMConstructorObject::createStructure):
(WebCore::getDOMStructure):

  • bindings/js/JSDOMGlobalObject.h:

(WebCore::JSDOMGlobalObject::createStructure):
(WebCore::getDOMConstructor):

  • bindings/js/JSDOMWindowBase.h:

(WebCore::JSDOMWindowBase::createStructure):

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::setWindow):

  • bindings/js/JSDOMWindowShell.h:

(WebCore::JSDOMWindowShell::createStructure):

  • bindings/js/JSDOMWrapper.h:

(WebCore::JSDOMWrapper::createStructure):

  • bindings/js/JSImageConstructor.h:

(WebCore::JSImageConstructor::createStructure):

  • bindings/js/JSImageDataCustom.cpp:

(WebCore::toJS):

  • bindings/js/JSOptionConstructor.h:

(WebCore::JSOptionConstructor::createStructure):

  • bindings/js/JSWorkerContextBase.h:

(WebCore::JSWorkerContextBase::createStructure):

  • bindings/js/WorkerScriptController.cpp:

(WebCore::WorkerScriptController::initScript):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorDeclaration):

  • bridge/c/CRuntimeObject.h:

(JSC::Bindings::CRuntimeObject::createStructure):

  • bridge/c/c_instance.cpp:

(JSC::Bindings::CRuntimeMethod::createStructure):

  • bridge/jni/jsc/JavaInstanceJSC.cpp:

(JavaRuntimeMethod::createStructure):

  • bridge/jni/jsc/JavaRuntimeObject.h:

(JSC::Bindings::JavaRuntimeObject::createStructure):

  • bridge/objc/ObjCRuntimeObject.h:

(JSC::Bindings::ObjCRuntimeObject::createStructure):

  • bridge/objc/objc_instance.mm:

(ObjCRuntimeMethod::createStructure):

  • bridge/objc/objc_runtime.h:

(JSC::Bindings::ObjcFallbackObjectImp::createStructure):

  • bridge/runtime_array.h:

(JSC::RuntimeArray::createStructure):

  • bridge/runtime_method.h:

(JSC::RuntimeMethod::createStructure):

  • bridge/runtime_object.h:

(JSC::Bindings::RuntimeObject::createStructure):

Source/WebKit/mac:

Update for new Structure::create() globalObject parameter.

  • Plugins/Hosted/ProxyInstance.mm:

(WebKit::ProxyRuntimeMethod::createStructure):

  • Plugins/Hosted/ProxyRuntimeObject.h:

(WebKit::ProxyRuntimeObject::createStructure):

Source/WebKit2:

Update for new Structure::create globalObject parameter.

  • WebProcess/Plugins/Netscape/JSNPMethod.cpp:

(WebKit::JSNPMethod::create):

  • WebProcess/Plugins/Netscape/JSNPMethod.h:

(WebKit::JSNPMethod::createStructure):

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::create):

  • WebProcess/Plugins/Netscape/JSNPObject.h:

(WebKit::JSNPObject::createStructure):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.h

    r94364 r94599  
    4242        const UString calculatedDisplayName(ExecState*);
    4343
    44         static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
     44        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
    4545        {
    46             return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
     46            return Structure::create(globalData, globalObject, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
    4747        }
    4848
Note: See TracChangeset for help on using the changeset viewer.