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/become.h" | 10 #include "vm/become.h" |
(...skipping 14235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14246 | 14246 |
14247 | 14247 |
14248 const char* Code::Name() const { | 14248 const char* Code::Name() const { |
14249 const Object& obj = Object::Handle(owner()); | 14249 const Object& obj = Object::Handle(owner()); |
14250 if (obj.IsNull()) { | 14250 if (obj.IsNull()) { |
14251 // Regular stub. | 14251 // Regular stub. |
14252 Thread* thread = Thread::Current(); | 14252 Thread* thread = Thread::Current(); |
14253 Zone* zone = thread->zone(); | 14253 Zone* zone = thread->zone(); |
14254 const char* name = StubCode::NameOfStub(UncheckedEntryPoint()); | 14254 const char* name = StubCode::NameOfStub(UncheckedEntryPoint()); |
14255 ASSERT(name != NULL); | 14255 ASSERT(name != NULL); |
14256 char* stub_name = | 14256 return OS::SCreate(zone, "[Stub] %s", name); |
14257 OS::SCreate(zone, "%s%s", Symbols::StubPrefix().ToCString(), name); | |
14258 return stub_name; | |
14259 } else if (obj.IsClass()) { | 14257 } else if (obj.IsClass()) { |
14260 // Allocation stub. | 14258 // Allocation stub. |
14261 Thread* thread = Thread::Current(); | 14259 Thread* thread = Thread::Current(); |
14262 Zone* zone = thread->zone(); | 14260 Zone* zone = thread->zone(); |
14263 const Class& cls = Class::Cast(obj); | 14261 const Class& cls = Class::Cast(obj); |
14264 String& cls_name = String::Handle(zone, cls.ScrubbedName()); | 14262 String& cls_name = String::Handle(zone, cls.ScrubbedName()); |
14265 ASSERT(!cls_name.IsNull()); | 14263 ASSERT(!cls_name.IsNull()); |
14266 char* stub_name = | 14264 return OS::SCreate(zone, "[Stub] Allocate %s", cls_name.ToCString()); |
14267 OS::SCreate(zone, "%s%s", Symbols::AllocationStubFor().ToCString(), | |
14268 cls_name.ToCString()); | |
14269 return stub_name; | |
14270 } else { | 14265 } else { |
14271 ASSERT(obj.IsFunction()); | 14266 ASSERT(obj.IsFunction()); |
14272 // Dart function. | 14267 // Dart function. |
14273 // Same as scrubbed name. | 14268 // Same as scrubbed name. |
14274 return String::Handle(Function::Cast(obj).UserVisibleName()).ToCString(); | 14269 return String::Handle(Function::Cast(obj).UserVisibleName()).ToCString(); |
14275 } | 14270 } |
14276 } | 14271 } |
14277 | 14272 |
14278 | 14273 |
14279 const char* Code::QualifiedName() const { | 14274 const char* Code::QualifiedName() const { |
(...skipping 8439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22719 return UserTag::null(); | 22714 return UserTag::null(); |
22720 } | 22715 } |
22721 | 22716 |
22722 | 22717 |
22723 const char* UserTag::ToCString() const { | 22718 const char* UserTag::ToCString() const { |
22724 const String& tag_label = String::Handle(label()); | 22719 const String& tag_label = String::Handle(label()); |
22725 return tag_label.ToCString(); | 22720 return tag_label.ToCString(); |
22726 } | 22721 } |
22727 | 22722 |
22728 } // namespace dart | 22723 } // namespace dart |
OLD | NEW |