Commit 8687da90 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
de-virtualizing visitChildren.

* API/JSCallbackObject.h:
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
* debugger/DebuggerActivation.h:
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/Executable.cpp:
* runtime/Executable.h:
* runtime/GetterSetter.cpp:
* runtime/GetterSetter.h:
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
* runtime/JSArray.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSObject.cpp:
* runtime/JSPropertyNameIterator.cpp:
* runtime/JSPropertyNameIterator.h:
* runtime/JSStaticScopeObject.cpp:
* runtime/JSStaticScopeObject.h:
* runtime/JSValue.h:
* runtime/NativeErrorConstructor.cpp:
* runtime/NativeErrorConstructor.h:
* runtime/RegExpObject.cpp:
* runtime/RegExpObject.h:
* runtime/Structure.cpp:
* runtime/Structure.h:
* runtime/StructureChain.cpp:
* runtime/StructureChain.h:

Inlined the method table access and call to the visitChildren function (the only call sites
to visitChildren are here).
* heap/MarkStack.cpp:
(JSC::SlotVisitor::visitChildren):

Changed the field name for the visitChildren function pointer to visitChildren (from
visitChildrenFunctionPtr) to make call sites less verbose.
* runtime/ClassInfo.h:

Discovered JSBoundFunction doesn't have its own ClassInfo (it used JSFunction's ClassInfo) but
overrides visitChildren, so it needs to have its own ClassInfo.
* runtime/JSBoundFunction.cpp:
* runtime/JSBoundFunction.h:

Had to move className up to make sure that the virtual destructor in JSObject wasn't
the first non-inline virtual method in JSObject (as per the comment in the file).
Also moved JSCell::visitChildrenVirtual into JSObject.h in order for it be inline-able
to mitigate the cost of an extra method call.

Also added a convenience accessor function methodTable() to JSCell to return the MethodTable to make
call sites more concise.  Implementation is inline in JSObject.h.
* runtime/JSObject.h:
(JSC::JSCell::methodTable):
* runtime/JSCell.h:

Added an out of line virtual destructor to JSWrapperObject and ScopeChainNode to
appease the vtable gods.  It refused to compile if there were no virtual methods in
both of these classes due to the presence of a weak vtable pointer.
* runtime/JSWrapperObject.cpp:
(JSC::JSWrapperObject::~JSWrapperObject):
* runtime/JSWrapperObject.h:
* runtime/ScopeChain.cpp:
(JSC::ScopeChainNode::~ScopeChainNode):
* runtime/ScopeChain.h:

Source/JavaScriptGlue:

Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
de-virtualizing visitChildren.

* UserObjectImp.cpp:
* UserObjectImp.h:

Source/WebCore:

No new tests.

Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
de-virtualizing visitChildren.

