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

Unified Diff: runtime/lib/array.dart

Issue 11000025: Revert hiding of VM-only coreimpl list implementation types. While I (Closed) Base URL: https://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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | runtime/lib/array_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 75a674f745f8a6eef678df80a9694b6a8a8fa590..aa2c29ce6b3cd25e993d78a76f5a4cd09e46e1e6 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -4,9 +4,9 @@
// TODO(srdjan): Use shared array implementation.
-class _ObjectArray<E> implements List<E> {
+class ObjectArray<E> implements List<E> {
- factory _ObjectArray(int length) native "ObjectArray_allocate";
+ factory ObjectArray(int length) native "ObjectArray_allocate";
E operator [](int index) native "ObjectArray_getIndexed";
@@ -18,7 +18,7 @@ class _ObjectArray<E> implements List<E> {
int get length native "ObjectArray_getLength";
- void _copyFromObjectArray(_ObjectArray src,
+ void _copyFromObjectArray(ObjectArray src,
int srcStart,
int dstStart,
int count)
@@ -33,7 +33,7 @@ class _ObjectArray<E> implements List<E> {
if (length < 0) {
throw new ArgumentError("negative length $length");
}
- if (from is _ObjectArray) {
+ if (from is ObjectArray) {
_copyFromObjectArray(from, startFrom, start, length);
} else {
Arrays.copy(from, startFrom, this, start, length);
@@ -53,7 +53,7 @@ class _ObjectArray<E> implements List<E> {
List<E> getRange(int start, int length) {
if (length == 0) return [];
Arrays.rangeCheck(this, start, length);
- List list = new _GrowableObjectArray<E>.withCapacity(length);
+ List list = new GrowableObjectArray<E>.withCapacity(length);
list.length = length;
Arrays.copy(this, start, list, 0, length);
return list;
@@ -68,8 +68,7 @@ class _ObjectArray<E> implements List<E> {
}
Collection map(f(E element)) {
- return Collections.map(
- this, new _GrowableObjectArray.withCapacity(length), f);
+ return Collections.map(this, new GrowableObjectArray.withCapacity(length), f);
}
reduce(initialValue, combine(previousValue, E element)) {
@@ -77,7 +76,7 @@ class _ObjectArray<E> implements List<E> {
}
Collection<E> filter(bool f(E element)) {
- return Collections.filter(this, new _GrowableObjectArray<E>(), f);
+ return Collections.filter(this, new GrowableObjectArray<E>(), f);
}
bool every(bool f(E element)) {
@@ -106,7 +105,7 @@ class _ObjectArray<E> implements List<E> {
}
Iterator<E> iterator() {
- return new _FixedSizeArrayIterator<E>(this);
+ return new FixedSizeArrayIterator<E>(this);
}
void add(E element) {
@@ -144,16 +143,16 @@ class _ObjectArray<E> implements List<E> {
}
-// This is essentially the same class as _ObjectArray, but it does not
+// This is essentially the same class as ObjectArray, but it does not
// permit any modification of array elements from Dart code. We use
// this class for arrays constructed from Dart array literals.
// TODO(hausner): We should consider the trade-offs between two
// classes (and inline cache misses) versus a field in the native
// implementation (checks when modifying). We should keep watching
// the inline cache misses.
-class _ImmutableArray<E> implements List<E> {
+class ImmutableArray<E> implements List<E> {
- factory _ImmutableArray._uninstantiable() {
+ factory ImmutableArray._uninstantiable() {
throw const UnsupportedOperationException(
"ImmutableArray can only be allocated by the VM");
}
@@ -210,8 +209,7 @@ class _ImmutableArray<E> implements List<E> {
}
Collection map(f(E element)) {
- return Collections.map(
- this, new _GrowableObjectArray.withCapacity(length), f);
+ return Collections.map(this, new GrowableObjectArray.withCapacity(length), f);
}
reduce(initialValue, combine(previousValue, E element)) {
@@ -219,7 +217,7 @@ class _ImmutableArray<E> implements List<E> {
}
Collection<E> filter(bool f(E element)) {
- return Collections.filter(this, new _GrowableObjectArray<E>(), f);
+ return Collections.filter(this, new GrowableObjectArray<E>(), f);
}
bool every(bool f(E element)) {
@@ -253,7 +251,7 @@ class _ImmutableArray<E> implements List<E> {
}
Iterator<E> iterator() {
- return new _FixedSizeArrayIterator<E>(this);
+ return new FixedSizeArrayIterator<E>(this);
}
void add(E element) {
@@ -292,10 +290,10 @@ class _ImmutableArray<E> implements List<E> {
// Iterator for arrays with fixed size.
-class _FixedSizeArrayIterator<E> implements Iterator<E> {
- _FixedSizeArrayIterator(List array)
+class FixedSizeArrayIterator<E> implements Iterator<E> {
+ FixedSizeArrayIterator(List array)
: _array = array, _length = array.length, _pos = 0 {
- assert(array is _ObjectArray || array is _ImmutableArray);
+ assert(array is ObjectArray || array is ImmutableArray);
}
bool hasNext() {
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | runtime/lib/array_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698