1. 22 Jun, 2018 1 commit
  2. 03 Jun, 2018 1 commit
  3. 30 May, 2018 1 commit
    • Alexey Kozyatinskiy's avatar
      [inspector] reworked async stack instrumentation for async functions · b6c9086c
      Alexey Kozyatinskiy authored
      New intstrumentation consists of:
      - kAsyncFunctionSuspended when async function is suspended on await
        (called on each await),
      - kAsyncFunctionFinished when async function is finished.
      
      Old instrumentation was based on reusing async function promise.
      Using this promise produces couple side effects:
      - for any promise instrumentation we first need to check if it is
        special case for async function promise or not - it requires
        expensive reading from promise object.
      - we capture stack for async functions even if it does not contain
        awaits.
      - we do not properly cancel async task created for async function.
      
      New intsrumntation resolved all these problems as well as provide
      clear mapping between async task and generator which we can use later
      to fetch scope information for async functions on pause.
      
      R=dgozman@chromium.org,yangguo@chromium.org
      
      Bug: v8:7078
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: Ifdcec947d91e6e3d4d5f9029bc080a19b8e23d41
      Reviewed-on: https://chromium-review.googlesource.com/1043096Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53445}
      b6c9086c
  4. 09 May, 2018 1 commit
  5. 12 Feb, 2018 1 commit
  6. 21 Nov, 2017 1 commit
    • Alexey Kozyatinskiy's avatar
      [inspector] reworked async instrumentation for promises · ed9b2072
      Alexey Kozyatinskiy authored
      Old instrumentation was designed to collect promise creation stack and
      promise scheduled stack together. In DevTools for last 6 months we
      show only creation stack for promises. We got strong support from users
      for new model. Now we can drop support for scheduled stacks and
      simplify implementation.
      
      New promise instrumentation is straightforward:
      - we send kDebugPromiseThen when promise is created by .then call,
      - we send kDebugPromiseCatch when promise is created by .catch call,
      - we send kDebugWillHandle before chained callback and kDebugDidHandle
        after chained callback,
      - and we send separate kDebugAsyncFunctionPromiseCreated for internal
        promise inside async await function.
      
      Advantages:
      - we reduce amount of captured stacks (we do not capture stack for
        promise that constructed not by .then or .catch),
      - we can consider async task related to .then and .catch as one shot
        since chained callback is executed once,
      - on V8 side we can implement required instrumentation using only
        promise hooks,
      
      Disadvantage:
      - see await-promise test, sometimes scheduled stack was useful since we
        add catch handler in native code,
      
      Implementation details:
      - on kInit promise hook we need to figure out why promise was created.
        We analyze builtin functions until first user defined function on
        current stack. If there is kAsyncFunctionPromiseCreate function then
        we send kDebugAsyncFunctionPromiseCreated event. If there is
        kPromiseThen or kPromiseCatch then only if this function is bottom
        builtin function we send corresponded event to inspector. We need it
        because Promise.all internally calls .then and in this case we have
        Promise.all and Promise.then on stack at the same time and we do not
        need to report this internally created promise to inspector.
      
      Bug: chromium:778796
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: I53f47ce8c5c4a9897655c3396c249ea59529ae47
      Reviewed-on: https://chromium-review.googlesource.com/765208
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49553}
      ed9b2072
  7. 11 Aug, 2017 1 commit
  8. 02 Aug, 2017 1 commit
    • Alexey Kozyatinskiy's avatar
      [inspector] move breakpoint management to native · cd9e86a5
      Alexey Kozyatinskiy authored
      My goal was to move breakpoint API to native with minimal changes around, so on inspector side we use v8::debug::BreakpointId instead of String16, on v8::internal::Debug we use i::BreakPoint object instead of break point object created inside of debug.js.
      
      There are a lot of opportunities how we can improve breakpoints (at least we can avoid some of linear lookups to speedup implementation) but I think that as first step we need to remove mirrors/debug.js APIs.
      
      Drive by: debugger-script.js and usage of debugger context in inspector code base.
      
      R=yangguo@chromium.org,jgruber@chromium.org,clemensh@chromium.org
      
      Bug: v8:5510,chromium:652939
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I0b17972c39053dd4989bbe26db2bb0b88ca378f7
      Reviewed-on: https://chromium-review.googlesource.com/593156Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47091}
      cd9e86a5
  9. 12 Jun, 2017 1 commit
    • Alexey Kozyatinskiy's avatar
      [inspector] introduced console.context · 701d79d0
      Alexey Kozyatinskiy authored
      console.context(name:string) method returns console instance, this console instance fully implements console interface (including fact that any method can be called without console as receiver).
      Protocol.Runtime.consoleAPICalled notification contains additional context:string field:
      - "anonymous#unique-id" for any method call on unnamed console context,
      - "name#unique-id" for any method call on named console context.
      
      console.count and console.timeEnd have context as a scope.
      console.clear clear all messages regardless on what context instance it was called.
      
      console calls is ~10% slower with this CL since we need to store and then fetch console_context_id and console_context_name from function object.
      We recently (in April) made console calls twice faster so 10% doesn't sound critical and existing of console.log call in hot code is problem by itself.
      
      R=pfeldman@chromium.org
      
      Bug: chromium:728767
      Change-Id: I5fc73216fb8b28bfe1e8c2c1b393ebfbe43cd02e
      Reviewed-on: https://chromium-review.googlesource.com/522128Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45864}
      701d79d0
  10. 20 Apr, 2017 1 commit
    • kozyatinskiy's avatar
      [inspector] removed kDebugPromiseCollected event · 189ffd94
      kozyatinskiy authored
      With recent CLs we always store maximum N async stack traces and when we reach limit we drop half of them.
      Current promise collected event requires creating weak handle:
      - it takes time,
      - it consumes memory.
      Since async task id distribution for promises is uniform (each new promise has last_async_task_id + 1 as an id) our hash map is good enough to handle any amount of async task ids, following time of executing 1 000 000 000 of lookups:
      - for empty hash map: 1.45 seconds,
      - for hash map with one entry: 14.95 seconds
      - 1024 entries: 15.03 seconds
      - 1024 * 1024 entries: 14.82 seconds
      - 1024 * 1024 * 1024: 17.9 seconds
      
      BUG=v8:6189
      R=dgozman@chromium.org,yangguo@chromium.org
      
      Review-Url: https://codereview.chromium.org/2819423005
      Cr-Commit-Position: refs/heads/master@{#44750}
      189ffd94
  11. 18 Apr, 2017 1 commit
  12. 06 Apr, 2017 1 commit
  13. 05 Apr, 2017 1 commit
  14. 04 Apr, 2017 2 commits
  15. 03 Apr, 2017 2 commits
  16. 06 Mar, 2017 1 commit
  17. 16 Feb, 2017 1 commit
  18. 25 Jan, 2017 1 commit
    • kozyatinskiy's avatar
      [inspector] change target promise for kDebugWillHandle & kDebugDidHandle · cb545a8c
      kozyatinskiy authored
      - kDebugPromiseCreated(task, parent_task)
      This event occurs when promise is created (PromiseHookType::Init). V8Debugger uses this event to maintain task -> parent task map.
      
      - kDebugEnqueueAsyncFunction(task)
      This event occurs when first internal promise for async function is created. V8Debugger collects stack trace at this point.
      
      - kDebugEnqueuePromiseResolve(task),
      This event occurs when Promise fulfills with resolved status. V8Debugger collects stack trace at this point.
      
      - kDebugEnqueuePromiseReject(task),
      This event occurs when Promise fulfills with rejected status. V8Debugger collects stack trace at this point.
      
      - kDebugPromiseCollected,
      This event occurs when Promise is collected and no other chained callbacks can be added. V8Debugger removes information about async task for this promise.
      
      - kDebugWillHandle,
      This event occurs when chained promise function (either resolve or reject handler) is called. V8Debugger installs parent promise's stack (based on task -> parent_task map) as current if available or current promise's scheduled stack otherwise.
      
      - kDebugDidHandle,
      This event occurs after chained promise function has finished. V8Debugger restores asynchronous call chain to previous one.
      
      With this change all instrumentation calls are related to current promise (before WillHandle and DidHandle were related to next async task).
      
      Before V8Debugger supported only the following:
      - asyncTaskScheduled(task1)
      - asyncTaskStarted(task1)
      - asyncTaskFinished(task1)
      
      Now V8Debugger supports the following:
      - asyncTaskScheduled(parent_task)
      ..
      - asyncTaskCreated(task, parent_task),
      - asyncTaskStarted(task), uses parent_task scheduled stack
      - asyncTaskScheduled(task)
      - asyncTaskFinished(task)
      
      Additionally: WillHandle and DidHandle were migrated to PromiseHook API.
      
      More details: https://docs.google.com/document/d/1u19N45f1gSF7M39mGsycJEK3IPyJgIXCBnWyiPeuJFE
      
      BUG=v8:5738
      R=dgozman@chromium.org,gsathya@chromium.org,yangguo@chromium.org
      
      Review-Url: https://codereview.chromium.org/2650803003
      Cr-Commit-Position: refs/heads/master@{#42644}
      cb545a8c
  19. 13 Jan, 2017 1 commit
  20. 10 Jan, 2017 1 commit
  21. 05 Dec, 2016 1 commit
    • clemensh's avatar
      [inspector] Split off interface-types.h · f5fb2da6
      clemensh authored
      This CL adds a new header src/debug/interface-types.h, moves the
      definition of Location from the debug-interface.h to this new header,
      and adds a new definition for the WasmDisassembly types.
      This allows to use the types in other implementation files or headers
      without having to include the entire debug-interface.h, reducing build
      dependencies and compile time (especially for incremental builds).
      
      The WasmDisassembly type replaces the old
      std::pair<std::string, std::vector<std::tuple<...>>>, which was a bit
      hard to unravel.
      
      R=yangguo@chromium.org, kozyatinskiy@chromium.org, titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2529383002
      Cr-Commit-Position: refs/heads/master@{#41488}
      f5fb2da6