OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 #ifndef VM_TAGS_H_ | 5 #ifndef VM_TAGS_H_ |
6 #define VM_TAGS_H_ | 6 #define VM_TAGS_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 void PrintToJSONObject(JSONObject* obj); | 77 void PrintToJSONObject(JSONObject* obj); |
78 | 78 |
79 private: | 79 private: |
80 int64_t counters_[VMTag::kNumVMTags]; | 80 int64_t counters_[VMTag::kNumVMTags]; |
81 }; | 81 }; |
82 | 82 |
83 | 83 |
84 class UserTags : public AllStatic { | 84 class UserTags : public AllStatic { |
85 public: | 85 public: |
86 static const uword kNoUserTag = 0; | |
87 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags). | 86 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags). |
88 static const intptr_t kMaxUserTags = 64; | 87 static const intptr_t kMaxUserTags = 64; |
89 static const uword kUserTagIdOffset = 0x4096; | 88 static const uword kUserTagIdOffset = 0x4096; |
| 89 static const uword kDefaultUserTag = kUserTagIdOffset; |
90 static const char* TagName(uword tag_id); | 90 static const char* TagName(uword tag_id); |
91 static bool IsUserTag(uword tag_id) { | 91 static bool IsUserTag(uword tag_id) { |
92 return (tag_id >= kUserTagIdOffset) && | 92 return (tag_id >= kUserTagIdOffset) && |
93 (tag_id < kUserTagIdOffset + kMaxUserTags); | 93 (tag_id < kUserTagIdOffset + kMaxUserTags); |
94 } | 94 } |
95 }; | 95 }; |
96 | 96 |
97 | 97 |
98 } // namespace dart | 98 } // namespace dart |
99 | 99 |
100 #endif // VM_TAGS_H_ | 100 #endif // VM_TAGS_H_ |
OLD | NEW |