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

Unified Diff: runtime/vm/thread.h

Issue 1814243002: Add Thread TaskKind (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/isolate_test.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index c949f17b0ba07ce92f5b0f813b519aa6e60b2db2..31313d6ec1b6398aa00be83e8ac059fbc614db3f 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -118,6 +118,14 @@ class Zone;
// must currently be called manually (issue 23474).
class Thread : public BaseThread {
public:
+ // The kind of task this thread is performing. Sampled by the profiler.
+ enum TaskKind {
+ kUnknownTask = 0x0,
+ kMutatorTask = 0x1,
+ kCompilerTask = 0x2,
+ kSweeperTask = 0x4,
+ kMarkerTask = 0x8,
+ };
~Thread();
// The currently executing thread, or NULL if not yet initialized.
@@ -139,6 +147,7 @@ class Thread : public BaseThread {
// SweeperTask (which uses the class table, which is copy-on-write).
// TODO(koda): Properly synchronize heap access to expand allowed operations.
static bool EnterIsolateAsHelper(Isolate* isolate,
+ TaskKind kind,
bool bypass_safepoint = false);
static void ExitIsolateAsHelper(bool bypass_safepoint = false);
@@ -181,6 +190,10 @@ class Thread : public BaseThread {
return ++stack_overflow_count_;
}
+ TaskKind task_kind() const {
+ return task_kind_;
+ }
+
// Retrieves and clears the stack overflow flags. These are set by
// the generated code before the slow path runtime routine for a
// stack overflow is called.
@@ -595,6 +608,7 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
uword top_exit_frame_info_;
StoreBufferBlock* store_buffer_block_;
uword vm_tag_;
+ TaskKind task_kind_;
// State that is cached in the TLS for fast access in generated code.
#define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \
type_name member_name;
« no previous file with comments | « runtime/vm/isolate_test.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698