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

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

Issue 346003003: vmservice: Add /coverage collection to scripts, classes and libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: exclude service_classescoverage from simmips tests 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 8289 matching lines...) Expand 10 before | Expand all | Expand 10 after
8300 break; 8300 break;
8301 } 8301 }
8302 const Smi& smi = Smi::Cast(value); 8302 const Smi& smi = Smi::Cast(value);
8303 lineInfo.AddValue(smi.Value()); 8303 lineInfo.AddValue(smi.Value());
8304 } 8304 }
8305 } 8305 }
8306 } 8306 }
8307 } 8307 }
8308 8308
8309 8309
8310 RawLibrary* Script::FindLibrary() const {
8311 Isolate* isolate = Isolate::Current();
8312 const GrowableObjectArray& libs = GrowableObjectArray::Handle(
8313 isolate, isolate->object_store()->libraries());
8314 Library& lib = Library::Handle();
8315 Script& script = Script::Handle();
8316 for (intptr_t i = 0; i < libs.Length(); i++) {
8317 lib ^= libs.At(i);
8318 ASSERT(!lib.IsNull());
8319 const Array& loaded_scripts = Array::Handle(lib.LoadedScripts());
8320 ASSERT(!loaded_scripts.IsNull());
8321 for (intptr_t j = 0; j < loaded_scripts.Length(); j++) {
8322 script ^= loaded_scripts.At(j);
8323 ASSERT(!script.IsNull());
8324 if (script.raw() == raw()) {
8325 return lib.raw();
Ivan Posva 2014/06/26 10:14:33 How does this work for scripts that have been incl
8326 }
8327 }
8328 }
8329 return Library::null();
8330 }
8331
8332
8333 RawScript* Script::FindByUrl(const String& url) {
8334 Isolate* isolate = Isolate::Current();
8335 const GrowableObjectArray& libs = GrowableObjectArray::Handle(
8336 isolate, isolate->object_store()->libraries());
8337 Library& lib = Library::Handle();
8338 Script& script = Script::Handle();
8339 String& script_url = String::Handle();
8340 for (intptr_t i = 0; i < libs.Length(); i++) {
8341 lib ^= libs.At(i);
8342 ASSERT(!lib.IsNull());
8343 const Array& loaded_scripts = Array::Handle(lib.LoadedScripts());
8344 ASSERT(!loaded_scripts.IsNull());
8345 for (intptr_t j = 0; j < loaded_scripts.Length(); j++) {
8346 script ^= loaded_scripts.At(j);
8347 ASSERT(!script.IsNull());
8348 script_url ^= script.url();
8349 if (script_url.Equals(url)) {
8350 return script.raw();
8351 }
8352 }
8353 }
8354 return Script::null();
8355 }
8356
8357
8310 DictionaryIterator::DictionaryIterator(const Library& library) 8358 DictionaryIterator::DictionaryIterator(const Library& library)
8311 : array_(Array::Handle(library.dictionary())), 8359 : array_(Array::Handle(library.dictionary())),
8312 // Last element in array is a Smi indicating the number of entries used. 8360 // Last element in array is a Smi indicating the number of entries used.
8313 size_(Array::Handle(library.dictionary()).Length() - 1), 8361 size_(Array::Handle(library.dictionary()).Length() - 1),
8314 next_ix_(0) { 8362 next_ix_(0) {
8315 MoveToNextObject(); 8363 MoveToNextObject();
8316 } 8364 }
8317 8365
8318 8366
8319 RawObject* DictionaryIterator::GetNext() { 8367 RawObject* DictionaryIterator::GetNext() {
(...skipping 10759 matching lines...) Expand 10 before | Expand all | Expand 10 after
19079 return tag_label.ToCString(); 19127 return tag_label.ToCString();
19080 } 19128 }
19081 19129
19082 19130
19083 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19131 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19084 Instance::PrintJSONImpl(stream, ref); 19132 Instance::PrintJSONImpl(stream, ref);
19085 } 19133 }
19086 19134
19087 19135
19088 } // namespace dart 19136 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | runtime/vm/service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698