⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 94035 in webkit


Ignore:
Timestamp:
Aug 29, 2011, 6:43:46 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

Unzip initialization lists and constructors in JSCell hierarchy (3/7)
https://bugs.webkit.org/show_bug.cgi?id=67064

Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-08-29
Reviewed by Darin Adler.

Source/JavaScriptCore:

Completed the third level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the second level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

  • debugger/DebuggerActivation.cpp:

(JSC::DebuggerActivation::DebuggerActivation):
(JSC::DebuggerActivation::finishCreation):

  • debugger/DebuggerActivation.h:

(JSC::DebuggerActivation::create):

  • runtime/Arguments.h:

(JSC::Arguments::create):
(JSC::Arguments::createNoParameters):
(JSC::Arguments::Arguments):
(JSC::Arguments::finishCreation):

  • runtime/ErrorInstance.cpp:

(JSC::ErrorInstance::ErrorInstance):

  • runtime/ErrorInstance.h:

(JSC::ErrorInstance::finishCreation):

  • runtime/ExceptionHelpers.cpp:

(JSC::InterruptedExecutionError::InterruptedExecutionError):
(JSC::TerminatedExecutionError::TerminatedExecutionError):

  • runtime/Executable.cpp:

(JSC::EvalExecutable::EvalExecutable):
(JSC::ProgramExecutable::ProgramExecutable):
(JSC::FunctionExecutable::FunctionExecutable):
Moved the assignment of m_firstLine and m_lastLine into the
FunctionExecutable::finishCreation() method in Executable.h

  • runtime/Executable.h:

(JSC::ScriptExecutable::ScriptExecutable):
(JSC::EvalExecutable::create):
(JSC::ProgramExecutable::create):
(JSC::FunctionExecutable::create):
(JSC::FunctionExecutable::finishCreation):

  • runtime/JSArray.cpp:

(JSC::JSArray::JSArray):
(JSC::JSArray::finishCreation):

  • runtime/JSArray.h:
  • runtime/JSByteArray.cpp:

(JSC::JSByteArray::JSByteArray):

  • runtime/JSByteArray.h:

(JSC::JSByteArray::finishCreation):

  • runtime/JSNotAnObject.h:

(JSC::JSNotAnObject::JSNotAnObject):

  • runtime/JSObject.h:

(JSC::JSNonFinalObject::JSNonFinalObject):

  • runtime/JSObjectWithGlobalObject.cpp:

(JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
(JSC::JSObjectWithGlobalObject::finishCreation):

  • runtime/JSObjectWithGlobalObject.h:
  • runtime/JSVariableObject.h:

(JSC::JSVariableObject::JSVariableObject):
(JSC::JSVariableObject::finishCreation):

  • runtime/JSWrapperObject.h:

(JSC::JSWrapperObject::JSWrapperObject):

  • runtime/ObjectPrototype.cpp:

(JSC::ObjectPrototype::ObjectPrototype):
(JSC::ObjectPrototype::finishCreation):

  • runtime/ObjectPrototype.h:
  • runtime/StrictEvalActivation.cpp:

(JSC::StrictEvalActivation::StrictEvalActivation):

Source/JavaScriptGlue:

Completed the third level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the second level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

  • UserObjectImp.cpp:

(UserObjectImp::UserObjectImp):

Source/WebCore:

No new tests.

Completed the third level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the second level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::JSDOMWindowShell):
(WebCore::JSDOMWindowShell::finishCreation):

  • bindings/js/JSDOMWindowShell.h:
