]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/MathObject.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / MathObject.h
index 3557d1ecaa7c04ce5c58dd9fb45aef8373524c6a..9d1c181c0f1efaa20b35f7e85d8dfadbff46379b 100644 (file)
 
 namespace JSC {
 
-    class MathObject : public JSObject {
-    public:
-        MathObject(ExecState*, PassRefPtr<Structure>);
-
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
-
-        static PassRefPtr<Structure> createStructure(JSValue prototype)
-        {
-            return Structure::create(prototype, TypeInfo(ObjectType));
-        }
-    };
+class MathObject : public JSNonFinalObject {
+private:
+    MathObject(VM&, Structure*);
+
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
+
+    static MathObject* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
+    {
+        MathObject* object = new (NotNull, allocateCell<MathObject>(vm.heap)) MathObject(vm, structure);
+        object->finishCreation(vm, globalObject);
+        return object;
+    }
+
+    DECLARE_INFO;
+
+    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+    {
+        return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+    }
+
+protected:
+    void finishCreation(VM&, JSGlobalObject*);
+};
+
+EncodedJSValue JSC_HOST_CALL mathProtoFuncAbs(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncFloor(ExecState*);
 
 } // namespace JSC