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

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, 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
Index: lib/compiler/implementation/ssa/nodes.dart
===================================================================
--- lib/compiler/implementation/ssa/nodes.dart (revision 13038)
+++ lib/compiler/implementation/ssa/nodes.dart (working copy)
@@ -833,6 +833,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();
@@ -1432,11 +1433,11 @@
if (isLengthGetterOnStringOrArray(types)) {
setUseGvn();
clearAllSideEffects();
- // 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)) setDependsOnSomething();
+ // 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)) {
+ setDependsOnSomething();
+ }
} else if (isSideEffectFree) {
setUseGvn();
clearAllSideEffects();
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/optimize.dart » ('j') | lib/compiler/implementation/ssa/types.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698