v8/test
Peter Marshall a450c18544 [builtins] Copy array contents using JS in ConstructByArrayLike.
The last CL https://chromium-review.googlesource.com/c/456707/ caused
some pretty heavy performance regressions. After experimenting, it
seems the easiest and most straight-forward way to copy the elements
into the new typed array is to do it in JS.

Adds a fast path for typed arrays, where the source typed array has
the same elements kind, in which case we can just copy the backing
store using memcpy.

This CL also removes regression test 319120 which is from a pwn2own
vulnerability. The old code path enforced a maximum byte_length
that was too low, which this change removes. The length property of
the typed array must be a Smi, but the byte_length, which can be up
to 8x larger than length for a Float64Array, can be a heap number.

We can also re-use some of the logic from ConstructByLength when
deciding whether to allocate the buffer on- or off-heap, so that
is factored out into InitializeBasedOnLength. We can also re-use
the DoInitialize helper instead of calling into the runtime,
meaning we can remove InitializeFromArrayLike.

BUG=v8:5977,chromium:705503,chromium:705394

Change-Id: I63372652091d4bdf3a9491acef9b4e3ac793a755
Reviewed-on: https://chromium-review.googlesource.com/459621
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44301}
2017-03-31 10:37:57 +00:00
..
benchmarks
cctest [wasm] [cleanup] Attach methods to the object they operate on 2017-03-31 08:12:15 +00:00
common [wasm] [interpreter] Implement indirect function calls 2017-03-23 10:54:58 +00:00
debugger [inspector] prepared console before moving into builtins 2017-03-29 23:04:49 +00:00
fuzzer Make isolate explicit param of parsing:: functions 2017-03-28 08:20:56 +00:00
inspector [inspector] support setTimeout in Debugger.scheduleStepIntoAsync method 2017-03-30 14:42:24 +00:00
intl [asm.js] Widen test coverage to cctest and friends. 2017-03-28 08:00:40 +00:00
js-perf-test [Tests] Update resources for SixSpeed and JSTest tests. 2017-03-31 07:57:51 +00:00
memory [snapshot] support multiple contexts in the same snapshot. 2016-06-15 15:39:06 +00:00
message [type-profile] Collect types for parameters. 2017-03-31 09:53:16 +00:00
mjsunit [builtins] Copy array contents using JS in ConstructByArrayLike. 2017-03-31 10:37:57 +00:00
mozilla [asm.js] Widen test coverage to cctest and friends. 2017-03-28 08:00:40 +00:00
preparser
promises-aplus
simdjs Store the FunctionTemplateInfo used to create remote objects in the map 2017-03-15 15:57:38 +00:00
test262 [async-iteration] implement AsyncGenerator 2017-03-29 17:33:12 +00:00
unittests [interpreter] Split function into Receiver() and Parameter(i). 2017-03-30 09:40:08 +00:00
webkit [asm.js] Widen test coverage to message tests. 2017-03-29 08:42:32 +00:00
bot_default.gyp [build] Make inspector the default in gyp 2017-03-30 15:08:31 +00:00
bot_default.isolate [debugger] basic test infrastructure for new debugger test api. 2016-10-21 06:38:05 +00:00
BUILD.gn Remove SIMD.js from V8. 2017-02-14 06:57:25 +00:00
default.gyp [build] Make inspector the default in gyp 2017-03-30 15:08:31 +00:00
default.isolate Add inspector tests to default tests to run locally. 2016-11-04 08:50:07 +00:00
optimize_for_size.gyp
optimize_for_size.isolate [debugger] basic test infrastructure for new debugger test api. 2016-10-21 06:38:05 +00:00
perf.gyp
perf.isolate Remove SIMD.js from V8. 2017-02-14 06:57:25 +00:00