#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 JS_EXPORTDATA const ClassInfo info;
+ typedef JSDestructibleObject Base;
- const UString& name(ExecState*);
- const UString displayName(ExecState*);
- const UString calculatedDisplayName(ExecState*);
+ static JS_EXPORTDATA const ClassInfo s_info;
- static PassRefPtr<Structure> createStructure(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(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
+ return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info);
}
protected:
static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
- InternalFunction(NonNullPassRefPtr<Structure> structure) : JSObject(structure) { }
- InternalFunction(JSGlobalData*, NonNullPassRefPtr<Structure>, const Identifier&);
+ JS_EXPORT_PRIVATE InternalFunction(JSGlobalObject*, Structure*);
+
+ JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name);
- private:
- virtual CallType getCallData(CallData&) = 0;
+ static CallType getCallData(JSCell*, CallData&);
};
InternalFunction* asInternalFunction(JSValue);
inline InternalFunction* asInternalFunction(JSValue value)
{
- ASSERT(asObject(value)->inherits(&InternalFunction::info));
+ ASSERT(asObject(value)->inherits(&InternalFunction::s_info));
return static_cast<InternalFunction*>(asObject(value));
}