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

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

Issue 351373002: Coverage API revamp (Closed) Base URL: https://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 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();
8326 }
8327 }
8328 }
8329 return Library::null();
8330 }
8331
8332
8333 RawScript* Script::FindByUrl(const String& url) { 8310 RawScript* Script::FindByUrl(const String& url) {
8334 Isolate* isolate = Isolate::Current(); 8311 Isolate* isolate = Isolate::Current();
8335 const GrowableObjectArray& libs = GrowableObjectArray::Handle( 8312 const GrowableObjectArray& libs = GrowableObjectArray::Handle(
8336 isolate, isolate->object_store()->libraries()); 8313 isolate, isolate->object_store()->libraries());
8337 Library& lib = Library::Handle(); 8314 Library& lib = Library::Handle();
8338 Script& script = Script::Handle(); 8315 Script& script = Script::Handle();
8339 String& script_url = String::Handle(); 8316 String& script_url = String::Handle();
8340 for (intptr_t i = 0; i < libs.Length(); i++) { 8317 for (intptr_t i = 0; i < libs.Length(); i++) {
8341 lib ^= libs.At(i); 8318 lib ^= libs.At(i);
8342 ASSERT(!lib.IsNull()); 8319 ASSERT(!lib.IsNull());
(...skipping 10741 matching lines...) Expand 10 before | Expand all | Expand 10 after
19084 return tag_label.ToCString(); 19061 return tag_label.ToCString();
19085 } 19062 }
19086 19063
19087 19064
19088 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19065 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19089 Instance::PrintJSONImpl(stream, ref); 19066 Instance::PrintJSONImpl(stream, ref);
19090 } 19067 }
19091 19068
19092 19069
19093 } // namespace dart 19070 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698