1. 04 Apr, 2018 2 commits
    • Ben Titzer's avatar
      Revert "[wasm] Merge the WasmContext into WasmInstanceObject" · 8adb94fc
      Ben Titzer authored
      This reverts commit 57bf0bfe.
      
      Reason for revert: <INSERT REASONING HERE>
      
      Original change's description:
      > [wasm] Merge the WasmContext into WasmInstanceObject
      > 
      > This change makes lifetime management of WasmCode much simpler.
      > By using the WasmInstanceObject as the context for WASM code execution,
      > including the pointer to the memory base and indirect function tables,
      > this keeps the instance alive when WASM code is on the stack, since
      > the instance object is passed as a parameter and spilled onto the stack.
      > This is in preparation of sharing the code between instances and
      > isolates.
      > 
      > Bug: v8:7424
      > 
      > Change-Id: Ic2e4b7bcc2feb20001d0553a615a8a9dff36317e
      > Reviewed-on: https://chromium-review.googlesource.com/958520
      > Commit-Queue: Ben Titzer <titzer@chromium.org>
      > Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52361}
      
      TBR=mstarzinger@chromium.org,titzer@chromium.org,ahaas@chromium.org,clemensh@chromium.org
      
      Change-Id: I653e27b46dbc43ad773eda4292d521a508f42d79
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7424
      Reviewed-on: https://chromium-review.googlesource.com/995418Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52364}
      8adb94fc
    • Ben L. Titzer's avatar
      [wasm] Merge the WasmContext into WasmInstanceObject · 57bf0bfe
      Ben L. Titzer authored
      This change makes lifetime management of WasmCode much simpler.
      By using the WasmInstanceObject as the context for WASM code execution,
      including the pointer to the memory base and indirect function tables,
      this keeps the instance alive when WASM code is on the stack, since
      the instance object is passed as a parameter and spilled onto the stack.
      This is in preparation of sharing the code between instances and
      isolates.
      
      Bug: v8:7424
      
      Change-Id: Ic2e4b7bcc2feb20001d0553a615a8a9dff36317e
      Reviewed-on: https://chromium-review.googlesource.com/958520
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52361}
      57bf0bfe
  2. 03 Apr, 2018 1 commit
  3. 27 Mar, 2018 1 commit
    • Ben Smith's avatar
      [wasm] Fix crash serializing modules w/ big frames · fae1ab03
      Ben Smith authored
      When a wasm function has a large stack frame, the x64 code generator
      performs the stack overflow check before constructing the frame. This
      requires using the `address_of_real_stack_limit` external reference, as
      well as the `ThrowWasmStackOverflow` runtime function.
      
      `ThrowWasmStackOverflow` is called via a generated trampoline, but it is
      not a builtin, so the serializer adds it to the `stub_lookup_` map. This
      map is encoded by using a monotonically increasing `stub_id` that starts
      at 0.
      
      When the function is serialized, a stub is differentiated from a builtin
      by which half of the `i32` bits is used, upper or lower. A stub only
      uses the lower 16 bits and a builtin only uses the upper 16 bits.
      
      The deserializer checks whether the lower 16 bits are 0; if so, it is
      determined to be a builtin. But if the `stub_id` is 0, then it will be
      confused with builtin 0 (`RecordWrite`). Calling the builtin instead of
      the stub causes a crash.
      
      This CL starts all `stub_id`s at 1, which prevents the builtin/stub
      confusion.
      
      There is an additional bug that is not fixed by this CL:
      `ThrowWasmStackOverflow` shouldn't be called at all. Currently it is
      called because `address_of_real_stack_limit` is a thread-local value
      that is not properly relocated.
      
      Bug: chromium:808848
      Change-Id: I06b3e650ea58ad717dcc47a3716443e16582e711
      Reviewed-on: https://chromium-review.googlesource.com/981687Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Ben Smith <binji@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52252}
      fae1ab03
  4. 26 Mar, 2018 1 commit
  5. 24 Mar, 2018 1 commit
  6. 23 Mar, 2018 2 commits
  7. 22 Mar, 2018 2 commits
  8. 21 Mar, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Avoid redundant icache flushing · b9c46e3f
      Clemens Hammacher authored
      Code is often being patched after creating, thus we don't need to flush
      the icache right away.
      This CL introduces a new enum to specify whether the icache should be
      flushed or not, and uses this in all methods which don't always need to
      flush.
      
      Drive-by: Fix a but where SKIP_ICACHE_FLUSH was interpreted as boolean
      value.
      
      R=mstarzinger@chromium.org
      
      Change-Id: I13ac71d2a7168a065b8a4a1086c590816de8ca28
      Reviewed-on: https://chromium-review.googlesource.com/971881Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52102}
      b9c46e3f
  9. 15 Mar, 2018 1 commit
  10. 14 Mar, 2018 1 commit
  11. 13 Mar, 2018 1 commit
  12. 12 Mar, 2018 2 commits
  13. 06 Mar, 2018 1 commit
  14. 05 Mar, 2018 3 commits
  15. 01 Mar, 2018 1 commit
  16. 27 Feb, 2018 1 commit
  17. 23 Feb, 2018 1 commit
  18. 21 Feb, 2018 1 commit
  19. 13 Feb, 2018 1 commit
  20. 05 Feb, 2018 1 commit
  21. 23 Jan, 2018 1 commit
  22. 22 Jan, 2018 1 commit
  23. 16 Jan, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Merge function table and signature table · 553e70b9
      Clemens Hammacher authored
      Both tables are always updated together and are always accessed
      together. Thus merge them, reducing code complexity, but also code
      space and overhead for accessing them during runtime. Instead of two
      weak global handles, we only need one, which also means one less load
      for each indirect call.
      Merging them also improves cache locality, since signature and code
      address are not stored next to each other in memory, so they will very
      likely end up in the same cache line.
      
      R=titzer@chromium.org
      
      Change-Id: I862df7de93a98aa602a3895796610c2c520d6f21
      Reviewed-on: https://chromium-review.googlesource.com/866868
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#50623}
      553e70b9
  24. 15 Jan, 2018 1 commit
  25. 11 Jan, 2018 1 commit
  26. 10 Jan, 2018 1 commit
  27. 09 Jan, 2018 1 commit
  28. 12 Dec, 2017 1 commit
  29. 08 Dec, 2017 1 commit
  30. 07 Dec, 2017 1 commit
    • Karl Schimpf's avatar
      [wasm] First step of refactoring trap handling to be per module. · 0d5de9ad
      Karl Schimpf authored
      The previous code assumed that trap handling was a global concept, defined
      by function trap_handler::UseTrapHandler(). This CL does the first step
      in changing the decision to be specifiable at a module level.
      
      Therefore trap_handler::UseTrapHandler() is replaced by
      trap_handler::IsTrapHandlerEnabled(), and communicates if compilation
      supports the use of trap handlers (but still allowing the use of
      bounds checking on memory accesses).
      
      It then refactors the classes ModuleEnv and WasmCompiledModule to have
      a field "use_trap_handler" that specifies if traps should be used for
      the memory accesses in the module being compiled.
      
      Bug: v8:7143
      Change-Id: I9844842d5721c86c2dd55e911b42bf8b9922cf63
      Reviewed-on: https://chromium-review.googlesource.com/802322
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49915}
      0d5de9ad
  31. 05 Dec, 2017 1 commit
  32. 02 Dec, 2017 1 commit
    • Mathias Bynens's avatar
      Normalize casing of hexadecimal digits · 822be9b2
      Mathias Bynens authored
      This patch normalizes the casing of hexadecimal digits in escape
      sequences of the form `\xNN` and integer literals of the form
      `0xNNNN`.
      
      Previously, the V8 code base used an inconsistent mixture of uppercase
      and lowercase.
      
      Google’s C++ style guide uses uppercase in its examples:
      https://google.github.io/styleguide/cppguide.html#Non-ASCII_Characters
      
      Moreover, uppercase letters more clearly stand out from the lowercase
      `x` (or `u`) characters at the start, as well as lowercase letters
      elsewhere in strings.
      
      BUG=v8:7109
      TBR=marja@chromium.org,titzer@chromium.org,mtrofin@chromium.org,mstarzinger@chromium.org,rossberg@chromium.org,yangguo@chromium.org,mlippautz@chromium.org
      NOPRESUBMIT=true
      
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I790e21c25d96ad5d95c8229724eb45d2aa9e22d6
      Reviewed-on: https://chromium-review.googlesource.com/804294
      Commit-Queue: Mathias Bynens <mathias@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49810}
      822be9b2
  33. 30 Nov, 2017 1 commit
  34. 28 Nov, 2017 1 commit
    • Mircea Trofin's avatar
      Revert "Revert "[wasm] JIT using WasmCodeManager"" · b03b1bd9
      Mircea Trofin authored
      This reverts commit b301203e.
      
      Reason for revert: Fixed issues on arm.
      
      Original change's description:
      > Revert "[wasm] JIT using WasmCodeManager"
      > 
      > This reverts commit d4c8393c.
      > 
      > Reason for revert: Breaks ARM hardware:
      > https://build.chromium.org/p/client.v8.ports/builders/V8%20Arm%20-%20debug/builds/5268
      > 
      > Original change's description:
      > > [wasm] JIT using WasmCodeManager
      > > 
      > > This is the first step towards wasm code sharing. This CL moves wasm
      > > code generation outside the JavaScript GC heap using the previously -
      > > introduced WasmCodeManager (all this, behind the --wasm-jit-to-native
      > > flag).
      > > 
      > > See design document: go/wasm-on-native-heap-stage-1
      > > 
      > > This CL doesn't change other wasm architectural invariants. We still
      > > have per-Isolate wasm code generation, and per-wasm module instance
      > > code specialization.
      > > 
      > > Bug:v8:6876
      > > 
      > > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      > > Change-Id: I1e08cecad75f93fb081545c31228a4568be276d3
      > > Reviewed-on: https://chromium-review.googlesource.com/674086
      > > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > > Reviewed-by: Eric Holk <eholk@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#49689}
      > 
      > TBR=bradnelson@chromium.org,titzer@chromium.org,mtrofin@chromium.org,eholk@chromium.org
      > 
      > Change-Id: I89af1ea5decd841bc12cd2ceaf74d32bc4433885
      > No-Presubmit: true
      > No-Tree-Checks: true
      > No-Try: true
      > Bug: v8:6876
      > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      > Reviewed-on: https://chromium-review.googlesource.com/794690
      > Reviewed-by: Michael Achenbach <machenbach@chromium.org>
      > Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#49691}
      
      TBR=bradnelson@chromium.org,machenbach@chromium.org,titzer@chromium.org,mtrofin@chromium.org,eholk@chromium.org
      
      Change-Id: I1b07638d1bb2ba0664305b4b2dcfc1342dc8444f
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:6876
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/794434
      Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49692}
      b03b1bd9