Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: runtime/vm/code_descriptors.cc

Issue 382993003: More PcDescriptor cleanups. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_descriptors.h ('k') | runtime/vm/code_descriptors_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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(RawPcDescriptors::Kind kind, 9 void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind,
10 intptr_t pc_offset, 10 intptr_t pc_offset,
11 intptr_t deopt_id, 11 intptr_t deopt_id,
12 intptr_t token_index, 12 intptr_t token_index,
13 intptr_t try_index) { 13 intptr_t try_index) {
14 struct PcDesc data; 14 struct PcDesc data;
15 data.pc_offset = pc_offset; 15 data.pc_offset = pc_offset;
16 data.kind = kind; 16 data.kind = kind;
17 data.deopt_id = deopt_id; 17 data.deopt_id = deopt_id;
18 data.SetTokenPos(token_index); 18 data.SetTokenPos(token_index);
19 data.try_index = try_index; 19 data.try_index = try_index;
20 list_.Add(data); 20 list_.Add(data);
21 if (try_index >= 0) {
22 has_try_index_ = true;
23 }
21 } 24 }
22 25
23 26
24 RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) { 27 RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) {
25 intptr_t num_descriptors = Length(); 28 intptr_t num_descriptors = Length();
26 const PcDescriptors& descriptors = 29 const PcDescriptors& descriptors =
27 PcDescriptors::Handle(PcDescriptors::New(num_descriptors)); 30 PcDescriptors::Handle(PcDescriptors::New(num_descriptors,
31 has_try_index_));
28 for (intptr_t i = 0; i < num_descriptors; i++) { 32 for (intptr_t i = 0; i < num_descriptors; i++) {
29 descriptors.AddDescriptor(i, 33 descriptors.AddDescriptor(i,
30 (entry_point + PcOffset(i)), 34 (entry_point + PcOffset(i)),
31 Kind(i), 35 Kind(i),
32 DeoptId(i), 36 DeoptId(i),
33 TokenPos(i), 37 TokenPos(i),
34 TryIndex(i)); 38 TryIndex(i));
35 } 39 }
36 return descriptors.raw(); 40 return descriptors.raw();
37 } 41 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 80 }
77 81
78 82
79 RawStackmap* StackmapTableBuilder::MapAt(intptr_t index) const { 83 RawStackmap* StackmapTableBuilder::MapAt(intptr_t index) const {
80 Stackmap& map = Stackmap::Handle(); 84 Stackmap& map = Stackmap::Handle();
81 map ^= list_.At(index); 85 map ^= list_.At(index);
82 return map.raw(); 86 return map.raw();
83 } 87 }
84 88
85 } // namespace dart 89 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_descriptors.h ('k') | runtime/vm/code_descriptors_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698