f76dfee9df
This is a change from ES5 to ES6: When reversing an array, first it is checked whether the element exists, before the element is looked up. The order in ES6 is [[HasElement]] lower [[Get]] lower (if present) [[HasElement]] upper [[Get]] upper (if present) In ES5, on the other hand, the order was [[Get]] lower [[Get]] upper [[HasElement]] lower [[HasElement]] upper To mitigate the performance impact, this patch implements a new, third copy of reversing arrays if %_HasPackedElements. This allows us to skip all membership tests, and a quick and dirty benchmark shows that the new version is faster: Over 4 runs, the slowest for the new version: d8> var start = Date.now(); for (var i = 0; i < 100000000; i++) [1, 2, 3, 4, 5].reverse(); Date.now() - start 4658 Over 3 runs, the fastest for the old version: d8> var start = Date.now(); for (var i = 0; i < 100000000; i++) [1, 2, 3, 4, 5].reverse(); Date.now() - start 5176 BUG=v8:4223 R=adamk LOG=Y Review URL: https://codereview.chromium.org/1238593003 Cr-Commit-Position: refs/heads/master@{#29716} |
||
---|---|---|
benchmarks | ||
build | ||
include | ||
infra | ||
samples | ||
src | ||
test | ||
testing | ||
third_party/binutils | ||
tools | ||
.clang-format | ||
.gitignore | ||
.ycm_extra_conf.py | ||
AUTHORS | ||
BUILD.gn | ||
ChangeLog | ||
codereview.settings | ||
DEPS | ||
LICENSE | ||
LICENSE.strongtalk | ||
LICENSE.v8 | ||
LICENSE.valgrind | ||
Makefile | ||
Makefile.android | ||
Makefile.nacl | ||
OWNERS | ||
PRESUBMIT.py | ||
README.md | ||
WATCHLISTS |
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://code.google.com/p/v8/
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/*