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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 1985813002: Add an intrinsified early out path for Dart timeline calls (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/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

Powered by Google App Engine
This is Rietveld 408576698