Changeset 189616 in webkit
- Timestamp:
- Sep 11, 2015, 2:16:37 AM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 74 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSAPIWrapperObject.mm
r179728 r189616 34 34 #if JSC_OBJC_API_ENABLED 35 35 36 class JSAPIWrapperObjectHandleOwner : public JSC::WeakHandleOwner {36 class JSAPIWrapperObjectHandleOwner final : public JSC::WeakHandleOwner { 37 37 public: 38 v irtual void finalize(JSC::Handle<JSC::Unknown>, void*) override;39 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&) override;38 void finalize(JSC::JSCell*&, void*) override; 39 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 40 40 }; 41 41 … … 46 46 } 47 47 48 void JSAPIWrapperObjectHandleOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void*)48 void JSAPIWrapperObjectHandleOwner::finalize(JSC::JSCell*& cell, void*) 49 49 { 50 JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(handle.get().asCell());51 if (!wrapperObject ->wrappedObject())50 auto& wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject&>(*cell); 51 if (!wrapperObject.wrappedObject()) 52 52 return; 53 53 54 JSC::Heap::heap( wrapperObject)->releaseSoon(adoptNS(static_cast<id>(wrapperObject->wrappedObject())));55 JSC::WeakSet::deallocate(JSC::WeakImpl::asWeakImpl( handle.slot()));54 JSC::Heap::heap(&wrapperObject)->releaseSoon(adoptNS(static_cast<id>(wrapperObject.wrappedObject()))); 55 JSC::WeakSet::deallocate(JSC::WeakImpl::asWeakImpl(&cell)); 56 56 } 57 57 58 bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor)58 bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, JSC::SlotVisitor& visitor) 59 59 { 60 JSC::JSAPIWrapperObject * wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(handle.get().asCell());60 JSC::JSAPIWrapperObject& wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject&>(cell); 61 61 // We use the JSGlobalObject when processing weak handles to prevent the situation where using 62 62 // the same Objective-C object in multiple global objects keeps all of the global objects alive. 63 if (!wrapperObject ->wrappedObject())63 if (!wrapperObject.wrappedObject()) 64 64 return false; 65 return JSC::Heap::isMarked(wrapperObject ->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject());65 return JSC::Heap::isMarked(wrapperObject.globalObject()) && visitor.containsOpaqueRoot(wrapperObject.wrappedObject()); 66 66 } 67 67 … … 87 87 { 88 88 Base::finishCreation(vm); 89 WeakSet::allocate( this, jsAPIWrapperObjectHandleOwner(), 0); // Balanced in JSAPIWrapperObjectHandleOwner::finalize.89 WeakSet::allocate(*this, jsAPIWrapperObjectHandleOwner(), 0); // Balanced in JSAPIWrapperObjectHandleOwner::finalize. 90 90 } 91 91 -
trunk/Source/JavaScriptCore/API/JSManagedValue.mm
r174110 r189616 40 40 #import <wtf/spi/cocoa/NSMapTableSPI.h> 41 41 42 class JSManagedValueHandleOwner : public JSC::WeakHandleOwner {42 class JSManagedValueHandleOwner final : public JSC::WeakHandleOwner { 43 43 public: 44 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context) override;45 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&) override;44 void finalize(JSC::JSCell*&, void* context) override; 45 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 46 46 }; 47 47 … … 296 296 @end 297 297 298 bool JSManagedValueHandleOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& visitor)298 bool JSManagedValueHandleOwner::isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor& visitor) 299 299 { 300 300 JSManagedValue *managedValue = static_cast<JSManagedValue *>(context); … … 302 302 } 303 303 304 void JSManagedValueHandleOwner::finalize(JSC:: Handle<JSC::Unknown>, void* context)304 void JSManagedValueHandleOwner::finalize(JSC::JSCell*&, void* context) 305 305 { 306 306 JSManagedValue *managedValue = static_cast<JSManagedValue *>(context); -
trunk/Source/JavaScriptCore/ChangeLog
r189599 r189616 1 2015-09-11 Andreas Kling <[email protected]> 2 3 [JSC] Weak should only accept cell pointees. 4 <https://webkit.org/b/148955> 5 6 Reviewed by Geoffrey Garen. 7 8 Since WeakImpls only support pointing to JSCell derived objects, 9 enforce that at compile time by having the API use JSCell* instead of JSValue. 10 11 WeakHandleOwner callbacks now get JSCell& and JSCell*& respectively instead 12 of wrapping the cell pointer in a Handle<Unknown>. 13 14 Also added a static_assert so Weak<T> can't be instantiated with a T that's 15 not convertible to JSCell. 16 17 * API/JSAPIWrapperObject.mm: 18 (JSAPIWrapperObjectHandleOwner::finalize): 19 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): 20 (JSC::JSAPIWrapperObject::finishCreation): 21 * API/JSManagedValue.mm: 22 (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): 23 (JSManagedValueHandleOwner::finalize): 24 * builtins/BuiltinExecutables.cpp: 25 (JSC::BuiltinExecutables::finalize): 26 * builtins/BuiltinExecutables.h: 27 * heap/Heap.cpp: 28 (JSC::Heap::addFinalizer): 29 (JSC::Heap::FinalizerOwner::finalize): 30 * heap/Heap.h: 31 * heap/WeakBlock.cpp: 32 (JSC::WeakBlock::visit): 33 (JSC::WeakBlock::reap): 34 * heap/WeakHandleOwner.cpp: 35 (JSC::WeakHandleOwner::isReachableFromOpaqueRoots): 36 (JSC::WeakHandleOwner::finalize): 37 * heap/WeakHandleOwner.h: 38 * heap/WeakImpl.h: 39 (JSC::WeakImpl::WeakImpl): 40 (JSC::WeakImpl::state): 41 (JSC::WeakImpl::cell): 42 (JSC::WeakImpl::asWeakImpl): 43 (JSC::WeakImpl::jsValue): Deleted. 44 * heap/WeakInlines.h: 45 (JSC::Weak<T>::Weak): 46 (JSC::>): 47 (JSC::Weak<T>::operator): 48 (JSC::Weak<T>::get): 49 (JSC::Weak<T>::was): 50 * heap/WeakSet.h: 51 * heap/WeakSetInlines.h: 52 (JSC::WeakSet::allocate): 53 (JSC::WeakBlock::finalize): 54 * jit/JITThunks.cpp: 55 (JSC::JITThunks::finalize): 56 * jit/JITThunks.h: 57 * jsc.cpp: 58 (WTF::ElementHandleOwner::isReachableFromOpaqueRoots): Deleted. 59 * runtime/JSCell.h: 60 (JSC::jsCast): 61 * runtime/RegExpCache.cpp: 62 (JSC::RegExpCache::finalize): 63 * runtime/RegExpCache.h: 64 * runtime/Structure.cpp: 65 (JSC::StructureTransitionTable::singleTransition): 66 (JSC::StructureTransitionTable::setSingleTransition): 67 1 68 2015-09-10 Sukolsak Sakshuwong <[email protected]> 2 69 -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
r188417 r189616 109 109 } 110 110 111 void BuiltinExecutables::finalize( Handle<Unknown>, void* context)111 void BuiltinExecutables::finalize(JSCell*&, void* context) 112 112 { 113 113 static_cast<Weak<UnlinkedFunctionExecutable>*>(context)->clear(); -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h
r187205 r189616 54 54 55 55 private: 56 void finalize( Handle<Unknown>, void* context) override;56 void finalize(JSCell*&, void* context) override; 57 57 58 58 VM& m_vm; -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r189553 r189616 1384 1384 void Heap::addFinalizer(JSCell* cell, Finalizer finalizer) 1385 1385 { 1386 WeakSet::allocate(cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer)); // Balanced by FinalizerOwner::finalize(). 1387 } 1388 1389 void Heap::FinalizerOwner::finalize(Handle<Unknown> handle, void* context) 1390 { 1391 HandleSlot slot = handle.slot(); 1386 WeakSet::allocate(*cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer)); // Balanced by FinalizerOwner::finalize(). 1387 } 1388 1389 void Heap::FinalizerOwner::finalize(JSCell*& cell, void* context) 1390 { 1392 1391 Finalizer finalizer = reinterpret_cast<Finalizer>(context); 1393 finalizer( slot->asCell());1394 WeakSet::deallocate(WeakImpl::asWeakImpl( slot));1392 finalizer(cell); 1393 WeakSet::deallocate(WeakImpl::asWeakImpl(&cell)); 1395 1394 } 1396 1395 -
trunk/Source/JavaScriptCore/heap/Heap.h
r189515 r189616 269 269 static const size_t minExtraMemory = 256; 270 270 271 class FinalizerOwner : public WeakHandleOwner {272 v irtual void finalize(Handle<Unknown>, void* context) override;271 class FinalizerOwner final : public WeakHandleOwner { 272 void finalize(JSCell*&, void* context) override; 273 273 }; 274 274 -
trunk/Source/JavaScriptCore/heap/WeakBlock.cpp
r183769 r189616 113 113 continue; 114 114 115 const JSValue& jsValue = weakImpl->jsValue(); 116 if (m_markedBlock->isMarkedOrNewlyAllocated(jsValue.asCell())) 115 if (m_markedBlock->isMarkedOrNewlyAllocated(weakImpl->m_cell)) 117 116 continue; 118 117 … … 121 120 continue; 122 121 123 if (!weakHandleOwner->isReachableFromOpaqueRoots( Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(jsValue)), weakImpl->context(), visitor))122 if (!weakHandleOwner->isReachableFromOpaqueRoots(*weakImpl->m_cell, weakImpl->context(), visitor)) 124 123 continue; 125 124 126 heapRootVisitor.visit(& const_cast<JSValue&>(jsValue));125 heapRootVisitor.visit(&weakImpl->m_cell); 127 126 } 128 127 } … … 145 144 continue; 146 145 147 if (m_markedBlock->isMarkedOrNewlyAllocated(weakImpl-> jsValue().asCell())) {146 if (m_markedBlock->isMarkedOrNewlyAllocated(weakImpl->cell())) { 148 147 ASSERT(weakImpl->state() == WeakImpl::Live); 149 148 continue; -
trunk/Source/JavaScriptCore/heap/WeakHandleOwner.cpp
r163844 r189616 38 38 } 39 39 40 bool WeakHandleOwner::isReachableFromOpaqueRoots( Handle<Unknown>, void*, SlotVisitor&)40 bool WeakHandleOwner::isReachableFromOpaqueRoots(JSCell&, void*, SlotVisitor&) 41 41 { 42 42 return false; 43 43 } 44 44 45 void WeakHandleOwner::finalize( Handle<Unknown>, void*)45 void WeakHandleOwner::finalize(JSCell*&, void*) 46 46 { 47 47 } -
trunk/Source/JavaScriptCore/heap/WeakHandleOwner.h
r113141 r189616 36 36 public: 37 37 virtual ~WeakHandleOwner(); 38 virtual bool isReachableFromOpaqueRoots( Handle<Unknown>, void* context, SlotVisitor&);39 virtual void finalize( Handle<Unknown>, void* context);38 virtual bool isReachableFromOpaqueRoots(JSCell&, void* context, SlotVisitor&); 39 virtual void finalize(JSCell*&, void* context); 40 40 }; 41 41 -
trunk/Source/JavaScriptCore/heap/WeakImpl.h
r143909 r189616 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 47 47 48 48 WeakImpl(); 49 WeakImpl(JS Value, WeakHandleOwner*, void* context);49 WeakImpl(JSCell&, WeakHandleOwner*, void* context); 50 50 51 State state() ;51 State state() const; 52 52 void setState(State); 53 53 54 const JSValue& jsValue();54 JSCell* cell(); 55 55 WeakHandleOwner* weakHandleOwner(); 56 56 void* context(); 57 57 58 static WeakImpl* asWeakImpl(JS Value*);58 static WeakImpl* asWeakImpl(JSCell**); 59 59 60 60 private: 61 const JSValue m_jsValue; 62 WeakHandleOwner* m_weakHandleOwner; 63 void* m_context; 61 friend class WeakBlock; 62 63 JSCell* m_cell { nullptr }; 64 WeakHandleOwner* m_weakHandleOwner { nullptr }; 65 void* m_context { nullptr }; 64 66 }; 65 67 66 68 inline WeakImpl::WeakImpl() 67 : m_weakHandleOwner(0)68 , m_context(0)69 69 { 70 70 setState(Deallocated); 71 71 } 72 72 73 inline WeakImpl::WeakImpl(JS Value jsValue, WeakHandleOwner* weakHandleOwner, void* context)74 : m_ jsValue(jsValue)73 inline WeakImpl::WeakImpl(JSCell& cell, WeakHandleOwner* weakHandleOwner, void* context) 74 : m_cell(&cell) 75 75 , m_weakHandleOwner(weakHandleOwner) 76 76 , m_context(context) 77 77 { 78 78 ASSERT(state() == Live); 79 ASSERT(m_jsValue && m_jsValue.isCell());80 79 } 81 80 82 inline WeakImpl::State WeakImpl::state() 81 inline WeakImpl::State WeakImpl::state() const 83 82 { 84 83 return static_cast<State>(reinterpret_cast<uintptr_t>(m_weakHandleOwner) & StateMask); … … 91 90 } 92 91 93 inline const JSValue& WeakImpl::jsValue()92 inline JSCell* WeakImpl::cell() 94 93 { 95 return m_ jsValue;94 return m_cell; 96 95 } 97 96 … … 106 105 } 107 106 108 inline WeakImpl* WeakImpl::asWeakImpl(JS Value* slot)107 inline WeakImpl* WeakImpl::asWeakImpl(JSCell** slot) 109 108 { 110 return reinterpret_cast_ptr<WeakImpl*>(reinterpret_cast_ptr<char*>(slot) + OBJECT_OFFSETOF(WeakImpl, m_jsValue));109 return reinterpret_cast_ptr<WeakImpl*>(reinterpret_cast_ptr<char*>(slot)); 111 110 } 112 111 -
trunk/Source/JavaScriptCore/heap/WeakInlines.h
r188040 r189616 35 35 36 36 template<typename T> inline Weak<T>::Weak(T* cell, WeakHandleOwner* weakOwner, void* context) 37 : m_impl(cell ? WeakSet::allocate( cell, weakOwner, context) : 0)37 : m_impl(cell ? WeakSet::allocate(*cell, weakOwner, context) : 0) 38 38 { 39 static_assert((std::is_convertible<T, JSCell>::value), "JSC::Weak can only be used with cell types."); 39 40 } 40 41 … … 74 75 { 75 76 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 76 return jsCast<T*>(m_impl-> jsValue().asCell());77 return jsCast<T*>(m_impl->cell()); 77 78 } 78 79 … … 80 81 { 81 82 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 82 return *jsCast<T*>(m_impl-> jsValue().asCell());83 return *jsCast<T*>(m_impl->cell()); 83 84 } 84 85 … … 87 88 if (!m_impl || m_impl->state() != WeakImpl::Live) 88 89 return 0; 89 return jsCast<T*>(m_impl-> jsValue().asCell());90 return jsCast<T*>(m_impl->cell()); 90 91 } 91 92 92 93 template<typename T> inline bool Weak<T>::was(T* other) const 93 94 { 94 return static_cast<T*>(m_impl-> jsValue().asCell()) == other;95 return static_cast<T*>(m_impl->cell()) == other; 95 96 } 96 97 97 98 template<typename T> inline bool Weak<T>::operator!() const 98 99 { 99 return !m_impl || !m_impl-> jsValue() || m_impl->state() != WeakImpl::Live;100 return !m_impl || !m_impl->cell() || m_impl->state() != WeakImpl::Live; 100 101 } 101 102 -
trunk/Source/JavaScriptCore/heap/WeakSet.h
r183769 r189616 39 39 40 40 public: 41 static WeakImpl* allocate(JS Value, WeakHandleOwner* = 0, void* context = 0);41 static WeakImpl* allocate(JSCell&, WeakHandleOwner* = 0, void* context = 0); 42 42 static void deallocate(WeakImpl*); 43 43 -
trunk/Source/JavaScriptCore/heap/WeakSetInlines.h
r148479 r189616 31 31 namespace JSC { 32 32 33 inline WeakImpl* WeakSet::allocate(JS Value jsValue, WeakHandleOwner* weakHandleOwner, void* context)33 inline WeakImpl* WeakSet::allocate(JSCell& cell, WeakHandleOwner* weakHandleOwner, void* context) 34 34 { 35 WeakSet& weakSet = MarkedBlock::blockFor( jsValue.asCell())->weakSet();35 WeakSet& weakSet = MarkedBlock::blockFor(&cell)->weakSet(); 36 36 WeakBlock::FreeCell* allocator = weakSet.m_allocator; 37 37 if (UNLIKELY(!allocator)) … … 40 40 41 41 WeakImpl* weakImpl = WeakBlock::asWeakImpl(allocator); 42 return new (NotNull, weakImpl) WeakImpl( jsValue, weakHandleOwner, context);42 return new (NotNull, weakImpl) WeakImpl(cell, weakHandleOwner, context); 43 43 } 44 44 … … 50 50 if (!weakHandleOwner) 51 51 return; 52 weakHandleOwner->finalize( Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(weakImpl->jsValue())), weakImpl->context());52 weakHandleOwner->finalize(weakImpl->m_cell, weakImpl->context()); 53 53 } 54 54 -
trunk/Source/JavaScriptCore/jit/JITThunks.cpp
r188499 r189616 77 77 } 78 78 79 void JITThunks::finalize( Handle<Unknown> handle, void*)79 void JITThunks::finalize(JSCell*& cell, void*) 80 80 { 81 auto* nativeExecutable = jsCast<NativeExecutable*>( handle.get().asCell());81 auto* nativeExecutable = jsCast<NativeExecutable*>(cell); 82 82 weakRemove(*m_hostFunctionStubMap, std::make_pair(nativeExecutable->function(), nativeExecutable->constructor()), nativeExecutable); 83 83 } -
trunk/Source/JavaScriptCore/jit/JITThunks.h
r188499 r189616 64 64 65 65 private: 66 void finalize( Handle<Unknown>, void* context) override;66 void finalize(JSCell*&, void* context) override; 67 67 68 68 typedef HashMap<ThunkGenerator, MacroAssemblerCodeRef> CTIStubMap; -
trunk/Source/JavaScriptCore/jsc.cpp
r189591 r189616 177 177 }; 178 178 179 class ElementHandleOwner : public WeakHandleOwner {179 class ElementHandleOwner final : public WeakHandleOwner { 180 180 public: 181 virtual bool isReachableFromOpaqueRoots( Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)182 { 183 Element* element = jsCast<Element*>(handle.slot()->asCell());184 return visitor.containsOpaqueRoot(element ->root());181 virtual bool isReachableFromOpaqueRoots(JSCell& cell, void*, SlotVisitor& visitor) 182 { 183 auto& element = jsCast<Element&>(cell); 184 return visitor.containsOpaqueRoot(element.root()); 185 185 } 186 186 }; -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r184328 r189616 246 246 247 247 template<typename To, typename From> 248 inline To& jsCast(From& from) 249 { 250 ASSERT_WITH_SECURITY_IMPLICATION(from.JSCell::inherits(std::remove_reference<To>::type::info())); 251 return static_cast<To&>(from); 252 } 253 254 template<typename To, typename From> 248 255 inline To jsCast(From* from) 249 256 { -
trunk/Source/JavaScriptCore/runtime/RegExpCache.cpp
r188397 r189616 57 57 } 58 58 59 void RegExpCache::finalize( Handle<Unknown> handle, void*)59 void RegExpCache::finalize(JSCell*& cell, void*) 60 60 { 61 RegExp* regExp = static_cast<RegExp*>(handle.get().asCell());61 RegExp* regExp = jsCast<RegExp*>(cell); 62 62 weakRemove(m_weakCache, regExp->key(), regExp); 63 63 } -
trunk/Source/JavaScriptCore/runtime/RegExpCache.h
r188394 r189616 55 55 static const int maxStrongCacheableEntries = 32; 56 56 57 v irtual void finalize(Handle<Unknown>, void* context) override;57 void finalize(JSCell*&, void* context) override; 58 58 59 59 RegExp* lookupOrCreate(const WTF::String& patternString, RegExpFlags); -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r189596 r189616 63 63 64 64 class SingleSlotTransitionWeakOwner final : public WeakHandleOwner { 65 void finalize( Handle<Unknown>, void* context) override65 void finalize(JSCell*&, void* context) override 66 66 { 67 67 StructureTransitionTable* table = reinterpret_cast<StructureTransitionTable*>(context); … … 83 83 if (WeakImpl* impl = this->weakImpl()) { 84 84 if (impl->state() == WeakImpl::Live) 85 return jsCast<Structure*>(impl-> jsValue().asCell());85 return jsCast<Structure*>(impl->cell()); 86 86 } 87 87 return nullptr; … … 93 93 if (WeakImpl* impl = this->weakImpl()) 94 94 WeakSet::deallocate(impl); 95 WeakImpl* impl = WeakSet::allocate( structure, &singleSlotTransitionWeakOwner(), this);95 WeakImpl* impl = WeakSet::allocate(*structure, &singleSlotTransitionWeakOwner(), this); 96 96 m_data = reinterpret_cast<intptr_t>(impl) | UsingSingleSlotFlag; 97 97 } -
trunk/Source/WebCore/ChangeLog
r189598 r189616 1 2015-09-11 Andreas Kling <[email protected]> 2 3 [JSC] Weak should only accept cell pointees. 4 <https://webkit.org/b/148955> 5 6 Reviewed by Geoffrey Garen. 7 8 Update WebCore bindings for the new Weak and Weak-related signatures. 9 10 * bindings/js/JSCSSRuleListCustom.cpp: 11 (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots): 12 * bindings/js/JSCSSValueCustom.cpp: 13 (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): 14 (WebCore::JSCSSValueOwner::finalize): 15 * bindings/js/JSCallbackData.cpp: 16 (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots): 17 * bindings/js/JSCallbackData.h: 18 * bindings/js/JSMutationObserverCustom.cpp: 19 (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): 20 * bindings/js/JSNodeCustom.cpp: 21 (WebCore::isReachableFromDOM): 22 (WebCore::JSNodeOwner::isReachableFromOpaqueRoots): 23 * bindings/js/JSNodeListCustom.cpp: 24 (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots): 25 * bindings/js/JSTextTrackCueCustom.cpp: 26 (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots): 27 * bindings/js/WebCoreTypedArrayController.cpp: 28 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): 29 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize): 30 * bindings/js/WebCoreTypedArrayController.h: 31 * bindings/scripts/CodeGeneratorJS.pm: 32 (GenerateHeader): 33 (GenerateImplementation): 34 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: 35 (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots): 36 (WebCore::JSTestActiveDOMObjectOwner::finalize): 37 * bindings/scripts/test/JS/JSTestActiveDOMObject.h: 38 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: 39 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots): 40 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize): 41 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: 42 * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: 43 (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots): 44 (WebCore::JSTestCustomNamedGetterOwner::finalize): 45 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: 46 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 47 (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots): 48 (WebCore::JSTestEventConstructorOwner::finalize): 49 * bindings/scripts/test/JS/JSTestEventConstructor.h: 50 * bindings/scripts/test/JS/JSTestEventTarget.cpp: 51 (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots): 52 (WebCore::JSTestEventTargetOwner::finalize): 53 * bindings/scripts/test/JS/JSTestEventTarget.h: 54 * bindings/scripts/test/JS/JSTestException.cpp: 55 (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots): 56 (WebCore::JSTestExceptionOwner::finalize): 57 * bindings/scripts/test/JS/JSTestException.h: 58 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: 59 (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): 60 (WebCore::JSTestGenerateIsReachableOwner::finalize): 61 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: 62 * bindings/scripts/test/JS/JSTestInterface.cpp: 63 (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots): 64 (WebCore::JSTestInterfaceOwner::finalize): 65 * bindings/scripts/test/JS/JSTestInterface.h: 66 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 67 (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots): 68 (WebCore::JSTestMediaQueryListListenerOwner::finalize): 69 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: 70 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: 71 (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots): 72 (WebCore::JSTestNamedConstructorOwner::finalize): 73 * bindings/scripts/test/JS/JSTestNamedConstructor.h: 74 * bindings/scripts/test/JS/JSTestNondeterministic.cpp: 75 (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots): 76 (WebCore::JSTestNondeterministicOwner::finalize): 77 * bindings/scripts/test/JS/JSTestNondeterministic.h: 78 * bindings/scripts/test/JS/JSTestObj.cpp: 79 (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots): 80 (WebCore::JSTestObjOwner::finalize): 81 * bindings/scripts/test/JS/JSTestObj.h: 82 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: 83 (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots): 84 (WebCore::JSTestOverloadedConstructorsOwner::finalize): 85 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: 86 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: 87 (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots): 88 (WebCore::JSTestOverrideBuiltinsOwner::finalize): 89 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: 90 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 91 (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots): 92 (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize): 93 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: 94 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 95 (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots): 96 (WebCore::JSTestTypedefsOwner::finalize): 97 * bindings/scripts/test/JS/JSTestTypedefs.h: 98 * bindings/scripts/test/JS/JSattribute.cpp: 99 (WebCore::JSattributeOwner::isReachableFromOpaqueRoots): 100 (WebCore::JSattributeOwner::finalize): 101 * bindings/scripts/test/JS/JSattribute.h: 102 * bindings/scripts/test/JS/JSreadonly.cpp: 103 (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots): 104 (WebCore::JSreadonlyOwner::finalize): 105 * bindings/scripts/test/JS/JSreadonly.h: 106 * bridge/runtime_root.cpp: 107 (JSC::Bindings::RootObject::finalize): 108 * bridge/runtime_root.h: 109 1 110 2015-09-10 Chris Fleizach <[email protected]> 2 111 -
trunk/Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp
r165757 r189616 37 37 namespace WebCore { 38 38 39 bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)39 bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 40 40 { 41 JSCSSRuleList* jsCSSRuleList = jsCast<JSCSSRuleList*>(handle.slot()->asCell());42 if (!jsCSSRuleList ->hasCustomProperties())41 auto& jsCSSRuleList = jsCast<JSCSSRuleList&>(cell); 42 if (!jsCSSRuleList.hasCustomProperties()) 43 43 return false; 44 if (CSSStyleSheet* styleSheet = jsCSSRuleList ->impl().styleSheet())44 if (CSSStyleSheet* styleSheet = jsCSSRuleList.impl().styleSheet()) 45 45 return visitor.containsOpaqueRoot(root(styleSheet)); 46 if (CSSRule* cssRule = jsCSSRuleList ->impl().item(0))46 if (CSSRule* cssRule = jsCSSRuleList.impl().item(0)) 47 47 return visitor.containsOpaqueRoot(root(cssRule)); 48 48 return false; -
trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp
r183523 r189616 45 45 namespace WebCore { 46 46 47 bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void* context, SlotVisitor& visitor)47 bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void* context, SlotVisitor& visitor) 48 48 { 49 JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.slot()->asCell());50 if (!jsCSSValue ->hasCustomProperties())49 auto& jsCSSValue = jsCast<JSCSSValue&>(cell); 50 if (!jsCSSValue.hasCustomProperties()) 51 51 return false; 52 DOMWrapperWorld * world =static_cast<DOMWrapperWorld*>(context);53 void* root = world ->m_cssValueRoots.get(&jsCSSValue->impl());52 DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context); 53 void* root = world.m_cssValueRoots.get(&jsCSSValue.impl()); 54 54 if (!root) 55 55 return false; … … 57 57 } 58 58 59 void JSCSSValueOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)59 void JSCSSValueOwner::finalize(JSC::JSCell*& cell, void* context) 60 60 { 61 JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.slot()->asCell());61 auto& jsCSSValue = jsCast<JSCSSValue&>(*cell); 62 62 DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context); 63 world.m_cssValueRoots.remove(&jsCSSValue ->impl());64 uncacheWrapper(world, &jsCSSValue ->impl(),jsCSSValue);63 world.m_cssValueRoots.remove(&jsCSSValue.impl()); 64 uncacheWrapper(world, &jsCSSValue.impl(), &jsCSSValue); 65 65 } 66 66 -
trunk/Source/WebCore/bindings/js/JSCallbackData.cpp
r189230 r189616 91 91 } 92 92 93 bool JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown>, void* context, SlotVisitor& visitor)93 bool JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots(JSC::JSCell&, void* context, SlotVisitor& visitor) 94 94 { 95 95 return visitor.containsOpaqueRoot(context); -
trunk/Source/WebCore/bindings/js/JSCallbackData.h
r189230 r189616 106 106 107 107 private: 108 class WeakOwner : public JSC::WeakHandleOwner {109 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);108 class WeakOwner final : public JSC::WeakHandleOwner { 109 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 110 110 }; 111 111 WeakOwner m_weakOwner; -
trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp
r170167 r189616 62 62 } 63 63 64 bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)64 bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 65 65 { 66 MutationObserver& observer = jsCast<JSMutationObserver *>(handle.slot()->asCell())->impl();66 MutationObserver& observer = jsCast<JSMutationObserver&>(cell).impl(); 67 67 auto observedNodes = observer.getObservedNodes(); 68 68 for (auto it = observedNodes.begin(), end = observedNodes.end(); it != end; ++it) { -
trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp
r188187 r189616 76 76 using namespace HTMLNames; 77 77 78 static inline bool isReachableFromDOM(Node *node, SlotVisitor& visitor)79 { 80 if (!node ->inDocument()) {81 if (is<Element>( *node)) {82 auto& element = downcast<Element>( *node);78 static inline bool isReachableFromDOM(Node& node, SlotVisitor& visitor) 79 { 80 if (!node.inDocument()) { 81 if (is<Element>(node)) { 82 auto& element = downcast<Element>(node); 83 83 84 84 // If a wrapper is the last reference to an image element … … 101 101 // If a node is firing event listeners, its wrapper is observable because 102 102 // its wrapper is responsible for marking those event listeners. 103 if (node ->isFiringEventListeners())103 if (node.isFiringEventListeners()) 104 104 return true; 105 105 } 106 106 107 return visitor.containsOpaqueRoot(root( node));108 } 109 110 bool JSNodeOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)111 { 112 JSNode* jsNode = jsCast<JSNode*>(handle.slot()->asCell());113 return isReachableFromDOM( &jsNode->impl(), visitor);107 return visitor.containsOpaqueRoot(root(&node)); 108 } 109 110 bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 111 { 112 auto& jsNode = jsCast<JSNode&>(cell); 113 return isReachableFromDOM(jsNode.impl(), visitor); 114 114 } 115 115 -
trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp
r188829 r189616 38 38 namespace WebCore { 39 39 40 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)40 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 41 41 { 42 JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.slot()->asCell());43 if (!jsNodeList ->hasCustomProperties())42 auto& jsNodeList = jsCast<JSNodeList&>(cell); 43 if (!jsNodeList.hasCustomProperties()) 44 44 return false; 45 if (jsNodeList ->impl().isLiveNodeList())46 return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList&>(jsNodeList ->impl()).ownerNode()));47 if (jsNodeList ->impl().isChildNodeList())48 return visitor.containsOpaqueRoot(root(static_cast<ChildNodeList&>(jsNodeList ->impl()).ownerNode()));49 if (jsNodeList ->impl().isEmptyNodeList())50 return visitor.containsOpaqueRoot(root(static_cast<EmptyNodeList&>(jsNodeList ->impl()).ownerNode()));45 if (jsNodeList.impl().isLiveNodeList()) 46 return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList&>(jsNodeList.impl()).ownerNode())); 47 if (jsNodeList.impl().isChildNodeList()) 48 return visitor.containsOpaqueRoot(root(static_cast<ChildNodeList&>(jsNodeList.impl()).ownerNode())); 49 if (jsNodeList.impl().isEmptyNodeList()) 50 return visitor.containsOpaqueRoot(root(static_cast<EmptyNodeList&>(jsNodeList.impl()).ownerNode())); 51 51 return false; 52 52 } -
trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp
r167794 r189616 39 39 namespace WebCore { 40 40 41 bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)41 bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 42 42 { 43 JSTextTrackCue* jsTextTrackCue = jsCast<JSTextTrackCue*>(handle.slot()->asCell());44 TextTrackCue& textTrackCue = jsTextTrackCue ->impl();43 auto& jsTextTrackCue = jsCast<JSTextTrackCue&>(cell); 44 TextTrackCue& textTrackCue = jsTextTrackCue.impl(); 45 45 46 46 // If the cue is firing event listeners, its wrapper is reachable because … … 50 50 51 51 // If the cue has no event listeners and has no custom properties, it is not reachable. 52 if (!textTrackCue.hasEventListeners() && !jsTextTrackCue ->hasCustomProperties())52 if (!textTrackCue.hasEventListeners() && !jsTextTrackCue.hasCustomProperties()) 53 53 return false; 54 54 -
trunk/Source/WebCore/bindings/js/WebCoreTypedArrayController.cpp
r165757 r189616 48 48 } 49 49 50 bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor)50 bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, JSC::SlotVisitor& visitor) 51 51 { 52 auto& wrapper = *JSC::jsCast<JSC::JSArrayBuffer*>(handle.slot()->asCell());52 auto& wrapper = JSC::jsCast<JSC::JSArrayBuffer&>(cell); 53 53 if (!wrapper.hasCustomProperties()) 54 54 return false; … … 56 56 } 57 57 58 void WebCoreTypedArrayController::JSArrayBufferOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)58 void WebCoreTypedArrayController::JSArrayBufferOwner::finalize(JSC::JSCell*& cell, void* context) 59 59 { 60 auto& wrapper = *static_cast<JSC::JSArrayBuffer*>(handle.slot()->asCell());60 auto& wrapper = static_cast<JSC::JSArrayBuffer&>(*cell); 61 61 auto& buffer = *wrapper.impl(); 62 62 uncacheWrapper(*static_cast<DOMWrapperWorld*>(context), &buffer, &wrapper); -
trunk/Source/WebCore/bindings/js/WebCoreTypedArrayController.h
r166124 r189616 36 36 namespace WebCore { 37 37 38 class WebCoreTypedArrayController : public JSC::TypedArrayController {38 class WebCoreTypedArrayController final : public JSC::TypedArrayController { 39 39 public: 40 40 WebCoreTypedArrayController(); … … 46 46 47 47 private: 48 class JSArrayBufferOwner : public JSC::WeakHandleOwner {48 class JSArrayBufferOwner final : public JSC::WeakHandleOwner { 49 49 public: 50 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&) override;51 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context) override;50 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 51 void finalize(JSC::JSCell*&, void* context) override; 52 52 }; 53 53 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r189507 r189616 1192 1192 $headerIncludes{"<wtf/NeverDestroyed.h>"} = 1; 1193 1193 push(@headerContent, "public:\n"); 1194 push(@headerContent, " virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);\n");1195 push(@headerContent, " v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);\n");1194 push(@headerContent, " bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override;\n"); 1195 push(@headerContent, " void finalize(JSC::JSCell*&, void* context) override;\n"); 1196 1196 push(@headerContent, "};\n"); 1197 1197 push(@headerContent, "\n"); … … 2946 2946 if ((!$hasParent && !GetCustomIsReachable($interface)) || GetGenerateIsReachable($interface) || $codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) { 2947 2947 2948 push(@implContent, "bool JS${interfaceName}Owner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)\n");2948 push(@implContent, "bool JS${interfaceName}Owner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor)\n"); 2949 2949 push(@implContent, "{\n"); 2950 2950 # All ActiveDOMObjects implement hasPendingActivity(), but not all of them … … 2957 2957 my $emittedJSCast = 0; 2958 2958 if ($codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) { 2959 push(@implContent, " auto * js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2959 push(@implContent, " auto& js${interfaceName} = jsCast<JS${interfaceName}&>(cell);\n"); 2960 2960 $emittedJSCast = 1; 2961 push(@implContent, " if (js${interfaceName} ->impl().hasPendingActivity())\n");2961 push(@implContent, " if (js${interfaceName}.impl().hasPendingActivity())\n"); 2962 2962 push(@implContent, " return true;\n"); 2963 2963 } 2964 2964 if ($codeGenerator->InheritsExtendedAttribute($interface, "EventTarget")) { 2965 2965 if (!$emittedJSCast) { 2966 push(@implContent, " auto * js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2966 push(@implContent, " auto& js${interfaceName} = jsCast<JS${interfaceName}&>(cell);\n"); 2967 2967 $emittedJSCast = 1; 2968 2968 } 2969 push(@implContent, " if (js${interfaceName} ->impl().isFiringEventListeners())\n");2969 push(@implContent, " if (js${interfaceName}.impl().isFiringEventListeners())\n"); 2970 2970 push(@implContent, " return true;\n"); 2971 2971 } 2972 2972 if ($codeGenerator->InheritsInterface($interface, "Node")) { 2973 2973 if (!$emittedJSCast) { 2974 push(@implContent, " auto * js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2974 push(@implContent, " auto& js${interfaceName} = jsCast<JS${interfaceName}&>(cell);\n"); 2975 2975 $emittedJSCast = 1; 2976 2976 } 2977 push(@implContent, " if (JSNodeOwner::isReachableFromOpaqueRoots( handle, 0, visitor))\n");2977 push(@implContent, " if (JSNodeOwner::isReachableFromOpaqueRoots(cell, 0, visitor))\n"); 2978 2978 push(@implContent, " return true;\n"); 2979 2979 } 2980 2980 if (GetGenerateIsReachable($interface)) { 2981 2981 if (!$emittedJSCast) { 2982 push(@implContent, " auto * js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2982 push(@implContent, " auto& js${interfaceName} = jsCast<JS${interfaceName}&>(cell);\n"); 2983 2983 $emittedJSCast = 1; 2984 2984 } … … 2986 2986 my $rootString; 2987 2987 if (GetGenerateIsReachable($interface) eq "Impl") { 2988 $rootString = " ${implType}* root = &js${interfaceName} ->impl();\n";2988 $rootString = " ${implType}* root = &js${interfaceName}.impl();\n"; 2989 2989 } elsif (GetGenerateIsReachable($interface) eq "ImplWebGLRenderingContext") { 2990 $rootString = " WebGLRenderingContextBase* root = WTF::getPtr(js${interfaceName} ->impl().context());\n";2990 $rootString = " WebGLRenderingContextBase* root = WTF::getPtr(js${interfaceName}.impl().context());\n"; 2991 2991 } elsif (GetGenerateIsReachable($interface) eq "ImplFrame") { 2992 $rootString = " Frame* root = WTF::getPtr(js${interfaceName} ->impl().frame());\n";2992 $rootString = " Frame* root = WTF::getPtr(js${interfaceName}.impl().frame());\n"; 2993 2993 $rootString .= " if (!root)\n"; 2994 2994 $rootString .= " return false;\n"; 2995 2995 } elsif (GetGenerateIsReachable($interface) eq "ImplDocument") { 2996 $rootString = " Document* root = WTF::getPtr(js${interfaceName} ->impl().document());\n";2996 $rootString = " Document* root = WTF::getPtr(js${interfaceName}.impl().document());\n"; 2997 2997 $rootString .= " if (!root)\n"; 2998 2998 $rootString .= " return false;\n"; … … 3000 3000 $implIncludes{"Element.h"} = 1; 3001 3001 $implIncludes{"JSNodeCustom.h"} = 1; 3002 $rootString = " Element* element = WTF::getPtr(js${interfaceName} ->impl().element());\n";3002 $rootString = " Element* element = WTF::getPtr(js${interfaceName}.impl().element());\n"; 3003 3003 $rootString .= " if (!element)\n"; 3004 3004 $rootString .= " return false;\n"; … … 3007 3007 $implIncludes{"Element.h"} = 1; 3008 3008 $implIncludes{"JSNodeCustom.h"} = 1; 3009 $rootString = " void* root = WebCore::root(js${interfaceName} ->impl().canvas());\n";3009 $rootString = " void* root = WebCore::root(js${interfaceName}.impl().canvas());\n"; 3010 3010 } elsif (GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { 3011 3011 $implIncludes{"Element.h"} = 1; 3012 3012 $implIncludes{"JSNodeCustom.h"} = 1; 3013 $rootString = " void* root = WebCore::root(js${interfaceName} ->impl().ownerNode());\n";3013 $rootString = " void* root = WebCore::root(js${interfaceName}.impl().ownerNode());\n"; 3014 3014 } else { 3015 $rootString = " void* root = WebCore::root(&js${interfaceName} ->impl());\n";3015 $rootString = " void* root = WebCore::root(&js${interfaceName}.impl());\n"; 3016 3016 } 3017 3017 … … 3020 3020 } else { 3021 3021 if (!$emittedJSCast) { 3022 push(@implContent, " UNUSED_PARAM( handle);\n");3022 push(@implContent, " UNUSED_PARAM(cell);\n"); 3023 3023 } 3024 3024 push(@implContent, " UNUSED_PARAM(visitor);\n"); … … 3033 3033 GetCustomIsReachable($interface) || 3034 3034 $codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject"))) { 3035 push(@implContent, "void JS${interfaceName}Owner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)\n");3035 push(@implContent, "void JS${interfaceName}Owner::finalize(JSC::JSCell*& cell, void* context)\n"); 3036 3036 push(@implContent, "{\n"); 3037 push(@implContent, " auto * js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");3037 push(@implContent, " auto& wrapper = jsCast<JS${interfaceName}&>(*cell);\n"); 3038 3038 push(@implContent, " auto& world = *static_cast<DOMWrapperWorld*>(context);\n"); 3039 push(@implContent, " uncacheWrapper(world, & js${interfaceName}->impl(), js${interfaceName});\n");3039 push(@implContent, " uncacheWrapper(world, &wrapper.impl(), &wrapper);\n"); 3040 3040 push(@implContent, "}\n\n"); 3041 3041 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
r189188 r189616 241 241 } 242 242 243 bool JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)244 { 245 UNUSED_PARAM( handle);243 bool JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 244 { 245 UNUSED_PARAM(cell); 246 246 UNUSED_PARAM(visitor); 247 247 return false; 248 248 } 249 249 250 void JSTestActiveDOMObjectOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)251 { 252 auto * jsTestActiveDOMObject = jsCast<JSTestActiveDOMObject*>(handle.slot()->asCell());250 void JSTestActiveDOMObjectOwner::finalize(JSC::JSCell*& cell, void* context) 251 { 252 auto& wrapper = jsCast<JSTestActiveDOMObject&>(*cell); 253 253 auto& world = *static_cast<DOMWrapperWorld*>(context); 254 uncacheWrapper(world, & jsTestActiveDOMObject->impl(), jsTestActiveDOMObject);254 uncacheWrapper(world, &wrapper.impl(), &wrapper); 255 255 } 256 256 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
r184228 r189616 73 73 class JSTestActiveDOMObjectOwner : public JSC::WeakHandleOwner { 74 74 public: 75 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);76 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);75 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 76 void finalize(JSC::JSCell*&, void* context) override; 77 77 }; 78 78 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp
r189188 r189616 158 158 } 159 159 160 bool JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)161 { 162 UNUSED_PARAM( handle);160 bool JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 161 { 162 UNUSED_PARAM(cell); 163 163 UNUSED_PARAM(visitor); 164 164 return false; 165 165 } 166 166 167 void JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)168 { 169 auto * jsTestCustomConstructorWithNoInterfaceObject = jsCast<JSTestCustomConstructorWithNoInterfaceObject*>(handle.slot()->asCell());167 void JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize(JSC::JSCell*& cell, void* context) 168 { 169 auto& wrapper = jsCast<JSTestCustomConstructorWithNoInterfaceObject&>(*cell); 170 170 auto& world = *static_cast<DOMWrapperWorld*>(context); 171 uncacheWrapper(world, & jsTestCustomConstructorWithNoInterfaceObject->impl(), jsTestCustomConstructorWithNoInterfaceObject);171 uncacheWrapper(world, &wrapper.impl(), &wrapper); 172 172 } 173 173 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h
r184953 r189616 69 69 class JSTestCustomConstructorWithNoInterfaceObjectOwner : public JSC::WeakHandleOwner { 70 70 public: 71 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);72 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);71 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 72 void finalize(JSC::JSCell*&, void* context) override; 73 73 }; 74 74 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
r189188 r189616 226 226 } 227 227 228 bool JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)229 { 230 UNUSED_PARAM( handle);228 bool JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 229 { 230 UNUSED_PARAM(cell); 231 231 UNUSED_PARAM(visitor); 232 232 return false; 233 233 } 234 234 235 void JSTestCustomNamedGetterOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)236 { 237 auto * jsTestCustomNamedGetter = jsCast<JSTestCustomNamedGetter*>(handle.slot()->asCell());235 void JSTestCustomNamedGetterOwner::finalize(JSC::JSCell*& cell, void* context) 236 { 237 auto& wrapper = jsCast<JSTestCustomNamedGetter&>(*cell); 238 238 auto& world = *static_cast<DOMWrapperWorld*>(context); 239 uncacheWrapper(world, & jsTestCustomNamedGetter->impl(), jsTestCustomNamedGetter);239 uncacheWrapper(world, &wrapper.impl(), &wrapper); 240 240 } 241 241 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h
r188663 r189616 76 76 class JSTestCustomNamedGetterOwner : public JSC::WeakHandleOwner { 77 77 public: 78 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);79 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);78 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 79 void finalize(JSC::JSCell*&, void* context) override; 80 80 }; 81 81 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
r189188 r189616 242 242 } 243 243 244 bool JSTestEventConstructorOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)245 { 246 UNUSED_PARAM( handle);244 bool JSTestEventConstructorOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 245 { 246 UNUSED_PARAM(cell); 247 247 UNUSED_PARAM(visitor); 248 248 return false; 249 249 } 250 250 251 void JSTestEventConstructorOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)252 { 253 auto * jsTestEventConstructor = jsCast<JSTestEventConstructor*>(handle.slot()->asCell());251 void JSTestEventConstructorOwner::finalize(JSC::JSCell*& cell, void* context) 252 { 253 auto& wrapper = jsCast<JSTestEventConstructor&>(*cell); 254 254 auto& world = *static_cast<DOMWrapperWorld*>(context); 255 uncacheWrapper(world, & jsTestEventConstructor->impl(), jsTestEventConstructor);255 uncacheWrapper(world, &wrapper.impl(), &wrapper); 256 256 } 257 257 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
r184228 r189616 72 72 class JSTestEventConstructorOwner : public JSC::WeakHandleOwner { 73 73 public: 74 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);75 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);74 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 75 void finalize(JSC::JSCell*&, void* context) override; 76 76 }; 77 77 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
r189188 r189616 321 321 } 322 322 323 bool JSTestEventTargetOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)324 { 325 auto * jsTestEventTarget = jsCast<JSTestEventTarget*>(handle.slot()->asCell());326 if (jsTestEventTarget ->impl().isFiringEventListeners())323 bool JSTestEventTargetOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 324 { 325 auto& jsTestEventTarget = jsCast<JSTestEventTarget&>(cell); 326 if (jsTestEventTarget.impl().isFiringEventListeners()) 327 327 return true; 328 328 UNUSED_PARAM(visitor); … … 330 330 } 331 331 332 void JSTestEventTargetOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)333 { 334 auto * jsTestEventTarget = jsCast<JSTestEventTarget*>(handle.slot()->asCell());332 void JSTestEventTargetOwner::finalize(JSC::JSCell*& cell, void* context) 333 { 334 auto& wrapper = jsCast<JSTestEventTarget&>(*cell); 335 335 auto& world = *static_cast<DOMWrapperWorld*>(context); 336 uncacheWrapper(world, & jsTestEventTarget->impl(), jsTestEventTarget);336 uncacheWrapper(world, &wrapper.impl(), &wrapper); 337 337 } 338 338 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
r188663 r189616 80 80 class JSTestEventTargetOwner : public JSC::WeakHandleOwner { 81 81 public: 82 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);83 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);82 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 83 void finalize(JSC::JSCell*&, void* context) override; 84 84 }; 85 85 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
r189188 r189616 191 191 } 192 192 193 bool JSTestExceptionOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)194 { 195 UNUSED_PARAM( handle);193 bool JSTestExceptionOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 194 { 195 UNUSED_PARAM(cell); 196 196 UNUSED_PARAM(visitor); 197 197 return false; 198 198 } 199 199 200 void JSTestExceptionOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)201 { 202 auto * jsTestException = jsCast<JSTestException*>(handle.slot()->asCell());200 void JSTestExceptionOwner::finalize(JSC::JSCell*& cell, void* context) 201 { 202 auto& wrapper = jsCast<JSTestException&>(*cell); 203 203 auto& world = *static_cast<DOMWrapperWorld*>(context); 204 uncacheWrapper(world, & jsTestException->impl(), jsTestException);204 uncacheWrapper(world, &wrapper.impl(), &wrapper); 205 205 } 206 206 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h
r184228 r189616 74 74 class JSTestExceptionOwner : public JSC::WeakHandleOwner { 75 75 public: 76 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);77 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);76 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 77 void finalize(JSC::JSCell*&, void* context) override; 78 78 }; 79 79 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
r189188 r189616 153 153 } 154 154 155 bool JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)156 { 157 auto * jsTestGenerateIsReachable = jsCast<JSTestGenerateIsReachable*>(handle.slot()->asCell());158 TestGenerateIsReachable* root = &jsTestGenerateIsReachable ->impl();155 bool JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 156 { 157 auto& jsTestGenerateIsReachable = jsCast<JSTestGenerateIsReachable&>(cell); 158 TestGenerateIsReachable* root = &jsTestGenerateIsReachable.impl(); 159 159 return visitor.containsOpaqueRoot(root); 160 160 } 161 161 162 void JSTestGenerateIsReachableOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)163 { 164 auto * jsTestGenerateIsReachable = jsCast<JSTestGenerateIsReachable*>(handle.slot()->asCell());162 void JSTestGenerateIsReachableOwner::finalize(JSC::JSCell*& cell, void* context) 163 { 164 auto& wrapper = jsCast<JSTestGenerateIsReachable&>(*cell); 165 165 auto& world = *static_cast<DOMWrapperWorld*>(context); 166 uncacheWrapper(world, & jsTestGenerateIsReachable->impl(), jsTestGenerateIsReachable);166 uncacheWrapper(world, &wrapper.impl(), &wrapper); 167 167 } 168 168 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h
r184228 r189616 70 70 class JSTestGenerateIsReachableOwner : public JSC::WeakHandleOwner { 71 71 public: 72 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);73 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);72 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 73 void finalize(JSC::JSCell*&, void* context) override; 74 74 }; 75 75 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r189188 r189616 940 940 #endif 941 941 942 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)943 { 944 auto * jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell());945 if (jsTestInterface ->impl().hasPendingActivity())942 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 943 { 944 auto& jsTestInterface = jsCast<JSTestInterface&>(cell); 945 if (jsTestInterface.impl().hasPendingActivity()) 946 946 return true; 947 947 UNUSED_PARAM(visitor); … … 949 949 } 950 950 951 void JSTestInterfaceOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)952 { 953 auto * jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell());951 void JSTestInterfaceOwner::finalize(JSC::JSCell*& cell, void* context) 952 { 953 auto& wrapper = jsCast<JSTestInterface&>(*cell); 954 954 auto& world = *static_cast<DOMWrapperWorld*>(context); 955 uncacheWrapper(world, & jsTestInterface->impl(), jsTestInterface);955 uncacheWrapper(world, &wrapper.impl(), &wrapper); 956 956 } 957 957 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
r183523 r189616 100 100 class JSTestInterfaceOwner : public JSC::WeakHandleOwner { 101 101 public: 102 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);103 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);102 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 103 void finalize(JSC::JSCell*&, void* context) override; 104 104 }; 105 105 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r189188 r189616 178 178 } 179 179 180 bool JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)181 { 182 UNUSED_PARAM( handle);180 bool JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 181 { 182 UNUSED_PARAM(cell); 183 183 UNUSED_PARAM(visitor); 184 184 return false; 185 185 } 186 186 187 void JSTestMediaQueryListListenerOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)188 { 189 auto * jsTestMediaQueryListListener = jsCast<JSTestMediaQueryListListener*>(handle.slot()->asCell());187 void JSTestMediaQueryListListenerOwner::finalize(JSC::JSCell*& cell, void* context) 188 { 189 auto& wrapper = jsCast<JSTestMediaQueryListListener&>(*cell); 190 190 auto& world = *static_cast<DOMWrapperWorld*>(context); 191 uncacheWrapper(world, & jsTestMediaQueryListListener->impl(), jsTestMediaQueryListListener);191 uncacheWrapper(world, &wrapper.impl(), &wrapper); 192 192 } 193 193 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
r184228 r189616 70 70 class JSTestMediaQueryListListenerOwner : public JSC::WeakHandleOwner { 71 71 public: 72 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);73 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);72 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 73 void finalize(JSC::JSCell*&, void* context) override; 74 74 }; 75 75 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
r189507 r189616 231 231 } 232 232 233 bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)234 { 235 auto * jsTestNamedConstructor = jsCast<JSTestNamedConstructor*>(handle.slot()->asCell());236 if (jsTestNamedConstructor ->impl().hasPendingActivity())233 bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 234 { 235 auto& jsTestNamedConstructor = jsCast<JSTestNamedConstructor&>(cell); 236 if (jsTestNamedConstructor.impl().hasPendingActivity()) 237 237 return true; 238 238 UNUSED_PARAM(visitor); … … 240 240 } 241 241 242 void JSTestNamedConstructorOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)243 { 244 auto * jsTestNamedConstructor = jsCast<JSTestNamedConstructor*>(handle.slot()->asCell());242 void JSTestNamedConstructorOwner::finalize(JSC::JSCell*& cell, void* context) 243 { 244 auto& wrapper = jsCast<JSTestNamedConstructor&>(*cell); 245 245 auto& world = *static_cast<DOMWrapperWorld*>(context); 246 uncacheWrapper(world, & jsTestNamedConstructor->impl(), jsTestNamedConstructor);246 uncacheWrapper(world, &wrapper.impl(), &wrapper); 247 247 } 248 248 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h
r184228 r189616 71 71 class JSTestNamedConstructorOwner : public JSC::WeakHandleOwner { 72 72 public: 73 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);74 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);73 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 74 void finalize(JSC::JSCell*&, void* context) override; 75 75 }; 76 76 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
r189188 r189616 484 484 } 485 485 486 bool JSTestNondeterministicOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)487 { 488 UNUSED_PARAM( handle);486 bool JSTestNondeterministicOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 487 { 488 UNUSED_PARAM(cell); 489 489 UNUSED_PARAM(visitor); 490 490 return false; 491 491 } 492 492 493 void JSTestNondeterministicOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)494 { 495 auto * jsTestNondeterministic = jsCast<JSTestNondeterministic*>(handle.slot()->asCell());493 void JSTestNondeterministicOwner::finalize(JSC::JSCell*& cell, void* context) 494 { 495 auto& wrapper = jsCast<JSTestNondeterministic&>(*cell); 496 496 auto& world = *static_cast<DOMWrapperWorld*>(context); 497 uncacheWrapper(world, & jsTestNondeterministic->impl(), jsTestNondeterministic);497 uncacheWrapper(world, &wrapper.impl(), &wrapper); 498 498 } 499 499 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h
r184228 r189616 70 70 class JSTestNondeterministicOwner : public JSC::WeakHandleOwner { 71 71 public: 72 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);73 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);72 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 73 void finalize(JSC::JSCell*&, void* context) override; 74 74 }; 75 75 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r189507 r189616 4683 4683 } 4684 4684 4685 bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)4686 { 4687 UNUSED_PARAM( handle);4685 bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 4686 { 4687 UNUSED_PARAM(cell); 4688 4688 UNUSED_PARAM(visitor); 4689 4689 return false; 4690 4690 } 4691 4691 4692 void JSTestObjOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)4693 { 4694 auto * jsTestObj = jsCast<JSTestObj*>(handle.slot()->asCell());4692 void JSTestObjOwner::finalize(JSC::JSCell*& cell, void* context) 4693 { 4694 auto& wrapper = jsCast<JSTestObj&>(*cell); 4695 4695 auto& world = *static_cast<DOMWrapperWorld*>(context); 4696 uncacheWrapper(world, & jsTestObj->impl(), jsTestObj);4696 uncacheWrapper(world, &wrapper.impl(), &wrapper); 4697 4697 } 4698 4698 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r188334 r189616 86 86 class JSTestObjOwner : public JSC::WeakHandleOwner { 87 87 public: 88 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);89 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);88 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 89 void finalize(JSC::JSCell*&, void* context) override; 90 90 }; 91 91 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
r189188 r189616 247 247 } 248 248 249 bool JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)250 { 251 UNUSED_PARAM( handle);249 bool JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 250 { 251 UNUSED_PARAM(cell); 252 252 UNUSED_PARAM(visitor); 253 253 return false; 254 254 } 255 255 256 void JSTestOverloadedConstructorsOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)257 { 258 auto * jsTestOverloadedConstructors = jsCast<JSTestOverloadedConstructors*>(handle.slot()->asCell());256 void JSTestOverloadedConstructorsOwner::finalize(JSC::JSCell*& cell, void* context) 257 { 258 auto& wrapper = jsCast<JSTestOverloadedConstructors&>(*cell); 259 259 auto& world = *static_cast<DOMWrapperWorld*>(context); 260 uncacheWrapper(world, & jsTestOverloadedConstructors->impl(), jsTestOverloadedConstructors);260 uncacheWrapper(world, &wrapper.impl(), &wrapper); 261 261 } 262 262 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h
r184228 r189616 70 70 class JSTestOverloadedConstructorsOwner : public JSC::WeakHandleOwner { 71 71 public: 72 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);73 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);72 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 73 void finalize(JSC::JSCell*&, void* context) override; 74 74 }; 75 75 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp
r189188 r189616 222 222 } 223 223 224 bool JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)225 { 226 UNUSED_PARAM( handle);224 bool JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 225 { 226 UNUSED_PARAM(cell); 227 227 UNUSED_PARAM(visitor); 228 228 return false; 229 229 } 230 230 231 void JSTestOverrideBuiltinsOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)232 { 233 auto * jsTestOverrideBuiltins = jsCast<JSTestOverrideBuiltins*>(handle.slot()->asCell());231 void JSTestOverrideBuiltinsOwner::finalize(JSC::JSCell*& cell, void* context) 232 { 233 auto& wrapper = jsCast<JSTestOverrideBuiltins&>(*cell); 234 234 auto& world = *static_cast<DOMWrapperWorld*>(context); 235 uncacheWrapper(world, & jsTestOverrideBuiltins->impl(), jsTestOverrideBuiltins);235 uncacheWrapper(world, &wrapper.impl(), &wrapper); 236 236 } 237 237 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h
r188663 r189616 76 76 class JSTestOverrideBuiltinsOwner : public JSC::WeakHandleOwner { 77 77 public: 78 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);79 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);78 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 79 void finalize(JSC::JSCell*&, void* context) override; 80 80 }; 81 81 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r189188 r189616 312 312 } 313 313 314 bool JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)315 { 316 UNUSED_PARAM( handle);314 bool JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 315 { 316 UNUSED_PARAM(cell); 317 317 UNUSED_PARAM(visitor); 318 318 return false; 319 319 } 320 320 321 void JSTestSerializedScriptValueInterfaceOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)322 { 323 auto * jsTestSerializedScriptValueInterface = jsCast<JSTestSerializedScriptValueInterface*>(handle.slot()->asCell());321 void JSTestSerializedScriptValueInterfaceOwner::finalize(JSC::JSCell*& cell, void* context) 322 { 323 auto& wrapper = jsCast<JSTestSerializedScriptValueInterface&>(*cell); 324 324 auto& world = *static_cast<DOMWrapperWorld*>(context); 325 uncacheWrapper(world, & jsTestSerializedScriptValueInterface->impl(), jsTestSerializedScriptValueInterface);325 uncacheWrapper(world, &wrapper.impl(), &wrapper); 326 326 } 327 327 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
r184228 r189616 76 76 class JSTestSerializedScriptValueInterfaceOwner : public JSC::WeakHandleOwner { 77 77 public: 78 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);79 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);78 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 79 void finalize(JSC::JSCell*&, void* context) override; 80 80 }; 81 81 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r189188 r189616 721 721 } 722 722 723 bool JSTestTypedefsOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)724 { 725 UNUSED_PARAM( handle);723 bool JSTestTypedefsOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 724 { 725 UNUSED_PARAM(cell); 726 726 UNUSED_PARAM(visitor); 727 727 return false; 728 728 } 729 729 730 void JSTestTypedefsOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)731 { 732 auto * jsTestTypedefs = jsCast<JSTestTypedefs*>(handle.slot()->asCell());730 void JSTestTypedefsOwner::finalize(JSC::JSCell*& cell, void* context) 731 { 732 auto& wrapper = jsCast<JSTestTypedefs&>(*cell); 733 733 auto& world = *static_cast<DOMWrapperWorld*>(context); 734 uncacheWrapper(world, & jsTestTypedefs->impl(), jsTestTypedefs);734 uncacheWrapper(world, &wrapper.impl(), &wrapper); 735 735 } 736 736 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h
r184228 r189616 73 73 class JSTestTypedefsOwner : public JSC::WeakHandleOwner { 74 74 public: 75 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);76 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);75 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 76 void finalize(JSC::JSCell*&, void* context) override; 77 77 }; 78 78 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
r189188 r189616 174 174 } 175 175 176 bool JSattributeOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)177 { 178 UNUSED_PARAM( handle);176 bool JSattributeOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 177 { 178 UNUSED_PARAM(cell); 179 179 UNUSED_PARAM(visitor); 180 180 return false; 181 181 } 182 182 183 void JSattributeOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)184 { 185 auto * jsattribute = jsCast<JSattribute*>(handle.slot()->asCell());183 void JSattributeOwner::finalize(JSC::JSCell*& cell, void* context) 184 { 185 auto& wrapper = jsCast<JSattribute&>(*cell); 186 186 auto& world = *static_cast<DOMWrapperWorld*>(context); 187 uncacheWrapper(world, & jsattribute->impl(), jsattribute);187 uncacheWrapper(world, &wrapper.impl(), &wrapper); 188 188 } 189 189 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h
r184228 r189616 71 71 class JSattributeOwner : public JSC::WeakHandleOwner { 72 72 public: 73 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);74 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);73 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 74 void finalize(JSC::JSCell*&, void* context) override; 75 75 }; 76 76 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp
r189188 r189616 153 153 } 154 154 155 bool JSreadonlyOwner::isReachableFromOpaqueRoots(JSC:: Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)155 bool JSreadonlyOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor) 156 156 { 157 UNUSED_PARAM( handle);157 UNUSED_PARAM(cell); 158 158 UNUSED_PARAM(visitor); 159 159 return false; 160 160 } 161 161 162 void JSreadonlyOwner::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)162 void JSreadonlyOwner::finalize(JSC::JSCell*& cell, void* context) 163 163 { 164 auto * jsreadonly = jsCast<JSreadonly*>(handle.slot()->asCell());164 auto& wrapper = jsCast<JSreadonly&>(*cell); 165 165 auto& world = *static_cast<DOMWrapperWorld*>(context); 166 uncacheWrapper(world, & jsreadonly->impl(), jsreadonly);166 uncacheWrapper(world, &wrapper.impl(), &wrapper); 167 167 } 168 168 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h
r184228 r189616 70 70 class JSreadonlyOwner : public JSC::WeakHandleOwner { 71 71 public: 72 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);73 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context);72 bool isReachableFromOpaqueRoots(JSC::JSCell&, void* context, JSC::SlotVisitor&) override; 73 void finalize(JSC::JSCell*&, void* context) override; 74 74 }; 75 75 -
trunk/Source/WebCore/bridge/runtime_root.cpp
r171371 r189616 197 197 } 198 198 199 void RootObject::finalize(JSC:: Handle<JSC::Unknown> handle, void*)200 { 201 RuntimeObject* object = static_cast<RuntimeObject*>(handle.slot()->asCell());199 void RootObject::finalize(JSC::JSCell*& cell, void*) 200 { 201 RuntimeObject* object = jsCast<RuntimeObject*>(cell); 202 202 203 203 Ref<RootObject> protect(*this); -
trunk/Source/WebCore/bridge/runtime_root.h
r172814 r189616 84 84 85 85 // WeakHandleOwner 86 v irtual void finalize(JSC::Handle<JSC::Unknown>, void* context) override;86 void finalize(JSC::JSCell*&, void* context) override; 87 87 88 88 bool m_isValid; -
trunk/Source/WebKit2/ChangeLog
r189602 r189616 1 2015-09-11 Andreas Kling <[email protected]> 2 3 [JSC] Weak should only accept cell pointees. 4 <https://webkit.org/b/148955> 5 6 Reviewed by Geoffrey Garen. 7 8 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: 9 (WebKit::NPRuntimeObjectMap::finalize): 10 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 11 1 12 2015-09-10 Joseph Pecoraro <[email protected]> 2 13 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
r173696 r189616 306 306 } 307 307 308 void NPRuntimeObjectMap::finalize(JSC:: Handle<JSC::Unknown> handle, void* context)309 { 310 JSNPObject * object = jsCast<JSNPObject*>(handle.get().asCell());311 weakRemove(m_jsNPObjects, static_cast<NPObject*>(context), object);312 addToInvalidationQueue(object ->leakNPObject());308 void NPRuntimeObjectMap::finalize(JSC::JSCell*& cell, void* context) 309 { 310 JSNPObject& object = jsCast<JSNPObject&>(*cell); 311 weakRemove(m_jsNPObjects, static_cast<NPObject*>(context), &object); 312 addToInvalidationQueue(object.leakNPObject()); 313 313 } 314 314 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h
r159001 r189616 53 53 54 54 // A per plug-in map of NPObjects that wrap JavaScript objects. 55 class NPRuntimeObjectMap : private JSC::WeakHandleOwner {55 class NPRuntimeObjectMap final : private JSC::WeakHandleOwner { 56 56 public: 57 57 explicit NPRuntimeObjectMap(PluginView*); … … 91 91 private: 92 92 // WeakHandleOwner 93 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 93 void finalize(JSC::JSCell*&, void* context) override; 94 94 95 void addToInvalidationQueue(NPObject*); 95 96 void invalidateQueuedObjects();
Note:
See TracChangeset
for help on using the changeset viewer.