v8/test
Benedikt Meurer 4995c85f28 [runtime] Optimize general object spread.
This adds a new %_CopyDataProperties intrinsic, that reuses most of the
existing machinery that we already have in place for Object.assign() and
computed property names in object literals. This speeds up the general
case for object spread (where the spread is not the first item in an
object literal) and brings it on par with Object.assign() at least - in
most cases it's significantly faster than Object.assign().

In the test case [1] referenced from the bug, the performance goes from

  objectSpreadLast: 3624 ms.
  objectAssignLast: 1938 ms.

to

  objectSpreadLast: 646 ms.
  objectAssignLast: 1944 ms.

which corresponds to a **5-6x performance boost**, making object spread
faster than Object.assign() in general.

Drive-by-fix: This refactors the Object.assign() fast-path in a way that
it can be reused appropriately for object spread, and adds another new
builtin SetDataProperties, which does the core of the Object.assign()
work. We can teach TurboFan to inline Object.assign() based on the new
SetDataProperties builtin at some later point to further optimize
Object.assign().

[1]: https://gist.github.com/bmeurer/0dae4a6b0e23f43d5a22d7c91476b6c0

Bug: v8:9167
Change-Id: I57bea7a8781c4a1e8ff3d394873c3cd4c5d73834
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587376
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61100}
2019-04-29 18:47:19 +00:00
..
benchmarks [test] Mark more slow tests 2019-04-26 11:51:21 +00:00
cctest heap/api: EmbedderHeapTracer: Pass along memory reducing mode 2019-04-29 16:56:09 +00:00
common [wasm-hints] Add Tests for Compilation Hints 2019-04-18 10:34:42 +00:00
debugger [Test] Add PrepareForOptimization to debugger/ tests. 2019-04-29 13:47:16 +00:00
fuzzer [cleanup] Use Vector::begin instead of Vector::start 2019-04-29 12:43:16 +00:00
inspector [cleanup] Use Vector::begin instead of Vector::start 2019-04-29 12:43:16 +00:00
intl [Intl] Add numberingSystem/calendar 2019-04-29 07:01:02 +00:00
js-perf-test [test] Remove duplicated traces from the JSTests3 config 2019-04-25 18:28:45 +00:00
memory [snapshot] Remove the builtins snapshot 2018-10-31 10:18:28 +00:00
message [ast] Refactor resolution of private names 2019-04-09 23:45:14 +00:00
mjsunit [runtime] Optimize general object spread. 2019-04-29 18:47:19 +00:00
mkgrokdump Revert "[heap] Skip ro-space from heap iterators, add CombinedHeapIterator." 2019-04-12 16:38:00 +00:00
mozilla [test] Mark more slow tests 2019-04-26 11:51:21 +00:00
preparser [test] Don't test jitless without embedded-builtins 2019-02-26 14:33:01 +00:00
test262 Remove always-true --harmony-string-matchall runtime flag 2019-04-25 10:46:05 +00:00
torque [torque] add references to HeapObject fields. 2019-04-11 14:11:18 +00:00
unittests heap/api: EmbedderHeapTracer: Pass along memory reducing mode 2019-04-29 16:56:09 +00:00
wasm-js [testrunner] handle timeout param in file 2019-02-27 17:49:17 +00:00
wasm-spec-tests [wasm] Update spec tests 2019-04-29 08:03:46 +00:00
webkit [test] Test more wasm variants 2019-04-09 13:41:52 +00:00
BUILD.gn [cctest] Enable shared linking for cctest 2019-04-09 12:12:19 +00:00
OWNERS Make tmrts an infra OWNER 2019-02-15 09:02:24 +00:00