https://bugs.webkit.org/show_bug.cgi?id=68567
Reviewed by Oliver Hunt.
Source/JavaScriptCore:
Declared/defined the MethodTable struct and added it to the ClassInfo struct.
Also defined the CREATE_METHOD_TABLE macro to generate these method tables
succinctly where they need to be defined.
Also added to it the first function to use this macro, visitChildren.
This is part of the process of getting rid of all C++ virtual methods in JSCell.
Eventually all virtual functions in JSCell that can't easily be converted to
non-virtual functions will be put into this custom vtable structure.
* runtime/ClassInfo.h:
Added the CREATE_METHOD_TABLE macro call as the last argument to each of the
ClassInfo structs declared in these classes. This saves us from having to visit
each s_info definition in the future when we add more methods to the MethodTable.
* API/JSCallbackConstructor.cpp:
* API/JSCallbackFunction.cpp:
* API/JSCallbackObject.cpp:
* JavaScriptCore.exp:
* runtime/Arguments.cpp:
* runtime/ArrayConstructor.cpp:
* runtime/ArrayPrototype.cpp:
* runtime/BooleanObject.cpp:
* runtime/BooleanPrototype.cpp:
* runtime/DateConstructor.cpp:
* runtime/DateInstance.cpp:
* runtime/DatePrototype.cpp:
* runtime/ErrorInstance.cpp:
* runtime/ErrorPrototype.cpp:
* runtime/ExceptionHelpers.cpp:
* runtime/Executable.cpp:
* runtime/GetterSetter.cpp:
* runtime/InternalFunction.cpp:
* runtime/JSAPIValueWrapper.cpp:
* runtime/JSActivation.cpp:
* runtime/JSArray.cpp:
* runtime/JSByteArray.cpp:
* runtime/JSFunction.cpp:
* runtime/JSGlobalObject.cpp:
* runtime/JSONObject.cpp:
* runtime/JSObject.cpp:
* runtime/JSPropertyNameIterator.cpp:
* runtime/JSString.cpp:
* runtime/MathObject.cpp:
* runtime/NativeErrorConstructor.cpp:
* runtime/NumberConstructor.cpp:
* runtime/NumberObject.cpp:
* runtime/NumberPrototype.cpp:
* runtime/ObjectConstructor.cpp:
* runtime/ObjectPrototype.cpp:
* runtime/RegExp.cpp:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpObject.cpp:
* runtime/RegExpPrototype.cpp:
* runtime/ScopeChain.cpp:
* runtime/StringConstructor.cpp:
* runtime/StringObject.cpp:
* runtime/StringPrototype.cpp:
* runtime/Structure.cpp:
* runtime/StructureChain.cpp:
Had to make visitChildren and visitChildrenVirtual protected instead of private
because some of the subclasses of JSWrapperObject need access to JSWrapperObject's
visitChildren function pointer in their vtable since they don't provide their own
implementation. Same for RegExpObject.
* runtime/JSWrapperObject.h:
* runtime/RegExpObject.h:
Source/JavaScriptGlue:
Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
specified class in its ClassInfo. Also added to it the first function to use
this macro, visitChildren. This is part of the process of getting rid of all
C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
that can't easily be converted to non-virtual functions will be put into
this custom vtable structure.
* UserObjectImp.cpp:
Source/WebCore:
No new tests.
Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
specified class in its ClassInfo. Also added to it the first function to use
this macro, visitChildren. This is part of the process of getting rid of all
C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
that can't easily be converted to non-virtual functions will be put into
this custom vtable structure.
* bindings/js/JSAudioConstructor.cpp:
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSDOMWindowShell.cpp:
* bindings/js/JSImageConstructor.cpp:
* bindings/js/JSImageDataCustom.cpp:
(WebCore::toJS):
* bindings/js/JSOptionConstructor.cpp:
* bindings/js/JSWorkerContextBase.cpp:
Changed the bindings generator to add the call to the CREATE_METHOD_TABLE macro where
necessary.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bridge/c/CRuntimeObject.cpp:
* bridge/c/c_instance.cpp:
* bridge/jni/jsc/JavaInstanceJSC.cpp:
* bridge/jni/jsc/JavaRuntimeObject.cpp:
* bridge/objc/ObjCRuntimeObject.mm:
* bridge/objc/objc_instance.mm:
* bridge/objc/objc_runtime.mm:
* bridge/qt/qt_instance.cpp:
* bridge/qt/qt_pixmapruntime.cpp:
* bridge/qt/qt_runtime.cpp:
* bridge/runtime_array.cpp:
* bridge/runtime_method.cpp:
* bridge/runtime_object.cpp:
Source/WebKit/mac:
Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
specified class in its ClassInfo. Also added to it the first function to use
this macro, visitChildren. This is part of the process of getting rid of all
C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
that can't easily be converted to non-virtual functions will be put into
this custom vtable structure.
* Plugins/Hosted/ProxyInstance.mm:
* Plugins/Hosted/ProxyRuntimeObject.mm:
Source/WebKit2:
Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
specified class in its ClassInfo. Also added to it the first function to use
this macro, visitChildren. This is part of the process of getting rid of all
C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
that can't easily be converted to non-virtual functions will be put into
this custom vtable structure.
* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95936
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
namespace JSC {
-const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackConstructor) };
JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)
: JSNonFinalObject(globalObject->globalData(), structure)
ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction);
-const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 };
+const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackFunction) };
JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
: InternalFunction(globalObject, globalObject->callbackFunctionStructure())
ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSGlobalObject>);
// Define the two types of JSCallbackObjects we support.
-template <> const ClassInfo JSCallbackObject<JSNonFinalObject>::s_info = { "CallbackObject", &JSNonFinalObject::s_info, 0, 0 };
-template <> const ClassInfo JSCallbackObject<JSGlobalObject>::s_info = { "CallbackGlobalObject", &JSGlobalObject::s_info, 0, 0 };
+template <> const ClassInfo JSCallbackObject<JSNonFinalObject>::s_info = { "CallbackObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) };
+template <> const ClassInfo JSCallbackObject<JSGlobalObject>::s_info = { "CallbackGlobalObject", &JSGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) };
void JSCallbackObjectData::finalize(Handle<Unknown> handle, void* context)
{
+2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Add custom vtable struct to ClassInfo struct
+ https://bugs.webkit.org/show_bug.cgi?id=68567
+
+ Reviewed by Oliver Hunt.
+
+ Declared/defined the MethodTable struct and added it to the ClassInfo struct.
+ Also defined the CREATE_METHOD_TABLE macro to generate these method tables
+ succinctly where they need to be defined.
+
+ Also added to it the first function to use this macro, visitChildren.
+
+ This is part of the process of getting rid of all C++ virtual methods in JSCell.
+ Eventually all virtual functions in JSCell that can't easily be converted to
+ non-virtual functions will be put into this custom vtable structure.
+ * runtime/ClassInfo.h:
+
+ Added the CREATE_METHOD_TABLE macro call as the last argument to each of the
+ ClassInfo structs declared in these classes. This saves us from having to visit
+ each s_info definition in the future when we add more methods to the MethodTable.
+ * API/JSCallbackConstructor.cpp:
+ * API/JSCallbackFunction.cpp:
+ * API/JSCallbackObject.cpp:
+ * JavaScriptCore.exp:
+ * runtime/Arguments.cpp:
+ * runtime/ArrayConstructor.cpp:
+ * runtime/ArrayPrototype.cpp:
+ * runtime/BooleanObject.cpp:
+ * runtime/BooleanPrototype.cpp:
+ * runtime/DateConstructor.cpp:
+ * runtime/DateInstance.cpp:
+ * runtime/DatePrototype.cpp:
+ * runtime/ErrorInstance.cpp:
+ * runtime/ErrorPrototype.cpp:
+ * runtime/ExceptionHelpers.cpp:
+ * runtime/Executable.cpp:
+ * runtime/GetterSetter.cpp:
+ * runtime/InternalFunction.cpp:
+ * runtime/JSAPIValueWrapper.cpp:
+ * runtime/JSActivation.cpp:
+ * runtime/JSArray.cpp:
+ * runtime/JSByteArray.cpp:
+ * runtime/JSFunction.cpp:
+ * runtime/JSGlobalObject.cpp:
+ * runtime/JSONObject.cpp:
+ * runtime/JSObject.cpp:
+ * runtime/JSPropertyNameIterator.cpp:
+ * runtime/JSString.cpp:
+ * runtime/MathObject.cpp:
+ * runtime/NativeErrorConstructor.cpp:
+ * runtime/NumberConstructor.cpp:
+ * runtime/NumberObject.cpp:
+ * runtime/NumberPrototype.cpp:
+ * runtime/ObjectConstructor.cpp:
+ * runtime/ObjectPrototype.cpp:
+ * runtime/RegExp.cpp:
+ * runtime/RegExpConstructor.cpp:
+ * runtime/RegExpObject.cpp:
+ * runtime/RegExpPrototype.cpp:
+ * runtime/ScopeChain.cpp:
+ * runtime/StringConstructor.cpp:
+ * runtime/StringObject.cpp:
+ * runtime/StringPrototype.cpp:
+ * runtime/Structure.cpp:
+ * runtime/StructureChain.cpp:
+
+ Had to make visitChildren and visitChildrenVirtual protected instead of private
+ because some of the subclasses of JSWrapperObject need access to JSWrapperObject's
+ visitChildren function pointer in their vtable since they don't provide their own
+ implementation. Same for RegExpObject.
+ * runtime/JSWrapperObject.h:
+ * runtime/RegExpObject.h:
+
2011-09-25 Adam Barth <abarth@webkit.org>
Finish removing PLATFORM(BREWMP) by removing associated code
__ZN3JSC6RegExp5matchERNS_12JSGlobalDataERKNS_7UStringEiPN3WTF6VectorIiLm32EEE
__ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
__ZN3JSC6RegExpD1Ev
+__ZN3JSC7JSArray13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataE
__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataERKNS_7ArgListE
__ZN3JSC7JSArray15setSubclassDataEPv
ASSERT_CLASS_FITS_IN_CELL(Arguments);
-const ClassInfo Arguments::s_info = { "Arguments", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo Arguments::s_info = { "Arguments", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(Arguments) };
Arguments::~Arguments()
{
namespace JSC {
-const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable };
+const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable, CREATE_METHOD_TABLE(ArrayConstructor) };
/* Source for ArrayConstructor.lut.h
@begin arrayConstructorTable
// ------------------------------ ArrayPrototype ----------------------------
-const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayPrototypeTable};
+const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayPrototypeTable, CREATE_METHOD_TABLE(ArrayPrototype)};
/* Source for ArrayPrototype.lut.h
@begin arrayPrototypeTable 16
ASSERT_CLASS_FITS_IN_CELL(BooleanObject);
-const ClassInfo BooleanObject::s_info = { "Boolean", &JSWrapperObject::s_info, 0, 0 };
+const ClassInfo BooleanObject::s_info = { "Boolean", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(BooleanObject) };
BooleanObject::BooleanObject(JSGlobalData& globalData, Structure* structure)
: JSWrapperObject(globalData, structure)
namespace JSC {
-const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info, 0, ExecState::booleanPrototypeTable };
+const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info, 0, ExecState::booleanPrototypeTable, CREATE_METHOD_TABLE(BooleanPrototype) };
/* Source for BooleanPrototype.lut.h
@begin booleanPrototypeTable
class HashEntry;
struct HashTable;
+ struct MethodTable {
+ typedef void (*VisitChildrenFunctionPtr)(JSCell*, SlotVisitor&);
+ VisitChildrenFunctionPtr visitChildrenFunctionPtr;
+ };
+
+#define CREATE_METHOD_TABLE(ClassName) { \
+ &ClassName::visitChildren \
+ }
+
struct ClassInfo {
/**
* A string denoting the class name. Example: "Window".
const HashTable* staticPropHashTable;
typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
+
+ MethodTable methodTable;
};
} // namespace JSC
namespace JSC {
-const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::dateConstructorTable };
+const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::dateConstructorTable, CREATE_METHOD_TABLE(DateConstructor) };
/* Source for DateConstructor.lut.h
@begin dateConstructorTable
namespace JSC {
-const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0};
+const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)};
DateInstance::DateInstance(ExecState* exec, Structure* structure)
: JSWrapperObject(exec->globalData(), structure)
return ok;
}
-const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecState::dateTable};
+const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecState::dateTable, CREATE_METHOD_TABLE(DatePrototype)};
/* Source for DatePrototype.lut.h
@begin dateTable
namespace JSC {
-const ClassInfo ErrorInstance::s_info = { "Error", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo ErrorInstance::s_info = { "Error", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorInstance) };
ErrorInstance::ErrorInstance(JSGlobalData& globalData, Structure* structure)
: JSNonFinalObject(globalData, structure)
namespace JSC {
-const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, ExecState::errorPrototypeTable };
+const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, ExecState::errorPrototypeTable, CREATE_METHOD_TABLE(ErrorPrototype) };
/* Source for ErrorPrototype.lut.h
@begin errorPrototypeTable
namespace JSC {
-const ClassInfo InterruptedExecutionError::s_info = { "InterruptedExecutionError", &Base::s_info, 0, 0 };
+const ClassInfo InterruptedExecutionError::s_info = { "InterruptedExecutionError", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(InterruptedExecutionError) };
UString InterruptedExecutionError::toString(ExecState*) const
{
}
-const ClassInfo TerminatedExecutionError::s_info = { "TerminatedExecutionError", &Base::s_info, 0, 0 };
+const ClassInfo TerminatedExecutionError::s_info = { "TerminatedExecutionError", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(TerminatedExecutionError) };
UString TerminatedExecutionError::toString(ExecState*) const
{
namespace JSC {
-const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0 };
+const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0, CREATE_METHOD_TABLE(ExecutableBase) };
void ExecutableBase::clearCode()
{
return &finalizer;
}
-const ClassInfo NativeExecutable::s_info = { "NativeExecutable", &ExecutableBase::s_info, 0, 0 };
+const ClassInfo NativeExecutable::s_info = { "NativeExecutable", &ExecutableBase::s_info, 0, 0, CREATE_METHOD_TABLE(NativeExecutable) };
NativeExecutable::~NativeExecutable()
{
}
#endif
-const ClassInfo ScriptExecutable::s_info = { "ScriptExecutable", &ExecutableBase::s_info, 0, 0 };
+const ClassInfo ScriptExecutable::s_info = { "ScriptExecutable", &ExecutableBase::s_info, 0, 0, CREATE_METHOD_TABLE(ScriptExecutable) };
-const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &ScriptExecutable::s_info, 0, 0 };
+const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(EvalExecutable) };
EvalExecutable::EvalExecutable(ExecState* exec, const SourceCode& source, bool inStrictContext)
: ScriptExecutable(exec->globalData().evalExecutableStructure.get(), exec, source, inStrictContext)
{
}
-const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, 0, 0 };
+const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(ProgramExecutable) };
ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source)
: ScriptExecutable(exec->globalData().programExecutableStructure.get(), exec, source, false)
{
}
-const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0 };
+const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionExecutable) };
FunctionExecutable::FunctionExecutable(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool inStrictContext)
: ScriptExecutable(globalData.functionExecutableStructure.get(), globalData, source, inStrictContext)
namespace JSC {
-const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0 };
+const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0, CREATE_METHOD_TABLE(GetterSetter) };
void GetterSetter::visitChildrenVirtual(SlotVisitor& visitor)
{
ASSERT_CLASS_FITS_IN_CELL(InternalFunction);
-const ClassInfo InternalFunction::s_info = { "Function", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo InternalFunction::s_info = { "Function", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(InternalFunction) };
InternalFunction::InternalFunction(VPtrStealingHackType)
: JSNonFinalObject(VPtrStealingHack)
namespace JSC {
-const ClassInfo JSAPIValueWrapper::s_info = { "API Wrapper", 0, 0, 0 };
+const ClassInfo JSAPIValueWrapper::s_info = { "API Wrapper", 0, 0, 0, CREATE_METHOD_TABLE(JSAPIValueWrapper) };
} // namespace JSC
ASSERT_CLASS_FITS_IN_CELL(JSActivation);
-const ClassInfo JSActivation::s_info = { "JSActivation", &Base::s_info, 0, 0 };
+const ClassInfo JSActivation::s_info = { "JSActivation", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSActivation) };
JSActivation::JSActivation(CallFrame* callFrame, FunctionExecutable* functionExecutable)
: Base(callFrame->globalData(), callFrame->globalData().activationStructure.get(), functionExecutable->symbolTable(), callFrame->registers())
// as long as it is 1/8 full. If more sparse than that, we use a map.
static const unsigned minDensityMultiplier = 8;
-const ClassInfo JSArray::s_info = {"Array", &JSNonFinalObject::s_info, 0, 0};
+const ClassInfo JSArray::s_info = {"Array", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSArray)};
// We keep track of the size of the last array after it was grown. We use this
// as a simple heuristic for as the value to grow the next array from size 0.
namespace JSC {
-const ClassInfo JSByteArray::s_defaultInfo = { "ByteArray", &Base::s_info, 0, 0 };
+const ClassInfo JSByteArray::s_defaultInfo = { "ByteArray", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
JSByteArray::JSByteArray(ExecState* exec, Structure* structure, ByteArray* storage)
: JSNonFinalObject(exec->globalData(), structure)
ASSERT_CLASS_FITS_IN_CELL(JSFunction);
-const ClassInfo JSFunction::s_info = { "Function", &Base::s_info, 0, 0 };
+const ClassInfo JSFunction::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSFunction) };
bool JSFunction::isHostFunctionNonInline() const
{
namespace JSC {
-const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &JSVariableObject::s_info, 0, ExecState::globalObjectTable };
+const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &JSVariableObject::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) };
/* Source for JSGlobalObject.lut.h
@begin globalObjectTable
// ------------------------------ JSONObject --------------------------------
-const ClassInfo JSONObject::s_info = { "JSON", &JSNonFinalObject::s_info, 0, ExecState::jsonTable };
+const ClassInfo JSONObject::s_info = { "JSON", &JSNonFinalObject::s_info, 0, ExecState::jsonTable, CREATE_METHOD_TABLE(JSONObject) };
/* Source for JSONObject.lut.h
@begin jsonTable
const char* StrictModeReadonlyPropertyWriteError = "Attempted to assign to readonly property.";
-const ClassInfo JSObject::s_info = { "Object", 0, 0, 0 };
+const ClassInfo JSObject::s_info = { "Object", 0, 0, 0, CREATE_METHOD_TABLE(JSObject) };
static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode)
{
ASSERT_CLASS_FITS_IN_CELL(JSPropertyNameIterator);
-const ClassInfo JSPropertyNameIterator::s_info = { "JSPropertyNameIterator", 0, 0, 0 };
+const ClassInfo JSPropertyNameIterator::s_info = { "JSPropertyNameIterator", 0, 0, 0, CREATE_METHOD_TABLE(JSPropertyNameIterator) };
inline JSPropertyNameIterator::JSPropertyNameIterator(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlots)
: JSCell(exec->globalData(), exec->globalData().propertyNameIteratorStructure.get())
static const unsigned substringFromRopeCutoff = 4;
-const ClassInfo JSString::s_info = { "string", 0, 0, 0 };
+const ClassInfo JSString::s_info = { "string", 0, 0, 0, CREATE_METHOD_TABLE(JSString) };
void JSString::resolveRope(ExecState* exec) const
{
explicit JSWrapperObject(JSGlobalData&, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
- private:
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
+ private:
WriteBarrier<Unknown> m_internalValue;
};
namespace JSC {
-const ClassInfo MathObject::s_info = { "Math", &JSNonFinalObject::s_info, 0, ExecState::mathTable };
+const ClassInfo MathObject::s_info = { "Math", &JSNonFinalObject::s_info, 0, ExecState::mathTable, CREATE_METHOD_TABLE(MathObject) };
/* Source for MathObject.lut.h
@begin mathTable
ASSERT_CLASS_FITS_IN_CELL(NativeErrorConstructor);
-const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0 };
+const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(NativeErrorConstructor) };
NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
namespace JSC {
-const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberConstructorTable };
+const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberConstructorTable, CREATE_METHOD_TABLE(NumberConstructor) };
/* Source for NumberConstructor.lut.h
@begin numberConstructorTable
ASSERT_CLASS_FITS_IN_CELL(NumberObject);
-const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, 0 };
+const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(NumberObject) };
NumberObject::NumberObject(JSGlobalData& globalData, Structure* structure)
: JSWrapperObject(globalData, structure)
namespace JSC {
-const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0, ExecState::numberPrototypeTable };
+const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0, ExecState::numberPrototypeTable, CREATE_METHOD_TABLE(NumberPrototype) };
/* Source for NumberPrototype.lut.h
@begin numberPrototypeTable
namespace JSC {
-const ClassInfo ObjectConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::objectConstructorTable };
+const ClassInfo ObjectConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::objectConstructorTable, CREATE_METHOD_TABLE(ObjectConstructor) };
/* Source for ObjectConstructor.lut.h
@begin objectConstructorTable
namespace JSC {
-const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, ExecState::objectPrototypeTable };
+const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, ExecState::objectPrototypeTable, CREATE_METHOD_TABLE(ObjectPrototype) };
/* Source for ObjectPrototype.lut.h
@begin objectPrototypeTable
namespace JSC {
-const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0 };
+const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0, CREATE_METHOD_TABLE(RegExp) };
RegExpFlags regExpFlags(const UString& string)
{
ASSERT_CLASS_FITS_IN_CELL(RegExpConstructor);
-const ClassInfo RegExpConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::regExpConstructorTable };
+const ClassInfo RegExpConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::regExpConstructorTable, CREATE_METHOD_TABLE(RegExpConstructor) };
/* Source for RegExpConstructor.lut.h
@begin regExpConstructorTable
ASSERT_CLASS_FITS_IN_CELL(RegExpObject);
-const ClassInfo RegExpObject::s_info = { "RegExp", &JSNonFinalObject::s_info, 0, ExecState::regExpTable };
+const ClassInfo RegExpObject::s_info = { "RegExp", &JSNonFinalObject::s_info, 0, ExecState::regExpTable, CREATE_METHOD_TABLE(RegExpObject) };
/* Source for RegExpObject.lut.h
@begin regExpTable
void finishCreation(JSGlobalObject*);
static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | Base::StructureFlags;
- private:
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
+ private:
bool match(ExecState*);
struct RegExpObjectData {
namespace JSC {
-const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0, ExecState::regExpPrototypeTable };
+const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0, ExecState::regExpPrototypeTable, CREATE_METHOD_TABLE(RegExpPrototype) };
/* Source for RegExpPrototype.lut.h
@begin regExpPrototypeTable
#endif
-const ClassInfo ScopeChainNode::s_info = { "ScopeChainNode", 0, 0, 0 };
+const ClassInfo ScopeChainNode::s_info = { "ScopeChainNode", 0, 0, 0, CREATE_METHOD_TABLE(ScopeChainNode) };
int ScopeChainNode::localDepth()
{
namespace JSC {
-const ClassInfo StringConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::stringConstructorTable };
+const ClassInfo StringConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::stringConstructorTable, CREATE_METHOD_TABLE(StringConstructor) };
/* Source for StringConstructor.lut.h
@begin stringConstructorTable
ASSERT_CLASS_FITS_IN_CELL(StringObject);
-const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0 };
+const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(StringObject) };
StringObject::StringObject(JSGlobalData& globalData, Structure* structure)
: JSWrapperObject(globalData, structure)
namespace JSC {
-const ClassInfo StringPrototype::s_info = { "String", &StringObject::s_info, 0, ExecState::stringTable };
+const ClassInfo StringPrototype::s_info = { "String", &StringObject::s_info, 0, ExecState::stringTable, CREATE_METHOD_TABLE(StringPrototype) };
/* Source for StringPrototype.lut.h
@begin stringTable 26
{
}
-const ClassInfo Structure::s_info = { "Structure", 0, 0, 0 };
+const ClassInfo Structure::s_info = { "Structure", 0, 0, 0, CREATE_METHOD_TABLE(Structure) };
Structure::Structure(JSGlobalData& globalData)
: JSCell(CreatingEarlyCell)
namespace JSC {
-ClassInfo StructureChain::s_info = { "StructureChain", 0, 0, 0 };
+ClassInfo StructureChain::s_info = { "StructureChain", 0, 0, 0, CREATE_METHOD_TABLE(StructureChain) };
StructureChain::StructureChain(JSGlobalData& globalData, Structure* structure)
: JSCell(globalData, structure)
+2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Add custom vtable struct to ClassInfo struct
+ https://bugs.webkit.org/show_bug.cgi?id=68567
+
+ Reviewed by Oliver Hunt.
+
+ Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
+ specified class in its ClassInfo. Also added to it the first function to use
+ this macro, visitChildren. This is part of the process of getting rid of all
+ C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
+ that can't easily be converted to non-virtual functions will be put into
+ this custom vtable structure.
+
+ * UserObjectImp.cpp:
+
2011-09-23 Mark Hahnenberg <mhahnenberg@apple.com>
Add static version of JSCell::visitChildren
#include <JavaScriptCore/JSString.h>
#include <JavaScriptCore/PropertyNameArray.h>
-const ClassInfo UserObjectImp::s_info = { "UserObject", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo UserObjectImp::s_info = { "UserObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(UserObjectImp) };
UserObjectImp::UserObjectImp(JSGlobalData& globalData, Structure* structure, JSUserObject* userObject)
: JSNonFinalObject(globalData, structure)
+2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Add custom vtable struct to ClassInfo struct
+ https://bugs.webkit.org/show_bug.cgi?id=68567
+
+ Reviewed by Oliver Hunt.
+
+ No new tests.
+
+ Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
+ specified class in its ClassInfo. Also added to it the first function to use
+ this macro, visitChildren. This is part of the process of getting rid of all
+ C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
+ that can't easily be converted to non-virtual functions will be put into
+ this custom vtable structure.
+
+ * bindings/js/JSAudioConstructor.cpp:
+ * bindings/js/JSDOMGlobalObject.cpp:
+ * bindings/js/JSDOMWindowBase.cpp:
+ * bindings/js/JSDOMWindowShell.cpp:
+ * bindings/js/JSImageConstructor.cpp:
+ * bindings/js/JSImageDataCustom.cpp:
+ (WebCore::toJS):
+ * bindings/js/JSOptionConstructor.cpp:
+ * bindings/js/JSWorkerContextBase.cpp:
+
+ Changed the bindings generator to add the call to the CREATE_METHOD_TABLE macro where
+ necessary.
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateConstructorDefinition):
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+ * bridge/c/CRuntimeObject.cpp:
+ * bridge/c/c_instance.cpp:
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ * bridge/jni/jsc/JavaRuntimeObject.cpp:
+ * bridge/objc/ObjCRuntimeObject.mm:
+ * bridge/objc/objc_instance.mm:
+ * bridge/objc/objc_runtime.mm:
+ * bridge/qt/qt_instance.cpp:
+ * bridge/qt/qt_pixmapruntime.cpp:
+ * bridge/qt/qt_runtime.cpp:
+ * bridge/runtime_array.cpp:
+ * bridge/runtime_method.cpp:
+ * bridge/runtime_object.cpp:
+
2011-09-25 Eunmi Lee <eunmi15.lee@samsung.com>
[EFL] Move GtkWidgetBackingStoreCairo to the cairo directory and modify to use in the EFL.
namespace WebCore {
-const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
+const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", &DOMConstructorWithDocument::s_info, 0, 0, CREATE_METHOD_TABLE(JSAudioConstructor) };
JSAudioConstructor::JSAudioConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorWithDocument(structure, globalObject)
namespace WebCore {
-const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0 };
+const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMGlobalObject) };
JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world)
: JSGlobalObject(globalData, structure)
namespace WebCore {
-const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0 };
+const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowBase) };
JSDOMWindowBase::JSDOMWindowBase(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
: JSDOMGlobalObject(globalData, structure, shell->world())
ASSERT_CLASS_FITS_IN_CELL(JSDOMWindowShell);
-const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0 };
+const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowShell) };
JSDOMWindowShell::JSDOMWindowShell(Structure* structure, DOMWrapperWorld* world)
: Base(*world->globalData(), structure)
ASSERT_CLASS_FITS_IN_CELL(JSImageConstructor);
-const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
+const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", &DOMConstructorWithDocument::s_info, 0, 0, CREATE_METHOD_TABLE(JSImageConstructor) };
JSImageConstructor::JSImageConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorWithDocument(structure, globalObject)
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, ImageData, imageData);
Identifier dataName(exec, "data");
- static const ClassInfo cpaClassInfo = { "CanvasPixelArray", &JSByteArray::Base::s_info, 0, 0 };
+ static const ClassInfo cpaClassInfo = { "CanvasPixelArray", &JSByteArray::Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
Structure* cpaStructure = getCachedDOMStructure(globalObject, &cpaClassInfo);
if (!cpaStructure)
cpaStructure = cacheDOMStructure(globalObject, JSByteArray::createStructure(exec->globalData(), globalObject, jsNull(), &cpaClassInfo), &cpaClassInfo);
ASSERT_CLASS_FITS_IN_CELL(JSOptionConstructor);
-const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
+const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", &DOMConstructorWithDocument::s_info, 0, 0, CREATE_METHOD_TABLE(JSOptionConstructor) };
JSOptionConstructor::JSOptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorWithDocument(structure, globalObject)
ASSERT_CLASS_FITS_IN_CELL(JSWorkerContextBase);
-const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", &JSDOMGlobalObject::s_info, 0, 0 };
+const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", &JSDOMGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSWorkerContextBase) };
JSWorkerContextBase::JSWorkerContextBase(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<WorkerContext> impl)
: JSDOMGlobalObject(globalData, structure, normalWorld(globalData))
push(@implContent, "{\n");
push(@implContent, " return getHashTableForGlobalData(exec->globalData(), &${className}PrototypeTable);\n");
push(@implContent, "}\n\n");
- push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, 0, get${className}PrototypeTable };\n\n");
+ push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, 0, get${className}PrototypeTable, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
} else {
- push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, &${className}PrototypeTable, 0 };\n\n");
+ push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, &${className}PrototypeTable, 0, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
}
if ($interfaceName ne "DOMWindow" && !$dataNode->extendedAttributes->{"IsWorkerContext"}) {
push(@implContent, "JSObject* ${className}Prototype::self(ExecState* exec, JSGlobalObject* globalObject)\n");
} else {
push(@implContent, ", 0 ");
}
- push(@implContent, "};\n\n");
+ push(@implContent, ", CREATE_METHOD_TABLE($className) };\n\n");
my $implType = $implClassName;
my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
my $callWith = $dataNode->extendedAttributes->{"CallWith"};
my $numberOfconstructParameters = $dataNode->extendedAttributes->{"ConstructorParameters"};
- push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0 };\n\n");
+ push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0, CREATE_METHOD_TABLE($constructorClassName) };\n\n");
push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n");
push(@$outputArray, " : DOMConstructorObject(structure, globalObject)\n");
virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
};
-const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 };
+const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestInterfaceConstructor) };
JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorObject(structure, globalObject)
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSTestInterfacePrototypeTable = { 1, 0, JSTestInterfacePrototypeTableValues, 0 };
-const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestInterfacePrototypeTable, 0 };
+const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestInterfacePrototype) };
JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSTestInterface>(exec, globalObject);
}
-const ClassInfo JSTestInterface::s_info = { "TestInterface", &JSDOMWrapper::s_info, &JSTestInterfaceTable, 0 };
+const ClassInfo JSTestInterface::s_info = { "TestInterface", &JSDOMWrapper::s_info, &JSTestInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestInterface) };
JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
: JSDOMWrapper(structure, globalObject)
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};
-const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 };
+const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListenerConstructor) };
JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorObject(structure, globalObject)
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
-const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSNonFinalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0 };
+const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSNonFinalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListenerPrototype) };
JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, descriptor);
}
-const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &JSDOMWrapper::s_info, &JSTestMediaQueryListListenerTable, 0 };
+const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &JSDOMWrapper::s_info, &JSTestMediaQueryListListenerTable, 0 , CREATE_METHOD_TABLE(JSTestMediaQueryListListener) };
JSTestMediaQueryListListener::JSTestMediaQueryListListener(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
: JSDOMWrapper(structure, globalObject)
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};
-const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 };
+const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorObject(structure, globalObject)
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 137, 127, JSTestObjPrototypeTableValues, 0 };
-const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSNonFinalObject::s_info, &JSTestObjPrototypeTable, 0 };
+const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSNonFinalObject::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
}
-const ClassInfo JSTestObj::s_info = { "TestObj", &JSDOMWrapper::s_info, &JSTestObjTable, 0 };
+const ClassInfo JSTestObj::s_info = { "TestObj", &JSDOMWrapper::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) };
JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
: JSDOMWrapper(structure, globalObject)
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};
-const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 };
+const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfaceConstructor) };
JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorObject(structure, globalObject)
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSTestSerializedScriptValueInterfacePrototypeTable = { 1, 0, JSTestSerializedScriptValueInterfacePrototypeTableValues, 0 };
-const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestSerializedScriptValueInterfacePrototypeTable, 0 };
+const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestSerializedScriptValueInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfacePrototype) };
JSObject* JSTestSerializedScriptValueInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSTestSerializedScriptValueInterface>(exec, globalObject);
}
-const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &JSDOMWrapper::s_info, &JSTestSerializedScriptValueInterfaceTable, 0 };
+const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &JSDOMWrapper::s_info, &JSTestSerializedScriptValueInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterface) };
JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
: JSDOMWrapper(structure, globalObject)
namespace JSC {
namespace Bindings {
-const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(CRuntimeObject) };
CRuntimeObject::CRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<CInstance> instance)
: RuntimeObject(exec, globalObject, structure, instance)
};
-const ClassInfo CRuntimeMethod::s_info = { "CRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+const ClassInfo CRuntimeMethod::s_info = { "CRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(CRuntimeMethod) };
JSValue CInstance::getMethod(ExecState* exec, const Identifier& propertyName)
{
}
};
-const ClassInfo JavaRuntimeMethod::s_info = { "JavaRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+const ClassInfo JavaRuntimeMethod::s_info = { "JavaRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(JavaRuntimeMethod) };
JSValue JavaInstance::getMethod(ExecState* exec, const Identifier& propertyName)
{
namespace JSC {
namespace Bindings {
-const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(JavaRuntimeObject) };
JavaRuntimeObject::JavaRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<JavaInstance> instance)
: RuntimeObject(exec, globalObject, structure, instance)
namespace JSC {
namespace Bindings {
-const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCRuntimeObject) };
ObjCRuntimeObject::ObjCRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ObjcInstance> instance, Structure* structure)
: RuntimeObject(exec, globalObject, structure, instance)
}
};
-const ClassInfo ObjCRuntimeMethod::s_info = { "ObjCRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+const ClassInfo ObjCRuntimeMethod::s_info = { "ObjCRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCRuntimeMethod) };
JSValue ObjcInstance::getMethod(ExecState* exec, const Identifier& propertyName)
{
return [_array.get() count];
}
-const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjcFallbackObjectImp) };
ObjcFallbackObjectImp::ObjcFallbackObjectImp(JSGlobalObject* globalObject, Structure* structure, ObjcInstance* i, const Identifier& propertyName)
: JSNonFinalObject(globalObject->globalData(), structure)
QtRuntimeObject(ExecState*, JSGlobalObject*, Structure*, PassRefPtr<Instance>);
};
-const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeObject) };
QtRuntimeObject::QtRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
: RuntimeObject(exec, globalObject, structure, instance)
{
}
-const ClassInfo QtPixmapRuntimeObject::s_info = { "QtPixmapRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+const ClassInfo QtPixmapRuntimeObject::s_info = { "QtPixmapRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(QtPixmapRuntimeObject) };
QtPixmapClass::QtPixmapClass()
{
#define QW_D(Class) Class##Data* d = d_func()
#define QW_DS(Class,Instance) Class##Data* d = Instance->d_func()
-const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0 };
+const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMethod) };
QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const Identifier& identifier)
: InternalFunction(exec->lexicalGlobalObject(), structure)
namespace JSC {
-const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &JSArray::s_info, 0, 0 };
+const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &JSArray::s_info, 0, 0, CREATE_METHOD_TABLE(RuntimeArray) };
RuntimeArray::RuntimeArray(ExecState* exec, Structure* structure)
: JSArray(exec->globalData(), structure)
ASSERT_CLASS_FITS_IN_CELL(RuntimeMethod);
-const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0 };
+const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(RuntimeMethod) };
RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& m)
// Callers will need to pass in the right global object corresponding to this native object "m".
namespace JSC {
namespace Bindings {
-const ClassInfo RuntimeObject::s_info = { "RuntimeObject", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo RuntimeObject::s_info = { "RuntimeObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(RuntimeObject) };
RuntimeObject::RuntimeObject(ExecState*, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
: JSNonFinalObject(globalObject->globalData(), structure)
+2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Add custom vtable struct to ClassInfo struct
+ https://bugs.webkit.org/show_bug.cgi?id=68567
+
+ Reviewed by Oliver Hunt.
+
+ Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
+ specified class in its ClassInfo. Also added to it the first function to use
+ this macro, visitChildren. This is part of the process of getting rid of all
+ C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
+ that can't easily be converted to non-virtual functions will be put into
+ this custom vtable structure.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ * Plugins/Hosted/ProxyRuntimeObject.mm:
+
2011-09-24 Adam Barth <abarth@webkit.org>
Always enable ENABLE(OFFLINE_WEB_APPLICATIONS)
}
};
-const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(ProxyRuntimeMethod) };
JSValue ProxyInstance::getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName)
{
namespace WebKit {
-const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(ProxyRuntimeObject) };
ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<ProxyInstance> instance)
: RuntimeObject(exec, globalObject, structure, instance)
+2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Add custom vtable struct to ClassInfo struct
+ https://bugs.webkit.org/show_bug.cgi?id=68567
+
+ Reviewed by Oliver Hunt.
+
+ Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
+ specified class in its ClassInfo. Also added to it the first function to use
+ this macro, visitChildren. This is part of the process of getting rid of all
+ C++ virtual methods in JSCell. Eventually all virtual functions in JSCell
+ that can't easily be converted to non-virtual functions will be put into
+ this custom vtable structure.
+
+ * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
+ * WebProcess/Plugins/Netscape/JSNPObject.cpp:
+
2011-09-25 Adam Barth <abarth@webkit.org>
Finish removing PLATFORM(BREWMP) by removing associated code
namespace WebKit {
-const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 };
+const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSNPMethod) };
JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier)
: InternalFunction(globalObject, structure)
return static_cast<NPIdentifier>(IdentifierRep::get(identifier.ustring().utf8().data()));
}
-const ClassInfo JSNPObject::s_info = { "NPObject", &JSNonFinalObject::s_info, 0, 0 };
+const ClassInfo JSNPObject::s_info = { "NPObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSNPObject) };
JSNPObject::JSNPObject(JSGlobalObject* globalObject, Structure* structure, NPRuntimeObjectMap* objectMap, NPObject* npObject)
: JSNonFinalObject(globalObject->globalData(), structure)