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

Unified Diff: runtime/vm/intrinsifier_ia32.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_ia32.cc
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 8dc9e999655f0977f31a7fe19dbdb8aa5b743961..20f11b801e61dfe11b2f9a9b0765d5943e9aa7c9 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -21,6 +21,7 @@
#include "vm/os.h"
#include "vm/regexp_assembler.h"
#include "vm/symbols.h"
+#include "vm/timeline.h"
namespace dart {
@@ -2131,7 +2132,31 @@ void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
__ ret();
}
+
+void Intrinsifier::Timeline_isDartStreamEnabled(Assembler* assembler) {
+ if (!FLAG_support_timeline) {
+ __ LoadObject(EAX, Bool::False());
+ __ ret();
+ return;
+ }
+ Label true_label;
+ // Load TimelineStream*.
+ __ movl(EAX, Address(THR, Thread::dart_stream_offset()));
+ // Load uintptr_t from TimelineStream*.
+ __ movl(EAX, Address(EAX, TimelineStream::enabled_offset()));
+ __ cmpl(EAX, Immediate(0));
+ __ j(NOT_ZERO, &true_label, Assembler::kNearJump);
+ // Not enabled.
+ __ LoadObject(EAX, Bool::False());
+ __ ret();
+ // Enabled.
+ __ Bind(&true_label);
+ __ LoadObject(EAX, Bool::True());
+ __ ret();
+}
+
#undef __
+
} // namespace dart
#endif // defined TARGET_ARCH_IA32

Powered by Google App Engine
This is Rietveld 408576698