[turbofan] Refactor the JSCreateArray lowering to support more cases.

Array (subclass) constructor calls with 0 parameters are now properly
turned into inline allocations, also Array (subclass) constructor calls
with exactly one parameter, which is either known to not be a Number
or which is a known integer in the valid loop unrolling range.

Also refactor the general JSCreateArray lowering logic to properly
support Array subclasses, i.e. deal with inobject properties and
initial maps correctly.

This boosts performance of those cases significantly (and will allow
us to reduce the complexity of the Array constructor significantly
long-term). For example the simple case

  new Array("a", "b", "c", "d", "e", "f", "g")

is now around 10x faster than before.

Bug: v8:6399
Change-Id: I70661971398524ee0c6a349ee559b98a962a6266
Reviewed-on: https://chromium-review.googlesource.com/703134
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48325}
2 files changed
tree: 2ab06179beaca6c2f1aa4a7954ebca5a97c602f0
  1. .clang-format
  2. .editorconfig
  3. .gitignore
  4. .gn
  5. .ycm_extra_conf.py
  7. BUILD.gn
  9. ChangeLog
  10. DEPS
  12. LICENSE.fdlibm
  13. LICENSE.strongtalk
  14. LICENSE.v8
  15. LICENSE.valgrind
  16. Makefile
  17. Makefile.android
  18. OWNERS
  19. PRESUBMIT.py
  20. README.md
  22. benchmarks/
  23. build_overrides/
  24. codereview.settings
  25. docs/
  26. gni/
  27. gypfiles/
  28. include/
  29. infra/
  30. samples/
  31. snapshot_toolchain.gni
  32. src/
  33. test/
  34. testing/
  35. third_party/
  36. tools/

V8 JavaScript Engine

V8 is Google's open source JavaScript engine.

V8 implements ECMAScript as specified in ECMA-262.

V8 is written in C++ and is used in Google Chrome, the open source browser from Google.

V8 can run standalone, or can be embedded into any C++ application.

V8 Project page: https://github.com/v8/v8/wiki

Getting the Code

Checkout depot tools, and run

    fetch v8

This will checkout V8 into the directory v8 and fetch all of its dependencies. To stay up to date, run

    git pull origin
    gclient sync

For fetching all branches, add the following into your remote configuration in .git/config:

    fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
    fetch = +refs/tags/*:refs/tags/*


Please follow the instructions mentioned on the V8 wiki.