| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 VMTag::TagEntry VMTag::entries_[] = { | 74 VMTag::TagEntry VMTag::entries_[] = { |
| 75 { "InvalidTag", kInvalidTagId, }, | 75 { "InvalidTag", kInvalidTagId, }, |
| 76 #define DEFINE_VM_TAG_ENTRY(tag) \ | 76 #define DEFINE_VM_TAG_ENTRY(tag) \ |
| 77 { ""#tag, k##tag##TagId }, | 77 { ""#tag, k##tag##TagId }, |
| 78 VM_TAG_LIST(DEFINE_VM_TAG_ENTRY) | 78 VM_TAG_LIST(DEFINE_VM_TAG_ENTRY) |
| 79 #undef DEFINE_VM_TAG_ENTRY | 79 #undef DEFINE_VM_TAG_ENTRY |
| 80 { "kNumVMTags", kNumVMTags }, | 80 { "kNumVMTags", kNumVMTags }, |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 | 83 |
| 84 VMTagScope::VMTagScope(Isolate* base_isolate, uword tag, bool conditional_set) | 84 VMTagScope::VMTagScope(Thread* thread, uword tag, bool conditional_set) |
| 85 : StackResource(base_isolate) { | 85 : StackResource(thread) { |
| 86 ASSERT(isolate() != NULL); | 86 ASSERT(isolate() != NULL); |
| 87 previous_tag_ = isolate()->vm_tag(); | 87 previous_tag_ = isolate()->vm_tag(); |
| 88 if (conditional_set) { | 88 if (conditional_set) { |
| 89 isolate()->set_vm_tag(tag); | 89 isolate()->set_vm_tag(tag); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 | 93 |
| 94 VMTagScope::~VMTagScope() { | 94 VMTagScope::~VMTagScope() { |
| 95 ASSERT(isolate() != NULL); | 95 ASSERT(isolate() != NULL); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 Isolate* isolate = Isolate::Current(); | 148 Isolate* isolate = Isolate::Current(); |
| 149 const UserTag& tag = | 149 const UserTag& tag = |
| 150 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); | 150 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); |
| 151 ASSERT(!tag.IsNull()); | 151 ASSERT(!tag.IsNull()); |
| 152 const String& label = String::Handle(isolate, tag.label()); | 152 const String& label = String::Handle(isolate, tag.label()); |
| 153 return label.ToCString(); | 153 return label.ToCString(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 | 156 |
| 157 } // namespace dart | 157 } // namespace dart |
| OLD | NEW |