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

Unified Diff: runtime/vm/object.h

Issue 12730013: - Use dart:typedata types in the Dart API calls. (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/vm/dart_api_message.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 19847)
+++ runtime/vm/object.h (working copy)
@@ -4935,6 +4935,11 @@
return (ElementSizeInBytes(cid) * Length());
}
+ void* DataAddr(intptr_t byte_offset) const {
+ ASSERT((byte_offset >= 0) && (byte_offset < LengthInBytes()));
+ return reinterpret_cast<void*>(raw_ptr()->data_ + byte_offset);
+ }
+
#define TYPED_GETTER_SETTER(name, type) \
type Get##name(intptr_t byte_offset) const { \
return *reinterpret_cast<type*>(DataAddr(byte_offset)); \
@@ -4989,11 +4994,6 @@
private:
static const intptr_t element_size[];
- void* DataAddr(intptr_t byte_offset) const {
- ASSERT((byte_offset >= 0) && (byte_offset < LengthInBytes()));
- return reinterpret_cast<void*>(raw_ptr()->data_ + byte_offset);
- }
-
FINAL_HEAP_OBJECT_IMPLEMENTATION(TypedData, Instance);
friend class Class;
friend class ExternalTypedData;
@@ -5017,6 +5017,15 @@
return (ElementSizeInBytes(cid) * Length());
}
+ void* GetPeer() const {
+ return raw_ptr()->peer_;
+ }
+
+ void* DataAddr(intptr_t byte_offset) const {
+ ASSERT((byte_offset >= 0) && (byte_offset < LengthInBytes()));
+ return reinterpret_cast<void*>(raw_ptr()->data_ + byte_offset);
+ }
+
#define TYPED_GETTER_SETTER(name, type) \
type Get##name(intptr_t byte_offset) const { \
return *reinterpret_cast<type*>(DataAddr(byte_offset)); \
@@ -5079,11 +5088,6 @@
}
private:
- void* DataAddr(intptr_t byte_offset) const {
- ASSERT((byte_offset >= 0) && (byte_offset < LengthInBytes()));
- return reinterpret_cast<void*>(raw_ptr()->data_ + byte_offset);
- }
-
FINAL_HEAP_OBJECT_IMPLEMENTATION(ExternalTypedData, Instance);
friend class Class;
};
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698