Index: runtime/vm/object.h |
=================================================================== |
--- runtime/vm/object.h (revision 37317) |
+++ runtime/vm/object.h (working copy) |
@@ -1299,7 +1299,8 @@ |
intptr_t Length() const; |
RawAbstractType* TypeAt(intptr_t index) const; |
static intptr_t type_at_offset(intptr_t index) { |
- return OFFSET_OF(RawTypeArguments, types_) + index * kWordSize; |
+ return OFFSET_OF_RETURNED_VALUE( |
+ RawTypeArguments, types) + index * kWordSize; |
} |
void SetTypeAt(intptr_t index, const AbstractType& value) const; |
@@ -1426,12 +1427,13 @@ |
} |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawTypeArguments) == OFFSET_OF(RawTypeArguments, types_)); |
+ ASSERT(sizeof(RawTypeArguments) == |
+ OFFSET_OF_RETURNED_VALUE(RawTypeArguments, types)); |
return 0; |
} |
static intptr_t InstanceSize(intptr_t len) { |
- // Ensure that the types_ is not adding to the object size, which includes |
+ // Ensure that the types() is not adding to the object size, which includes |
// 2 fields: instantiations_ and length_. |
ASSERT(sizeof(RawTypeArguments) == (sizeof(RawObject) + (2 * kWordSize))); |
ASSERT(0 <= len && len <= kMaxElements); |
@@ -2873,7 +2875,8 @@ |
(2 * OS::kMaxPreferredCodeAlignment))); |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawInstructions) == OFFSET_OF(RawInstructions, data_)); |
+ ASSERT(sizeof(RawInstructions) == |
+ OFFSET_OF_RETURNED_VALUE(RawInstructions, data)); |
return 0; |
} |
@@ -2936,7 +2939,7 @@ |
static intptr_t InstanceSize() { |
ASSERT(sizeof(RawLocalVarDescriptors) == |
- OFFSET_OF(RawLocalVarDescriptors, data_)); |
+ OFFSET_OF_RETURNED_VALUE(RawLocalVarDescriptors, data)); |
return 0; |
} |
static intptr_t InstanceSize(intptr_t len) { |
@@ -3006,7 +3009,8 @@ |
static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawPcDescriptors) == OFFSET_OF(RawPcDescriptors, data_)); |
+ ASSERT(sizeof(RawPcDescriptors) == |
+ OFFSET_OF_RETURNED_VALUE(RawPcDescriptors, data)); |
return 0; |
} |
static intptr_t InstanceSize(intptr_t len) { |
@@ -3042,7 +3046,7 @@ |
intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { |
ASSERT((index >=0) && (index < Length())); |
intptr_t data_index = (index * kNumberOfEntries) + entry_offset; |
- return &raw_ptr()->data_[data_index]; |
+ return &raw_ptr()->data()[data_index]; |
} |
RawSmi** SmiAddr(intptr_t index, intptr_t entry_offset) const { |
return reinterpret_cast<RawSmi**>(EntryAddr(index, entry_offset)); |
@@ -3077,7 +3081,7 @@ |
static const intptr_t kMaxLengthInBytes = kSmiMax; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_)); |
+ ASSERT(sizeof(RawStackmap) == OFFSET_OF_RETURNED_VALUE(RawStackmap, data)); |
return 0; |
} |
static intptr_t InstanceSize(intptr_t length) { |
@@ -3127,8 +3131,8 @@ |
bool HasCatchAll(intptr_t try_index) const; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawExceptionHandlers) == OFFSET_OF(RawExceptionHandlers, |
- data_)); |
+ ASSERT(sizeof(RawExceptionHandlers) == |
+ OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data)); |
return 0; |
} |
static intptr_t InstanceSize(intptr_t len) { |
@@ -3197,7 +3201,8 @@ |
static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawDeoptInfo) == OFFSET_OF(RawDeoptInfo, data_)); |
+ ASSERT(sizeof(RawDeoptInfo) == |
+ OFFSET_OF_RETURNED_VALUE(RawDeoptInfo, data)); |
return 0; |
} |
@@ -3233,7 +3238,7 @@ |
intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { |
ASSERT((index >=0) && (index < Length())); |
intptr_t data_index = (index * kNumberOfEntries) + entry_offset; |
- return &raw_ptr()->data_[data_index]; |
+ return &raw_ptr()->data()[data_index]; |
} |
void SetLength(intptr_t value) const; |
@@ -3624,11 +3629,11 @@ |
// embedded objects in the instructions using pointer_offsets. |
static const intptr_t kBytesPerElement = |
- sizeof(reinterpret_cast<RawCode*>(0)->data_[0]); |
+ sizeof(reinterpret_cast<RawCode*>(0)->data()[0]); |
static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawCode) == OFFSET_OF(RawCode, data_)); |
+ ASSERT(sizeof(RawCode) == OFFSET_OF_RETURNED_VALUE(RawCode, data)); |
return 0; |
} |
static intptr_t InstanceSize(intptr_t len) { |
@@ -3756,7 +3761,7 @@ |
ASSERT(index >= 0); |
ASSERT(index < pointer_offsets_length()); |
// TODO(iposva): Unit test is missing for this functionality. |
- return &raw_ptr()->data_[index]; |
+ return &raw_ptr()->data()[index]; |
} |
void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { |
*PointerOffsetAddrAt(index) = offset_in_instructions; |
@@ -3788,6 +3793,7 @@ |
StorePointer(&raw_ptr()->parent_, parent.raw()); |
} |
static intptr_t parent_offset() { return OFFSET_OF(RawContext, parent_); } |
+ static intptr_t data_offset() { return parent_offset() + kWordSize; } |
Isolate* isolate() const { return raw_ptr()->isolate_; } |
static intptr_t isolate_offset() { return OFFSET_OF(RawContext, isolate_); } |
@@ -3808,11 +3814,11 @@ |
static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
static intptr_t variable_offset(intptr_t context_index) { |
- return OFFSET_OF(RawContext, data_[context_index]); |
+ return data_offset() + kWordSize * context_index; |
} |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawContext) == OFFSET_OF(RawContext, data_)); |
+ ASSERT(sizeof(RawContext) == OFFSET_OF_RETURNED_VALUE(RawContext, data)); |
return 0; |
} |
@@ -3827,7 +3833,7 @@ |
private: |
RawInstance** InstanceAddr(intptr_t context_index) const { |
ASSERT((context_index >= 0) && (context_index < num_variables())); |
- return &raw_ptr()->data_[context_index]; |
+ return &raw_ptr()->data()[context_index]; |
} |
void set_isolate(Isolate* isolate) const { |
@@ -3885,7 +3891,8 @@ |
static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawContextScope) == OFFSET_OF(RawContextScope, data_)); |
+ ASSERT(sizeof(RawContextScope) == |
+ OFFSET_OF_RETURNED_VALUE(RawContextScope, data)); |
return 0; |
} |
@@ -5533,10 +5540,13 @@ |
static const intptr_t kBytesPerElement = 1; |
static const intptr_t kMaxElements = String::kMaxElements; |
- static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } |
+ static intptr_t data_offset() { |
+ return OFFSET_OF_RETURNED_VALUE(RawOneByteString, data); |
+ } |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); |
+ ASSERT(sizeof(RawOneByteString) == |
+ OFFSET_OF_RETURNED_VALUE(RawOneByteString, data)); |
return 0; |
} |
@@ -5629,7 +5639,7 @@ |
ASSERT((index >= 0) && (index < str.Length())); |
ASSERT(str.IsOneByteString()); |
NoGCScope no_gc; |
- return &raw_ptr(str)->data_[index]; |
+ return &raw_ptr(str)->data()[index]; |
} |
static RawOneByteString* ReadFrom(SnapshotReader* reader, |
@@ -5660,10 +5670,13 @@ |
static const intptr_t kBytesPerElement = 2; |
static const intptr_t kMaxElements = String::kMaxElements; |
- static intptr_t data_offset() { return OFFSET_OF(RawTwoByteString, data_); } |
+ static intptr_t data_offset() { |
+ return OFFSET_OF_RETURNED_VALUE(RawTwoByteString, data); |
+ } |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawTwoByteString) == OFFSET_OF(RawTwoByteString, data_)); |
+ ASSERT(sizeof(RawTwoByteString) == |
+ OFFSET_OF_RETURNED_VALUE(RawTwoByteString, data)); |
return 0; |
} |
@@ -5727,7 +5740,7 @@ |
ASSERT((index >= 0) && (index < str.Length())); |
ASSERT(str.IsTwoByteString()); |
NoGCScope no_gc; |
- return &raw_ptr(str)->data_[index]; |
+ return &raw_ptr(str)->data()[index]; |
} |
static RawTwoByteString* ReadFrom(SnapshotReader* reader, |
@@ -6307,7 +6320,7 @@ |
void* DataAddr(intptr_t byte_offset) const { |
ASSERT((byte_offset == 0) || |
((byte_offset > 0) && (byte_offset < LengthInBytes()))); |
- return reinterpret_cast<void*>(raw_ptr()->data_ + byte_offset); |
+ return reinterpret_cast<void*>(raw_ptr()->data() + byte_offset); |
} |
#define TYPED_GETTER_SETTER(name, type) \ |
@@ -6338,11 +6351,12 @@ |
} |
static intptr_t data_offset() { |
- return OFFSET_OF(RawTypedData, data_); |
+ return OFFSET_OF_RETURNED_VALUE(RawTypedData, data); |
} |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawTypedData) == OFFSET_OF(RawTypedData, data_)); |
+ ASSERT(sizeof(RawTypedData) == |
+ OFFSET_OF_RETURNED_VALUE(RawTypedData, data)); |
return 0; |
} |
@@ -6838,7 +6852,7 @@ |
static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
static intptr_t InstanceSize() { |
- ASSERT(sizeof(RawJSRegExp) == OFFSET_OF(RawJSRegExp, data_)); |
+ ASSERT(sizeof(RawJSRegExp) == OFFSET_OF_RETURNED_VALUE(RawJSRegExp, data)); |
return 0; |
} |
@@ -7040,7 +7054,7 @@ |
if (native_fields == TypedData::null()) { |
return 0; |
} |
- return reinterpret_cast<intptr_t*>(native_fields->ptr()->data_)[index]; |
+ return reinterpret_cast<intptr_t*>(native_fields->ptr()->data())[index]; |
} |
@@ -7056,7 +7070,7 @@ |
field_values[i] = 0; |
} |
} |
- intptr_t* fields = reinterpret_cast<intptr_t*>(native_fields->ptr()->data_); |
+ intptr_t* fields = reinterpret_cast<intptr_t*>(native_fields->ptr()->data()); |
for (intptr_t i = 0; i < num_fields; i++) { |
field_values[i] = fields[i]; |
} |