]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NumberConstructor.h
JavaScriptCore-7600.1.4.11.8.tar.gz
[apple/javascriptcore.git] / runtime / NumberConstructor.h
index 723c4b283152b01030225e3fae71b50fe926b918..6c8ed89fecdc04f00ee324879a58a3e97646003b 100644 (file)
@@ -29,29 +29,35 @@ namespace JSC {
 
     class NumberConstructor : public InternalFunction {
     public:
-        NumberConstructor(ExecState*, NonNullPassRefPtr<Structure>, NumberPrototype*);
+        typedef InternalFunction Base;
 
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
+        static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype)
+        {
+            NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(vm, structure);
+            constructor->finishCreation(vm, numberPrototype);
+            return constructor;
+        }
+
+        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
         JSValue getValueProperty(ExecState*, int token) const;
 
-        static const ClassInfo info;
+        DECLARE_INFO;
 
-        static PassRefPtr<Structure> createStructure(JSValue proto) 
+        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) 
         { 
-            return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); 
+            return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); 
         }
 
         enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
 
     protected:
+        void finishCreation(VM&, NumberPrototype*);
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
 
     private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
-
-        virtual const ClassInfo* classInfo() const { return &info; }
+        NumberConstructor(VM&, Structure*);
+        static ConstructType getConstructData(JSCell*, ConstructData&);
+        static CallType getCallData(JSCell*, CallData&);
     };
 
 } // namespace JSC