| 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 10983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10994 return chars; | 10994 return chars; |
| 10995 } | 10995 } |
| 10996 | 10996 |
| 10997 | 10997 |
| 10998 RawString* Code::Name() const { | 10998 RawString* Code::Name() const { |
| 10999 const Object& obj = Object::Handle(owner()); | 10999 const Object& obj = Object::Handle(owner()); |
| 11000 if (obj.IsNull()) { | 11000 if (obj.IsNull()) { |
| 11001 // Regular stub. | 11001 // Regular stub. |
| 11002 const char* name = StubCode::NameOfStub(EntryPoint()); | 11002 const char* name = StubCode::NameOfStub(EntryPoint()); |
| 11003 ASSERT(name != NULL); | 11003 ASSERT(name != NULL); |
| 11004 return String::New(name); | 11004 const String& stub_name = String::Handle(String::New(name)); |
| 11005 return String::Concat(Symbols::StubPrefix(), stub_name); |
| 11005 } else if (obj.IsClass()) { | 11006 } else if (obj.IsClass()) { |
| 11006 // Allocation stub. | 11007 // Allocation stub. |
| 11007 const Class& cls = Class::Cast(obj); | 11008 const Class& cls = Class::Cast(obj); |
| 11008 String& cls_name = String::Handle(cls.Name()); | 11009 String& cls_name = String::Handle(cls.Name()); |
| 11009 ASSERT(!cls_name.IsNull()); | 11010 ASSERT(!cls_name.IsNull()); |
| 11010 return String::Concat(Symbols::AllocationStubFor(), cls_name); | 11011 return String::Concat(Symbols::AllocationStubFor(), cls_name); |
| 11011 } else { | 11012 } else { |
| 11012 ASSERT(obj.IsFunction()); | 11013 ASSERT(obj.IsFunction()); |
| 11013 // Dart function. | 11014 // Dart function. |
| 11014 return Function::Cast(obj).name(); | 11015 return Function::Cast(obj).name(); |
| 11015 } | 11016 } |
| 11016 } | 11017 } |
| 11017 | 11018 |
| 11018 | 11019 |
| 11019 RawString* Code::UserName() const { | 11020 RawString* Code::UserName() const { |
| 11020 const Object& obj = Object::Handle(owner()); | 11021 const Object& obj = Object::Handle(owner()); |
| 11021 if (obj.IsNull()) { | 11022 if (obj.IsNull()) { |
| 11022 // Regular stub. | 11023 // Regular stub. |
| 11023 const char* name = StubCode::NameOfStub(EntryPoint()); | 11024 const char* name = StubCode::NameOfStub(EntryPoint()); |
| 11024 ASSERT(name != NULL); | 11025 ASSERT(name != NULL); |
| 11025 return String::New(name); | 11026 const String& stub_name = String::Handle(String::New(name)); |
| 11027 return String::Concat(Symbols::StubPrefix(), stub_name); |
| 11026 } else if (obj.IsClass()) { | 11028 } else if (obj.IsClass()) { |
| 11027 // Allocation stub. | 11029 // Allocation stub. |
| 11028 const Class& cls = Class::Cast(obj); | 11030 const Class& cls = Class::Cast(obj); |
| 11029 String& cls_name = String::Handle(cls.Name()); | 11031 String& cls_name = String::Handle(cls.Name()); |
| 11030 ASSERT(!cls_name.IsNull()); | 11032 ASSERT(!cls_name.IsNull()); |
| 11031 return String::Concat(Symbols::AllocationStubFor(), cls_name); | 11033 return String::Concat(Symbols::AllocationStubFor(), cls_name); |
| 11032 } else { | 11034 } else { |
| 11033 ASSERT(obj.IsFunction()); | 11035 ASSERT(obj.IsFunction()); |
| 11034 // Dart function. | 11036 // Dart function. |
| 11035 return Function::Cast(obj).QualifiedUserVisibleName(); | 11037 return Function::Cast(obj).QualifiedUserVisibleName(); |
| (...skipping 7424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18460 return tag_label.ToCString(); | 18462 return tag_label.ToCString(); |
| 18461 } | 18463 } |
| 18462 | 18464 |
| 18463 | 18465 |
| 18464 void UserTag::PrintToJSONStream(JSONStream* stream, bool ref) const { | 18466 void UserTag::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 18465 Instance::PrintToJSONStream(stream, ref); | 18467 Instance::PrintToJSONStream(stream, ref); |
| 18466 } | 18468 } |
| 18467 | 18469 |
| 18468 | 18470 |
| 18469 } // namespace dart | 18471 } // namespace dart |
| OLD | NEW |