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

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

Issue 1740503002: Build CodeSourceMap for each code object (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | runtime/vm/compiler.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,
(...skipping 26 matching lines...) Expand all
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 44
45 void CodeSourceMapBuilder::AddEntry(intptr_t pc_offset, 45 void CodeSourceMapBuilder::AddEntry(intptr_t pc_offset,
46 TokenPosition token_pos) { 46 TokenPosition token_pos) {
47 // Require pc offset to monotonically increase.
48 ASSERT((prev_pc_offset < pc_offset) ||
49 ((prev_pc_offset == 0) && (pc_offset == 0)));
47 CodeSourceMap::EncodeInteger(&encoded_data_, pc_offset - prev_pc_offset); 50 CodeSourceMap::EncodeInteger(&encoded_data_, pc_offset - prev_pc_offset);
48 CodeSourceMap::EncodeInteger(&encoded_data_, 51 CodeSourceMap::EncodeInteger(&encoded_data_,
49 token_pos.value() - prev_token_pos); 52 token_pos.value() - prev_token_pos);
50 53
51 prev_pc_offset = pc_offset; 54 prev_pc_offset = pc_offset;
52 prev_token_pos = token_pos.value(); 55 prev_token_pos = token_pos.value();
53 } 56 }
54 57
55 58
56 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() { 59 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 list_[i].needs_stacktrace, 133 list_[i].needs_stacktrace,
131 has_catch_all); 134 has_catch_all);
132 handlers.SetHandledTypes(i, *list_[i].handler_types); 135 handlers.SetHandledTypes(i, *list_[i].handler_types);
133 } 136 }
134 } 137 }
135 return handlers.raw(); 138 return handlers.raw();
136 } 139 }
137 140
138 141
139 } // namespace dart 142 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698