Commit 3e084662 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dd2555de
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
namespace JSC { 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) JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)
: JSNonFinalObject(globalObject->globalData(), structure) : JSNonFinalObject(globalObject->globalData(), structure)
......
...@@ -40,7 +40,7 @@ namespace JSC { ...@@ -40,7 +40,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction); 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) JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
: InternalFunction(globalObject, globalObject->callbackFunctionStructure()) : InternalFunction(globalObject, globalObject->callbackFunctionStructure())
......
...@@ -36,8 +36,8 @@ ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSNonFinalObject>); ...@@ -36,8 +36,8 @@ ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSNonFinalObject>);
ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSGlobalObject>); ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject<JSGlobalObject>);
// Define the two types of JSCallbackObjects we support. // 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<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 }; 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) 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> 2011-09-25 Adam Barth <abarth@webkit.org>
Finish removing PLATFORM(BREWMP) by removing associated code Finish removing PLATFORM(BREWMP) by removing associated code
...@@ -273,6 +273,7 @@ __ZN3JSC6JSLockC1EPNS_9ExecStateE ...@@ -273,6 +273,7 @@ __ZN3JSC6JSLockC1EPNS_9ExecStateE
__ZN3JSC6RegExp5matchERNS_12JSGlobalDataERKNS_7UStringEiPN3WTF6VectorIiLm32EEE __ZN3JSC6RegExp5matchERNS_12JSGlobalDataERKNS_7UStringEiPN3WTF6VectorIiLm32EEE
__ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE __ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
__ZN3JSC6RegExpD1Ev __ZN3JSC6RegExpD1Ev
__ZN3JSC7JSArray13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataE __ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataE
__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataERKNS_7ArgListE __ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataERKNS_7ArgListE
__ZN3JSC7JSArray15setSubclassDataEPv __ZN3JSC7JSArray15setSubclassDataEPv
......
...@@ -35,7 +35,7 @@ namespace JSC { ...@@ -35,7 +35,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(Arguments); 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() Arguments::~Arguments()
{ {
......
...@@ -41,7 +41,7 @@ static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*); ...@@ -41,7 +41,7 @@ static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
namespace JSC { 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 /* Source for ArrayConstructor.lut.h
@begin arrayConstructorTable @begin arrayConstructorTable
......
...@@ -85,7 +85,7 @@ static inline bool isNumericCompareFunction(ExecState* exec, CallType callType, ...@@ -85,7 +85,7 @@ static inline bool isNumericCompareFunction(ExecState* exec, CallType callType,
// ------------------------------ ArrayPrototype ---------------------------- // ------------------------------ 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 /* Source for ArrayPrototype.lut.h
@begin arrayPrototypeTable 16 @begin arrayPrototypeTable 16
......
...@@ -25,7 +25,7 @@ namespace JSC { ...@@ -25,7 +25,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(BooleanObject); 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) BooleanObject::BooleanObject(JSGlobalData& globalData, Structure* structure)
: JSWrapperObject(globalData, structure) : JSWrapperObject(globalData, structure)
......
...@@ -38,7 +38,7 @@ static EncodedJSValue JSC_HOST_CALL booleanProtoFuncValueOf(ExecState*); ...@@ -38,7 +38,7 @@ static EncodedJSValue JSC_HOST_CALL booleanProtoFuncValueOf(ExecState*);
namespace JSC { 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 /* Source for BooleanPrototype.lut.h
@begin booleanPrototypeTable @begin booleanPrototypeTable
......
...@@ -30,6 +30,15 @@ namespace JSC { ...@@ -30,6 +30,15 @@ namespace JSC {
class HashEntry; class HashEntry;
struct HashTable; struct HashTable;
struct MethodTable {
typedef void (*VisitChildrenFunctionPtr)(JSCell*, SlotVisitor&);
VisitChildrenFunctionPtr visitChildrenFunctionPtr;
};
#define CREATE_METHOD_TABLE(ClassName) { \
&ClassName::visitChildren \
}
struct ClassInfo { struct ClassInfo {
/** /**
* A string denoting the class name. Example: "Window". * A string denoting the class name. Example: "Window".
...@@ -64,6 +73,8 @@ namespace JSC { ...@@ -64,6 +73,8 @@ namespace JSC {
const HashTable* staticPropHashTable; const HashTable* staticPropHashTable;
typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*); typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
const ClassPropHashTableGetterFunction classPropHashTableGetterFunction; const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
MethodTable methodTable;
}; };
} // namespace JSC } // namespace JSC
......
...@@ -61,7 +61,7 @@ static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState*); ...@@ -61,7 +61,7 @@ static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState*);
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 /* Source for DateConstructor.lut.h
@begin dateConstructorTable @begin dateConstructorTable
......
...@@ -32,7 +32,7 @@ using namespace WTF; ...@@ -32,7 +32,7 @@ using namespace WTF;
namespace JSC { 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) DateInstance::DateInstance(ExecState* exec, Structure* structure)
: JSWrapperObject(exec->globalData(), structure) : JSWrapperObject(exec->globalData(), structure)
......
...@@ -375,7 +375,7 @@ static bool fillStructuresUsingDateArgs(ExecState *exec, int maxArgs, double *ms ...@@ -375,7 +375,7 @@ static bool fillStructuresUsingDateArgs(ExecState *exec, int maxArgs, double *ms
return ok; 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 /* Source for DatePrototype.lut.h
@begin dateTable @begin dateTable
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
namespace JSC { 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) ErrorInstance::ErrorInstance(JSGlobalData& globalData, Structure* structure)
: JSNonFinalObject(globalData, structure) : JSNonFinalObject(globalData, structure)
......
...@@ -40,7 +40,7 @@ static EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState*); ...@@ -40,7 +40,7 @@ static EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState*);
namespace JSC { 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 /* Source for ErrorPrototype.lut.h
@begin errorPrototypeTable @begin errorPrototypeTable
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
namespace JSC { 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 UString InterruptedExecutionError::toString(ExecState*) const
{ {
...@@ -64,7 +64,7 @@ bool isInterruptedExecutionException(JSValue value) ...@@ -64,7 +64,7 @@ bool isInterruptedExecutionException(JSValue value)
} }
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 UString TerminatedExecutionError::toString(ExecState*) const
{ {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
namespace JSC { 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() void ExecutableBase::clearCode()
{ {
...@@ -71,7 +71,7 @@ WeakHandleOwner* ExecutableBase::executableFinalizer() ...@@ -71,7 +71,7 @@ WeakHandleOwner* ExecutableBase::executableFinalizer()
return &finalizer; 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() NativeExecutable::~NativeExecutable()
{ {
...@@ -98,9 +98,9 @@ static void jettisonCodeBlock(JSGlobalData& globalData, OwnPtr<T>& codeBlock) ...@@ -98,9 +98,9 @@ static void jettisonCodeBlock(JSGlobalData& globalData, OwnPtr<T>& codeBlock)
} }
#endif #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) EvalExecutable::EvalExecutable(ExecState* exec, const SourceCode& source, bool inStrictContext)
: ScriptExecutable(exec->globalData().evalExecutableStructure.get(), exec, source, inStrictContext) : ScriptExecutable(exec->globalData().evalExecutableStructure.get(), exec, source, inStrictContext)
...@@ -111,7 +111,7 @@ EvalExecutable::~EvalExecutable() ...@@ -111,7 +111,7 @@ EvalExecutable::~EvalExecutable()
{ {
} }
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) ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source)
: ScriptExecutable(exec->globalData().programExecutableStructure.get(), exec, source, false) : ScriptExecutable(exec->globalData().programExecutableStructure.get(), exec, source, false)
...@@ -122,7 +122,7 @@ ProgramExecutable::~ProgramExecutable() ...@@ -122,7 +122,7 @@ ProgramExecutable::~ProgramExecutable()
{ {
} }
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) FunctionExecutable::FunctionExecutable(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool inStrictContext)
: ScriptExecutable(globalData.functionExecutableStructure.get(), globalData, source, inStrictContext) : ScriptExecutable(globalData.functionExecutableStructure.get(), globalData, source, inStrictContext)
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
namespace JSC { 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) void GetterSetter::visitChildrenVirtual(SlotVisitor& visitor)
{ {
......
...@@ -34,7 +34,7 @@ void InternalFunction::vtableAnchor() {} ...@@ -34,7 +34,7 @@ void InternalFunction::vtableAnchor() {}
ASSERT_CLASS_FITS_IN_CELL(InternalFunction); 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) InternalFunction::InternalFunction(VPtrStealingHackType)
: JSNonFinalObject(VPtrStealingHack) : JSNonFinalObject(VPtrStealingHack)
......
...@@ -28,6 +28,6 @@ ...@@ -28,6 +28,6 @@
namespace JSC { 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 } // namespace JSC
...@@ -37,7 +37,7 @@ namespace JSC { ...@@ -37,7 +37,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSActivation); 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) JSActivation::JSActivation(CallFrame* callFrame, FunctionExecutable* functionExecutable)
: Base(callFrame->globalData(), callFrame->globalData().activationStructure.get(), functionExecutable->symbolTable(), callFrame->registers()) : Base(callFrame->globalData(), callFrame->globalData().activationStructure.get(), functionExecutable->symbolTable(), callFrame->registers())
......
...@@ -92,7 +92,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSArray); ...@@ -92,7 +92,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSArray);
// as long as it is 1/8 full. If more sparse than that, we use a map. // as long as it is 1/8 full. If more sparse than that, we use a map.
static const unsigned minDensityMultiplier = 8; 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 // 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. // as a simple heuristic for as the value to grow the next array from size 0.
......
...@@ -33,7 +33,7 @@ using namespace WTF; ...@@ -33,7 +33,7 @@ using namespace WTF;
namespace JSC { 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) JSByteArray::JSByteArray(ExecState* exec, Structure* structure, ByteArray* storage)
: JSNonFinalObject(exec->globalData(), structure) : JSNonFinalObject(exec->globalData(), structure)
......
...@@ -50,7 +50,7 @@ EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState* exec) ...@@ -50,7 +50,7 @@ EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState* exec)
ASSERT_CLASS_FITS_IN_CELL(JSFunction); 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 bool JSFunction::isHostFunctionNonInline() const
{ {
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
namespace JSC { 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 /* Source for JSGlobalObject.lut.h
@begin globalObjectTable @begin globalObjectTable
......
...@@ -588,7 +588,7 @@ bool Stringifier::Holder::appendNextProperty(Stringifier& stringifier, UStringBu ...@@ -588,7 +588,7 @@ bool Stringifier::Holder::appendNextProperty(Stringifier& stringifier, UStringBu
// ------------------------------ JSONObject -------------------------------- // ------------------------------ 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 /* Source for JSONObject.lut.h
@begin jsonTable @begin jsonTable
......
...@@ -47,7 +47,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSFinalObject); ...@@ -47,7 +47,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSFinalObject);
const char* StrictModeReadonlyPropertyWriteError = "Attempted to assign to readonly property."; 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) static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode)
{ {
......
...@@ -35,7 +35,7 @@ namespace JSC { ...@@ -35,7 +35,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSPropertyNameIterator); 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) inline JSPropertyNameIterator::JSPropertyNameIterator(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlots)
: JSCell(exec->globalData(), exec->globalData().propertyNameIteratorStructure.get()) : JSCell(exec->globalData(), exec->globalData().propertyNameIteratorStructure.get())
......
...@@ -34,7 +34,7 @@ namespace JSC { ...@@ -34,7 +34,7 @@ namespace JSC {
static const unsigned substringFromRopeCutoff = 4; 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 void JSString::resolveRope(ExecState* exec) const
{ {
......
...@@ -44,10 +44,10 @@ namespace JSC { ...@@ -44,10 +44,10 @@ namespace JSC {
explicit JSWrapperObject(JSGlobalData&, Structure*); explicit JSWrapperObject(JSGlobalData&, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags; static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
private:
virtual void visitChildrenVirtual(SlotVisitor&); virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&); static void visitChildren(JSCell*, SlotVisitor&);
private:
WriteBarrier<Unknown> m_internalValue; WriteBarrier<Unknown> m_internalValue;
}; };
......
...@@ -59,7 +59,7 @@ static EncodedJSValue JSC_HOST_CALL mathProtoFuncTan(ExecState*); ...@@ -59,7 +59,7 @@ static EncodedJSValue JSC_HOST_CALL mathProtoFuncTan(ExecState*);
namespace JSC { 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) };