Harmony promises
authorrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 27 Nov 2013 17:21:40 +0000 (17:21 +0000)
committerrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 27 Nov 2013 17:21:40 +0000 (17:21 +0000)
commite943623b12edacc77e287ecba5995733dd9518fe
treef13af342dfb937dfc9f6c9e54ddc8de0b7d4f891
parent8903dcbab8845bdb58a09062f2910c1af2708ad5
Harmony promises

Based on prototype at

  https://github.com/rossberg-chromium/js-promise

which informed the latest spec draft version at

  https://github.com/domenic/promises-unwrapping/blob/master/README.md

Activated by --harmony-promises.

Feature complete with respect to the draft spec, plus the addition of .when and .deferred methods. Final naming and other possible deviations from the current draft will hopefully be resolved soon after the next TC39 meeting.

This CL also generalises the Object.observe delivery loop into a simplistic microtask loop. Currently, all observer events are delivered before invoking any promise handler in a single fixpoint iteration. It's not clear yet what the final semantics is supposed to be (should there be a global event ordering?), but it will probably require a more thorough event loop abstraction inside V8 once we get there.

R=dslomov@chromium.org, yhirano@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
19 files changed:
src/api.cc
src/bootstrapper.cc
src/contexts.h
src/execution.cc
src/execution.h
src/flag-definitions.h
src/isolate.h
src/messages.js
src/object-observe.js
src/objects.cc
src/objects.h
src/promise.js [new file with mode: 0644]
src/runtime.cc
src/runtime.h
src/v8.cc
src/v8natives.js
test/mjsunit/harmony/iteration-semantics.js
test/mjsunit/harmony/promises.js [new file with mode: 0644]
tools/gyp/v8.gyp