| 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/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 explicit DescriptorList(intptr_t initial_capacity) : list_(initial_capacity) { | 32 explicit DescriptorList(intptr_t initial_capacity) : list_(initial_capacity) { |
| 33 } | 33 } |
| 34 ~DescriptorList() { } | 34 ~DescriptorList() { } |
| 35 | 35 |
| 36 intptr_t Length() const { | 36 intptr_t Length() const { |
| 37 return list_.length(); | 37 return list_.length(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 intptr_t PcOffset(int index) const { | 40 intptr_t PcOffset(intptr_t index) const { |
| 41 return list_[index].pc_offset; | 41 return list_[index].pc_offset; |
| 42 } | 42 } |
| 43 PcDescriptors::Kind Kind(int index) const { | 43 PcDescriptors::Kind Kind(intptr_t index) const { |
| 44 return list_[index].kind; | 44 return list_[index].kind; |
| 45 } | 45 } |
| 46 intptr_t DeoptId(int index) const { | 46 intptr_t DeoptId(intptr_t index) const { |
| 47 return list_[index].deopt_id; | 47 return list_[index].deopt_id; |
| 48 } | 48 } |
| 49 intptr_t TokenPos(int index) const { | 49 intptr_t TokenPos(intptr_t index) const { |
| 50 return list_[index].TokenPos(); | 50 return list_[index].TokenPos(); |
| 51 } | 51 } |
| 52 DeoptReasonId DeoptReason(int index) const { | 52 DeoptReasonId DeoptReason(intptr_t index) const { |
| 53 return list_[index].DeoptReason(); | 53 return list_[index].DeoptReason(); |
| 54 } | 54 } |
| 55 intptr_t TryIndex(int index) const { | 55 intptr_t TryIndex(intptr_t index) const { |
| 56 return list_[index].try_index; | 56 return list_[index].try_index; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void AddDescriptor(PcDescriptors::Kind kind, | 59 void AddDescriptor(PcDescriptors::Kind kind, |
| 60 intptr_t pc_offset, | 60 intptr_t pc_offset, |
| 61 intptr_t deopt_id, | 61 intptr_t deopt_id, |
| 62 intptr_t token_index, | 62 intptr_t token_index, |
| 63 intptr_t try_index); | 63 intptr_t try_index); |
| 64 | 64 |
| 65 RawPcDescriptors* FinalizePcDescriptors(uword entry_point); | 65 RawPcDescriptors* FinalizePcDescriptors(uword entry_point); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 void AddEntry(intptr_t pc_offset, | 81 void AddEntry(intptr_t pc_offset, |
| 82 BitmapBuilder* bitmap, | 82 BitmapBuilder* bitmap, |
| 83 intptr_t register_bit_count); | 83 intptr_t register_bit_count); |
| 84 | 84 |
| 85 bool Verify(); | 85 bool Verify(); |
| 86 | 86 |
| 87 RawArray* FinalizeStackmaps(const Code& code); | 87 RawArray* FinalizeStackmaps(const Code& code); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 intptr_t Length() const { return list_.Length(); } | 90 intptr_t Length() const { return list_.Length(); } |
| 91 RawStackmap* MapAt(int index) const; | 91 RawStackmap* MapAt(intptr_t index) const; |
| 92 | 92 |
| 93 Stackmap& stack_map_; | 93 Stackmap& stack_map_; |
| 94 GrowableObjectArray& list_; | 94 GrowableObjectArray& list_; |
| 95 DISALLOW_COPY_AND_ASSIGN(StackmapTableBuilder); | 95 DISALLOW_COPY_AND_ASSIGN(StackmapTableBuilder); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 | 98 |
| 99 class ExceptionHandlerList : public ZoneAllocated { | 99 class ExceptionHandlerList : public ZoneAllocated { |
| 100 public: | 100 public: |
| 101 struct HandlerDesc { | 101 struct HandlerDesc { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 private: | 179 private: |
| 180 GrowableArray<struct HandlerDesc> list_; | 180 GrowableArray<struct HandlerDesc> list_; |
| 181 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 181 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 } // namespace dart | 184 } // namespace dart |
| 185 | 185 |
| 186 #endif // VM_CODE_DESCRIPTORS_H_ | 186 #endif // VM_CODE_DESCRIPTORS_H_ |
| OLD | NEW |