8be73bad18
This patch makes `%DebugPrint(fn)` print `fn`’s feedback vector when available. Example output: ``` d8> fn = (x) => x + '.'; fn(''); %DebugPrint(fn) DebugPrint: 0x1c12b950df81: [Function] - map = 0x1c12b1802361 [FastProperties] - prototype = 0x1c12ec904591 - elements = 0x1c12f5702241 <FixedArray[0]> [HOLEY_ELEMENTS] - initial_map = - shared_info = 0x1c12ec92fde9 <SharedFunctionInfo fn> - name = 0x1c12ec92fcd1 <String[2]: fn> - formal_parameter_count = 1 - kind = [ ArrowFunction ] - context = 0x1c12ec903cd1 <FixedArray[278]> - code = 0x220721125061 <Code BUILTIN> - interpreted - bytecode = 0x1c12ec930181 - source code = (x) => x + '.' - properties = 0x1c12f5702241 <FixedArray[0]> { #length: 0x1c12e3095eb1 <AccessorInfo> (const accessor descriptor) #name: 0x1c12e3095f21 <AccessorInfo> (const accessor descriptor) } - feedback vector: 0x1c12ec9301f9: [FeedbackVector] in OldSpace - length: 1 SharedFunctionInfo: 0x1c12ec92fde9 <SharedFunctionInfo fn> Optimized Code: 0 Invocation Count: 1 Profiler Ticks: 0 Slot #0 BinaryOp MONOMORPHIC [0]: 8 0x1c12b1802361: [Map] - type: JS_FUNCTION_TYPE - instance size: 72 - inobject properties: 0 - elements kind: HOLEY_ELEMENTS - unused property fields: 0 - enum length: invalid - callable - back pointer: 0x1c12f57022d1 <undefined> - instance descriptors (own) #2: 0x1c12ec9048e9 <FixedArray[8]> - layout descriptor: 0x0 - prototype: 0x1c12ec904591 <JSFunction (sfi = 0x1c12f5707c91)> - constructor: 0x1c12f5702201 <null> - code cache: 0x1c12f5702241 <FixedArray[0]> - dependent code: 0x1c12f5702241 <FixedArray[0]> - construction counter: 0 (x) => x + '.' ``` Example output when feedback vector is not available: ``` d8> %DebugPrint(() => {}) DebugPrint: 0x1c12b950bf49: [Function] - map = 0x1c12b1802361 [FastProperties] - prototype = 0x1c12ec904591 - elements = 0x1c12f5702241 <FixedArray[0]> [HOLEY_ELEMENTS] - initial_map = - shared_info = 0x1c12ec92c021 <SharedFunctionInfo> - name = 0x1c12f5702431 <String[0]: > - formal_parameter_count = 0 - kind = [ ArrowFunction ] - context = 0x1c12ec903cd1 <FixedArray[278]> - code = 0x220721004861 <Code BUILTIN> - source code = () => {} - properties = 0x1c12f5702241 <FixedArray[0]> { #length: 0x1c12e3095eb1 <AccessorInfo> (const accessor descriptor) #name: 0x1c12e3095f21 <AccessorInfo> (const accessor descriptor) } - feedback vector: not available 0x1c12b1802361: [Map] - type: JS_FUNCTION_TYPE - instance size: 72 - inobject properties: 0 - elements kind: HOLEY_ELEMENTS - unused property fields: 0 - enum length: invalid - callable - back pointer: 0x1c12f57022d1 <undefined> - instance descriptors (own) #2: 0x1c12ec9048e9 <FixedArray[8]> - layout descriptor: 0x0 - prototype: 0x1c12ec904591 <JSFunction (sfi = 0x1c12f5707c91)> - constructor: 0x1c12f5702201 <null> - code cache: 0x1c12f5702241 <FixedArray[0]> - dependent code: 0x1c12f5702241 <FixedArray[0]> - construction counter: 0 () => {} ``` Change-Id: Ic80289bff652cfc8d04182c68740843c61c87849 Reviewed-on: https://chromium-review.googlesource.com/591369 Commit-Queue: Mathias Bynens <mathias@chromium.org> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#46977} |
||
---|---|---|
benchmarks | ||
build_overrides | ||
docs | ||
gni | ||
gypfiles | ||
include | ||
infra | ||
samples | ||
src | ||
test | ||
testing | ||
third_party | ||
tools | ||
.clang-format | ||
.editorconfig | ||
.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.