1. 09 Aug, 2021 2 commits
    • Camillo Bruni's avatar
      [modules] Update Module::Status enum to match spec · 26285e2f
      Camillo Bruni authored
      Change-Id: Ia324f486f138757017951c0d2b83502937b950d9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3075362
      Auto-Submit: Camillo Bruni <cbruni@chromium.org>
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#76158}
      26285e2f
    • Leszek Swirski's avatar
      [api] Add API for off-thread code cache deserialization · f888f48e
      Leszek Swirski authored
      To consume a code cache off-thread
      
        1. The embedder creates a CachedData object wrapping the data blob.
        2. The embedder calls ScriptCompiler::StartConsumingCodeCache with the
           CachedData, and receives a ScriptCompiler::CodeCacheConsumeTask
           which takes ownership of the CachedData.
        3. The embedder calls ScriptCompiler::CodeCacheConsumeTask::Run
           on a different thread.
        4. Once this completes, the embedded passes the completed task as an
           optional argument into Source constructor, and calls Compile as
           before.
      
      This is roughly similar to how streaming compilation works, with the
      QoL improvement that Source owns the CodeCacheConsumeTask and therefore
      we can reuse the same Compile method and do the off-thread finalization
      behind the scenes inside Compile.
      
      On the v8::internal side, ScriptCompiler::CodeCacheConsumeTask wraps a
      v8::internal::BackgroundDeserializeTask, which has a Run and a Finish
      method. The Run creates a LocalIsolate (again, similar to
      BackgroundCompileTask), calls some helpers on CodeSerializer, and stores
      the pre-finalization result in a OffThreadDeserializeData structure.
      This stores Persistent Handles to the off-thread initialized SFI and
      a vector of Scripts needing fixing up, and it owns the PersistentHandles
      object which owns those Handles. Finally, the Finish method consumes
      this OffThreadDeserializeData structure, fixes up Scripts, moves the
      SFI Handle into the caller HandleScope, and that's it.
      
      Since we don't yet have the source at off-thread deserialization time,
      the various code cache sanity checks are done without the source hash
      when deserializing, and the Finish method re-does them now that the
      source is available.
      
      Bug: chromium:1075999
      Change-Id: If1faf35ba3ef840fa4e735581d0b29c96c1d5fc8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3067322
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#76155}
      f888f48e
  2. 06 Aug, 2021 1 commit
    • Leszek Swirski's avatar
      Revert "[counters] Fix reentrant timers for V8.Execute" · a12c6fa2
      Leszek Swirski authored
      This reverts commit fffcbaea.
      
      Reason for revert: Breaks in Chromium (e.g. https://ci.chromium.org/p/v8/builders/ci/Linux%20V8%20FYI%20Release%20%28NVIDIA%29)
      
      Original change's description:
      > [counters] Fix reentrant timers for V8.Execute
      >
      > This CL fixes a long standing issue where reentering TimedHistograms
      > scopes would cause spurious measurements. Only the non-nested scopes
      > yielded correct results.
      >
      > Due to the changed numbers, the V8.Execute histogram is renamed to
      > V8.ExecuteMicroSeconds. Note that this histogram is also guarded
      > behind the --slow-histograms flag due to the additional overhead.
      >
      > Unlike before, it does no longer include time for external callbacks
      > and only measures self time. The following example illustrates the
      > new behaviour:
      >
      > 1. Enter V8:           |--+.......+--| self-time: 4 units (reported)
      > 2. Exit V8 (callback):    |-+...+-|    self-time: 2 units (ignored)
      > 3. Re-enter V8:             |---|      self-time: 3 units (reported)
      >
      > This would result in 2 histogram entries with 4 time units for the first
      > V8 slice and 3 units for the nested part. Note that the callback time
      > itself is ignored.
      >
      > This CL attempts to clean up how TimedHistograms work:
      > - Histogram: the base class
      > - TimedHistograms: used for time-related histograms that are not nested
      > - NestedTimeHistograms: Extends TimedHistograms and is used for nested
      >   histograms
      >
      > This CL changes Histograms to not measure time themselves. Measurements
      > happen in the *HistogramScopes:
      > - BaseTimedHistogramScope: Base functionality
      > - TimedHistogramScope: For non-nested measurements
      > - NestedTimedHistogramScope: For nested measurements
      > - PauseNestedTimedHistogramScope: Ignore time during a given scope.
      >   This is used to pause timers during callbacks.
      >
      > Additional changes:
      > - ExternalCallbackScope now contains a PauseNestedTimedHistogramScope
      >   and always sets VMState<EXTERNAL>
      >
      > Bug: v8:11946
      > Change-Id: I45e4b7ff77b5948b605dd50539044cb26222fa21
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3001345
      > Reviewed-by: Omer Katz <omerkatz@chromium.org>
      > Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
      > Reviewed-by: Victor Gomes <victorgomes@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#76111}
      
      Bug: v8:11946
      Change-Id: I954de1afbabf101fb5d4f52eca0d3b80a723385b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077153
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Owners-Override: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#76138}
      a12c6fa2
  3. 05 Aug, 2021 4 commits
  4. 04 Aug, 2021 5 commits
  5. 03 Aug, 2021 3 commits
    • Seth Brenith's avatar
      Iterate in assembly order for jump threading · fcc81d9a
      Seth Brenith authored
      While reading through the jump threading implementation, I noticed
      something strange: ApplyForwarding iterates through the block list in
      reverse post-order, not in assembly order. Thus, the value prev_fallthru
      might not refer to the previous block in assembly order. Obviously it
      works fine this way or we would have noticed by now, but I think that
      this step would be a little easier to read and reason about if the
      iteration used assembly order instead.
      
      I've added a test case to demonstrate the difference when using
      assembly order: in a diamond where the right side starts with an empty
      deferred block, the current implementation would fail to replace that
      block with a nop. I doubt this case would have any real-world impact.
      
      Change-Id: I28abe2043434debb54896871d15c540ad52c6368
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3039261
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#76067}
      fcc81d9a
    • Bruce Dawson's avatar
      Remove windows.h from win32-headers.h · fb9e1299
      Bruce Dawson authored
      Windows.h causes massive namespace pollution with its defining of many
      macros, it adds to build times, it disables warnings, and it makes it
      easier to write non-portable code.
      
      This change removes windows.h from V8's win32-headers.h. It does this
      by replicating the small number of typedefs that are needed and by
      defining three "proxy" types that are the same size and layout. The
      V8ToWindowsType functions are used to reinterpret_cast between the
      types.
      
      Prior to this change there were over 760 v8-related source files that
      include windows.h. After this change there are 16.
      
      Bug: chromium:796644
      Change-Id: I89efeed47028faae72de2da4f1dae345d8d7746c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3042215
      Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#76064}
      fb9e1299
    • Jakob Gruber's avatar
      [compiler] Remove SerializerForBackgroundCompilation · 204dc4aa
      Jakob Gruber authored
      Based on a CL by mvstanton@.
      
      Bug: v8:7790,v8:12030,v8:12031,v8:12041
      Change-Id: I58b75bd96c724a99133bec7d3bd6cf4e0c9be6d4
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059683Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#76055}
      204dc4aa
  6. 02 Aug, 2021 1 commit
  7. 30 Jul, 2021 2 commits
  8. 29 Jul, 2021 1 commit
  9. 28 Jul, 2021 1 commit
  10. 26 Jul, 2021 1 commit
  11. 23 Jul, 2021 3 commits
    • Vicky Kontoura's avatar
      [web snapshot] Support classes · 8439314d
      Vicky Kontoura authored
      This CL adds support for classes with methods.
      
      More specifically:
      - A new ValueSerializer is added and classes are serialized separetely
      from functions, although the common parts are handled in the same way
      and abstracted away.
      - The function prototype is serialized as an object and any missing
      information is set up again during deserialization.
      - FunctionFlagsToFunctionKinds() is updated to allow for more function
      kinds.
      - Context serialization is updated to support serializing BlockContexts
      and creating ScopeInfos of type CLASS_SCOPE.
      - Map serialization is updated to support properties with custom
      attributes.
      
      Bug: v8:11525, v8:11706
      Change-Id: I16ca7cbc17b1811721081cda05124ce36073f9be
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3006416
      Commit-Queue: Vicky Kontoura <vkont@google.com>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75893}
      8439314d
    • Paolo Severini's avatar
      [compiler] Wrong receiver in API calls with --turbo-optimize-apply · 6a5568b4
      Paolo Severini authored
      Enabling --turbo-optimize-apply breaks tests because we are
      passing the wrong receiver;
      in JSCallReducer::ReduceCallOrConstructWithArrayLikeOrSpread
      we create a Call node with the wrong ConvertReceiverMode, we
      pass kNullOrUndefined while it should be kAny. This may break
      calls to API or in general calls to functions that use the
      receiver.
      
      Bug: chromium:1231108, v8:9974
      Change-Id: Ib35a1bf8746ad254b6d63274f3ae11b12aa83de8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3043690
      Commit-Queue: Paolo Severini <paolosev@microsoft.com>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75886}
      6a5568b4
    • Maya Lekova's avatar
      Reland "[fastcall] Implement support for TypedArray arguments" · 66856bac
      Maya Lekova authored
      This is a reland of 84d5b027
      
      It removes support for 8-byte types which were causing
      unaligned reads.
      
      Original change's description:
      > [fastcall] Implement support for TypedArray arguments
      >
      > This CL adds TypedArrays as supported arguments for fast API calls.
      > It implements "exact type" matching, i.e. if Float32Array is expected
      > and e.g. Int32Array is passed instead, the generated code bails to the
      > slow callback.
      >
      > Bug: chromium:1052746, chromium:1018624
      > Change-Id: I01d4e681d2b367cbb57b06effcb591c090a23295
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2999094
      > Commit-Queue: Maya Lekova <mslekova@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75756}
      
      Bug: chromium:1052746, chromium:1018624
      Change-Id: I872716d95bde8c340cf04990a3e4ae8ec8cd74a2
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3035090Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75877}
      66856bac
  12. 22 Jul, 2021 1 commit
  13. 20 Jul, 2021 1 commit
  14. 19 Jul, 2021 1 commit
    • Jakob Gruber's avatar
      [compiler] Make JSFunction bg-serialized · 0dba97f8
      Jakob Gruber authored
      This wraps up the transition away from kSerialized ref kinds.
      
      Since JSFunctionRef is a complex type, we don't attempt full
      consistency on the background thread. Instead, we serialize functions
      on the background in a partially-racy manner, in which consistency
      between different JSFunction fields is *not* guaranteed. Consistency
      is later verified through a new compilation dependency kind during
      finalization.
      
      Bug: v8:7790, v8:12004
      Change-Id: Ic2b78af9c9fe183c8769d323132bb304b151dc75
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2968404
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75789}
      0dba97f8
  15. 16 Jul, 2021 3 commits
  16. 15 Jul, 2021 1 commit
  17. 14 Jul, 2021 1 commit
  18. 13 Jul, 2021 2 commits
  19. 12 Jul, 2021 1 commit
  20. 09 Jul, 2021 1 commit
  21. 08 Jul, 2021 3 commits
    • Patrick Thier's avatar
      Reland "Reland "Reland "Improve error messages for property access on null/undefined""" · c0fd89c3
      Patrick Thier authored
      This is a reland of 819c3ae2
      
      Original change's description:
      > Reland "Reland "Improve error messages for property access on null/undefined""
      >
      > This is a reland of 8b18c5e6
      >
      > Original change's description:
      > > Reland "Improve error messages for property access on null/undefined"
      > >
      > > This is a reland of 24c626c1
      > >
      > > Original change's description:
      > > > Improve error messages for property access on null/undefined
      > > >
      > > > Only print the property name when accessing null/undefined if we can
      > > > convert it to a string without causing side effects.
      > > > If we can't, omit the property name in the error message.
      > > > This should avoid confusion when the key is an object with toString().
      > > > E.g. undefined[{toString:()=>'a'}] doesn't print 'read property [object
      > > > Object]' anymore, which was misleading since the property accessed would
      > > > be 'a', but we can't evaluate the key without side effects.
      > > >
      > > > Bug: v8:11365
      > > > Change-Id: If82d1adb42561d4851e2bd2ca297a1c71738aee8
      > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960211
      > > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > > > Commit-Queue: Patrick Thier <pthier@chromium.org>
      > > > Cr-Commit-Position: refs/heads/master@{#75250}
      > >
      > > Bug: v8:11365
      > > Change-Id: Ie2312337f4f1915faa31528a728d90833d80dbd1
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2979599
      > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > > Commit-Queue: Patrick Thier <pthier@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#75571}
      >
      > Bug: v8:11365
      > Change-Id: I90360641ecd870bd93247aa6d91dfb0ad049cfb8
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3008219
      > Auto-Submit: Patrick Thier <pthier@chromium.org>
      > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75604}
      
      Bug: v8:11365
      Change-Id: I002b537144f328ccbbdcd655e26e5dc87c49c6f5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3013935Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Patrick Thier <pthier@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75645}
      c0fd89c3
    • Clemens Backes's avatar
      [wasm] Disable trap handling for memory64 · 72af112c
      Clemens Backes authored
      Trap handling is not implemented yet for memory64. Make sure that no
      code tries to use it, by setting {NativeModule::bounds_checks_}
      accordingly.
      This requires some changes to tests to make sure that the
      {WasmModule::is_memory64} field is set before creating the corresponding
      {NativeModule}.
      
      R=ahaas@chromium.org
      
      Bug: v8:10949
      Change-Id: I11d9544b603fc471e3368bb4e7487da4711293a0
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3011167Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75632}
      72af112c
    • Leszek Swirski's avatar
      Revert "Reland "Reland "Improve error messages for property access on null/undefined""" · 7ac7b72b
      Leszek Swirski authored
      This reverts commit 819c3ae2.
      
      Reason for revert: Sorry Patrick, still failing on some layout tests :( https://test-results.appspot.com/data/layout_results/mac-rel/726365/blink_web_tests%20%28retry%20shards%20with%20patch%29/layout-test-results/results.html
      
      Original change's description:
      > Reland "Reland "Improve error messages for property access on null/undefined""
      >
      > This is a reland of 8b18c5e6
      >
      > Original change's description:
      > > Reland "Improve error messages for property access on null/undefined"
      > >
      > > This is a reland of 24c626c1
      > >
      > > Original change's description:
      > > > Improve error messages for property access on null/undefined
      > > >
      > > > Only print the property name when accessing null/undefined if we can
      > > > convert it to a string without causing side effects.
      > > > If we can't, omit the property name in the error message.
      > > > This should avoid confusion when the key is an object with toString().
      > > > E.g. undefined[{toString:()=>'a'}] doesn't print 'read property [object
      > > > Object]' anymore, which was misleading since the property accessed would
      > > > be 'a', but we can't evaluate the key without side effects.
      > > >
      > > > Bug: v8:11365
      > > > Change-Id: If82d1adb42561d4851e2bd2ca297a1c71738aee8
      > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960211
      > > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > > > Commit-Queue: Patrick Thier <pthier@chromium.org>
      > > > Cr-Commit-Position: refs/heads/master@{#75250}
      > >
      > > Bug: v8:11365
      > > Change-Id: Ie2312337f4f1915faa31528a728d90833d80dbd1
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2979599
      > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > > Commit-Queue: Patrick Thier <pthier@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#75571}
      >
      > Bug: v8:11365
      > Change-Id: I90360641ecd870bd93247aa6d91dfb0ad049cfb8
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3008219
      > Auto-Submit: Patrick Thier <pthier@chromium.org>
      > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75604}
      
      Bug: v8:11365
      Change-Id: I7d7c0f201288384c2aa38a51418b582a64213ae0
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3013352
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/master@{#75626}
      7ac7b72b
  22. 07 Jul, 2021 1 commit