v8/test/webkit/fast/js
Benedikt Meurer 8e7737cb58 [builtins] Refactor promises to reduce GC overhead.
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}
2018-01-31 10:05:39 +00:00
..
kde Fix common misspellings 2017-08-02 09:35:28 +00:00
arguments-expected.txt Pass legacy const runtime flag to preparser appropriately 2016-03-18 01:09:17 +00:00
arguments.js Pass legacy const runtime flag to preparser appropriately 2016-03-18 01:09:17 +00:00
array-bad-time-expected.txt
array-bad-time.js
array-float-delete-expected.txt
array-float-delete.js
array-functions-non-arrays-expected.txt
array-functions-non-arrays.js
array-prototype-properties-expected.txt [js] Remove CHECK_OBJECT_COERCIBLE for Array methods 2017-10-20 19:29:36 +00:00
array-prototype-properties.js [js] Remove CHECK_OBJECT_COERCIBLE for Array methods 2017-10-20 19:29:36 +00:00
array-slow-put-expected.txt
array-slow-put.js
array-tostring-ignore-separator-expected.txt
array-tostring-ignore-separator.js
basic-strict-mode-expected.txt [runtime] Create only one instance of %ThrowTypeError%. 2017-07-10 08:26:02 +00:00
basic-strict-mode.js Remove the 'caller' property from the strict-mode arguments map 2016-11-04 14:30:29 +00:00
date-big-setmonth-expected.txt
date-big-setmonth.js
date-negative-setmonth-expected.txt
date-negative-setmonth.js
date-preserve-milliseconds-expected.txt
date-preserve-milliseconds.js
date-toisostring-expected.txt
date-toisostring.js
deep-recursion-test-expected.txt
deep-recursion-test.js [compiler] Make --debug-code the default in debug builds. 2016-12-02 11:36:55 +00:00
end-in-string-escape-expected.txt
end-in-string-escape.js
exception-properties-expected.txt
exception-properties.js
exception-registerfile-shrink-expected.txt
exception-registerfile-shrink.js
excessive-comma-usage-expected.txt
excessive-comma-usage.js [test] Slim down test that exceeds stack limit 2016-04-21 08:37:20 +00:00
function-apply-expected.txt
function-apply.js
function-constructor-error-expected.txt
function-constructor-error.js
function-decompilation-operators-expected.txt
function-decompilation-operators.js
function-toString-parentheses-expected.txt
function-toString-parentheses.js
function-toString-semicolon-insertion-expected.txt Adjust whitespace to make tests oblivious to --harmony-function-tostring 2016-07-22 00:18:41 +00:00
function-toString-semicolon-insertion.js Adjust whitespace to make tests oblivious to --harmony-function-tostring 2016-07-22 00:18:41 +00:00
JSON-parse-reviver-expected.txt
JSON-parse-reviver.js
modify-non-references-expected.txt
modify-non-references.js
native-error-prototype-expected.txt
native-error-prototype.js
number-tofixed-expected.txt [builtins] Increase precision limits for toFixed, etc 2017-07-20 13:05:35 +00:00
number-tofixed.js
number-toprecision-expected.txt [builtins] Increase precision limits for toFixed, etc 2017-07-20 13:05:35 +00:00
number-toprecision.js
number-toString-expected.txt Reimplement Number.prototype.toString with non-default radix. 2016-11-24 10:30:46 +00:00
number-toString.js
numeric-escapes-in-string-literals-expected.txt Change error messages for octal escape sequences 2016-12-07 17:26:42 +00:00
numeric-escapes-in-string-literals.js
object-bad-time-expected.txt
object-bad-time.js
Object-defineProperty-expected.txt
Object-defineProperty.js
object-extra-comma-expected.txt
object-extra-comma.js
object-prototype-constructor-expected.txt
object-prototype-constructor.js
object-prototype-properties-expected.txt
object-prototype-properties.js
object-prototype-toLocaleString-expected.txt
object-prototype-toLocaleString.js
object-slow-put-expected.txt
object-slow-put.js
parser-syntax-check-expected.txt [ESNext] Ship optional catch binding 2018-01-19 00:35:16 +00:00
parser-syntax-check.js [ESNext] Ship optional catch binding 2018-01-19 00:35:16 +00:00
primitive-property-access-edge-cases-expected.txt
primitive-property-access-edge-cases.js
Promise-already-rejected-expected.txt
Promise-already-rejected.js
Promise-already-resolved-expected.txt
Promise-already-resolved.js
Promise-catch-expected.txt
Promise-catch.js
Promise-chained-then-expected.txt
Promise-chained-then.js
Promise-exception-expected.txt
Promise-exception.js
Promise-init-callback-receiver-expected.txt
Promise-init-callback-receiver.js
Promise-init-expected.txt
Promise-init.js
Promise-onFulfilled-deep-expected.txt
Promise-onFulfilled-deep.js
Promise-onRejected-deep-expected.txt
Promise-onRejected-deep.js
Promise-reject-expected.txt
Promise-reject.js
Promise-resolve-chain-expected.txt
Promise-resolve-chain.js
Promise-resolve-expected.txt
Promise-resolve-state-expected.txt
Promise-resolve-state.js
Promise-resolve-with-itself-expected.txt
Promise-resolve-with-itself.js
Promise-resolve-with-then-exception-expected.txt [builtins] Refactor promises to reduce GC overhead. 2018-01-31 10:05:39 +00:00
Promise-resolve-with-then-exception.js
Promise-resolve-with-then-fulfill-expected.txt
Promise-resolve-with-then-fulfill.js
Promise-resolve-with-then-reject-expected.txt
Promise-resolve-with-then-reject.js
Promise-resolve.js
Promise-simple-expected.txt
Promise-simple.js
Promise-static-all-expected.txt
Promise-static-all.js
Promise-static-cast-expected.txt
Promise-static-cast.js
Promise-static-race-expected.txt
Promise-static-race.js
Promise-static-reject-expected.txt
Promise-static-reject.js
Promise-static-resolve-expected.txt
Promise-static-resolve.js
Promise-then-callback-receiver-expected.txt
Promise-then-callback-receiver.js
Promise-then-expected.txt
Promise-then-without-callbacks-expected.txt
Promise-then-without-callbacks.js
Promise-then.js
read-modify-eval-expected.txt
read-modify-eval.js Fix common misspellings 2017-08-02 09:35:28 +00:00
regexp-bol-expected.txt
regexp-bol-with-multiline-expected.txt
regexp-bol-with-multiline.js
regexp-bol.js
regexp-extended-characters-crash-expected.txt
regexp-extended-characters-crash.js
regexp-lastindex-expected.txt
regexp-lastindex.js
regexp-look-ahead-expected.txt
regexp-look-ahead.js
regexp-no-extensions-expected.txt
regexp-no-extensions.js
regexp-non-capturing-groups-expected.txt
regexp-non-capturing-groups.js
regexp-non-greedy-parentheses-expected.txt
regexp-non-greedy-parentheses.js
regexp-range-out-of-order-expected.txt
regexp-range-out-of-order.js
regexp-ranges-and-escaped-hyphens-expected.txt
regexp-ranges-and-escaped-hyphens.js
regexp-stack-overflow-expected.txt
regexp-stack-overflow.js
regexp-unicode-handling-expected.txt
regexp-unicode-handling.js
reserved-words-strict-expected.txt
reserved-words-strict.js
string-anchor-expected.txt
string-anchor.js
string-capitalization-expected.txt Turn on icu_case_mapping by default 2017-01-19 21:45:12 +00:00
string-capitalization.js
string-fontcolor-expected.txt
string-fontcolor.js
string-fontsize-expected.txt
string-fontsize.js
string-link-expected.txt
string-link.js
string-split-conformance-expected.txt
string-split-conformance.js
string-split-double-empty-expected.txt
string-split-double-empty.js
string-split-ignore-case-expected.txt
string-split-ignore-case.js
toString-exception-expected.txt
toString-exception.js
toString-number-expected.txt Reimplement Number.prototype.toString with non-default radix. 2016-11-24 10:30:46 +00:00
toString-number.js
toString-overrides-expected.txt Do not record source positions for non-script or native script compiles. 2016-07-08 08:49:45 +00:00
toString-overrides.js