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

Unified Diff: pkg/compiler/lib/src/cps_ir/insert_refinements.dart

Issue 1388473003: dart2js cps_ir: Use interceptors for is-checks. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: pkg/compiler/lib/src/cps_ir/insert_refinements.dart
diff --git a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
index afea3976dee6bb0de887eee47d1d8de6b271ba79..5922247f4c9b975a8730bdee93bd7dfb9eb78eca 100644
--- a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
+++ b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
@@ -161,6 +161,14 @@ class InsertRefinements extends RecursiveVisitor implements Pass {
push(falseCont);
return;
}
+ if (condition is TypeTestRaw) {
+ Primitive value = condition.value.definition;
+ TypeMask type = types.subtypesOf(condition.dartType);
+ Primitive refinedValue = new Refinement(value, type);
+ pushRefinement(trueCont, refinedValue);
+ push(falseCont);
+ return;
+ }
// If the condition is comparison with a constant, promote the other value.
// This can happen either for calls to `==` or `identical` calls, such

Powered by Google App Engine
This is Rietveld 408576698