Index: tools/clang/blink_gc_plugin/Config.h |
diff --git a/tools/clang/blink_gc_plugin/Config.h b/tools/clang/blink_gc_plugin/Config.h |
index 48f611b3f442eb491d4a2bd9d75d2fe54dfe41e8..9341306d0ab1d1bcdf9ad20913cfbb1135f83c81 100644 |
--- a/tools/clang/blink_gc_plugin/Config.h |
+++ b/tools/clang/blink_gc_plugin/Config.h |
@@ -105,13 +105,23 @@ class Config { |
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) { |
@@ -120,6 +130,12 @@ class Config { |
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); |