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

Unified Diff: runtime/vm/coverage.cc

Issue 356923006: Iterate over PcDescriptors only via iterators, not via an index. (preparation for more compression … (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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/coverage.cc
===================================================================
--- runtime/vm/coverage.cc (revision 38030)
+++ runtime/vm/coverage.cc (working copy)
@@ -90,16 +90,18 @@
const intptr_t end_pos = function.end_token_pos();
intptr_t last_line = -1;
intptr_t last_count = 0;
- for (int j = 0; j < descriptors.Length(); j++) {
+ PcDescriptors::Iterator iter(descriptors);
+ while (iter.HasNext()) {
HANDLESCOPE(isolate);
- PcDescriptors::Kind kind = descriptors.DescriptorKind(j);
+ const RawPcDescriptors::PcDescriptorRec& rec = iter.Next();
+ RawPcDescriptors::Kind kind = rec.kind();
// Only IC based calls have counting.
- if ((kind == PcDescriptors::kIcCall) ||
- (kind == PcDescriptors::kUnoptStaticCall)) {
- intptr_t deopt_id = descriptors.DeoptId(j);
+ if ((kind == RawPcDescriptors::kIcCall) ||
+ (kind == RawPcDescriptors::kUnoptStaticCall)) {
+ intptr_t deopt_id = rec.deopt_id;
const ICData* ic_data= (*ic_data_array)[deopt_id];
if (!ic_data->IsNull()) {
- intptr_t token_pos = descriptors.TokenPos(j);
+ intptr_t token_pos = rec.token_pos;
// Filter out descriptors that do not map to tokens in the source code.
if (token_pos < begin_pos ||
token_pos > end_pos) {

Powered by Google App Engine
This is Rietveld 408576698