InternalFunction.h [plain text]
#ifndef InternalFunction_h
#define InternalFunction_h
#include "Identifier.h"
#include "JSDestructibleObject.h"
namespace JSC {
class FunctionPrototype;
class InternalFunction : public JSDestructibleObject {
public:
typedef JSDestructibleObject Base;
static const unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance | ImplementsDefaultHasInstance | TypeOfShouldCallGetCallData;
DECLARE_EXPORT_INFO;
JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
JS_EXPORT_PRIVATE const String& name();
const String displayName(VM&);
const String calculatedDisplayName(VM&);
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
{
return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info());
}
JS_EXPORT_PRIVATE static Structure* createSubclassStructure(ExecState*, JSValue newTarget, Structure*);
protected:
JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*);
JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name);
static CallType getCallData(JSCell*, CallData&);
WriteBarrier<JSString> m_originalName;
};
InternalFunction* asInternalFunction(JSValue);
inline InternalFunction* asInternalFunction(JSValue value)
{
ASSERT(asObject(value)->inherits(InternalFunction::info()));
return static_cast<InternalFunction*>(asObject(value));
}
}
#endif // InternalFunction_h