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 8f494bbf2184a4cdefd9400d3d4ab1026870e626..7defe2a1559acf5a4b7cf466729f759ebf5fb726 100644 |
--- a/tools/clang/blink_gc_plugin/Config.h |
+++ b/tools/clang/blink_gc_plugin/Config.h |
@@ -32,6 +32,10 @@ const char kVisitorVarName[] = "visitor"; |
const char kAdjustAndMarkName[] = "adjustAndMark"; |
const char kIsHeapObjectAliveName[] = "isHeapObjectAlive"; |
const char kIsEagerlyFinalizedName[] = "IsEagerlyFinalizedMarker"; |
+const char kConstIteratorName[] = "const_iterator"; |
+const char kIteratorName[] = "iterator"; |
+const char kConstReverseIteratorName[] = "const_reverse_iterator"; |
+const char kReverseIteratorName[] = "reverse_iterator"; |
class Config { |
public: |
@@ -101,6 +105,16 @@ class Config { |
name == "PersistentHeapHashMap"; |
} |
+ static bool IsGCCollectionWithUnsafeIterator(const std::string& name) { |
+ if (!IsGCCollection(name)) |
+ return false; |
+ // The list hash set iterators refer to the set, not the |
+ // backing store and are consequently safe. |
+ if (name == "HeapListHashSet" || name == "PersistentHeapListHashSet") |
+ return false; |
+ return true; |
+ } |
+ |
static bool IsHashMap(const std::string& name) { |
return name == "HashMap" || |
name == "HeapHashMap" || |
@@ -131,6 +145,11 @@ class Config { |
IsGCMixinBase(name); |
} |
+ static bool IsIterator(const std::string& name) { |
+ return name == kIteratorName || name == kConstIteratorName || |
+ name == kReverseIteratorName || name == kConstReverseIteratorName; |
+ } |
+ |
// 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) { |