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

Side by Side Diff: runtime/lib/array_patch.dart

Issue 10933019: Improve moves of Smi and null objects. Add result cid to List constructor calls. Add tracing of inl… (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Note that optimizing compiler depends on the algorithm which returns
6 // a GrowableObjectArray if length is null, otherwise returns fixed size array.
5 patch class ListImplementation<E> { 7 patch class ListImplementation<E> {
6 /* patch */ factory List([int length = null]) { 8 /* patch */ factory List([int length = null]) {
7 if (length === null) { 9 if (length === null) {
8 return new GrowableObjectArray<E>(); 10 return new GrowableObjectArray<E>();
9 } else { 11 } else {
10 return new ObjectArray<E>(length); 12 return new ObjectArray<E>(length);
11 } 13 }
12 } 14 }
13 15
14 /* patch */ static _from(Iterable other) { 16 /* patch */ static _from(Iterable other) {
15 GrowableObjectArray list = new GrowableObjectArray(); 17 GrowableObjectArray list = new GrowableObjectArray();
16 for (final e in other) { 18 for (final e in other) {
17 list.add(e); 19 list.add(e);
18 } 20 }
19 return list; 21 return list;
20 } 22 }
21 } 23 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698