1. 13 Oct, 2021 1 commit
    • Joyee Cheung's avatar
      [class] Add IC support for defining class fields to replace runtime call · 713ebae3
      Joyee Cheung authored
      Introduces several new runtime mechanics for defining private fields,
      including:
        - Bytecode StaKeyedPropertyAsDefine
        - Builtins StoreOwnIC{Trampoline|Baseline|_NoFeedback}
        - Builtins KeyedDefineOwnIC{Trampoline|Baseline|_Megamorphic}
        - TurboFan IR opcode JSDefineProperty
      
      These new operations can reduce a runtime call per class field into a
      more traditional Store equivalent. In the microbenchmarks, this
      results in a substantial win over the status quo (~8x benchmark score
      for single fields with the changes, ~20x with multiple fields).
      
      The TurboFan JSDefineProperty op is lowered in
      JSNativeContextSpecialization, however this required some hacks.
      Because private fields are defined as DONT_ENUM when added to the
      object, we can't find a suitable transition using the typical data
      property (NONE) flags. I've added a mechanism to specify the required
      PropertyAttributes for the transition we want to look up.
      
      Details:
      
      New bytecodes:
        - StaKeyedPropertyAsDefine, which is essentially StaKeyedProperty
          but with a different IC builtin (KeyedDefineOwnIC). This is a
          bytecode rather than a flag for the existing StaKeyedProperty in
          order to avoid impacting typical keyed stores in any way due to
          additional branching and testing.
      
      New builtins:
        - StoreOwnIC{TTrampoline|Baseline|_NoFeedback} is now used for
          StaNamedOwnProperty. Unlike the regular StoreIC, this variant will
          no longer look up the property name in the prototype.
          In adddition, this CL changes an assumption that
          StoreNamedOwnProperty can't result in a map transition, as we
          can't rely on the property already being present in the Map due
          to an object literal boilerplate.
      
          In the context of class features, this replaces the runtime
          function %CreateDataProperty().
      
        - KeyedDefineOwnIC{Trampoline|Baseline|_Megamorphic} is used by the
          new StaKeyedPropertyAsDefine bytecode. This is similar to an
          ordinary KeyedStoreIC, but will not check the prototype for
          setters, and for private fields, will take the slow path if the
          field already exists.
      
          In the context of class features, this replaces the runtime
          function %AddPrivateField().
      
      TurboFan IR:
        - JSDefineProperty is introduced to represent a situation where we
          need to use "Define" semantics, in particular, it codifies that we
          do not consult the prototype chain, and the semantics relating to
          private fields are implied as well.
      
      R=leszeks@chromium.org, syg@chromium.org, rmcilroy@chromium.org
      
      Bug: v8:9888
      Change-Id: Idcc947585c0e612f9e8533aa4e2e0f8f0df8875d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2795831Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
      Commit-Queue: Joyee Cheung <joyee@igalia.com>
      Cr-Commit-Position: refs/heads/main@{#77377}
      713ebae3
  2. 23 Sep, 2021 2 commits
  3. 02 Sep, 2021 1 commit
  4. 01 Sep, 2021 1 commit
  5. 09 Aug, 2021 1 commit
  6. 06 Aug, 2021 1 commit
  7. 02 Aug, 2021 2 commits
  8. 29 Jul, 2021 1 commit
  9. 27 Jul, 2021 1 commit
  10. 26 Jul, 2021 1 commit
  11. 23 Jul, 2021 1 commit
  12. 22 Jul, 2021 1 commit
  13. 16 Jul, 2021 1 commit
  14. 12 Jul, 2021 1 commit
  15. 01 Jul, 2021 1 commit
    • Jakob Kummerow's avatar
      [bigint] Fix Karatsuba intermediate result length · a4b573e5
      Jakob Kummerow authored
      When adding up the results of the recursive steps, the Karatsuba
      algorithm can temporarily have intermediate results that are one
      bit bigger than the final result. This patch makes sure we handle
      that case correctly.
      Since that extra bit would always get subtracted again, the old
      code would not have caused incorrect results or memory corruption,
      but it did run into DCHECK-failures, and potentially could have
      caused segfaults.
      
      Bug: v8:11515, chromium:1223724
      Change-Id: I3592835d01cc36def8f0a9bae625e9249864ef78
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2988758Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75509}
      a4b573e5
  16. 17 Jun, 2021 1 commit
  17. 15 Jun, 2021 1 commit
  18. 01 Jun, 2021 1 commit
  19. 31 May, 2021 1 commit
  20. 18 May, 2021 3 commits
  21. 06 May, 2021 1 commit
  22. 23 Apr, 2021 1 commit
  23. 08 Apr, 2021 2 commits
  24. 19 Mar, 2021 1 commit
  25. 15 Mar, 2021 1 commit
  26. 18 Feb, 2021 1 commit
  27. 11 Feb, 2021 1 commit
  28. 10 Feb, 2021 1 commit
    • Daniel Clark's avatar
      Fix top-level await crash from synthetic module being evaluated twice · f033e2a1
      Daniel Clark authored
      With top-level await, when Evaluate is performed on an already-evaluated
      synthetic module, Module::InnerEvaluate returns undefined.  This breaks
      top-level await's assumption that the returned value is always a
      promise.
      
      In order to make SyntheticModule's behavior consistent with
      SourceTextModule, the top_level_capability field is moved up to Module
      and SyntheticModule::Evaluate places the promise returned from the
      host's evaluation steps in that field.  Now SourceTextModule and
      SyntheticModule can share the same code to handle the case where the
      module is either kErrored or kEvaluated, so the code for this
      is moved up to Module.
      
      Thus, SyntheticModule is now guaranteed to return the
      promise from the evaluation steps even on subsequent Evaluate() calls.
      
      Unfortunately Node hasn't yet updated their EvaluationStepsCallback
      to return a Promise, so we can't yet assume that the returned value
      is a Promise without breaking Node.  So, this change also adds a clause
      to check for this condition and create a new resolved Promise if one
      was not provided by the callback steps.  This could eventually be
      removed once Node's callback steps are updated for top-level await.
      
      Change-Id: I2d6ae918abfeba9e3a757838502d4df92946edaa
      Bug: v8:11398
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2673794Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Dan Clark <daniec@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#72629}
      f033e2a1
  29. 04 Feb, 2021 1 commit
  30. 03 Feb, 2021 1 commit
  31. 26 Jan, 2021 3 commits
  32. 21 Jan, 2021 1 commit
  33. 24 Nov, 2020 1 commit