1. 24 Jan, 2020 1 commit
  2. 08 Jan, 2020 1 commit
  3. 02 Jan, 2020 1 commit
  4. 08 Nov, 2019 1 commit
  5. 16 Sep, 2019 1 commit
    • Clemens Hammacher's avatar
      Fix two warnings issued by g++ · fa0ec09f
      Clemens Hammacher authored
      A local build with g++ 8.3.0 failed with two warnings. This CL fixes
      them.
      The errors were:
      
      1) error: 'char* strncat(char*, const char*, size_t)' output truncated
         before terminating nul copying as many bytes from a string as its
         length [-Werror=stringop-truncation]
      2) error: 'char* strncpy(char*, const char*, size_t)' specified bound
         depends on the length of the source argument
         [-Werror=stringop-overflow=]
      
      R=petermarshall@chromium.org
      
      Bug: v8:9396
      Change-Id: I175a72435becd694e4151a64e538084ec17d8500
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803636Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63788}
      fa0ec09f
  6. 13 Sep, 2019 2 commits
  7. 10 Sep, 2019 2 commits
    • Michael Lippautz's avatar
      [heap] Provide async GC for JS · aa7c6e22
      Michael Lippautz authored
      Reuse the existing builtin and extension infrastructure to provide a
      garbage collection mechanism that allows for asynchronous execution.
      
      On --expose-gc, this changes the gc call to parse parameters the
      following:
      (1) Parse options when encountering an options object with known properties.
      (2) No parameters is parsed as
          {type: 'major', execution: 'sync'}.
      (3) Truthy parameter that is not setting options is parsed as
          {type: 'minor', execution: 'sync'}.
      
      (2) and (3) preserve backwards compatibility for existing callers as this may be
      used widely across various test and benchmarking infrastructures.
      
      Valid options:
      - type: 'major' or 'minor' for full GC and Scavenge, respectively.
      - execution: 'sync' or 'async' for synchronous and asynchronous
        execution respectively.
      
      Returns a Promise that resolves when GC is done when asynchronous execution
      is requested, and undefined otherwise.
      
      Note: This is implemented as builtin to avoid having any stack at all. This
      information is also passed to the embedder to allow skipping stack scanning.
      
      Change-Id: Ie5c9b6f0d55238abfeb9051ffa1837501d474934
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1793143
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63659}
      aa7c6e22
    • Clemens Hammacher's avatar
      Replace base::make_unique by std::make_unique · 859b2d77
      Clemens Hammacher authored
      Since we switched to C++14 now, we can use {std::make_unique} instead
      of our own {base::make_unique} from {template-utils.h}.
      
      R=mstarzinger@chromium.org, yangguo@chromium.org
      
      Bug: v8:9687
      No-Try: true
      Change-Id: I660eb30038bbb079cee93c7861cd87ccd134f01b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1789300
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63642}
      859b2d77
  8. 06 Sep, 2019 1 commit
  9. 05 Sep, 2019 2 commits
  10. 06 Aug, 2019 1 commit
  11. 05 Aug, 2019 1 commit
    • Peter Marshall's avatar
      [tracing] Fix TracingCpuProfiler test for Perfetto · 5ab7510e
      Peter Marshall authored
      Update the TracingCpuProfiler test to work properly with perfetto.
      
      Roll perfetto to get fixes for bugs encountered with starting/stopping
      tracing rapidly, which happens in the test for the tracing profiler.
      
      Add a check that the DataSource::Register call was successful to flush
      out any errors there (although they are fixed by the perfetto roll).
      
      Emit a fake trace event when stopping tracing in order to avoid
      losing the final trace event that the user provided. Remove the ad-hoc
      fake final trace events that the cctests for perfetto added.
      
      Add a test StartAndStopRepeated which flushes out the issues fixed by
      the perfetto roll.
      
      TBR=yangguo@chromium.org
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: I042d7385486bf42c86f1631406974693868a477f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1731006
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63083}
      5ab7510e
  12. 30 Jul, 2019 1 commit
  13. 18 Jul, 2019 1 commit
  14. 08 Jul, 2019 2 commits
  15. 27 May, 2019 2 commits
    • Peter Marshall's avatar
      [tracing] Add a way to test perfetto traces. · d365f62e
      Peter Marshall authored
      Add a new abstract class TraceEventListener which is just an interface
      for consuming trace events. This separates the V8-specific stuff that
      an actual perfetto consumer needs to do e.g. handling the has_more flag
      and signalling back to the controller with a semaphore.
      
      This is a change from the previous plan of making the PerfettoConsumer
      class sub-classable to implement custom consumption of trace events.
      This will be difficult when the consumer is created outside of the
      PerfettoTracingController as we can't hook up the
      consumer_finished_semaphore_ that belongs to the controller.
      
      Now the PerfettoTracingController is responsible for the Consumer life-
      cycle and hides it entirely from callers. We add the
      AddTraceEventListener() method to allow callers to register a listener
      either for testing or a JSON listener for real tracing.
      
      This lets us write tests that can store all the trace events in memory
      without first converting them to JSON, letting us write test more
      easily. There's an example test add to test-tracing - more tests using
      this style will follow.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: I2d2b0f408b1c7bed954144163e1968f40d772c1b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1628789
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Auto-Submit: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61854}
      d365f62e
    • Clemens Hammacher's avatar
      [cleanup] Replace simple typedefs by using · a335f2ae
      Clemens Hammacher authored
      This replaces all typedefs that define types and not functions by the
      equivalent "using" declaration.
      
      This was done mostly automatically using this command:
      ag -l '\btypedef\b' src test | xargs -L1 \
           perl -i -p0e 's/typedef ([^*;{}]+) (\w+);/using \2 = \1;/sg'
      
      Patchset 2 then adds some manual changes for typedefs for pointer types,
      where the regular expression did not match.
      
      R=mstarzinger@chromium.org
      TBR=yangguo@chromium.org, jarin@chromium.org
      
      Bug: v8:9183
      Change-Id: I6f6ee28d1793b7ac34a58f980b94babc21874b78
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631409
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61849}
      a335f2ae
  16. 23 May, 2019 2 commits
    • Peter Marshall's avatar
      [tracing] Add a perfetto consumer base class · 9a2e4693
      Peter Marshall authored
      Split the JSONConsumer into a base case and subclass so that we can
      implement different consumers without needing to repeat the code that
      deals with the finished semaphore and endpoint setters/getters.
      
      This makes it possible to add a test consumer that just holds the trace
      events in memory in a later CL.
      
      This CL re-uses the existing perfetto-consumer.h file to some extent,
      but it was accidentally leftover from a previous CL where we stopped
      using it and switched to the JSON consumer instead.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: I56c305833c8937da76a8e6defbe7a52c59b25106
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621938
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61799}
      9a2e4693
    • Peter Marshall's avatar
      Reland "[tracing] Add a configurable output stream for perfetto tracing" · d5688b1f
      Peter Marshall authored
      This is a reland of a03ed626
      
      Removed the added test which was failing on win32. The test was unrelated
      to the CL; we can add it later.
      
      Original change's description:
      > [tracing] Add a configurable output stream for perfetto tracing
      >
      > Add the ability to provide perfetto with an output stream for the JSON
      > consumer rather than hardcode it. D8 will use this interface exclusively
      > once the old trace controller is removed.
      >
      > Also add a test for scope-managed trace events and their duration - this
      > was leftover from a previous CL.
      >
      > Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      > Bug: v8:8339
      > Change-Id: I1c45e17e528b549a4cfdaecabd33c7ac4ab4af77
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611801
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#61753}
      
      TBR=jgruber@chromium.org, ulan@chromium.org
      
      Bug: v8:8339
      Change-Id: I3442a4d111e12947c107e7d0c226ae934acd06e4
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627334Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61780}
      d5688b1f
  17. 22 May, 2019 2 commits
  18. 20 May, 2019 2 commits
    • Peter Marshall's avatar
      [tracing] Use ChromeTracePacket to save binary size with perfetto · 76f85199
      Peter Marshall authored
      Previously, compiling with perfetto would add 2.3 MiB to the d8 release
      binary. With this change it's 472 KiB.
      
      This is because trace:lite pulls in many more compiled proto classes
      than we need, e.g. a bunch of stuff under ftrace/ which is only used
      on Android.
      
      Chrome uses a 'mirror proto' ChromeTrackPacket to only provide
      compiled protos for the types of packets it will actually see, which on
      non-android devices does not include anything under ftrace/.
      
      We use the same trick here in the JSON consumer.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: Iae1f74eec3bd93b18e9f069701fc016440d3ce5e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619759
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Auto-Submit: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61662}
      76f85199
    • Peter Marshall's avatar
      [tracing] Convert COMPLETE events to BEGIN/END pairs for perfetto · d5c4d577
      Peter Marshall authored
      COMPLETE events are being deprecated and don't work well with perfetto
      because we can't give out a handle into the buffer like we used to so
      that the caller can update the existing event with the duration.
      
      BEGIN/END pairs should be used instead to add two separate trace events
      to the buffer which can be associated with one another by the trace
      processor e.g. the trace viewer UI.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: Ib73c19d77ad58456ce23d15f0b658c26f3dc3d53
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615257Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61641}
      d5c4d577
  19. 16 May, 2019 2 commits
    • Peter Marshall's avatar
      [tracing] Roll perfetto · 59cbcb7f
      Peter Marshall authored
      Roll perfetto to get the fix for a TSAN race.
      
      We need to override a new method on the producer, ClearIncrementalState.
      It is only called if the producer opts into it, which we do not so we
      add UNREACHABLE() in the implementation.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: I782989f32b511e98479f6637148e3bdd78a6578a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615461Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61584}
      59cbcb7f
    • Peter Marshall's avatar
      [tracing] Don't delete TraceWriters in Perfetto · d2061b34
      Peter Marshall authored
      Perfetto has a mechanism for getting trace data from buffers held alive
      by TraceWriters. We enable this with the SetSMBScrapingEnabled() call.
      
      This means we don't need to delete TraceWriter objects and can just leak
      them for now, and eventually use thread-local destructors to ensure they
      are eventually deleted on thread exit.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
      Bug: v8:8339
      Change-Id: I690bc435c48db6d91eab2fbc7a49ec9feae3b45a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607653
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61575}
      d2061b34
  20. 10 May, 2019 1 commit
  21. 09 May, 2019 1 commit
  22. 08 May, 2019 2 commits
  23. 03 May, 2019 1 commit
  24. 22 Mar, 2019 1 commit
    • Peter Marshall's avatar
      [platform] Only wait for positive time values in DelayedTaskQueue · 4db62d2a
      Peter Marshall authored
      We were hitting a DCHECK in WaitFor() when rel_time was negative. This
      was caused when GetNext() recalculated the wait time for a delayed
      task. In the first part of the loop we moved all delayed tasks which
      have passed their deadline into the immediate task queue. At the
      bottom of the loop we assume that all delayed tasks in the queue
      have a deadline in the future, but this isn't always the case as we
      use a new 'now' value for the calculation, and time could have elapsed.
      
      Fix this by using one 'now' value for an iteration of the loop.
      
      Bug: v8:9030
      Change-Id: Ia49fb571f3c7c7d9f15c6a464ee0a9db814a7f03
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535820
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60409}
      4db62d2a
  25. 19 Mar, 2019 1 commit
    • Peter Marshall's avatar
      [platform] Implement delayed tasks in the default worker runner · da66158f
      Peter Marshall authored
      This was unimplemented but is needed for Perfetto which posts delayed
      tasks on worker threads e.g. drain the trace buffer into a file every x
      seconds.
      
      This is implemented by adding a second queue which holds the delayed
      tasks in chronological order of 'next-to-execute'. We use an
      std::multimap for the queue so that we can easily get the next delayed
      task with begin().
      
      The implementation will move delayed tasks into the main task queue
      when their deadline expires.
      
      Drive-by cleanup of the runner destructor which can just use = default.
      
      Bug: v8:8339
      
      Change-Id: I3629c5d6e15ced2fc47eb1b7519a2dbbf8461fce
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1521114
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60320}
      da66158f
  26. 13 Mar, 2019 1 commit
  27. 21 Feb, 2019 1 commit
    • Peter Marshall's avatar
      [tracing] Fix races in TracingController implementation · 51e80efd
      Peter Marshall authored
      The default TracingController (used by d8 and Node) has some concurrency
      issues. The new test flushes these out, when a second thread logs trace
      events while the main thread calls StopTracing().
      
      - Use an acquire load in UpdateCategoryGroupEnabledFlags() because this
        was racing with GetCategoryGroupEnabled() where a new category is
        added in the slow path. g_category_groups is append-only, but
        reads/writes to g_category_index need to be correctly ordered so that
        new categories are added and only then is the change to the index
        visible. The relaxed load ignored this and caused unsynchronized
        read/write.
      - Use a relaxed load in ~ScopedTracer() to access category_group_enabled
        as this previously used a non-atomic operation which caused a race
        with UpdateCategoryGroupEnabledFlag() which does a relaxed store.
      - Replace TracingController::mode_ with an atomic bool as read/writes to
        mode_ were not synchronized and caused TSAN errors. It only has two
        states and it doesn't seem like we will extend this so just convert it
        to bool.
      - Take the lock around calling trace_object->Initialize in
        AddTraceEvent(), and around trace_buffer_->Flush() in StopTracing().
        These two raced previously as the underlying TraceBufferRingBuffer
        passes out pointers to TraceObjects in a synchronized way, but the
        caller (AddTraceEvent) then writes into the object without
        synchronization. This leads to races when Flush() is called, at which
        time TraceBufferRingBuffer assumes that all the pointers it handed out
        are to valid, initialized TraceObjects - which is not true because
        AddTraceEvent may still be calling Initialize on them. This could be
        the cause of issues in Node.js where the last line of tracing/logging
        sometimes gets cut off. This is kind of a band-aid solution - access
        to the TraceObjects handed out by the ring buffer really needs proper
        synchronization which at this point would require redesign. It's quite
        likely we will replace this with Perfetto in the near future so not
        much point investing in this code right now.
      - Enable TracingCpuProfiler test which was flaky due to these bugs.
      
      Bug: v8:8821
      Change-Id: I141296800c6906ac0e7f3f21dd16d861b07dae62
      Reviewed-on: https://chromium-review.googlesource.com/c/1477283
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarAli Ijaz Sheikh <ofrobots@google.com>
      Cr-Commit-Position: refs/heads/master@{#59752}
      51e80efd
  28. 19 Feb, 2019 1 commit
  29. 11 Feb, 2019 1 commit
  30. 12 Oct, 2018 1 commit