| Index: runtime/vm/object.h
|
| ===================================================================
|
| --- runtime/vm/object.h (revision 14777)
|
| +++ runtime/vm/object.h (working copy)
|
| @@ -3074,14 +3074,9 @@
|
| return ((index >= 0) && (index < clazz()->ptr()->num_native_fields_));
|
| }
|
|
|
| - intptr_t GetNativeField(int index) const {
|
| - return *NativeFieldAddr(index);
|
| - }
|
| + inline intptr_t GetNativeField(Isolate* isolate, int index) const;
|
| + void SetNativeField(int index, intptr_t value) const;
|
|
|
| - void SetNativeField(int index, intptr_t value) const {
|
| - *NativeFieldAddr(index) = value;
|
| - }
|
| -
|
| // Returns true if the instance is a closure object.
|
| bool IsClosure() const;
|
|
|
| @@ -3099,11 +3094,8 @@
|
| RawObject** FieldAddr(const Field& field) const {
|
| return FieldAddrAtOffset(field.Offset());
|
| }
|
| - intptr_t* NativeFieldAddr(int index) const {
|
| - ASSERT(IsValidNativeIndex(index));
|
| - return reinterpret_cast<intptr_t*>((raw_value() - kHeapObjectTag)
|
| - + (index * kWordSize)
|
| - + sizeof(RawObject));
|
| + RawObject** NativeFieldsAddr() const {
|
| + return FieldAddrAtOffset(sizeof(RawObject));
|
| }
|
| void SetFieldAtOffset(intptr_t offset, const Object& value) const {
|
| StorePointer(FieldAddrAtOffset(offset), value.raw());
|
| @@ -5849,6 +5841,18 @@
|
| }
|
|
|
|
|
| +intptr_t Instance::GetNativeField(Isolate* isolate, int index) const {
|
| + ASSERT(IsValidNativeIndex(index));
|
| + NoGCScope no_gc;
|
| + RawIntPtrArray* native_fields =
|
| + reinterpret_cast<RawIntPtrArray*>(*NativeFieldsAddr());
|
| + if (native_fields == IntPtrArray::null()) {
|
| + return 0;
|
| + }
|
| + return native_fields->ptr()->data_[index];
|
| +}
|
| +
|
| +
|
| bool String::Equals(const String& str) const {
|
| if (raw() == str.raw()) {
|
| return true; // Both handles point to the same raw instance.
|
|
|