Ignore:
Timestamp:
Aug 25, 2011, 4:30:14 PM (14 years ago)
Author:
[email protected]
Message:

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

Patch by Mark Hahnenberg <[email protected]> on 2011-08-25
Reviewed by Geoffrey Garen.

Added finishCreation() methods to all immediately subclasses of JSCell with
non-empty constructors. Part of a larger refactoring to "unzip" initialization
lists and constructor bodies. Also renamed JSCell's constructorBody() method
to finishCreation().

  • runtime/Executable.h:

(JSC::ExecutableBase::ExecutableBase):
(JSC::ExecutableBase::constructorBody):

  • runtime/GetterSetter.h:

(JSC::GetterSetter::GetterSetter):

  • runtime/JSAPIValueWrapper.h:

(JSC::JSAPIValueWrapper::constructorBody):
(JSC::JSAPIValueWrapper::JSAPIValueWrapper):

  • runtime/JSCell.h:

(JSC::JSCell::JSCell::JSCell):
(JSC::JSCell::JSCell::constructorBody):

  • runtime/JSObject.h:

(JSC::JSObject::constructorBody):
(JSC::JSObject::JSObject):

  • runtime/JSPropertyNameIterator.h:

(JSC::JSPropertyNameIterator::constructorBody):

  • runtime/JSString.h:

(JSC::RopeBuilder::JSString):
(JSC::RopeBuilder::constructorBody):

  • runtime/RegExp.cpp:

(JSC::RegExp::RegExp):
(JSC::RegExp::constructorBody):

  • runtime/RegExp.h:
  • runtime/ScopeChain.h:

(JSC::ScopeChainNode::ScopeChainNode):
(JSC::ScopeChainNode::constructorBody):

  • runtime/Structure.cpp:

(JSC::Structure::Structure):

  • runtime/StructureChain.cpp:

(JSC::StructureChain::StructureChain):

  • runtime/StructureChain.h:

(JSC::StructureChain::create):
(JSC::StructureChain::constructorBody):

File:
1 edited

Legend:

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

    r92706 r93835  
    2828
    2929#include "JSCell.h"
     30#include "JSObject.h"
    3031#include "Structure.h"
    3132
     
    4546        typedef JSCell Base;
    4647
    47         static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (allocateCell<StructureChain>(globalData.heap)) StructureChain(globalData, globalData.structureChainStructure.get(), head); }
     48        static StructureChain* create(JSGlobalData& globalData, Structure* head)
     49        {
     50            return new (allocateCell<StructureChain>(globalData.heap)) StructureChain(globalData, globalData.structureChainStructure.get(), head);
     51        }
    4852        WriteBarrier<Structure>* head() { return m_vector.get(); }
    4953        void visitChildren(SlotVisitor&);
     
    5256       
    5357        static ClassInfo s_info;
     58
     59    protected:
     60        void finishCreation(JSGlobalData& globalData, Structure* head)
     61        {
     62            Base::finishCreation(globalData);
     63            size_t size = 0;
     64            for (Structure* current = head; current; current = current->storedPrototype().isNull() ? 0 : asObject(current->storedPrototype())->structure())
     65                ++size;
     66   
     67            m_vector = adoptArrayPtr(new WriteBarrier<Structure>[size + 1]);
     68
     69            size_t i = 0;
     70            for (Structure* current = head; current; current = current->storedPrototype().isNull() ? 0 : asObject(current->storedPrototype())->structure())
     71                m_vector[i++].set(globalData, this, current);
     72        }
    5473
    5574    private:
Note: See TracChangeset for help on using the changeset viewer.