99100db4f3
So far the JSCallReducer was only able to unfold constant JSBoundFunction targets for JSCall nodes, which is not the common case. With the introduction of JSCreateBoundFunction operator earlier, we can now also recognize calls to bound functions where the bind happens earlier in the function, i.e. as the example of a.map(f.bind(self)) in https://twitter.com/BenLesh/status/920700003974123520, which is a handy way to use Function#bind. So this transformation takes a node like JSCall(JSCreateBoundFunction(bound_target_function, bound_this, a1,...,aN), receiver, p1,...,pM) and turns that into JSCall(bound_target_function, bound_this, a1,...,aN,p1,...,pM) allowing TurboFan to further inline the bound_target_function at this call site if that's also inlinable (i.e. it's a known constant JSFunction or the result of a JSCreateClosure call). This improves the micro-benchmark from arrowCall: 55 ms. boundCall: 221 ms. arrowMap: 181 ms. boundMap: 806 ms. to arrowCall: 71 ms. boundCall: 76 ms. arrowMap: 188 ms. boundMap: 186 ms. so that Function#bind in this case is as fast as using closures, which is an up to 4.3x improvement in the Array#map example. Bug: v8:5257, v8:6961 Change-Id: Ibca650faad912bf9db1db6fbc48772e7551289a6 Reviewed-on: https://chromium-review.googlesource.com/727799 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#48713} |
||
---|---|---|
benchmarks | ||
build_overrides | ||
docs | ||
gni | ||
gypfiles | ||
include | ||
infra | ||
samples | ||
src | ||
test | ||
testing | ||
third_party | ||
tools | ||
.clang-format | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitignore | ||
.gn | ||
.ycm_extra_conf.py | ||
AUTHORS | ||
BUILD.gn | ||
ChangeLog | ||
CODE_OF_CONDUCT.md | ||
codereview.settings | ||
DEPS | ||
LICENSE | ||
LICENSE.fdlibm | ||
LICENSE.strongtalk | ||
LICENSE.v8 | ||
LICENSE.valgrind | ||
Makefile | ||
Makefile.android | ||
OWNERS | ||
PRESUBMIT.py | ||
README.md | ||
snapshot_toolchain.gni | ||
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://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/*
Contributing
Please follow the instructions mentioned on the V8 wiki.