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" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 RawPcDescriptors* FinalizePcDescriptors(uword entry_point); | 58 RawPcDescriptors* FinalizePcDescriptors(uword entry_point); |
59 | 59 |
60 private: | 60 private: |
61 GrowableArray<struct PcDesc> list_; | 61 GrowableArray<struct PcDesc> list_; |
62 DISALLOW_COPY_AND_ASSIGN(DescriptorList); | 62 DISALLOW_COPY_AND_ASSIGN(DescriptorList); |
63 }; | 63 }; |
64 | 64 |
65 | 65 |
66 class StackmapTableBuilder : public ZoneAllocated { | 66 class StackmapTableBuilder : public ZoneAllocated { |
67 public: | 67 public: |
68 explicit StackmapTableBuilder(intptr_t entry_length_in_bits) | 68 explicit StackmapTableBuilder(intptr_t entry_length) |
69 : entry_length_in_bits_(entry_length_in_bits), | 69 : entry_length_(entry_length), |
70 stack_map_(Stackmap::ZoneHandle()), | 70 stack_map_(Stackmap::ZoneHandle()), |
71 list_(GrowableObjectArray::ZoneHandle( | 71 list_(GrowableObjectArray::ZoneHandle( |
72 GrowableObjectArray::New(Heap::kOld))) { } | 72 GrowableObjectArray::New(Heap::kOld))) { } |
73 ~StackmapTableBuilder() { } | 73 ~StackmapTableBuilder() { } |
74 | 74 |
75 void AddEntry(intptr_t pc_offset, BitmapBuilder* bitmap); | 75 void AddEntry(intptr_t pc_offset, BitmapBuilder* bitmap); |
76 | 76 |
77 bool Verify(); | 77 bool Verify(); |
78 | 78 |
79 RawArray* FinalizeStackmaps(const Code& code); | 79 RawArray* FinalizeStackmaps(const Code& code); |
80 | 80 |
81 private: | 81 private: |
82 intptr_t Length() const { return list_.Length(); } | 82 intptr_t Length() const { return list_.Length(); } |
83 RawStackmap* MapAt(int index) const; | 83 RawStackmap* MapAt(int index) const; |
84 | 84 |
85 // All the stackmaps in a function have the same length. | 85 // All the stackmaps in a function have the same length. |
86 intptr_t entry_length_in_bits_; | 86 const intptr_t entry_length_; |
srdjan
2012/08/21 16:06:04
Why did you remove the _in_bits? I assume it is n
Kevin Millikin (Google)
2012/08/22 07:34:18
No, it's the number of entries in each stackmap.
| |
87 Stackmap& stack_map_; | 87 Stackmap& stack_map_; |
88 GrowableObjectArray& list_; | 88 GrowableObjectArray& list_; |
89 DISALLOW_COPY_AND_ASSIGN(StackmapTableBuilder); | 89 DISALLOW_COPY_AND_ASSIGN(StackmapTableBuilder); |
90 }; | 90 }; |
91 | 91 |
92 | 92 |
93 class ExceptionHandlerList : public ZoneAllocated { | 93 class ExceptionHandlerList : public ZoneAllocated { |
94 public: | 94 public: |
95 struct HandlerDesc { | 95 struct HandlerDesc { |
96 intptr_t try_index; // Try block index handled by the handler. | 96 intptr_t try_index; // Try block index handled by the handler. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 } | 131 } |
132 | 132 |
133 private: | 133 private: |
134 GrowableArray<struct HandlerDesc> list_; | 134 GrowableArray<struct HandlerDesc> list_; |
135 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 135 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
136 }; | 136 }; |
137 | 137 |
138 } // namespace dart | 138 } // namespace dart |
139 | 139 |
140 #endif // VM_CODE_DESCRIPTORS_H_ | 140 #endif // VM_CODE_DESCRIPTORS_H_ |
OLD | NEW |