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 13780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13791 | 13791 |
13792 | 13792 |
13793 RawString* Code::Name() const { | 13793 RawString* Code::Name() const { |
13794 const Object& obj = Object::Handle(owner()); | 13794 const Object& obj = Object::Handle(owner()); |
13795 if (obj.IsNull()) { | 13795 if (obj.IsNull()) { |
13796 // Regular stub. | 13796 // Regular stub. |
13797 Thread* thread = Thread::Current(); | 13797 Thread* thread = Thread::Current(); |
13798 Zone* zone = thread->zone(); | 13798 Zone* zone = thread->zone(); |
13799 const char* name = StubCode::NameOfStub(EntryPoint()); | 13799 const char* name = StubCode::NameOfStub(EntryPoint()); |
13800 ASSERT(name != NULL); | 13800 ASSERT(name != NULL); |
13801 const String& stub_name = String::Handle(zone, String::New(name)); | 13801 char* stub_name = OS::SCreate(zone, |
13802 return Symbols::FromConcat(thread, Symbols::StubPrefix(), stub_name); | 13802 "%s%s", Symbols::StubPrefix().ToCString(), name); |
| 13803 return Symbols::New(thread, stub_name, strlen(stub_name)); |
13803 } else if (obj.IsClass()) { | 13804 } else if (obj.IsClass()) { |
13804 // Allocation stub. | 13805 // Allocation stub. |
13805 Thread* thread = Thread::Current(); | 13806 Thread* thread = Thread::Current(); |
13806 Zone* zone = thread->zone(); | 13807 Zone* zone = thread->zone(); |
13807 const Class& cls = Class::Cast(obj); | 13808 const Class& cls = Class::Cast(obj); |
13808 String& cls_name = String::Handle(zone, cls.ScrubbedName()); | 13809 String& cls_name = String::Handle(zone, cls.ScrubbedName()); |
13809 ASSERT(!cls_name.IsNull()); | 13810 ASSERT(!cls_name.IsNull()); |
13810 return Symbols::FromConcat(thread, Symbols::AllocationStubFor(), cls_name); | 13811 return Symbols::FromConcat(thread, Symbols::AllocationStubFor(), cls_name); |
13811 } else { | 13812 } else { |
13812 ASSERT(obj.IsFunction()); | 13813 ASSERT(obj.IsFunction()); |
(...skipping 8316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22129 return UserTag::null(); | 22130 return UserTag::null(); |
22130 } | 22131 } |
22131 | 22132 |
22132 | 22133 |
22133 const char* UserTag::ToCString() const { | 22134 const char* UserTag::ToCString() const { |
22134 const String& tag_label = String::Handle(label()); | 22135 const String& tag_label = String::Handle(label()); |
22135 return tag_label.ToCString(); | 22136 return tag_label.ToCString(); |
22136 } | 22137 } |
22137 | 22138 |
22138 } // namespace dart | 22139 } // namespace dart |
OLD | NEW |