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

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..f0d976624055234334ef92fffa0d6e08d9bb6e45
--- /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) \
siva 2014/03/13 23:20:36 Another tag that Todd had pointed out a while back
Cutch 2014/03/14 15:41:51 Done.
+
+
+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(uword id);
+ private:
+ struct TagEntry {
+ const char* name;
+ uword id;
+ };
+ static TagEntry entries_[];
+};
+
+class VMTagScope : StackResource {
+ public:
+ VMTagScope(Isolate* isolate, uword tag);
+ ~VMTagScope();
+ private:
+ Isolate* isolate_;
siva 2014/03/13 23:18:47 StackResource already has an isolate pointer you d
Cutch 2014/03/14 15:41:51 Done.
+ uword previous_tag_;
siva 2014/03/13 23:18:47 DISALLOW stuff.
Cutch 2014/03/14 15:41:51 Done.
+};
+
+} // namespace dart
+
+#endif // VM_TAGS_H_

Powered by Google App Engine
This is Rietveld 408576698