Changeset 95936 in webkit


Ignore:
Timestamp:
Sep 26, 2011 12:05:28 AM (13 years ago)
Author:
mhahnenberg@apple.com
Message:

Add custom vtable struct to ClassInfo struct
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:
Location:
trunk/Source
Files:
84 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackConstructor.cpp

    r94875 r95936  
    3737namespace JSC {
    3838
    39 const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSNonFinalObject::s_info, 0, 0 };
     39const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackConstructor) };
    4040
    4141JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp

    r95108 r95936  
    4141ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction);
    4242
    43 const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 };
     43const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackFunction) };
    4444
    4545JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.cpp

    r94701 r95936  
    3737
    3838// Define the two types of JSCallbackObjects we support.
    39 template <> const ClassInfo JSCallbackObject<JSNonFinalObject>::s_info = { "CallbackObject", &JSNonFinalObject::s_info, 0, 0 };
    40 template <> const ClassInfo JSCallbackObject<JSGlobalObject>::s_info = { "CallbackGlobalObject", &JSGlobalObject::s_info, 0, 0 };
     39template <> const ClassInfo JSCallbackObject<JSNonFinalObject>::s_info = { "CallbackObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) };
     40template <> const ClassInfo JSCallbackObject<JSGlobalObject>::s_info = { "CallbackGlobalObject", &JSGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) };
    4141
    4242void JSCallbackObjectData::finalize(Handle<Unknown> handle, void* context)
  • trunk/Source/JavaScriptCore/ChangeLog

    r95934 r95936  
     12011-09-25  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add custom vtable struct to ClassInfo struct
     4        https://bugs.webkit.org/show_bug.cgi?id=68567
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Declared/defined the MethodTable struct and added it to the ClassInfo struct.
     9        Also defined the CREATE_METHOD_TABLE macro to generate these method tables
     10        succinctly where they need to be defined.
     11
     12        Also added to it the first function to use this macro, visitChildren.
     13
     14        This is part of the process of getting rid of all C++ virtual methods in JSCell. 
     15        Eventually all virtual functions in JSCell that can't easily be converted to
     16        non-virtual functions will be put into this custom vtable structure.
     17        * runtime/ClassInfo.h:
     18
     19        Added the CREATE_METHOD_TABLE macro call as the last argument to each of the
     20        ClassInfo structs declared in these classes.  This saves us from having to visit
     21        each s_info definition in the future when we add more methods to the MethodTable.
     22        * API/JSCallbackConstructor.cpp:
     23        * API/JSCallbackFunction.cpp:
     24        * API/JSCallbackObject.cpp:
     25        * JavaScriptCore.exp:
     26        * runtime/Arguments.cpp:
     27        * runtime/ArrayConstructor.cpp:
     28        * runtime/ArrayPrototype.cpp:
     29        * runtime/BooleanObject.cpp:
     30        * runtime/BooleanPrototype.cpp:
     31        * runtime/DateConstructor.cpp:
     32        * runtime/DateInstance.cpp:
     33        * runtime/DatePrototype.cpp:
     34        * runtime/ErrorInstance.cpp:
     35        * runtime/ErrorPrototype.cpp:
     36        * runtime/ExceptionHelpers.cpp:
     37        * runtime/Executable.cpp:
     38        * runtime/GetterSetter.cpp:
     39        * runtime/InternalFunction.cpp:
     40        * runtime/JSAPIValueWrapper.cpp:
     41        * runtime/JSActivation.cpp:
     42        * runtime/JSArray.cpp:
     43        * runtime/JSByteArray.cpp:
     44        * runtime/JSFunction.cpp:
     45        * runtime/JSGlobalObject.cpp:
     46        * runtime/JSONObject.cpp:
     47        * runtime/JSObject.cpp:
     48        * runtime/JSPropertyNameIterator.cpp:
     49        * runtime/JSString.cpp:
     50        * runtime/MathObject.cpp:
     51        * runtime/NativeErrorConstructor.cpp:
     52        * runtime/NumberConstructor.cpp:
     53        * runtime/NumberObject.cpp:
     54        * runtime/NumberPrototype.cpp:
     55        * runtime/ObjectConstructor.cpp:
     56        * runtime/ObjectPrototype.cpp:
     57        * runtime/RegExp.cpp:
     58        * runtime/RegExpConstructor.cpp:
     59        * runtime/RegExpObject.cpp:
     60        * runtime/RegExpPrototype.cpp:
     61        * runtime/ScopeChain.cpp:
     62        * runtime/StringConstructor.cpp:
     63        * runtime/StringObject.cpp:
     64        * runtime/StringPrototype.cpp:
     65        * runtime/Structure.cpp:
     66        * runtime/StructureChain.cpp:
     67
     68        Had to make visitChildren and visitChildrenVirtual protected instead of private
     69        because some of the subclasses of JSWrapperObject need access to JSWrapperObject's
     70        visitChildren function pointer in their vtable since they don't provide their own
     71        implementation. Same for RegExpObject.
     72        * runtime/JSWrapperObject.h:
     73        * runtime/RegExpObject.h:
     74
    1752011-09-25  Adam Barth  <abarth@webkit.org>
    276
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r95893 r95936  
    274274__ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
    275275__ZN3JSC6RegExpD1Ev
     276__ZN3JSC7JSArray13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
    276277__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataE
    277278__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataERKNS_7ArgListE
  • trunk/Source/JavaScriptCore/runtime/Arguments.cpp

    r95849 r95936  
    3636ASSERT_CLASS_FITS_IN_CELL(Arguments);
    3737
    38 const ClassInfo Arguments::s_info = { "Arguments", &JSNonFinalObject::s_info, 0, 0 };
     38const ClassInfo Arguments::s_info = { "Arguments", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(Arguments) };
    3939
    4040Arguments::~Arguments()
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r95108 r95936  
    4242namespace JSC {
    4343
    44 const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable };
     44const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable, CREATE_METHOD_TABLE(ArrayConstructor) };
    4545
    4646/* Source for ArrayConstructor.lut.h
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r95787 r95936  
    8686// ------------------------------ ArrayPrototype ----------------------------
    8787
    88 const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayPrototypeTable};
     88const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayPrototypeTable, CREATE_METHOD_TABLE(ArrayPrototype)};
    8989
    9090/* Source for ArrayPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/BooleanObject.cpp

    r94875 r95936  
    2626ASSERT_CLASS_FITS_IN_CELL(BooleanObject);
    2727
    28 const ClassInfo BooleanObject::s_info = { "Boolean", &JSWrapperObject::s_info, 0, 0 };
     28const ClassInfo BooleanObject::s_info = { "Boolean", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(BooleanObject) };
    2929
    3030BooleanObject::BooleanObject(JSGlobalData& globalData, Structure* structure)
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r95108 r95936  
    3939namespace JSC {
    4040
    41 const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info, 0, ExecState::booleanPrototypeTable };
     41const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info, 0, ExecState::booleanPrototypeTable, CREATE_METHOD_TABLE(BooleanPrototype) };
    4242
    4343/* Source for BooleanPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r95115 r95936  
    3030    class HashEntry;
    3131    struct HashTable;
     32
     33    struct MethodTable {
     34        typedef void (*VisitChildrenFunctionPtr)(JSCell*, SlotVisitor&);
     35        VisitChildrenFunctionPtr visitChildrenFunctionPtr;
     36    };
     37
     38#define CREATE_METHOD_TABLE(ClassName) { \
     39        &ClassName::visitChildren \
     40    }
    3241
    3342    struct ClassInfo {
     
    6574        typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
    6675        const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
     76
     77        MethodTable methodTable;
    6778    };
    6879
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r95108 r95936  
    6262namespace JSC {
    6363
    64 const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::dateConstructorTable };
     64const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::dateConstructorTable, CREATE_METHOD_TABLE(DateConstructor) };
    6565
    6666/* Source for DateConstructor.lut.h
  • trunk/Source/JavaScriptCore/runtime/DateInstance.cpp

    r94875 r95936  
    3333namespace JSC {
    3434
    35 const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0};
     35const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)};
    3636
    3737DateInstance::DateInstance(ExecState* exec, Structure* structure)
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r95108 r95936  
    376376}
    377377
    378 const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecState::dateTable};
     378const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecState::dateTable, CREATE_METHOD_TABLE(DatePrototype)};
    379379
    380380/* Source for DatePrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp

    r94364 r95936  
    2424namespace JSC {
    2525
    26 const ClassInfo ErrorInstance::s_info = { "Error", &JSNonFinalObject::s_info, 0, 0 };
     26const ClassInfo ErrorInstance::s_info = { "Error", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorInstance) };
    2727
    2828ErrorInstance::ErrorInstance(JSGlobalData& globalData, Structure* structure)
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r94929 r95936  
    4141namespace JSC {
    4242
    43 const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, ExecState::errorPrototypeTable };
     43const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, ExecState::errorPrototypeTable, CREATE_METHOD_TABLE(ErrorPrototype) };
    4444
    4545/* Source for ErrorPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r95901 r95936  
    4242namespace JSC {
    4343
    44 const ClassInfo InterruptedExecutionError::s_info = { "InterruptedExecutionError", &Base::s_info, 0, 0 };
     44const ClassInfo InterruptedExecutionError::s_info = { "InterruptedExecutionError", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(InterruptedExecutionError) };
    4545
    4646UString InterruptedExecutionError::toString(ExecState*) const
     
    6565
    6666
    67 const ClassInfo TerminatedExecutionError::s_info = { "TerminatedExecutionError", &Base::s_info, 0, 0 };
     67const ClassInfo TerminatedExecutionError::s_info = { "TerminatedExecutionError", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(TerminatedExecutionError) };
    6868
    6969UString TerminatedExecutionError::toString(ExecState*) const
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r95901 r95936  
    3737namespace JSC {
    3838
    39 const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0 };
     39const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0, CREATE_METHOD_TABLE(ExecutableBase) };
    4040
    4141void ExecutableBase::clearCode()
     
    7272}
    7373
    74 const ClassInfo NativeExecutable::s_info = { "NativeExecutable", &ExecutableBase::s_info, 0, 0 };
     74const ClassInfo NativeExecutable::s_info = { "NativeExecutable", &ExecutableBase::s_info, 0, 0, CREATE_METHOD_TABLE(NativeExecutable) };
    7575
    7676NativeExecutable::~NativeExecutable()
     
    9999#endif
    100100
    101 const ClassInfo ScriptExecutable::s_info = { "ScriptExecutable", &ExecutableBase::s_info, 0, 0 };
    102 
    103 const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &ScriptExecutable::s_info, 0, 0 };
     101const ClassInfo ScriptExecutable::s_info = { "ScriptExecutable", &ExecutableBase::s_info, 0, 0, CREATE_METHOD_TABLE(ScriptExecutable) };
     102
     103const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(EvalExecutable) };
    104104
    105105EvalExecutable::EvalExecutable(ExecState* exec, const SourceCode& source, bool inStrictContext)
     
    112112}
    113113
    114 const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, 0, 0 };
     114const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(ProgramExecutable) };
    115115
    116116ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source)
     
    123123}
    124124
    125 const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0 };
     125const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionExecutable) };
    126126
    127127FunctionExecutable::FunctionExecutable(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool inStrictContext)
  • trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp

    r95849 r95936  
    2929namespace JSC {
    3030
    31 const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0 };
     31const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0, CREATE_METHOD_TABLE(GetterSetter) };
    3232
    3333void GetterSetter::visitChildrenVirtual(SlotVisitor& visitor)
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp

    r94875 r95936  
    3535ASSERT_CLASS_FITS_IN_CELL(InternalFunction);
    3636
    37 const ClassInfo InternalFunction::s_info = { "Function", &JSNonFinalObject::s_info, 0, 0 };
     37const ClassInfo InternalFunction::s_info = { "Function", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(InternalFunction) };
    3838
    3939InternalFunction::InternalFunction(VPtrStealingHackType)
  • trunk/Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp

    r95901 r95936  
    2929namespace JSC {
    3030
    31 const ClassInfo JSAPIValueWrapper::s_info = { "API Wrapper", 0, 0, 0 };
     31const ClassInfo JSAPIValueWrapper::s_info = { "API Wrapper", 0, 0, 0, CREATE_METHOD_TABLE(JSAPIValueWrapper) };
    3232
    3333} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r95901 r95936  
    3838ASSERT_CLASS_FITS_IN_CELL(JSActivation);
    3939
    40 const ClassInfo JSActivation::s_info = { "JSActivation", &Base::s_info, 0, 0 };
     40const ClassInfo JSActivation::s_info = { "JSActivation", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSActivation) };
    4141
    4242JSActivation::JSActivation(CallFrame* callFrame, FunctionExecutable* functionExecutable)
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r95849 r95936  
    9393static const unsigned minDensityMultiplier = 8;
    9494
    95 const ClassInfo JSArray::s_info = {"Array", &JSNonFinalObject::s_info, 0, 0};
     95const ClassInfo JSArray::s_info = {"Array", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSArray)};
    9696
    9797// We keep track of the size of the last array after it was grown.  We use this
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp

    r95901 r95936  
    3434namespace JSC {
    3535
    36 const ClassInfo JSByteArray::s_defaultInfo = { "ByteArray", &Base::s_info, 0, 0 };
     36const ClassInfo JSByteArray::s_defaultInfo = { "ByteArray", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
    3737
    3838JSByteArray::JSByteArray(ExecState* exec, Structure* structure, ByteArray* storage)
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r95849 r95936  
    5151ASSERT_CLASS_FITS_IN_CELL(JSFunction);
    5252
    53 const ClassInfo JSFunction::s_info = { "Function", &Base::s_info, 0, 0 };
     53const ClassInfo JSFunction::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSFunction) };
    5454
    5555bool JSFunction::isHostFunctionNonInline() const
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r95849 r95936  
    7575namespace JSC {
    7676
    77 const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &JSVariableObject::s_info, 0, ExecState::globalObjectTable };
     77const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &JSVariableObject::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) };
    7878
    7979/* Source for JSGlobalObject.lut.h
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r95901 r95936  
    589589// ------------------------------ JSONObject --------------------------------
    590590
    591 const ClassInfo JSONObject::s_info = { "JSON", &JSNonFinalObject::s_info, 0, ExecState::jsonTable };
     591const ClassInfo JSONObject::s_info = { "JSON", &JSNonFinalObject::s_info, 0, ExecState::jsonTable, CREATE_METHOD_TABLE(JSONObject) };
    592592
    593593/* Source for JSONObject.lut.h
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r95849 r95936  
    4848const char* StrictModeReadonlyPropertyWriteError = "Attempted to assign to readonly property.";
    4949
    50 const ClassInfo JSObject::s_info = { "Object", 0, 0, 0 };
     50const ClassInfo JSObject::s_info = { "Object", 0, 0, 0, CREATE_METHOD_TABLE(JSObject) };
    5151
    5252static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode)
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp

    r95901 r95936  
    3636ASSERT_CLASS_FITS_IN_CELL(JSPropertyNameIterator);
    3737
    38 const ClassInfo JSPropertyNameIterator::s_info = { "JSPropertyNameIterator", 0, 0, 0 };
     38const ClassInfo JSPropertyNameIterator::s_info = { "JSPropertyNameIterator", 0, 0, 0, CREATE_METHOD_TABLE(JSPropertyNameIterator) };
    3939
    4040inline JSPropertyNameIterator::JSPropertyNameIterator(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlots)
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r94875 r95936  
    3535static const unsigned substringFromRopeCutoff = 4;
    3636
    37 const ClassInfo JSString::s_info = { "string", 0, 0, 0 };
     37const ClassInfo JSString::s_info = { "string", 0, 0, 0, CREATE_METHOD_TABLE(JSString) };
    3838
    3939void JSString::resolveRope(ExecState* exec) const
  • trunk/Source/JavaScriptCore/runtime/JSWrapperObject.h

    r95849 r95936  
    4545        static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
    4646
    47     private:
    4847        virtual void visitChildrenVirtual(SlotVisitor&);
    4948        static void visitChildren(JSCell*, SlotVisitor&);
    5049       
     50    private:
    5151        WriteBarrier<Unknown> m_internalValue;
    5252    };
  • trunk/Source/JavaScriptCore/runtime/MathObject.cpp

    r94875 r95936  
    6060namespace JSC {
    6161
    62 const ClassInfo MathObject::s_info = { "Math", &JSNonFinalObject::s_info, 0, ExecState::mathTable };
     62const ClassInfo MathObject::s_info = { "Math", &JSNonFinalObject::s_info, 0, ExecState::mathTable, CREATE_METHOD_TABLE(MathObject) };
    6363
    6464/* Source for MathObject.lut.h
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r95849 r95936  
    3131ASSERT_CLASS_FITS_IN_CELL(NativeErrorConstructor);
    3232
    33 const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0 };
     33const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(NativeErrorConstructor) };
    3434
    3535NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r95108 r95936  
    4343namespace JSC {
    4444
    45 const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberConstructorTable };
     45const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberConstructorTable, CREATE_METHOD_TABLE(NumberConstructor) };
    4646
    4747/* Source for NumberConstructor.lut.h
  • trunk/Source/JavaScriptCore/runtime/NumberObject.cpp

    r95893 r95936  
    3030ASSERT_CLASS_FITS_IN_CELL(NumberObject);
    3131
    32 const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, 0 };
     32const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(NumberObject) };
    3333
    3434NumberObject::NumberObject(JSGlobalData& globalData, Structure* structure)
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r95108 r95936  
    5656namespace JSC {
    5757
    58 const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0, ExecState::numberPrototypeTable };
     58const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0, ExecState::numberPrototypeTable, CREATE_METHOD_TABLE(NumberPrototype) };
    5959
    6060/* Source for NumberPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r95108 r95936  
    5656namespace JSC {
    5757
    58 const ClassInfo ObjectConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::objectConstructorTable };
     58const ClassInfo ObjectConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::objectConstructorTable, CREATE_METHOD_TABLE(ObjectConstructor) };
    5959
    6060/* Source for ObjectConstructor.lut.h
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r94929 r95936  
    4545namespace JSC {
    4646
    47 const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, ExecState::objectPrototypeTable };
     47const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, ExecState::objectPrototypeTable, CREATE_METHOD_TABLE(ObjectPrototype) };
    4848
    4949/* Source for ObjectPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/RegExp.cpp

    r94981 r95936  
    3939namespace JSC {
    4040
    41 const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0 };
     41const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0, CREATE_METHOD_TABLE(RegExp) };
    4242
    4343RegExpFlags regExpFlags(const UString& string)
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r95108 r95936  
    6868ASSERT_CLASS_FITS_IN_CELL(RegExpConstructor);
    6969
    70 const ClassInfo RegExpConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::regExpConstructorTable };
     70const ClassInfo RegExpConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::regExpConstructorTable, CREATE_METHOD_TABLE(RegExpConstructor) };
    7171
    7272/* Source for RegExpConstructor.lut.h
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r95849 r95936  
    5151ASSERT_CLASS_FITS_IN_CELL(RegExpObject);
    5252
    53 const ClassInfo RegExpObject::s_info = { "RegExp", &JSNonFinalObject::s_info, 0, ExecState::regExpTable };
     53const ClassInfo RegExpObject::s_info = { "RegExp", &JSNonFinalObject::s_info, 0, ExecState::regExpTable, CREATE_METHOD_TABLE(RegExpObject) };
    5454
    5555/* Source for RegExpObject.lut.h
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r95849 r95936  
    8282        static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | Base::StructureFlags;
    8383
    84     private:
    8584        virtual void visitChildrenVirtual(SlotVisitor&);
    8685        static void visitChildren(JSCell*, SlotVisitor&);
    8786
     87    private:
    8888        bool match(ExecState*);
    8989
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r95108 r95936  
    5050namespace JSC {
    5151
    52 const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0, ExecState::regExpPrototypeTable };
     52const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0, ExecState::regExpPrototypeTable, CREATE_METHOD_TABLE(RegExpPrototype) };
    5353
    5454/* Source for RegExpPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/ScopeChain.cpp

    r95849 r95936  
    5252#endif
    5353
    54 const ClassInfo ScopeChainNode::s_info = { "ScopeChainNode", 0, 0, 0 };
     54const ClassInfo ScopeChainNode::s_info = { "ScopeChainNode", 0, 0, 0, CREATE_METHOD_TABLE(ScopeChainNode) };
    5555
    5656int ScopeChainNode::localDepth()
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r95108 r95936  
    3838namespace JSC {
    3939
    40 const ClassInfo StringConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::stringConstructorTable };
     40const ClassInfo StringConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::stringConstructorTable, CREATE_METHOD_TABLE(StringConstructor) };
    4141
    4242/* Source for StringConstructor.lut.h
  • trunk/Source/JavaScriptCore/runtime/StringObject.cpp

    r94875 r95936  
    2828ASSERT_CLASS_FITS_IN_CELL(StringObject);
    2929
    30 const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0 };
     30const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(StringObject) };
    3131
    3232StringObject::StringObject(JSGlobalData& globalData, Structure* structure)
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r95787 r95936  
    8686namespace JSC {
    8787
    88 const ClassInfo StringPrototype::s_info = { "String", &StringObject::s_info, 0, ExecState::stringTable };
     88const ClassInfo StringPrototype::s_info = { "String", &StringObject::s_info, 0, ExecState::stringTable, CREATE_METHOD_TABLE(StringPrototype) };
    8989
    9090/* Source for StringPrototype.lut.h
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r95901 r95936  
    176176}
    177177
    178 const ClassInfo Structure::s_info = { "Structure", 0, 0, 0 };
     178const ClassInfo Structure::s_info = { "Structure", 0, 0, 0, CREATE_METHOD_TABLE(Structure) };
    179179
    180180Structure::Structure(JSGlobalData& globalData)
  • trunk/Source/JavaScriptCore/runtime/StructureChain.cpp

    r95901 r95936  
    3333namespace JSC {
    3434   
    35 ClassInfo StructureChain::s_info = { "StructureChain", 0, 0, 0 };
     35ClassInfo StructureChain::s_info = { "StructureChain", 0, 0, 0, CREATE_METHOD_TABLE(StructureChain) };
    3636
    3737StructureChain::StructureChain(JSGlobalData& globalData, Structure* structure)
  • trunk/Source/JavaScriptGlue/ChangeLog

    r95849 r95936  
     12011-09-25  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add custom vtable struct to ClassInfo struct
     4        https://bugs.webkit.org/show_bug.cgi?id=68567
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
     9        specified class in its ClassInfo.  Also added to it the first function to use
     10        this macro, visitChildren.  This is part of the process of getting rid of all
     11        C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
     12        that can't easily be converted to non-virtual functions will be put into
     13        this custom vtable structure.
     14
     15        * UserObjectImp.cpp:
     16
    1172011-09-23  Mark Hahnenberg  <mhahnenberg@apple.com>
    218
  • trunk/Source/JavaScriptGlue/UserObjectImp.cpp

    r95849 r95936  
    3333#include <JavaScriptCore/PropertyNameArray.h>
    3434
    35 const ClassInfo UserObjectImp::s_info = { "UserObject", &JSNonFinalObject::s_info, 0, 0 };
     35const ClassInfo UserObjectImp::s_info = { "UserObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(UserObjectImp) };
    3636
    3737UserObjectImp::UserObjectImp(JSGlobalData& globalData, Structure* structure, JSUserObject* userObject)
  • trunk/Source/WebCore/ChangeLog

    r95935 r95936  
     12011-09-25  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add custom vtable struct to ClassInfo struct
     4        https://bugs.webkit.org/show_bug.cgi?id=68567
     5
     6        Reviewed by Oliver Hunt.
     7
     8        No new tests.
     9
     10        Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
     11        specified class in its ClassInfo.  Also added to it the first function to use
     12        this macro, visitChildren.  This is part of the process of getting rid of all
     13        C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
     14        that can't easily be converted to non-virtual functions will be put into
     15        this custom vtable structure.
     16
     17        * bindings/js/JSAudioConstructor.cpp:
     18        * bindings/js/JSDOMGlobalObject.cpp:
     19        * bindings/js/JSDOMWindowBase.cpp:
     20        * bindings/js/JSDOMWindowShell.cpp:
     21        * bindings/js/JSImageConstructor.cpp:
     22        * bindings/js/JSImageDataCustom.cpp:
     23        (WebCore::toJS):
     24        * bindings/js/JSOptionConstructor.cpp:
     25        * bindings/js/JSWorkerContextBase.cpp:
     26
     27        Changed the bindings generator to add the call to the CREATE_METHOD_TABLE macro where
     28        necessary.
     29        * bindings/scripts/CodeGeneratorJS.pm:
     30        (GenerateImplementation):
     31        (GenerateConstructorDefinition):
     32        * bindings/scripts/test/JS/JSTestInterface.cpp:
     33        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
     34        * bindings/scripts/test/JS/JSTestObj.cpp:
     35        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
     36        * bridge/c/CRuntimeObject.cpp:
     37        * bridge/c/c_instance.cpp:
     38        * bridge/jni/jsc/JavaInstanceJSC.cpp:
     39        * bridge/jni/jsc/JavaRuntimeObject.cpp:
     40        * bridge/objc/ObjCRuntimeObject.mm:
     41        * bridge/objc/objc_instance.mm:
     42        * bridge/objc/objc_runtime.mm:
     43        * bridge/qt/qt_instance.cpp:
     44        * bridge/qt/qt_pixmapruntime.cpp:
     45        * bridge/qt/qt_runtime.cpp:
     46        * bridge/runtime_array.cpp:
     47        * bridge/runtime_method.cpp:
     48        * bridge/runtime_object.cpp:
     49
    1502011-09-25  Eunmi Lee  <eunmi15.lee@samsung.com>
    251
  • trunk/Source/WebCore/bindings/js/JSAudioConstructor.cpp

    r95250 r95936  
    3838namespace WebCore {
    3939
    40 const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
     40const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", &DOMConstructorWithDocument::s_info, 0, 0, CREATE_METHOD_TABLE(JSAudioConstructor) };
    4141
    4242JSAudioConstructor::JSAudioConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp

    r95849 r95936  
    4141namespace WebCore {
    4242
    43 const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0 };
     43const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMGlobalObject) };
    4444
    4545JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world)
  • trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp

    r95250 r95936  
    4242namespace WebCore {
    4343
    44 const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0 };
     44const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowBase) };
    4545
    4646JSDOMWindowBase::JSDOMWindowBase(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp

    r95901 r95936  
    4242ASSERT_CLASS_FITS_IN_CELL(JSDOMWindowShell);
    4343
    44 const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0 };
     44const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowShell) };
    4545
    4646JSDOMWindowShell::JSDOMWindowShell(Structure* structure, DOMWrapperWorld* world)
  • trunk/Source/WebCore/bindings/js/JSImageConstructor.cpp

    r95250 r95936  
    3333ASSERT_CLASS_FITS_IN_CELL(JSImageConstructor);
    3434
    35 const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
     35const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", &DOMConstructorWithDocument::s_info, 0, 0, CREATE_METHOD_TABLE(JSImageConstructor) };
    3636
    3737JSImageConstructor::JSImageConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
  • trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp

    r95901 r95936  
    4848    wrapper = CREATE_DOM_WRAPPER(exec, globalObject, ImageData, imageData);
    4949    Identifier dataName(exec, "data");
    50     static const ClassInfo cpaClassInfo = { "CanvasPixelArray", &JSByteArray::Base::s_info, 0, 0 };
     50    static const ClassInfo cpaClassInfo = { "CanvasPixelArray", &JSByteArray::Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
    5151    Structure* cpaStructure = getCachedDOMStructure(globalObject, &cpaClassInfo);
    5252    if (!cpaStructure)
  • trunk/Source/WebCore/bindings/js/JSOptionConstructor.cpp

    r95250 r95936  
    3434ASSERT_CLASS_FITS_IN_CELL(JSOptionConstructor);
    3535
    36 const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
     36const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", &DOMConstructorWithDocument::s_info, 0, 0, CREATE_METHOD_TABLE(JSOptionConstructor) };
    3737
    3838JSOptionConstructor::JSOptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
  • trunk/Source/WebCore/bindings/js/JSWorkerContextBase.cpp

    r95250 r95936  
    4747ASSERT_CLASS_FITS_IN_CELL(JSWorkerContextBase);
    4848
    49 const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", &JSDOMGlobalObject::s_info, 0, 0 };
     49const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", &JSDOMGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSWorkerContextBase) };
    5050
    5151JSWorkerContextBase::JSWorkerContextBase(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<WorkerContext> impl)
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r95849 r95936  
    14221422        push(@implContent, "    return getHashTableForGlobalData(exec->globalData(), &${className}PrototypeTable);\n");
    14231423        push(@implContent, "}\n\n");
    1424         push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, 0, get${className}PrototypeTable };\n\n");
     1424        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");
    14251425    } else {
    1426         push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, &${className}PrototypeTable, 0 };\n\n");
     1426        push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleClassName}Prototype\", &JSC::JSNonFinalObject::s_info, &${className}PrototypeTable, 0, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
    14271427    }
    14281428    if ($interfaceName ne "DOMWindow" && !$dataNode->extendedAttributes->{"IsWorkerContext"}) {
     
    15011501        push(@implContent, ", 0 ");
    15021502    }
    1503     push(@implContent, "};\n\n");
     1503    push(@implContent, ", CREATE_METHOD_TABLE($className) };\n\n");
    15041504
    15051505    my $implType = $implClassName;
     
    31803180    my $numberOfconstructParameters = $dataNode->extendedAttributes->{"ConstructorParameters"};
    31813181
    3182     push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0 };\n\n");
     3182    push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0, CREATE_METHOD_TABLE($constructorClassName) };\n\n");
    31833183
    31843184    push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n");
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r95901 r95936  
    100100};
    101101
    102 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 };
     102const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestInterfaceConstructor) };
    103103
    104104JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     
    157157#undef THUNK_GENERATOR
    158158static JSC_CONST_HASHTABLE HashTable JSTestInterfacePrototypeTable = { 1, 0, JSTestInterfacePrototypeTableValues, 0 };
    159 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestInterfacePrototypeTable, 0 };
     159const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestInterfacePrototype) };
    160160
    161161JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    164164}
    165165
    166 const ClassInfo JSTestInterface::s_info = { "TestInterface", &JSDOMWrapper::s_info, &JSTestInterfaceTable, 0 };
     166const ClassInfo JSTestInterface::s_info = { "TestInterface", &JSDOMWrapper::s_info, &JSTestInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestInterface) };
    167167
    168168JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp

    r95901 r95936  
    9999};
    100100
    101 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 };
     101const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListenerConstructor) };
    102102
    103103JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     
    143143#undef THUNK_GENERATOR
    144144static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
    145 const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSNonFinalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0 };
     145const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSNonFinalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListenerPrototype) };
    146146
    147147JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    160160}
    161161
    162 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &JSDOMWrapper::s_info, &JSTestMediaQueryListListenerTable, 0 };
     162const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &JSDOMWrapper::s_info, &JSTestMediaQueryListListenerTable, 0 , CREATE_METHOD_TABLE(JSTestMediaQueryListListener) };
    163163
    164164JSTestMediaQueryListListener::JSTestMediaQueryListListener(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r95901 r95936  
    201201};
    202202
    203 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 };
     203const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
    204204
    205205JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     
    300300#undef THUNK_GENERATOR
    301301static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 137, 127, JSTestObjPrototypeTableValues, 0 };
    302 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSNonFinalObject::s_info, &JSTestObjPrototypeTable, 0 };
     302const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSNonFinalObject::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
    303303
    304304JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    317317}
    318318
    319 const ClassInfo JSTestObj::s_info = { "TestObj", &JSDOMWrapper::s_info, &JSTestObjTable, 0 };
     319const ClassInfo JSTestObj::s_info = { "TestObj", &JSDOMWrapper::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) };
    320320
    321321JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp

    r95901 r95936  
    100100};
    101101
    102 const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 };
     102const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfaceConstructor) };
    103103
    104104JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     
    143143#undef THUNK_GENERATOR
    144144static JSC_CONST_HASHTABLE HashTable JSTestSerializedScriptValueInterfacePrototypeTable = { 1, 0, JSTestSerializedScriptValueInterfacePrototypeTableValues, 0 };
    145 const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestSerializedScriptValueInterfacePrototypeTable, 0 };
     145const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestSerializedScriptValueInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfacePrototype) };
    146146
    147147JSObject* JSTestSerializedScriptValueInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    150150}
    151151
    152 const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &JSDOMWrapper::s_info, &JSTestSerializedScriptValueInterfaceTable, 0 };
     152const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &JSDOMWrapper::s_info, &JSTestSerializedScriptValueInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterface) };
    153153
    154154JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
  • trunk/Source/WebCore/bridge/c/CRuntimeObject.cpp

    r95901 r95936  
    3636namespace Bindings {
    3737
    38 const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_info, 0, 0 };
     38const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(CRuntimeObject) };
    3939
    4040CRuntimeObject::CRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<CInstance> instance)
  • trunk/Source/WebCore/bridge/c/c_instance.cpp

    r95250 r95936  
    145145};
    146146
    147 const ClassInfo CRuntimeMethod::s_info = { "CRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
     147const ClassInfo CRuntimeMethod::s_info = { "CRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(CRuntimeMethod) };
    148148
    149149JSValue CInstance::getMethod(ExecState* exec, const Identifier& propertyName)
  • trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp

    r95250 r95936  
    149149};
    150150
    151 const ClassInfo JavaRuntimeMethod::s_info = { "JavaRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
     151const ClassInfo JavaRuntimeMethod::s_info = { "JavaRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(JavaRuntimeMethod) };
    152152
    153153JSValue JavaInstance::getMethod(ExecState* exec, const Identifier& propertyName)
  • trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp

    r95901 r95936  
    3434namespace Bindings {
    3535
    36 const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObject::s_info, 0, 0 };
     36const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(JavaRuntimeObject) };
    3737
    3838JavaRuntimeObject::JavaRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<JavaInstance> instance)
  • trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.mm

    r95901 r95936  
    3434namespace Bindings {
    3535
    36 const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObject::s_info, 0, 0 };
     36const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCRuntimeObject) };
    3737
    3838ObjCRuntimeObject::ObjCRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ObjcInstance> instance, Structure* structure)
  • trunk/Source/WebCore/bridge/objc/objc_instance.mm

    r95675 r95936  
    205205};
    206206
    207 const ClassInfo ObjCRuntimeMethod::s_info = { "ObjCRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
     207const ClassInfo ObjCRuntimeMethod::s_info = { "ObjCRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCRuntimeMethod) };
    208208
    209209JSValue ObjcInstance::getMethod(ExecState* exec, const Identifier& propertyName)
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r95675 r95936  
    191191}
    192192
    193 const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JSNonFinalObject::s_info, 0, 0 };
     193const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjcFallbackObjectImp) };
    194194
    195195ObjcFallbackObjectImp::ObjcFallbackObjectImp(JSGlobalObject* globalObject, Structure* structure, ObjcInstance* i, const Identifier& propertyName)
  • trunk/Source/WebCore/bridge/qt/qt_instance.cpp

    r95849 r95936  
    8989};
    9090
    91 const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0 };
     91const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeObject) };
    9292
    9393QtRuntimeObject::QtRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
  • trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp

    r95901 r95936  
    229229}
    230230
    231 const ClassInfo QtPixmapRuntimeObject::s_info = { "QtPixmapRuntimeObject", &RuntimeObject::s_info, 0, 0 };
     231const ClassInfo QtPixmapRuntimeObject::s_info = { "QtPixmapRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(QtPixmapRuntimeObject) };
    232232
    233233QtPixmapClass::QtPixmapClass()
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r95849 r95936  
    10051005#define QW_DS(Class,Instance) Class##Data* d = Instance->d_func()
    10061006
    1007 const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0 };
     1007const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMethod) };
    10081008
    10091009QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const Identifier& identifier)
  • trunk/Source/WebCore/bridge/runtime_array.cpp

    r94875 r95936  
    3636namespace JSC {
    3737
    38 const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &JSArray::s_info, 0, 0 };
     38const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &JSArray::s_info, 0, 0, CREATE_METHOD_TABLE(RuntimeArray) };
    3939
    4040RuntimeArray::RuntimeArray(ExecState* exec, Structure* structure)
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r95108 r95936  
    4242ASSERT_CLASS_FITS_IN_CELL(RuntimeMethod);
    4343
    44 const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0 };
     44const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(RuntimeMethod) };
    4545
    4646RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& m)
  • trunk/Source/WebCore/bridge/runtime_object.cpp

    r94875 r95936  
    3636namespace Bindings {
    3737
    38 const ClassInfo RuntimeObject::s_info = { "RuntimeObject", &JSNonFinalObject::s_info, 0, 0 };
     38const ClassInfo RuntimeObject::s_info = { "RuntimeObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(RuntimeObject) };
    3939
    4040RuntimeObject::RuntimeObject(ExecState*, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
  • trunk/Source/WebKit/mac/ChangeLog

    r95919 r95936  
     12011-09-25  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add custom vtable struct to ClassInfo struct
     4        https://bugs.webkit.org/show_bug.cgi?id=68567
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
     9        specified class in its ClassInfo.  Also added to it the first function to use
     10        this macro, visitChildren.  This is part of the process of getting rid of all
     11        C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
     12        that can't easily be converted to non-virtual functions will be put into
     13        this custom vtable structure.
     14
     15        * Plugins/Hosted/ProxyInstance.mm:
     16        * Plugins/Hosted/ProxyRuntimeObject.mm:
     17
    1182011-09-24  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm

    r95901 r95936  
    212212};
    213213
    214 const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
     214const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMethod::s_info, 0, 0, CREATE_METHOD_TABLE(ProxyRuntimeMethod) };
    215215
    216216JSValue ProxyInstance::getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName)
  • trunk/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm

    r95901 r95936  
    3535
    3636
    37 const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0 };
     37const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0, CREATE_METHOD_TABLE(ProxyRuntimeObject) };
    3838
    3939ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<ProxyInstance> instance)
  • trunk/Source/WebKit2/ChangeLog

    r95934 r95936  
     12011-09-25  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add custom vtable struct to ClassInfo struct
     4        https://bugs.webkit.org/show_bug.cgi?id=68567
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
     9        specified class in its ClassInfo.  Also added to it the first function to use
     10        this macro, visitChildren.  This is part of the process of getting rid of all
     11        C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
     12        that can't easily be converted to non-virtual functions will be put into
     13        this custom vtable structure.
     14
     15        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
     16        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
     17
    1182011-09-25  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp

    r95901 r95936  
    4040namespace WebKit {
    4141
    42 const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 };
     42const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSNPMethod) };
    4343
    4444JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier)
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r95901 r95936  
    4949}
    5050
    51 const ClassInfo JSNPObject::s_info = { "NPObject", &JSNonFinalObject::s_info, 0, 0 };
     51const ClassInfo JSNPObject::s_info = { "NPObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSNPObject) };
    5252
    5353JSNPObject::JSNPObject(JSGlobalObject* globalObject, Structure* structure, NPRuntimeObjectMap* objectMap, NPObject* npObject)
Note: See TracChangeset for help on using the changeset viewer.