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

Unified Diff: runtime/vm/object.cc

Issue 9235067: Use ByteArray's native for Socket and File. (Closed) Base URL: http://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
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 3621)
+++ runtime/vm/object.cc (working copy)
@@ -7511,6 +7511,46 @@
}
+void ByteArray::Copy(uint8_t* dst,
+ const ByteArray& src,
+ intptr_t src_byte_offset,
+ intptr_t length) {
+ ASSERT(src_byte_offset + length <= src.Length());
+ const uint8_t *src_addr = src.ByteAddr(src_byte_offset);
cshapiro 2012/01/27 23:00:04 This should be wrapped in a NoGCScope.
Anders Johnsen 2012/01/27 23:42:39 Done.
+ memmove(dst, src_addr, length);
+}
+
+
+void ByteArray::Copy(const ByteArray& dst,
+ intptr_t dst_byte_offset,
+ const uint8_t* src,
+ intptr_t length) {
+ ASSERT(dst_byte_offset + length <= dst.Length());
+ uint8_t *dst_addr = dst.ByteAddr(dst_byte_offset);
cshapiro 2012/01/27 23:00:04 Same here...
Anders Johnsen 2012/01/27 23:42:39 Done.
+ memmove(dst_addr, src, length);
+}
+
+
+void ByteArray::Copy(const ByteArray& dst,
+ intptr_t dst_byte_offset,
+ const ByteArray& src,
+ intptr_t src_byte_offset,
+ intptr_t length) {
+ ASSERT(src_byte_offset + length <= src.Length());
+ ASSERT(dst_byte_offset + length <= dst.Length());
+ const uint8_t *src_addr = src.ByteAddr(src_byte_offset);
+ uint8_t *dst_addr = dst.ByteAddr(dst_byte_offset);
cshapiro 2012/01/27 23:00:04 ...and here.
Anders Johnsen 2012/01/27 23:42:39 Done.
+ memmove(dst_addr, src_addr, length);
+}
+
+
+uint8_t* ByteArray::ByteAddr(intptr_t byte_offset) const {
+ // ByteArray is an abstract class.
+ UNREACHABLE();
+ return NULL;
+}
+
+
const char* ByteArray::ToCString() const {
// ByteArray is an abstract class.
UNREACHABLE();
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698