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

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
Index: runtime/vm/tags.h
diff --git a/runtime/vm/tags.h b/runtime/vm/tags.h
new file mode 100644
index 0000000000000000000000000000000000000000..efaa8e124710aa7d73d59018fe06cfc71731748b
--- /dev/null
+++ b/runtime/vm/tags.h
@@ -0,0 +1,54 @@
+// 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) \
+
+
+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,
+ };
+
+ const char* TagName(intptr_t id);
+ private:
+ struct TagEntry {
+ const char* name;
+ intptr_t id;
+ };
+ static TagEntry entries_[];
+};
+
+class VMTagScope : StackResource {
+ public:
+ VMTagScope(intptr_t tag, Isolate* isolate);
+ ~VMTagScope();
+ private:
+ Isolate* isolate_;
+ intptr_t previous_tag_;
+};
+
+} // namespace dart
+
+#endif // VM_TAGS_H_

Powered by Google App Engine
This is Rietveld 408576698