| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_CODE_INDEX_TABLE_H_ | 5 #ifndef VM_CODE_INDEX_TABLE_H_ |
| 6 #define VM_CODE_INDEX_TABLE_H_ | 6 #define VM_CODE_INDEX_TABLE_H_ |
| 7 | 7 |
| 8 #include "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 length_ += 1; | 85 length_ += 1; |
| 86 } | 86 } |
| 87 void Resize(int new_capacity) { | 87 void Resize(int new_capacity) { |
| 88 ASSERT(new_capacity > capacity_); | 88 ASSERT(new_capacity > capacity_); |
| 89 T* new_data = reinterpret_cast<T*>(realloc(reinterpret_cast<void*>(data_), | 89 T* new_data = reinterpret_cast<T*>(realloc(reinterpret_cast<void*>(data_), |
| 90 new_capacity * sizeof(T))); | 90 new_capacity * sizeof(T))); |
| 91 ASSERT(new_data != NULL); | 91 ASSERT(new_data != NULL); |
| 92 data_ = new_data; | 92 data_ = new_data; |
| 93 capacity_ = new_capacity; | 93 capacity_ = new_capacity; |
| 94 } | 94 } |
| 95 |
| 95 private: | 96 private: |
| 96 intptr_t length_; | 97 intptr_t length_; |
| 97 intptr_t capacity_; | 98 intptr_t capacity_; |
| 98 T* data_; | 99 T* data_; |
| 99 DISALLOW_COPY_AND_ASSIGN(IndexArray); | 100 DISALLOW_COPY_AND_ASSIGN(IndexArray); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 // PC range for a function. | 103 // PC range for a function. |
| 103 typedef struct { | 104 typedef struct { |
| 104 uword entrypoint; // Entry point for the function. | 105 uword entrypoint; // Entry point for the function. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 RawArray* code_lists_; // Array of pointers to code lists (arrays). | 162 RawArray* code_lists_; // Array of pointers to code lists (arrays). |
| 162 IndexArray<PcRange>* largecode_pc_ranges_; // pc ranges of large codes. | 163 IndexArray<PcRange>* largecode_pc_ranges_; // pc ranges of large codes. |
| 163 RawArray* largecode_list_; // Array of pointer to large code objects. | 164 RawArray* largecode_list_; // Array of pointer to large code objects. |
| 164 | 165 |
| 165 DISALLOW_COPY_AND_ASSIGN(CodeIndexTable); | 166 DISALLOW_COPY_AND_ASSIGN(CodeIndexTable); |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 } // namespace dart | 169 } // namespace dart |
| 169 | 170 |
| 170 #endif // VM_CODE_INDEX_TABLE_H_ | 171 #endif // VM_CODE_INDEX_TABLE_H_ |
| OLD | NEW |