- 05 Oct, 2018 1 commit
-
-
Maya Lekova authored
Design doc: https://docs.google.com/document/d/1kL08cz4lR6gO5b2FATNK3QAfS8t-6K6kdk88U-n8tug/edit This CL is a follow-up after the original implementation, see CL: https://chromium-review.googlesource.com/c/v8/v8/+/1106977 It includes a fix for the missing async generators optimization, as well as cleanup of the manual patching of the builtins. It also includes mjsunit test for all usages of the new behaviour. Bug: v8:8267 Change-Id: I999f341acb746c6da5216e44b68a519656fd5403 Reviewed-on: https://chromium-review.googlesource.com/c/1261124Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/master@{#56414}
-
- 29 Sep, 2018 1 commit
-
-
Benedikt Meurer authored
Change the way that the (internal) await closures store the link to the generator object by introducing a dedicated AwaitContext, which stores the generator object into the extension slot (instead of misusing a regular FunctionContext here). Also unify the allocation+initialization of these contexts in the await-related builtins (both for async functions and generators). The rationale behind this is that for (zero-cost) async stack traces, we will need to dig into these contexts and we can do better checking with a dedicated instance type there. As an additional benefit, we save one word per await context, since we just use (the otherwise unused) extension slot to remember the generator object. As yet another benefit we will never accidentally use any of these contexts in the regular scope chain lookups, meaning we can also catch bugs there. And last but not least the objects printing machinery understands these contexts now and can even print the generator object for AwaitContexts for short printing, which is really valuable for debugging. Tbr: ulan@chromium.org Bug: v8:7253, v8:7522, v8:8015 Change-Id: I86955f5701e694e8a10b91ebe5f52705aa90968d Reviewed-on: https://chromium-review.googlesource.com/1249491Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#56301}
-
- 20 Jun, 2018 1 commit
-
-
Maya Lekova authored
This is a reland of 21c0d77e Original change's description: > [async] Optimize await and AsyncFromSyncIterator > > Simplify the promise wrapping in await and > %AsyncFromSyncIteratorPrototype%.next/return/throw to reuse the PromiseResolve > primitive. Now await takes 1 tick instead of 3 on the microtask queue. > > Change-Id: I7e99b8689eb8fcb09c48915b11c1e06684dc0f1a > Reviewed-on: https://chromium-review.googlesource.com/1090272 > Commit-Queue: Maya Lekova <mslekova@chromium.org> > Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> > Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> > Reviewed-by: Mathias Bynens <mathias@chromium.org> > Cr-Commit-Position: refs/heads/master@{#53853} Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Ifa5b2fb8b2fb84b635b2dc1b6455d6aaf154cbfd Reviewed-on: https://chromium-review.googlesource.com/1106977 Commit-Queue: Maya Lekova <mslekova@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#53900}
-
- 19 Jun, 2018 2 commits
-
-
Bill Budge authored
This reverts commit 21c0d77e. Reason for revert: Compile failure in bootstrapper.cc Original change's description: > [async] Optimize await and AsyncFromSyncIterator > > Simplify the promise wrapping in await and > %AsyncFromSyncIteratorPrototype%.next/return/throw to reuse the PromiseResolve > primitive. Now await takes 1 tick instead of 3 on the microtask queue. > > Change-Id: I7e99b8689eb8fcb09c48915b11c1e06684dc0f1a > Reviewed-on: https://chromium-review.googlesource.com/1090272 > Commit-Queue: Maya Lekova <mslekova@chromium.org> > Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> > Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> > Reviewed-by: Mathias Bynens <mathias@chromium.org> > Cr-Commit-Position: refs/heads/master@{#53853} TBR=kozyatinskiy@chromium.org,littledan@chromium.org,gsathya@chromium.org,bmeurer@chromium.org,domenic@chromium.org,mathias@chromium.org,mslekova@chromium.org Change-Id: Ia631acdfcd5c1f9c28c1540c8da16cdf076abf87 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/1106566Reviewed-by: Bill Budge <bbudge@chromium.org> Commit-Queue: Bill Budge <bbudge@chromium.org> Cr-Commit-Position: refs/heads/master@{#53855}
-
Maya Lekova authored
Simplify the promise wrapping in await and %AsyncFromSyncIteratorPrototype%.next/return/throw to reuse the PromiseResolve primitive. Now await takes 1 tick instead of 3 on the microtask queue. Change-Id: I7e99b8689eb8fcb09c48915b11c1e06684dc0f1a Reviewed-on: https://chromium-review.googlesource.com/1090272 Commit-Queue: Maya Lekova <mslekova@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org> Cr-Commit-Position: refs/heads/master@{#53853}
-
- 14 May, 2018 1 commit
-
-
Maya Lekova authored
Revert "[async-await] Eliminate throwaway promise in async functions." This reverts commit a840f1f8. Revert "[async-generators] Also avoid throwaway promise here." This reverts commit feb545ce. Revert "[async-await] Turn await closures into intrinsics." This reverts commit d97bb317. Revert "[async-generators] Add fast-path for primitives in AsyncGeneratorYield." This reverts commit e57b500e. Revert "[async-generators] Add fast-path to skip "then" lookup in AsyncGeneratorResolve." This reverts commit c15802e1. Revert "[promises] Correctly run before/after hooks for await." This reverts commit ca763923. Bug: v8:7253, v8:7745 Change-Id: I25ad0d2df3cfbc84dbb431aa25b268bce8a39e89 Reviewed-on: https://chromium-review.googlesource.com/1049975 Commit-Queue: Maya Lekova <mslekova@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#53139}
-
- 19 Feb, 2018 1 commit
-
-
Benedikt Meurer authored
This extends the previously introduced logic for implementing await without having to allocate the throwaway promise and the additional closures and context, to also cover await and yield inside of async generators. Bug: v8:7253 Change-Id: I011583a7714bbd148c54e5f204e2076630008db0 Reviewed-on: https://chromium-review.googlesource.com/924003 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#51361}
-
- 02 Feb, 2018 1 commit
-
-
jgruber authored
This check verifies that all .h files in the src/ directory have an include guard of the form #ifndef V8_PATH_TO_FILE_H_ #define V8_PATH_TO_FILE_H_ // ... #endif // V8_PATH_TO_FILE_H_ The check can be skipped with a magic comment: // PRESUBMIT_INTENTIONALLY_MISSING_INCLUDE_GUARD Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I0a7b96abec289ad60f64ba8418f1892a6969596d Reviewed-on: https://chromium-review.googlesource.com/897487Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#51079}
-
- 09 Aug, 2017 1 commit
-
-
Caitlin Potter authored
AsyncGenerators, when resumed with a "return" completion, Await the sent value to provide consistency with syntactic return statements. This moves the await to during AsyncGeneratorResumeNext, shrinking the number of bytecodes. There's a minor change to BytecodeGenerator which removes a %_GeneratorClose() call, since it's inserted implicitly by the parser. BUG=v8:5855 TBR=neis@chromium.org Change-Id: I2965c610e5985ac24c713b481e62f6b97f96a3d8 Reviewed-on: https://chromium-review.googlesource.com/582218 Commit-Queue: Caitlin Potter <caitp@igalia.com> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#47253}
-
- 08 Aug, 2017 1 commit
-
-
Caitlin Potter authored
A spec change (https://github.com/tc39/proposal-async-iteration/commit/a0dfeba1a8029012b6e964099929b8a157818c9f) introduced a number of Await operations to the spec. In turn, this caused generated bytecode for async generators to grow drastically. This commit moves the Await within AsyncGeneratorYield (https://tc39.github.io/proposal-async-iteration/#sec-asyncgeneratoryield step 5) into a new TFJ builtin, similar in structure to AsyncGeneratorAwait, but instead of resuming the generator on resolution of the Promise, the current generator request's Promise is fulfilled instead. This results in a reduction in generated bytecode without losing any statically available information. BUG=v8:5855 Change-Id: Ib5bcf06132d221beffdea30639a7b4437030143b Reviewed-on: https://chromium-review.googlesource.com/582487 Commit-Queue: Caitlin Potter <caitp@igalia.com> Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#47224}
-
- 30 Jun, 2017 1 commit
-
-
Caitlin Potter authored
Allocates the Await success/failure closures, their context, and the two required JSPromise objects all at once in a single call, rather than performing multiple allocations throughout the function. Saves about 2kb of snapshot space on an x64.release build. Performance impact of this change has not been measured yet. BUG=v8:4483 R=ishell@chromium.org, jgruber@chromium.org Change-Id: I8d911cb91f5d0e00544ad3ba608aa170f6b2f704 Reviewed-on: https://chromium-review.googlesource.com/549999Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Caitlin Potter <caitp@igalia.com> Cr-Commit-Position: refs/heads/master@{#46360}
-
- 29 Mar, 2017 1 commit
-
-
Caitlin Potter authored
- Introduce new struct AsyncGeneratorRequest, which holds information pertinent to resuming execution of an AsyncGenerator, such as the Promise associated with the async generator request. It is intended to be used as a singly linked list, and holds a pointer to the next item in te queue. - Introduce JSAsyncGeneratorObject (subclass of JSGeneratorObject), which includes several new internal fields (`queue` which contains a singly linked list of AsyncGeneratorRequest objects, and `await_input` which contains the sent value from an Await expression (This is necessary to prevent function.sent (used by yield*) from having the sent value observably overwritten during execution). - Modify SuspendGenerator to accept a set of Flags, which indicate whether the suspend is for a Yield or Await, and whether it takes place on an async generator or ES6 generator. - Introduce interpreter intrinsics and TF intrinsic lowering for accessing the await input of an async generator - Modify the JSGeneratorStore operator to understand whether or not it's suspending for a normal yield, or an AsyncGenerator Await. This ensures appropriate registers are stored. - Add versions of ResumeGeneratorTrampoline which store the input value in a different field depending on wether it's an AsyncGenerator Await resume, or an ordinary resume. Also modifies whether debug code will assert that the generator object is a JSGeneratorObject or a JSAsyncGeneratorObject depending on the resume type. BUG=v8:5855 R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org, littledan@chromium.org, neis@chromium.org TBR=marja@chromium.org Change-Id: I9d58df1d344465fc937fe7eed322424204497187 Reviewed-on: https://chromium-review.googlesource.com/446961 Commit-Queue: Caitlin Potter <caitp@igalia.com> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Hannes Payer <hpayer@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#44240}
-
- 21 Mar, 2017 1 commit
-
-
jkummerow authored
BUG=v8:6055 Review-Url: https://codereview.chromium.org/2760953002 Cr-Commit-Position: refs/heads/master@{#43975}
-
- 16 Mar, 2017 1 commit
-
-
jkummerow authored
This is in preparation for linking the former only into mksnapshot. Just shuffling code around, no changes in functionality. BUG=v8:6055 Review-Url: https://codereview.chromium.org/2752143004 Cr-Commit-Position: refs/heads/master@{#43858}
-
- 20 Jan, 2017 1 commit
-
-
jgruber authored
This moves AsyncFunctionAwait{Caught,Uncaught} to CSA, and removes async-await.js. BUG=v8:5639 Review-Url: https://codereview.chromium.org/2643023002 Cr-Commit-Position: refs/heads/master@{#42579}
-
- 18 Jan, 2017 1 commit
-
-
caitp authored
First step in splitting apart https://codereview.chromium.org/2622833002/ to land piece by piece. Porting src/js/async-await.js to TF builtins using this boilerplate is now very straightforward. BUG=v8:4483, v8:5855 R=jgruber@chromium.org, gsathya@chromium.org Review-Url: https://codereview.chromium.org/2635353002 Cr-Commit-Position: refs/heads/master@{#42466}
-