Commit Graph

4 Commits

Author SHA1 Message Date
Mathias Bynens
26c00f4a4c [elements] Rename FAST elements kinds
The `FAST_` prefix doesn’t make much sense — they’re all just different cases
with their own optimizations. Packedness being implicit (e.g. `FAST_ELEMENTS`
vs. `FAST_HOLEY_ELEMENTS`) is not ideal, either.

This patch renames the FAST elements kinds as follows:

- e.g. FAST_ELEMENTS => PACKED_ELEMENTS
- e.g. FAST_HOLEY_ELEMENTS => HOLEY_ELEMENTS

The following exceptions are left intact, for lack of a better name:

- FAST_SLOPPY_ARGUMENTS_ELEMENTS
- SLOW_SLOPPY_ARGUMENTS_ELEMENTS
- FAST_STRING_WRAPPER_ELEMENTS
- SLOW_STRING_WRAPPER_ELEMENTS

This makes it easier to reason about elements kinds, and less confusing to
explain how they’re used.

R=jkummerow@chromium.org, cbruni@chromium.org
BUG=v8:6548

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ie7c6bee85583c3d84b730f7aebbd70c1efa38af9
Reviewed-on: https://chromium-review.googlesource.com/556032
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46361}
2017-06-30 13:31:44 +00:00
bmeurer
07e163bd5a [js-perf-test] Add microbenchmarks for materialized rest parameters.
Functions that take mandatory parameters plus a number of optional
parameters, that need to be materialized as an Array are quite common.
The simplest possible case of this is essentially:

  function foo(mandatory, ...args) { return args; }

Babel translates this to something like:

  function foo(mandatory) {
    "use strict";
    for (var _len = arguments.length,
             args = Array(_len > 1 ? _len - 1 : 0),
             _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    return args;
  }

The key to great performance here is to make sure that we don't
materialize the (unmapped) arguments object in this case, plus that we
have some kind of fast-path for the Array constructor and the
initialization loop.

This microbenchmark ensures that we have decent performance even in the
case where the assignment to args is polymorphic, i.e. the arguments
have seen different elements kinds, starting with FAST_HOLEY_ELEMENTS
and then FAST_HOLEY_SMI_ELEMENTS.

R=yangguo@chromium.org
BUG=v8:6262

Review-Url: https://codereview.chromium.org/2823343004
Cr-Commit-Position: refs/heads/master@{#44709}
2017-04-19 05:25:40 +00:00
caitpotter88
0cc8eaa4c6 [es6] fixup for rest parameters perf test
BUG=v8:2160
LOG=N
NOTRY=true
R=adamk, machenbach@chromium.org, rossberg

Review URL: https://codereview.chromium.org/1331803003

Cr-Commit-Position: refs/heads/master@{#30682}
2015-09-10 13:45:08 +00:00
caitpotter88
ce95a4db69 [es6] add js-perf-test for rest parameters
BUG=v8:2160
LOG=N
R=adamk, rossberg, wingo

Review URL: https://codereview.chromium.org/1317113007

Cr-Commit-Position: refs/heads/master@{#30647}
2015-09-08 23:17:11 +00:00