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

Unified Diff: lib/compiler/implementation/ssa/nodes.dart

Issue 11024003: Add a fixed array type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/nodes.dart
===================================================================
--- lib/compiler/implementation/ssa/nodes.dart (revision 13221)
+++ lib/compiler/implementation/ssa/nodes.dart (working copy)
@@ -869,6 +869,7 @@
bool isReadableArray(HTypeMap types) => types[this].isReadableArray();
bool isMutableArray(HTypeMap types) => types[this].isMutableArray();
bool isExtendableArray(HTypeMap types) => types[this].isExtendableArray();
+ bool isFixedArray(HTypeMap types) => types[this].isFixedArray();
bool isBoolean(HTypeMap types) => types[this].isBoolean();
bool isInteger(HTypeMap types) => types[this].isInteger();
bool isDouble(HTypeMap types) => types[this].isDouble();
@@ -1479,11 +1480,11 @@
clearAllSideEffects();
if (isLengthGetterOnStringOrArray(types)) {
setUseGvn();
- // If the input is a string, we know the length cannot change.
- // We cannot do the same thing for non-extendable array because
- // we don't express that type yet: a mutable array might be
- // extendable.
- if (!inputs[1].isString(types)) setDependsOnInstancePropertyStore();
+ // If the input is a string or a fixed length array, we know
+ // the length cannot change.
+ if (!inputs[1].isString(types) && !inputs[1].isFixedArray(types)) {
+ setDependsOnInstancePropertyStore();
+ }
} else if (isSideEffectFree) {
setUseGvn();
setDependsOnSomething();
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698