Changeset 84176 in webkit
- Timestamp:
- Apr 18, 2011 1:34:50 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r84121 r84176 1 2011-04-18 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Remove DeprecatedPtr 6 https://bugs.webkit.org/show_bug.cgi?id=58718 7 8 As simple as it sounds. 9 10 * runtime/JSValue.h: 11 * runtime/WriteBarrier.h: 12 1 13 2011-04-17 Cameron Zwarich <zwarich@apple.com> 2 14 -
trunk/Source/JavaScriptCore/runtime/JSValue.h
r84081 r84176 52 52 struct Instruction; 53 53 54 template <class T> class DeprecatedPtr;55 54 template <class T> class WriteBarrierBase; 56 55 … … 237 236 238 237 private: 239 template <class T> JSValue(DeprecatedPtr<T>);240 238 template <class T> JSValue(WriteBarrierBase<T>); 241 239 -
trunk/Source/JavaScriptCore/runtime/WriteBarrier.h
r84081 r84176 43 43 typedef enum { } Unknown; 44 44 typedef JSValue* HandleSlot; 45 46 // FIXME: Remove all uses of this class.47 template <class T> class DeprecatedPtr {48 public:49 DeprecatedPtr() : m_cell(0) { }50 DeprecatedPtr(T* cell) : m_cell(reinterpret_cast<JSCell*>(cell)) { }51 T* get() const { return reinterpret_cast<T*>(m_cell); }52 T* operator*() const { return static_cast<T*>(m_cell); }53 T* operator->() const { return static_cast<T*>(m_cell); }54 55 JSCell** slot() { return &m_cell; }56 57 typedef T* (DeprecatedPtr::*UnspecifiedBoolType);58 operator UnspecifiedBoolType*() const { return m_cell ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; }59 60 bool operator!() const { return !m_cell; }61 62 protected:63 JSCell* m_cell;64 };65 66 // FIXME: Remove all uses of this class.67 template <> class DeprecatedPtr<Unknown> {68 public:69 DeprecatedPtr() { }70 DeprecatedPtr(JSValue value) : m_value(value) { }71 DeprecatedPtr(JSCell* value) : m_value(value) { }72 const JSValue& get() const { return m_value; }73 const JSValue* operator*() const { return &m_value; }74 const JSValue* operator->() const { return &m_value; }75 76 JSValue* slot() { return &m_value; }77 78 typedef JSValue (DeprecatedPtr::*UnspecifiedBoolType);79 operator UnspecifiedBoolType*() const { return m_value ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; }80 bool operator!() const { return !m_value; }81 82 private:83 JSValue m_value;84 };85 86 template <typename U, typename V> inline bool operator==(const DeprecatedPtr<U>& lhs, const DeprecatedPtr<V>& rhs)87 {88 return lhs.get() == rhs.get();89 }90 45 91 46 template <typename T> struct JSValueChecker { -
trunk/Source/WebCore/ChangeLog
r84172 r84176 1 2011-04-18 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Remove DeprecatedPtr 6 https://bugs.webkit.org/show_bug.cgi?id=58718 7 8 Replace use of DeprecatedPtr<> with Global<> as ownership rules 9 aren't obvious, have filed bug #58820 on seeing if this is safe. 10 11 * bridge/qt/qt_class.cpp: 12 (JSC::Bindings::QtClass::fallbackObject): 13 * bridge/qt/qt_instance.cpp: 14 (JSC::Bindings::QtInstance::removeCachedMethod): 15 (JSC::Bindings::QtInstance::markAggregate): 16 * bridge/qt/qt_instance.h: 17 1 18 2011-04-14 Matthew Delaney <mdelaney@apple.com> 2 19 -
trunk/Source/WebCore/bridge/qt/qt_class.cpp
r77151 r84176 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, Global<JSObject>(exec->globalData(), 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, Global<JSObject>(exec->globalData(), val)); 110 110 return val; 111 111 } -
trunk/Source/WebCore/bridge/qt/qt_instance.cpp
r84052 r84176 152 152 m_defaultMethod.clear(); 153 153 154 for (QHash<QByteArray, DeprecatedPtr<JSObject> >::Iterator it = m_methods.begin(),154 for (QHash<QByteArray, Global<JSObject> >::Iterator it = m_methods.begin(), 155 155 end = m_methods.end(); it != end; ++it) 156 156 if (it.value().get() == method) { … … 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 }196 192 } 197 193 -
trunk/Source/WebCore/bridge/qt/qt_instance.h
r79988 r84176 84 84 QPointer<QObject> m_object; 85 85 QObject* m_hashkey; 86 mutable QHash<QByteArray, DeprecatedPtr<JSObject> > m_methods;86 mutable QHash<QByteArray, Global<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.