| 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 4732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4743 return Smi::Value(raw_ptr()->length_); | 4743 return Smi::Value(raw_ptr()->length_); |
| 4744 } | 4744 } |
| 4745 | 4745 |
| 4746 static intptr_t length_offset() { | 4746 static intptr_t length_offset() { |
| 4747 return OFFSET_OF(RawByteArray, length_); | 4747 return OFFSET_OF(RawByteArray, length_); |
| 4748 } | 4748 } |
| 4749 | 4749 |
| 4750 virtual intptr_t ByteLength() const; | 4750 virtual intptr_t ByteLength() const; |
| 4751 | 4751 |
| 4752 virtual void* GetPeer() const { return NULL; } | 4752 virtual void* GetPeer() const { return NULL; } |
| 4753 virtual uint8_t* ByteAddr(intptr_t byte_offset) const; |
| 4753 | 4754 |
| 4754 FinalizablePersistentHandle* AddFinalizer( | 4755 FinalizablePersistentHandle* AddFinalizer( |
| 4755 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; | 4756 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; |
| 4756 | 4757 |
| 4757 static void Copy(void* dst, | 4758 static void Copy(void* dst, |
| 4758 const ByteArray& src, | 4759 const ByteArray& src, |
| 4759 intptr_t src_offset, | 4760 intptr_t src_offset, |
| 4760 intptr_t length); | 4761 intptr_t length); |
| 4761 | 4762 |
| 4762 static void Copy(const ByteArray& dst, | 4763 static void Copy(const ByteArray& dst, |
| 4763 intptr_t dst_offset, | 4764 intptr_t dst_offset, |
| 4764 const void* src, | 4765 const void* src, |
| 4765 intptr_t length); | 4766 intptr_t length); |
| 4766 | 4767 |
| 4767 static void Copy(const ByteArray& dst, | 4768 static void Copy(const ByteArray& dst, |
| 4768 intptr_t dst_offset, | 4769 intptr_t dst_offset, |
| 4769 const ByteArray& src, | 4770 const ByteArray& src, |
| 4770 intptr_t src_offset, | 4771 intptr_t src_offset, |
| 4771 intptr_t length); | 4772 intptr_t length); |
| 4772 | 4773 |
| 4773 protected: | 4774 protected: |
| 4774 virtual uint8_t* ByteAddr(intptr_t byte_offset) const; | |
| 4775 virtual void SetPeer(void* peer) const { } | 4775 virtual void SetPeer(void* peer) const { } |
| 4776 | 4776 |
| 4777 template<typename HandleT, typename RawT> | 4777 template<typename HandleT, typename RawT> |
| 4778 static RawT* NewImpl(intptr_t class_id, | 4778 static RawT* NewImpl(intptr_t class_id, |
| 4779 intptr_t len, | 4779 intptr_t len, |
| 4780 Heap::Space space); | 4780 Heap::Space space); |
| 4781 | 4781 |
| 4782 template<typename HandleT, typename RawT, typename ElementT> | 4782 template<typename HandleT, typename RawT, typename ElementT> |
| 4783 static RawT* NewImpl(intptr_t class_id, | 4783 static RawT* NewImpl(intptr_t class_id, |
| 4784 const ElementT* data, | 4784 const ElementT* data, |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6338 | 6338 |
| 6339 | 6339 |
| 6340 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6340 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6341 intptr_t index) { | 6341 intptr_t index) { |
| 6342 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6342 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6343 } | 6343 } |
| 6344 | 6344 |
| 6345 } // namespace dart | 6345 } // namespace dart |
| 6346 | 6346 |
| 6347 #endif // VM_OBJECT_H_ | 6347 #endif // VM_OBJECT_H_ |
| OLD | NEW |