Location:
trunk/Source
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r93991 r94035  
     12011-08-29  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (3/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67064
     5
     6        Reviewed by Darin Adler.
     7
     8        Completed the third level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the second level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * debugger/DebuggerActivation.cpp:
     21        (JSC::DebuggerActivation::DebuggerActivation):
     22        (JSC::DebuggerActivation::finishCreation):
     23        * debugger/DebuggerActivation.h:
     24        (JSC::DebuggerActivation::create):
     25        * runtime/Arguments.h:
     26        (JSC::Arguments::create):
     27        (JSC::Arguments::createNoParameters):
     28        (JSC::Arguments::Arguments):
     29        (JSC::Arguments::finishCreation):
     30        * runtime/ErrorInstance.cpp:
     31        (JSC::ErrorInstance::ErrorInstance):
     32        * runtime/ErrorInstance.h:
     33        (JSC::ErrorInstance::finishCreation):
     34        * runtime/ExceptionHelpers.cpp:
     35        (JSC::InterruptedExecutionError::InterruptedExecutionError):
     36        (JSC::TerminatedExecutionError::TerminatedExecutionError):
     37        * runtime/Executable.cpp:
     38        (JSC::EvalExecutable::EvalExecutable):
     39        (JSC::ProgramExecutable::ProgramExecutable):
     40        (JSC::FunctionExecutable::FunctionExecutable):
     41        Moved the assignment of m_firstLine and m_lastLine into the
     42        FunctionExecutable::finishCreation() method in Executable.h
     43        * runtime/Executable.h:
     44        (JSC::ScriptExecutable::ScriptExecutable):
     45        (JSC::EvalExecutable::create):
     46        (JSC::ProgramExecutable::create):
     47        (JSC::FunctionExecutable::create):
     48        (JSC::FunctionExecutable::finishCreation):
     49        * runtime/JSArray.cpp:
     50        (JSC::JSArray::JSArray):
     51        (JSC::JSArray::finishCreation):
     52        * runtime/JSArray.h:
     53        * runtime/JSByteArray.cpp:
     54        (JSC::JSByteArray::JSByteArray):
     55        * runtime/JSByteArray.h:
     56        (JSC::JSByteArray::finishCreation):
     57        * runtime/JSNotAnObject.h:
     58        (JSC::JSNotAnObject::JSNotAnObject):
     59        * runtime/JSObject.h:
     60        (JSC::JSNonFinalObject::JSNonFinalObject):
     61        * runtime/JSObjectWithGlobalObject.cpp:
     62        (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
     63        (JSC::JSObjectWithGlobalObject::finishCreation):
     64        * runtime/JSObjectWithGlobalObject.h:
     65        * runtime/JSVariableObject.h:
     66        (JSC::JSVariableObject::JSVariableObject):
     67        (JSC::JSVariableObject::finishCreation):
     68        * runtime/JSWrapperObject.h:
     69        (JSC::JSWrapperObject::JSWrapperObject):
     70        * runtime/ObjectPrototype.cpp:
     71        (JSC::ObjectPrototype::ObjectPrototype):
     72        (JSC::ObjectPrototype::finishCreation):
     73        * runtime/ObjectPrototype.h:
     74        * runtime/StrictEvalActivation.cpp:
     75        (JSC::StrictEvalActivation::StrictEvalActivation):
     76
    1772011-08-29  Andreas Kling  <kling@webkit.org>
    278
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp

    r86785 r94035  
    3434    : JSNonFinalObject(globalData, globalData.debuggerActivationStructure.get())
    3535{
     36    finishCreation(globalData, activation);
     37}
     38
     39void DebuggerActivation::finishCreation(JSGlobalData& globalData, JSObject* activation)
     40{
     41    Base::finishCreation(globalData);
    3642    ASSERT(activation);
    3743    ASSERT(activation->isActivationObject());
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r92706 r94035  
    3131namespace JSC {
    3232
    33     class JSActivation;
    34 
    3533    class DebuggerActivation : public JSNonFinalObject {
    3634    public:
     
    3937        static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object)
    4038        {
    41             return new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData, object);
     39            DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData, object);
     40            return activation;
    4241        }
    4342
     
    6362        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | JSObject::StructureFlags;
    6463
     64        void finishCreation(JSGlobalData&, JSObject* activation);
     65
    6566    private:
    6667        DebuggerActivation(JSGlobalData&, JSObject*);
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r92706 r94035  
    6464        static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame)
    6565        {
    66             return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
     66            Arguments* arguments = new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
     67            return arguments;
    6768        }
    6869       
    6970        static Arguments* createNoParameters(JSGlobalData& globalData, CallFrame* callFrame)
    7071        {
    71             return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame, NoParameters);
     72            Arguments* arguments = new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame, NoParameters);
     73            return arguments;
    7274        }
    7375
     
    115117    protected:
    116118        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
     119
     120        void finishCreation(CallFrame*);
     121        void finishCreation(CallFrame*, NoParametersType);
    117122
    118123    private:
     
    162167        , d(adoptPtr(new ArgumentsData))
    163168    {
     169        finishCreation(callFrame);
     170    }
     171
     172    inline Arguments::Arguments(CallFrame* callFrame, NoParametersType)
     173        : JSNonFinalObject(callFrame->globalData(), callFrame->lexicalGlobalObject()->argumentsStructure())
     174        , d(adoptPtr(new ArgumentsData))
     175    {
     176        finishCreation(callFrame, NoParameters);
     177    }
     178   
     179    inline void Arguments::finishCreation(CallFrame* callFrame)
     180    {
     181        Base::finishCreation(callFrame->globalData());
    164182        ASSERT(inherits(&s_info));
    165183
     
    200218    }
    201219
    202     inline Arguments::Arguments(CallFrame* callFrame, NoParametersType)
    203         : JSNonFinalObject(callFrame->globalData(), callFrame->lexicalGlobalObject()->argumentsStructure())
    204         , d(adoptPtr(new ArgumentsData))
    205     {
     220    inline void Arguments::finishCreation(CallFrame* callFrame, NoParametersType)
     221    {
     222        Base::finishCreation(callFrame->globalData());
    206223        ASSERT(inherits(&s_info));
    207224        ASSERT(!asFunction(callFrame->callee())->jsExecutable()->parameterCount());
  • trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp

    r93710 r94035  
    3030    , m_appendSourceToMessage(false)
    3131{
    32     constructorBody(globalData);
     32    finishCreation(globalData, UString("", 0));
    3333}
    3434
     
    3737    , m_appendSourceToMessage(false)
    3838{
    39     ASSERT(inherits(&s_info));
    40     putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, message), DontEnum);
     39    finishCreation(globalData, message);
    4140}
    4241
  • trunk/Source/JavaScriptCore/runtime/ErrorInstance.h

    r93378 r94035  
    5151        explicit ErrorInstance(JSGlobalData&, Structure*, const UString&);
    5252
    53         void constructorBody(JSGlobalData& globalData)
     53        void finishCreation(JSGlobalData& globalData, const UString& message)
    5454        {
     55            Base::finishCreation(globalData);
    5556            ASSERT(inherits(&s_info));
    56             putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, ""), DontEnum);
     57            putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, message), DontEnum);
    5758        }
    5859
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r92706 r94035  
    4747        : JSNonFinalObject(globalData, globalData.interruptedExecutionErrorStructure.get())
    4848    {
     49        finishCreation(globalData);
    4950    }
    5051
     
    7273        : JSNonFinalObject(globalData, globalData.terminatedExecutionErrorStructure.get())
    7374    {
     75        finishCreation(globalData);
    7476    }
    7577
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r93947 r94035  
    128128    : ScriptExecutable(exec->globalData().evalExecutableStructure.get(), exec, source, inStrictContext)
    129129{
     130    finishCreation(exec->globalData());
    130131}
    131132
     
    139140    : ScriptExecutable(exec->globalData().programExecutableStructure.get(), exec, source, false)
    140141{
     142    finishCreation(exec->globalData());
    141143}
    142144
     
    166168    , m_symbolTable(0)
    167169{
    168     m_firstLine = firstLine;
    169     m_lastLine = lastLine;
    170170    finishCreation(exec->globalData(), name, firstLine, lastLine);
    171171}
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r93947 r94035  
    244244            , m_features(isInStrictContext ? StrictModeFeature : 0)
    245245        {
    246             finishCreation(globalData);
    247246        }
    248247
     
    252251            , m_features(isInStrictContext ? StrictModeFeature : 0)
    253252        {
    254             finishCreation(exec->globalData());
    255253        }
    256254
     
    319317        static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext)
    320318        {
    321             return new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
     319            EvalExecutable* executable = new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
     320            return executable;
    322321        }
    323322
     
    355354        static ProgramExecutable* create(ExecState* exec, const SourceCode& source)
    356355        {
    357             return new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
     356            ProgramExecutable* executable = new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
     357            return executable;
    358358        }
    359359
     
    413413        static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
    414414        {
    415             return new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
     415            FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
     416            return executable;
    416417        }
    417418
    418419        static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
    419420        {
    420             return new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
     421            FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
     422            return executable;
    421423        }
    422424
     
    531533        void finishCreation(JSGlobalData& globalData, const Identifier& name, int firstLine, int lastLine)
    532534        {
     535            Base::finishCreation(globalData);
    533536            m_firstLine = firstLine;
    534537            m_lastLine = lastLine;
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r90282 r94035  
    135135    : JSNonFinalObject(globalData, structure)
    136136{
     137    finishCreation(globalData);
     138}
     139
     140JSArray::JSArray(JSGlobalData& globalData, Structure* structure, unsigned initialLength, ArrayCreationMode creationMode)
     141    : JSNonFinalObject(globalData, structure)
     142{
     143    finishCreation(globalData, initialLength, creationMode);
     144}
     145
     146JSArray::JSArray(JSGlobalData& globalData, Structure* structure, const ArgList& list)
     147    : JSNonFinalObject(globalData, structure)
     148{
     149    finishCreation(globalData, list);
     150}
     151
     152void JSArray::finishCreation(JSGlobalData& globalData)
     153{
     154    Base::finishCreation(globalData);
    137155    ASSERT(inherits(&s_info));
    138156
     
    149167}
    150168
    151 JSArray::JSArray(JSGlobalData& globalData, Structure* structure, unsigned initialLength, ArrayCreationMode creationMode)
    152     : JSNonFinalObject(globalData, structure)
    153 {
     169void JSArray::finishCreation(JSGlobalData& globalData, unsigned initialLength, ArrayCreationMode creationMode)
     170{
     171    Base::finishCreation(globalData);
    154172    ASSERT(inherits(&s_info));
    155173
     
    191209}
    192210
    193 JSArray::JSArray(JSGlobalData& globalData, Structure* structure, const ArgList& list)
    194     : JSNonFinalObject(globalData, structure)
    195 {
     211void JSArray::finishCreation(JSGlobalData& globalData, const ArgList& list)
     212{
     213    Base::finishCreation(globalData);
    196214    ASSERT(inherits(&s_info));
    197215
  • trunk/Source/JavaScriptCore/runtime/JSArray.h

    r92706 r94035  
    6565        JSArray(JSGlobalData&, Structure*, unsigned initialLength, ArrayCreationMode);
    6666        JSArray(JSGlobalData&, Structure*, const ArgList& initialValues);
    67        
     67
     68        void finishCreation(JSGlobalData&);
     69        void finishCreation(JSGlobalData&, unsigned initialLength, ArrayCreationMode);
     70        void finishCreation(JSGlobalData&, const ArgList&);
     71   
    6872    public:
    6973        typedef JSNonFinalObject Base;
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp

    r93378 r94035  
    4040    , m_storage(storage)
    4141{
    42     constructorBody(exec);
     42    finishCreation(exec);
    4343}
    4444       
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.h

    r93378 r94035  
    105105        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
    106106
    107         void constructorBody(ExecState* exec)
     107        void finishCreation(ExecState* exec)
    108108        {
     109            Base::finishCreation(exec->globalData());
    109110            putDirect(exec->globalData(), exec->globalData().propertyNames->length, jsNumber(m_storage->length()), ReadOnly | DontDelete);
    110111        }
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h

    r92706 r94035  
    4242            : JSNonFinalObject(exec->globalData(), exec->globalData().notAnObjectStructure.get())
    4343        {
     44            finishCreation(exec->globalData());
    4445        }
    4546       
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r93920 r94035  
    362362            : JSObject(globalData, structure, m_inlineStorage)
    363363        {
    364             finishCreation(globalData);
    365364        }
    366365
  • trunk/Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp

    r84052 r94035  
    3434    : JSNonFinalObject(globalObject->globalData(), structure)
    3535{
    36     COMPILE_ASSERT(AnonymousSlotCount == 1, AnonymousSlotCount_must_be_one);
    37     ASSERT(!globalObject || globalObject->isGlobalObject());
    38     if (!globalObject)
    39         clearAnonymousValue(GlobalObjectSlot);
    40     else
    41         putAnonymousValue(globalObject->globalData(), GlobalObjectSlot, globalObject);
     36    finishCreation(globalObject->globalData(), globalObject);
    4237}
    4338
     
    4540    : JSNonFinalObject(globalData, structure)
    4641{
     42    finishCreation(globalData, globalObject);
     43}
     44
     45void JSObjectWithGlobalObject::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject)
     46{
     47    Base::finishCreation(globalData);
    4748    COMPILE_ASSERT(AnonymousSlotCount == 1, AnonymousSlotCount_must_be_one);
    4849    ASSERT(!globalObject || globalObject->isGlobalObject());
  • trunk/Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.h

    r84052 r94035  
    3535class JSObjectWithGlobalObject : public JSNonFinalObject {
    3636public:
     37    typedef JSNonFinalObject Base;
     38
    3739    static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
    3840    {
     
    5456        // Should only be used by JSFunction when we aquire the JSFunction vptr.
    5557    }
     58
     59    void finishCreation(JSGlobalData&, JSGlobalObject*);
     60
    5661    static const unsigned AnonymousSlotCount = JSObject::AnonymousSlotCount + 1;
    5762    static const unsigned GlobalObjectSlot = 0;
  • trunk/Source/JavaScriptCore/runtime/JSVariableObject.h

    r92706 r94035  
    7575            , m_registers(reinterpret_cast<WriteBarrier<Unknown>*>(registers))
    7676        {
     77            finishCreation(globalData);
     78        }
     79
     80        void finishCreation(JSGlobalData& globalData)
     81        {
     82            Base::finishCreation(globalData);
    7783            ASSERT(m_symbolTable);
    7884            COMPILE_ASSERT(sizeof(WriteBarrier<Unknown>) == sizeof(Register), Register_should_be_same_size_as_WriteBarrier);
  • trunk/Source/JavaScriptCore/runtime/JSWrapperObject.h

    r92706 r94035  
    5454        : JSNonFinalObject(globalData, structure)
    5555    {
     56        finishCreation(globalData);
    5657    }
    5758
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r91351 r94035  
    6868    , m_hasNoPropertiesWithUInt32Names(true)
    6969{
     70    finishCreation(exec->globalData(), globalObject);
     71}
     72
     73void ObjectPrototype::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject)
     74{
     75    Base::finishCreation(globalData);
    7076    ASSERT(inherits(&s_info));
    7177    putAnonymousValue(globalObject->globalData(), 0, globalObject);
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r92706 r94035  
    4646        static const unsigned AnonymousSlotCount = JSNonFinalObject::AnonymousSlotCount + 1;
    4747
     48        void finishCreation(JSGlobalData&, JSGlobalObject*);
     49
    4850    private:
    4951        ObjectPrototype(ExecState*, JSGlobalObject*, Structure*);
  • trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp

    r84052 r94035  
    3232    : JSNonFinalObject(exec->globalData(), exec->globalData().strictEvalActivationStructure.get())
    3333{
     34    finishCreation(exec->globalData());
    3435}
    3536
  • trunk/Source/JavaScriptGlue/ChangeLog

    r93059 r94035  
     12011-08-29  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (3/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67064
     5
     6        Reviewed by Darin Adler.
     7
     8        Completed the third level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the second level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * UserObjectImp.cpp:
     21        (UserObjectImp::UserObjectImp):
     22
    1232011-08-15  Mark Hahnenberg  <mhahnenberg@apple.com>
    224
  • trunk/Source/JavaScriptGlue/UserObjectImp.cpp

    r84556 r94035  
    3939    , fJSUserObject((JSUserObject*)userObject->Retain())
    4040{
     41    finishCreation(globalData);
    4142}
    4243
  • trunk/Source/WebCore/ChangeLog

    r94026 r94035  
     12011-08-29  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (3/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67064
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests.
     9
     10        Completed the third level of the refactoring to add finishCreation()
     11        methods to all classes within the JSCell hierarchy with non-trivial
     12        constructor bodies.
     13
     14        This primarily consists of pushing the calls to finishCreation() down
     15        into the constructors of the subclasses of the second level of the hierarchy
     16        as well as pulling the finishCreation() calls out into the class's corresponding
     17        create() method if it has one.  Doing both simultaneously allows us to
     18        maintain the invariant that the finishCreation() method chain is called exactly
     19        once during the creation of an object, since calling it any other number of
     20        times (0, 2, or more) will cause an assertion failure.
     21
     22        * bindings/js/JSDOMWindowShell.cpp:
     23        (WebCore::JSDOMWindowShell::JSDOMWindowShell):
     24        (WebCore::JSDOMWindowShell::finishCreation):
     25        * bindings/js/JSDOMWindowShell.h:
     26
    1272011-08-29  John Bauman  <jbauman@chromium.org>
    228
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp

    r93688 r94035  
    4848    , m_world(world)
    4949{
     50    finishCreation(*world->globalData(), window);
     51}
     52
     53void JSDOMWindowShell::finishCreation(JSGlobalData& globalData, PassRefPtr<DOMWindow> window)
     54{
     55    Base::finishCreation(globalData);
    5056    ASSERT(inherits(&s_info));
    5157    setWindow(window);
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h

    r92788 r94035  
    6565        DOMWrapperWorld* world() { return m_world.get(); }
    6666
     67    protected:
     68        void finishCreation(JSC::JSGlobalData&, PassRefPtr<DOMWindow>);
     69
    6770    private:
    6871        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | JSC::OverridesGetPropertyNames | Base::StructureFlags;
Note: See TracChangeset for help on using the changeset viewer.