| 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 2922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2933 intptr_t FromIndex(intptr_t index) const; | 2933 intptr_t FromIndex(intptr_t index) const; |
| 2934 intptr_t ToIndex(intptr_t index) const { | 2934 intptr_t ToIndex(intptr_t index) const { |
| 2935 return index; | 2935 return index; |
| 2936 } | 2936 } |
| 2937 | 2937 |
| 2938 // Unpack the entire translation into an array of deoptimization | 2938 // Unpack the entire translation into an array of deoptimization |
| 2939 // instructions. This copies any shared suffixes into the array. | 2939 // instructions. This copies any shared suffixes into the array. |
| 2940 void ToInstructions(const Array& table, | 2940 void ToInstructions(const Array& table, |
| 2941 GrowableArray<DeoptInstr*>* instructions) const; | 2941 GrowableArray<DeoptInstr*>* instructions) const; |
| 2942 | 2942 |
| 2943 |
| 2944 // Returns true iff decompression yields the same instructions as the |
| 2945 // original. |
| 2946 bool VerifyDecompression(const GrowableArray<DeoptInstr*>& original, |
| 2947 const Array& deopt_table) const; |
| 2948 |
| 2943 private: | 2949 private: |
| 2944 intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { | 2950 intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { |
| 2945 ASSERT((index >=0) && (index < Length())); | 2951 ASSERT((index >=0) && (index < Length())); |
| 2946 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; | 2952 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; |
| 2947 return &raw_ptr()->data_[data_index]; | 2953 return &raw_ptr()->data_[data_index]; |
| 2948 } | 2954 } |
| 2949 | 2955 |
| 2950 void SetLength(intptr_t value) const; | 2956 void SetLength(intptr_t value) const; |
| 2951 | 2957 |
| 2952 FINAL_HEAP_OBJECT_IMPLEMENTATION(DeoptInfo, Object); | 2958 FINAL_HEAP_OBJECT_IMPLEMENTATION(DeoptInfo, Object); |
| (...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6162 | 6168 |
| 6163 | 6169 |
| 6164 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6170 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6165 intptr_t index) { | 6171 intptr_t index) { |
| 6166 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6172 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6167 } | 6173 } |
| 6168 | 6174 |
| 6169 } // namespace dart | 6175 } // namespace dart |
| 6170 | 6176 |
| 6171 #endif // VM_OBJECT_H_ | 6177 #endif // VM_OBJECT_H_ |
| OLD | NEW |