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

Unified Diff: runtime/vm/isolate.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
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 18f417a249e37b6f47df70288722b2b8fcfebf84..4631bbcc79b790586baa779465a3b374231ba2b4 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -336,11 +336,14 @@ Isolate::Isolate()
object_id_ring_(NULL),
profiler_data_(NULL),
thread_state_(NULL),
+ tag_table_(GrowableObjectArray::null()),
+ current_tag_(UserTag::null()),
next_(NULL),
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
reusable_handles_() {
set_vm_tag(VMTag::kIdleTagId);
+ set_user_tag(UserTags::kNoUserTag);
}
#undef REUSABLE_HANDLE_SCOPE_INIT
#undef REUSABLE_HANDLE_INITIALIZERS
@@ -450,7 +453,6 @@ Isolate* Isolate::Init(const char* name_prefix) {
}
}
-
return result;
}
@@ -849,6 +851,12 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
// Visit the top context which is stored in the isolate.
visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_));
+ // Visit the current tag which is stored in the isolate.
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(&current_tag_));
+
+ // Visit the tag table which is stored in the isolate.
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_));
+
// Visit objects in the debugger.
debugger()->VisitObjectPointers(visitor);
@@ -968,6 +976,24 @@ void Isolate::ProfileIdle() {
}
+void Isolate::set_tag_table(const GrowableObjectArray& value) {
+ tag_table_ = value.raw();
+}
+
+
+void Isolate::set_current_tag(const UserTag& tag) {
+ intptr_t user_tag = tag.tag();
+ set_user_tag(static_cast<uword>(user_tag));
+ current_tag_ = tag.raw();
+}
+
+
+void Isolate::clear_current_tag() {
+ set_user_tag(UserTags::kNoUserTag);
+ current_tag_ = UserTag::null();
+}
+
+
void Isolate::VisitIsolates(IsolateVisitor* visitor) {
if (visitor == NULL) {
return;
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698