Changeset 246808 in webkit
- Timestamp:
- Jun 25, 2019 2:19:21 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246798 r246808 1 2019-06-25 Keith Miller <keith_miller@apple.com> 2 3 Add didBecomePrototype() calls to global context prototypes 4 https://bugs.webkit.org/show_bug.cgi?id=199202 5 6 Reviewed by Mark Lam. 7 8 This fixes some crashes related to asserting that all prototypes 9 have been marked as such in JSC from 10 https://trac.webkit.org/changeset/246801. It's ok to call 11 didBecomePrototype here as we setting up the world state right now 12 so we won't be having a bad time. 13 14 We don't automatically call didBecomePrototype() for 15 setPrototypeWithoutTransition because existing objects may already 16 have this structure so it seems more reasonable to be explicit 17 there. 18 19 * bindings/js/JSWindowProxy.cpp: 20 (WebCore::JSWindowProxy::setWindow): 21 * bindings/js/WorkerScriptController.cpp: 22 (WebCore::WorkerScriptController::initScript): 23 * worklets/WorkletScriptController.cpp: 24 (WebCore::WorkletScriptController::initScriptWithSubclass): 25 1 26 2019-06-25 Joseph Pecoraro <pecoraro@apple.com> 2 27 -
trunk/Source/WebCore/bindings/js/JSWindowProxy.cpp
r246780 r246808 112 112 auto& propertiesStructure = *JSDOMWindowProperties::createStructure(vm, window, JSEventTarget::prototype(vm, *window)); 113 113 auto& properties = *JSDOMWindowProperties::create(&propertiesStructure, *window); 114 properties.didBecomePrototype(); 114 115 prototype->structure(vm)->setPrototypeWithoutTransition(vm, &properties); 115 116 -
trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp
r237981 r246808 91 91 ASSERT(m_workerGlobalScopeWrapper->structure(*m_vm)->globalObject() == m_workerGlobalScopeWrapper); 92 92 dedicatedContextPrototype->structure(*m_vm)->setGlobalObject(*m_vm, m_workerGlobalScopeWrapper.get()); 93 dedicatedContextPrototype->structure(*m_vm)->setPrototypeWithoutTransition(*m_vm, JSWorkerGlobalScope::prototype(*m_vm, *m_workerGlobalScopeWrapper.get())); 93 auto* workerGlobalScopePrototype = JSWorkerGlobalScope::prototype(*m_vm, *m_workerGlobalScopeWrapper.get()); 94 workerGlobalScopePrototype->didBecomePrototype(); 95 dedicatedContextPrototype->structure(*m_vm)->setPrototypeWithoutTransition(*m_vm, workerGlobalScopePrototype); 94 96 95 97 proxy->setTarget(*m_vm, m_workerGlobalScopeWrapper.get()); … … 108 110 ASSERT(m_workerGlobalScopeWrapper->structure()->globalObject() == m_workerGlobalScopeWrapper); 109 111 contextPrototype->structure(*m_vm)->setGlobalObject(*m_vm, m_workerGlobalScopeWrapper.get()); 110 contextPrototype->structure(*m_vm)->setPrototypeWithoutTransition(*m_vm, JSWorkerGlobalScope::prototype(*m_vm, *m_workerGlobalScopeWrapper.get())); 112 auto* workerGlobalScopePrototype = JSWorkerGlobalScope::prototype(*m_vm, *m_workerGlobalScopeWrapper.get()); 113 workerGlobalScopePrototype->didBecomePrototype(); 114 contextPrototype->structure(*m_vm)->setPrototypeWithoutTransition(*m_vm, workerGlobalScopePrototype); 111 115 112 116 proxy->setTarget(*m_vm, m_workerGlobalScopeWrapper.get()); -
trunk/Source/WebCore/worklets/WorkletScriptController.cpp
r238686 r246808 127 127 ASSERT(m_workletGlobalScopeWrapper->structure(*m_vm)->globalObject() == m_workletGlobalScopeWrapper); 128 128 contextPrototype->structure(*m_vm)->setGlobalObject(*m_vm, m_workletGlobalScopeWrapper.get()); 129 contextPrototype->structure(*m_vm)->setPrototypeWithoutTransition(*m_vm, JSGlobalScope::prototype(*m_vm, *m_workletGlobalScopeWrapper.get())); 129 auto* globalScopePrototype = JSGlobalScope::prototype(*m_vm, *m_workletGlobalScopeWrapper.get()); 130 globalScopePrototype->didBecomePrototype(); 131 contextPrototype->structure(*m_vm)->setPrototypeWithoutTransition(*m_vm, globalScopePrototype); 130 132 131 133 proxy->setTarget(*m_vm, m_workletGlobalScopeWrapper.get());
Note: See TracChangeset
for help on using the changeset viewer.