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

Unified Diff: runtime/lib/typeddata.dart

Issue 12881006: Add the native intrinsic TypedData_setRange to optimize the setRange call when the destination and … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/lib/typeddata.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typeddata.dart
===================================================================
--- runtime/lib/typeddata.dart (revision 20057)
+++ runtime/lib/typeddata.dart (working copy)
@@ -325,6 +325,7 @@
return this.length == 0;
}
+
// Method(s) implementing the List interface.
set length(newLength) {
@@ -442,14 +443,24 @@
}
void setRange(int start, int length, List from, [int startFrom = 0]) {
- IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom);
+ if (!_setRange(start, length, from, startFrom)) {
+ IterableMixinWorkaround.setRangeList(this, start,
+ length, from, startFrom);
+ }
}
+
// Method(s) implementing Object interface.
String toString() {
return Collections.collectionToString(this);
}
+
+
+ // Internal utility methods.
+
+ bool _setRange(int start, int length, List from, startFrom)
+ native "TypedData_setRange";
}
« no previous file with comments | « runtime/lib/typeddata.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698