1. 26 Jan, 2022 1 commit
    • Igor Sheludko's avatar
      [ext-code-space] Fix CodeRange allocation logic · 695afbff
      Igor Sheludko authored
      1) when generating short builtin calls/jumps assemblers should use the
         offset from the CodeRange base rather than the start of the code
         range reservation because otherwise it's not guaranteed that the
         PC-relative offset will fit into architecture's constraints.
         The code range reservation start could be different from the code
         range base in the following cases:
           * when the "base bias size" is non-zero (on Windows 64),
           * when we ended up over-reserving the address space for the code
             range, which happens as a last resort to fulfil the CodeRange
             alignment requirements.
         See the VirtualMemoryCage description for details.
      
      Drive-by fixes:
      2) in case of over-reserving address space for external code range,
         the pre-calculated hint for where the remapped embedded builtins
         should be copied to was outside of the allocatable CodeRange region
         and thus useless. The fix is to use the allocatable region instead
         of the reservation region when calculating the hint.
      3) when allocating CodeRange with zero base bias size we can create
         the VirtualMemory reservation from the first attempt simply by
         passing the required base alignment to the VirtualMemory
         constructor.
      
      Bug: v8:11880, chromium:1290591
      Change-Id: If341418947e2170d967e22b38bcc371594939c1c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3412089Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Igor Sheludko <ishell@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78772}
      695afbff
  2. 04 Jan, 2022 1 commit
  3. 16 Dec, 2021 1 commit
  4. 11 Oct, 2021 1 commit
  5. 27 Aug, 2021 1 commit
  6. 11 Aug, 2021 1 commit
  7. 04 Aug, 2021 1 commit
  8. 29 Jul, 2021 1 commit
  9. 22 Jul, 2021 1 commit
  10. 30 Jun, 2021 1 commit
  11. 23 Jun, 2021 3 commits
    • Clemens Backes's avatar
      Reland "[wasm] Remove WasmInstructionBuffer" · c581e790
      Clemens Backes authored
      This is a reland of ac654646.
      Two constants defined in {AssemblerBase} were not defined anywhere,
      which is fixed now.
      
      Original change's description:
      > [wasm] Remove WasmInstructionBuffer
      >
      > {WasmInstructionBuffer} was basically a wrapper around {AssemblerBuffer}
      > which remembered the last {AssemblerBuffer} on {Grow()}. Since the
      > {Assembler} itself already keeps track of the latest {AssemblerBuffer},
      > this functionality is mostly redundant. All we need instead is a method
      > to retrieve the {AssemblerBuffer} from the {Assembler}.
      >
      > This CL thus removes {WasmInstructionBuffer} and instead adds
      > {AssemblerBase::ReleaseBuffer}.
      >
      > R=jkummerow@chromium.org, mslekova@chromium.org
      > CC=dlehmann@google.com
      >
      > Bug: v8:11714
      > Change-Id: Id07945b67992802a6177bf09e5f5c5be08f657b0
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2982013
      > Commit-Queue: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Maya Lekova <mslekova@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75336}
      
      Bug: v8:11714
      Change-Id: I8797de1a7a78a93aaef936e46bfd1e73ec2cc9d5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2982015Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75338}
      c581e790
    • Maya Lekova's avatar
      Revert "[wasm] Remove WasmInstructionBuffer" · f8182a8e
      Maya Lekova authored
      This reverts commit ac654646.
      
      Reason for revert: Breaks ASAN no-inline - https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Clusterfuzz%20Linux64%20ASAN%20no%20inline%20-%20release%20builder/22909/overview
      
      Original change's description:
      > [wasm] Remove WasmInstructionBuffer
      >
      > {WasmInstructionBuffer} was basically a wrapper around {AssemblerBuffer}
      > which remembered the last {AssemblerBuffer} on {Grow()}. Since the
      > {Assembler} itself already keeps track of the latest {AssemblerBuffer},
      > this functionality is mostly redundant. All we need instead is a method
      > to retrieve the {AssemblerBuffer} from the {Assembler}.
      >
      > This CL thus removes {WasmInstructionBuffer} and instead adds
      > {AssemblerBase::ReleaseBuffer}.
      >
      > R=​jkummerow@chromium.org, mslekova@chromium.org
      > CC=​dlehmann@google.com
      >
      > Bug: v8:11714
      > Change-Id: Id07945b67992802a6177bf09e5f5c5be08f657b0
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2982013
      > Commit-Queue: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Maya Lekova <mslekova@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75336}
      
      Bug: v8:11714
      Change-Id: Iff32952f712ab2f0f9a16d91906d0135c084f4df
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2982014
      Auto-Submit: Maya Lekova <mslekova@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@{#75337}
      f8182a8e
    • Clemens Backes's avatar
      [wasm] Remove WasmInstructionBuffer · ac654646
      Clemens Backes authored
      {WasmInstructionBuffer} was basically a wrapper around {AssemblerBuffer}
      which remembered the last {AssemblerBuffer} on {Grow()}. Since the
      {Assembler} itself already keeps track of the latest {AssemblerBuffer},
      this functionality is mostly redundant. All we need instead is a method
      to retrieve the {AssemblerBuffer} from the {Assembler}.
      
      This CL thus removes {WasmInstructionBuffer} and instead adds
      {AssemblerBase::ReleaseBuffer}.
      
      R=jkummerow@chromium.org, mslekova@chromium.org
      CC=dlehmann@google.com
      
      Bug: v8:11714
      Change-Id: Id07945b67992802a6177bf09e5f5c5be08f657b0
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2982013
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75336}
      ac654646
  12. 22 Jun, 2021 2 commits
  13. 18 Jun, 2021 1 commit
  14. 15 Jun, 2021 1 commit
  15. 28 Apr, 2021 1 commit
  16. 21 Apr, 2021 1 commit
  17. 20 Apr, 2021 1 commit
  18. 24 Mar, 2021 1 commit
  19. 18 Mar, 2021 1 commit
  20. 17 Mar, 2021 1 commit
  21. 09 Feb, 2021 2 commits
  22. 27 Oct, 2020 1 commit
  23. 09 Jun, 2020 1 commit
    • Clemens Backes's avatar
      [utils] Add OwnedVector::NewForOverwrite · ff2e485f
      Clemens Backes authored
      The existing {OwnedVector::New} value-initializes all elements, which
      means zeroing them in case on integral types. In many cases though we
      know that we will overwrite the content anyway, so the initialization is
      redundant.
      In the case of assembly buffers for wasm compilation, this zeroing
      showed up with several percent of execution times for some benchmarks.
      
      Hence this CL introduces a new {OwnedVector::NewForOverwrite} (along the
      lines of {std::make_unique_for_overwrite}), which only
      default-initializes the values (meaning no initialization for integral
      values).
      
      R=thibaudm@chromium.org
      
      Bug: v8:10576
      Change-Id: I8d2806088acebe8a264dea2c7ed74b0423671d4f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2237140
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68268}
      ff2e485f
  24. 22 Apr, 2020 1 commit
    • Jakob Gruber's avatar
      Reland "[snapshot] Extract more files" · d587f67a
      Jakob Gruber authored
      This is a reland of 5c4b8056
      
      Original change's description:
      > [snapshot] Extract more files
      >
      > This moves:
      >
      > - ExternalReferenceEncoder to codegen/external-reference-encoder.h
      > - SerializerDeserializer to snapshot/serializer-deserializer.h
      > - Checksum() to snapshot/snapshot-utils.h
      >
      > serializer-common.h and .cc are removed.
      >
      > Tbr: clemensb@chromium.org,ulan@chromium.org
      > Bug: v8:10416
      > Change-Id: I36a242dcc1ad8833374aa567f73e0d4a75632c58
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144118
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Dan Elphick <delphick@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#67281}
      
      Tbr: delphick@chromium.org,clemensb@chromium.org,ulan@chromium.org
      Bug: v8:10416
      Change-Id: I6f6a1017435db185778ed931e1ddb13d8d5e920e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2157384Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67298}
      d587f67a
  25. 21 Apr, 2020 2 commits
  26. 06 Feb, 2020 1 commit
  27. 13 Jan, 2020 1 commit
    • Pierre Langlois's avatar
      [arm64][builtins] Allow simulator instructions in builtins. · d0650ae1
      Pierre Langlois authored
      Simulator-specific instructions are very useful, we can:
      
        - Place breakpoints that enable the simulator's interactive debugger, allowing
          us to see registers, the stack and print JS objects.
      
        - Enable and disable simulator tracing dynamically.
      
        - Call printf() directly, as the simulator cannot easily support its calling
          convention.
      
      However these tools are not available when generating builtins. The reason is
      that when cross-compiling, builtins are generated for real hardware but may
      still run inside the simulator on the host if we have a custom snapshot. Using
      the `v8_embed_script` GN option will do that for example but embedders may also
      do this with the V8 API.
      
      mksnapshot cannot tell the difference between generating code for a simulator
      build and a cross-build. If we change this, we can allow us to use
      simulator-specific features in builtins in simulator builds.
      
      So in this patch we:
      
        - Introduce a --target_is_simulator mksnapshot flag to drive the
          enable_simulator_code Assembler option.
      
        - Make sure the assembler respect the option instead of the USE_SIMULATOR
          macro.
      
      
      Change-Id: I7a7249f514427c1a2518a1af3679679596a72c7e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1991497Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
      Cr-Commit-Position: refs/heads/master@{#65734}
      d0650ae1
  28. 07 Jan, 2020 1 commit
  29. 14 Nov, 2019 1 commit
  30. 04 Nov, 2019 1 commit
    • Dan Elphick's avatar
      Reland "Reland: [builtins] Move non-JS linkage builtins code objects into RO_SPACE" · 352bbb12
      Dan Elphick authored
      This is a reland of 855591a5
      
      Fixes break in builds that verify ReadOnlyHeap by relaxing the requirement for
      Code objects to be in CODE_SPACE in PagedSpaceObjectIterator::FromCurrentPage.
      
      Original change's description:
      > Reland: [builtins] Move non-JS linkage builtins code objects into RO_SPACE
      >
      > Reland of https://chromium-review.googlesource.com/c/v8/v8/+/1795358.
      >
      > [builtins] Move non-JS linkage builtins code objects into RO_SPACE
      >
      > Creates an allow-list of builtins that can still go in code_space
      > including all TFJ builtins and a small manual list that should be pared
      > down in the future.
      >
      > For builtins that go in RO_SPACE a Code object is created that contains an
      > immediate trap instruction. Generally these Code objects are still no
      > smaller than CODE_SPACE Code objects because of the Code object alignment
      > requirements. This will hopefully be addressed in a follow-up CL either by
      > relaxing them or removing the instruction stream completely.
      >
      > In the snapshot, this reduces code_space from ~152k to ~40k (-112k) and
      > increases by the same amount.
      >
      > Change-Id: I76661c35c7ea5866c1fb16e87e87122b3e3ca0ce
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893336
      > Commit-Queue: Dan Elphick <delphick@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#64700}
      
      Change-Id: I4eeb7dab3027b42fa58c5dfb2bad9873e9fff250
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893192
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64728}
      352bbb12
  31. 31 Oct, 2019 2 commits
  32. 18 Oct, 2019 2 commits
    • Sathya Gunasekaran's avatar
      Revert "[builtins] Move non-JS linkage builtins code objects into RO_SPACE" · f1ebde88
      Sathya Gunasekaran authored
      This reverts commit 83f8464f.
      
      Reason for revert: speculative revert for blink linux failure
      https://ci.chromium.org/p/v8/builders/ci/V8%20Blink%20Linux/1272
      
      Original change's description:
      > [builtins] Move non-JS linkage builtins code objects into RO_SPACE
      > 
      > Creates an allow-list of builtins that can still go in code_space
      > including all TFJ builtins and a small manual list that should be pared
      > down in the future.
      > 
      > For builtins that go in RO_SPACE a Code object is created that contains
      > no code at all (shrinking its size from 96 bytes to 64 bytes on x64),
      > but is there to allow the runtime to continue to work since it expects
      > a Code object.
      > 
      > This reduces code_space from ~152k to ~40k (-112k) and increases
      > read_only_space from 33k to 108k (+75k) in the snapshot.
      > 
      > Bug: v8:7464, v8:9821, v8:9338, v8:8127
      > Change-Id: Icc8bfc722bb267a2bcc17e2f1e27bef7f02f2376
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1795358
      > Commit-Queue: Dan Elphick <delphick@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#64377}
      
      TBR=mstarzinger@chromium.org,jgruber@chromium.org,delphick@chromium.org
      
      Change-Id: I4cf38e9370280acdd2de718ca527776ebc509003
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7464, v8:9821, v8:9338, v8:8127
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1868621Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
      Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64383}
      f1ebde88
    • Dan Elphick's avatar
      [builtins] Move non-JS linkage builtins code objects into RO_SPACE · 83f8464f
      Dan Elphick authored
      Creates an allow-list of builtins that can still go in code_space
      including all TFJ builtins and a small manual list that should be pared
      down in the future.
      
      For builtins that go in RO_SPACE a Code object is created that contains
      no code at all (shrinking its size from 96 bytes to 64 bytes on x64),
      but is there to allow the runtime to continue to work since it expects
      a Code object.
      
      This reduces code_space from ~152k to ~40k (-112k) and increases
      read_only_space from 33k to 108k (+75k) in the snapshot.
      
      Bug: v8:7464, v8:9821, v8:9338, v8:8127
      Change-Id: Icc8bfc722bb267a2bcc17e2f1e27bef7f02f2376
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1795358
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64377}
      83f8464f
  33. 10 Sep, 2019 1 commit