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

Unified Diff: src/isolate.cc

Issue 2289593005: Introduce v8.execute tracing category with RunMicrotasks event. (Closed)
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 10835256ccc9d2e021de96cd5a9c8917c7f911ed..7d21090ed2e9fecb8b30aa2a37b5b354e95a3d9f 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2957,17 +2957,21 @@ void Isolate::EnqueueMicrotask(Handle<Object> microtask) {
void Isolate::RunMicrotasks() {
- // Increase call depth to prevent recursive callbacks.
- v8::Isolate::SuppressMicrotaskExecutionScope suppress(
- reinterpret_cast<v8::Isolate*>(this));
- is_running_microtasks_ = true;
- RunMicrotasksInternal();
- is_running_microtasks_ = false;
+ if (pending_microtask_count()) {
+ TRACE_EVENT0("v8.execute", "RunMicrotasks");
caseq 2016/08/30 16:16:14 let's move down to RunMicrotasksInternal?
alph 2016/08/30 17:06:04 Done. Also I noticed that originally FireMicrotask
+ // Increase call depth to prevent recursive callbacks.
+ v8::Isolate::SuppressMicrotaskExecutionScope suppress(
+ reinterpret_cast<v8::Isolate*>(this));
+ is_running_microtasks_ = true;
+ RunMicrotasksInternal();
+ is_running_microtasks_ = false;
+ }
FireMicrotasksCompletedCallback();
}
void Isolate::RunMicrotasksInternal() {
+ DCHECK(pending_microtask_count() > 0);
while (pending_microtask_count() > 0) {
HandleScope scope(this);
int num_tasks = pending_microtask_count();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698