Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: runtime/vm/tags.h

Issue 266913010: Refactor 'dart:profiler' UserTag API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/symbols.h ('k') | sdk/lib/profiler/profiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « runtime/vm/symbols.h ('k') | sdk/lib/profiler/profiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698