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

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

Issue 324843004: Significantly improve performance of code coverage tool by precomputing a map token_pos->line numbe… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/vm/object.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 Script& script = Script::Handle(); 81 Script& script = Script::Handle();
82 String& saved_url = String::Handle(); 82 String& saved_url = String::Handle();
83 String& url = String::Handle(); 83 String& url = String::Handle();
84 84
85 int i = 0; 85 int i = 0;
86 while (i < functions.Length()) { 86 while (i < functions.Length()) {
87 HANDLESCOPE(isolate); 87 HANDLESCOPE(isolate);
88 function ^= functions.At(i); 88 function ^= functions.At(i);
89 JSONObject jsobj(&jsarr); 89 JSONObject jsobj(&jsarr);
90 script = function.script(); 90 script = function.script();
91 // Makes token_pos to line-number lookup faster.
92 script.ComputeTokenPosToLineNumberArray();
Ivan Posva 2014/06/10 00:14:58 As discussed we might want to cache this array onl
91 saved_url = script.url(); 93 saved_url = script.url();
92 jsobj.AddProperty("source", saved_url.ToCString()); 94 jsobj.AddProperty("source", saved_url.ToCString());
93 jsobj.AddProperty("script", script); 95 jsobj.AddProperty("script", script);
94 JSONArray hits_arr(&jsobj, "hits"); 96 JSONArray hits_arr(&jsobj, "hits");
95 97
96 // We stay within this loop while we are seeing functions from the same 98 // We stay within this loop while we are seeing functions from the same
97 // source URI. 99 // source URI.
98 while (i < functions.Length()) { 100 while (i < functions.Length()) {
99 function ^= functions.At(i); 101 function ^= functions.At(i);
100 script = function.script(); 102 script = function.script();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // functions. 198 // functions.
197 PrintClass(cls, jsarr); 199 PrintClass(cls, jsarr);
198 } 200 }
199 } 201 }
200 } 202 }
201 } 203 }
202 } 204 }
203 205
204 206
205 } // namespace dart 207 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698