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

Unified Diff: runtime/vm/raw_object.h

Issue 12937010: Handle TypedDataView objects in Dart_TypedDataAcquireData 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/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 20452)
+++ runtime/vm/raw_object.h (working copy)
@@ -155,6 +155,12 @@
#undef DEFINE_OBJECT_KIND
#define DEFINE_OBJECT_KIND(clazz) \
+ kTypedData##clazz##ViewCid,
+CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
+ kByteDataViewCid,
+#undef DEFINE_OBJECT_KIND
+
+#define DEFINE_OBJECT_KIND(clazz) \
kExternalTypedData##clazz##Cid,
CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND)
#undef DEFINE_OBJECT_KIND
@@ -392,6 +398,7 @@
static bool IsByteArrayClassId(intptr_t index);
static bool IsExternalByteArrayClassId(intptr_t index);
static bool IsTypedDataClassId(intptr_t index);
+ static bool IsTypedDataViewClassId(intptr_t index);
static bool IsExternalTypedDataClassId(intptr_t index);
static intptr_t NumberOfTypedDataClasses();
@@ -1874,12 +1881,31 @@
kTypedDataUint64ArrayCid == kTypedDataInt8ArrayCid + 8 &&
kTypedDataFloat32ArrayCid == kTypedDataInt8ArrayCid + 9 &&
kTypedDataFloat64ArrayCid == kTypedDataInt8ArrayCid + 10 &&
- kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayCid + 11);
+ kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 11);
return (index >= kTypedDataInt8ArrayCid &&
index <= kTypedDataFloat64ArrayCid);
}
+inline bool RawObject::IsTypedDataViewClassId(intptr_t index) {
+ // Make sure this is updated when new TypedData types are added.
+ ASSERT(kTypedDataUint8ArrayViewCid == kTypedDataInt8ArrayViewCid + 1 &&
+ kTypedDataUint8ClampedArrayViewCid == kTypedDataInt8ArrayViewCid + 2 &&
+ kTypedDataInt16ArrayViewCid == kTypedDataInt8ArrayViewCid + 3 &&
+ kTypedDataUint16ArrayViewCid == kTypedDataInt8ArrayViewCid + 4 &&
+ kTypedDataInt32ArrayViewCid == kTypedDataInt8ArrayViewCid + 5 &&
+ kTypedDataUint32ArrayViewCid == kTypedDataInt8ArrayViewCid + 6 &&
+ kTypedDataInt64ArrayViewCid == kTypedDataInt8ArrayViewCid + 7 &&
+ kTypedDataUint64ArrayViewCid == kTypedDataInt8ArrayViewCid + 8 &&
+ kTypedDataFloat32ArrayViewCid == kTypedDataInt8ArrayViewCid + 9 &&
+ kTypedDataFloat64ArrayViewCid == kTypedDataInt8ArrayViewCid + 10 &&
+ kByteDataViewCid == kTypedDataInt8ArrayViewCid + 11 &&
+ kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 12);
+ return (index >= kTypedDataInt8ArrayViewCid &&
+ index <= kByteDataViewCid);
+}
+
+
inline bool RawObject::IsExternalTypedDataClassId(intptr_t index) {
// Make sure this is updated when new ExternalTypedData types are added.
ASSERT((kExternalTypedDataUint8ArrayCid ==
@@ -1910,7 +1936,8 @@
inline intptr_t RawObject::NumberOfTypedDataClasses() {
// Make sure this is updated when new TypedData types are added.
- ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayCid + 11);
+ ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 11);
+ ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 12);
ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11);
return (kNullCid - kTypedDataInt8ArrayCid);
}
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698