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

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed)

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

Description

Introduce infrastructure for tracing ScriptWrappables. This cl introduces components needed to trace ScriptWrappable references. Unsurprisingly, this cl does not aim for correctness and is far from tracing all the wrappables. Instead it demonstrates the approach we've chosen, and will foster the discussion about future direction. Once we polish the details, I will upload cls which will improve the tracing coverage. We introduced TraceWrappableReferences idl annotation, which will generate the tracing method. The intended usage is demonstrated on Node class. Not all objects we have to trace through are ScriptWrappable instances, and the intended solution to this problem is shown on NodeRareData class. Comments are more than welcome! BUG=468240 LOG=no Committed: https://crrev.com/47fcf60157c8e5e4898e8fc4eeafbe5a92159589 Cr-Commit-Position: refs/heads/master@{#388506}

Patch Set 1 #

Patch Set 2 : Rebase master #

Total comments: 4

Patch Set 3 : Incorporate Haraken's wonderful comments #

Total comments: 42

Patch Set 4 : Incorporate Haraken's wonderful comments #

Patch Set 5 : Fix comment #

Patch Set 6 : Revert to traceActiveScriptWrappables - C++ is happier #

Total comments: 41

Patch Set 7 : Incorporate Haraken's wonderful comments #

Patch Set 8 : Use new v8 api #

Patch Set 9 : Use newer v8 api #

Total comments: 38

Patch Set 10 : Addressing final comments #

Patch Set 11 : Addressing comments #

Patch Set 12 : Final polish :) #

Patch Set 13 : Fix var used only in assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+379 lines, -5 lines) Patch
M third_party/WebKit/Source/bindings/IDLExtendedAttributes.md View 1 2 3 4 5 6 7 8 9 1 chunk +26 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp View 1 2 3 4 5 2 chunks +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DOMWrapperMap.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h View 1 2 3 4 5 6 7 8 9 2 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h View 1 2 3 4 5 6 7 8 9 1 chunk +106 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +104 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8BindingDesign.md View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/v8.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_interface.py View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.idl View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/NodeRareData.cpp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapPage.h View 1 2 3 4 5 6 7 8 9 3 chunks +27 lines, -1 line 0 comments Download

Messages

