| OLD | NEW |
| 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 4211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4222 const Library& lib = Library::Handle(isolate, library()); | 4222 const Library& lib = Library::Handle(isolate, library()); |
| 4223 const Object& obj = Object::Handle(isolate, lib.LookupLocalObject(name)); | 4223 const Object& obj = Object::Handle(isolate, lib.LookupLocalObject(name)); |
| 4224 if (!obj.IsNull() && obj.IsLibraryPrefix()) { | 4224 if (!obj.IsNull() && obj.IsLibraryPrefix()) { |
| 4225 return LibraryPrefix::Cast(obj).raw(); | 4225 return LibraryPrefix::Cast(obj).raw(); |
| 4226 } | 4226 } |
| 4227 return LibraryPrefix::null(); | 4227 return LibraryPrefix::null(); |
| 4228 } | 4228 } |
| 4229 | 4229 |
| 4230 | 4230 |
| 4231 const char* Class::ToCString() const { | 4231 const char* Class::ToCString() const { |
| 4232 const char* format = "%s Class: %s"; | 4232 const char* format = "%s %sClass: %s"; |
| 4233 const Library& lib = Library::Handle(library()); | 4233 const Library& lib = Library::Handle(library()); |
| 4234 const char* library_name = lib.IsNull() ? "" : lib.ToCString(); | 4234 const char* library_name = lib.IsNull() ? "" : lib.ToCString(); |
| 4235 const char* patch_prefix = is_patch() ? "Patch " : ""; |
| 4235 const char* class_name = String::Handle(Name()).ToCString(); | 4236 const char* class_name = String::Handle(Name()).ToCString(); |
| 4236 intptr_t len = OS::SNPrint(NULL, 0, format, library_name, class_name) + 1; | 4237 intptr_t len = |
| 4238 OS::SNPrint(NULL, 0, format, library_name, patch_prefix, class_name) + 1; |
| 4237 char* chars = Thread::Current()->zone()->Alloc<char>(len); | 4239 char* chars = Thread::Current()->zone()->Alloc<char>(len); |
| 4238 OS::SNPrint(chars, len, format, library_name, class_name); | 4240 OS::SNPrint(chars, len, format, library_name, patch_prefix, class_name); |
| 4239 return chars; | 4241 return chars; |
| 4240 } | 4242 } |
| 4241 | 4243 |
| 4242 | 4244 |
| 4243 void Class::PrintJSONImpl(JSONStream* stream, bool ref) const { | 4245 void Class::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 4244 Isolate* isolate = Isolate::Current(); | 4246 Isolate* isolate = Isolate::Current(); |
| 4245 JSONObject jsobj(stream); | 4247 JSONObject jsobj(stream); |
| 4246 if ((raw() == Class::null()) || (id() == kFreeListElement)) { | 4248 if ((raw() == Class::null()) || (id() == kFreeListElement)) { |
| 4247 // TODO(turnidge): This is weird and needs to be changed. | 4249 // TODO(turnidge): This is weird and needs to be changed. |
| 4248 jsobj.AddProperty("type", "null"); | 4250 jsobj.AddProperty("type", "null"); |
| (...skipping 17259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21508 return tag_label.ToCString(); | 21510 return tag_label.ToCString(); |
| 21509 } | 21511 } |
| 21510 | 21512 |
| 21511 | 21513 |
| 21512 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21514 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21513 Instance::PrintJSONImpl(stream, ref); | 21515 Instance::PrintJSONImpl(stream, ref); |
| 21514 } | 21516 } |
| 21515 | 21517 |
| 21516 | 21518 |
| 21517 } // namespace dart | 21519 } // namespace dart |
| OLD | NEW |