X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index 532bd0c..8b0d09f 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -24,45 +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 JSNonFinalObject { - public: - typedef JSNonFinalObject Base; +class InternalFunction : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + static const unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance | TypeOfShouldCallGetCallData; - static JS_EXPORTDATA const ClassInfo s_info; + DECLARE_EXPORT_INFO; - JS_EXPORT_PRIVATE const UString& name(ExecState*); - const UString displayName(ExecState*); - const UString calculatedDisplayName(ExecState*); + JS_EXPORT_PRIVATE const String& name(ExecState*); + const String displayName(ExecState*); + const String calculatedDisplayName(ExecState*); - static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) - { - return Structure::create(globalData, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); - } - - 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()); + } - JS_EXPORT_PRIVATE InternalFunction(JSGlobalObject*, Structure*); +protected: + JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*); - JS_EXPORT_PRIVATE void finishCreation(JSGlobalData&, const Identifier& name); + JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); - static CallType getCallData(JSCell*, CallData&); - }; + 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