class JSActivation;
class JSGlobalObject;
class NativeExecutable;
+ class VPtrHackExecutable;
EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState*);
typedef JSObjectWithGlobalObject Base;
public:
- JSFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction);
-#if ENABLE(JIT)
- JSFunction(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, int length, const Identifier&, PassRefPtr<NativeExecutable>);
-#endif
- JSFunction(ExecState*, NonNullPassRefPtr<FunctionExecutable>, ScopeChainNode*);
+ JSFunction(ExecState*, JSGlobalObject*, Structure*, int length, const Identifier&, NativeFunction);
+ JSFunction(ExecState*, JSGlobalObject*, Structure*, int length, const Identifier&, NativeExecutable*);
+ JSFunction(ExecState*, FunctionExecutable*, ScopeChainNode*);
virtual ~JSFunction();
const UString& name(ExecState*);
const UString displayName(ExecState*);
const UString calculatedDisplayName(ExecState*);
- ScopeChain& scope()
+ ScopeChainNode* scope()
{
ASSERT(!isHostFunctionNonInline());
- return m_scopeChain;
+ return m_scopeChain.get();
}
- void setScope(const ScopeChain& scopeChain)
+ void setScope(JSGlobalData& globalData, ScopeChainNode* scopeChain)
{
ASSERT(!isHostFunctionNonInline());
- m_scopeChain = scopeChain;
+ m_scopeChain.set(globalData, this, scopeChain);
}
ExecutableBase* executable() const { return m_executable.get(); }
inline bool isHostFunction() const;
FunctionExecutable* jsExecutable() const;
- static JS_EXPORTDATA const ClassInfo info;
+ static JS_EXPORTDATA const ClassInfo s_info;
- static PassRefPtr<Structure> createStructure(JSValue prototype)
+ static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
- return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
+ return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
NativeFunction nativeFunction();
const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
private:
- JSFunction(NonNullPassRefPtr<Structure>);
+ explicit JSFunction(VPtrStealingHackType);
bool isHostFunctionNonInline() const;
virtual void markChildren(MarkStack&);
- virtual const ClassInfo* classInfo() const { return &info; }
-
static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
static JSValue callerGetter(ExecState*, JSValue, const Identifier&);
static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
- RefPtr<ExecutableBase> m_executable;
- ScopeChain m_scopeChain;
+ WriteBarrier<ExecutableBase> m_executable;
+ WriteBarrier<ScopeChainNode> m_scopeChain;
};
JSFunction* asFunction(JSValue);
inline JSFunction* asFunction(JSValue value)
{
- ASSERT(asObject(value)->inherits(&JSFunction::info));
+ ASSERT(asObject(value)->inherits(&JSFunction::s_info));
return static_cast<JSFunction*>(asObject(value));
}