Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |