| 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 | 6 |
| 7 namespace dart { | 7 namespace dart { |
| 8 | 8 |
| 9 void DescriptorList::AddDescriptor(PcDescriptors::Kind kind, | 9 void DescriptorList::AddDescriptor(PcDescriptors::Kind kind, |
| 10 intptr_t pc_offset, | 10 intptr_t pc_offset, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 return true; | 74 return true; |
| 75 } | 75 } |
| 76 | 76 |
| 77 | 77 |
| 78 RawArray* StackmapTableBuilder::FinalizeStackmaps(const Code& code) { | 78 RawArray* StackmapTableBuilder::FinalizeStackmaps(const Code& code) { |
| 79 ASSERT(Verify()); | 79 ASSERT(Verify()); |
| 80 intptr_t num_entries = Length(); | 80 intptr_t num_entries = Length(); |
| 81 uword entry_point = code.EntryPoint(); | 81 uword entry_point = code.EntryPoint(); |
| 82 if (num_entries == 0) { | 82 if (num_entries == 0) { |
| 83 return Array::Empty(); | 83 return Object::empty_array(); |
| 84 } | 84 } |
| 85 for (intptr_t i = 0; i < num_entries; i++) { | 85 for (intptr_t i = 0; i < num_entries; i++) { |
| 86 stack_map_ = Map(i); | 86 stack_map_ = Map(i); |
| 87 stack_map_.SetPC(entry_point + stack_map_.PC()); | 87 stack_map_.SetPC(entry_point + stack_map_.PC()); |
| 88 stack_map_.SetCode(code); | 88 stack_map_.SetCode(code); |
| 89 } | 89 } |
| 90 return Array::MakeArray(list_); | 90 return Array::MakeArray(list_); |
| 91 } | 91 } |
| 92 | 92 |
| 93 | 93 |
| 94 RawStackmap* StackmapTableBuilder::Map(int index) const { | 94 RawStackmap* StackmapTableBuilder::Map(int index) const { |
| 95 Stackmap& map = Stackmap::Handle(); | 95 Stackmap& map = Stackmap::Handle(); |
| 96 map ^= list_.At(index); | 96 map ^= list_.At(index); |
| 97 return map.raw(); | 97 return map.raw(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace dart | 100 } // namespace dart |
| OLD | NEW |