X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index 28e260e..8b0d09f 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -24,47 +24,44 @@ #ifndef InternalFunction_h #define InternalFunction_h -#include "JSObjectWithGlobalObject.h" #include "Identifier.h" +#include "JSDestructibleObject.h" namespace JSC { - class FunctionPrototype; +class FunctionPrototype; - class InternalFunction : public JSObjectWithGlobalObject { - public: - static JS_EXPORTDATA const ClassInfo s_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 Structure* createStructure(JSGlobalData& globalData, JSValue proto) - { - return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); - } + JS_EXPORT_PRIVATE const String& name(ExecState*); + const String displayName(ExecState*); + const String calculatedDisplayName(ExecState*); - protected: - static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; - - // Only used to allow us to determine the JSFunction vptr - InternalFunction(VPtrStealingHackType); + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) + { + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); + } - InternalFunction(JSGlobalData*, JSGlobalObject*, Structure*, const Identifier&); +protected: + JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*); - private: - virtual CallType getCallData(CallData&) = 0; + JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); - virtual void vtableAnchor(); - }; + static CallType getCallData(JSCell*, CallData&); +}; - InternalFunction* asInternalFunction(JSValue); +InternalFunction* asInternalFunction(JSValue); - inline InternalFunction* asInternalFunction(JSValue value) - { - ASSERT(asObject(value)->inherits(&InternalFunction::s_info)); - return static_cast(asObject(value)); - } +inline InternalFunction* asInternalFunction(JSValue value) +{ + ASSERT(asObject(value)->inherits(InternalFunction::info())); + return static_cast(asObject(value)); +} } // namespace JSC