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);
}
protected:
+ JSCallbackConstructor(JSGlobalObject*, Structure*, JSClassRef, JSObjectCallAsConstructorCallback);
static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
private:
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);
};
-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);
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
}
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;
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);
}
namespace JSC {
-template <class Base>
-inline JSCallbackObject<Base>* JSCallbackObject<Base>::asCallbackObject(JSValue value)
+template <class Parent>
+inline JSCallbackObject<Parent>* JSCallbackObject<Parent>::asCallbackObject(JSValue value)
{
ASSERT(asObject(value)->inherits(&s_info));
return static_cast<JSCallbackObject*>(asObject(value));
}
-template <class Base>
-JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, void* data)
- : Base(globalObject, structure)
+template <class Parent>
+JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, void* data)
+ : Parent(globalObject, structure)
, m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass)))
{
- ASSERT(Base::inherits(&s_info));
+ ASSERT(Parent::inherits(&s_info));
init(exec);
}
// Global object constructor.
// FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one.
-template <class Base>
-JSCallbackObject<Base>::JSCallbackObject(JSGlobalData& globalData, JSClassRef jsClass, Structure* structure)
- : Base(globalData, structure)
+template <class Parent>
+JSCallbackObject<Parent>::JSCallbackObject(JSGlobalData& globalData, JSClassRef jsClass, Structure* structure)
+ : Parent(globalData, structure)
, m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass)))
{
- ASSERT(Base::inherits(&s_info));
- ASSERT(Base::isGlobalObject());
+ ASSERT(Parent::inherits(&s_info));
+ ASSERT(Parent::isGlobalObject());
init(static_cast<JSGlobalObject*>(this)->globalExec());
}
-template <class Base>
-void JSCallbackObject<Base>::init(ExecState* exec)
+template <class Parent>
+void JSCallbackObject<Parent>::init(ExecState* exec)
{
ASSERT(exec);
}
}
-template <class Base>
-UString JSCallbackObject<Base>::className() const
+template <class Parent>
+UString JSCallbackObject<Parent>::className() const
{
UString thisClassName = classRef()->className();
if (!thisClassName.isEmpty())
return thisClassName;
- return Base::className();
+ return Parent::className();
}
-template <class Base>
-bool JSCallbackObject<Base>::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+template <class Parent>
+bool JSCallbackObject<Parent>::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
JSContextRef ctx = toRef(exec);
JSObjectRef thisRef = toRef(this);
}
}
- return Base::getOwnPropertySlot(exec, propertyName, slot);
+ return Parent::getOwnPropertySlot(exec, propertyName, slot);
}
-template <class Base>
-bool JSCallbackObject<Base>::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+template <class Parent>
+bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
PropertySlot slot;
if (getOwnPropertySlot(exec, propertyName, slot)) {
return true;
}
- return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
+ return Parent::getOwnPropertyDescriptor(exec, propertyName, descriptor);
}
-template <class Base>
-void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
+template <class Parent>
+void JSCallbackObject<Parent>::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
JSContextRef ctx = toRef(exec);
JSObjectRef thisRef = toRef(this);
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeReadOnly)
return;
- JSCallbackObject<Base>::putDirect(exec->globalData(), propertyName, value); // put as override property
+ JSCallbackObject<Parent>::putDirect(exec->globalData(), propertyName, value); // put as override property
return;
}
}
}
- return Base::put(exec, propertyName, value, slot);
+ return Parent::put(exec, propertyName, value, slot);
}
-template <class Base>
-bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, const Identifier& propertyName)
+template <class Parent>
+bool JSCallbackObject<Parent>::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
JSContextRef ctx = toRef(exec);
JSObjectRef thisRef = toRef(this);
}
}
- return Base::deleteProperty(exec, propertyName);
+ return Parent::deleteProperty(exec, propertyName);
}
-template <class Base>
-bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, unsigned propertyName)
+template <class Parent>
+bool JSCallbackObject<Parent>::deleteProperty(ExecState* exec, unsigned propertyName)
{
return deleteProperty(exec, Identifier::from(exec, propertyName));
}
-template <class Base>
-ConstructType JSCallbackObject<Base>::getConstructData(ConstructData& constructData)
+template <class Parent>
+ConstructType JSCallbackObject<Parent>::getConstructData(ConstructData& constructData)
{
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
if (jsClass->callAsConstructor) {
return ConstructTypeNone;
}
-template <class Base>
-EncodedJSValue JSCallbackObject<Base>::construct(ExecState* exec)
+template <class Parent>
+EncodedJSValue JSCallbackObject<Parent>::construct(ExecState* exec)
{
JSObject* constructor = exec->callee();
JSContextRef execRef = toRef(exec);
JSObjectRef constructorRef = toRef(constructor);
- for (JSClassRef jsClass = static_cast<JSCallbackObject<Base>*>(constructor)->classRef(); jsClass; jsClass = jsClass->parentClass) {
+ for (JSClassRef jsClass = static_cast<JSCallbackObject<Parent>*>(constructor)->classRef(); jsClass; jsClass = jsClass->parentClass) {
if (JSObjectCallAsConstructorCallback callAsConstructor = jsClass->callAsConstructor) {
int argumentCount = static_cast<int>(exec->argumentCount());
Vector<JSValueRef, 16> arguments(argumentCount);
return JSValue::encode(JSValue());
}
-template <class Base>
-bool JSCallbackObject<Base>::hasInstance(ExecState* exec, JSValue value, JSValue)
+template <class Parent>
+bool JSCallbackObject<Parent>::hasInstance(ExecState* exec, JSValue value, JSValue)
{
JSContextRef execRef = toRef(exec);
JSObjectRef thisRef = toRef(this);
return false;
}
-template <class Base>
-CallType JSCallbackObject<Base>::getCallData(CallData& callData)
+template <class Parent>
+CallType JSCallbackObject<Parent>::getCallData(CallData& callData)
{
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
if (jsClass->callAsFunction) {
return CallTypeNone;
}
-template <class Base>
-EncodedJSValue JSCallbackObject<Base>::call(ExecState* exec)
+template <class Parent>
+EncodedJSValue JSCallbackObject<Parent>::call(ExecState* exec)
{
JSContextRef execRef = toRef(exec);
JSObjectRef functionRef = toRef(exec->callee());
JSObjectRef thisObjRef = toRef(exec->hostThisValue().toThisObject(exec));
- for (JSClassRef jsClass = static_cast<JSCallbackObject<Base>*>(toJS(functionRef))->classRef(); jsClass; jsClass = jsClass->parentClass) {
+ for (JSClassRef jsClass = static_cast<JSCallbackObject<Parent>*>(toJS(functionRef))->classRef(); jsClass; jsClass = jsClass->parentClass) {
if (JSObjectCallAsFunctionCallback callAsFunction = jsClass->callAsFunction) {
int argumentCount = static_cast<int>(exec->argumentCount());
Vector<JSValueRef, 16> arguments(argumentCount);
return JSValue::encode(JSValue());
}
-template <class Base>
-void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+template <class Parent>
+void JSCallbackObject<Parent>::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSContextRef execRef = toRef(exec);
JSObjectRef thisRef = toRef(this);
}
}
- Base::getOwnPropertyNames(exec, propertyNames, mode);
+ Parent::getOwnPropertyNames(exec, propertyNames, mode);
}
-template <class Base>
-double JSCallbackObject<Base>::toNumber(ExecState* exec) const
+template <class Parent>
+double JSCallbackObject<Parent>::toNumber(ExecState* exec) const
{
// We need this check to guard against the case where this object is rhs of
// a binary expression where lhs threw an exception in its conversion to
return toJS(exec, value).getNumber(dValue) ? dValue : std::numeric_limits<double>::quiet_NaN();
}
- return Base::toNumber(exec);
+ return Parent::toNumber(exec);
}
-template <class Base>
-UString JSCallbackObject<Base>::toString(ExecState* exec) const
+template <class Parent>
+UString JSCallbackObject<Parent>::toString(ExecState* exec) const
{
JSContextRef ctx = toRef(exec);
JSObjectRef thisRef = toRef(this);
return toJS(exec, value).getString(exec);
}
- return Base::toString(exec);
+ return Parent::toString(exec);
}
-template <class Base>
-void JSCallbackObject<Base>::setPrivate(void* data)
+template <class Parent>
+void JSCallbackObject<Parent>::setPrivate(void* data)
{
m_callbackObjectData->privateData = data;
}
-template <class Base>
-void* JSCallbackObject<Base>::getPrivate()
+template <class Parent>
+void* JSCallbackObject<Parent>::getPrivate()
{
return m_callbackObjectData->privateData;
}
-template <class Base>
-bool JSCallbackObject<Base>::inherits(JSClassRef c) const
+template <class Parent>
+bool JSCallbackObject<Parent>::inherits(JSClassRef c) const
{
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass)
if (jsClass == c)
return false;
}
-template <class Base>
-JSValue JSCallbackObject<Base>::getStaticValue(ExecState* exec, const Identifier& propertyName)
+template <class Parent>
+JSValue JSCallbackObject<Parent>::getStaticValue(ExecState* exec, const Identifier& propertyName)
{
JSObjectRef thisRef = toRef(this);
RefPtr<OpaqueJSString> propertyNameRef;
return JSValue();
}
-template <class Base>
-JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
+template <class Parent>
+JSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, JSValue slotParent, const Identifier& propertyName)
{
- JSCallbackObject* thisObj = asCallbackObject(slotBase);
+ JSCallbackObject* thisObj = asCallbackObject(slotParent);
// Check for cached or override property.
PropertySlot slot2(thisObj);
- if (thisObj->Base::getOwnPropertySlot(exec, propertyName, slot2))
+ if (thisObj->Parent::getOwnPropertySlot(exec, propertyName, slot2))
return slot2.getValue(exec, propertyName);
for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) {
return throwError(exec, createReferenceError(exec, "Static function property defined with NULL callAsFunction callback."));
}
-template <class Base>
-JSValue JSCallbackObject<Base>::callbackGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
+template <class Parent>
+JSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, JSValue slotParent, const Identifier& propertyName)
{
- JSCallbackObject* thisObj = asCallbackObject(slotBase);
+ JSCallbackObject* thisObj = asCallbackObject(slotParent);
JSObjectRef thisRef = toRef(thisObj);
RefPtr<OpaqueJSString> propertyNameRef;
+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
class DebuggerActivation : public JSNonFinalObject {
public:
+ typedef JSNonFinalObject Base;
+
static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object)
{
return new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData, object);
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);
class Arguments : public JSNonFinalObject {
public:
+ typedef JSNonFinalObject Base;
+
static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame)
{
return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
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);
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&);
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);
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&);
};
BooleanObject(JSGlobalData&, Structure*);
public:
+ typedef JSWrapperObject Base;
+
static BooleanObject* create(JSGlobalData& globalData, Structure* structure)
{
return new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
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);
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&);
};
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);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
+ DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
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);
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);
}
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);
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&);
};
class ErrorInstance : public JSNonFinalObject {
public:
+ typedef JSNonFinalObject Base;
+
static const ClassInfo s_info;
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
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);
}
protected:
+ ErrorPrototype(ExecState*, JSGlobalObject*, Structure*);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ErrorInstance::StructureFlags;
static const unsigned AnonymousSlotCount = ErrorInstance::AnonymousSlotCount + 1;
}
public:
+ typedef JSNonFinalObject Base;
+
static InterruptedExecutionError* create(JSGlobalData& globalData)
{
return new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
}
public:
+ typedef JSNonFinalObject Base;
+
static TerminatedExecutionError* create(JSGlobalData& globalData)
{
return new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
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)
}
public:
+ typedef JSCell Base;
+
static ExecutableBase* create(JSGlobalData& globalData, Structure* structure, int numParameters)
{
return new (allocateCell<ExecutableBase>(globalData.heap)) ExecutableBase(globalData, structure, numParameters);
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)
{
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)
class EvalExecutable : public ScriptExecutable {
public:
+ typedef ScriptExecutable Base;
~EvalExecutable();
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);
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);
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&);
};
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);
}
private:
+ FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
virtual CallType getCallData(CallData&);
};
}
public:
+ typedef JSCell Base;
+
static GetterSetter* create(ExecState* exec)
{
return new (allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
class InternalFunction : public JSObjectWithGlobalObject {
public:
+ typedef JSObjectWithGlobalObject Base;
+
static JS_EXPORTDATA const ClassInfo s_info;
const UString& name(ExecState*);
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; }
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);
JSArray(JSGlobalData&, Structure*, const ArgList& initialValues);
public:
+ typedef JSNonFinalObject Base;
+
JSArray(VPtrStealingHackType);
virtual ~JSArray();
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);
}
public:
+ typedef JSVariableObject Base;
+
static JSGlobalObject* create(JSGlobalData& globalData, Structure* structure)
{
return new (allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure);
}
public:
+ typedef JSNonFinalObject Base;
+
static JSNotAnObject* create(ExecState* exec)
{
return new (allocateCell<JSNotAnObject>(*exec->heap())) JSNotAnObject(exec);
class Stringifier;
class JSONObject : public JSObjectWithGlobalObject {
- private:
- JSONObject(JSGlobalObject*, Structure*);
-
public:
+ typedef JSObjectWithGlobalObject Base;
+
static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
private:
+ JSONObject(JSGlobalObject*, Structure*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
friend void setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot);
public:
+ typedef JSCell Base;
+
virtual void visitChildren(SlotVisitor&);
ALWAYS_INLINE void visitChildrenDirect(SlotVisitor&);
friend class JSObject;
public:
+ typedef JSObject Base;
+
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
friend class JSObject;
public:
+ typedef JSObject Base;
+
explicit JSFinalObject(VPtrStealingHackType)
: JSObject(VPtrStealingHack, m_inlineStorage)
{
friend class JIT;
public:
+ typedef JSCell Base;
+
static JSPropertyNameIterator* create(ExecState*, JSObject*);
static JSPropertyNameIterator* create(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlot)
{
class JSStaticScopeObject : public JSVariableObject {
public:
+ typedef JSVariableObject Base;
+
static JSStaticScopeObject* create(ExecState* exec, const Identifier& ident, JSValue value, unsigned attributes)
{
return new (allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec, ident, value, attributes);
friend class SpecializedThunkJIT;
friend struct ThunkHelpers;
+ typedef JSCell Base;
+
class RopeBuilder {
public:
RopeBuilder(unsigned fiberCount)
friend class JIT;
public:
+ typedef JSNonFinalObject Base;
+
SymbolTable& symbolTable() const { return *m_symbolTable; }
virtual void putWithAttributes(ExecState*, const Identifier&, JSValue, unsigned attributes) = 0;
// This class is used as a base for classes such as String,
// Number, Boolean and Date which are wrappers for primitive types.
class JSWrapperObject : public JSNonFinalObject {
- protected:
- explicit JSWrapperObject(JSGlobalData&, Structure*);
-
public:
+ typedef JSNonFinalObject Base;
+
JSValue internalValue() const;
void setInternalValue(JSGlobalData&, JSValue);
}
protected:
+ explicit JSWrapperObject(JSGlobalData&, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
private:
MathObject(ExecState*, JSGlobalObject*, Structure*);
public:
+ typedef JSObjectWithGlobalObject Base;
+
static MathObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<MathObject>(*exec->heap())) MathObject(exec, globalObject, structure);
class NativeErrorPrototype;
class NativeErrorConstructor : public InternalFunction {
- private:
- NativeErrorConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);
-
public:
+ typedef InternalFunction Base;
+
static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& nameAndMessage)
{
return new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(exec, globalObject, structure, prototypeStructure, nameAndMessage);
Structure* errorStructure() { return m_errorStructure.get(); }
private:
+ NativeErrorConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);
static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
public:
+ typedef ErrorPrototype Base;
+
static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
{
return new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, globalObject, structure, nameAndMessage, constructor);
class NumberPrototype;
class NumberConstructor : public InternalFunction {
- private:
- NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
-
public:
+ typedef InternalFunction Base;
+
static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numPrototype)
{
return new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(exec, globalObject, structure, numPrototype);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
private:
+ NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
NumberObject(JSGlobalData&, Structure*);
public:
+ typedef JSWrapperObject Base;
+
static NumberObject* create(JSGlobalData& globalData, Structure* structure)
{
return new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
namespace JSC {
class NumberPrototype : public NumberObject {
- private:
- NumberPrototype(ExecState*, JSGlobalObject*, Structure*);
-
public:
+ typedef NumberObject Base;
+
static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, globalObject, structure);
static const unsigned AnonymousSlotCount = NumberObject::AnonymousSlotCount + 1;
private:
+ NumberPrototype(ExecState*, JSGlobalObject*, Structure*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
};
class ObjectPrototype;
class ObjectConstructor : public InternalFunction {
- private:
- ObjectConstructor(ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);
-
public:
+ typedef InternalFunction Base;
+
static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objPrototype)
{
return new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(exec, globalObject, structure, objPrototype);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
+ ObjectConstructor(ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
namespace JSC {
class ObjectPrototype : public JSNonFinalObject {
- private:
- ObjectPrototype(ExecState*, JSGlobalObject*, Structure*);
-
public:
+ typedef JSNonFinalObject Base;
+
static ObjectPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, globalObject, structure);
static const unsigned AnonymousSlotCount = JSNonFinalObject::AnonymousSlotCount + 1;
private:
+ ObjectPrototype(ExecState*, JSGlobalObject*, Structure*);
virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
class RegExp : public JSCell {
public:
+ typedef JSCell Base;
+
static RegExp* create(JSGlobalData&, const UString& pattern, RegExpFlags);
~RegExp();
};
class RegExpConstructor : public InternalFunction {
- private:
- RegExpConstructor(ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);
-
public:
+ typedef InternalFunction Base;
+
static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
{
return new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(exec, globalObject, structure, regExpPrototype);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
private:
+ RegExpConstructor(ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
RegExpMatchesArray(ExecState*, RegExpConstructorPrivate*);
public:
+ typedef JSArray Base;
+
static RegExpMatchesArray* create(ExecState* exec, RegExpConstructorPrivate* ctorPrivate)
{
return new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec, ctorPrivate);
namespace JSC {
class RegExpObject : public JSObjectWithGlobalObject {
- protected:
- RegExpObject(JSGlobalObject*, Structure*, RegExp*);
-
public:
+ typedef JSObjectWithGlobalObject Base;
+
static RegExpObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
{
return new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp);
{
return new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp);
}
-
- typedef JSObjectWithGlobalObject Base;
virtual ~RegExpObject();
}
protected:
+ RegExpObject(JSGlobalObject*, Structure*, RegExp*);
static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | JSObjectWithGlobalObject::StructureFlags;
private:
namespace JSC {
class RegExpPrototype : public RegExpObject {
- protected:
- RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, RegExp*);
-
public:
+ typedef RegExpObject Base;
+
static RegExpPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
{
return new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(exec, globalObject, structure, regExp);
}
protected:
+ RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, RegExp*);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | RegExpObject::StructureFlags;
private:
}
public:
+ typedef JSCell Base;
+
static ScopeChainNode* create(ExecState* exec, ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
{
return new (allocateCell<ScopeChainNode>(*exec->heap())) ScopeChainNode(next, object, globalData, globalObject, globalThis);
class StrictEvalActivation : public JSNonFinalObject {
public:
+ typedef JSNonFinalObject Base;
+
static StrictEvalActivation* create(ExecState* exec)
{
return new (allocateCell<StrictEvalActivation>(*exec->heap())) StrictEvalActivation(exec);
class StringPrototype;
class StringConstructor : public InternalFunction {
- private:
- StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
-
public:
+ typedef InternalFunction Base;
+
static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* strPrototype)
{
return new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(exec, globalObject, structure, strPrototype);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
+ StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
namespace JSC {
class StringObject : public JSWrapperObject {
- protected:
- StringObject(ExecState*, Structure*);
- StringObject(ExecState*, Structure*, const UString&);
-
public:
+ typedef JSWrapperObject Base;
+
static StringObject* create(ExecState* exec, Structure* structure)
{
return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec, structure);
}
protected:
+ StringObject(ExecState*, Structure*);
+ StringObject(ExecState*, Structure*, const UString&);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
StringObject(JSGlobalData&, Structure*, JSString*);
};
// WebCore uses this to make style.filter undetectable
class StringObjectThatMasqueradesAsUndefined : public StringObject {
public:
+ typedef StringObject Base;
+
static StringObjectThatMasqueradesAsUndefined* create(ExecState* exec, const UString& string)
{
return new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec,
StringPrototype(ExecState*, JSGlobalObject*, Structure*);
public:
+ typedef StringObject Base;
+
static StringPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, globalObject, structure);
class Structure : public JSCell {
public:
friend class StructureTransitionTable;
+
+ typedef JSCell Base;
+
static Structure* create(JSGlobalData& globalData, JSValue prototype, const TypeInfo& typeInfo, unsigned anonymousSlotCount, const ClassInfo* classInfo)
{
ASSERT(globalData.structureStructure);
friend class JIT;
public:
+ typedef JSCell Base;
+
static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (allocateCell<StructureChain>(globalData.heap)) StructureChain(globalData, globalData.structureChainStructure.get(), head); }
WriteBarrier<Structure>* head() { return m_vector.get(); }
void visitChildren(SlotVisitor&);
+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.
+
+ * JSRun.h:
+ * UserObjectImp.h:
+
2011-08-04 Mark Rowe <mrowe@apple.com>
Future-proof Xcode configuration settings.
class JSGlueGlobalObject : public JSGlobalObject {
public:
+ typedef JSGlobalObject Base;
+
static JSGlueGlobalObject* create(JSGlobalData& globalData, Structure* structure, JSFlags flags = kJSFlagNone)
{
return new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, flags);
class UserObjectImp : public JSNonFinalObject {
public:
+ typedef JSNonFinalObject Base;
+
static UserObjectImp* create(JSGlobalData& globalData, Structure* structure, JSUserObject* userObject)
{
return new (allocateCell<UserObjectImp>(globalData.heap)) UserObjectImp(globalData, structure, userObject);
+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.
+
+ 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):
+
2011-08-09 Alexei Svitkine <asvitkine@chromium.org>
[Chromium] Enable rubber banding when scrolling.
class JSAudioConstructor : public DOMConstructorWithDocument {
public:
+ typedef DOMConstructorWithDocument Base;
+
static JSAudioConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSAudioConstructor>(*exec->heap())) JSAudioConstructor(exec, structure, globalObject);
class JSImageConstructor : public DOMConstructorWithDocument {
public:
+ typedef DOMConstructorWithDocument Base;
+
static JSImageConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(exec, structure, globalObject);
class JSOptionConstructor : public DOMConstructorWithDocument {
public:
+ typedef DOMConstructorWithDocument Base;
+
static JSOptionConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSOptionConstructor>(*exec->heap())) JSOptionConstructor(exec, structure, globalObject);
# Class declaration
push(@headerContent, "class $className : public $parentClassName {\n");
- push(@headerContent, " typedef $parentClassName Base;\n");
# Static create methods
push(@headerContent, "public:\n");
+ push(@headerContent, " typedef $parentClassName Base;\n");
if ($interfaceName eq "DOMWindow") {
push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n");
push(@headerContent, " {\n");
# Add prototype declaration.
%structureFlags = ();
push(@headerContent, "class ${className}Prototype : public JSC::JSObjectWithGlobalObject {\n");
- push(@headerContent, " typedef JSC::JSObjectWithGlobalObject Base;\n");
push(@headerContent, "public:\n");
+ push(@headerContent, " typedef JSC::JSObjectWithGlobalObject Base;\n");
if ($interfaceName ne "DOMWindow" && !$dataNode->extendedAttributes->{"IsWorkerContext"}) {
push(@headerContent, " static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);\n");
}
push(@$outputArray, " ${constructorClassName}(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);\n\n");
push(@$outputArray, "public:\n");
+ push(@$outputArray, " typedef DOMConstructorObject Base;\n");
push(@$outputArray, " static $constructorClassName* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)\n");
push(@$outputArray, " {\n");
push(@$outputArray, " return new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(exec, structure, globalObject);\n");
JSTestInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
public:
+ typedef DOMConstructorObject Base;
static JSTestInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(exec, structure, globalObject);
namespace WebCore {
class JSTestInterface : public JSDOMWrapper {
- typedef JSDOMWrapper Base;
public:
+ typedef JSDOMWrapper Base;
static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
{
return new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl);
TestInterface* toTestInterface(JSC::JSValue);
class JSTestInterfacePrototype : public JSC::JSObjectWithGlobalObject {
- typedef JSC::JSObjectWithGlobalObject Base;
public:
+ typedef JSC::JSObjectWithGlobalObject Base;
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
static JSTestInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSTestMediaQueryListListenerConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
public:
+ typedef DOMConstructorObject Base;
static JSTestMediaQueryListListenerConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(exec, structure, globalObject);
namespace WebCore {
class JSTestMediaQueryListListener : public JSDOMWrapper {
- typedef JSDOMWrapper Base;
public:
+ typedef JSDOMWrapper Base;
static JSTestMediaQueryListListener* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
{
return new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl);
TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue);
class JSTestMediaQueryListListenerPrototype : public JSC::JSObjectWithGlobalObject {
- typedef JSC::JSObjectWithGlobalObject Base;
public:
+ typedef JSC::JSObjectWithGlobalObject Base;
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
static JSTestMediaQueryListListenerPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSTestObjConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
public:
+ typedef DOMConstructorObject Base;
static JSTestObjConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(exec, structure, globalObject);
namespace WebCore {
class JSTestObj : public JSDOMWrapper {
- typedef JSDOMWrapper Base;
public:
+ typedef JSDOMWrapper Base;
static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
{
return new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl);
TestObj* toTestObj(JSC::JSValue);
class JSTestObjPrototype : public JSC::JSObjectWithGlobalObject {
- typedef JSC::JSObjectWithGlobalObject Base;
public:
+ typedef JSC::JSObjectWithGlobalObject Base;
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
static JSTestObjPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
public:
+ typedef DOMConstructorObject Base;
static JSTestSerializedScriptValueInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(exec, structure, globalObject);
namespace WebCore {
class JSTestSerializedScriptValueInterface : public JSDOMWrapper {
- typedef JSDOMWrapper Base;
public:
+ typedef JSDOMWrapper Base;
static JSTestSerializedScriptValueInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
{
return new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl);
TestSerializedScriptValueInterface* toTestSerializedScriptValueInterface(JSC::JSValue);
class JSTestSerializedScriptValueInterfacePrototype : public JSC::JSObjectWithGlobalObject {
- typedef JSC::JSObjectWithGlobalObject Base;
public:
+ typedef JSC::JSObjectWithGlobalObject Base;
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
static JSTestSerializedScriptValueInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
class CRuntimeObject : public RuntimeObject {
public:
+ typedef RuntimeObject Base;
+
static CRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<CInstance> instance)
{
return new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, instance);
class CRuntimeMethod : public RuntimeMethod {
public:
+ typedef RuntimeMethod Base;
+
static CRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list)
{
return new (allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(exec, globalObject, name, list);
class JavaRuntimeMethod : public RuntimeMethod {
public:
+ typedef RuntimeMethod Base;
+
static JavaRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list)
{
return new (allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(exec, globalObject, name, list);
class JavaRuntimeObject : public RuntimeObject {
public:
+ typedef RuntimeObject Base;
+
static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInst)
{
return new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, javaInst);
class ObjCRuntimeObject : public RuntimeObject {
public:
+ typedef RuntimeObject Base;
+
static ObjCRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ObjcInstance> inst)
{
return new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst);
class ObjcFallbackObjectImp : public JSObjectWithGlobalObject {
public:
+ typedef JSObjectWithGlobalObject Base;
+
static ObjcFallbackObjectImp* create(ExecState* exec, JSGlobalObject* globalObject, ObjcInstance* instance, const Identifier& propertyName)
{
return new (allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(exec, globalObject, instance, propertyName);
// Derived RuntimeObject
class QtRuntimeObject : public RuntimeObject {
public:
+ typedef RuntimeObject Base;
+
static QtRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance)
{
return new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, instance);
// Derived RuntimeObject
class QtPixmapRuntimeObject : public RuntimeObject {
public:
+ typedef RuntimeObject Base;
+
static QtPixmapRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance)
{
return new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, instance);
// Common base class (doesn't really do anything interesting)
class QtRuntimeMethod : public InternalFunction {
public:
+ typedef InternalFunction Base;
+
virtual ~QtRuntimeMethod();
static const ClassInfo s_info;
class QtRuntimeMetaMethod : public QtRuntimeMethod
{
public:
+ typedef QtRuntimeMethod Base;
+
static QtRuntimeMetaMethod* create(ExecState* exec, const Identifier& n, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate)
{
return new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, n, inst, index, signature, allowPrivate);
};
class QtConnectionObject;
-class QtRuntimeConnectionMethod : public QtRuntimeMethod
-{
+class QtRuntimeConnectionMethod : public QtRuntimeMethod {
public:
+ typedef QtRuntimeMethod Base;
+
static QtRuntimeConnectionMethod* create(ExecState* exec, const Identifier& n, bool isConnect, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature)
{
return new (allocateCell<QtRuntimeConnectionMethod>(*exec->heap())) QtRuntimeConnectionMethod(exec, n, isConnect, inst, index, signature);
class RuntimeArray : public JSArray {
public:
+ typedef JSArray Base;
+
static RuntimeArray* create(ExecState* exec, Bindings::Array* array)
{
return new (allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, array);
class RuntimeMethod : public InternalFunction {
public:
+ typedef InternalFunction Base;
+
static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList)
{
return new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(exec, globalObject, structure, name, methodList);
class RuntimeObject : public JSObjectWithGlobalObject {
public:
+ typedef JSObjectWithGlobalObject Base;
+
static RuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
{
return new (allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance);
class Global : public JSNonFinalObject {
public:
- virtual UString className() const { return "global"; }
+ typedef JSNonFinalObject Base;
+
+ virtual UString className() const { return "global"; }
};
static char code[] =
+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.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ * Plugins/Hosted/ProxyRuntimeObject.h:
+
2011-08-08 Chris Marrin <cmarrin@apple.com>
Logic to compute visible display rect in GraphicsLayerCA::syncCompositingState
class ProxyRuntimeMethod : public RuntimeMethod {
public:
+ typedef RuntimeMethod Base;
+
static ProxyRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list)
{
return new (allocateCell<ProxyRuntimeMethod>(*exec->heap())) ProxyRuntimeMethod(exec, globalObject, name, list);
class ProxyRuntimeObject : public JSC::Bindings::RuntimeObject {
public:
+ typedef JSC::Bindings::RuntimeObject Base;
+
static ProxyRuntimeObject* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, PassRefPtr<ProxyInstance> instance)
{
return new (JSC::allocateCell<ProxyRuntimeObject>(*exec->heap())) ProxyRuntimeObject(exec, globalObject, instance);
+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.
+
+ * WebProcess/Plugins/Netscape/JSNPMethod.h:
+ * WebProcess/Plugins/Netscape/JSNPObject.h:
+
2011-08-08 Adrienne Walker <enne@google.com>
Add testing for --force-compositing-mode to windows.internal
// A JSObject that wraps an NPMethod.
class JSNPMethod : public JSC::InternalFunction {
public:
+ typedef JSC::InternalFunction Base;
+
static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& ident, NPIdentifier npIdent)
{
return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, ident, npIdent);
class JSNPObject : public JSC::JSObjectWithGlobalObject {
public:
+ typedef JSC::JSObjectWithGlobalObject Base;
+
static JSNPObject* create(JSC::JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject)
{
return new (JSC::allocateCell<JSNPObject>(globalObject->globalData().heap)) JSNPObject(globalObject, objectMap, npObject);