* WebCore.exp.in:
* bindings/js/JSAttrCustom.cpp:
* bindings/js/JSAudioContextCustom.cpp:
* bindings/js/JSCSSRuleCustom.cpp:
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
* bindings/js/JSCanvasRenderingContextCustom.cpp:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
(WebCore::JSDOMGlobalObject::finishCreation):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDOMWindowShell.cpp:
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSJavaScriptAudioNodeCustom.cpp:
* bindings/js/JSMessageChannelCustom.cpp:
* bindings/js/JSMessagePortCustom.cpp:
* bindings/js/JSNamedNodeMapCustom.cpp:
* bindings/js/JSNodeCustom.cpp:
* bindings/js/JSNodeFilterCustom.cpp:
* bindings/js/JSNodeIteratorCustom.cpp:
* bindings/js/JSSVGElementInstanceCustom.cpp:
* bindings/js/JSSharedWorkerCustom.cpp:
* bindings/js/JSStyleSheetCustom.cpp:
* bindings/js/JSTreeWalkerCustom.cpp:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
* bindings/js/JSWorkerContextCustom.cpp:
* bindings/js/JSXMLHttpRequestCustom.cpp:
* bindings/js/JSXPathResultCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bridge/qt/qt_instance.cpp:
* bridge/qt/qt_runtime.cpp:
* bridge/qt/qt_runtime.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5423e021
......@@ -197,11 +197,6 @@ private:
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
virtual void visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
static void visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
......
2011-09-29 Mark Hahnenberg <mhahnenberg@apple.com>
De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods
https://bugs.webkit.org/show_bug.cgi?id=68839
Reviewed by Geoffrey Garen.
Removed the remaining visitChildrenVirtual methods. This patch completes the process of
de-virtualizing visitChildren.
* API/JSCallbackObject.h:
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
* debugger/DebuggerActivation.h:
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/Executable.cpp:
* runtime/Executable.h:
* runtime/GetterSetter.cpp:
* runtime/GetterSetter.h:
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
* runtime/JSArray.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSObject.cpp:
* runtime/JSPropertyNameIterator.cpp:
* runtime/JSPropertyNameIterator.h:
* runtime/JSStaticScopeObject.cpp:
* runtime/JSStaticScopeObject.h:
* runtime/JSValue.h:
* runtime/NativeErrorConstructor.cpp:
* runtime/NativeErrorConstructor.h:
* runtime/RegExpObject.cpp:
* runtime/RegExpObject.h:
* runtime/Structure.cpp:
* runtime/Structure.h:
* runtime/StructureChain.cpp:
* runtime/StructureChain.h:
Inlined the method table access and call to the visitChildren function (the only call sites
to visitChildren are here).
* heap/MarkStack.cpp:
(JSC::SlotVisitor::visitChildren):
Changed the field name for the visitChildren function pointer to visitChildren (from
visitChildrenFunctionPtr) to make call sites less verbose.
* runtime/ClassInfo.h:
Discovered JSBoundFunction doesn't have its own ClassInfo (it used JSFunction's ClassInfo) but
overrides visitChildren, so it needs to have its own ClassInfo.
* runtime/JSBoundFunction.cpp:
* runtime/JSBoundFunction.h:
Had to move className up to make sure that the virtual destructor in JSObject wasn't
the first non-inline virtual method in JSObject (as per the comment in the file).
Also moved JSCell::visitChildrenVirtual into JSObject.h in order for it be inline-able
to mitigate the cost of an extra method call.
Also added a convenience accessor function methodTable() to JSCell to return the MethodTable to make
call sites more concise. Implementation is inline in JSObject.h.
* runtime/JSObject.h:
(JSC::JSCell::methodTable):
* runtime/JSCell.h:
Added an out of line virtual destructor to JSWrapperObject and ScopeChainNode to
appease the vtable gods. It refused to compile if there were no virtual methods in
both of these classes due to the presence of a weak vtable pointer.
* runtime/JSWrapperObject.cpp:
(JSC::JSWrapperObject::~JSWrapperObject):
* runtime/JSWrapperObject.h:
* runtime/ScopeChain.cpp:
(JSC::ScopeChainNode::~ScopeChainNode):
* runtime/ScopeChain.h:
2011-09-29 Yuqiang Xian <yuqiang.xian@intel.com>
Bug fixes for CreateThis, NewObject and GetByOffset in JSVALUE32_64 DFG JIT
......@@ -166,7 +166,6 @@ __ZN3JSC14JSGlobalObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
__ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi
__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
__ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC14JSGlobalObject20visitChildrenVirtualERNS_11SlotVisitorE
__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
......@@ -277,7 +276,6 @@ __ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataE
__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataERKNS_7ArgListE
__ZN3JSC7JSArray15setSubclassDataEPv
__ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC7JSArray20visitChildrenVirtualERNS_11SlotVisitorE
__ZN3JSC7JSArray6s_infoE
__ZN3JSC7JSArray9setLengthEj
__ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEPNS_9StructureE
......@@ -321,7 +319,6 @@ __ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValu
__ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateEjNS_7JSValueEj
__ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
__ZN3JSC8JSObject20visitChildrenVirtualERNS_11SlotVisitorE
__ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
__ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
......
......@@ -33,6 +33,7 @@ EXPORTS
??1JSGlobalObject@JSC@@UAE@XZ
??1Mutex@WTF@@QAE@XZ
??1RefCountedLeakCounter@WTF@@QAE@XZ
??1ScopeChainNode@JSC@@EAE@XZ
??1SourceProviderCache@JSC@@QAE@XZ
??1ThreadCondition@WTF@@QAE@XZ
??1WTFThreadData@WTF@@QAE@XZ
......@@ -372,9 +373,6 @@ EXPORTS
?vtableAnchor@InternalFunction@JSC@@EAEXXZ
?visitChildren@JSGlobalObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
?visitChildren@JSObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
?visitChildrenVirtual@JSGlobalObject@JSC@@UAEXAAVSlotVisitor@2@@Z
?visitChildrenVirtual@JSObject@JSC@@UAEXAAVSlotVisitor@2@@Z
?visitChildrenVirtual@ScopeChainNode@JSC@@UAEXAAVSlotVisitor@2@@Z
?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
?writable@PropertyDescriptor@JSC@@QBE_NXZ
......
......@@ -43,11 +43,6 @@ void DebuggerActivation::finishCreation(JSGlobalData& globalData, JSObject* acti
m_activation.set(globalData, this, static_cast<JSActivation*>(activation));
}
void DebuggerActivation::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void DebuggerActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
......
......@@ -41,7 +41,6 @@ namespace JSC {
return activation;
}
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
virtual UString className() const;
virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
......
......@@ -70,7 +70,7 @@ inline void SlotVisitor::visitChildren(JSCell* cell)
#else
ASSERT(!m_isCheckingForDefaultMarkViolation);
m_isCheckingForDefaultMarkViolation = true;
cell->visitChildrenVirtual(*this);
cell->methodTable()->visitChildren(cell, *this);
ASSERT(m_isCheckingForDefaultMarkViolation);
m_isCheckingForDefaultMarkViolation = false;
#endif
......@@ -80,7 +80,7 @@ inline void SlotVisitor::visitChildren(JSCell* cell)
asArray(cell)->visitChildrenDirect(*this);
return;
}
cell->visitChildrenVirtual(*this);
cell->methodTable()->visitChildren(cell, *this);
}
void SlotVisitor::drain()
......
......@@ -43,11 +43,6 @@ Arguments::~Arguments()
delete [] d->extraArguments;
}
void Arguments::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void Arguments::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
......
......@@ -90,7 +90,6 @@ namespace JSC {
static const ClassInfo s_info;
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
void fillArgList(ExecState*, MarkedArgumentBuffer&);
......
......@@ -32,7 +32,7 @@ namespace JSC {
struct MethodTable {
typedef void (*VisitChildrenFunctionPtr)(JSCell*, SlotVisitor&);
VisitChildrenFunctionPtr visitChildrenFunctionPtr;
VisitChildrenFunctionPtr visitChildren;
};
#define CREATE_METHOD_TABLE(ClassName) { \
......
......@@ -234,11 +234,6 @@ void EvalExecutable::jettisonOptimizedCode(JSGlobalData& globalData)
}
#endif
void EvalExecutable::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void EvalExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
EvalExecutable* thisObject = static_cast<EvalExecutable*>(cell);
......@@ -378,11 +373,6 @@ void ProgramExecutable::unlinkCalls()
#endif
}
void ProgramExecutable::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void ProgramExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
ProgramExecutable* thisObject = static_cast<ProgramExecutable*>(cell);
......@@ -596,11 +586,6 @@ void FunctionExecutable::jettisonOptimizedCodeForConstruct(JSGlobalData& globalD
}
#endif
void FunctionExecutable::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void FunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
FunctionExecutable* thisObject = static_cast<FunctionExecutable*>(cell);
......
......@@ -356,7 +356,6 @@ namespace JSC {
EvalExecutable(ExecState*, const SourceCode&, bool);
JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
void unlinkCalls();
......@@ -422,7 +421,6 @@ namespace JSC {
ProgramExecutable(ExecState*, const SourceCode&);
JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
void unlinkCalls();
......@@ -582,7 +580,6 @@ namespace JSC {
SharedSymbolTable* symbolTable() const { return m_symbolTable; }
void discardCode();
void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
static FunctionExecutable* fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
......
......@@ -30,11 +30,6 @@ namespace JSC {
const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0, CREATE_METHOD_TABLE(GetterSetter) };
void GetterSetter::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void GetterSetter::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
GetterSetter* thisObject = static_cast<GetterSetter*>(cell);
......
......@@ -53,7 +53,6 @@ namespace JSC {
return getterSetter;
}
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
JSObject* getter() const { return m_getter.get(); }
......
......@@ -63,11 +63,6 @@ JSActivation::~JSActivation()
static_cast<SharedSymbolTable*>(m_symbolTable)->deref();
}
void JSActivation::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSActivation* thisObject = static_cast<JSActivation*>(cell);
......
......@@ -55,7 +55,6 @@ namespace JSC {
virtual ~JSActivation();
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
virtual bool isDynamicScope(bool& requiresDynamicChecks) const;
......
......@@ -871,11 +871,6 @@ void JSArray::unshiftCount(ExecState* exec, int count)
vector[i].clear();
}
void JSArray::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSArray::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSArray* thisObject = static_cast<JSArray*>(cell);
......
......@@ -172,7 +172,6 @@ namespace JSC {
virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
virtual bool deleteProperty(ExecState*, unsigned propertyName);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
void* subclassData() const;
......
......@@ -32,6 +32,8 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSBoundFunction);
const ClassInfo JSBoundFunction::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSBoundFunction) };
EncodedJSValue JSC_HOST_CALL boundFunctionCall(ExecState* exec)
{
JSBoundFunction* boundFunction = static_cast<JSBoundFunction*>(exec->callee());
......@@ -140,11 +142,6 @@ void JSBoundFunction::finishCreation(ExecState* exec, NativeExecutable* executab
ASSERT(inherits(&s_info));
}
void JSBoundFunction::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSBoundFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSBoundFunction* thisObject = static_cast<JSBoundFunction*>(cell);
......
......@@ -54,10 +54,11 @@ public:
return Structure::create(globalData, globalObject, prototype, TypeInfo(JSFunctionType, StructureFlags), &s_info);
}
static JS_EXPORTDATA const ClassInfo s_info;
protected:
const static unsigned StructureFlags = OverridesHasInstance | Base::StructureFlags;
const static unsigned StructureFlags = OverridesHasInstance | OverridesVisitChildren | Base::StructureFlags;
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
private:
......
......@@ -85,11 +85,11 @@ namespace JSC {
virtual UString toString(ExecState*) const;
virtual JSObject* toObject(ExecState*, JSGlobalObject*) const;
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
// Object operations, with the toObject operation included.
const ClassInfo* classInfo() const;
const MethodTable* methodTable() const;
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void put(ExecState*, unsigned propertyName, JSValue);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
......@@ -181,11 +181,6 @@ namespace JSC {
return m_structure.get();
}
inline void JSCell::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
inline void JSCell::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSCell* thisObject = static_cast<JSCell*>(cell);
......
......@@ -151,11 +151,6 @@ const UString JSFunction::calculatedDisplayName(ExecState* exec)
return name(exec);
}
void JSFunction::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSFunction* thisObject = static_cast<JSFunction*>(cell);
......
......@@ -135,7 +135,6 @@ namespace JSC {
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
private:
......
......@@ -308,11 +308,6 @@ void JSGlobalObject::resetPrototype(JSGlobalData& globalData, JSValue prototype)
oldLastInPrototypeChain->setPrototype(globalData, objectPrototype);
}
void JSGlobalObject::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell);
......
......@@ -175,7 +175,6 @@ namespace JSC {
public:
virtual ~JSGlobalObject();
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
......
......@@ -68,11 +68,6 @@ static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* class
}
}
void JSObject::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSObject* thisObject = static_cast<JSObject*>(cell);
......
......@@ -79,10 +79,11 @@ namespace JSC {
public:
typedef JSCell Base;
virtual void visitChildrenVirtual(SlotVisitor&);
ALWAYS_INLINE void visitChildrenDirect(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
virtual UString className() const;
// The inline virtual destructor cannot be the first virtual function declared
// in the class as it results in the vtable being generated as a weak symbol
virtual ~JSObject();
......@@ -93,8 +94,6 @@ namespace JSC {
Structure* inheritorID(JSGlobalData&);
virtual UString className() const;
JSValue get(ExecState*, const Identifier& propertyName) const;
JSValue get(ExecState*, unsigned propertyName) const;
......@@ -485,6 +484,11 @@ inline bool JSCell::inherits(const ClassInfo* info) const
return classInfo()->isSubClassOf(info);
}
inline const MethodTable* JSCell::methodTable() const
{
return &classInfo()->methodTable;
}
// this method is here to be after the inline declaration of JSCell::inherits
inline bool JSValue::inherits(const ClassInfo* classInfo) const
{
......
......@@ -92,11 +92,6 @@ JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i)
return identifier;
}
void JSPropertyNameIterator::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSPropertyNameIterator::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSPropertyNameIterator* thisObject = static_cast<JSPropertyNameIterator*>(cell);
......
......@@ -58,7 +58,6 @@ namespace JSC {
return Structure::create(globalData, globalObject, prototype, TypeInfo(CompoundType, OverridesVisitChildren), &s_info);
}
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
bool getOffset(size_t i, int& offset)
......
......@@ -32,11 +32,6 @@
namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSStaticScopeObject);
void JSStaticScopeObject::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void JSStaticScopeObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSStaticScopeObject* thisObject = static_cast<JSStaticScopeObject*>(cell);
......
......@@ -41,7 +41,6 @@ namespace JSC{
return scopeObject;
}
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
bool isDynamicScope(bool& requiresDynamicChecks) const;
virtual JSObject* toThisObject(ExecState*) const;
......
......@@ -54,6 +54,7 @@ namespace JSC {
struct ClassInfo;
struct Instruction;
struct MethodTable;
template <class T> class WriteBarrierBase;
......
......@@ -26,9 +26,8 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSWrapperObject);
void JSWrapperObject::visitChildrenVirtual(SlotVisitor& visitor)
JSWrapperObject::~JSWrapperObject()
{
visitChildren(this, visitor);
}
void JSWrapperObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
......
......@@ -44,8 +44,9 @@ namespace JSC {
explicit JSWrapperObject(JSGlobalData&, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
virtual ~JSWrapperObject();
private:
WriteBarrier<Unknown> m_internalValue;
......
......@@ -37,11 +37,6 @@ NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Str
{
}
void NativeErrorConstructor::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void NativeErrorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
NativeErrorConstructor* thisObject = static_cast<NativeErrorConstructor*>(cell);
......
......@@ -71,7 +71,6 @@ namespace JSC {
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
WriteBarrier<Structure> m_errorStructure;
......
......@@ -78,11 +78,6 @@ RegExpObject::~RegExpObject()
{
}
void RegExpObject::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void RegExpObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
RegExpObject* thisObject = static_cast<RegExpObject*>(cell);
......
......@@ -81,7 +81,6 @@ namespace JSC {
void finishCreation(JSGlobalObject*);
static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | Base::StructureFlags;
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
private:
......
......@@ -29,6 +29,10 @@
namespace JSC {
ScopeChainNode::~ScopeChainNode()
{
}
#ifndef NDEBUG
void ScopeChainNode::print()
......@@ -67,11 +71,6 @@ int ScopeChainNode::localDepth()
return scopeDepth;
}
void ScopeChainNode::visitChildrenVirtual(SlotVisitor& visitor)
{
visitChildren(this, visitor);
}
void ScopeChainNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
ScopeChainNode* thisObject = static_cast<ScopeChainNode*>(cell);
......
......@@ -45,6 +45,8 @@ namespace JSC {
{
}
virtual ~ScopeChainNode();
protected:
void finishCreation(JSGlobalData* globalData, JSGlobalObject* globalObject)
{
......@@ -87,7 +89,6 @@ namespace JSC {
#endif
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(globalData, globalObject, proto, TypeInfo(CompoundType, StructureFlags), &s_info); }
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
static JS_EXPORTDATA const ClassInfo s_info;