X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..12899fa232562c774004a3a9d7d3149944dec712:/runtime/ArrayConstructor.h diff --git a/runtime/ArrayConstructor.h b/runtime/ArrayConstructor.h index dc0df24..727475b 100644 --- a/runtime/ArrayConstructor.h +++ b/runtime/ArrayConstructor.h @@ -25,29 +25,43 @@ namespace JSC { - class ArrayPrototype; +class ArrayAllocationProfile; +class ArrayPrototype; +class JSArray; - class ArrayConstructor : public InternalFunction { - public: - ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*); +class ArrayConstructor : public InternalFunction { +public: + typedef InternalFunction Base; - static const ClassInfo s_info; + static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype) + { + ArrayConstructor* constructor = new (NotNull, allocateCell(*exec->heap())) ArrayConstructor(globalObject, structure); + constructor->finishCreation(exec, arrayPrototype); + return constructor; + } - static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) - { - return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); - } + static const ClassInfo s_info; - protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); + } - private: - virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); - virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); +protected: + void finishCreation(ExecState*, ArrayPrototype*); + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; - virtual ConstructType getConstructData(ConstructData&); - virtual CallType getCallData(CallData&); - }; +private: + ArrayConstructor(JSGlobalObject*, Structure*); + static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); + + static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); + + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); +}; + +JSObject* constructArrayWithSizeQuirk(ExecState*, ArrayAllocationProfile*, JSGlobalObject*, JSValue); } // namespace JSC