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

Unified Diff: runtime/vm/object.cc

Issue 14296006: Fast copy between TypedData and ExternalTypedData (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 8b7c8168e1ce11deba9e646a8852b5b9d980d43a..40c9a8388cb8e45d15e17299af4ae9185830f916 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12610,20 +12610,8 @@ void TypedData::Copy(const TypedData& dst,
const TypedData& src,
intptr_t src_offset_in_bytes,
intptr_t length_in_bytes) {
- ASSERT(Utils::RangeCheck(src_offset_in_bytes,
- length_in_bytes,
- src.LengthInBytes()));
- ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
- length_in_bytes,
- dst.LengthInBytes()));
- {
- NoGCScope no_gc;
- if (length_in_bytes > 0) {
- memmove(dst.DataAddr(dst_offset_in_bytes),
- src.DataAddr(src_offset_in_bytes),
- length_in_bytes);
- }
- }
+ TypedArrayCopyData<TypedData, TypedData>(
+ dst, dst_offset_in_bytes, src, src_offset_in_bytes, length_in_bytes);
siva 2013/04/19 17:38:40 This code can be removed as it is already set up i
kustermann 2013/04/19 19:21:54 Done.
}
@@ -12669,20 +12657,8 @@ void ExternalTypedData::Copy(const ExternalTypedData& dst,
const ExternalTypedData& src,
intptr_t src_offset_in_bytes,
intptr_t length_in_bytes) {
- ASSERT(Utils::RangeCheck(src_offset_in_bytes,
- length_in_bytes,
- src.LengthInBytes()));
- ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
- length_in_bytes,
- dst.LengthInBytes()));
- {
- NoGCScope no_gc;
- if (length_in_bytes > 0) {
- memmove(dst.DataAddr(dst_offset_in_bytes),
- src.DataAddr(src_offset_in_bytes),
- length_in_bytes);
- }
- }
+ TypedArrayCopyData<ExternalTypedData, ExternalTypedData>(
+ dst, dst_offset_in_bytes, src, src_offset_in_bytes, length_in_bytes);
}
siva 2013/04/19 17:38:40 Get rid of this Copy function.
kustermann 2013/04/19 19:21:54 Done.
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698