]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NumberObject.h
JavaScriptCore-1097.13.tar.gz
[apple/javascriptcore.git] / runtime / NumberObject.h
index 6c18cdd3bfa441ca588bd8b7cbb7e8c5ebdfb749..07334722b936fd9ab5242018fe36cf5f650ea68f 100644 (file)
 namespace JSC {
 
     class NumberObject : public JSWrapperObject {
-    public:
-        explicit NumberObject(NonNullPassRefPtr<Structure>);
+    protected:
+        NumberObject(JSGlobalData&, Structure*);
+        void finishCreation(JSGlobalData&);
 
-        static const ClassInfo info;
+    public:
+        typedef JSWrapperObject Base;
 
-        static PassRefPtr<Structure> createStructure(JSValue prototype)
+        static NumberObject* create(JSGlobalData& globalData, Structure* structure)
         {
-            return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
+            NumberObject* number = new (NotNull, allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
+            number->finishCreation(globalData);
+            return number;
         }
 
-    protected:
-#if USE(JSVALUE32)
-        static const unsigned StructureFlags = OverridesMarkChildren | JSWrapperObject::StructureFlags;
-#else
-        static const unsigned StructureFlags = JSWrapperObject::StructureFlags;
-#endif
+        static const ClassInfo s_info;
 
-    private:
-        virtual const ClassInfo* classInfo() const { return &info; }
-
-        virtual JSValue getJSNumber();
+        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
+        {
+            return Structure::create(globalData, globalObject, prototype, TypeInfo(NumberObjectType, StructureFlags), &s_info);
+        }
     };
 
-    NumberObject* constructNumber(ExecState*, JSValue);
+    NumberObject* constructNumber(ExecState*, JSGlobalObject*, JSValue);
 
 } // namespace JSC