1. 08 Feb, 2022 1 commit
    • Benedikt Meurer's avatar
      [debug] Implement stepping out of async functions in the debugger. · 536e96cc
      Benedikt Meurer authored
      Previously the inspector was trying to handle step-out for async
      functions by annotating the async stacks, but this was merely a
      hack and didn't work reliably
      
      (a) when the async caller that is `await`ing the result of the
          callee was still in the synchronous part (because then there
          was no async task yet in the inspector), or
      (b) not at all when the async stack tracking wasn't enabled or the
          maximum async stack depth was too small.
      
      This CL replaces that hack with a pragmatic solution inside the
      V8 debugger, where upon `await` we memorize the async function
      object of the caller on the outer promise of the callee, and when
      stepping out of the callee we check whether the returned promise
      has a memorized async function object and if so, we schedule that
      to resume.
      
      This CL thereby effectively reverts https://crrev.com/c/1054618
      and replaces it with a V8 debug solution, and thereby further
      reduces the (memory) overhead of an AsyncStackTrace.
      
      Fixed: chromium:1246867
      Bug: v8:6161, v8:7753, chromium:1277451, chromium:1280519
      Change-Id: I6aa79e90f49d204f66bfd37e7a328c7fb8d635b1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3439865Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78990}
      536e96cc
  2. 04 Feb, 2022 1 commit
  3. 04 Jan, 2022 2 commits
  4. 03 Jan, 2022 1 commit
    • Benedikt Meurer's avatar
      Revert "[inspector] Fix `Runtime.setMaxCallStackSizeToCapture`." · c51b582d
      Benedikt Meurer authored
      This reverts commit 34f73cc7.
      
      Reason for revert: Performance regressions throughout a lot of
      system health and browsing benchmarks.
      
      Original change's description:
      > [inspector] Fix `Runtime.setMaxCallStackSizeToCapture`.
      >
      > This change fixes the implementation of the previously introduced API
      > `Runtime.setMaxCallStackSizeToCapture` to work correctly and also apply
      > (consistently) to stack traces captured by V8 when exceptions are
      > thrown. It does so in a fully backwards compatible manner.
      >
      > This change thus makes the previous fix for catapult (which landed in
      > http://crrev.com/c/3347789) effective, and therefore ensures that real
      > world performance benchmarks aren't affected by the use of the `Runtime`
      > domain in the catapult test framework.
      >
      > Bug: chromium:1283162, chromium:1278650, chromium:1258599
      > Bug: chromium:1280803, chromium:1280832, chromium:1280818
      > Fixed: chromium:1280831
      > Doc: https://bit.ly/v8-cheaper-inspector-stack-traces
      > Change-Id: I4ec951a858317fa49096cd4023deb0104d92c9c9
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3361839
      > Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      > Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78458}
      
      Bug: chromium:1283162, chromium:1278650, chromium:1258599
      Bug: chromium:1280803, chromium:1280832, chromium:1280818
      Bug: chromium:1280831
      Change-Id: Id1efaffa2f7f08c47f833f68b8a297494edee21e
      Fixed: chromium:1283751, chromium:1283749, chromium:1283746
      Fixed: chromium:1283729, chromium:1283700, chromium:1283700
      Fixed: chromium:1283691, chromium:1283687, chromium:1283678
      Fixed: chromium:1283677, chromium:1283676, chromium:1283675
      Fixed: chromium:1283674, chromium:1283618, chromium:1283536
      Fixed: chromium:1283523, chromium:1283516
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3364078
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78462}
      c51b582d
  5. 31 Dec, 2021 1 commit
  6. 24 Nov, 2021 1 commit
  7. 11 Nov, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Cache StackFrames by script, line and column number. · e60dc99e
      Benedikt Meurer authored
      This introduces a stack frame cache on the V8Debugger level, which
      de-duplicates StackFrame instances based on their scriptId, line and
      column number.
      
      This greatly reduces the memory pressure when debugging huge Web
      applications that have a lot of async activity (and potentially
      have scripts with huge URLs). This is guided by the observation
      that even in huge applications, there are only a very limited
      number of call sites that initiate async activity and hence we
      only have a limited number of distinct StackFrames to worry
      about (despite having to maintain a large number of async stack
      traces overall).
      
      As a nice side effect, this CL also greatly reduces the negative
      performance impact of collecting async stack traces in these
      huge applications.
      
      Generally speaking this is mostly duct tape however, and we might
      want to follow up with changes to make capturing (and storing)
      stack frames even cheaper.
      
      Fixed: chromium:1268436
      Change-Id: Ib212b3c97dce2bb7ca47d5875d45cf20b9b97afe
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3272577
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77835}
      e60dc99e
  8. 30 Sep, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Align async task frame reporting for `await`. · d6c01059
      Benedikt Meurer authored
      The V8 Inspector was sending an additional frame as part of async stack
      traces for async functions, which pointed to the first executed `await`
      in the async function. This is leaking an implementation detail of how
      (and more precisely when) the inspector decides to collect this stack
      trace. From the users perspective the async part of the stack trace is
      supposed to capture what happened _prior to the task_ - meaning in case
      of async functions: What lead to the execution of the async function.
      This is reflected by the fact that the DevTools front-end (and the V8
      Inspector itself) performs post-processing on these async call stacks,
      removing the misleading top frame from it. But this post-processing is
      not applied consistently to all async stack traces (i.e. the Console
      message stack traces don't get this), and potentially also not applied
      consistently across consumers of the Chromium debugger backend.
      
      Instead the V8 Inspector now removes the top frame itself and thus
      reports `await` consistently with how other async tasks are reported to
      debugger front-ends.
      
      Note: This preserves backwards compatibility with old versions of
      devtools-frontend, which do post-processing (for the Call Stack) only on
      async stack traces marked with "async function", while we now mark these
      async stack traces with "await" instead (aligned with what the front-end
      is using as user visibile string anyways in the Call Stack section, and
      this matching will be updated in a separate follow up CL to look for
      "await" instead of "async function").
      
      Before: https://imgur.com/kIrWcIc.png
      After: https://imgur.com/HvZGqiP
      Fixed: chromium:1254259
      Bug: chromium:1229662
      Change-Id: I57ce051a28892177b6b96221f083ae957f967e52
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193535
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77157}
      d6c01059
  9. 23 Jul, 2021 1 commit
  10. 25 Jun, 2021 1 commit
  11. 10 May, 2021 1 commit
  12. 06 May, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Consistently pass around script ID as integer. · 51fe5571
      Benedikt Meurer authored
      Within the inspector we should be consistent about passing the script ID
      always as integer, and only convert to String16 when actually needed.
      That (a) saves memory (and some runtime overhead) when stashing away
      call frames, for example in case of async stack traces, and (b) reduces
      confusion which representation to chose.
      
      Bug: chromium:1162229
      Change-Id: I9591931da0a307779372f36aba6e155ec22bbe3d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2876856
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Yang Guo <yangguo@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74410}
      51fe5571
  13. 13 Jan, 2021 1 commit
  14. 15 Dec, 2020 1 commit
  15. 22 Oct, 2020 1 commit
  16. 17 Aug, 2020 1 commit
  17. 25 Mar, 2020 1 commit
  18. 09 Feb, 2020 1 commit
  19. 04 Feb, 2020 1 commit
  20. 24 Jan, 2020 1 commit
  21. 22 Jan, 2020 1 commit
  22. 09 Jan, 2020 1 commit
  23. 20 Sep, 2019 1 commit
  24. 12 Sep, 2019 1 commit
  25. 10 Sep, 2019 1 commit
  26. 26 Jun, 2019 1 commit
  27. 15 Jun, 2019 1 commit
  28. 18 Oct, 2018 1 commit
  29. 18 Sep, 2018 2 commits
  30. 09 Aug, 2018 1 commit
    • Alexey Kozyatinskiy's avatar
      [inspector] added V8InspectorClient::resourceNameToUrl · dbfcc487
      Alexey Kozyatinskiy authored
      Some clients (see Node.js) use platform path as ScriptOrigin.
      Reporting platform path in protocol makes using protocol much harder.
      This CL introduced V8InspectorClient::resourceNameToUrl method that
      is called for any reported using protocol url.
      V8Inspector uses url internally as well so protocol client may generate
      pattern for blackboxing with file urls only and does not need to build
      complicated regexp that covers files urls and platform paths on
      different platforms.
      
      R=lushnikov@chromium.org
      TBR=yangguo@chromium.org
      
      Bug: none
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: Iff302e7441df922fa5d689fe510f5a9bfd470b9b
      Reviewed-on: https://chromium-review.googlesource.com/1164624
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55029}
      dbfcc487
  31. 25 Jul, 2018 1 commit
  32. 23 Jul, 2018 1 commit
  33. 04 Jun, 2018 1 commit
  34. 31 May, 2018 1 commit
  35. 30 May, 2018 1 commit
  36. 07 May, 2018 1 commit
  37. 14 Dec, 2017 1 commit
  38. 23 Nov, 2017 1 commit