Changeset 84286 in webkit
- Timestamp:
- Apr 19, 2011 1:40:31 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84284 r84286 1 2011-04-19 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] QtInstance method cache ownership rules are unclear 6 https://bugs.webkit.org/show_bug.cgi?id=58820 7 8 Make the QtInstance method cache use WriteBarrier, and handle 9 ownership properly. 10 11 * bridge/qt/qt_class.cpp: 12 (JSC::Bindings::QtClass::fallbackObject): 13 (JSC::Bindings::QtClass::fieldNamed): 14 * bridge/qt/qt_instance.cpp: 15 (JSC::Bindings::QtInstance::~QtInstance): 16 (JSC::Bindings::QtInstance::removeCachedMethod): 17 (JSC::Bindings::QtInstance::newRuntimeObject): 18 (JSC::Bindings::QtInstance::markAggregate): 19 * bridge/qt/qt_instance.h: 20 1 21 2011-04-19 David Kilzer <ddkilzer@apple.com> 2 22 -
trunk/Source/WebCore/bridge/qt/qt_class.cpp
r84252 r84286 88 88 if (m.access() != QMetaMethod::Private) { 89 89 QtRuntimeMetaMethod* val = new (exec) QtRuntimeMetaMethod(exec, identifier, static_cast<QtInstance*>(inst), index, normal, false); 90 qtinst->m_methods.insert(name, val);90 qtinst->m_methods.insert(name, WriteBarrier<JSObject>(exec->globalData(), qtinst->createRuntimeObject(exec), val)); 91 91 return val; 92 92 } … … 107 107 if (normal == QByteArray::fromRawData(signature, iter)) { 108 108 QtRuntimeMetaMethod* val = new (exec) QtRuntimeMetaMethod(exec, identifier, static_cast<QtInstance*>(inst), index, normal, false); 109 qtinst->m_methods.insert(name, val);109 qtinst->m_methods.insert(name, WriteBarrier<JSObject>(exec->globalData(), qtinst->createRuntimeObject(exec), val)); 110 110 return val; 111 111 } -
trunk/Source/WebCore/bridge/qt/qt_instance.cpp
r84252 r84286 152 152 m_defaultMethod.clear(); 153 153 154 for (QHash<QByteArray, DeprecatedPtr<JSObject> >::Iterator it = m_methods.begin(), 155 end = m_methods.end(); it != end; ++it) 154 for (QHash<QByteArray, WriteBarrier<JSObject> >::Iterator it = m_methods.begin(), end = m_methods.end(); it != end; ++it) { 156 155 if (it.value().get() == method) { 157 156 m_methods.erase(it); 158 157 return; 159 158 } 159 } 160 160 } 161 161 … … 190 190 if (m_defaultMethod) 191 191 markStack.append(&m_defaultMethod); 192 foreach (DeprecatedPtr<JSObject> val, m_methods.values()) { 193 if (val) 194 markStack.append(&val); 195 } 192 for (QHash<QByteArray, WriteBarrier<JSObject> >::Iterator it = m_methods.begin(), end = m_methods.end(); it != end; ++it) 193 markStack.append(&it.value()); 196 194 } 197 195 -
trunk/Source/WebCore/bridge/qt/qt_instance.h
r84252 r84286 84 84 QPointer<QObject> m_object; 85 85 QObject* m_hashkey; 86 mutable QHash<QByteArray, DeprecatedPtr<JSObject> > m_methods;86 mutable QHash<QByteArray, WriteBarrier<JSObject> > m_methods; 87 87 mutable QHash<QString, QtField*> m_fields; 88 88 mutable WriteBarrier<QtRuntimeMetaMethod> m_defaultMethod;
Note: See TracChangeset
for help on using the changeset viewer.