Index: runtime/vm/raw_object.h |
=================================================================== |
--- runtime/vm/raw_object.h (revision 38347) |
+++ runtime/vm/raw_object.h (working copy) |
@@ -150,6 +150,8 @@ |
CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) |
#undef DEFINE_OBJECT_KIND |
+ kByteBufferCid, |
+ |
// The following entries do not describe a predefined class, but instead |
// are class indexes for pre-allocated instance (Null, dynamic and Void). |
kNullCid, |
@@ -417,6 +419,7 @@ |
static bool IsExternalTypedDataClassId(intptr_t index); |
static bool IsInternalVMdefinedClassId(intptr_t index); |
static bool IsVariableSizeClassId(intptr_t index); |
+ static bool IsImplicitFieldClassId(intptr_t index); |
static intptr_t NumberOfTypedDataClasses(); |
@@ -451,6 +454,7 @@ |
friend class Api; |
friend class Array; |
+ friend class ByteBuffer; |
friend class Code; |
friend class FreeListElement; |
friend class GCMarker; |
@@ -1833,7 +1837,8 @@ |
(index == kGrowableObjectArrayCid) || |
IsTypedDataClassId(index) || |
IsTypedDataViewClassId(index) || |
- IsExternalTypedDataClassId(index)); |
+ IsExternalTypedDataClassId(index) || |
+ (index == kByteBufferCid)); |
} |
@@ -1910,7 +1915,7 @@ |
kExternalTypedDataInt8ArrayCid + 12) && |
(kExternalTypedDataFloat64x2ArrayCid == |
kExternalTypedDataInt8ArrayCid + 13) && |
- (kNullCid == kExternalTypedDataInt8ArrayCid + 14)); |
+ (kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14)); |
return (index >= kExternalTypedDataInt8ArrayCid && |
index <= kExternalTypedDataFloat64x2ArrayCid); |
} |
@@ -1918,11 +1923,10 @@ |
inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) { |
return ((index < kNumPredefinedCids) && |
- !RawObject::IsTypedDataViewClassId(index)); |
+ !RawObject::IsImplicitFieldClassId(index)); |
} |
- |
inline bool RawObject::IsVariableSizeClassId(intptr_t index) { |
return (index == kArrayCid) || |
(index == kImmutableArrayCid) || |
@@ -1945,12 +1949,21 @@ |
} |
+// This is a set of classes that are not Dart classes whose representation |
+// is defined by the VM but are used in the VM code by computing the |
+// implicit field offsets of the various fields in the dart object. |
+inline bool RawObject::IsImplicitFieldClassId(intptr_t index) { |
+ return (IsTypedDataViewClassId(index) || index == kByteBufferCid); |
+} |
+ |
+ |
inline intptr_t RawObject::NumberOfTypedDataClasses() { |
// Make sure this is updated when new TypedData types are added. |
COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
kTypedDataInt8ArrayViewCid + 15); |
- COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); |
+ COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
+ COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
return (kNullCid - kTypedDataInt8ArrayCid); |
} |