v8/test/cctest/compiler
Daniel Clifford 6452b26a4b Reimplement Array.prototype.slice in CSA and C++
Previously, V8's slice was implemented in a combination of C++ and a 
Javascript fallback. The disadvantage of this approach was that the
fast-path required a call through the CEntryStub, which introduced
considerable overhead for small arrays with fast elements kinds.

Now the implementation primarily uses the CSA to generate both the
full spec-complaint implementation as well as fast paths for argument
objects and arrays with fast elements kinds. The CSA implementation
uses a C++ implementation fallback in select situations where the the
complexity of a CSA implementation would be too great and the
CEntryStub overhead is not decisive (e.g. slices of dictionary
elements arrays).

Performance results on semi-random arrays with small number of
elements (old vs. new):

smi copy: 48.7 ms vs. 12 ms
smi slice: 43.5 ms 14.8 ms
object copy: 35.5 ms 7.7 ms
object slice: 38.7 ms 8.8 ms
dictionary slice: 2398.3 ms vs. 5.4 ms
fast sloppy arguments slice: 9.6 ms vs. 7.2 ms
slow sloppy arguments slice: 28.9 ms vs. 8.5 ms

As a bonus, the new implementation is fully spec-compliant and fixes
at least one existing bug.

The design document for Array.prototype builtin rework can be found
at https://goo.gl/wFHe2n

Bug: v8:1956,v8:6601,v8:6710,v8:6978
Change-Id: Ia0155bedcf39b4577605ff754f416c2af938efb7
Reviewed-on: https://chromium-review.googlesource.com/574710
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48853}
2017-10-24 06:39:47 +00:00
..
c-signature.h [wasm] Replace the BufferedRawMachineAssemblerTester in the WasmRunner. 2016-02-18 09:55:49 +00:00
call-tester.h [cleanup] Remove return after UNREACHABLE 2017-05-22 13:10:01 +00:00
code-assembler-tester.h [cctest] Record execution of parallel moves. 2017-10-11 14:18:49 +00:00
codegen-tester.cc Reland "[test] Avoid unnecessary std::vector allocations" 2017-10-19 08:47:31 +00:00
codegen-tester.h Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
function-tester.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
function-tester.h [cleanup] Add templatized FunctionTester::CallChecked(...) helpers 2017-07-18 14:25:21 +00:00
graph-builder-tester.h Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-basic-block-profiler.cc [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h 2017-02-23 12:10:21 +00:00
test-branch-combine.cc [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h 2017-02-23 12:10:21 +00:00
test-code-assembler.cc [csa] fix variable merge for switch default label 2017-09-26 12:31:29 +00:00
test-code-generator.cc [test] Add missing field definitions 2017-10-23 09:10:15 +00:00
test-gap-resolver.cc Add bound checking to RegisterConfiguration accessors function. 2017-08-18 09:24:31 +00:00
test-graph-visualizer.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-instruction.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-js-constant-cache.cc [iwyu] Remove stale TODOs about objects-inl.h inclusion. 2017-10-09 11:14:59 +00:00
test-js-context-specialization.cc [compiler][modules] Constant-fold loads of module cells. 2017-05-04 11:09:19 +00:00
test-js-typed-lowering.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-jump-threading.cc [cleanup] Fix remaining (D)CHECK macro usages 2017-10-18 10:12:31 +00:00
test-linkage.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-loop-analysis.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-machine-operator-reducer.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-multiple-return.cc Remove ComputeFlags, simply pass in Code::Kind instead of Code::Flags 2017-09-29 15:37:27 +00:00
test-node.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-operator.cc Start preparing test/cctest for jumbo compilation 2017-08-14 20:58:10 +00:00
test-representation-change.cc [turbofan] Propagate minus-zero truncation in representation inference. 2017-03-08 06:11:37 +00:00
test-run-bytecode-graph-builder.cc [tests] Create canonicalized handle scope for Turbofan. 2017-10-18 07:41:43 +00:00
test-run-calls-to-external-references.cc [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h 2017-02-23 12:10:21 +00:00
test-run-deopt.cc [fullcodegen] Remove --stress-fullcodegen flag. 2017-08-10 09:52:49 +00:00
test-run-intrinsics.cc Remove SubString intrinsic and convert SubString code stub to CSA. 2017-10-18 05:52:47 +00:00
test-run-jsbranches.cc [turbofan] Remove for-in support from the AstGraphBuilder. 2017-02-08 06:41:42 +00:00
test-run-jscalls.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-run-jsexceptions.cc [fullcodegen] Remove --stress-fullcodegen flag. 2017-08-10 09:52:49 +00:00
test-run-jsobjects.cc [iwyu] Remove stale TODOs about objects-inl.h inclusion. 2017-10-09 11:14:59 +00:00
test-run-jsops.cc [fullcodegen] Remove --stress-fullcodegen flag. 2017-08-10 09:52:49 +00:00
test-run-load-store.cc Start preparing test/cctest for jumbo compilation 2017-08-14 20:58:10 +00:00
test-run-machops.cc Reland "[test] Add nan bit patterns to uint{32,64}_vector" 2017-10-20 10:17:52 +00:00
test-run-native-calls.cc Remove ComputeFlags, simply pass in Code::Kind instead of Code::Flags 2017-09-29 15:37:27 +00:00
test-run-stackcheck.cc [fullcodegen] Remove --stress-fullcodegen flag. 2017-08-10 09:52:49 +00:00
test-run-stubs.cc Reimplement Array.prototype.slice in CSA and C++ 2017-10-24 06:39:47 +00:00
test-run-unwinding-info.cc [turbofan] Replace uninitialized JSCall nodes with SOFT deopt. 2017-06-27 03:57:13 +00:00
test-run-variables.cc Use nullptr instead of NULL where possible 2017-10-13 17:21:49 +00:00
test-run-wasm-machops.cc [wasm] Store the globals_start in WasmContext. 2017-10-16 09:35:47 +00:00
value-helper.cc Reland "[test] Avoid unnecessary std::vector allocations" 2017-10-19 08:47:31 +00:00
value-helper.h Reland "[test] Add nan bit patterns to uint{32,64}_vector" 2017-10-20 10:17:52 +00:00