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