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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. Created 7 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index d6e73d27fefc06afc8acf900b73b5f9bb3f734e5..55ee9a33791b14efe96b3500eb0dbc26dd8bb7c5 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -355,7 +355,7 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
if (backend.fixedLengthListConstructor == null) {
backend.fixedLengthListConstructor =
compiler.listClass.lookupConstructor(
- new Selector.callConstructor(const SourceString("fixedLength"),
+ new Selector.callConstructor(const SourceString(""),
compiler.listClass.getLibrary()));
}
// TODO(ngeoffray): checking if the second input is an integer
@@ -363,6 +363,7 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
// other optimizations to reason on a fixed length constructor
// that we know takes an int.
return element == backend.fixedLengthListConstructor
+ && node.inputs.length == 2
&& node.inputs[1].isInteger();
}
@@ -597,7 +598,7 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
if (node.element == backend.jsArrayLength) {
if (node.receiver is HInvokeStatic) {
// Try to recognize the length getter with input
- // [:new List.fixedLength(int):].
+ // [:new List(int):].
HInvokeStatic call = node.receiver;
if (isFixedSizeListConstructor(call)) {
return call.inputs[1];
@@ -1088,8 +1089,8 @@ class SsaGlobalValueNumberer implements OptimizationPhase {
// loop changes flags list to zero so we can use bitwise or when
// propagating loop changes upwards.
final int length = graph.blocks.length;
- blockChangesFlags = new List<int>.fixedLength(length);
- loopChangesFlags = new List<int>.fixedLength(length);
+ blockChangesFlags = new List<int>(length);
+ loopChangesFlags = new List<int>(length);
for (int i = 0; i < length; i++) loopChangesFlags[i] = 0;
// Run through all the basic blocks in the graph and fill in the
@@ -1164,7 +1165,7 @@ class SsaCodeMotion extends HBaseVisitor implements OptimizationPhase {
List<ValueSet> values;
void visitGraph(HGraph graph) {
- values = new List<ValueSet>.fixedLength(graph.blocks.length);
+ values = new List<ValueSet>(graph.blocks.length);
for (int i = 0; i < graph.blocks.length; i++) {
values[graph.blocks[i].id] = new ValueSet();
}

Powered by Google App Engine
This is Rietveld 408576698