1. 30 Oct, 2018 1 commit
  2. 12 Oct, 2018 1 commit
  3. 20 Sep, 2018 1 commit
  4. 19 Sep, 2018 3 commits
    • Clemens Hammacher's avatar
      Reland "[wasm] Introduce a soft limit on reserved memory" · 5e94b208
      Clemens Hammacher authored
      This is a reland of 3bb5cb63
      
      Original change's description:
      > [wasm] Introduce a soft limit on reserved memory
      > 
      > Currently, wasm memory and wasm code use a shared limit for the total
      > size of reservations. This can cause wasm code reservations to fail
      > because wasm memories used all available reservation space.
      > This CL introduces a soft limit which is used when allocating wasm
      > memory with full guards. If this limit is reached and the respective
      > flag is set, we fall back to allocation without full guards and check
      > against the hard limit. Code reservations always check against the hard
      > limit.
      > 
      > R=ahaas@chromium.org
      > 
      > Bug: v8:8196
      > Change-Id: I3fcbaeaa6f72c972d408d291af5d6b788d43151d
      > Reviewed-on: https://chromium-review.googlesource.com/1233614
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#56028}
      
      Bug: v8:8196
      Change-Id: If8baf429b02e23b344346f7335bc911b99ae5579
      Reviewed-on: https://chromium-review.googlesource.com/1233756Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56044}
      5e94b208
    • Leszek Swirski's avatar
      Revert "[wasm] Introduce a soft limit on reserved memory" · 196874aa
      Leszek Swirski authored
      This reverts commit 3bb5cb63.
      
      Reason for revert: Breaks Win64 bot https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Win64/26418
      
      Original change's description:
      > [wasm] Introduce a soft limit on reserved memory
      > 
      > Currently, wasm memory and wasm code use a shared limit for the total
      > size of reservations. This can cause wasm code reservations to fail
      > because wasm memories used all available reservation space.
      > This CL introduces a soft limit which is used when allocating wasm
      > memory with full guards. If this limit is reached and the respective
      > flag is set, we fall back to allocation without full guards and check
      > against the hard limit. Code reservations always check against the hard
      > limit.
      > 
      > R=​ahaas@chromium.org
      > 
      > Bug: v8:8196
      > Change-Id: I3fcbaeaa6f72c972d408d291af5d6b788d43151d
      > Reviewed-on: https://chromium-review.googlesource.com/1233614
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#56028}
      
      TBR=ahaas@chromium.org,clemensh@chromium.org
      
      Change-Id: If645e738b4a5800eceabd993738ac2285f4a63bc
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:8196
      Reviewed-on: https://chromium-review.googlesource.com/1233834Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56031}
      196874aa
    • Clemens Hammacher's avatar
      [wasm] Introduce a soft limit on reserved memory · 3bb5cb63
      Clemens Hammacher authored
      Currently, wasm memory and wasm code use a shared limit for the total
      size of reservations. This can cause wasm code reservations to fail
      because wasm memories used all available reservation space.
      This CL introduces a soft limit which is used when allocating wasm
      memory with full guards. If this limit is reached and the respective
      flag is set, we fall back to allocation without full guards and check
      against the hard limit. Code reservations always check against the hard
      limit.
      
      R=ahaas@chromium.org
      
      Bug: v8:8196
      Change-Id: I3fcbaeaa6f72c972d408d291af5d6b788d43151d
      Reviewed-on: https://chromium-review.googlesource.com/1233614Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56028}
      3bb5cb63
  5. 18 Sep, 2018 1 commit
  6. 17 Sep, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Fix flaky OOM on memory allocation · 863e6ce9
      Clemens Hammacher authored
      We still see occasions of "WebAssembly Instantiation: Out of memory:
      wasm memory", e.g. on the N5X arm64 bot.
      
      We already have a retry-loop around the {ReserveAddressSpace} call, so
      this error can only happen if {AllocatePages} fails.
      I cannot easily reproduce, so I will land this CL and hope that it
      fixes the flake.
      
      We might eventually replace all these gc-then-retry loops by a better
      mechanism which knows about process-wide allocations. Currently,
      {AllocatePages} is isolate-independent, and only calls
      {Platform::OnCriticalMemoryPressure}, but this call does nothing on the
      default platform. So trigger a GC on the current isolate instead.
      
      R=mlippautz@chromium.org
      
      Bug: chromium:883639, v8:7872, v8:8158
      Change-Id: Ib4e4a4a5f6b598d5832c327b1fc83ccb3bada9bc
      Reviewed-on: https://chromium-review.googlesource.com/1226886Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55955}
      863e6ce9
  7. 14 Sep, 2018 1 commit
  8. 13 Sep, 2018 1 commit
  9. 10 Sep, 2018 1 commit
  10. 06 Sep, 2018 1 commit
  11. 23 Aug, 2018 1 commit
  12. 17 Aug, 2018 1 commit
  13. 09 Aug, 2018 1 commit
    • Ben L. Titzer's avatar
      [wasm] Add WasmFeatures to enable/detect features · 6aa2a253
      Ben L. Titzer authored
      This CL introduces a set of configuration options implemented as
      a struct of booleans that together comprise the set of enabled
      or detected features. The configuration options replace command-line
      flags that were checked deep in the implementation. As such, it is
      necessary to plumb them through multiple levels of abstraction.
      
      R=ahaas@chromium.org
      CC=mstarzinger@chromium.org
      BUG=chromium:868844
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: I1b82f5826e4fd263f68e8cafcd923bac5818a637
      Reviewed-on: https://chromium-review.googlesource.com/1163670Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55018}
      6aa2a253
  14. 25 Jul, 2018 3 commits
  15. 24 Jul, 2018 1 commit
    • Ben L. Titzer's avatar
      [wasm] Prepare to support 4GiB memories · dab10765
      Ben L. Titzer authored
      This is a preparatory CL that refactors the WASM memory allocation path,
      the WasmGraphBuilder, and several points of contact for ArrayBuffers to
      allow them to eventually be up to 4GiB.
      
      1.) Refactor definition of constants to prepare for memories of size 2^32
      2.) Refactor WasmInstanceObject fields memory_size and memory_mask to
          be stored as uintptr_t
      3.) Refactor WasmGraphBuilder to use 64-bit comparisons for bounds checks
      4.) Refactor JSArrayBuffer accessor methods to use size_t properly.
      5.) Add empirical maximum memory and array buffer size tests
      
      R=mstarzinger@chromium.org
      BUG=v8:7881
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: I78a49069cfa89757cc93f0a30b1c1a99c4b2edba
      Reviewed-on: https://chromium-review.googlesource.com/1112003
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54646}
      dab10765
  16. 18 Jul, 2018 1 commit
  17. 21 Jun, 2018 1 commit
    • Eric Holk's avatar
      [wasm] Add negative guard regions · 7eea8eda
      Eric Holk authored
      This change adds an addition 2GiB of guard region in front of guarded
      WebAssembly memories. This provides defense in depth against code
      generation errors, such as accidental sign extension of a 32-bit value.
      As we consider supporting 4GiB WebAssembly memories, this is an
      important line of defense.
      
      Change-Id: Ica643c01ef28b5d2a01fbbd46273442545d8448e
      Reviewed-on: https://chromium-review.googlesource.com/1108503
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53949}
      7eea8eda
  18. 07 Jun, 2018 1 commit
    • Eric Holk's avatar
      [wasm] Fall back on bounds checks when guarded memory unavailable · b984b70c
      Eric Holk authored
      This CL adds the simplest version of a trap handler fallback. At
      instantiation time, we check whether the module was compiled to use
      trap handlers and the memory is guarded. If the memory is not guarded
      but the module is supposed to use trap handlers, we recompile the
      module with bounds checks so that we can use an unguarded memory.
      
      The compiled module is replaced with a bounds checking version, meaning
      future instances from this module will also use bounds checks.
      
      Some likely desirable features that are current missing but can be
      added future CLs include:
      * Disabling trap handler mode entirely.
      * Recompiling all old instances so that trap handler and bounds checked
        code does not coexist in the same process.
      
      Bug: v8:7143
      
      Change-Id: I161fc0d544133b07dc4a93cc6af813369aaf3efe
      Reviewed-on: https://chromium-review.googlesource.com/1018182
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53566}
      b984b70c
  19. 01 Jun, 2018 1 commit
  20. 29 May, 2018 1 commit
  21. 04 May, 2018 1 commit
  22. 03 May, 2018 1 commit
  23. 02 May, 2018 3 commits
    • Michael Lippautz's avatar
      [heap] Fix ArrayBufferTracker accessing already swept byte length · 55d00c95
      Michael Lippautz authored
      The tracker needs to maintain the byte length as there is no order guarantee
      when sweeping pages and the byte length may be a HeapNumber that is stored on a
      different page.
      
      The abstraction for ArrayBuffers is left untouched. We distinguish between the
      following cases:
      1. Regular AB (backing_store and bye_length should be used)
      2. AB allocated using kReservation but not part of wasm
      3. AB allocated using kReservation and part of wasm
      
      In practice, 2. does not exist, but we still maintain "allocation_base" and
      "allocation_length" which fall back to backing_store and byte_length in this
      case. The problematic part is that they look like innocent getters on the
      object but actually refer to different data structures or on-heap objects.
      
      Since 2. does not exist, and 3. looks up the bounds in its own tracker, it is
      fine for ArrayBufferTracker to pass backing_store and tracked byte_length.
      
      Bug: v8:7701
      Change-Id: Ib89d5fe94fce5cef8e5d8343a5415a3b9ad0deba
      Reviewed-on: https://chromium-review.googlesource.com/1039385Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52923}
      55d00c95
    • Eric Holk's avatar
      Reland "[wasm] Always enable guard regions on 64-bit platforms" · 19617ec0
      Eric Holk authored
      This is a reland of ad221d14
      
      Original change's description:
      > [wasm] Always enable guard regions on 64-bit platforms
      > 
      > This change makes full 8 GiB guard regions always enabled on 64-bit
      > platforms.
      > 
      > Additionally, since all Wasm memory allocation paths have some form of
      > guard regions, this removes and simplifies most of the logic around
      > whether to enable guard regions.
      > 
      > This is a reland of https://crrev.com/c/985142.
      > 
      > Bug: v8:7619
      > Change-Id: I8bf1f86d6f89fd0bb2144431c7628f15a6b00ba0
      > Reviewed-on: https://chromium-review.googlesource.com/996466
      > Reviewed-by: Brad Nelson <bradnelson@chromium.org>
      > Commit-Queue: Eric Holk <eholk@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52412}
      
      Bug: v8:7619
      Change-Id: I0f311305472ca2305ad2fa9163560ff54c1422c2
      Reviewed-on: https://chromium-review.googlesource.com/999872
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52921}
      19617ec0
    • Eric Holk's avatar
      [wasm] Remove racy DCHECKs · 07ef612f
      Eric Holk authored
      These DCHECKs involve reading and comparing two variables that may be modified
      on a separate thread. Thus, there is no way to ensure these comparisons happen
      atomically. This leads to runtime failures that are otherwise benign.
      
      The other option would be to take the memory tracker mutex, but this seems
      unnecessary given that two atomic counters is sufficient and these checks are
      only used during debug builds.
      
      Bug: chromium:838043
      Change-Id: I1b87698c46c550bd2d58bfef956b5a07cb2ec52c
      Reviewed-on: https://chromium-review.googlesource.com/1038886Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52920}
      07ef612f
  24. 24 Apr, 2018 1 commit
    • Eric Holk's avatar
      [wasm] Add metrics for Wasm memory allocation · 45dd38c1
      Eric Holk authored
      This adds two new UMA histograms to give us more insight into Wasm
      memory allocation.
      
      The first records the result of every attempt to to allocate a Wasm
      backing store. This will let us know things like how often we
      explicitly trigger a GC, or how often we hit our address space limit.
      
      The second records how many megabytes of address space Wasm reserves.
      A sample is added every time the number either increases or decreases.
      This metric will give us a sense of how many outstanding Wasm memories
      there are in typical usage.
      
      Change-Id: I38c1bc1ad915c26b6cda3c373ededdd395193a4c
      Reviewed-on: https://chromium-review.googlesource.com/1024646
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52767}
      45dd38c1
  25. 06 Apr, 2018 1 commit
  26. 05 Apr, 2018 2 commits
  27. 04 Apr, 2018 2 commits
  28. 03 Apr, 2018 1 commit
    • Eric Holk's avatar
      Revert "[wasm] Always enable guard regions on 64-bit platforms" · 76e79f0f
      Eric Holk authored
      This reverts commit 0cd7468b.
      
      Reason for revert: Blocks v8 roll into chromium: https://crbug.com/828499
      
      Original change's description:
      > [wasm] Always enable guard regions on 64-bit platforms
      > 
      > This change makes full 8 GiB guard regions always enabled on 64-bit
      > platforms.
      > 
      > Additionally, since all Wasm memory allocation paths have some form of
      > guard regions, this removes and simplifies most of the logic around
      > whether to enable guard regions.
      > 
      > R=​gdeepti@chromium.org
      > 
      > Change-Id: Idf3fbcc11ac70ea2ee7eb88c2173d6a1410395e1
      > Reviewed-on: https://chromium-review.googlesource.com/985142
      > Commit-Queue: Eric Holk <eholk@chromium.org>
      > Reviewed-by: Brad Nelson <bradnelson@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52310}
      
      TBR=bradnelson@chromium.org,gdeepti@chromium.org,eholk@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Change-Id: I126b5afe283a4fe08adfa301e637d2641c29cccd
      Reviewed-on: https://chromium-review.googlesource.com/993160Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52334}
      76e79f0f
  29. 30 Mar, 2018 1 commit
  30. 29 Mar, 2018 1 commit
  31. 28 Mar, 2018 1 commit
  32. 24 Mar, 2018 1 commit