]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/InternalFunction.h
JavaScriptCore-7600.1.4.16.1.tar.gz
[apple/javascriptcore.git] / runtime / InternalFunction.h
index cc4b917e440df4e3a045f378b4d4991ab370522c..e216c2f82eb373326314f354c21f6b254bdc85b2 100644 (file)
 #ifndef InternalFunction_h
 #define InternalFunction_h
 
-#include "JSObject.h"
 #include "Identifier.h"
+#include "JSDestructibleObject.h"
 
 namespace JSC {
 
     class FunctionPrototype;
 
-    class InternalFunction : public JSObject {
+    class InternalFunction : public JSDestructibleObject {
     public:
-        virtual const ClassInfo* classInfo() const; 
-        static const ClassInfo info;
+        typedef JSDestructibleObject Base;
 
-        const UString& name(JSGlobalData*);
+        DECLARE_EXPORT_INFO;
 
-        static PassRefPtr<Structure> createStructure(JSValuePtr 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(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot)); 
+            return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); 
         }
 
     protected:
-        InternalFunction(PassRefPtr<Structure> structure) : JSObject(structure) { }
-        InternalFunction(JSGlobalData*, PassRefPtr<Structure>, const Identifier&);
+        static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
+
+        JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*);
+
+        JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name);
 
-    private:
-        virtual CallType getCallData(CallData&) = 0;
+        static CallType getCallData(JSCell*, CallData&);
     };
 
-    InternalFunction* asInternalFunction(JSValuePtr);
+    InternalFunction* asInternalFunction(JSValue);
 
-    inline InternalFunction* asInternalFunction(JSValuePtr value)
+    inline InternalFunction* asInternalFunction(JSValue value)
     {
-        ASSERT(asObject(value)->inherits(&InternalFunction::info));
+        ASSERT(asObject(value)->inherits(InternalFunction::info()));
         return static_cast<InternalFunction*>(asObject(value));
     }