X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index cc4b917..8b0d09f 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -24,40 +24,44 @@ #ifndef InternalFunction_h #define InternalFunction_h -#include "JSObject.h" #include "Identifier.h" +#include "JSDestructibleObject.h" namespace JSC { - class FunctionPrototype; +class FunctionPrototype; - class InternalFunction : public JSObject { - public: - virtual const ClassInfo* classInfo() const; - static const ClassInfo info; +class InternalFunction : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + static const unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance | TypeOfShouldCallGetCallData; - const UString& name(JSGlobalData*); + DECLARE_EXPORT_INFO; - static PassRefPtr createStructure(JSValuePtr proto) - { - return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot)); - } + JS_EXPORT_PRIVATE const String& name(ExecState*); + const String displayName(ExecState*); + const String calculatedDisplayName(ExecState*); - protected: - InternalFunction(PassRefPtr structure) : JSObject(structure) { } - InternalFunction(JSGlobalData*, PassRefPtr, const Identifier&); + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) + { + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); + } - private: - virtual CallType getCallData(CallData&) = 0; - }; +protected: + JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*); - InternalFunction* asInternalFunction(JSValuePtr); + JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); - inline InternalFunction* asInternalFunction(JSValuePtr value) - { - ASSERT(asObject(value)->inherits(&InternalFunction::info)); - return static_cast(asObject(value)); - } + static CallType getCallData(JSCell*, CallData&); +}; + +InternalFunction* asInternalFunction(JSValue); + +inline InternalFunction* asInternalFunction(JSValue value) +{ + ASSERT(asObject(value)->inherits(InternalFunction::info())); + return static_cast(asObject(value)); +} } // namespace JSC