| 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 #include "vm/code_descriptors.h" | 5 #include "vm/code_descriptors.h" |
| 6 #include "vm/compiler.h" | 6 #include "vm/compiler.h" |
| 7 | 7 |
| 8 namespace dart { | 8 namespace dart { |
| 9 | 9 |
| 10 void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind, | 10 void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 | 35 |
| 36 RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) { | 36 RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) { |
| 37 if (encoded_data_.length() == 0) { | 37 if (encoded_data_.length() == 0) { |
| 38 return Object::empty_descriptors().raw(); | 38 return Object::empty_descriptors().raw(); |
| 39 } | 39 } |
| 40 return PcDescriptors::New(&encoded_data_); | 40 return PcDescriptors::New(&encoded_data_); |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 |
| 45 void CodeSourceMapBuilder::AddEntry(intptr_t pc_offset, |
| 46 intptr_t token_pos) { |
| 47 CodeSourceMap::EncodeInteger(&encoded_data_, pc_offset - prev_pc_offset); |
| 48 CodeSourceMap::EncodeInteger(&encoded_data_, token_pos - prev_token_pos); |
| 49 |
| 50 prev_pc_offset = pc_offset; |
| 51 prev_token_pos = token_pos; |
| 52 } |
| 53 |
| 54 |
| 55 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() { |
| 56 return CodeSourceMap::New(&encoded_data_); |
| 57 } |
| 58 |
| 59 |
| 44 void StackmapTableBuilder::AddEntry(intptr_t pc_offset, | 60 void StackmapTableBuilder::AddEntry(intptr_t pc_offset, |
| 45 BitmapBuilder* bitmap, | 61 BitmapBuilder* bitmap, |
| 46 intptr_t register_bit_count) { | 62 intptr_t register_bit_count) { |
| 47 stack_map_ = Stackmap::New(pc_offset, bitmap, register_bit_count); | 63 stack_map_ = Stackmap::New(pc_offset, bitmap, register_bit_count); |
| 48 list_.Add(stack_map_, Heap::kOld); | 64 list_.Add(stack_map_, Heap::kOld); |
| 49 } | 65 } |
| 50 | 66 |
| 51 | 67 |
| 52 bool StackmapTableBuilder::Verify() { | 68 bool StackmapTableBuilder::Verify() { |
| 53 intptr_t num_entries = Length(); | 69 intptr_t num_entries = Length(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 list_[i].needs_stacktrace, | 129 list_[i].needs_stacktrace, |
| 114 has_catch_all); | 130 has_catch_all); |
| 115 handlers.SetHandledTypes(i, *list_[i].handler_types); | 131 handlers.SetHandledTypes(i, *list_[i].handler_types); |
| 116 } | 132 } |
| 117 } | 133 } |
| 118 return handlers.raw(); | 134 return handlers.raw(); |
| 119 } | 135 } |
| 120 | 136 |
| 121 | 137 |
| 122 } // namespace dart | 138 } // namespace dart |
| OLD | NEW |