1. 23 Jan, 2018 2 commits
  2. 16 Jan, 2018 3 commits
  3. 11 Jan, 2018 2 commits
  4. 05 Jan, 2018 1 commit
  5. 21 Dec, 2017 1 commit
  6. 20 Dec, 2017 2 commits
  7. 18 Dec, 2017 5 commits
  8. 15 Dec, 2017 1 commit
  9. 09 Dec, 2017 1 commit
  10. 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
  11. 28 Nov, 2017 4 commits
    • 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
    • Michael Achenbach's avatar
      Revert "[wasm] JIT using WasmCodeManager" · b301203e
      Michael Achenbach authored
      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/794690Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49691}
      b301203e
    • Mircea Trofin's avatar
      [wasm] JIT using WasmCodeManager · d4c8393c
      Mircea Trofin authored
      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/674086Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49689}
      d4c8393c
    • Clemens Hammacher's avatar
      [wasm] Factor out {GetWasmFunctionInfo} function · dbe3362d
      Clemens Hammacher authored
      There are several places where we extract function information
      (instance and function index) from the deoptimization data. Add a
      central method to do this.
      
      Drive-by: Move {AttachWasmFunctionInfo} from wasm-compiler.h to
      wasm-objects.h.
      
      R=titzer@chromium.org
      
      Change-Id: I768d2c9aa8049f75a6be02242b1fe524ff42e3e4
      Reviewed-on: https://chromium-review.googlesource.com/793046Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49682}
      dbe3362d
  12. 22 Nov, 2017 1 commit
  13. 20 Nov, 2017 3 commits
    • Mircea Trofin's avatar
      Reland "[wasm] Data structures for JIT-ing wasm to native memory." · 0cd6166c
      Mircea Trofin authored
      This is a reland of c71fd20c
      Original change's description:
      > [wasm] Data structures for JIT-ing wasm to native memory.
      >
      > This CL introduces the structures for JIT-ing wasm on the native heap.
      > They are described in detail at go/wasm-on-native-heap-stage-1
      >
      > Briefly:
      > - WasmCodeManager manages memory for modules and offers an interior
      > pointer lookup (i.e. PC -> WasmCode)
      > - WasmCode represents code, including reloc info. It holds wasm
      > specific data, like function index, and runtime information, like trap
      > handler info.
      > - NativeModule manages memory for one module.
      >
      > Tests cover the allocation and lookup aspects, following that current
      > regression tests cover the JITed code. A separate CL will enable
      > JITing using the new data structures.
      >
      > Bug: v8:6876
      > Change-Id: I1731238409001fe97c97eafb7a12fd3922da6a42
      > Reviewed-on: https://chromium-review.googlesource.com/767581
      > Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#49501}
      
      Bug: v8:6876
      Change-Id: Ifd1a4c23de8150dbdc75f059cd657e9670b15c9b
      Reviewed-on: https://chromium-review.googlesource.com/779680
      Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49512}
      0cd6166c
    • Mircea Trofin's avatar
      Revert "[wasm] Data structures for JIT-ing wasm to native memory." · 9e45be09
      Mircea Trofin authored
      This reverts commit c71fd20c.
      
      Reason for revert: msvc is unhappy (https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/208)
      
      Original change's description:
      > [wasm] Data structures for JIT-ing wasm to native memory.
      > 
      > This CL introduces the structures for JIT-ing wasm on the native heap.
      > They are described in detail at go/wasm-on-native-heap-stage-1
      > 
      > Briefly:
      > - WasmCodeManager manages memory for modules and offers an interior
      > pointer lookup (i.e. PC -> WasmCode)
      > - WasmCode represents code, including reloc info. It holds wasm
      > specific data, like function index, and runtime information, like trap
      > handler info.
      > - NativeModule manages memory for one module.
      > 
      > Tests cover the allocation and lookup aspects, following that current
      > regression tests cover the JITed code. A separate CL will enable JITing
      > using the new data structures.
      > 
      > Bug: v8:6876
      > Change-Id: I1731238409001fe97c97eafb7a12fd3922da6a42
      > Reviewed-on: https://chromium-review.googlesource.com/767581
      > Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#49501}
      
      TBR=bradnelson@chromium.org,ulan@chromium.org,mstarzinger@chromium.org,titzer@chromium.org,mtrofin@chromium.org,mlippautz@chromium.org
      
      Change-Id: Id54deb74782c6f0fd06c61ddcabb727eb7010333
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:6876
      Reviewed-on: https://chromium-review.googlesource.com/779679Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
      Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49503}
      9e45be09
    • Mircea Trofin's avatar
      [wasm] Data structures for JIT-ing wasm to native memory. · c71fd20c
      Mircea Trofin authored
      This CL introduces the structures for JIT-ing wasm on the native heap.
      They are described in detail at go/wasm-on-native-heap-stage-1
      
      Briefly:
      - WasmCodeManager manages memory for modules and offers an interior
      pointer lookup (i.e. PC -> WasmCode)
      - WasmCode represents code, including reloc info. It holds wasm
      specific data, like function index, and runtime information, like trap
      handler info.
      - NativeModule manages memory for one module.
      
      Tests cover the allocation and lookup aspects, following that current
      regression tests cover the JITed code. A separate CL will enable JITing
      using the new data structures.
      
      Bug: v8:6876
      Change-Id: I1731238409001fe97c97eafb7a12fd3922da6a42
      Reviewed-on: https://chromium-review.googlesource.com/767581
      Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49501}
      c71fd20c
  14. 31 Oct, 2017 1 commit
  15. 25 Oct, 2017 1 commit
  16. 20 Oct, 2017 1 commit
  17. 16 Oct, 2017 2 commits
  18. 04 Oct, 2017 1 commit
  19. 28 Sep, 2017 2 commits
    • Enrico Bacis's avatar
      [wasm] Introduce the WasmContext · 6cd7a5a7
      Enrico Bacis authored
      The WasmContext struct introduced in this CL is used to store the
      mem_size and mem_start address of the wasm memory. These variables can
      be accessed at C++ level at graph build time (e.g., initialized during
      instance building). When the GrowMemory runtime is invoked, the context
      variables can be changed in the WasmContext at C++ level so that the
      generated code will load the correct values.
      
      This requires to insert a relocatable pointer only in the
      JSToWasmWrapper (and in the other wasm entry points), the value is then
      passed from function to function as an automatically added additional
      parameter. The WasmContext is then dropped when creating an Interpreter
      Entry or when invoking a JavaScript function. This removes the need of
      patching the generated code at runtime (i.e., when the memory grows)
      with respect to WASM_MEMORY_REFERENCE and WASM_MEMORY_SIZE_REFERENCE.
      However, we still need to patch the code at instance build time to patch
      the JSToWasmWrappers; in fact the address of the WasmContext is not
      known during compilation, but only when the instance is built.
      
      The WasmContext address is passed as the first parameter. This has the
      advantage of not having to move the WasmContext around if the function
      does not use many registers. This CL also changes the wasm calling
      convention so that the first parameter register is different from the
      return value register. The WasmContext is attached to every
      WasmMemoryObject, to share the same context with multiple instances
      sharing the same memory. Moreover, the nodes representing the
      WasmContext variables are cached in the SSA environment, similarly to
      other local variables that might change during execution.  The nodes are
      created when initializing the SSA environment and refreshed every time a
      grow_memory or a function call happens, so that we are sure that they
      always represent the correct mem_size and mem_start variables.
      
      This CL also removes the WasmMemorySize runtime (since it's now possible
      to directly retrieve mem_size from the context) and simplifies the
      GrowMemory runtime (since every instance now has a memory_object).
      
      R=ahaas@chromium.org,clemensh@chromium.org
      CC=gdeepti@chromium.org
      
      Change-Id: I3f058e641284f5a1bbbfc35a64c88da6ff08e240
      Reviewed-on: https://chromium-review.googlesource.com/671008
      Commit-Queue: Enrico Bacis <enricobacis@google.com>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48209}
      6cd7a5a7
    • Ben L. Titzer's avatar
      [wasm] Move compilation methods to module-compiler.h · afb7bdc4
      Ben L. Titzer authored
      Note that this also makes it possible to move several classes
      into the module-compiler.cc file and inline their implementations.
      
      This also allows removing several uses of wasm-module.h from
      other places in V8 that include wasm-objects.h.
      
      R=yangguo@chromium.org,clemensh@chromium.org,ahaas@chromium.org
      
      Bug: 
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I303ee2bb49dc53c951d377a1b65699c1e0e91da7
      Reviewed-on: https://chromium-review.googlesource.com/687494Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48204}
      afb7bdc4
  20. 27 Sep, 2017 1 commit
  21. 19 Sep, 2017 1 commit
    • Mircea Trofin's avatar
      [wasm] Sanitize imports · 1bc42ab4
      Mircea Trofin authored
      Sanitize imports before we start the instance building process. This
      avoids the possibility of exiting to JS while building instances,
      and allowing JS to observe an inconsistent state of the wasm world -
      e.g. incomplete specialization chains.
      
      We now validate we never exit to JS during that process.
      
      Bug: chromium:766260
      
      Change-Id: I34930c8b70bdac16af464b3f62a2b6a38107acb3
      Reviewed-on: https://chromium-review.googlesource.com/671480
      Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48074}
      1bc42ab4
  22. 11 Sep, 2017 1 commit
    • Deepti Gandluri's avatar
      [wasm] Memory.Grow with guard pages enabled should adjust memory allocated · 2aecded2
      Deepti Gandluri authored
       - Memory.Grow with guard pages enabled should adjust amount of allocated
         memory, and not allocate a new buffer. This was disabled because previously
         the backing store was freed in the MemoryFinalizer, and we needed to be sure
         that the backing store is not released till the last buffer using it is
         released. This is now safe as we no longer use the MemoryFinalizer
       - SetProtection should use Guard/Unprotect that use mprotect underneath,
         instead of CommitRegion/UncommitRegion that use mmap
       - Move buffer allocation to the end to avoid inconsistent memory due to GC
      
      BUG=v8:5886
      
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I0d7edb884bd1e3167eb5fbced6953c6401688d40
      Reviewed-on: https://chromium-review.googlesource.com/629517Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
      Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
      Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47960}
      2aecded2
  23. 08 Sep, 2017 2 commits