OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 #ifndef VM_TAGS_H_ |
| 6 #define VM_TAGS_H_ |
| 7 |
| 8 #include "vm/allocation.h" |
| 9 |
| 10 class Isolate; |
| 11 |
| 12 namespace dart { |
| 13 |
| 14 #define VM_TAG_LIST(V) \ |
| 15 V(VM) /* Catch all */ \ |
| 16 V(Compile) \ |
| 17 V(Script) \ |
| 18 V(GCNewSpace) \ |
| 19 V(GCOldSpace) \ |
| 20 V(RuntimeNative) \ |
| 21 V(Idle) \ |
| 22 |
| 23 |
| 24 class VMTag : public AllStatic { |
| 25 public: |
| 26 enum VMTagId { |
| 27 kInvalidTagId = 0, |
| 28 #define DEFINE_VM_TAG_ID(tag) \ |
| 29 k##tag##TagId, |
| 30 VM_TAG_LIST(DEFINE_VM_TAG_ID) |
| 31 #undef DEFINE_VM_TAG_KIND |
| 32 kNumVMTags, |
| 33 }; |
| 34 |
| 35 static const char* TagName(uword id); |
| 36 |
| 37 private: |
| 38 struct TagEntry { |
| 39 const char* name; |
| 40 uword id; |
| 41 }; |
| 42 static TagEntry entries_[]; |
| 43 }; |
| 44 |
| 45 class VMTagScope : StackResource { |
| 46 public: |
| 47 VMTagScope(Isolate* isolate, uword tag); |
| 48 ~VMTagScope(); |
| 49 private: |
| 50 uword previous_tag_; |
| 51 |
| 52 DISALLOW_ALLOCATION(); |
| 53 DISALLOW_IMPLICIT_CONSTRUCTORS(VMTagScope); |
| 54 }; |
| 55 |
| 56 } // namespace dart |
| 57 |
| 58 #endif // VM_TAGS_H_ |
OLD | NEW |