Add ParentClass typedef in all JSC classes

https://bugs.webkit.org/show_bug.cgi?id=65731

Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-08-09
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

Just added the Base typedefs in all the classes that are a subclass of JSCell
to point at their parent classes.  This is a change to support future changes to the way
constructors and destructors are implemented in JS objects, among other things.

* API/JSCallbackConstructor.h:
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
(JSC::JSCallbackObject::createStructure):
(JSC::JSCallbackObject::visitChildren):
* API/JSCallbackObjectFunctions.h:
(JSC::::asCallbackObject):
(JSC::::JSCallbackObject):
(JSC::::init):
(JSC::::className):
(JSC::::getOwnPropertySlot):
(JSC::::getOwnPropertyDescriptor):
(JSC::::put):
(JSC::::deleteProperty):
(JSC::::getConstructData):
(JSC::::construct):
(JSC::::hasInstance):
(JSC::::getCallData):
(JSC::::call):
(JSC::::getOwnPropertyNames):
(JSC::::toNumber):
(JSC::::toString):
(JSC::::setPrivate):
(JSC::::getPrivate):
(JSC::::inherits):
(JSC::::getStaticValue):
(JSC::::staticFunctionGetter):
(JSC::::callbackGetter):
* debugger/DebuggerActivation.h:
* jsc.cpp:
* runtime/Arguments.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.h:
* runtime/BooleanConstructor.h:
* runtime/BooleanObject.h:
* runtime/BooleanPrototype.h:
* runtime/DateConstructor.h:
* runtime/DateInstance.h:
* runtime/DatePrototype.h:
* runtime/Error.cpp:
* runtime/ErrorConstructor.h:
* runtime/ErrorInstance.h:
* runtime/ErrorPrototype.h:
* runtime/ExceptionHelpers.cpp:
* runtime/Executable.h:
* runtime/FunctionConstructor.h:
* runtime/FunctionPrototype.h:
* runtime/GetterSetter.h:
* runtime/InternalFunction.h:
* runtime/JSAPIValueWrapper.h:
* runtime/JSActivation.h:
* runtime/JSArray.h:
* runtime/JSFunction.h:
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.h:
* runtime/JSObject.h:
* runtime/JSPropertyNameIterator.h:
* runtime/JSStaticScopeObject.h:
* runtime/JSString.h:
* runtime/JSVariableObject.h:
* runtime/JSWrapperObject.h:
* runtime/MathObject.h:
* runtime/NativeErrorConstructor.h:
* runtime/NativeErrorPrototype.h:
* runtime/NumberConstructor.h:
* runtime/NumberObject.h:
* runtime/NumberPrototype.h:
* runtime/ObjectConstructor.h:
* runtime/ObjectPrototype.h:
* runtime/RegExp.h:
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.h:
* runtime/RegExpObject.h:
(JSC::RegExpObject::create):
* runtime/RegExpPrototype.h:
* runtime/ScopeChain.h:
* runtime/StrictEvalActivation.h:
* runtime/StringConstructor.h:
* runtime/StringObject.h:
* runtime/StringObjectThatMasqueradesAsUndefined.h:
* runtime/StringPrototype.h:
* runtime/Structure.h:
* runtime/StructureChain.h:

Source/JavaScriptGlue:

Just added the Base typedefs in all the classes that are a subclass of JSCell
to point at their parent classes.  This is a change to support future changes to the way
constructors and destructors are implemented in JS objects, among other things.

* JSRun.h:
* UserObjectImp.h:

Source/WebCore:

No new tests.

Just added the Base typedefs in all the classes that are a subclass of JSCell
to point at their parent classes.  This is a change to support future changes to the way
constructors and destructors are implemented in JS objects, among other things.

