V8 Microtask Queue & API
authorrafaelw@chromium.org <rafaelw@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 12 Feb 2014 22:04:19 +0000 (22:04 +0000)
committerrafaelw@chromium.org <rafaelw@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 12 Feb 2014 22:04:19 +0000 (22:04 +0000)
commit6b5a4cdef28826e9d9dd1fd9469515f4721e2f5f
tree23d690f5911ca7310cd856f59077fdc30e6d9d19
parent0cb13eb55244376efc684e1bf2fdf4dff7e3fcc7
V8 Microtask Queue & API

This patch generalizes Object.observe callbacks and promise resolution into a FIFO queue called a "microtask queue".

It also exposes new V8 API which exposes the microtask queue to the embedder. In particular, it allows the embedder to

-schedule a microtask (EnqueueExternalMicrotask)
-run the microtask queue (RunMicrotasks)
-control whether the microtask queue is run automatically within V8 when the last script exits (SetAutorunMicrotasks).

R=dcarney@chromium.org, rossberg@chromium.org, dcarney, rossberg, svenpanne
BUG=

Review URL: https://codereview.chromium.org/154283002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19344 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
22 files changed:
include/v8.h
src/api.cc
src/bootstrapper.cc
src/contexts.h
src/execution.cc
src/execution.h
src/heap.cc
src/heap.h
src/isolate.h
src/object-observe.js
src/promise.js
src/runtime.cc
src/runtime.h
src/v8.cc
src/v8.h
src/v8natives.js
test/cctest/cctest.gyp
test/cctest/test-api.cc
test/cctest/test-microtask-delivery.cc [new file with mode: 0644]
test/mjsunit/fuzz-natives-part3.js
test/mjsunit/harmony/microtask-delivery.js [new file with mode: 0644]
tools/v8heapconst.py