|
|
Chromium Code Reviews
DescriptionFor a worker, mark relative to its wrapper map.
If marking a ScriptWrappable's wrapper object in a worker context,
do that by consulting the worker's underlying DOMWrapperMap.
R=jochen,haraken
BUG=686563
Patch Set 1 #Patch Set 2 : avoid redundant test #Patch Set 3 : add test #
Total comments: 3
Patch Set 4 : provide DOMWrapperWorld via TLS #Patch Set 5 : simplify DOMWrapperWorld lookup #Patch Set 6 : check if ThreadState has a registered Isolate #Patch Set 7 : check if ThreadState has a non-empty Isolate #
Total comments: 3
Patch Set 8 : check DOMDataStore access #
Total comments: 1
Messages
Total messages: 53 (34 generated)
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Handle marking in worker wrapper worlds. R= BUG=683406 ========== to ========== For a worker, mark relative to its wrapper map. If marking a ScriptWrappable's wrapper object in a worker context, do that by consulting the worker's underlying DOMWrapperMap. R= BUG=683406 ==========
jochen@chromium.org changed reviewers: + jochen@chromium.org
https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: DOMWrapperWorld* wrapperWorld = alternatively, we could stick the wrapper map into a thread local, wdyt?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
haraken@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: DOMWrapperWorld* wrapperWorld = On 2017/01/29 15:50:44, jochen (travelling til Feb 4) wrote: > alternatively, we could stick the wrapper map into a thread local, wdyt? Yeah, if we move m_world to V8PerContextData, we can use the same code path for the main thread and a worker thread. I'm not sure how much work it will be. This CL looks good as an immediate fix.
https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: DOMWrapperWorld* wrapperWorld = On 2017/01/29 15:50:44, jochen (travelling til Feb 4) wrote: > alternatively, we could stick the wrapper map into a thread local, wdyt? That would cut out the middle men here, ps#4 tries that. I added clearing of the TLS entry upon script controller disposal, to make its non-null lifetime known & clear.
lgtm
On 2017/01/29 16:52:13, sof wrote: > https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): > > https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: > DOMWrapperWorld* wrapperWorld = > On 2017/01/29 15:50:44, jochen (travelling til Feb 4) wrote: > > alternatively, we could stick the wrapper map into a thread local, wdyt? > > That would cut out the middle men here, ps#4 tries that. > > I added clearing of the TLS entry upon script controller disposal, to make its > non-null lifetime known & clear. This will work but looks a bit weird to create a thread-local storage since V8PerContextData is a "thread-local" storage for V8-related per-thread things...
On 2017/01/29 16:57:13, haraken wrote: > On 2017/01/29 16:52:13, sof wrote: > > > https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... > > File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): > > > > > https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... > > third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: > > DOMWrapperWorld* wrapperWorld = > > On 2017/01/29 15:50:44, jochen (travelling til Feb 4) wrote: > > > alternatively, we could stick the wrapper map into a thread local, wdyt? > > > > That would cut out the middle men here, ps#4 tries that. > > > > I added clearing of the TLS entry upon script controller disposal, to make its > > non-null lifetime known & clear. > > This will work but looks a bit weird to create a thread-local storage since > V8PerContextData is a "thread-local" storage for V8-related per-thread things... That makes good sense, but I overlooked one DOMWrapperWorld "cow path" initially. ps#5 simplifies - looks ok?
On 2017/01/29 17:24:01, sof wrote: > On 2017/01/29 16:57:13, haraken wrote: > > On 2017/01/29 16:52:13, sof wrote: > > > > > > https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... > > > File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): > > > > > > > > > https://codereview.chromium.org/2663643002/diff/40001/third_party/WebKit/Sour... > > > third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: > > > DOMWrapperWorld* wrapperWorld = > > > On 2017/01/29 15:50:44, jochen (travelling til Feb 4) wrote: > > > > alternatively, we could stick the wrapper map into a thread local, wdyt? > > > > > > That would cut out the middle men here, ps#4 tries that. > > > > > > I added clearing of the TLS entry upon script controller disposal, to make > its > > > non-null lifetime known & clear. > > > > This will work but looks a bit weird to create a thread-local storage since > > V8PerContextData is a "thread-local" storage for V8-related per-thread > things... > > That makes good sense, but I overlooked one DOMWrapperWorld "cow path" > initially. ps#5 simplifies - looks ok? PS5 looks awesome! LGTM.
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== For a worker, mark relative to its wrapper map. If marking a ScriptWrappable's wrapper object in a worker context, do that by consulting the worker's underlying DOMWrapperMap. R= BUG=683406 ========== to ========== For a worker, mark relative to its wrapper map. If marking a ScriptWrappable's wrapper object in a worker context, do that by consulting the worker's underlying DOMWrapperMap. R=jochen,haraken BUG=686563 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
ngg@tresorit.com changed reviewers: + ngg@tresorit.com
I'll be able to check tomorrow if this solves really solves our problem. Thanks for the work! https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:145: scriptWrappable->markWrapper(visitor); was this line unnecessary on worker threads?
This needs more work, some boundary cases not being handled correctly. I'll be travelling and mostly afk next week, so if anyone wants to take it over, please do.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
On 2017/01/29 21:11:13, sof wrote: > This needs more work, some boundary cases not being handled correctly. > > I'll be travelling and mostly afk next week, so if anyone wants to take it over, > please do. LGTM, will check details tomorrow. Thanks
jochen@chromium.org changed reviewers: + mlippautz@chromium.org
https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:149: if (dataStore.containsWrapper(scriptWrappable)) { I guess this line is missing ^^^
On 2017/01/30 00:52:28, jochen (travelling til Feb 4) wrote: > https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... > File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): > > https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... > third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:149: if > (dataStore.containsWrapper(scriptWrappable)) { > I guess this line is missing ^^^ I can take over on Monday in MTV, if that is of any help. Just let me know.
The CQ bit was checked by sigbjornf@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/01/30 01:54:12, Michael Lippautz (slow travel) wrote: > On 2017/01/30 00:52:28, jochen (travelling til Feb 4) wrote: > > > https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... > > File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): > > > > > https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... > > third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:149: if > > (dataStore.containsWrapper(scriptWrappable)) { > > I guess this line is missing ^^^ > > I can take over on Monday in MTV, if that is of any help. Just let me know. Thanks, if it hasn't landed, that'd be awesome :) i.e., giving latest ps to the bots with jochen@'s additional check - that might be it. And now better rush to the airport.
https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:149: if (dataStore.containsWrapper(scriptWrappable)) { On 2017/01/30 00:52:27, jochen (travelling til Feb 4) wrote: > I guess this line is missing ^^^ ah, thanks much - that might be all.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
On 2017/01/30 04:50:56, sof wrote: > https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... > File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): > > https://codereview.chromium.org/2663643002/diff/120001/third_party/WebKit/Sou... > third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:149: if > (dataStore.containsWrapper(scriptWrappable)) { > On 2017/01/30 00:52:27, jochen (travelling til Feb 4) wrote: > > I guess this line is missing ^^^ > > ah, thanks much - that might be all. Unfortunately this doesn't solve our problem, in our project the XHR still gets GC'd before finishing. My previous minimized example runs correctly now, I'll try to create a new small example that still fails.
https://codereview.chromium.org/2663643002/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp (right): https://codereview.chromium.org/2663643002/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp:139: if (isolate && !isolate->GetCurrentContext().IsEmpty()) { maybe remove the GetCurrentContext() call? That creates handles, but we're not necessarily in a handlescope here (and gc creating handles isn't that great either)
On 2017/01/30 12:37:21, NGG wrote: > Unfortunately this doesn't solve our problem, in our project the XHR still gets > GC'd before finishing. My previous minimized example runs correctly now, I'll > try to create a new small example that still fails. self.gc() seems to be working, but manually triggering the GC via the DevConsole can still reproduce the issue. https://bugs.chromium.org/p/chromium/issues/detail?id=683406#c39
On 2017/01/30 17:33:49, NGG wrote: > On 2017/01/30 12:37:21, NGG wrote: > > Unfortunately this doesn't solve our problem, in our project the XHR still > gets > > GC'd before finishing. My previous minimized example runs correctly now, I'll > > try to create a new small example that still fails. > > self.gc() seems to be working, but manually triggering the GC via the DevConsole > can still reproduce the issue. > https://bugs.chromium.org/p/chromium/issues/detail?id=683406#c39 FYI: I am looking right now. The current approach doesn't work as we cannot call GetCurrentContext during a GC, as it would require a new handle scope. I am implementing this now using TLS.
On 2017/01/30 21:58:16, Michael Lippautz (slow travel) wrote: > On 2017/01/30 17:33:49, NGG wrote: > > On 2017/01/30 12:37:21, NGG wrote: > > > Unfortunately this doesn't solve our problem, in our project the XHR still > > gets > > > GC'd before finishing. My previous minimized example runs correctly now, > I'll > > > try to create a new small example that still fails. > > > > self.gc() seems to be working, but manually triggering the GC via the > DevConsole > > can still reproduce the issue. > > https://bugs.chromium.org/p/chromium/issues/detail?id=683406#c39 > > FYI: I am looking right now. The current approach doesn't work as we cannot call > GetCurrentContext during a GC, as it would require a new handle scope. I am > implementing this now using TLS. https://codereview.chromium.org/2665733002 that ended up as, thanks much. Closing this one. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
