Ignore:
Timestamp:
Aug 29, 2011, 6:43:46 PM (14 years ago)
Author:
[email protected]
Message:

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

Patch by Mark Hahnenberg <[email protected]> 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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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*);
Note: See TracChangeset for help on using the changeset viewer.