X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..1981f5dfe8d77d97469d20652f712a09400c48ed:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index 310644c..532bd0c 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -31,33 +31,36 @@ namespace JSC { class FunctionPrototype; - class InternalFunction : public JSObject { + class InternalFunction : public JSNonFinalObject { public: - virtual const ClassInfo* classInfo() const; - static JS_EXPORTDATA const ClassInfo info; + typedef JSNonFinalObject Base; - const UString& name(JSGlobalData*); - const UString displayName(JSGlobalData*); - const UString calculatedDisplayName(JSGlobalData*); + static JS_EXPORTDATA const ClassInfo s_info; - static PassRefPtr createStructure(JSValue proto) + JS_EXPORT_PRIVATE const UString& name(ExecState*); + const UString displayName(ExecState*); + const UString calculatedDisplayName(ExecState*); + + static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) { - return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot)); + return Structure::create(globalData, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); } protected: - InternalFunction(PassRefPtr structure) : JSObject(structure) { } - InternalFunction(JSGlobalData*, PassRefPtr, const Identifier&); + static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; + + JS_EXPORT_PRIVATE InternalFunction(JSGlobalObject*, Structure*); + + JS_EXPORT_PRIVATE void finishCreation(JSGlobalData&, const Identifier& name); - private: - virtual CallType getCallData(CallData&) = 0; + static CallType getCallData(JSCell*, CallData&); }; InternalFunction* asInternalFunction(JSValue); inline InternalFunction* asInternalFunction(JSValue value) { - ASSERT(asObject(value)->inherits(&InternalFunction::info)); + ASSERT(asObject(value)->inherits(&InternalFunction::s_info)); return static_cast(asObject(value)); }