• commit-queue@webkit.org's avatar
    Move allocation in constructors into separate constructorBody() methods · 53aecd29
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=66265
    
    Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-08-18
    Reviewed by Oliver Hunt.
    
    Source/JavaScriptCore:
    
    Refactoring to put all allocations that need to be done after the object's
    initialization list has executed but before the object is ready for use
    into a separate constructorBody() method.  This method is still called by the constructor,
    so the patch doesn't resolve any potential issues, it's just to set up the code for further refactoring.
    
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * jsc.cpp:
    (GlobalObject::constructorBody):
    (GlobalObject::GlobalObject):
    * runtime/ErrorInstance.cpp:
    (JSC::ErrorInstance::ErrorInstance):
    * runtime/ErrorInstance.h:
    (JSC::ErrorInstance::constructorBody):
    * runtime/ErrorPrototype.cpp:
    (JSC::ErrorPrototype::ErrorPrototype):
    (JSC::ErrorPrototype::constructorBody):
    * runtime/ErrorPrototype.h:
    * runtime/Executable.cpp:
    (JSC::FunctionExecutable::FunctionExecutable):
    * runtime/Executable.h:
    (JSC::FunctionExecutable::constructorBody):
    * runtime/InternalFunction.cpp:
    (JSC::InternalFunction::InternalFunction):
    * runtime/InternalFunction.h:
    (JSC::InternalFunction::constructorBody):
    * runtime/JSByteArray.cpp:
    (JSC::JSByteArray::JSByteArray):
    * runtime/JSByteArray.h:
    (JSC::JSByteArray::constructorBody):
    * runtime/JSFunction.cpp:
    (JSC::JSFunction::JSFunction):
    (JSC::JSFunction::constructorBody):
    * runtime/JSFunction.h:
    * runtime/JSGlobalObject.h:
    (JSC::JSGlobalObject::JSGlobalObject):
    (JSC::JSGlobalObject::constructorBody):
    * runtime/JSPropertyNameIterator.cpp:
    (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
    * runtime/JSPropertyNameIterator.h:
    (JSC::JSPropertyNameIterator::constructorBody):
    * runtime/JSString.h:
    (JSC::RopeBuilder::JSString):
    (JSC::RopeBuilder::constructorBody):
    * runtime/NativeErrorConstructor.cpp:
    (JSC::NativeErrorConstructor::NativeErrorConstructor):
    * runtime/NativeErrorConstructor.h:
    (JSC::NativeErrorConstructor::constructorBody):
    * runtime/NativeErrorPrototype.cpp:
    (JSC::NativeErrorPrototype::NativeErrorPrototype):
    (JSC::NativeErrorPrototype::constructorBody):
    * runtime/NativeErrorPrototype.h:
    * runtime/StringObject.cpp:
    * runtime/StringObject.h:
    (JSC::StringObject::create):
    * runtime/StringObjectThatMasqueradesAsUndefined.h:
    (JSC::StringObjectThatMasqueradesAsUndefined::create):
    (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
    * runtime/StringPrototype.cpp:
    (JSC::StringPrototype::StringPrototype):
    * runtime/StringPrototype.h:
    (JSC::StringPrototype::create):
    
    Source/WebCore:
    
    No new tests.
    
    Refactoring to put all allocations that need to be done after the object's
    initialization list has executed but before the object is ready for use
    into a separate constructorBody() method.  This method is still called by the constructor,
    so the patch doesn't resolve any potential issues, it's just to set up the code for further refactoring.
    
    * bridge/objc/ObjCRuntimeObject.h:
    (JSC::Bindings::ObjCRuntimeObject::create):
    * bridge/objc/ObjCRuntimeObject.mm:
    * bridge/objc/objc_instance.mm:
    (ObjCRuntimeMethod::create):
    (ObjCRuntimeMethod::ObjCRuntimeMethod):
    * bridge/runtime_array.cpp:
    * bridge/runtime_array.h:
    (JSC::RuntimeArray::create):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    53aecd29
ErrorPrototype.cpp 3.51 KB