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

Unified Diff: runtime/vm/tags.cc

Issue 230863005: Initial UserTag and dart:profiler library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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.cc
diff --git a/runtime/vm/tags.cc b/runtime/vm/tags.cc
index 68f9c51c0deebf39451d744b05f6cd31af837a8b..199bf2631b8b7f20d75e36cfa764ce14abc95b16 100644
--- a/runtime/vm/tags.cc
+++ b/runtime/vm/tags.cc
@@ -8,6 +8,7 @@
#include "vm/json_stream.h"
#include "vm/native_entry.h"
#include "vm/runtime_entry.h"
+#include "vm/object.h"
namespace dart {
@@ -138,4 +139,17 @@ void VMTagCounters::PrintToJSONObject(JSONObject* obj) {
}
}
+
+const char* UserTags::TagName(uword tag_address) {
+ ASSERT(tag_address >= kUserTagIdOffset);
+ ASSERT(tag_address < kUserTagIdOffset + kMaxUserTags);
+ Isolate* isolate = Isolate::Current();
+ const UserTag& tag =
+ UserTag::Handle(isolate, UserTag::FindTagById(tag_address));
+ ASSERT(!tag.IsNull());
+ const String& label = String::Handle(isolate, tag.label());
+ return label.ToCString();
+}
+
+
} // namespace dart
« no previous file with comments | « runtime/vm/tags.h ('k') | runtime/vm/vm.gypi » ('j') | sdk/lib/profiler/profiler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698