1. 02 Oct, 2018 1 commit
  2. 04 Apr, 2018 1 commit
    • jgruber's avatar
      [coverage] Fix invalid coverage block transformation · e42ce200
      jgruber authored
      Before reporting coverage data, we attempt to reduce clutter by
      merging nested and consecutive ranges. Nested ranges are merged, if
      the child range has the same execution count as the parent range.
      Sibling ranges are merged, if one sibling begins where the other ends
      and execution counts are identical.
      
      This allowed an invalid transformation in which a range with an
      execution count of 1 would be merged into the parent change, but the
      sibling range with identical start and end points and a count of 0
      would remain, effectively deleting the covered range.
      
      For example:
      
      {start: 0, end: 10, count: 1},
      {start: 5, end:  8, count: 1},  // It's invalid to remove this.
      {start: 5, end:  8, count: 0}
      
      The fix is to separate the parent and sibling merge passes, and
      removing duplicate ranges in-between.
      
      Bug: chromium:827530
      Change-Id: Ic35eae1d4a106746570ce9cb412ed6710ef6da53
      Reviewed-on: https://chromium-review.googlesource.com/992114Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52352}
      e42ce200
  3. 12 Jan, 2018 1 commit
  4. 12 Dec, 2017 1 commit
  5. 24 Nov, 2017 1 commit
  6. 20 Nov, 2017 1 commit
  7. 17 Nov, 2017 1 commit
    • Jakob Gruber's avatar
      Revert "[coverage] add coverage for binary expressions" · 9037639e
      Jakob Gruber authored
      This reverts commit 4d3bc552.
      
      Reason for revert: https://crbug.com/785778
      
      Original change's description:
      > [coverage] add coverage for binary expressions
      > 
      > Adds block-level coverage tracking for binary && and ||
      > expressions. Introduces a BinaryOperation source-range
      > for tracking the operations themselves and an Expression
      > source-range, used for tracking NaryLogical expressions.
      > 
      > This builds on work by jgruber@chromium.org in
      > the issue.
      > 
      > TBR=marja@chromium.org
      > R=​jgruber@chromium.org, rmcilroy@chromium.org
      > 
      > Bug: v8:6660
      > Change-Id: I83a81f13a3514a734c06948b2d3e91138fb00e18
      > Reviewed-on: https://chromium-review.googlesource.com/754564
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#49304}
      
      TBR=rmcilroy@chromium.org,marja@chromium.org,jgruber@chromium.org,ben@npmjs.com
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:6660
      Change-Id: Ie017c528604b2e01400f527511413eaea5786198
      Reviewed-on: https://chromium-review.googlesource.com/776768Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49454}
      9037639e
  8. 10 Nov, 2017 1 commit
  9. 09 Nov, 2017 1 commit
  10. 10 Aug, 2017 1 commit
  11. 02 Aug, 2017 1 commit
  12. 28 Jul, 2017 1 commit
  13. 27 Jul, 2017 1 commit
  14. 26 Jul, 2017 2 commits
  15. 14 Jul, 2017 2 commits
  16. 13 Jul, 2017 2 commits
  17. 12 Jul, 2017 1 commit
  18. 11 Jul, 2017 1 commit
  19. 07 Jul, 2017 1 commit
  20. 06 Jul, 2017 1 commit
  21. 23 Jun, 2017 1 commit
  22. 21 Jun, 2017 1 commit
    • jgruber's avatar
      [coverage] Improve source range precision · 63a7fa5a
      jgruber authored
      This CL improves reported source range precision in a couple of ways:
      
      Source ranges are now standardized to consist of an inclusive start
      index and an exclusive end index (similar to what's reported for
      functions). For example:
      
      0123456789  // Offset.
      { f(); }    // Block represented as range {0,8}.
      
      Duplicate singleton ranges (i.e. same start and end offsets) are now
      merged (this only becomes relevant once jump statement coverage is
      added). For example:
      
      for (.) break;  // Break- and loop continuation have same positions.
      
      SourceRangeScope incorrectly collected starting position
      (unconditionally) and end position (when no semi-colon was present).
      
      01234567890123  // Offset.
      for (.) break   // Loop body range is {8,13}, was {6,9}.
      
      Bug: v8:6000
      Change-Id: I62e7c70cc894a20f318330a2fbbcedc47da2b5db
      Reviewed-on: https://chromium-review.googlesource.com/541358
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46095}
      63a7fa5a
  23. 19 Jun, 2017 1 commit
    • jgruber's avatar
      [coverage] Add continuation counters · 95882f0e
      jgruber authored
      Track execution counts of the continuations of block structures (e.g.
      IfStatements) to capture cases in which execution does not continue after a
      block. For example:
      
      for (;;) {
        return;
      }
      // Never reached, tracked by continuation counter.
      
      A continuation counter only has a start position; it's range is implicitly
      until the next sibling range or the end of the parent range.
      
      Bug: v8:6000
      Change-Id: I8e8f1f5b140b64c86754b916e626eb50f0707d70
      Reviewed-on: https://chromium-review.googlesource.com/530846
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46006}
      95882f0e
  24. 08 Jun, 2017 1 commit
  25. 06 Jun, 2017 1 commit
    • jgruber's avatar
      [coverage] Block coverage with support for IfStatements · b4241540
      jgruber authored
      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}
      b4241540
  26. 22 Feb, 2017 1 commit
  27. 16 Feb, 2017 1 commit
  28. 14 Feb, 2017 1 commit
  29. 10 Feb, 2017 1 commit
    • yangguo's avatar
      [debugger] add precise mode for code coverage. · 8422e25b
      yangguo authored
      Collecting precise invocation counts need to be explicitly
      enabled. Once enabled, we disable optimization (optimized
      code does not increment invocation count, and may inline
      callees), and make sure feedback vectors interesting for
      code coverage is not garbage-collected.
      
      R=hpayer@chromium.org, jgruber@chromium.org
      BUG=v8:5808
      
      Review-Url: https://codereview.chromium.org/2686063002
      Cr-Commit-Position: refs/heads/master@{#43082}
      8422e25b
  30. 09 Feb, 2017 1 commit
    • yangguo's avatar
      [debugger] implement per-function code coverage. · 058d7ab7
      yangguo authored
      Collect code coverage from the available invocation counts.
      The granularity is at function level, and invocation counts may
      be lost to GC.
      
      Coverage::Collect returns a std::vector of Coverage::ScriptData.
      Each ScriptData contains a script ID and a std::vector of
      Coverage::RangeEntry.
      Each RangeEntry consists of a end position and the invocation
      count. The start position is implicit from the end position of
      the previous RangeEntry, or 0 if it's the first RangeEntry.
      
      R=jgruber@chromium.org
      BUG=v8:5808
      
      Review-Url: https://codereview.chromium.org/2689493002
      Cr-Commit-Position: refs/heads/master@{#43072}
      058d7ab7