X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index d19b82b..8b0d09f 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -24,44 +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(ExecState*); - const UString displayName(ExecState*); - const UString calculatedDisplayName(ExecState*); + DECLARE_EXPORT_INFO; - static PassRefPtr createStructure(JSValue proto) - { - return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); - } + JS_EXPORT_PRIVATE const String& name(ExecState*); + const String displayName(ExecState*); + const String calculatedDisplayName(ExecState*); - protected: - static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) + { + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); + } - InternalFunction(NonNullPassRefPtr structure) : JSObject(structure) { } - InternalFunction(JSGlobalData*, NonNullPassRefPtr, const Identifier&); +protected: + JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*); - private: - virtual CallType getCallData(CallData&) = 0; - }; + JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); - InternalFunction* asInternalFunction(JSValue); + static CallType getCallData(JSCell*, CallData&); +}; - inline InternalFunction* asInternalFunction(JSValue value) - { - ASSERT(asObject(value)->inherits(&InternalFunction::info)); - return static_cast(asObject(value)); - } +InternalFunction* asInternalFunction(JSValue); + +inline InternalFunction* asInternalFunction(JSValue value) +{ + ASSERT(asObject(value)->inherits(InternalFunction::info())); + return static_cast(asObject(value)); +} } // namespace JSC