1. 30 Jan, 2019 1 commit
  2. 24 May, 2018 1 commit
    • Andreas Haas's avatar
      [wasm] Reimplement WebAssembly.instantiate without desugaring · 8a95da24
      Andreas Haas authored
      At the moment, WebAssembly.instantiate(bytes) is implemented by
      desugaring it to WebAssembly.compile(bytes).then(WebAssembly.instantiate).
      The problem is that the {then} in this snippet is observable. With this
      CL I introduce a CompilationResultResolver which allows to do the
      desugaring internally and thereby make the {then} unobservable.
      Unfortunately the result of WebAssembly.instantiate(bytes) is different
      than the result of WebAssembly.instantiate(module). Therefore I also
      introduced an InstantiationResultResolver for symmetry with
      WebAssembly.compile.
      
      R=mstarzinger@chromium.org
      Bug: chromium:837417
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: I2d98e03d65f2ada19041d5a9e2df5da91b24ccca
      Reviewed-on: https://chromium-review.googlesource.com/1059783
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53347}
      8a95da24
  3. 27 Apr, 2018 1 commit
    • Andreas Haas's avatar
      [wasm] Do an additional IsWasmModuleObject check during instantiation · 441e6d4a
      Andreas Haas authored
      When WebAssembly.instantiate or WebAssembly.instantiateStreaming is
      called in JavaScript, internally we transfrom it into
      WebAssembly.compile(buffer).then(WebAssembly.instantiate). However,
      modifying the prototype of WebAssembly.Module can change the result of
      WebAssembly.compile(buffer). With this CL we make sure that even if the
      result of WebAssembly.compile is modified, there is still no type
      confusion. In the long term we have to do a refactoring and remove
      this internal transformation.
      
      R=mstarzinger@chromium.org
      
      Bug: chromium:837417
      Change-Id: I376068b8b8b01b991ec450162da6a62ae7030c62
      Reviewed-on: https://chromium-review.googlesource.com/1032392
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52859}
      441e6d4a
  4. 24 Apr, 2018 1 commit
    • Andreas Haas's avatar
      [wasm] Call AsyncInstantiate directly when instantiating a module object · 49712d8a
      Andreas Haas authored
      WebAssembly.instantiate is polymorphic, it can either take a module
      object as parameter, or a buffer source which should be compiled first.
      To share code between the two implementations, the module object was
      first passed to a promise (i.e. which is the result of compilation).
      However, passing the module object to a promise has a side effect if
      the module object has a then function. To avoid this side effect I
      remove this code sharing and call AsyncInstantiate directly in case
      the parameter is a module object.
      
      R=mstarzinger@chromium.org
      
      Bug: chromium:836141
      Change-Id: I67b76d0d7761c5aeb2cf1deda45b6842e494eed4
      Reviewed-on: https://chromium-review.googlesource.com/1025774Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52755}
      49712d8a
  5. 05 Feb, 2018 1 commit
  6. 22 Jan, 2018 1 commit
  7. 15 Jan, 2018 1 commit
  8. 17 Oct, 2017 1 commit
  9. 01 Jun, 2017 1 commit
  10. 30 May, 2017 1 commit
  11. 23 May, 2017 1 commit
  12. 22 May, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] Stricter max memory check · a5449b0f
      Clemens Hammacher authored
      If the maximum number of memory pages is raised using
      --wasm-max-mem-pages, we might allocate more than kMaxInt bytes for
      wasm memory. The byte length is stored as int in JSArrayBuffer, hence
      this can lead to failures.
      Thus, we now additially check against kMaxInt, and fail instantiation
      if this check fails.
      
      Drive-by: Add/fix more bounds checks.
      
      R=ahaas@chromium.org
      BUG=chromium:724846
      
      Change-Id: Id8e1a1e13e15f4aa355ab9414b4b950510e5e88a
      Reviewed-on: https://chromium-review.googlesource.com/509255Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45465}
      a5449b0f