X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..2656c66b5b30d5597e842a751c7f19ad6c2fe31a:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index cc4b917..e216c2f 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -24,38 +24,43 @@ #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 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) : JSObject(structure) { } - InternalFunction(JSGlobalData*, PassRefPtr, 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(asObject(value)); }