| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 4980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4991 uint8_t At(intptr_t index) const { | 4991 uint8_t At(intptr_t index) const { |
| 4992 ASSERT((index >= 0) && (index < Length())); | 4992 ASSERT((index >= 0) && (index < Length())); |
| 4993 return raw_ptr()->external_data_->data()[index]; | 4993 return raw_ptr()->external_data_->data()[index]; |
| 4994 } | 4994 } |
| 4995 | 4995 |
| 4996 void SetAt(intptr_t index, uint8_t value) const { | 4996 void SetAt(intptr_t index, uint8_t value) const { |
| 4997 ASSERT((index >= 0) && (index < Length())); | 4997 ASSERT((index >= 0) && (index < Length())); |
| 4998 raw_ptr()->external_data_->data()[index] = value; | 4998 raw_ptr()->external_data_->data()[index] = value; |
| 4999 } | 4999 } |
| 5000 | 5000 |
| 5001 void* GetData() const { |
| 5002 return raw_ptr()->external_data_->data(); |
| 5003 } |
| 5004 |
| 5001 void* GetPeer() const { | 5005 void* GetPeer() const { |
| 5002 return raw_ptr()->external_data_->peer(); | 5006 return raw_ptr()->external_data_->peer(); |
| 5003 } | 5007 } |
| 5004 | 5008 |
| 5005 static const intptr_t kBytesPerElement = 1; | 5009 static const intptr_t kBytesPerElement = 1; |
| 5006 | 5010 |
| 5007 // Since external arrays may be serialized to non-external ones, | 5011 // Since external arrays may be serialized to non-external ones, |
| 5008 // enforce the same maximum element count. | 5012 // enforce the same maximum element count. |
| 5009 static const intptr_t kMaxElements = Uint8Array::kMaxElements; | 5013 static const intptr_t kMaxElements = Uint8Array::kMaxElements; |
| 5010 | 5014 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5789 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5793 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5790 return false; | 5794 return false; |
| 5791 } | 5795 } |
| 5792 } | 5796 } |
| 5793 return true; | 5797 return true; |
| 5794 } | 5798 } |
| 5795 | 5799 |
| 5796 } // namespace dart | 5800 } // namespace dart |
| 5797 | 5801 |
| 5798 #endif // VM_OBJECT_H_ | 5802 #endif // VM_OBJECT_H_ |
| OLD | NEW |