- 05 Nov, 2018 1 commit
-
-
Tobias Tebbi authored
No longer use inheritance to associate Torque-generated assemblers with corresponding CSA subclasses. Instead, all references to CSA and CSA-derived assemblers are now explicitly qualified, by generating a short-lived assembler instance in-place. As a consequence, Torque files have to mention the assembler external macros live in. The CodeStubAssembler is the default for this and can be omitted. As a drive-by cleanup, also distinguish between names that are emitted in C++ and names that are intended to be read in error messages. This is relevant for generic instantiations, where the generated names are rather unreadably mangled. As a follow-up, it will be easy to allow for qualified access to different modules, thus implementing full namespace semantics for modules. Bug: v8:7793 Change-Id: Ie6f1b6b549b510fb49be2442393d898d5f130950 Reviewed-on: https://chromium-review.googlesource.com/c/1309636 Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Daniel Clifford <danno@chromium.org> Cr-Commit-Position: refs/heads/master@{#57235}
-
- 31 Oct, 2018 1 commit
-
-
Daniel Clifford authored
This is preparation to support the Torque port of Object.fromEntries, including tests to make sure that the interface of the iterator functions is correct and compiles when used. Change-Id: I2a30ef80a80f42d4744a92746c8cd383abc10c19 Reviewed-on: https://chromium-review.googlesource.com/c/1303726 Commit-Queue: Daniel Clifford <danno@chromium.org> Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#57192}
-
- 26 Oct, 2018 1 commit
-
-
Benedikt Meurer authored
This adds support for Promise.all() to --async-stack-traces (also at zero cost, since we can derive the relevant information from the resolve element closure and context). In case of `Promise.all(a)` the stack trace even tells you which element of `a` is responsible, for example ```js async function fine() {} async function thrower() { await fine(); throw new Error(); } async function test() { await Promise.all([fine(), thrower()]); } ``` will generate the following stack trace ``` Error at thrower (something.js:1:9) at async Promise.all (index 1) at async test (something.js:3:3) ``` so it not only shows the async Promise.all() frames, but even tells the user exactly that the second element of `[fine(), thrower()]` is the relevant one. Bug: v8:7522 Change-Id: I279a845888e06053cf0e3c9338ab71caabaabf45 Reviewed-on: https://chromium-review.googlesource.com/c/1299248Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#57023}
-
- 22 Oct, 2018 1 commit
-
-
Benedikt Meurer authored
This CL introduces a new fast-path for `Promise.all(a)` for the case that elements in `a` are native promises, and the Promise.prototype and Promise function itself are intact. If so, we can skip the lookups of "resolve" on Promise and "then" on the result of invoking "resolve", which are both quite expensive, and we can instead directly call the PerformPromiseThen() operation on the element of `a`. In addition to that we don't need to create and chain a result promise, since this is only used when either async_hooks or DevTools are enabled. Otherwise it's a "throwaway promise" only used to satisfy the operation parameter signature (see https://github.com/tc39/ecma262/pull/1146). This results in a significant performance improvement on `Promise.all()` heavy code. For example the parallel-promises-es2015-native test goes from around 84ms to roughly 68ms, which is almost a 20% improvement. Bug: v8:7253 Ref: tc39/ecma262#1146 Change-Id: Iab9c57edb26d13a467b0653fd8de6149c382efc6 Reviewed-on: https://chromium-review.googlesource.com/c/1293374Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Maya Lekova <mslekova@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#56858}
-
- 20 Sep, 2018 1 commit
-
-
Igor Sheludko authored
and introduce RootsTable - a V8 heap roots storage. So, the renaming part looks like this: Heap::RootListIndex -> RootIndex Heap::kBlahBlahRootIndex -> RootIndex::kBlahBlah Bug: v8:8015, v8:8182 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: I38e1f3e3f6813ef35e37b0bed35e9ae14a62134f Reviewed-on: https://chromium-review.googlesource.com/1234613Reviewed-by:
Toon Verwaest <verwaest@chromium.org> Reviewed-by:
Hannes Payer <hpayer@chromium.org> Reviewed-by:
Tobias Tebbi <tebbi@chromium.org> Reviewed-by:
Ross McIlroy <rmcilroy@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#56067}
-
- 09 Jul, 2018 1 commit
-
-
Benedikt Meurer authored
This extends the current Promise Rejection Hook with two new events kPromiseRejectAfterResolved kPromiseResolveAfterResolved which are used to detect (and signal) misuse of the Promise constructor. Specifically the common bug like new Promise((res, rej) => { res(1); throw new Error("something") }); where the error is silently swallowed by the Promise constructor without the user ever noticing can be caught via this hook. Doc: https://goo.gl/2stLUY Bug: v8:7919 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: I890a7e766cdd1be88db94844fb744f72823dba33 Reviewed-on: https://chromium-review.googlesource.com/1126099Reviewed-by:
Maya Lekova <mslekova@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#54309}
-
- 17 May, 2018 1 commit
-
-
Igor Sheludko authored
Bug: v8:7754 Change-Id: Id22020984e10bd2ddb22119c50b490419c897174 Reviewed-on: https://chromium-review.googlesource.com/1062272Reviewed-by:
Leszek Swirski <leszeks@chromium.org> Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#53232}
-
- 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}
-
- 22 Mar, 2018 1 commit
-
-
Benedikt Meurer authored
In Promise.all we used to allocate a fresh closure plus a fresh context for each individual element, which is quite a lot of overhead, especially since this could be shared in a single context for all elements. The only bit of information that is needed for each resolve element closure is the index under which to store the resulting value. With this change we move this index to the "identity hash" field of the JSFunction, which doesn't care about the concrete value anyways, as long as it's not zero (the "no hash" sentinel), and share the rest of the fields in a single outer context for all resolve element closures. This limits the maximum number of elements for Promise.all to 2^21 for now, but that should be fine. Shall we ever see the need for more than this, we can add machinery to overflow to separate context for indices larger than 2^21. This significantly reduces the overhead due to Promise.all on the parallel-async-es2017-native test, with execution time dropping from around 148ms to 133ms, so overall a steady 10% improvement on this benchmark. Bug: v8:7253 Change-Id: I1092da771c4919f3db7129d2b0a244fc26a7b144 Reviewed-on: https://chromium-review.googlesource.com/973283Reviewed-by:
Yang Guo <yangguo@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#52134}
-
- 08 Mar, 2018 1 commit
-
-
Benedikt Meurer authored
This adds a global protector to guard the lookup of "resolve" on the %Promise% intrinsic object (the initial Promise constructor), making sure that Promise.resolve yields the initial builtin method. We use this protector to avoid the lookup of "resolve" all the time inside of Promise.all and Promise.race, when called with constructor being the %Promise% intrinsic object. This improves the performance on the parallel-async-es2017-native benchmark by roughly 2-3%. Bug: v8:7253 Change-Id: Ida93b88afbaeae61f17be4cd30ea6a78b4267cea Reviewed-on: https://chromium-review.googlesource.com/955564Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51810}
-
- 26 Feb, 2018 1 commit
-
-
Marja Hölttä authored
BUG=v8:5402,v8:7310 Change-Id: Ic3ee7d2dec0403e7831f51735365c26caadc6a7b Reviewed-on: https://chromium-review.googlesource.com/934136 Commit-Queue: Marja Hölttä <marja@chromium.org> Reviewed-by:
Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#51565}
-
- 16 Feb, 2018 1 commit
-
-
Benedikt Meurer authored
The ES2017 specification contains a so-called "throwaway" promise that is used to specify the behavior of await in terms of PerformPromiseThen, but it's actually not necessary and never exposed to user code. In addition to that, hooking up the promise in await required a context (to refer to the generator object) and two closures for the reject/fulfill handling, which would resume the generator corresponding to the async function. That meant, we had to allocate 4 additional objects for every await. Instead of using a JSPromise plus the callbacks, this CL adds logic to allow PromiseReaction and PromiseReactionJobTask to carry arbitrary payloads and Code handlers. We use this for await to avoid the additional 4 objects mentioned above, and instead just have simple Code handlers that resume the generator (for the async function), either by throwing (in case of a rejection) or by resuming normally (in case of fulfillment). For this to work properly the JSGeneratorObject has to have a link to the outer promise returned by the async function, so that the catch prediction can still figure out what to do in case of promise rejection. This is done by adding a new generator_outer_promise_symbol when the debugger is active, which refers from the generator to the outer promise. With this change the doxbee-async-es2017-native test goes from around 100.54ms to around 82.45ms, which corresponds to a ~18% reduction in execution time. Bug: v8:7253 Change-Id: Iae25b3300bac351c3417be5ae687eff469b0e61f Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Reviewed-on: https://chromium-review.googlesource.com/924069Reviewed-by:
Yang Guo <yangguo@chromium.org> Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51334}
-
- 13 Feb, 2018 1 commit
-
-
Benedikt Meurer authored
This introduces dedicated builtins - FulfillPromise, - RejectPromise, and - ResolvePromise, which perform the corresponding operations from the language specification, and removes the redundant entry points and the excessive inlining of these operations into other builtins. We also add the same logic on the C++ side, so that we don't need to go into JavaScript land when resolving/rejecting from the API. The C++ side has a complete implementation, including full support for the debugger and the current PromiseHook machinery. This is to avoid constantly crossing the boundary for those cases, and to also simplify the CSA side (and soon the TurboFan side), where we only do the fast-path and bail out to the runtime for the general handling. On top of this we introduce %_RejectPromise and %_ResolvePromise, which are entry points used by the bytecode and parser desugarings for async functions, and also used by the V8 Extras API. Thanks to this we can uniformly optimize these in TurboFan, where we have corresponding operators JSRejectPromise and JSResolvePromise, which currently just call into the builtins, but middle-term can be further optimized, i.e. to skip the "then" lookup for JSResolvePromise when we know something about the resolution. In TurboFan we can also already inline the default PromiseCapability [[Reject]] and [[Resolve]] functions, although this is not as effective as it can be right now, until we have inlining support for the Promise constructor (being worked on by petermarshall@ right now) and/or SFI based CALL_IC feedback. Overall this change is meant as a refactoring without significant performance impact anywhere; it seems to improve performance of simple async functions a bit, but otherwise is neutral. Bug: v8:7253 Change-Id: Id0b979f9b2843560e38cd8df4b02627dad4b6d8c Reviewed-on: https://chromium-review.googlesource.com/911632Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Georg Neis <neis@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51260}
-
- 08 Feb, 2018 1 commit
-
-
Adam Klein authored
This reverts commit 14108f4c. Reason for revert: Not the culprit for Canary microtask crashes Original change's description: > [builtins] Mega-revert to address the Dev blocker in crbug.com/808911. > > - Revert "[builtins] Save one word in contexts for Promise.all." > This reverts commit 7632da06. > - Revert "[builtins] Also use the Promise#then protector for Promise#finally()." > This reverts commit d4f072ce. > - Revert "[builtins] Don't mess with entered context for MicrotaskCallbacks." > This reverts commit 6703dacd. > - Revert "[debugger] Properly deal with settled promises in catch prediction." > This reverts commit 40dd0658. > - Revert "[builtins] Widen the fast-path for Promise builtins." > This reverts commit db0556b7. > - Revert "[builtins] Unify PerformPromiseThen and optimize it with TurboFan." > This reverts commit a582199c. > - Revert "[builtins] Remove obsolete PromiseBuiltinsAssembler::AppendPromiseCallback." > This reverts commit 6bf88852. > - Revert "[builtins] Turn NewPromiseCapability into a proper builtin." > This reverts commit 313b490d. > - Revert "[builtins] Inline InternalPromiseThen into it's only caller" > This reverts commit f7bd6a2f. > - Revert "[builtins] Implement Promise#catch by really calling into Promise#then." > This reverts commit b23b098f. > - Revert "[promise] Remove incorrect fast path" > This reverts commit 0f6eafe8. > - Revert "[builtins] Squeeze JSPromise::result and JSPromise::reactions into a single field." > This reverts commit 8a677a28. > - Revert "[builtins] Refactor promises to reduce GC overhead." > This reverts commit 8e7737cb. > > Tbr: hpayer@chromium.org > Bug: chromium:800651, chromium:808911, v8:5691, v8:7253 > Change-Id: I8c8ea5ed32ed62f6cd8b0d027a3707ddd891e5f1 > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng > Reviewed-on: https://chromium-review.googlesource.com/906991 > Commit-Queue: Yang Guo <yangguo@chromium.org> > Commit-Queue: Adam Klein <adamk@chromium.org> > Reviewed-by: Adam Klein <adamk@chromium.org> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> > Cr-Commit-Position: refs/heads/master@{#51158} Change-Id: I09d958cbebd635a325809072a290f2f53df8c5d4 Tbr: adamk@chromium.org,yangguo@chromium.org,bmeurer@chromium.org Bug: chromium:800651, chromium:808911, v8:5691, v8:7253 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Reviewed-on: https://chromium-review.googlesource.com/908988Reviewed-by:
Adam Klein <adamk@chromium.org> Commit-Queue: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/master@{#51181}
-
- 07 Feb, 2018 1 commit
-
-
Benedikt Meurer authored
- Revert "[builtins] Save one word in contexts for Promise.all." This reverts commit 7632da06. - Revert "[builtins] Also use the Promise#then protector for Promise#finally()." This reverts commit d4f072ce. - Revert "[builtins] Don't mess with entered context for MicrotaskCallbacks." This reverts commit 6703dacd. - Revert "[debugger] Properly deal with settled promises in catch prediction." This reverts commit 40dd0658. - Revert "[builtins] Widen the fast-path for Promise builtins." This reverts commit db0556b7. - Revert "[builtins] Unify PerformPromiseThen and optimize it with TurboFan." This reverts commit a582199c. - Revert "[builtins] Remove obsolete PromiseBuiltinsAssembler::AppendPromiseCallback." This reverts commit 6bf88852. - Revert "[builtins] Turn NewPromiseCapability into a proper builtin." This reverts commit 313b490d. - Revert "[builtins] Inline InternalPromiseThen into it's only caller" This reverts commit f7bd6a2f. - Revert "[builtins] Implement Promise#catch by really calling into Promise#then." This reverts commit b23b098f. - Revert "[promise] Remove incorrect fast path" This reverts commit 0f6eafe8. - Revert "[builtins] Squeeze JSPromise::result and JSPromise::reactions into a single field." This reverts commit 8a677a28. - Revert "[builtins] Refactor promises to reduce GC overhead." This reverts commit 8e7737cb. Tbr: hpayer@chromium.org Bug: chromium:800651, chromium:808911, v8:5691, v8:7253 Change-Id: I8c8ea5ed32ed62f6cd8b0d027a3707ddd891e5f1 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Reviewed-on: https://chromium-review.googlesource.com/906991 Commit-Queue: Yang Guo <yangguo@chromium.org> Commit-Queue: Adam Klein <adamk@chromium.org> Reviewed-by:
Adam Klein <adamk@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51158}
-
- 06 Feb, 2018 2 commits
-
-
Benedikt Meurer authored
In the contexts for the resolver closures used in Promise.all we can save the "already visited" cell, by just setting the index slot to a negative value, which then indicates that this element was already done. Bug: v8:7253 Change-Id: I1296a2216eac3b51368c1e7795dbcd2c80cc430a Reviewed-on: https://chromium-review.googlesource.com/903928Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51125}
-
Benedikt Meurer authored
Add a fast-path to Promise#finally, which skips the "then" lookup of the Promise#then lookup chain is intact, similar to what we already do for Promise#catch. Drive-by-fix: Also use the @@species protector to speed up the lookup of the SpeciesConstructor in Promise#finally. Bug: v8:7253 Change-Id: If77e779a0188904effc4528beffc8f0bdd7c2efe Reviewed-on: https://chromium-review.googlesource.com/902283Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51116}
-
- 04 Feb, 2018 1 commit
-
-
Benedikt Meurer authored
This adds a new isolate wide Promise#then protector, which guards the "then" lookup for all JSPromise instances whose [[Prototype]] is the initial %PromisePrototype%. Thus arbitrary mutations to the Promise.prototype (i.e. monkey-patching other methods or installing new functions) no longer sent you down the slow-path. Use this protector in Promise.prototype.catch and in Promise.resolve. Drive-by-fix: Restructure the resolve logic a bit and avoid the expensive and large SameValue check, which can be turned into a simple reference equal, as the promise in there is known to be a JSPromise anyways. Bug: v8:7253 Change-Id: If68b12c6bc6ca9c4d10552ae84854ebc3b5774f9 Reviewed-on: https://chromium-review.googlesource.com/899302 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#51085}
-
- 02 Feb, 2018 3 commits
-
-
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}
-
Benedikt Meurer authored
This creates a uniform PerformPromiseThen builtin, which performs the operation with the same name from the spec, except that it expects the handlers to be either undefined or callable already, since this is only relevant for a single callsite (namely Promise.prototype.then). Introduce a matching operator JSPerformPromiseThen into TurboFan, which represents this operation and removes the additional checks in case of Promise.prototype.then based on the information we can derived from the receiver maps. This yields a nice 20-25% improvement on Promise.prototype.then, as illustrated by the following micro-benchmark ```js const N = 1e7; function inc(x) { return x + 1; } function chain(promise) { return promise.then(inc).then(value => { if (value < N) chain(Promise.resolve(value)); }); } console.time('total'); chain(Promise.resolve(0)); setTimeout(console.timeEnd.bind(console, 'total')); ``` which goes from around 1230ms to 930ms with this patch. Bug: v8:7253 Change-Id: I5712a863acdbe7da3bb8e621887c7b952148c51a Reviewed-on: https://chromium-review.googlesource.com/899064Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51071}
-
Benedikt Meurer authored
This method is now dead code since we introduced PromiseReaction chains as linked lists. Bug: v8:7253, v8:7310 Change-Id: I505a23d9ba4de456dbeeba9e603e70218cf6e767 Reviewed-on: https://chromium-review.googlesource.com/897515Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51052}
-
- 01 Feb, 2018 2 commits
-
-
Benedikt Meurer authored
Instead of inlining NewPromiseCapability everywhere, we should have it as a separate builtin that can be called. The motivation for doing so is to reduce the overhead of the builtins and just share the slow-path handling in a single place, plus this way we can also utilize the NewPromiseCapability functionality from TurboFan optimized code eventually. Also remove the unused %new_promise_capability intrinsic and the builtin backing it. Bug: v8:7253 Change-Id: Ic7c916a11f12d063a645e2c25cc4120badee5640 Reviewed-on: https://chromium-review.googlesource.com/897804Reviewed-by:
Yang Guo <yangguo@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51036}
-
Benedikt Meurer authored
There's now only a single caller to InternalPromiseThen left, which is the Promise.prototype.then implementation, so there's no need to have a separate helper function. Bug: v8:7253 Change-Id: I0e1ea674c942f735dd069137182232f34d16a729 Reviewed-on: https://chromium-review.googlesource.com/897762Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51031}
-
- 31 Jan, 2018 1 commit
-
-
Benedikt Meurer authored
This implements the ideas outlined in the section "Microtask queue" of the exploration document "Promise and async/await performance" (at https://goo.gl/WHRar2), except that the microtask queue stays a linear FixedArray for now, to avoid running into trouble with the parallel scavenger. This way we can already save a significant amount of allocations, thereby reducing the GC frequency quite a bit. All items on the microtask queue are now proper structs that subclass Microtask, i.e. we also wrap JSFunction and MicrotaskCallback jobs into structs. We also consistently remember the context for every microtask (except for MicrotaskCallback where we don't have a context), and execute it later in exactly that context (as required by the spec anyways for the Promise related jobs). Particularly interesting is the PromiseReactionJobTask and its subclasses, since they are designed to have the same size as the PromiseReaction. When we resolve a JSPromise we just take the existing PromiseReaction instances and morph them into PromiseFulfillReactionJobTask or PromiseRejectReactionJobTask (depending whether you "Fulfill" or "Reject"). That way the JSPromise class is now only 6 words instead of 10 words. Also the PromiseReaction and the reaction tasks can either carry a JSPromise (for the fast native case) or a PromiseCapability (for the generic case), which means we don't always pay the overhead of having to also remember the "deferred resolve" and "deferred reject" handlers that are only relevant for the generic case anyways. It also fixes a spec violation where we called "then" before we actually enqueued the PromiseResolveThenableJob, which is observably wrong. Calling it later has the advantage that it should be fairly straight-forward now to completely avoid it for native Promise instances. This seems to save around 10-20% on the various Promise benchmarks and micro-benchmarks. We expect to gain even more as we're now able to inline various operations into TurboFan optimized code easily. Bug: v8:7253 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: I893d24ca5bb046974b4f5826a8f6dd22f1210b6a Reviewed-on: https://chromium-review.googlesource.com/892819 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#50980}
-
- 19 Jan, 2018 1 commit
-
-
Peter Marshall authored
This is a reland of a7c91c77. Original change's description: > [typedarray] Port ConstructByTypedArray to CSA. > > This is needed to easily port the constructor dispatcher to CSA. > > Bug: v8:7102 > Change-Id: I9672416495940ca12088a2980a9ecc61364aef9d > Reviewed-on: https://chromium-review.googlesource.com/785630 > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> > Reviewed-by: Toon Verwaest <verwaest@chromium.org> > Commit-Queue: Peter Marshall <petermarshall@chromium.org> > Cr-Commit-Position: refs/heads/master@{#50671} Bug: v8:7102 Change-Id: I9d839343d9b95f288f806953455c2c26ca8cab06 Reviewed-on: https://chromium-review.googlesource.com/875031Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Toon Verwaest <verwaest@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#50723}
-
- 18 Jan, 2018 2 commits
-
-
Michael Achenbach authored
This reverts commit a7c91c77. Reason for revert: changes a layout test https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/21031 Original change's description: > [typedarray] Port ConstructByTypedArray to CSA. > > This is needed to easily port the constructor dispatcher to CSA. > > Bug: v8:7102 > Change-Id: I9672416495940ca12088a2980a9ecc61364aef9d > Reviewed-on: https://chromium-review.googlesource.com/785630 > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> > Reviewed-by: Toon Verwaest <verwaest@chromium.org> > Commit-Queue: Peter Marshall <petermarshall@chromium.org> > Cr-Commit-Position: refs/heads/master@{#50671} TBR=petermarshall@chromium.org,bmeurer@chromium.org,verwaest@chromium.org Change-Id: I118a1cb0d873a1d2e159619e5f327f9f6f7974c4 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: v8:7102 Reviewed-on: https://chromium-review.googlesource.com/873790Reviewed-by:
Michael Achenbach <machenbach@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/heads/master@{#50686}
-
Peter Marshall authored
This is needed to easily port the constructor dispatcher to CSA. Bug: v8:7102 Change-Id: I9672416495940ca12088a2980a9ecc61364aef9d Reviewed-on: https://chromium-review.googlesource.com/785630Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Toon Verwaest <verwaest@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#50671}
-
- 11 Jan, 2018 1 commit
-
-
Caitlin Potter authored
https://github.com/tc39/ecma262/pull/988 gained concensus during the september 2017 TC39 meetings. This moves the load of the "next" method to the very beginning of the iteration protocol, rather than during each iteration step. This impacts: - yield* - for-of loops - spread arguments - array spreads In the v8 implementation, this also affects async iteration versions of these things (the sole exception being the Async-From-Sync iterator, which requires a few more changes to work with this, likely done in a followup patch). This change introduces a new AST node, ResolvedProperty, which can be used as a callee by Call nodes to produce the same bytecode as Property calls, without observably re-loading the property. This is used in several AST-desugarings involving the iteration protocol. BUG=v8:6861, v8:5699 R=rmcilroy@chromium.org TBR=neis@chromium.org, adamk@chromium.org Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I9685db6e85315ba8a2df87a4537c2bf491e1e35b Reviewed-on: https://chromium-review.googlesource.com/857593 Commit-Queue: Caitlin Potter <caitp@igalia.com> Reviewed-by:
Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#50518}
-
- 09 Jan, 2018 3 commits
-
-
Benedikt Meurer authored
Inlining the EnqueueMicrotask logic into the various uses blows up the snapshot size significantly. So instead of doing that we just turn the operation into a dedicated builtin that we call from the various uses. This still avoids the runtime function call overhead and maintains the fast path without write barriers for the common case of the microtask queue fitting into new space. This also moves back the microtask helper CSA functions to the specialized assembler. Bug: v8:7253, chromium:799563 Change-Id: I2d24d0e5c01e442c5ad7f5d4373fbc6e94351ac5 Reviewed-on: https://chromium-review.googlesource.com/856618Reviewed-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@{#50461}
-
Michael Achenbach authored
This reverts commit bf4cc9ee. Reason for revert: Breaks windows with msvc and linux with gcc https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/841 https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/17265 Original change's description: > [esnext] load `iterator.next` only once at beginning of iteration > > https://github.com/tc39/ecma262/pull/988 gained concensus during the > september 2017 TC39 meetings. This moves the load of the "next" method > to the very beginning of the iteration protocol, rather than during > each iteration step. > > This impacts: > > - yield* > - for-of loops > - spread arguments > - array spreads > > In the v8 implementation, this also affects async iteration versions of > these things (the sole exception being the Async-From-Sync iterator, > which requires a few more changes to work with this, likely done in a > followup patch). > > This change introduces a new AST node, ResolvedProperty, which can be used > as a callee by Call nodes to produce the same bytecode as Property calls, > without observably re-loading the property. This is used in several > AST-desugarings involving the iteration protocol. > > BUG=v8:6861, v8:5699 > R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org > > Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng > Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b > Reviewed-on: https://chromium-review.googlesource.com/687997 > Commit-Queue: Caitlin Potter <caitp@igalia.com> > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> > Reviewed-by: Adam Klein <adamk@chromium.org> > Reviewed-by: Georg Neis <neis@chromium.org> > Cr-Commit-Position: refs/heads/master@{#50452} TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,caitp@igalia.com,caitp@chromium.org Change-Id: I1797c0d596dfd6850d6f0f505f591a7a990dd1f1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: v8:6861, v8:5699 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Reviewed-on: https://chromium-review.googlesource.com/857616Reviewed-by:
Michael Achenbach <machenbach@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/heads/master@{#50454}
-
Caitlin Potter authored
https://github.com/tc39/ecma262/pull/988 gained concensus during the september 2017 TC39 meetings. This moves the load of the "next" method to the very beginning of the iteration protocol, rather than during each iteration step. This impacts: - yield* - for-of loops - spread arguments - array spreads In the v8 implementation, this also affects async iteration versions of these things (the sole exception being the Async-From-Sync iterator, which requires a few more changes to work with this, likely done in a followup patch). This change introduces a new AST node, ResolvedProperty, which can be used as a callee by Call nodes to produce the same bytecode as Property calls, without observably re-loading the property. This is used in several AST-desugarings involving the iteration protocol. BUG=v8:6861, v8:5699 R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b Reviewed-on: https://chromium-review.googlesource.com/687997 Commit-Queue: Caitlin Potter <caitp@igalia.com> Reviewed-by:
Ross McIlroy <rmcilroy@chromium.org> Reviewed-by:
Adam Klein <adamk@chromium.org> Reviewed-by:
Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#50452}
-
- 07 Jan, 2018 1 commit
-
-
Timothy Gu authored
Bug: v8:7245 Change-Id: Ia8931037021b935e776230a6a50c580ad82efba8 Reviewed-on: https://chromium-review.googlesource.com/844065 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#50394}
-
- 05 Jan, 2018 1 commit
-
-
Benedikt Meurer authored
Previously the Promise builtins would always use a runtime function to schedule a new microtask, which is unnecessarily expensive. Since the runtime function only adds the microtask to a FixedArray (potentially growing that array) and increments the number of pending microtasks, it is fairly straight-forward to do this in CSA land instead. This change improves the Bluebird benchmarks by 2-4% on average. Bug: v8:7253 Change-Id: I77e96b9e5afbb4bdbe129b6bb289d9905ed581bf Reviewed-on: https://chromium-review.googlesource.com/851972 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#50372}
-
- 07 Nov, 2017 1 commit
-
-
Sathya Gunasekaran authored
We no longer need the kAlreadyVisitedSlot because we can just check for undefined in the kPromiseSlot to know if the clsoure was already fulfilled. This means we save one word per context per promise resolving closure. Bug: v8:7037 Change-Id: Ib8f0fb445d2e143714d57fe644ba6d7a3f04c1f7 Reviewed-on: https://chromium-review.googlesource.com/756176Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#49200}
-
- 16 Oct, 2017 1 commit
-
-
Benedikt Meurer authored
Port the baseline version of Reflect.has to the CodeStubAssembler and reuse the existing logic for HasProperty (i.e. the HasProperty builtin). Also inline the Reflect.has builtin into TurboFan, by adding a check on the target in front of a use of the JSHasProperty operator. Technically this additional check is not necessary, because the JSHasProperty operator already throws if the target is not a JSReceiver, but the exception message is confusing then. This improves the performance of the micro-benchmark from reflectHasPresent: 337 ms. reflectHasAbsent: 472 ms. to reflectHasPresent: 121 ms. reflectHasAbsent: 216 ms. which is a nice 2.8x improvement in the best case. It also improves the chai test on the web-tooling-benchmark by around 1-2%, which is roughly the expected win (since Reflect.has overall accounts for around 3-4%). Bug: v8:5996, v8:6936, v8:6937 Change-Id: I856183229677a71c19936f06f2a4fc7a794a9a4a Reviewed-on: https://chromium-review.googlesource.com/720959 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by:
Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#48608}
-
- 07 Sep, 2017 1 commit
-
-
Sathya Gunasekaran authored
The spec calls out to Promise.prototype.then and also passes around the constructor of the receiver to Promise.prototype.finally. Adds a new constructor slot to PromiseFinallyContext enum and this is used to create a new promise in the thenFinally/catchFinally callbacks. Created a new PromiseResolve TFS builtin refactored from the existing PromiseResolve builtin. PromiseResolveWrapper calls out to this TFS Builtin and is now exposed as Promise.resolve. The thenFinally and catchFinally callbacks also call out to the PromiseResolve TFS builtin. Spec -- https://tc39.github.io/proposal-promise-finally/ Bug: v8:5967 Change-Id: I2ce89f14d3b149619d11e424b6e37062e466c4d5 Reviewed-on: https://chromium-review.googlesource.com/652026Reviewed-by:
Georg Neis <neis@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#47898}
-
- 28 Aug, 2017 1 commit
-
-
Sathya Gunasekaran authored
Instead of using a word to store the status of the promise, this patch uses 2 bit on flags. Bug: v8:5046 Change-Id: Ic651338230dbe1704c68de8652676f236a3298f0 Reviewed-on: https://chromium-review.googlesource.com/634623 Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#47628}
-
- 22 Aug, 2017 1 commit
-
-
Sathya Gunasekaran authored
Split the PromiseFinallyContextSlot enum into two separate enums because the spec requires additional slot to store the Promise constructor in the Promise.prototype.finally builtin. This will be added in a follow on patch. Inline the various context creation functions into their callsites since they're only a single line and have only one callsite. Bug: v8:5967 Change-Id: I2834c9c3d4940b8fbbdb7c162f42323d0fe0939f Reviewed-on: https://chromium-review.googlesource.com/624543 Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by:
Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#47525}
-
- 08 Jul, 2017 1 commit
-
-
Caitlin Potter authored
- Implements the Promise.race algorithm using CodeStubAssembler. - Delete src/js/promise.js, which is no longer needed. - Migrate Promise constructor from slow to fast object in bootstrapper (per v8:5902) Increases size of snapshot_blob.bin on an x64.release build by 1.27kb. BUG=v8:5343 R=gsathya@chromium.org, cbruni@chromium.org Change-Id: I751e7389bd6ba410109640fcd7960b6021540f2f Reviewed-on: https://chromium-review.googlesource.com/535041 Commit-Queue: Caitlin Potter <caitp@igalia.com> Reviewed-by:
Camillo Bruni <cbruni@chromium.org> Cr-Commit-Position: refs/heads/master@{#46489}
-
- 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}
-