• yutak's avatar
    BlinkGCPlugin: Support overloaded trace() call from template. · e5ec4fe6
    yutak authored
    With the new setup with InlinedGlobalTracingVisitor, trace() functions are
    overloaded and may be called from a traceImpl() function in derived classes.
    As traceImpl() is a function template, the trace() overload cannot be resolved
    at the time of plugin execution and thus the callee of the trace() call becomes
    UnresolvedMemberExpr*.
    
    This patch adds support for detecting Base::trace() call if the
    "Base::trace" part is UnresolvedMemberExpr. Specifically, the new code finds
    a function looking like trace() from the candidates of UnresolvedMemberExpr,
    and if there's one, we treat it as a valid Base::trace() call. The call
    needs to give exactly one argument named "visitor" to the function.
    
    A few tests are added to test these cases. A stub for InlinedGlobalTracing-
    Visitor is added to tests/heap/stubs.h so it can be used from tests.
    
    BUG=none
    R=kouhei@chromium.org
    CC=zerny@chromium.org, oilpan-reviews@chromium.org
    
    Review URL: https://codereview.chromium.org/939303005
    
    Cr-Commit-Position: refs/heads/master@{#317768}
    e5ec4fe6
traceimpl_overloaded.txt 1 Byte