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

Unified Diff: src/v8natives.js

Issue 131413008: Implement Microtask Delivery Queue (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cleanup Created 6 years, 11 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: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index b0b66e760b32118be5876b223a3292844a0ae439..76567a412b8a3de6382a9c0a378ad1b68a980747 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1904,10 +1904,15 @@ SetUpFunction();
// Eventually, we should move to a real event queue that allows to maintain
// relative ordering of different kinds of tasks.
-RunMicrotasks.runners = new InternalArray;
+RunMicrotasks.queue = new InternalArray;
function RunMicrotasks() {
while (%SetMicrotaskPending(false)) {
- for (var i in RunMicrotasks.runners) RunMicrotasks.runners[i]();
+ var microtasks = RunMicrotasks.queue;
+ RunMicrotasks.queue = new InternalArray;
+
+ for (var i = 0; i < microtasks.length; i++) {
+ microtasks[i]();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698