]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/InternalFunction.h
JavaScriptCore-7600.1.4.15.12.tar.gz
[apple/javascriptcore.git] / runtime / InternalFunction.h
index 28e260e30130ddd8c0ae796d663337298fe9cfa1..e216c2f82eb373326314f354c21f6b254bdc85b2 100644 (file)
 #ifndef InternalFunction_h
 #define InternalFunction_h
 
-#include "JSObjectWithGlobalObject.h"
 #include "Identifier.h"
+#include "JSDestructibleObject.h"
 
 namespace JSC {
 
     class FunctionPrototype;
 
-    class InternalFunction : public JSObjectWithGlobalObject {
+    class InternalFunction : public JSDestructibleObject {
     public:
-        static JS_EXPORTDATA const ClassInfo s_info;
+        typedef JSDestructibleObject Base;
 
-        const UString& name(ExecState*);
-        const UString displayName(ExecState*);
-        const UString calculatedDisplayName(ExecState*);
+        DECLARE_EXPORT_INFO;
 
-        static Structure* createStructure(JSGlobalData& globalData, JSValue proto) 
+        JS_EXPORT_PRIVATE const String& name(ExecState*);
+        const String displayName(ExecState*);
+        const String calculatedDisplayName(ExecState*);
+
+        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) 
         { 
-            return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 
+            return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); 
         }
 
     protected:
         static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
 
-        // Only used to allow us to determine the JSFunction vptr
-        InternalFunction(VPtrStealingHackType);
-
-        InternalFunction(JSGlobalData*, JSGlobalObject*, Structure*, const Identifier&);
+        JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*);
 
-    private:
-        virtual CallType getCallData(CallData&) = 0;
+        JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name);
 
-        virtual void vtableAnchor();
+        static CallType getCallData(JSCell*, CallData&);
     };
 
     InternalFunction* asInternalFunction(JSValue);
 
     inline InternalFunction* asInternalFunction(JSValue value)
     {
-        ASSERT(asObject(value)->inherits(&InternalFunction::s_info));
+        ASSERT(asObject(value)->inherits(InternalFunction::info()));
         return static_cast<InternalFunction*>(asObject(value));
     }