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 13722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13733 return zone->PrintToString("Code entry:%" Px, EntryPoint()); | 13733 return zone->PrintToString("Code entry:%" Px, EntryPoint()); |
13734 } | 13734 } |
13735 } | 13735 } |
13736 | 13736 |
13737 | 13737 |
13738 RawString* Code::Name() const { | 13738 RawString* Code::Name() const { |
13739 const Object& obj = Object::Handle(owner()); | 13739 const Object& obj = Object::Handle(owner()); |
13740 if (obj.IsNull()) { | 13740 if (obj.IsNull()) { |
13741 // Regular stub. | 13741 // Regular stub. |
13742 Thread* thread = Thread::Current(); | 13742 Thread* thread = Thread::Current(); |
13743 Zone* zone = thread->zone(); | |
13744 const char* name = StubCode::NameOfStub(EntryPoint()); | 13743 const char* name = StubCode::NameOfStub(EntryPoint()); |
13745 ASSERT(name != NULL); | 13744 ASSERT(name != NULL); |
13746 const String& stub_name = String::Handle(zone, String::New(name)); | 13745 const String& stub_name = String::Handle(Symbols::New(thread, name)); |
13747 return Symbols::FromConcat(thread, Symbols::StubPrefix(), stub_name); | 13746 return Symbols::FromConcat(thread, Symbols::StubPrefix(), stub_name); |
siva
2016/04/13 20:29:48
Why not do:
char* stub_name = OS::Screate(zone, "
srdjan
2016/04/13 20:38:16
Done.
| |
13748 } else if (obj.IsClass()) { | 13747 } else if (obj.IsClass()) { |
13749 // Allocation stub. | 13748 // Allocation stub. |
13750 Thread* thread = Thread::Current(); | 13749 Thread* thread = Thread::Current(); |
13751 Zone* zone = thread->zone(); | 13750 Zone* zone = thread->zone(); |
13752 const Class& cls = Class::Cast(obj); | 13751 const Class& cls = Class::Cast(obj); |
13753 String& cls_name = String::Handle(zone, cls.ScrubbedName()); | 13752 String& cls_name = String::Handle(zone, cls.ScrubbedName()); |
13754 ASSERT(!cls_name.IsNull()); | 13753 ASSERT(!cls_name.IsNull()); |
13755 return Symbols::FromConcat(thread, Symbols::AllocationStubFor(), cls_name); | 13754 return Symbols::FromConcat(thread, Symbols::AllocationStubFor(), cls_name); |
13756 } else { | 13755 } else { |
13757 ASSERT(obj.IsFunction()); | 13756 ASSERT(obj.IsFunction()); |
(...skipping 8264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
22022 return UserTag::null(); | 22021 return UserTag::null(); |
22023 } | 22022 } |
22024 | 22023 |
22025 | 22024 |
22026 const char* UserTag::ToCString() const { | 22025 const char* UserTag::ToCString() const { |
22027 const String& tag_label = String::Handle(label()); | 22026 const String& tag_label = String::Handle(label()); |
22028 return tag_label.ToCString(); | 22027 return tag_label.ToCString(); |
22029 } | 22028 } |
22030 | 22029 |
22031 } // namespace dart | 22030 } // namespace dart |
OLD | NEW |