Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: runtime/vm/cha_test.cc

Issue 2002583002: Background compiler should validate CHA decisions before committing the code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/cha.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « runtime/vm/cha.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698