* bindings/js/JSAudioConstructor.h:
* bindings/js/JSImageConstructor.h:
* bindings/js/JSOptionConstructor.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateConstructorDeclaration):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bridge/c/CRuntimeObject.h:
* bridge/c/c_instance.cpp:
* bridge/jni/jsc/JavaInstanceJSC.cpp:
* bridge/jni/jsc/JavaRuntimeObject.h:
* bridge/objc/ObjCRuntimeObject.h:
* bridge/objc/objc_runtime.h:
* bridge/qt/qt_instance.cpp:
* bridge/qt/qt_pixmapruntime.cpp:
* bridge/qt/qt_runtime.h:
* bridge/runtime_array.h:
* bridge/runtime_method.h:
* bridge/runtime_object.h:
* bridge/testqtbindings.cpp:
(Global::className):

Source/WebKit/mac:

Just added the Base typedefs in all the classes that are a subclass of JSCell
to point at their parent classes.  This is a change to support future changes to the way
constructors and destructors are implemented in JS objects, among other things.

* Plugins/Hosted/ProxyInstance.mm:
* Plugins/Hosted/ProxyRuntimeObject.h:

Source/WebKit2:

Just added the Base typedefs in all the classes that are a subclass of JSCell
to point at their parent classes.  This is a change to support future changes to the way
constructors and destructors are implemented in JS objects, among other things.

* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 37ba767f
......@@ -32,9 +32,9 @@
namespace JSC {
class JSCallbackConstructor : public JSObjectWithGlobalObject {
protected:
JSCallbackConstructor(JSGlobalObject*, Structure*, JSClassRef, JSObjectCallAsConstructorCallback);
public:
typedef JSObjectWithGlobalObject Base;
static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback)
{
return new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
......@@ -51,6 +51,7 @@ public:
}
protected:
JSCallbackConstructor(JSGlobalObject*, Structure*, JSClassRef, JSObjectCallAsConstructorCallback);
static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
private:
......
......@@ -36,6 +36,8 @@ protected:
JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
public:
typedef InternalFunction Base;
static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
{
return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name);
......
......@@ -114,17 +114,19 @@ struct JSCallbackObjectData : WeakHandleOwner {
};
template <class Base>
class JSCallbackObject : public Base {
template <class Parent>
class JSCallbackObject : public Parent {
protected:
JSCallbackObject(ExecState*, JSGlobalObject*, Structure*, JSClassRef, void* data);
JSCallbackObject(JSGlobalData&, JSClassRef, Structure*);
// We'd like to use the placement version of operator new defined in JSCell, but
// we can't because Base is a template argument, so we just duplicate the same
// we can't because Parent is a template argument, so we just duplicate the same
// functionality here.
void* operator new(size_t, void* ptr) { return ptr; }
public:
typedef Parent Base;
static JSCallbackObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, void* data)
{
return new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, globalObject, structure, classRef, data);
......@@ -144,7 +146,7 @@ public:
static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
{
return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), Base::AnonymousSlotCount, &s_info);
return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), Parent::AnonymousSlotCount, &s_info);
}
JSValue getPrivateProperty(const Identifier& propertyName) const
......@@ -163,7 +165,7 @@ public:
}
protected:
static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags;
private:
virtual UString className() const;
......@@ -188,10 +190,10 @@ private:
virtual void visitChildren(SlotVisitor& visitor)
{
ASSERT_GC_OBJECT_INHERITS((static_cast<Base*>(this)), &JSCallbackObject<Base>::s_info);
ASSERT_GC_OBJECT_INHERITS((static_cast<Parent*>(this)), &JSCallbackObject<Parent>::s_info);
COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
ASSERT(Base::structure()->typeInfo().overridesVisitChildren());
Base::visitChildren(visitor);
ASSERT(Parent::structure()->typeInfo().overridesVisitChildren());
Parent::visitChildren(visitor);
m_callbackObjectData->visitChildren(visitor);
}
......
2011-08-09 Mark Hahnenberg <mhahnenberg@apple.com>
Add ParentClass typedef in all JSC classes
https://bugs.webkit.org/show_bug.cgi?id=65731
Reviewed by Oliver Hunt.
Just added the Base typedefs in all the classes that are a subclass of JSCell
to point at their parent classes. This is a change to support future changes to the way
constructors and destructors are implemented in JS objects, among other things.
* API/JSCallbackConstructor.h:
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
(JSC::JSCallbackObject::createStructure):
(JSC::JSCallbackObject::visitChildren):
* API/JSCallbackObjectFunctions.h:
(JSC::::asCallbackObject):
(JSC::::JSCallbackObject):
(JSC::::init):
(JSC::::className):
(JSC::::getOwnPropertySlot):
(JSC::::getOwnPropertyDescriptor):
(JSC::::put):
(JSC::::deleteProperty):
(JSC::::getConstructData):
(JSC::::construct):
(JSC::::hasInstance):
(JSC::::getCallData):
(JSC::::call):
(JSC::::getOwnPropertyNames):
(JSC::::toNumber):
(JSC::::toString):
(JSC::::setPrivate):
(JSC::::getPrivate):
(JSC::::inherits):
(JSC::::getStaticValue):
(JSC::::staticFunctionGetter):
(JSC::::callbackGetter):
* debugger/DebuggerActivation.h:
* jsc.cpp:
* runtime/Arguments.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.h:
* runtime/BooleanConstructor.h:
* runtime/BooleanObject.h:
* runtime/BooleanPrototype.h:
* runtime/DateConstructor.h:
* runtime/DateInstance.h:
* runtime/DatePrototype.h:
* runtime/Error.cpp:
* runtime/ErrorConstructor.h:
* runtime/ErrorInstance.h:
* runtime/ErrorPrototype.h:
* runtime/ExceptionHelpers.cpp:
* runtime/Executable.h:
* runtime/FunctionConstructor.h:
* runtime/FunctionPrototype.h:
* runtime/GetterSetter.h:
* runtime/InternalFunction.h:
* runtime/JSAPIValueWrapper.h:
* runtime/JSActivation.h:
* runtime/JSArray.h:
* runtime/JSFunction.h:
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.h:
* runtime/JSObject.h:
* runtime/JSPropertyNameIterator.h:
* runtime/JSStaticScopeObject.h:
* runtime/JSString.h:
* runtime/JSVariableObject.h:
* runtime/JSWrapperObject.h:
* runtime/MathObject.h:
* runtime/NativeErrorConstructor.h:
* runtime/NativeErrorPrototype.h:
* runtime/NumberConstructor.h:
* runtime/NumberObject.h:
* runtime/NumberPrototype.h:
* runtime/ObjectConstructor.h:
* runtime/ObjectPrototype.h:
* runtime/RegExp.h:
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.h:
* runtime/RegExpObject.h:
(JSC::RegExpObject::create):
* runtime/RegExpPrototype.h:
* runtime/ScopeChain.h:
* runtime/StrictEvalActivation.h:
* runtime/StringConstructor.h:
* runtime/StringObject.h:
* runtime/StringObjectThatMasqueradesAsUndefined.h:
* runtime/StringPrototype.h:
* runtime/Structure.h:
* runtime/StructureChain.h:
2011-08-08 Oliver Hunt <oliver@apple.com>
Using mprotect to create guard pages breaks our use of madvise to release executable memory
......
......@@ -34,6 +34,8 @@ namespace JSC {
class DebuggerActivation : public JSNonFinalObject {
public:
typedef JSNonFinalObject Base;
static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object)
{
return new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData, object);
......
......@@ -148,6 +148,8 @@ private:
GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
public:
typedef JSGlobalObject Base;
static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
{
return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
......
......@@ -59,6 +59,8 @@ namespace JSC {
class Arguments : public JSNonFinalObject {
public:
typedef JSNonFinalObject Base;
static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame)
{
return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
......
......@@ -28,10 +28,9 @@ namespace JSC {
class ArrayPrototype;
class ArrayConstructor : public InternalFunction {
private:
ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
public:
typedef InternalFunction Base;
static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrPrototype)
{
return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype);
......@@ -48,6 +47,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
......
......@@ -31,6 +31,8 @@ namespace JSC {
ArrayPrototype(JSGlobalObject*, Structure*);
public:
typedef JSArray Base;
static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
......
......@@ -28,16 +28,16 @@ namespace JSC {
class BooleanPrototype;
class BooleanConstructor : public InternalFunction {
private:
BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
public:
typedef InternalFunction Base;
static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* boolPrototype)
{
return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype);
}
private:
BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
......
......@@ -30,6 +30,8 @@ namespace JSC {
BooleanObject(JSGlobalData&, Structure*);
public:
typedef JSWrapperObject Base;
static BooleanObject* create(JSGlobalData& globalData, Structure* structure)
{
return new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
......
......@@ -26,10 +26,9 @@
namespace JSC {
class BooleanPrototype : public BooleanObject {
private:
BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
public:
typedef BooleanObject Base;
static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure);
......@@ -47,6 +46,7 @@ namespace JSC {
static const unsigned AnonymousSlotCount = BooleanObject::AnonymousSlotCount + 1;
private:
BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
};
......
......@@ -28,10 +28,9 @@ namespace JSC {
class DatePrototype;
class DateConstructor : public InternalFunction {
private:
DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
public:
typedef InternalFunction Base;
static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
{
return new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(exec, globalObject, structure, datePrototype);
......@@ -48,6 +47,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
......
......@@ -35,6 +35,8 @@ namespace JSC {
DateInstance(ExecState*, Structure*);
public:
typedef JSWrapperObject Base;
static DateInstance* create(ExecState* exec, Structure* structure, double date)
{
return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure, date);
......
......@@ -32,6 +32,8 @@ namespace JSC {
DatePrototype(ExecState*, JSGlobalObject*, Structure*);
public:
typedef DateInstance Base;
static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, globalObject, structure);
......
......@@ -174,6 +174,8 @@ private:
}
public:
typedef InternalFunction Base;
static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
{
return new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(exec, globalObject, structure, message);
......
......@@ -29,16 +29,16 @@ namespace JSC {
class ErrorPrototype;
class ErrorConstructor : public InternalFunction {
private:
ErrorConstructor(ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);
public:
typedef InternalFunction Base;
static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errPrototype)
{
return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype);
}
private:
ErrorConstructor(ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
......
......@@ -27,6 +27,8 @@ namespace JSC {
class ErrorInstance : public JSNonFinalObject {
public:
typedef JSNonFinalObject Base;
static const ClassInfo s_info;
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
......
......@@ -28,10 +28,9 @@ namespace JSC {
class ObjectPrototype;
class ErrorPrototype : public ErrorInstance {
protected:
ErrorPrototype(ExecState*, JSGlobalObject*, Structure*);
public:
typedef ErrorInstance Base;
static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, globalObject, structure);
......@@ -45,6 +44,7 @@ namespace JSC {
}
protected:
ErrorPrototype(ExecState*, JSGlobalObject*, Structure*);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ErrorInstance::StructureFlags;
static const unsigned AnonymousSlotCount = ErrorInstance::AnonymousSlotCount + 1;
......
......@@ -49,6 +49,8 @@ private:
}
public:
typedef JSNonFinalObject Base;
static InterruptedExecutionError* create(JSGlobalData& globalData)
{
return new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
......@@ -72,6 +74,8 @@ private:
}
public:
typedef JSNonFinalObject Base;
static TerminatedExecutionError* create(JSGlobalData& globalData)
{
return new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
......
......@@ -53,7 +53,6 @@ namespace JSC {
static const int NUM_PARAMETERS_IS_HOST = 0;
static const int NUM_PARAMETERS_NOT_COMPILED = -1;
protected:
ExecutableBase(JSGlobalData& globalData, Structure* structure, int numParameters)
: JSCell(globalData, structure)
, m_numParametersForCall(numParameters)
......@@ -66,6 +65,8 @@ namespace JSC {
}
public:
typedef JSCell Base;
static ExecutableBase* create(JSGlobalData& globalData, Structure* structure, int numParameters)
{
return new (allocateCell<ExecutableBase>(globalData.heap)) ExecutableBase(globalData, structure, numParameters);
......@@ -168,6 +169,8 @@ namespace JSC {
class NativeExecutable : public ExecutableBase {
friend class JIT;
public:
typedef ExecutableBase Base;
#if ENABLE(JIT)
static NativeExecutable* create(JSGlobalData& globalData, MacroAssemblerCodePtr callThunk, NativeFunction function, MacroAssemblerCodePtr constructThunk, NativeFunction constructor)
{
......@@ -219,6 +222,8 @@ namespace JSC {
class ScriptExecutable : public ExecutableBase {
public:
typedef ExecutableBase Base;
ScriptExecutable(Structure* structure, JSGlobalData& globalData, const SourceCode& source, bool isInStrictContext)
: ExecutableBase(globalData, structure, NUM_PARAMETERS_NOT_COMPILED)
, m_source(source)
......@@ -277,6 +282,7 @@ namespace JSC {
class EvalExecutable : public ScriptExecutable {
public:
typedef ScriptExecutable Base;
~EvalExecutable();
......@@ -326,6 +332,8 @@ namespace JSC {
class ProgramExecutable : public ScriptExecutable {
public:
typedef ScriptExecutable Base;
static ProgramExecutable* create(ExecState* exec, const SourceCode& source)
{
return new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
......@@ -379,6 +387,8 @@ namespace JSC {
class FunctionExecutable : public ScriptExecutable {
friend class JIT;
public:
typedef ScriptExecutable Base;
static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
{
return new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
......
......@@ -28,16 +28,16 @@ namespace JSC {
class FunctionPrototype;
class FunctionConstructor : public InternalFunction {
private:
FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
public:
typedef InternalFunction Base;
static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* funcPrototype)
{
return new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(exec, globalObject, structure, funcPrototype);
}
private:
FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
......
......@@ -26,10 +26,9 @@
namespace JSC {
class FunctionPrototype : public InternalFunction {
private:
FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
public:
typedef InternalFunction Base;
static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(exec, globalObject, structure);
......@@ -43,6 +42,7 @@ namespace JSC {
}
private:
FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
virtual CallType getCallData(CallData&);
};
......
......@@ -44,6 +44,8 @@ namespace JSC {
}
public:
typedef JSCell Base;
static GetterSetter* create(ExecState* exec)
{
return new (allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
......
......@@ -33,6 +33,8 @@ namespace JSC {
class InternalFunction : public JSObjectWithGlobalObject {
public:
typedef JSObjectWithGlobalObject Base;
static JS_EXPORTDATA const ClassInfo s_info;
const UString& name(ExecState*);
......
......@@ -32,6 +32,8 @@ namespace JSC {
class JSAPIValueWrapper : public JSCell {
friend JSValue jsAPIValueWrapper(ExecState*, JSValue);
public:
typedef JSCell Base;
JSValue value() const { return m_value.get(); }
virtual bool isAPIValueWrapper() const { return true; }
......
......@@ -41,10 +41,11 @@ namespace JSC {
class JSActivation : public JSVariableObject {
private:
typedef JSVariableObject Base;
JSActivation(CallFrame*, FunctionExecutable*);
public:
typedef JSVariableObject Base;
static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec)
{
return new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
......
......@@ -66,6 +66,8 @@ namespace JSC {
JSArray(JSGlobalData&, Structure*, const ArgList& initialValues);
public:
typedef JSNonFinalObject Base;
JSArray(VPtrStealingHackType);
virtual ~JSArray();
......
......@@ -46,13 +46,13 @@ namespace JSC {
friend class DFG::JITCodeGenerator;
friend class JSGlobalData;
typedef JSObjectWithGlobalObject Base;
JSFunction(ExecState*, JSGlobalObject*, Structure*, int length, const Identifier&, NativeFunction);
JSFunction(ExecState*, JSGlobalObject*, Structure*, int length, const Identifier&, NativeExecutable*);
JSFunction(ExecState*, FunctionExecutable*, ScopeChainNode*);
public:
typedef JSObjectWithGlobalObject Base;
static JSFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, int length, const Identifier& ident, NativeFunction nativeFunc)
{
return new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, structure, length, ident, nativeFunc);
......