1. 16 Oct, 2017 1 commit
  2. 11 Oct, 2017 3 commits
  3. 05 Oct, 2017 1 commit
  4. 08 Sep, 2017 1 commit
  5. 31 Aug, 2017 1 commit
  6. 09 Aug, 2017 1 commit
  7. 02 Aug, 2017 3 commits
    • Karl Schimpf's avatar
      Reland "Start migration of try/throw/catch to match proposal." · ad49b7b4
      Karl Schimpf authored
      This is a reland of 470a1001
      Original change's description:
      > Start migration of try/throw/catch to match proposal.
      > 
      > This CL does the first baby steps on moving the current (experimental)
      > exception handling to match that of the WebAssembly proposal.
      > 
      > It does the following:
      > 
      > 1) Use exception tags instead of integers.
      > 
      > 2) Only handle empty exception signatures (i.e. no values associated
      >    with the exception tag.
      > 
      > 3) Only handle one catch clause.
      > 
      > 4) Be sure to rethrow the exception if the exception tag does not match.
      > 
      > Note: There are many things that need to be fixed, and are too
      > numerous to list here. However, the code should have TODO's on each
      > missing parts of the implementation.
      > 
      > Also note that the code currently doesn't handle nested catch blocks,
      > nor does it change the throw value being an integer. Rather, the
      > integer value is still being thrown, and currently is the exception
      > tag. Therefore, we don't build an exception object. This is the reason
      > why this CL doesn't handle exceptions that pass values.
      > 
      > Also, the current implementation still can't handle multiple modules
      > because tag resolution (between) modules has not be implemented yet.
      > 
      > Bug: v8:6577
      > Change-Id: Id6d08b641b3c42d1eec7d4db582f2dab35406114
      > Reviewed-on: https://chromium-review.googlesource.com/591910
      > Reviewed-by: Brad Nelson <bradnelson@chromium.org>
      > Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#47087}
      
      Bug: v8:6577
      Change-Id: I41c3309827c292cb787681a95aaef7cf9b931835
      Reviewed-on: https://chromium-review.googlesource.com/598968Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
      Commit-Queue: Brad Nelson <bradnelson@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47100}
      ad49b7b4
    • Ulan Degenbaev's avatar
      Revert "Start migration of try/throw/catch to match proposal." · 41daf8a5
      Ulan Degenbaev authored
      This reverts commit 470a1001.
      
      Reason for revert: GC stress bot failures.
      https://uberchromegw.corp.google.com/i/client.v8/builders/V8%20Mac%20GC%20Stress/builds/14522
      
      
      Original change's description:
      > Start migration of try/throw/catch to match proposal.
      > 
      > This CL does the first baby steps on moving the current (experimental)
      > exception handling to match that of the WebAssembly proposal.
      > 
      > It does the following:
      > 
      > 1) Use exception tags instead of integers.
      > 
      > 2) Only handle empty exception signatures (i.e. no values associated
      >    with the exception tag.
      > 
      > 3) Only handle one catch clause.
      > 
      > 4) Be sure to rethrow the exception if the exception tag does not match.
      > 
      > Note: There are many things that need to be fixed, and are too
      > numerous to list here. However, the code should have TODO's on each
      > missing parts of the implementation.
      > 
      > Also note that the code currently doesn't handle nested catch blocks,
      > nor does it change the throw value being an integer. Rather, the
      > integer value is still being thrown, and currently is the exception
      > tag. Therefore, we don't build an exception object. This is the reason
      > why this CL doesn't handle exceptions that pass values.
      > 
      > Also, the current implementation still can't handle multiple modules
      > because tag resolution (between) modules has not be implemented yet.
      > 
      > Bug: v8:6577
      > Change-Id: Id6d08b641b3c42d1eec7d4db582f2dab35406114
      > Reviewed-on: https://chromium-review.googlesource.com/591910
      > Reviewed-by: Brad Nelson <bradnelson@chromium.org>
      > Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#47087}
      
      TBR=bradnelson@chromium.org,eholk@chromium.org,kschimpf@chromium.org
      
      Change-Id: I01dc8c40cc1057333a988c1d275ce5f457b0cb64
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:6577
      Reviewed-on: https://chromium-review.googlesource.com/598847Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47090}
      41daf8a5
    • Karl Schimpf's avatar
      Start migration of try/throw/catch to match proposal. · 470a1001
      Karl Schimpf authored
      This CL does the first baby steps on moving the current (experimental)
      exception handling to match that of the WebAssembly proposal.
      
      It does the following:
      
      1) Use exception tags instead of integers.
      
      2) Only handle empty exception signatures (i.e. no values associated
         with the exception tag.
      
      3) Only handle one catch clause.
      
      4) Be sure to rethrow the exception if the exception tag does not match.
      
      Note: There are many things that need to be fixed, and are too
      numerous to list here. However, the code should have TODO's on each
      missing parts of the implementation.
      
      Also note that the code currently doesn't handle nested catch blocks,
      nor does it change the throw value being an integer. Rather, the
      integer value is still being thrown, and currently is the exception
      tag. Therefore, we don't build an exception object. This is the reason
      why this CL doesn't handle exceptions that pass values.
      
      Also, the current implementation still can't handle multiple modules
      because tag resolution (between) modules has not be implemented yet.
      
      Bug: v8:6577
      Change-Id: Id6d08b641b3c42d1eec7d4db582f2dab35406114
      Reviewed-on: https://chromium-review.googlesource.com/591910Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
      Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47087}
      470a1001
  8. 19 Jun, 2017 1 commit
  9. 04 May, 2017 1 commit
  10. 05 Apr, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] [decoder] Templatize decode function for unchecked decoding · eeaceccb
      Clemens Hammacher authored
      In the C++ wasm interpreter, we decode LEB encoded immediates each time
      we execute the respective instruction. The whole instruction sequence
      was validated before, thus we know that all integers are valid.
      This CL refactors several Decoder methods to allow for either checked
      or unchecked decoding. In the checked case, an error is set if a check
      fails, in the unchecked case, a DCHECK will fail.
      
      This improves performance of the interpreter by 20.5%.
      
      R=ahaas@chromium.org
      BUG=v8:5822
      
      Change-Id: If69efd4f6fbe19d84bfc2f4aa000f429a8e22bf5
      Reviewed-on: https://chromium-review.googlesource.com/468786
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#44406}
      eeaceccb
  11. 16 Mar, 2017 1 commit
  12. 13 Feb, 2017 1 commit
  13. 10 Feb, 2017 1 commit
  14. 24 Jan, 2017 1 commit
  15. 23 Jan, 2017 1 commit
    • clemensh's avatar
      Enable emplace_back for zone containers · 14f470ca
      clemensh authored
      As required by C++11, this CL changes the zone allocator to be able to
      construct and destroy arbitrary types, and accept arbitrary arguments
      for construct, passing them via perfect forwarding.
      I also change some push_back to emplace_back. Some of those did not
      compile before.
      
      R=ishell@chromium.org, titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2646873004
      Cr-Commit-Position: refs/heads/master@{#42597}
      14f470ca
  16. 20 Jan, 2017 1 commit
  17. 15 Jan, 2017 1 commit
  18. 13 Jan, 2017 2 commits
  19. 12 Jan, 2017 4 commits
  20. 09 Jan, 2017 1 commit
  21. 06 Jan, 2017 1 commit
    • mtrofin's avatar
      [wasm] factor lower level utilties out of WasmFullDecoder · ccfb815c
      mtrofin authored
      Separated:
      - decoding of locals
      - loop assignment analysis
      - determination of opcode length
      
      as statics that work on a Decoder. Neither need the context of a
      Module, and were used in scenarios where one wasn't available either.
      
      Changed BodyLocalDecls to match the usecases for the type. In all but
      one (a printer), we want the list (in order of declaration, with
      repetitions) of types of locals.
      
      Removed a now-unnecessary constructor for the WasmFullDecoder.
      
      BUG=
      
      Review-Url: https://codereview.chromium.org/2610813009
      Cr-Commit-Position: refs/heads/master@{#42115}
      ccfb815c
  22. 21 Dec, 2016 1 commit
  23. 05 Dec, 2016 2 commits
    • clemensh's avatar
      [inspector] Split off interface-types.h · f5fb2da6
      clemensh authored
      This CL adds a new header src/debug/interface-types.h, moves the
      definition of Location from the debug-interface.h to this new header,
      and adds a new definition for the WasmDisassembly types.
      This allows to use the types in other implementation files or headers
      without having to include the entire debug-interface.h, reducing build
      dependencies and compile time (especially for incremental builds).
      
      The WasmDisassembly type replaces the old
      std::pair<std::string, std::vector<std::tuple<...>>>, which was a bit
      hard to unravel.
      
      R=yangguo@chromium.org, kozyatinskiy@chromium.org, titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2529383002
      Cr-Commit-Position: refs/heads/master@{#41488}
      f5fb2da6
    • clemensh's avatar
      [wasm] Add disassembly for select instruction · 8f9bb9b8
      clemensh authored
      This was somehow missing so far. With this CL, we can disassembly all
      functions on AngryBots.
      
      R=titzer@chromium.org, rossberg@chromium.org
      BUG=chromium:659715
      
      Review-Url: https://codereview.chromium.org/2552643002
      Cr-Commit-Position: refs/heads/master@{#41476}
      8f9bb9b8
  24. 01 Dec, 2016 1 commit
    • 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
  25. 30 Nov, 2016 1 commit
    • clemensh's avatar
      [wasm] Remove raw byte pointers from WasmModule · 6572b562
      clemensh authored
      These byte pointers (module_start and module_end) were only valid
      during decoding. During instantiation or execution, they can get
      invalidated by garbage collection.
      This CL removes them from the WasmModule struct, and introduces a new
      ModuleStorage struct as interface to the wasm wire bytes.
      Since the storage is often needed together with the ModuleEnv, a new
      ModuleStorageEnv struct holds both a ModuleEnv and a ModuleStorage.
      The pointers in the ModuleStorage should never escape the live range of
      this struct, as they might point into a SeqOneByteString or ArrayBuffer.
      Therefore, the WasmInterpreter needs to create its own copy of the
      whole module.
      Runtime functions that previously used the raw pointers in WasmModule
      (leading to memory errors) now have to use the SeqOneByteString in the
      WasmCompiledModule.
      
      R=titzer@chromium.org
      BUG=chromium:669518
      
      Review-Url: https://codereview.chromium.org/2540133002
      Cr-Commit-Position: refs/heads/master@{#41388}
      6572b562
  26. 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
  27. 22 Nov, 2016 1 commit
    • 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