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

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

Issue 403643002: One more iteration of PcDescriptor iterator improvement: do not copy record but access individual … (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_test.cc ('k') | runtime/vm/debugger.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/coverage.h" 5 #include "vm/coverage.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 const PcDescriptors& descriptors = PcDescriptors::Handle( 86 const PcDescriptors& descriptors = PcDescriptors::Handle(
87 code.pc_descriptors()); 87 code.pc_descriptors());
88 88
89 const intptr_t begin_pos = function.token_pos(); 89 const intptr_t begin_pos = function.token_pos();
90 const intptr_t end_pos = function.end_token_pos(); 90 const intptr_t end_pos = function.end_token_pos();
91 intptr_t last_line = -1; 91 intptr_t last_line = -1;
92 intptr_t last_count = 0; 92 intptr_t last_count = 0;
93 // Only IC based calls have counting. 93 // Only IC based calls have counting.
94 PcDescriptors::Iterator iter(descriptors, 94 PcDescriptors::Iterator iter(descriptors,
95 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); 95 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall);
96 while (iter.HasNext()) { 96 while (iter.MoveNext()) {
97 HANDLESCOPE(isolate); 97 HANDLESCOPE(isolate);
98 RawPcDescriptors::PcDescriptorRec rec; 98 const ICData* ic_data = (*ic_data_array)[iter.DeoptId()];
99 iter.NextRec(&rec);
100 const ICData* ic_data = (*ic_data_array)[rec.deopt_id()];
101 if (!ic_data->IsNull()) { 99 if (!ic_data->IsNull()) {
102 const intptr_t token_pos = rec.token_pos(); 100 const intptr_t token_pos = iter.TokenPos();
103 // Filter out descriptors that do not map to tokens in the source code. 101 // Filter out descriptors that do not map to tokens in the source code.
104 if ((token_pos < begin_pos) || (token_pos > end_pos)) { 102 if ((token_pos < begin_pos) || (token_pos > end_pos)) {
105 continue; 103 continue;
106 } 104 }
107 intptr_t line = pos_to_line[token_pos]; 105 intptr_t line = pos_to_line[token_pos];
108 #if defined(DEBUG) 106 #if defined(DEBUG)
109 const Script& script = Script::Handle(function.script()); 107 const Script& script = Script::Handle(function.script());
110 intptr_t test_line = -1; 108 intptr_t test_line = -1;
111 script.GetTokenLocation(token_pos, &test_line, NULL); 109 script.GetTokenLocation(token_pos, &test_line, NULL);
112 ASSERT(test_line == line); 110 ASSERT(test_line == line);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 cls = it.GetNextClass(); 281 cls = it.GetNextClass();
284 ASSERT(!cls.IsNull()); 282 ASSERT(!cls.IsNull());
285 PrintClass(lib, cls, jsarr, filter); 283 PrintClass(lib, cls, jsarr, filter);
286 } 284 }
287 } 285 }
288 } 286 }
289 } 287 }
290 288
291 289
292 } // namespace dart 290 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698