1. 06 Dec, 2016 1 commit
  2. 05 Dec, 2016 3 commits
  3. 03 Dec, 2016 1 commit
    • gdeepti's avatar
      [wasm] Fix WasmInstanceWrapper allocation. · 6454102c
      gdeepti authored
      In the current implementation, WasmInstanceWrapper is allocated after the imports for the instance are processed, and before the InstanceFinalizer callback is associated with the instance. This raises the possibility of triggering a gc in the middle of the instantiate flow which is incorrect.
      
      BUG=5707
      
      R=titzer@chromium.org, petermarshall@chromium.org
      
      Review-Url: https://codereview.chromium.org/2544273002
      Cr-Commit-Position: refs/heads/master@{#41464}
      6454102c
  4. 02 Dec, 2016 1 commit
  5. 01 Dec, 2016 4 commits
    • bbudge's avatar
      [Turbofan] Canonicalize SIMD 32x4 Select, Swizzle, and Shuffle. · df9deb53
      bbudge authored
      - These operations are identical for Float32x4 and Int32x4.
      - Make them generic, following the naming for generic Simd128 / S128
      opcodes.
      - F32x4/I32x4 -> S32x4, similarly to S128
      - Float32x4/Int32x4 -> Simd32x4, similarly to Simd128.
      
      LOG=N
      BUG=v8:4124
      
      Review-Url: https://codereview.chromium.org/2543773002
      Cr-Commit-Position: refs/heads/master@{#41437}
      df9deb53
    • clemensh's avatar
      [wasm] Make DisassembleFunction a method of WasmCompiledModule · 4e55cbf7
      clemensh authored
      Before, it was a method in wasm namespace, and received a
      Handle<WasmCompiledModule>. As it does not allocate on the heap, we can
      just make it a non-static method on WasmCompiledModule.
      
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2536373007
      Cr-Commit-Position: refs/heads/master@{#41429}
      4e55cbf7
    • bradnelson's avatar
      [wasm][asm.js] Allow a function to be exported more than once. · 71cc94da
      bradnelson authored
      Allow a function to be exported multiple times in a asm.js
      module.
      Remarkably, this had not been working before.
      
      BUG=670057
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2535723009
      Cr-Commit-Position: refs/heads/master@{#41416}
      71cc94da
    • clemensh's avatar
      [base] Define CHECK comparison for signed vs. unsigned · db0c86fa
      clemensh authored
      The current CHECK/DCHECK implementation fails statically if a signed
      value is compared against an unsigned value. The common solution is to
      cast on each caller, which is tedious and error-prone (might hide bugs).
      This CL implements signed vs. unsigned comparisons by executing up to
      two comparisons. For example, if i is int32_t and u is uint_32_t, a
      DCHECK_LE(i, u) would create the check
      i <= 0 || static_cast<uint32_t>(i) <= u.
      For checks against constants, at least one of the checks can be removed
      by compiler optimizations.
      
      The tradeoff we have to make is to sometimes silently execute an
      additional comparison. And we increase code complexity of course, even
      though the usage is just as easy (or even easier) as before.
      
      The compile time impact seems to be minimal:
      I ran 3 full compilations for Optdebug on my local machine, one time on
      the current ToT, one time with this CL plus http://crrev.com/2524093002.
      Before: 143.72 +- 1.21 seconds
      Now: 144.18 +- 0.67 seconds
      
      In order to check that the new comparisons are working, I refactored
      some DCHECKs in wasm to use the new magic, and added unit test cases.
      
      R=ishell@chromium.org, titzer@chromium.org
      CC=ahaas@chromium.org, bmeurer@chromium.org
      
      Committed: https://crrev.com/5925074a9dab5a8577766545b91b62f2c531d3dc
      Review-Url: https://codereview.chromium.org/2526783002
      Cr-Original-Commit-Position: refs/heads/master@{#41275}
      Cr-Commit-Position: refs/heads/master@{#41411}
      db0c86fa
  6. 30 Nov, 2016 3 commits
  7. 28 Nov, 2016 1 commit
    • clemensh's avatar
      [wasm] Move asm.js offset table to compiled module · 916a5337
      clemensh authored
      Before, the encoded variant was stored in the compiled module, and the
      decoded one in the debug info (per instance).
      The decoded table was a FixedArray of ByteArrays.
      Now, also the decoded table is a flat ByteArray, and it encodes whether
      it is encoded or decoded. This saves memory and allows to store encoded
      and decoded variant in the same field. The table is automatically
      decoded on the first use.
      
      This CL also removes some unused and unimplemented methods from
      WasmDebugInfo (probably merge artifacts). That class is now pretty much
      empty, but we might still need it for breakpoint support.
      
      R=titzer@chromium.org, ahaas@chromium.org
      
      Review-Url: https://codereview.chromium.org/2522953002
      Cr-Commit-Position: refs/heads/master@{#41316}
      916a5337
  8. 24 Nov, 2016 2 commits
    • clemensh's avatar
      Revert of [base] Define CHECK comparison for signed vs. unsigned (patchset #5... · 0406620c
      clemensh authored
      Revert of [base] Define CHECK comparison for signed vs. unsigned (patchset #5 id:80001 of https://codereview.chromium.org/2526783002/ )
      
      Reason for revert:
      Need to revert previous CL because of Android compile error, and this one depends in it.
      
      Original issue's description:
      > [base] Define CHECK comparison for signed vs. unsigned
      >
      > The current CHECK/DCHECK implementation fails statically if a signed
      > value is compared against an unsigned value. The common solution is to
      > cast on each caller, which is tedious and error-prone (might hide bugs).
      > This CL implements signed vs. unsigned comparisons by executing up to
      > two comparisons. For example, if i is int32_t and u is uint_32_t, a
      > DCHECK_LE(i, u) would create the check
      > i <= 0 || static_cast<uint32_t>(i) <= u.
      > For checks against constants, at least one of the checks can be removed
      > by compiler optimizations.
      >
      > The tradeoff we have to make is to sometimes silently execute an
      > additional comparison. And we increase code complexity of course, even
      > though the usage is just as easy (or even easier) as before.
      >
      > The compile time impact seems to be minimal:
      > I ran 3 full compilations for Optdebug on my local machine, one time on
      > the current ToT, one time with this CL plus http://crrev.com/2524093002.
      > Before: 143.72 +- 1.21 seconds
      > Now: 144.18 +- 0.67 seconds
      >
      > In order to check that the new comparisons are working, I refactored
      > some DCHECKs in wasm to use the new magic.
      >
      > R=bmeurer@chromium.org, titzer@chromium.org
      >
      > Committed: https://crrev.com/5925074a9dab5a8577766545b91b62f2c531d3dc
      > Cr-Commit-Position: refs/heads/master@{#41275}
      
      TBR=ishell@chromium.org,titzer@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      
      Review-Url: https://codereview.chromium.org/2531533003
      Cr-Commit-Position: refs/heads/master@{#41277}
      0406620c
    • clemensh's avatar
      [base] Define CHECK comparison for signed vs. unsigned · 5925074a
      clemensh authored
      The current CHECK/DCHECK implementation fails statically if a signed
      value is compared against an unsigned value. The common solution is to
      cast on each caller, which is tedious and error-prone (might hide bugs).
      This CL implements signed vs. unsigned comparisons by executing up to
      two comparisons. For example, if i is int32_t and u is uint_32_t, a
      DCHECK_LE(i, u) would create the check
      i <= 0 || static_cast<uint32_t>(i) <= u.
      For checks against constants, at least one of the checks can be removed
      by compiler optimizations.
      
      The tradeoff we have to make is to sometimes silently execute an
      additional comparison. And we increase code complexity of course, even
      though the usage is just as easy (or even easier) as before.
      
      The compile time impact seems to be minimal:
      I ran 3 full compilations for Optdebug on my local machine, one time on
      the current ToT, one time with this CL plus http://crrev.com/2524093002.
      Before: 143.72 +- 1.21 seconds
      Now: 144.18 +- 0.67 seconds
      
      In order to check that the new comparisons are working, I refactored
      some DCHECKs in wasm to use the new magic.
      
      R=bmeurer@chromium.org, titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2526783002
      Cr-Commit-Position: refs/heads/master@{#41275}
      5925074a
  9. 23 Nov, 2016 3 commits
    • gdeepti's avatar
      [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. · e108f90d
      gdeepti authored
      Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
       - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
       - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
       - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
       - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      
       R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      
      Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31
      Review-Url: https://codereview.chromium.org/2471883003
      Cr-Original-Original-Commit-Position: refs/heads/master@{#41121}
      Cr-Original-Commit-Position: refs/heads/master@{#41198}
      Cr-Commit-Position: refs/heads/master@{#41234}
      e108f90d
    • hablich's avatar
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple... · de330e13
      hablich authored
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (patchset #13 id:240001 of https://codereview.chromium.org/2471883003/ )
      
      Reason for revert:
      Test crashes after an unrelated revert: https://chromegw.corp.google.com/i/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/7189
      
      Reverting because of recommendation from WASM team.
      
      Original issue's description:
      > [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
      >
      > Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
      >  - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
      >  - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
      >  - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
      >  - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      >
      >  R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      >
      > Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      > Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31
      > Cr-Original-Commit-Position: refs/heads/master@{#41121}
      > Cr-Commit-Position: refs/heads/master@{#41198}
      
      TBR=bradnelson@chromium.org,mtrofin@chromium.org,titzer@chromium.org,gdeepti@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      
      Review-Url: https://codereview.chromium.org/2529573002
      Cr-Commit-Position: refs/heads/master@{#41208}
      de330e13
    • gdeepti's avatar
      [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. · 3c98e339
      gdeepti authored
      Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
       - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
       - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
       - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
       - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      
       R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      
      Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      Review-Url: https://codereview.chromium.org/2471883003
      Cr-Original-Commit-Position: refs/heads/master@{#41121}
      Cr-Commit-Position: refs/heads/master@{#41198}
      3c98e339
  10. 22 Nov, 2016 2 commits
    • clemensh's avatar
      [wasm] Move and refactor position to location translation · de52d865
      clemensh authored
      The GetPositionInfo function only operates on WasmCompiledModule, so it
      should be a method of that class.
      This CL also splits the method in two, such that I can reuse the
      GetContainingFunction method for breakpoint support.
      
      R=titzer@chromium.org
      BUG=chromium:613110
      
      Review-Url: https://codereview.chromium.org/2521293002
      Cr-Commit-Position: refs/heads/master@{#41191}
      de52d865
    • clemensh's avatar
      [wasm] Implement official wasm text format · 172f5012
      clemensh authored
      When disassembling functions for the inspector, we used an internal
      text representation before. This CL implements the official text
      format like it is understood by the spec interpreter.
      
      Example output:
      func $main (param i32) (result i32)
      block i32
        get_local 0
        i32.const 2
        i32.lt_u
        if
          i32.const -2
          return
        end
        get_local 0
        call_indirect 0
      end
      
      R=rossberg@chromium.org, titzer@chromium.org
      BUG=chromium:659715
      
      Review-Url: https://codereview.chromium.org/2520943002
      Cr-Commit-Position: refs/heads/master@{#41172}
      172f5012
  11. 21 Nov, 2016 2 commits
  12. 19 Nov, 2016 2 commits
    • machenbach's avatar
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple... · 682f6500
      machenbach authored
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (patchset #10 id:180001 of https://codereview.chromium.org/2471883003/ )
      
      Reason for revert:
      Breaks gc stress:
      https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/7114
      
      Original issue's description:
      > [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
      >
      > Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
      >  - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
      >  - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
      >  - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
      >  - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      >
      >  R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      >
      > Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      > Cr-Commit-Position: refs/heads/master@{#41121}
      
      TBR=bradnelson@chromium.org,mtrofin@chromium.org,titzer@chromium.org,gdeepti@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      
      Review-Url: https://codereview.chromium.org/2512323004
      Cr-Commit-Position: refs/heads/master@{#41122}
      682f6500
    • gdeepti's avatar
      [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. · 30ef8e33
      gdeepti authored
      Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
       - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
       - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
       - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
       - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      
       R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      
      Review-Url: https://codereview.chromium.org/2471883003
      Cr-Commit-Position: refs/heads/master@{#41121}
      30ef8e33
  13. 18 Nov, 2016 2 commits
    • clemensh's avatar
      [wasm] Translate locations to positions properly · 8ab945f2
      clemensh authored
      ... at least for the function which will remain after restructuring of
      the debug interface. For some methods that will be removed anyway, we
      just return zero / null for now.
      
      I also refactored the ScriptLocationFromLine method to make it more
      readable and reuse parts in other files (like ScriptLinePosition).
      
      BUG=5655
      R=titzer@chromium.org, jgruber@chromium.org
      
      Review-Url: https://codereview.chromium.org/2512833003
      Cr-Commit-Position: refs/heads/master@{#41115}
      8ab945f2
    • clemensh's avatar
      [wasm] Implement frame printing for debug · 18084f17
      clemensh authored
      This makes wasm frames show up nicely in stack traces generated e.g. by
      Isolate::PrintStack() and Isolate::PrintCurrentStackTrace().
      With this CL, we print the script name, function index, function name,
      pc and source position.
      
      R=titzer@chromium.org, ahaas@chromium.org
      
      Review-Url: https://codereview.chromium.org/2509323002
      Cr-Commit-Position: refs/heads/master@{#41102}
      18084f17
  14. 17 Nov, 2016 4 commits
  15. 16 Nov, 2016 4 commits
  16. 15 Nov, 2016 2 commits
    • titzer's avatar
      [wasm] Be more lenient on the names section. · 6e643f04
      titzer authored
      R=clemensh@chromium.org,dschuff@chromium.org
      BUG=v8:5632
      LOG=Y
      
      Review-Url: https://codereview.chromium.org/2501873003
      Cr-Commit-Position: refs/heads/master@{#41011}
      6e643f04
    • clemensh's avatar
      [wasm] Allocate a single script per wasm module · 32077e01
      clemensh authored
      Before, we allocated one script per function per instance, and each
      script referenced the wasm instance and the function index. Now we only
      allocate one script per compiled wasm module, so the script also only
      references this WasmCompiledModule, which causes changes to many interfaces.
      
      Instead of fixing the disassemble API only used via debug.js, I decided
      to drop it for now. Some later CL will reintroduce it via
      DebugInterface.
      
      BUG=v8:5530,chromium:659715
      R=yangguo@chromium.org, titzer@chromium.org
      CC=jgruber@chromium.org
      
      Review-Url: https://codereview.chromium.org/2493823003
      Cr-Commit-Position: refs/heads/master@{#41004}
      32077e01
  17. 14 Nov, 2016 2 commits
  18. 11 Nov, 2016 1 commit
    • ahaas's avatar
      [wasm] Check data segments for zero-sized memory. · e3c7324a
      ahaas authored
      According to the spec data segments are allowed even if the memory size
      is zero. However, if one of the data segments has a length greater than
      0, then module instantiation should fail.
      
      I also changed the exception type in LoadDataSegments to TypeError,
      because that's the exception type for all exceptions which can happen
      during instantiation.
      
      R=titzer@chromium.org, rossberg@chromium.org
      TEST=cctest/test-run-wasm-module/EmptyMemoryEmptyDataSegment, cctest/test-run-wasm-module/EmptyMemoryNonEmptyDataSegment
      
      Review-Url: https://codereview.chromium.org/2483053005
      Cr-Commit-Position: refs/heads/master@{#40922}
      e3c7324a