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

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

Issue 9183002: Remove the type token used to pass element information to arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address floitsch's comments 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 701eae5fb0dc947c5036c658a752486ce2d7a6a2..e712576e9f2ba4894ecb8563434fd05610599e67 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) {
if (0 <= index && index < length) {
return _indexOperator(index);
« 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