v8/test
Sigurd Schneider 0d7889d0b1 [coverage] Correctly report coverage for inline scripts
This fixes a bug where coverage for the inline script
  <script>function foo() {}<script>
started to get deterministically reported as covered
after crrev.com/c/1771776, while before it, we most of
the time reported it as uncovered (depending on heap
order of SFIs). The correct result is to report `foo`
as uncovered as it is never called.

The problem arose from the fact that v8:9212 needed to
handle extra-wrappers around scripts correctly. Those
wrappers have the same source range as the wrapped
script and a call count of zero even if the wrapped
script is executed. To filter them out, we previously
determined nesting for identical source ranges by
ascending call count. However, in the script case above,
the script has call count one, while `foo` (which has
the same source range) has call count zero. In this
case, nesting is decreasing order of call counts.

This CL is a minimal change that sorts SFIs which are
top-level to the front, only then considers call counts
in descending order. This preserves the behavior that
node's extra wrappers are sorted to the front (and
then filtered out by existing logic), but also ensures
that for the example above, we report the script's
coverage before the coverage for `foo`.


Bug: v8:9857, v9:9212
Change-Id: Id224b0d8f12028b1f586ee5039e126bb5b8d8d36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1863197
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64307}
2019-10-16 08:23:55 +00:00
..
benchmarks [test] Skip slow tests 2019-10-14 07:37:15 +00:00
cctest Reland "Unconditionally enable snapshot builds and remove 'v8_use_snapshot'" 2019-10-16 06:01:05 +00:00
common [wasm] Rename {Get,Set}Global to Global{Get,Set} 2019-10-08 14:27:50 +00:00
debugger Reland "[Heap] Create a fast path for young allocations." 2019-09-16 13:25:51 +00:00
fuzzer [wasm] Rename {Get,Set}Global to Global{Get,Set} 2019-10-08 14:27:50 +00:00
inspector [class] implement static private methods 2019-10-10 15:34:44 +00:00
intl [Intl] Only set HourCycle if needed 2019-10-11 20:44:17 +00:00
js-perf-test [perf-test] Add a performance test for LdaGlobal bytecodes 2019-10-09 16:34:33 +00:00
memory [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
message [wasm-simd] Implement memory tracing for kSimd128 data types 2019-10-11 20:45:21 +00:00
mjsunit [coverage] Correctly report coverage for inline scripts 2019-10-16 08:23:55 +00:00
mkgrokdump Reland "Unconditionally enable snapshot builds and remove 'v8_use_snapshot'" 2019-10-16 06:01:05 +00:00
mozilla [CSA][cleanup] TNodify builtins constructor gen 2019-09-12 10:55:18 +00:00
preparser Add OWNERS files for src and test 2019-05-30 04:51:21 +00:00
test262 [test] Fix test-skip config 2019-10-14 06:59:24 +00:00
torque [torque] Add HeapSlice location references to Torque 2019-08-30 11:51:32 +00:00
unittests Reland "Unconditionally enable snapshot builds and remove 'v8_use_snapshot'" 2019-10-16 06:01:05 +00:00
wasm-api-tests [wasm-c-api] Roll bf31edf: Fix life times of host info 2019-08-26 14:28:51 +00:00
wasm-js [wasm][bulk] Update the element segment decoding to the new spec changes 2019-09-17 13:25:42 +00:00
wasm-spec-tests Rename clemensh to clemensb in OWNERS 2019-09-26 08:44:44 +00:00
webkit [regexp] Add missing case for EscapeRegExpPattern 2019-07-09 08:11:51 +00:00
BUILD.gn [wasm-c-api] Add tests and fixes 2019-05-28 09:57:04 +00:00
OWNERS Use relative paths to OWNERS files 2019-08-12 13:52:52 +00:00