| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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/tags.h" | 5 #include "vm/tags.h" |
| 6 | 6 |
| 7 #include "vm/isolate.h" | 7 #include "vm/isolate.h" |
| 8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
| 9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 ASSERT(tag != kInvalidTagId); | 27 ASSERT(tag != kInvalidTagId); |
| 28 ASSERT(tag < kNumVMTags); | 28 ASSERT(tag < kNumVMTags); |
| 29 const TagEntry& entry = entries_[tag]; | 29 const TagEntry& entry = entries_[tag]; |
| 30 ASSERT(entry.id == tag); | 30 ASSERT(entry.id == tag); |
| 31 return entry.name; | 31 return entry.name; |
| 32 } | 32 } |
| 33 | 33 |
| 34 | 34 |
| 35 bool VMTag::IsNativeEntryTag(uword tag) { | 35 bool VMTag::IsNativeEntryTag(uword tag) { |
| 36 if (tag == 0) { | 36 if ((tag == kRootTagId) || (tag == kTruncatedTagId)) { |
| 37 return false; | 37 return false; |
| 38 } | 38 } |
| 39 ASSERT(tag != kInvalidTagId); | 39 ASSERT(tag != kInvalidTagId); |
| 40 ASSERT(tag != kNumVMTags); | 40 ASSERT(tag != kNumVMTags); |
| 41 ASSERT(tag != kLastTagId); |
| 41 return (tag > kNumVMTags) && !IsRuntimeEntryTag(tag); | 42 return (tag > kNumVMTags) && !IsRuntimeEntryTag(tag); |
| 42 } | 43 } |
| 43 | 44 |
| 44 static RuntimeEntry* runtime_entry_list = NULL; | 45 static RuntimeEntry* runtime_entry_list = NULL; |
| 45 | 46 |
| 46 bool VMTag::IsRuntimeEntryTag(uword id) { | 47 bool VMTag::IsRuntimeEntryTag(uword id) { |
| 47 const RuntimeEntry* current = runtime_entry_list; | 48 const RuntimeEntry* current = runtime_entry_list; |
| 48 while (current != NULL) { | 49 while (current != NULL) { |
| 49 if (reinterpret_cast<uword>(current->function()) == id) { | 50 if (reinterpret_cast<uword>(current->function()) == id) { |
| 50 return true; | 51 return true; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 Isolate* isolate = Isolate::Current(); | 150 Isolate* isolate = Isolate::Current(); |
| 150 const UserTag& tag = | 151 const UserTag& tag = |
| 151 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); | 152 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); |
| 152 ASSERT(!tag.IsNull()); | 153 ASSERT(!tag.IsNull()); |
| 153 const String& label = String::Handle(isolate, tag.label()); | 154 const String& label = String::Handle(isolate, tag.label()); |
| 154 return label.ToCString(); | 155 return label.ToCString(); |
| 155 } | 156 } |
| 156 | 157 |
| 157 | 158 |
| 158 } // namespace dart | 159 } // namespace dart |
| OLD | NEW |