const char kTraceAfterDispatchName[] = "traceAfterDispatch";
const char kRegisterWeakMembersName[] = "registerWeakMembers";
const char kHeapAllocatorName[] = "HeapAllocator";
+const char kTraceIfNeededName[] = "TraceIfNeeded";
class Config {
public:
name == "PersistentHeapHashMap";
}
+ // Following http://crrev.com/369633033 (Blink r177436),
+ // ignore blink::ScriptWrappable's destructor.
+ // FIXME: remove when its non-Oilpan destructor is removed.
+ static bool HasIgnorableDestructor(const std::string& ns,
+ const std::string& name) {
+ return ns == "blink" && name == "ScriptWrappable";
+ }
+
// Assumes name is a valid collection name.
static size_t CollectionDimension(const std::string& name) {
return (IsHashMap(name) || name == "pair") ? 2 : 1;
}
+ static bool IsDummyBase(const std::string& name) {
+ return name == "DummyBase";
+ }
+
+ static bool IsRefCountedBase(const std::string& name) {
+ return name == "RefCounted" ||
+ name == "ThreadSafeRefCounted";
+ }
+
static bool IsGCMixinBase(const std::string& name) {
return name == "GarbageCollectedMixin";
}
static bool IsGCFinalizedBase(const std::string& name) {
return name == "GarbageCollectedFinalized" ||
- name == "RefCountedGarbageCollected";
+ name == "RefCountedGarbageCollected" ||
+ name == "ThreadSafeRefCountedGarbageCollected";
}
static bool IsGCBase(const std::string& name) {
IsGCMixinBase(name);
}
+ // Returns true of the base classes that do not need a vtable entry for trace
+ // because they cannot possibly initiate a GC during construction.
+ static bool IsSafePolymorphicBase(const std::string& name) {
+ return IsGCBase(name) || IsDummyBase(name) || IsRefCountedBase(name);
+ }
+
static bool IsAnnotated(clang::Decl* decl, const std::string& anno) {
clang::AnnotateAttr* attr = decl->getAttr<clang::AnnotateAttr>();
return attr && (attr->getAnnotation() == anno);
static bool IsVisitor(const std::string& name) { return name == "Visitor"; }
- static bool IsTraceMethod(clang::CXXMethodDecl* method,
+ static bool IsTraceMethod(clang::FunctionDecl* method,
bool* isTraceAfterDispatch = 0) {
if (method->getNumParams() != 1)
return false;