Total messages: 64 (11 generated)
Marcel Hlopko
Ptal.
4 years, 8 months ago (2016-04-12 11:45:54 UTC) #2
Marcel Hlopko
Haraken: > > I'm not quite sure if it's a good idea to generate the ...
4 years, 8 months ago (2016-04-12 11:52:01 UTC) #3
haraken
On 2016/04/12 11:52:01, Marcel Hlopko wrote: > Haraken: > > > > I'm not quite ...
4 years, 8 months ago (2016-04-12 14:08:36 UTC) #4
haraken
https://codereview.chromium.org/1876383003/diff/20001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h (right): https://codereview.chromium.org/1876383003/diff/20001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h#newcode56 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h:56: class ScriptWrappableVisitor { It's a bit confusing to mix ...
4 years, 8 months ago (2016-04-13 00:44:01 UTC) #5
Marcel Hlopko
https://codereview.chromium.org/1876383003/diff/20001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h (right): https://codereview.chromium.org/1876383003/diff/20001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h#newcode56 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h:56: class ScriptWrappableVisitor { Done https://codereview.chromium.org/1876383003/diff/20001/third_party/WebKit/Source/core/dom/Node.idl File third_party/WebKit/Source/core/dom/Node.idl (right): https://codereview.chromium.org/1876383003/diff/20001/third_party/WebKit/Source/core/dom/Node.idl#newcode25 ...
4 years, 8 months ago (2016-04-13 08:46:09 UTC) #6
haraken
Thanks for the update -- the latest CL looks much tidier and nicer! On 2016/04/13 ...
4 years, 8 months ago (2016-04-13 09:05:22 UTC) #7
jochen (gone - plz use gerrit)
On 2016/04/13 at 09:05:22, haraken wrote: > Thanks for the update -- the latest CL ...
4 years, 8 months ago (2016-04-13 09:51:12 UTC) #8
jochen (gone - plz use gerrit)
On 2016/04/13 at 09:51:12, jochen - slow wrote: > On 2016/04/13 at 09:05:22, haraken wrote: ...
4 years, 8 months ago (2016-04-13 09:52:11 UTC) #9
haraken
https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp (right): https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp#newcode54 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp:54: void ScriptWrappableVisitor::trace(const NodeRareData* data) const Do we need to ...
4 years, 8 months ago (2016-04-13 11:09:06 UTC) #10
Marcel Hlopko
https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp (right): https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp#newcode54 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp:54: void ScriptWrappableVisitor::trace(const NodeRareData* data) const On 2016/04/13 at 11:09:05, ...
4 years, 8 months ago (2016-04-13 11:11:57 UTC) #11
haraken
On 2016/04/13 11:11:57, Marcel Hlopko wrote: > https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp > File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp > (right): > > ...
4 years, 8 months ago (2016-04-13 11:24:54 UTC) #12
Marcel Hlopko
I think nobody is fully convinced about superiority of any of generate/not generate approaches. So ...
4 years, 8 months ago (2016-04-13 11:37:38 UTC) #13
haraken
On 2016/04/13 11:37:38, Marcel Hlopko wrote: > I think nobody is fully convinced about superiority ...
4 years, 8 months ago (2016-04-13 11:48:04 UTC) #14
Marcel Hlopko
:) So who wants to lgtm this thing? :)
4 years, 8 months ago (2016-04-13 11:48:52 UTC) #15
haraken
My main comments are the following two points: - This CL will keep alive wrappers ...
4 years, 8 months ago (2016-04-13 12:26:23 UTC) #16
Marcel Hlopko
Ptaal :) (the cl is not currently buildable as the accompanying v8 cl has not ...
4 years, 8 months ago (2016-04-14 16:39:09 UTC) #17
haraken
https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp (right): https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp#newcode40 third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp:40: handle.RegisterExternalReference(isolate); On 2016/04/14 16:39:08, Marcel Hlopko wrote: > On ...
4 years, 8 months ago (2016-04-15 01:28:16 UTC) #18
Marcel Hlopko
https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h (right): https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h#newcode32 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h:32: std::vector<HeapObjectHeader*> m_headersToUnmark; On 2016/04/15 at 01:28:16, haraken wrote: > ...
4 years, 8 months ago (2016-04-15 07:27:15 UTC) #19
haraken
On 2016/04/15 07:27:15, Marcel Hlopko wrote: > https://codereview.chromium.org/1876383003/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h > File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h > (right): > > ...
4 years, 8 months ago (2016-04-15 11:39:44 UTC) #20
Marcel Hlopko
On 2016/04/15 at 11:39:44, haraken wrote: > On 2016/04/15 07:27:15, Marcel Hlopko wrote: > > ...
4 years, 8 months ago (2016-04-15 11:50:06 UTC) #21
haraken
On 2016/04/15 11:50:06, Marcel Hlopko wrote: > On 2016/04/15 at 11:39:44, haraken wrote: > > ...
4 years, 8 months ago (2016-04-15 11:52:00 UTC) #22
Marcel Hlopko
On 2016/04/15 at 11:52:00, haraken wrote: > On 2016/04/15 11:50:06, Marcel Hlopko wrote: > > ...
4 years, 8 months ago (2016-04-15 12:28:47 UTC) #23
Marcel Hlopko
Added few fixes
4 years, 8 months ago (2016-04-15 15:31:47 UTC) #24
haraken
Mostly looks good. Here is a final round of comments. > Ah, misunderstanding. I'm investigating ...
4 years, 8 months ago (2016-04-18 04:35:42 UTC) #25
jochen (gone - plz use gerrit)
wrt vectors: the std::vector is part of the V8 API, so it's technically allowed (and ...
4 years, 8 months ago (2016-04-18 09:35:46 UTC) #26
haraken
On 2016/04/18 09:35:46, jochen wrote: > wrt vectors: the std::vector is part of the V8 ...
4 years, 8 months ago (2016-04-18 09:41:14 UTC) #27
jochen (gone - plz use gerrit)
On 2016/04/18 at 09:41:14, haraken wrote: > On 2016/04/18 09:35:46, jochen wrote: > > wrt ...
4 years, 8 months ago (2016-04-18 09:45:06 UTC) #28
haraken
On 2016/04/18 09:45:06, jochen wrote: > On 2016/04/18 at 09:41:14, haraken wrote: > > On ...
4 years, 8 months ago (2016-04-18 09:54:17 UTC) #29
jochen (gone - plz use gerrit)
On 2016/04/18 at 09:54:17, haraken wrote: > On 2016/04/18 09:45:06, jochen wrote: > > On ...
4 years, 8 months ago (2016-04-18 09:58:29 UTC) #30
haraken
On 2016/04/18 09:58:29, jochen wrote: > On 2016/04/18 at 09:54:17, haraken wrote: > > On ...
4 years, 8 months ago (2016-04-18 10:30:54 UTC) #31
haraken
On 2016/04/18 10:30:54, haraken wrote: > On 2016/04/18 09:58:29, jochen wrote: > > On 2016/04/18 ...
4 years, 8 months ago (2016-04-18 10:46:10 UTC) #32
jochen (gone - plz use gerrit)
On 2016/04/18 at 10:46:10, haraken wrote: > On 2016/04/18 10:30:54, haraken wrote: > > On ...
4 years, 8 months ago (2016-04-18 10:47:32 UTC) #33
haraken
On 2016/04/18 10:47:32, jochen wrote: > On 2016/04/18 at 10:46:10, haraken wrote: > > On ...
4 years, 8 months ago (2016-04-18 10:52:45 UTC) #34
jochen (gone - plz use gerrit)
On 2016/04/18 at 10:52:45, haraken wrote: > On 2016/04/18 10:47:32, jochen wrote: > > On ...
4 years, 8 months ago (2016-04-18 11:13:46 UTC) #35
Marcel Hlopko
Wonderful, let the poor intern decide :) Ok, I'll keep the vector here. Regarding the ...
4 years, 8 months ago (2016-04-18 11:28:04 UTC) #36
Marcel Hlopko
Incorporated the comments, I already can see the finish line, so please bear with me ...
4 years, 8 months ago (2016-04-18 11:45:35 UTC) #37
Marcel Hlopko
Refactored to use new v8 api (only renamed methods)
4 years, 8 months ago (2016-04-18 12:25:40 UTC) #38
haraken
LGTM All comments are just nits. https://codereview.chromium.org/1876383003/diff/160001/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt File third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt (right): https://codereview.chromium.org/1876383003/diff/160001/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt#newcode91 third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt:91: TraceWrapperReferences=* TraceWrapperReferences => ...
4 years, 8 months ago (2016-04-19 04:58:31 UTC) #39
Hannes Payer (out of office)
awesome Marcel! https://codereview.chromium.org/1876383003/diff/160001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h File third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h (right): https://codereview.chromium.org/1876383003/diff/160001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h#newcode17 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableHeapTracer.h:17: * When this heap tracer is set ...
4 years, 8 months ago (2016-04-19 07:44:33 UTC) #40
Marcel Hlopko
Final version. After the v8 changes reach chromium repo, and there aren't any objections, I ...
4 years, 8 months ago (2016-04-19 12:40:30 UTC) #41
haraken
Still LGTM https://codereview.chromium.org/1876383003/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/1876383003/diff/160001/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp#newcode16 third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp:16: bool ScriptWrappableVisitor::isHeaderMarked(const void* garbageCollected) const On 2016/04/19 ...
4 years, 8 months ago (2016-04-19 12:51:05 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1876383003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1876383003/220001
4 years, 8 months ago (2016-04-19 14:45:13 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-generic_chromium_compile_only_ng/builds/124054)
4 years, 8 months ago (2016-04-19 14:57:34 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1876383003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1876383003/220001
4 years, 8 months ago (2016-04-20 12:56:46 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_android on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_android/builds/53436)
4 years, 8 months ago (2016-04-20 13:07:01 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1876383003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1876383003/220001
4 years, 8 months ago (2016-04-20 14:02:02 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-generic_chromium_compile_only_ng/builds/124757)
4 years, 8 months ago (2016-04-20 14:22:20 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1876383003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1876383003/240001
4 years, 8 months ago (2016-04-20 14:27:08 UTC) #57
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 8 months ago (2016-04-20 15:39:47 UTC) #58
Michael Achenbach
FYI: Please keep a bigger window between v8 api changes and chromium patches: https://build.chromium.org/p/chromium.fyi/builders/Linux%20V8%20API%20Stability/builds/16054 Otherwise ...
4 years, 8 months ago (2016-04-21 07:51:53 UTC) #60
blink-reviews
Will do, sorry. On Thu, Apr 21, 2016 at 9:51 AM <machenbach@chromium.org> wrote: > FYI: ...
4 years, 8 months ago (2016-04-21 07:55:08 UTC) #61
chromium-reviews
Will do, sorry. On Thu, Apr 21, 2016 at 9:51 AM <machenbach@chromium.org> wrote: > FYI: ...
4 years, 8 months ago (2016-04-21 07:55:08 UTC) #62
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:23:51 UTC) #64
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/47fcf60157c8e5e4898e8fc4eeafbe5a92159589
Cr-Commit-Position: refs/heads/master@{#388506}

Powered by Google App Engine
This is Rietveld 408576698