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

Unified Diff: pkg/compiler/lib/src/ssa/nodes.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/codegen.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index e642edeae7124eb3e7793556506f41d26bbc9a35..575044550131e4c458ce57d17ba7733cdbf33712 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -900,7 +900,9 @@ abstract class HInstruction implements Spannable {
JavaScriptBackend backend = compiler.backend;
return instructionType.contains(backend.jsArrayClass, classWorld)
|| instructionType.contains(backend.jsFixedArrayClass, classWorld)
- || instructionType.contains(backend.jsExtendableArrayClass, classWorld);
+ || instructionType.contains(backend.jsExtendableArrayClass, classWorld)
+ || instructionType.contains(
+ backend.jsUnmodifiableArrayClass, classWorld);
}
bool isIndexablePrimitive(Compiler compiler) {
@@ -912,7 +914,9 @@ abstract class HInstruction implements Spannable {
bool isFixedArray(Compiler compiler) {
JavaScriptBackend backend = compiler.backend;
- return instructionType.containsOnly(backend.jsFixedArrayClass);
+ // TODO(sra): Recognize the union of these types as well.
+ return instructionType.containsOnly(backend.jsFixedArrayClass)
+ || instructionType.containsOnly(backend.jsUnmodifiableArrayClass);
}
bool isExtendableArray(Compiler compiler) {
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698