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

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

Issue 1305863010: dart2js cps: Store the TypeMask for each primitive in a field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 3 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 | « pkg/compiler/lib/src/cps_ir/insert_refinements.dart ('k') | pkg/compiler/lib/src/cps_ir/mutable_ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/loop_invariant_code_motion.dart
diff --git a/pkg/compiler/lib/src/cps_ir/loop_invariant_code_motion.dart b/pkg/compiler/lib/src/cps_ir/loop_invariant_code_motion.dart
index 4471019fb5dac959d7e37a507e4658bf3ad5f9e1..877f4ac9a56cd4671f79a1338df2216887f1a53f 100644
--- a/pkg/compiler/lib/src/cps_ir/loop_invariant_code_motion.dart
+++ b/pkg/compiler/lib/src/cps_ir/loop_invariant_code_motion.dart
@@ -126,9 +126,15 @@ class LoopInvariantCodeMotion extends RecursiveVisitor implements Pass {
}
bool shouldLift(Primitive prim) {
- // Interceptors are safe and almost always profitable for lifting
+ // Interceptors are generally safe and almost always profitable for lifting
// out of loops. Several other primitive could be lifted too, but it's not
// always profitable to do so.
+
+ // Note that the type of the interceptor is technically not sound after
+ // lifting because its current type might have been computed based on a
+ // refinement node (which has since been removed). As a whole, it still
+ // works out because all uses of the interceptor must occur in a context
+ // where it indeed has the type it claims to have.
return prim is Interceptor;
}
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/insert_refinements.dart ('k') | pkg/compiler/lib/src/cps_ir/mutable_ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698