| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void PrintToJSONObject(JSONObject* obj); | 80 void PrintToJSONObject(JSONObject* obj); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 int64_t counters_[VMTag::kNumVMTags]; | 83 int64_t counters_[VMTag::kNumVMTags]; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 | 86 |
| 87 class UserTags : public AllStatic { | 87 class UserTags : public AllStatic { |
| 88 public: | 88 public: |
| 89 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags). | 89 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags). |
| 90 static const intptr_t kMaxUserTags = 64; | 90 static const intptr_t kMaxUserTags = 256; |
| 91 static const uword kUserTagIdOffset = 0x4096; | 91 static const uword kUserTagIdOffset = 0x4096; |
| 92 static const uword kDefaultUserTag = kUserTagIdOffset; | 92 static const uword kDefaultUserTag = kUserTagIdOffset; |
| 93 static const char* TagName(uword tag_id); | 93 static const char* TagName(uword tag_id); |
| 94 static bool IsUserTag(uword tag_id) { | 94 static bool IsUserTag(uword tag_id) { |
| 95 return (tag_id >= kUserTagIdOffset) && | 95 return (tag_id >= kUserTagIdOffset) && |
| 96 (tag_id < kUserTagIdOffset + kMaxUserTags); | 96 (tag_id < kUserTagIdOffset + kMaxUserTags); |
| 97 } | 97 } |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 | 100 |
| 101 } // namespace dart | 101 } // namespace dart |
| 102 | 102 |
| 103 #endif // VM_TAGS_H_ | 103 #endif // VM_TAGS_H_ |
| OLD | NEW |