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

Unified Diff: compiler/lib/implementation/array.dart

Issue 9255025: Revert the revert of http://code.google.com/p/dart/source/detail?r=3360. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « compiler/lib/corelib_impl.dart ('k') | compiler/lib/implementation/array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/lib/implementation/array.dart
diff --git a/compiler/lib/implementation/array.dart b/compiler/lib/implementation/array.dart
index 2690982aacaca6cd287c262747f1bae76388abfb..698f7245bc0f48e19f9bee5d918c8f7f10ba8c16 100644
--- a/compiler/lib/implementation/array.dart
+++ b/compiler/lib/implementation/array.dart
@@ -22,15 +22,11 @@ class ListFactory<E> {
} else if (length < 0) {
throw new IllegalArgumentException("negative length $length");
}
- // TODO(floitsch): make list creation more efficient. Currently we allocate
- // a new TypeToken at every allocation. Either we can optimize them away,
- // or we need to find other ways to pass type-information from Dart to JS.
- ListImplementation list = _new(new TypeToken<E>(), length);
+
+ ListImplementation<E> list = new ListImplementation<E>(length);
list._isFixed = isFixed;
return list;
}
-
- static ListImplementation _new(TypeToken typeToken, int length) native;
}
@@ -42,6 +38,8 @@ class ListImplementation<T> implements List<T> native "Array" {
// and coerce to false.
bool _isFixed;
+ ListImplementation(int length);
+
T operator[](int index) native;
void operator[]=(int index, T value) native;
« no previous file with comments | « compiler/lib/corelib_impl.dart ('k') | compiler/lib/implementation/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698