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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1126063002: Recognize unmodifiable lists (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 752019abf06d6f730440ce4dd66bdc66532e82d7..2ae2827869af37741d270a1b5f1e3ad00be2a711 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -105,9 +105,12 @@ bool isFixedLength(mask, Compiler compiler) {
if (mask.isContainer && mask.length != null) {
// A container on which we have inferred the length.
return true;
- } else if (mask.containsOnly(backend.jsFixedArrayClass)
- || mask.containsOnlyString(classWorld)
- || backend.isTypedArray(mask)) {
+ }
+ // TODO(sra): Recognize any combination of fixed length indexables.
+ if (mask.containsOnly(backend.jsFixedArrayClass) ||
+ mask.containsOnly(backend.jsUnmodifiableArrayClass) ||
+ mask.containsOnlyString(classWorld) ||
+ backend.isTypedArray(mask)) {
return true;
}
return false;
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698