| 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) | 68 explicit StackmapTableBuilder() |
| 69 : entry_length_(entry_length), | 69 : stack_map_(Stackmap::ZoneHandle()), |
| 70 stack_map_(Stackmap::ZoneHandle()), | |
| 71 list_(GrowableObjectArray::ZoneHandle( | 70 list_(GrowableObjectArray::ZoneHandle( |
| 72 GrowableObjectArray::New(Heap::kOld))) { } | 71 GrowableObjectArray::New(Heap::kOld))) { } |
| 73 ~StackmapTableBuilder() { } | 72 ~StackmapTableBuilder() { } |
| 74 | 73 |
| 75 void AddEntry(intptr_t pc_offset, BitmapBuilder* bitmap); | 74 void AddEntry(intptr_t pc_offset, BitmapBuilder* bitmap); |
| 76 | 75 |
| 77 bool Verify(); | 76 bool Verify(); |
| 78 | 77 |
| 79 RawArray* FinalizeStackmaps(const Code& code); | 78 RawArray* FinalizeStackmaps(const Code& code); |
| 80 | 79 |
| 81 private: | 80 private: |
| 82 intptr_t Length() const { return list_.Length(); } | 81 intptr_t Length() const { return list_.Length(); } |
| 83 RawStackmap* MapAt(int index) const; | 82 RawStackmap* MapAt(int index) const; |
| 84 | 83 |
| 85 // All the stackmaps in a function have the same length. | |
| 86 const intptr_t entry_length_; | |
| 87 Stackmap& stack_map_; | 84 Stackmap& stack_map_; |
| 88 GrowableObjectArray& list_; | 85 GrowableObjectArray& list_; |
| 89 DISALLOW_COPY_AND_ASSIGN(StackmapTableBuilder); | 86 DISALLOW_COPY_AND_ASSIGN(StackmapTableBuilder); |
| 90 }; | 87 }; |
| 91 | 88 |
| 92 | 89 |
| 93 class ExceptionHandlerList : public ZoneAllocated { | 90 class ExceptionHandlerList : public ZoneAllocated { |
| 94 public: | 91 public: |
| 95 struct HandlerDesc { | 92 struct HandlerDesc { |
| 96 intptr_t try_index; // Try block index handled by the handler. | 93 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 } | 128 } |
| 132 | 129 |
| 133 private: | 130 private: |
| 134 GrowableArray<struct HandlerDesc> list_; | 131 GrowableArray<struct HandlerDesc> list_; |
| 135 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 132 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
| 136 }; | 133 }; |
| 137 | 134 |
| 138 } // namespace dart | 135 } // namespace dart |
| 139 | 136 |
| 140 #endif // VM_CODE_DESCRIPTORS_H_ | 137 #endif // VM_CODE_DESCRIPTORS_H_ |
| OLD | NEW |