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

Side by Side Diff: runtime/vm/coverage.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_test.cc ('k') | runtime/vm/debugger.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) 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.HasNext()) {
97 HANDLESCOPE(isolate); 97 HANDLESCOPE(isolate);
98 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); 98 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next();
99 intptr_t deopt_id = rec.deopt_id; 99 intptr_t deopt_id = rec.deopt_id();
100 const ICData* ic_data = (*ic_data_array)[deopt_id]; 100 const ICData* ic_data = (*ic_data_array)[deopt_id];
101 if (!ic_data->IsNull()) { 101 if (!ic_data->IsNull()) {
102 intptr_t token_pos = rec.token_pos; 102 intptr_t token_pos = rec.token_pos();
103 // Filter out descriptors that do not map to tokens in the source code. 103 // Filter out descriptors that do not map to tokens in the source code.
104 if ((token_pos < begin_pos) || (token_pos > end_pos)) { 104 if ((token_pos < begin_pos) || (token_pos > end_pos)) {
105 continue; 105 continue;
106 } 106 }
107 intptr_t line = pos_to_line[token_pos]; 107 intptr_t line = pos_to_line[token_pos];
108 #if defined(DEBUG) 108 #if defined(DEBUG)
109 const Script& script = Script::Handle(function.script()); 109 const Script& script = Script::Handle(function.script());
110 intptr_t test_line = -1; 110 intptr_t test_line = -1;
111 script.GetTokenLocation(token_pos, &test_line, NULL); 111 script.GetTokenLocation(token_pos, &test_line, NULL);
112 ASSERT(test_line == line); 112 ASSERT(test_line == line);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 cls = it.GetNextClass(); 283 cls = it.GetNextClass();
284 ASSERT(!cls.IsNull()); 284 ASSERT(!cls.IsNull());
285 PrintClass(lib, cls, jsarr, filter); 285 PrintClass(lib, cls, jsarr, filter);
286 } 286 }
287 } 287 }
288 } 288 }
289 } 289 }
290 290
291 291
292 } // namespace dart 292 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698