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

Issue 964273002: BlinkGCPlugin: Handle omitted trace() in intermediary classes. (Closed)

Created:
5 years, 9 months ago by Yuta Kitamura
Modified:
5 years, 9 months ago
Reviewers:
kouhei (in TOK)
CC:
chromium-reviews, zerny-chromium, oilpan-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

BlinkGCPlugin: Handle omitted trace() in intermediary classes. As a result of introducing templated traceImpl() function, the callee part of "Base::trace()" call (i.e. Base::trace) may not be fully resolved at the time of the plugin execution. This has caused another issue in cases where trace() is intentionally omitted because the class has no fields to trace. Consider the following example: class A : public GarbageCollected<A> { trace() { ... } }; class B : public A { /* No trace() */ }; class C : public B { trace() { B::trace(visitor); } }; The "B::trace()" call in C is actually A::trace(). If the callee part "B::trace" is unresolved, we only know that "there is a function call which will be resolved to A::trace()". We still want to mark B as traced when we see such a function call. This patch fixes this trace call detection logic so we can handle this case. The new logic keeps going up the class hierarchy while the class is not required to have a trace method, and if we find a class that matches the class of the (unresolved) callee part, we mark the direct base class of the original class as traced. BUG=462511 R=kouhei@chromium.org CC=zerny@chromium.org, oilpan-reviews@chromium.org Committed: https://crrev.com/4a636301c72b71b544b3a8acc17884e1eb8f2036 Cr-Commit-Position: refs/heads/master@{#318665}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use range-for. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -37 lines) Patch
M tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp View 1 5 chunks +51 lines, -9 lines 0 comments Download
A + tools/clang/blink_gc_plugin/tests/traceimpl_omitted_trace.h View 3 chunks +11 lines, -26 lines 0 comments Download
A + tools/clang/blink_gc_plugin/tests/traceimpl_omitted_trace.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
A + tools/clang/blink_gc_plugin/tests/traceimpl_omitted_trace.txt View 0 chunks +-1 lines, --1 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Yuta Kitamura
5 years, 9 months ago (2015-03-02 04:11:37 UTC) #1
kouhei (in TOK)
lgtm https://codereview.chromium.org/964273002/diff/1/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp File tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp (right): https://codereview.chromium.org/964273002/diff/1/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp#newcode549 tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp:549: iter != info_->GetBases().end(); ++iter) { Nit: use foreach?
5 years, 9 months ago (2015-03-02 04:24:13 UTC) #2
Yuta Kitamura
https://codereview.chromium.org/964273002/diff/1/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp File tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp (right): https://codereview.chromium.org/964273002/diff/1/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp#newcode549 tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp:549: iter != info_->GetBases().end(); ++iter) { On 2015/03/02 04:24:13, kouhei ...
5 years, 9 months ago (2015-03-02 07:36:49 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/964273002/20001
5 years, 9 months ago (2015-03-02 07:37:50 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 9 months ago (2015-03-02 08:16:13 UTC) #7
commit-bot: I haz the power
5 years, 9 months ago (2015-03-02 08:16:51 UTC) #8
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/4a636301c72b71b544b3a8acc17884e1eb8f2036
Cr-Commit-Position: refs/heads/master@{#318665}

Powered by Google App Engine
This is Rietveld 408576698