| 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_CODE_DESCRIPTORS_H_ | 5 #ifndef VM_CODE_DESCRIPTORS_H_ |
| 6 #define VM_CODE_DESCRIPTORS_H_ | 6 #define VM_CODE_DESCRIPTORS_H_ |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 class DescriptorList : public ZoneAllocated { | 14 class DescriptorList : public ZoneAllocated { |
| 15 public: | 15 public: |
| 16 struct PcDesc { | 16 struct PcDesc { |
| 17 intptr_t pc_offset; // PC offset value of the descriptor. | 17 intptr_t pc_offset; // PC offset value of the descriptor. |
| 18 PcDescriptors::Kind kind; // Descriptor kind (kDeopt, kOther). | 18 PcDescriptors::Kind kind; // Descriptor kind (kDeopt, kOther). |
| 19 intptr_t node_id; // AST node id. | 19 intptr_t node_id; // AST node id. |
| 20 intptr_t token_index; // Token position in source of PC. | 20 intptr_t token_index; // Token position in source of PC. |
| 21 intptr_t try_index; // Try block index of PC. | 21 intptr_t try_index; // Try block index of PC. |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 DescriptorList() : list_() { | 24 explicit DescriptorList(intptr_t initial_capacity) : list_(initial_capacity) { |
| 25 } | 25 } |
| 26 ~DescriptorList() { } | 26 ~DescriptorList() { } |
| 27 | 27 |
| 28 intptr_t Length() const { | 28 intptr_t Length() const { |
| 29 return list_.length(); | 29 return list_.length(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 intptr_t PcOffset(int index) const { | 32 intptr_t PcOffset(int index) const { |
| 33 return list_[index].pc_offset; | 33 return list_[index].pc_offset; |
| 34 } | 34 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 GrowableArray<struct HandlerDesc> list_; | 157 GrowableArray<struct HandlerDesc> list_; |
| 158 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 158 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 } // namespace dart | 161 } // namespace dart |
| 162 | 162 |
| 163 #endif // VM_CODE_DESCRIPTORS_H_ | 163 #endif // VM_CODE_DESCRIPTORS_H_ |
| OLD | NEW |