| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 | 92 |
| 93 class VMTagCounters { | 93 class VMTagCounters { |
| 94 public: | 94 public: |
| 95 VMTagCounters(); | 95 VMTagCounters(); |
| 96 | 96 |
| 97 void Increment(uword tag); | 97 void Increment(uword tag); |
| 98 | 98 |
| 99 int64_t count(uword tag); | 99 int64_t count(uword tag); |
| 100 | 100 |
| 101 #ifndef PRODUCT |
| 101 void PrintToJSONObject(JSONObject* obj); | 102 void PrintToJSONObject(JSONObject* obj); |
| 103 #endif // !PRODUCT |
| 102 | 104 |
| 103 private: | 105 private: |
| 104 int64_t counters_[VMTag::kNumVMTags]; | 106 int64_t counters_[VMTag::kNumVMTags]; |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 | 109 |
| 108 class UserTags : public AllStatic { | 110 class UserTags : public AllStatic { |
| 109 public: | 111 public: |
| 110 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags). | 112 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags). |
| 111 static const intptr_t kMaxUserTags = 256; | 113 static const intptr_t kMaxUserTags = 256; |
| 112 static const uword kUserTagIdOffset = 0x4096; | 114 static const uword kUserTagIdOffset = 0x4096; |
| 113 static const uword kDefaultUserTag = kUserTagIdOffset; | 115 static const uword kDefaultUserTag = kUserTagIdOffset; |
| 114 static const char* TagName(uword tag_id); | 116 static const char* TagName(uword tag_id); |
| 115 static bool IsUserTag(uword tag_id) { | 117 static bool IsUserTag(uword tag_id) { |
| 116 return (tag_id >= kUserTagIdOffset) && | 118 return (tag_id >= kUserTagIdOffset) && |
| 117 (tag_id < kUserTagIdOffset + kMaxUserTags); | 119 (tag_id < kUserTagIdOffset + kMaxUserTags); |
| 118 } | 120 } |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 | 123 |
| 122 } // namespace dart | 124 } // namespace dart |
| 123 | 125 |
| 124 #endif // VM_TAGS_H_ | 126 #endif // VM_TAGS_H_ |
| OLD | NEW |