1. 23 Mar, 2021 1 commit
    • Andreas Haas's avatar
      [api] Add callback to set up conditional features · 16d9298a
      Andreas Haas authored
      Origin trials allow webpages to use experimental features even though
      the features are not yet enabled by default. These features will then
      get enabled per execution context: it is possible that the feature is
      enabled in one execution context but disabled in another execution
      context. In V8 we check for origin trials by calling a callback provided
      by the embedder that takes the context as a parameter and returns
      whether a feature is enabled in this context or not.
      
      This approach fails when a feature changes the context itself, e.g. by
      extending the global object. In that case the context is not available
      yet to check for the origin trial.
      
      To solve the problem this CL adds a new API function that can be called
      by the embedder to notify V8 that context with the origin trial
      information is finished. After that V8 can read the origin trial
      information from the context and extend e.g. the global object with the
      origin trial features.
      
      Additionally to the API this CL also adds code to enable the
      WebAssembly.Exception constructor conditionally, depending on whether
      it has been enabled by an origin trial or not.
      
      The Blink-side change: https://crrev.com/c/2775573
      
      R=ulan@chromium.org, jkummerow@chromium.org
      
      Change-Id: Ic05c4a89eb3e0e31469e49da8767d630c43b2e00
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2773287Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73597}
      16d9298a
  2. 16 Mar, 2021 1 commit
  3. 18 Jan, 2021 1 commit
    • Clemens Backes's avatar
      [wasm][liftoff] Check for unexpected bailout · 589677bc
      Clemens Backes authored
      We are working on getting Liftoff feature complete. Eventually, bailout
      should only happen if experimental features are enabled. Until we are
      there, we also need to allow some more bailouts, which should be removed
      in the near future.
      
      This CL adds a check for expected bailout reasons. The new function
      serves as a burndown list of issues to be fixed.
      
      Drive-by: Make some methods constexpr such that they can be used in
      static assertions.
      
      R=ahaas@chromium.org
      
      Change-Id: I5d3cd8f49a30d01f89ac6cf5321e1314b63eba40
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2629513
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72127}
      589677bc
  4. 01 Jul, 2020 1 commit
    • Manos Koukoutos's avatar
      [wasm] Properly implement parsing of s33 values · 5df74c35
      Manos Koukoutos authored
      Motivation:
      We used to approximate s33/i33 value parsing by first checking for
      specific negative codes, and then parsing an u32 value if that failed.
      This is not correct in all cases.
      
      Changes:
      - Implement i33 parsing in Decoder.
      - Factor out parsing of heap types into read_heap_type.
      - Introduce HeapType::kBottom.
      - Introduce helper functions in WasmFeatures and value_type_reader.
      - Remove macros from the parsing of value types.
      - HeapType::code now returns an i32 for compatibility with the i33
        requirement.
      - Introduce HeapType::Repr.
      - Renamings: HeapType::type() -> representation(),
                   ValueType::heap() -> heap_representation()
      
      Bug: v8:7748
      Change-Id: I04deabce8837a48af2226411cd706a397f9e5725
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2274118
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68633}
      5df74c35
  5. 26 Nov, 2019 1 commit
  6. 06 Aug, 2019 1 commit
  7. 23 Aug, 2018 3 commits
    • Ben L. Titzer's avatar
      Reland "[wasm] Add feature counter for threads and shared memory" · ab6d5ed5
      Ben L. Titzer authored
      This is a reland of b10a967f
      
      Original change's description:
      > [wasm] Add feature counter for threads and shared memory
      > 
      > This adds a feature counter for WASM shared memory (i.e. the presence
      > of the "shared" bit in a WASM module's memory section) and the usage
      > of WASM threads opcodes (i.e. wake/wait and atomics).
      > 
      > This CL also plumbs the WasmFeatures through the compilation pipeline
      > to detect features as functions are being compiled.
      > 
      > R=ahaas@chromium.org, ulan@chromium.org
      > BUG=chromium:868844
      > 
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      > Change-Id: I854f932d3adb16e4fd87196fe2a193950295b856
      > Reviewed-on: https://chromium-review.googlesource.com/1186329
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#55337}
      
      Bug: chromium:868844
      Change-Id: Iac3a38d80fa71aadd7147704669a8fd671ecfae8
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/1186343
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55363}
      ab6d5ed5
    • Maya Lekova's avatar
      Revert "[wasm] Add feature counter for threads and shared memory" · a984ccd7
      Maya Lekova authored
      This reverts commit b10a967f.
      
      Reason for revert: Breaks a TSAN bot - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20TSAN/22122
      
      Original change's description:
      > [wasm] Add feature counter for threads and shared memory
      > 
      > This adds a feature counter for WASM shared memory (i.e. the presence
      > of the "shared" bit in a WASM module's memory section) and the usage
      > of WASM threads opcodes (i.e. wake/wait and atomics).
      > 
      > This CL also plumbs the WasmFeatures through the compilation pipeline
      > to detect features as functions are being compiled.
      > 
      > R=​ahaas@chromium.org, ulan@chromium.org
      > BUG=chromium:868844
      > 
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      > Change-Id: I854f932d3adb16e4fd87196fe2a193950295b856
      > Reviewed-on: https://chromium-review.googlesource.com/1186329
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#55337}
      
      TBR=ulan@chromium.org,titzer@chromium.org,ahaas@chromium.org
      
      Change-Id: Id011b6707b3359598621b315b87171644132b0ab
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: chromium:868844
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/1186421Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55340}
      a984ccd7
    • Ben L. Titzer's avatar
      [wasm] Add feature counter for threads and shared memory · b10a967f
      Ben L. Titzer authored
      This adds a feature counter for WASM shared memory (i.e. the presence
      of the "shared" bit in a WASM module's memory section) and the usage
      of WASM threads opcodes (i.e. wake/wait and atomics).
      
      This CL also plumbs the WasmFeatures through the compilation pipeline
      to detect features as functions are being compiled.
      
      R=ahaas@chromium.org, ulan@chromium.org
      BUG=chromium:868844
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: I854f932d3adb16e4fd87196fe2a193950295b856
      Reviewed-on: https://chromium-review.googlesource.com/1186329Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55337}
      b10a967f
  8. 13 Aug, 2018 1 commit
    • Andreas Haas's avatar
      [wasm] Check the isolate if WebAssembly threads are enabled. · 1408e127
      Andreas Haas authored
      With the origin trial for WebAssembly threads, threads can be turned on
      and off by the embedder depending on the context we are currently in.
      With this CL we call the embedder callback stored on the isolate to
      determine whether threads are enabled in the current context or not.
      
      Design decision:
      I decided to extend the {WasmFeaturesFromIsolate} function to ask the
      embedder if WebAssembly threads are enabled. This is the function which
      defines dynamically which features are turned on. It would be awkward
      to have two such functions, one which calls the embedder and one which
      does not.
      A downside is that in WasmJs::Install the embedder does not seem to be
      ready to be called. That's why I changed the code there to call
      {WasmFeaturesFromFlags} instead.
      
      R=titzer@chromium.org, mstarzinger@chromium.org
      
      Bug: chromium:868844
      Change-Id: I6bfa89960a54cec71992756e3717bbb3a9fe195e
      Reviewed-on: https://chromium-review.googlesource.com/1169180
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55076}
      1408e127
  9. 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