| 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 == kRootTagId) || (tag == kTruncatedTagId)) { | 36 return (tag > kLastTagId) && !IsRuntimeEntryTag(tag); |
| 37 return false; | |
| 38 } | |
| 39 ASSERT(tag != kInvalidTagId); | |
| 40 ASSERT(tag != kNumVMTags); | |
| 41 ASSERT(tag != kLastTagId); | |
| 42 return (tag > kNumVMTags) && !IsRuntimeEntryTag(tag); | |
| 43 } | 37 } |
| 44 | 38 |
| 39 |
| 45 static RuntimeEntry* runtime_entry_list = NULL; | 40 static RuntimeEntry* runtime_entry_list = NULL; |
| 46 | 41 |
| 42 |
| 47 bool VMTag::IsRuntimeEntryTag(uword id) { | 43 bool VMTag::IsRuntimeEntryTag(uword id) { |
| 48 const RuntimeEntry* current = runtime_entry_list; | 44 const RuntimeEntry* current = runtime_entry_list; |
| 49 while (current != NULL) { | 45 while (current != NULL) { |
| 50 if (reinterpret_cast<uword>(current->function()) == id) { | 46 if (reinterpret_cast<uword>(current->function()) == id) { |
| 51 return true; | 47 return true; |
| 52 } | 48 } |
| 53 current = current->next(); | 49 current = current->next(); |
| 54 } | 50 } |
| 55 return false; | 51 return false; |
| 56 } | 52 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 Isolate* isolate = Isolate::Current(); | 146 Isolate* isolate = Isolate::Current(); |
| 151 const UserTag& tag = | 147 const UserTag& tag = |
| 152 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); | 148 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); |
| 153 ASSERT(!tag.IsNull()); | 149 ASSERT(!tag.IsNull()); |
| 154 const String& label = String::Handle(isolate, tag.label()); | 150 const String& label = String::Handle(isolate, tag.label()); |
| 155 return label.ToCString(); | 151 return label.ToCString(); |
| 156 } | 152 } |
| 157 | 153 |
| 158 | 154 |
| 159 } // namespace dart | 155 } // namespace dart |
| OLD | NEW |