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

Unified Diff: runtime/vm/object.h

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
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 3811)
+++ runtime/vm/object.h (working copy)
@@ -3249,7 +3249,25 @@
public:
virtual intptr_t Length() const;
+ static void Copy(uint8_t* dst,
+ const ByteArray& src,
+ intptr_t src_offset,
+ intptr_t length);
+
+ static void Copy(const ByteArray& dst,
+ intptr_t dst_offset,
+ const uint8_t* src,
+ intptr_t length);
+
+ static void Copy(const ByteArray& dst,
+ intptr_t dst_offset,
+ const ByteArray& src,
+ intptr_t src_offset,
+ intptr_t length);
+
private:
+ virtual uint8_t* ByteAddr(intptr_t byte_offset) const;
+
HEAP_OBJECT_IMPLEMENTATION(ByteArray, Instance);
friend class Class;
};
@@ -3313,6 +3331,10 @@
Heap::Space space = Heap::kNew);
private:
+ uint8_t* ByteAddr(intptr_t byte_offset) const {
+ return Addr<uint8_t>(byte_offset);
+ }
+
template<typename T>
T* Addr(intptr_t byte_offset) const {
intptr_t limit = byte_offset + sizeof(T);
@@ -3373,6 +3395,10 @@
Heap::Space space = Heap::kNew);
private:
+ uint8_t* ByteAddr(intptr_t byte_offset) const {
+ return Addr<uint8_t>(byte_offset);
+ }
+
template<typename T>
T* Addr(intptr_t byte_offset) const {
intptr_t limit = byte_offset + sizeof(T);

Powered by Google App Engine
This is Rietveld 408576698