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

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') | runtime/vm/compiler.cc » ('J')
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 DECLARE_FLAG(bool, precompilation); 9 DECLARE_FLAG(bool, precompilation);
10 10
(...skipping 28 matching lines...) Expand all
39 if (encoded_data_.length() == 0) { 39 if (encoded_data_.length() == 0) {
40 return Object::empty_descriptors().raw(); 40 return Object::empty_descriptors().raw();
41 } 41 }
42 return PcDescriptors::New(&encoded_data_); 42 return PcDescriptors::New(&encoded_data_);
43 } 43 }
44 44
45 45
46 46
47 void CodeSourceMapBuilder::AddEntry(intptr_t pc_offset, 47 void CodeSourceMapBuilder::AddEntry(intptr_t pc_offset,
48 TokenPosition token_pos) { 48 TokenPosition token_pos) {
49 // Require pc offset to monotonically increase.
50 ASSERT((prev_pc_offset < pc_offset) ||
51 ((prev_pc_offset == 0) && (pc_offset == 0)));
49 CodeSourceMap::EncodeInteger(&encoded_data_, pc_offset - prev_pc_offset); 52 CodeSourceMap::EncodeInteger(&encoded_data_, pc_offset - prev_pc_offset);
50 CodeSourceMap::EncodeInteger(&encoded_data_, 53 CodeSourceMap::EncodeInteger(&encoded_data_,
51 token_pos.value() - prev_token_pos); 54 token_pos.value() - prev_token_pos);
52 55
53 prev_pc_offset = pc_offset; 56 prev_pc_offset = pc_offset;
54 prev_token_pos = token_pos.value(); 57 prev_token_pos = token_pos.value();
55 } 58 }
56 59
57 60
58 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() { 61 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 list_[i].needs_stacktrace, 135 list_[i].needs_stacktrace,
133 has_catch_all); 136 has_catch_all);
134 handlers.SetHandledTypes(i, *list_[i].handler_types); 137 handlers.SetHandledTypes(i, *list_[i].handler_types);
135 } 138 }
136 } 139 }
137 return handlers.raw(); 140 return handlers.raw();
138 } 141 }
139 142
140 143
141 } // namespace dart 144 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | runtime/vm/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698