Reviewers: rossberg, rafaelw,

Message:
Would you take a look?

Description:
Fix |RunMicrotasks()| leaking reference to the last context being run on.

RunMicrotasks() executes pending tasks and swaps the old array with a new array.
However, the new array contains the reference to the current context as its
creation context. This prevents the context from gc-ed until RunMicrotasks() is
executed in the different context.

BUG=crbug.com/367016

Please review this at https://codereview.chromium.org/250883002/

SVN Base: git://github.com/v8/v8.git@master

Affected files (+1, -1 lines):
  M src/v8natives.js


Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index f183afb968f84df9b11c5438f2cfadc64d20068d..ee1dfe0defdf60ac28e31a77a1a6a1a50c0d5a73 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1908,7 +1908,7 @@ function RunMicrotasks() {
       return;

     var microtasks = microtaskState.queue;
-    microtaskState.queue = new InternalArray;
+    delete microtaskState.queue;

     for (var i = 0; i < microtasks.length; i++) {
       microtasks[i]();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to