| 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 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 int32_t* PointerOffsetAddrAt(int index) const { | 2984 int32_t* PointerOffsetAddrAt(int index) const { |
| 2985 ASSERT(index >= 0); | 2985 ASSERT(index >= 0); |
| 2986 ASSERT(index < pointer_offsets_length()); | 2986 ASSERT(index < pointer_offsets_length()); |
| 2987 // TODO(iposva): Unit test is missing for this functionality. | 2987 // TODO(iposva): Unit test is missing for this functionality. |
| 2988 return &raw_ptr()->data_[index]; | 2988 return &raw_ptr()->data_[index]; |
| 2989 } | 2989 } |
| 2990 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { | 2990 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { |
| 2991 *PointerOffsetAddrAt(index) = offset_in_instructions; | 2991 *PointerOffsetAddrAt(index) = offset_in_instructions; |
| 2992 } | 2992 } |
| 2993 | 2993 |
| 2994 intptr_t BinarySearchInSCallTable(uword pc) const; |
| 2994 | 2995 |
| 2995 // New is a private method as RawInstruction and RawCode objects should | 2996 // New is a private method as RawInstruction and RawCode objects should |
| 2996 // only be created using the Code::FinalizeCode method. This method creates | 2997 // only be created using the Code::FinalizeCode method. This method creates |
| 2997 // the RawInstruction and RawCode objects, sets up the pointer offsets | 2998 // the RawInstruction and RawCode objects, sets up the pointer offsets |
| 2998 // and links the two in a GC safe manner. | 2999 // and links the two in a GC safe manner. |
| 2999 static RawCode* New(intptr_t pointer_offsets_length); | 3000 static RawCode* New(intptr_t pointer_offsets_length); |
| 3000 | 3001 |
| 3001 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object); | 3002 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object); |
| 3002 friend class Class; | 3003 friend class Class; |
| 3003 }; | 3004 }; |
| (...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5840 | 5841 |
| 5841 | 5842 |
| 5842 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5843 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5843 intptr_t index) { | 5844 intptr_t index) { |
| 5844 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5845 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5845 } | 5846 } |
| 5846 | 5847 |
| 5847 } // namespace dart | 5848 } // namespace dart |
| 5848 | 5849 |
| 5849 #endif // VM_OBJECT_H_ | 5850 #endif // VM_OBJECT_H_ |
| OLD | NEW |