Index: runtime/vm/cha_test.cc |
diff --git a/runtime/vm/cha_test.cc b/runtime/vm/cha_test.cc |
index 7316da00d2b5a3a08634cb0b0df66531210fd80f..107c2337991ae15a4721542ef9e50da08bdff22c 100644 |
--- a/runtime/vm/cha_test.cc |
+++ b/runtime/vm/cha_test.cc |
@@ -11,13 +11,6 @@ |
namespace dart { |
-static bool ContainsCid(const GrowableArray<Class*>& classes, intptr_t cid) { |
- for (intptr_t i = 0; i < classes.length(); ++i) { |
- if (classes[i]->id() == cid) return true; |
- } |
- return false; |
-} |
- |
TEST_CASE(ClassHierarchyAnalysis) { |
const char* kScriptChars = |
@@ -89,14 +82,14 @@ TEST_CASE(ClassHierarchyAnalysis) { |
EXPECT(CHA::HasSubclasses(class_a)); |
EXPECT(CHA::HasSubclasses(class_b)); |
EXPECT(!CHA::HasSubclasses(class_c)); |
- cha.AddToLeafClasses(class_c); |
+ cha.AddToGuardedClasses(class_c, /*subclass_count=*/0); |
EXPECT(!CHA::HasSubclasses(class_d)); |
- cha.AddToLeafClasses(class_d); |
+ cha.AddToGuardedClasses(class_d, /*subclass_count=*/0); |
- EXPECT(!ContainsCid(cha.leaf_classes(), class_a.id())); |
- EXPECT(!ContainsCid(cha.leaf_classes(), class_b.id())); |
- EXPECT(ContainsCid(cha.leaf_classes(), class_c.id())); |
- EXPECT(ContainsCid(cha.leaf_classes(), class_d.id())); |
+ EXPECT(!cha.IsGuardedClass(class_a.id())); |
+ EXPECT(!cha.IsGuardedClass(class_b.id())); |
+ EXPECT(cha.IsGuardedClass(class_c.id())); |
+ EXPECT(cha.IsGuardedClass(class_d.id())); |
const Class& closure_class = |
Class::Handle(Isolate::Current()->object_store()->closure_class()); |