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

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

Issue 10701147: Implement more intrinisification for x64 (not as inlined code but as header of the target). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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_x64.h » ('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 class ListFactory<E> { 5 class ListFactory<E> {
6 6
7 factory List.from(Iterable<E> other) { 7 factory List.from(Iterable<E> other) {
8 GrowableObjectArray<E> list = new GrowableObjectArray<E>(); 8 GrowableObjectArray<E> list = new GrowableObjectArray<E>();
9 for (final e in other) { 9 for (final e in other) {
10 list.add(e); 10 list.add(e);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 295
296 // Iterator for arrays with fixed size. 296 // Iterator for arrays with fixed size.
297 class FixedSizeArrayIterator<E> implements Iterator<E> { 297 class FixedSizeArrayIterator<E> implements Iterator<E> {
298 FixedSizeArrayIterator(List array) 298 FixedSizeArrayIterator(List array)
299 : _array = array, _length = array.length, _pos = 0 { 299 : _array = array, _length = array.length, _pos = 0 {
300 assert(array is ObjectArray || array is ImmutableArray); 300 assert(array is ObjectArray || array is ImmutableArray);
301 } 301 }
302 302
303 bool hasNext() { 303 bool hasNext() {
304 return _length > _pos; 304 return _length > _pos;
305 } 305 }
306 306
307 E next() { 307 E next() {
308 if (!hasNext()) { 308 if (!hasNext()) {
309 throw const NoMoreElementsException(); 309 throw const NoMoreElementsException();
310 } 310 }
311 return _array[_pos++]; 311 return _array[_pos++];
312 } 312 }
313 313
314 final List<E> _array; 314 final List<E> _array;
315 final int _length; // Cache array length for faster access. 315 final int _length; // Cache array length for faster access.
316 int _pos; 316 int _pos;
317 } 317 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698