Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Issue 2043033002: Trace ScriptWrappableVisitor.m_markingDeque by oilpan gc (Closed)

Created:
4 years, 6 months ago by Marcel Hlopko
Modified:
4 years, 6 months ago
CC:
Mads Ager (chromium), blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews, kouhei+heap_chromium.org, oilpan-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Trace ScriptWrappableVisitor.m_markingDeque by oilpan gc This cl has two parts: 1. Make ScriptWrappableVisitor.m_markingDeque part of the root set for the oilpan gc so wrapper marked objects will not be collected. Without this cl, v8 can detect wrapper during incremental marking, but the v8 scavenger is free to collect the wrapper. Subsequent oilpan gc will collect ScriptWrappable and recorded internal fields of v8 wrapper are no longer valid. With this cl, oilpan will not collect ScriptWrappables if they are in the marking deque. Other slightly more complicated approach would be to cleanup the marking deque after oilpan gc and remove dead objects. 2. Add freshly associated wrappers to the ScriptWrappableVisitor.m_markingDeque to ensure they will be processed when black allocation in v8 is on. When black allcation is on, v8 creates new objects black, and completely skips any processing, including wrapper detection. Such object would be undetected and not traced at all. Because of that, on all wrapper associations (which happen shortly after creation) we put objects into the marking deque. This way we make sure the object will be traced. LOG=no BUG=468240 Committed: https://crrev.com/b2bf69081a17b107dc4ec9c2cc5dd64d961c7e0d Cr-Commit-Position: refs/heads/master@{#399141}

Patch Set 1 #

Patch Set 2 : Do not add already black objects #

Patch Set 3 : Only record wrappers when tracing #

Total comments: 4

Patch Set 4 : Cleanup marking deque after oilpan gc #

Patch Set 5 : Polish #

Total comments: 8

Patch Set 6 : Polish #

Patch Set 7 : Polish #

Total comments: 7

Patch Set 8 : Invalidate deque for all threads #

Patch Set 9 : Polish #

Total comments: 5

Patch Set 10 : Move tracing of active script wrappable to epilogue #

Patch Set 11 : Fix callers of registerTraceDOMWrappers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -28 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h View 1 2 3 4 5 6 4 chunks +11 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +51 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h View 1 2 3 3 chunks +14 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp View 1 2 3 4 5 1 chunk +9 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/heap/RunAllTests.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/heap/ThreadState.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/heap/ThreadState.cpp View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/testing/RunAllTests.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 29 (8 generated)
Marcel Hlopko
Ptal.
4 years, 6 months ago (2016-06-07 13:39:19 UTC) #2
haraken
> Make ScriptWrappableVisitor.m_markingDeque part of the root set for the > oilpan gc so wrapper ...
4 years, 6 months ago (2016-06-08 01:10:12 UTC) #3
Marcel Hlopko
I tried multiple solutions in the v8, but none which would not regress performance on ...
4 years, 6 months ago (2016-06-08 06:45:06 UTC) #4
haraken
> Without this cl, v8 can detect wrapper during incremental marking, but the v8 > ...
4 years, 6 months ago (2016-06-08 08:56:08 UTC) #5
Marcel Hlopko
Addressed all the points. Marking deque is now cleaned after oilpan gc. Wdyt?
4 years, 6 months ago (2016-06-08 14:17:08 UTC) #6
haraken
The approach looks good. https://codereview.chromium.org/2043033002/diff/80001/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp File third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp (right): https://codereview.chromium.org/2043033002/diff/80001/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp#newcode37 third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp:37: visitor->RegisterV8Reference(std::make_pair(wrapperTypeInfo, scriptWrappable)); Would you help ...
4 years, 6 months ago (2016-06-08 14:38:23 UTC) #7
Marcel Hlopko
https://codereview.chromium.org/2043033002/diff/80001/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp File third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp (right): https://codereview.chromium.org/2043033002/diff/80001/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp#newcode37 third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp:37: visitor->RegisterV8Reference(std::make_pair(wrapperTypeInfo, scriptWrappable)); On 2016/06/08 at 14:38:23, haraken wrote: > ...
4 years, 6 months ago (2016-06-08 15:12:48 UTC) #8
haraken
https://codereview.chromium.org/2043033002/diff/80001/third_party/WebKit/Source/platform/heap/Heap.cpp File third_party/WebKit/Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/2043033002/diff/80001/third_party/WebKit/Source/platform/heap/Heap.cpp#newcode608 third_party/WebKit/Source/platform/heap/Heap.cpp:608: On 2016/06/08 14:38:23, haraken wrote: > > You need ...
4 years, 6 months ago (2016-06-09 06:28:31 UTC) #9
Marcel Hlopko
https://codereview.chromium.org/2043033002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp (right): https://codereview.chromium.org/2043033002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp#newcode44 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp:44: return; On 2016/06/09 at 06:28:31, haraken wrote: > Shall ...
4 years, 6 months ago (2016-06-09 09:00:50 UTC) #10
haraken
Mostly looks good :) Here is a final round of comments. https://codereview.chromium.org/2043033002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp (right): ...
4 years, 6 months ago (2016-06-09 11:29:03 UTC) #11
Marcel Hlopko
I also moved tracing of active script wrappables to the epilogue. https://codereview.chromium.org/2043033002/diff/160001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp (right): ...
4 years, 6 months ago (2016-06-09 11:56:54 UTC) #12
haraken
LGTM with a question. https://codereview.chromium.org/2043033002/diff/160001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp (right): https://codereview.chromium.org/2043033002/diff/160001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp#newcode43 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp:43: if (!m_tracingInProgress) { On 2016/06/09 ...
4 years, 6 months ago (2016-06-09 14:09:10 UTC) #13
Marcel Hlopko
> > Given the following timeline: > > [Mutator] => [Incremental marking part 1] => ...
4 years, 6 months ago (2016-06-09 14:10:41 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043033002/180001
4 years, 6 months ago (2016-06-09 14:11:06 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/79336) android_compile_dbg on tryserver.chromium.android (JOB_FAILED, ...
4 years, 6 months ago (2016-06-09 14:32:44 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043033002/200001
4 years, 6 months ago (2016-06-09 14:57:17 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/236338)
4 years, 6 months ago (2016-06-09 18:50:38 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043033002/200001
4 years, 6 months ago (2016-06-10 07:32:10 UTC) #25
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 6 months ago (2016-06-10 09:23:03 UTC) #26
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-10 09:23:09 UTC) #27
commit-bot: I haz the power
4 years, 6 months ago (2016-06-10 09:24:07 UTC) #29
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/b2bf69081a17b107dc4ec9c2cc5dd64d961c7e0d
Cr-Commit-Position: refs/heads/master@{#399141}

Powered by Google App Engine
This is Rietveld 408576698