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 24 matching lines...) Expand all Loading... |
35 GrowableArray<uint8_t> encoded_data_; | 35 GrowableArray<uint8_t> encoded_data_; |
36 | 36 |
37 intptr_t prev_pc_offset; | 37 intptr_t prev_pc_offset; |
38 intptr_t prev_deopt_id; | 38 intptr_t prev_deopt_id; |
39 intptr_t prev_token_pos; | 39 intptr_t prev_token_pos; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(DescriptorList); | 41 DISALLOW_COPY_AND_ASSIGN(DescriptorList); |
42 }; | 42 }; |
43 | 43 |
44 | 44 |
| 45 class CodeSourceMapBuilder : public ZoneAllocated { |
| 46 public: |
| 47 explicit CodeSourceMapBuilder(intptr_t initial_capacity = 64) |
| 48 : encoded_data_(initial_capacity), |
| 49 prev_pc_offset(0), |
| 50 prev_token_pos(0) {} |
| 51 |
| 52 ~CodeSourceMapBuilder() { } |
| 53 |
| 54 void AddEntry(intptr_t pc_offset, intptr_t token_pos); |
| 55 |
| 56 RawCodeSourceMap* Finalize(); |
| 57 |
| 58 private: |
| 59 GrowableArray<uint8_t> encoded_data_; |
| 60 |
| 61 intptr_t prev_pc_offset; |
| 62 intptr_t prev_token_pos; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(CodeSourceMapBuilder); |
| 65 }; |
| 66 |
| 67 |
45 class StackmapTableBuilder : public ZoneAllocated { | 68 class StackmapTableBuilder : public ZoneAllocated { |
46 public: | 69 public: |
47 StackmapTableBuilder() | 70 StackmapTableBuilder() |
48 : stack_map_(Stackmap::ZoneHandle()), | 71 : stack_map_(Stackmap::ZoneHandle()), |
49 list_(GrowableObjectArray::ZoneHandle( | 72 list_(GrowableObjectArray::ZoneHandle( |
50 GrowableObjectArray::New(Heap::kOld))) { } | 73 GrowableObjectArray::New(Heap::kOld))) { } |
51 ~StackmapTableBuilder() { } | 74 ~StackmapTableBuilder() { } |
52 | 75 |
53 void AddEntry(intptr_t pc_offset, | 76 void AddEntry(intptr_t pc_offset, |
54 BitmapBuilder* bitmap, | 77 BitmapBuilder* bitmap, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) const; | 159 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) const; |
137 | 160 |
138 private: | 161 private: |
139 GrowableArray<struct HandlerDesc> list_; | 162 GrowableArray<struct HandlerDesc> list_; |
140 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 163 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
141 }; | 164 }; |
142 | 165 |
143 } // namespace dart | 166 } // namespace dart |
144 | 167 |
145 #endif // VM_CODE_DESCRIPTORS_H_ | 168 #endif // VM_CODE_DESCRIPTORS_H_ |
OLD | NEW |