Index: runtime/vm/intrinsifier_x64.cc |
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc |
index 402613e37fab085efe2d3f7afb0c038e62d0ac58..1c0acee1500fa4f21a671ebf088505843164ddb9 100644 |
--- a/runtime/vm/intrinsifier_x64.cc |
+++ b/runtime/vm/intrinsifier_x64.cc |
@@ -14,6 +14,7 @@ |
#include "vm/object_store.h" |
#include "vm/regexp_assembler.h" |
#include "vm/symbols.h" |
+#include "vm/timeline.h" |
namespace dart { |
@@ -2086,6 +2087,29 @@ void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
__ ret(); |
} |
+ |
+void Intrinsifier::Timeline_isDartStreamEnabled(Assembler* assembler) { |
+ if (!FLAG_support_timeline) { |
+ __ LoadObject(RAX, Bool::False()); |
+ __ ret(); |
+ return; |
+ } |
+ Label true_label; |
+ // Load TimelineStream*. |
+ __ movq(RAX, Address(THR, Thread::dart_stream_offset())); |
+ // Load uintptr_t from TimelineStream*. |
+ __ movq(RAX, Address(RAX, TimelineStream::enabled_offset())); |
+ __ cmpq(RAX, Immediate(0)); |
+ __ j(NOT_ZERO, &true_label, Assembler::kNearJump); |
+ // Not enabled. |
+ __ LoadObject(RAX, Bool::False()); |
+ __ ret(); |
+ // Enabled. |
+ __ Bind(&true_label); |
+ __ LoadObject(RAX, Bool::True()); |
+ __ ret(); |
+} |
+ |
#undef __ |
} // namespace dart |