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

Unified Diff: runtime/vm/tags.h

Issue 195733009: Basic tag infrastructure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/native_entry.cc ('k') | runtime/vm/tags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/tags.h
diff --git a/runtime/vm/tags.h b/runtime/vm/tags.h
new file mode 100644
index 0000000000000000000000000000000000000000..98be468cbf79bc429aedceb4b9960f9bcf593758
--- /dev/null
+++ b/runtime/vm/tags.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef VM_TAGS_H_
+#define VM_TAGS_H_
+
+#include "vm/allocation.h"
+
+class Isolate;
+
+namespace dart {
+
+#define VM_TAG_LIST(V) \
+ V(VM) /* Catch all */ \
+ V(Compile) \
+ V(Script) \
+ V(GCNewSpace) \
+ V(GCOldSpace) \
+ V(RuntimeNative) \
+ V(Idle) \
+
+
+class VMTag : public AllStatic {
+ public:
+ enum VMTagId {
+ kInvalidTagId = 0,
+#define DEFINE_VM_TAG_ID(tag) \
+ k##tag##TagId,
+ VM_TAG_LIST(DEFINE_VM_TAG_ID)
+#undef DEFINE_VM_TAG_KIND
+ kNumVMTags,
+ };
+
+ static const char* TagName(uword id);
+
+ private:
+ struct TagEntry {
+ const char* name;
+ uword id;
+ };
+ static TagEntry entries_[];
+};
+
+class VMTagScope : StackResource {
+ public:
+ VMTagScope(Isolate* isolate, uword tag);
+ ~VMTagScope();
+ private:
+ uword previous_tag_;
+
+ DISALLOW_ALLOCATION();
+ DISALLOW_IMPLICIT_CONSTRUCTORS(VMTagScope);
+};
+
+} // namespace dart
+
+#endif // VM_TAGS_H_
« no previous file with comments | « runtime/vm/native_entry.cc ('k') | runtime/vm/tags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698