X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..a253471d7f8e4d91bf6ebabab00155c3b387d3d0:/runtime/InternalFunction.h diff --git a/runtime/InternalFunction.h b/runtime/InternalFunction.h index cc4b917..532bd0c 100644 --- a/runtime/InternalFunction.h +++ b/runtime/InternalFunction.h @@ -31,31 +31,36 @@ namespace JSC { class FunctionPrototype; - class InternalFunction : public JSObject { + class InternalFunction : public JSNonFinalObject { public: - virtual const ClassInfo* classInfo() const; - static const ClassInfo info; + typedef JSNonFinalObject Base; - const UString& name(JSGlobalData*); + static JS_EXPORTDATA const ClassInfo s_info; - static PassRefPtr createStructure(JSValuePtr 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(JSValuePtr); + InternalFunction* asInternalFunction(JSValue); - inline InternalFunction* asInternalFunction(JSValuePtr value) + inline InternalFunction* asInternalFunction(JSValue value) { - ASSERT(asObject(value)->inherits(&InternalFunction::info)); + ASSERT(asObject(value)->inherits(&InternalFunction::s_info)); return static_cast(asObject(value)); }