X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index 310644c..8b0d09f 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -24,42 +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 JS_EXPORTDATA const ClassInfo info; +class InternalFunction : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + static const unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance | TypeOfShouldCallGetCallData; - const UString& name(JSGlobalData*); - const UString displayName(JSGlobalData*); - const UString calculatedDisplayName(JSGlobalData*); + DECLARE_EXPORT_INFO; - static PassRefPtr createStructure(JSValue 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(JSValue); + JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); - inline InternalFunction* asInternalFunction(JSValue 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