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

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

Issue 1645053002: dart2js cps: Refactor tracking of side effects. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Treat named argument as optional Created 4 years, 10 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/builtin_operator.dart
diff --git a/pkg/compiler/lib/src/cps_ir/builtin_operator.dart b/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
index 295cd3b9bfbbee008e9a062272e2e796055f26d5..575164434e0b6a2084b0e34ca04b08094fa504d7 100644
--- a/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
+++ b/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
@@ -5,6 +5,8 @@ library builtin_operator;
// This is shared by the CPS and Tree IRs.
// Both cps_ir_nodes and tree_ir_nodes import and re-export this file.
+import 'effects.dart';
+
/// An operator supported natively in the CPS and Tree IRs using the
/// `ApplyBuiltinOperator` instructions.
///
@@ -222,3 +224,17 @@ bool isCompoundableOperator(BuiltinOperator operator) {
return false;
}
}
+
+int getEffectsOfBuiltinMethod(BuiltinMethod method) {
+ switch (method) {
+ case BuiltinMethod.Push:
+ return Effects.changesIndexableContent |
+ Effects.changesIndexableLength;
+ case BuiltinMethod.Pop:
+ return Effects.dependsOnIndexableContent |
+ Effects.dependsOnIndexableLength |
+ Effects.changesIndexableLength;
+ case BuiltinMethod.SetLength:
+ return Effects.changesIndexableLength;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698