v8/test/unittests/interpreter
jgruber b42415402f [coverage] Block coverage with support for IfStatements
This CL implements general infrastructure for block coverage together with
initial support for if-statements.

Coverage output can be generated in lcov format by d8 as follows:

$ d8 --block-coverage --lcov=$(echo ~/simple-if.lcov) ~/simple-if.js
$ genhtml ~/simple-if.lcov -o ~/simple-if
$ chrome ~/simple-if/index.html

A high level overview of the implementation follows:

The parser now collects source ranges unconditionally for relevant AST nodes.
Memory overhead is very low and this seemed like the cleanest and simplest
alternative.

Bytecode generation uses these ranges to allocate coverage slots and insert
IncBlockCounter instructions (e.g. at the beginning of then- and else blocks
for if-statements). The slot-range mapping is generated here and passed on
through CompilationInfo, and is later accessible through the
SharedFunctionInfo.

The IncBlockCounter bytecode fetches the slot-range mapping (called
CoverageInfo) from the shared function info and simply increments the counter.
We don't collect native-context-specific counts as they are irrelevant to our
use-cases.

Coverage information is finally generated on-demand through Coverage::Collect.
The only current consumer is a d8 front-end with lcov-style output, but the
short-term goal is to expose this through the inspector protocol.

BUG=v8:6000
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng

Review-Url: https://codereview.chromium.org/2882973002
Cr-Commit-Position: refs/heads/master@{#45737}
2017-06-06 15:44:55 +00:00
..
bytecode-array-builder-unittest.cc [coverage] Block coverage with support for IfStatements 2017-06-06 15:44:55 +00:00
bytecode-array-iterator-unittest.cc [ignition] Remove handles from bytecode generation 2017-02-10 17:52:39 +00:00
bytecode-array-random-iterator-unittest.cc [ignition] Remove handles from bytecode generation 2017-02-10 17:52:39 +00:00
bytecode-array-writer-unittest.cc [inspector] cache stack frame for call sites 2017-04-12 18:33:20 +00:00
bytecode-decoder-unittest.cc Reland: [ignition] Add call bytecodes for undefined receiver 2017-04-11 15:52:37 +00:00
bytecode-node-unittest.cc [Interpreter] Remove BytecodePipeline. 2017-04-12 15:18:50 +00:00
bytecode-operands-unittest.cc [Interpreter] Templatize AccumulatorUsage and OperandType for bytecode creation. 2016-12-15 07:56:21 +00:00
bytecode-register-allocator-unittest.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
bytecode-register-optimizer-unittest.cc [Interpreter] Remove BytecodePipeline. 2017-04-12 15:18:50 +00:00
bytecode-source-info-unittest.cc [Interpreter] Remove BytecodePipeline. 2017-04-12 15:18:50 +00:00
bytecode-utils.h [interpreter] Introduce bytecode generation pipeline. 2016-05-12 19:20:04 +00:00
bytecodes-unittest.cc [ignition] Optimize jump checks to range checks 2016-12-05 18:26:26 +00:00
constant-array-builder-unittest.cc [ignition] Remove handles from bytecode generation 2017-02-10 17:52:39 +00:00
interpreter-assembler-unittest.cc This is a first step towards reducing the number of stores/loads when suspending/resuming a generator. 2017-06-02 11:55:48 +00:00
interpreter-assembler-unittest.h [turbofan] Remove virtual methods from CodeAssembler. 2016-12-28 15:47:34 +00:00