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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 | 138 |
139 void CodeCoverage::PrintClass(const Library& lib, | 139 void CodeCoverage::PrintClass(const Library& lib, |
140 const Class& cls, | 140 const Class& cls, |
141 const JSONArray& jsarr, | 141 const JSONArray& jsarr, |
142 CoverageFilter* filter, | 142 CoverageFilter* filter, |
143 bool as_call_sites) { | 143 bool as_call_sites) { |
144 Thread* thread = Thread::Current(); | 144 Thread* thread = Thread::Current(); |
145 Isolate* isolate = thread->isolate(); | 145 if (cls.EnsureIsFinalized(thread) != Error::null()) { |
146 if (cls.EnsureIsFinalized(isolate) != Error::null()) { | |
147 // Only classes that have been finalized do have a meaningful list of | 146 // Only classes that have been finalized do have a meaningful list of |
148 // functions. | 147 // functions. |
149 return; | 148 return; |
150 } | 149 } |
151 Array& functions = Array::Handle(cls.functions()); | 150 Array& functions = Array::Handle(cls.functions()); |
152 ASSERT(!functions.IsNull()); | 151 ASSERT(!functions.IsNull()); |
153 Function& function = Function::Handle(); | 152 Function& function = Function::Handle(); |
154 Script& script = Script::Handle(); | 153 Script& script = Script::Handle(); |
155 String& saved_url = String::Handle(); | 154 String& saved_url = String::Handle(); |
156 String& url = String::Handle(); | 155 String& url = String::Handle(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 cls = it.GetNextClass(); | 283 cls = it.GetNextClass(); |
285 ASSERT(!cls.IsNull()); | 284 ASSERT(!cls.IsNull()); |
286 PrintClass(lib, cls, jsarr, filter, as_call_sites); | 285 PrintClass(lib, cls, jsarr, filter, as_call_sites); |
287 } | 286 } |
288 } | 287 } |
289 } | 288 } |
290 } | 289 } |
291 | 290 |
292 | 291 |
293 } // namespace dart | 292 } // namespace dart |
OLD | NEW |