1. 05 Aug, 2017 1 commit
  2. 03 Aug, 2017 2 commits
  3. 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
  4. 07 Jul, 2017 1 commit
    • titzer's avatar
      [wasm] Introduce instance types for WebAssembly.* objects. · 17001a05
      titzer authored
      This CL refactors the internal representation of JavaScript-exposed
      WebAssembly objects to be more like other such objects in V8. By introducing
      a new instance type for each of the JS-exposed types, we get more robust
      typechecking without using embedder fields (which were previously used
      when these objects where instance type JS_API_OBJECT).
      
      In addition to the new instance types, the subclasses X of JSObject
      (WasmInstanceObject, WasmMemoryObject, WasmModuleObject, WasmTableObject)
      now have appropriate Is##X() methods on Object and are now robust.
      
      BUG=v8:6547
      CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng
      
      Review-Url: https://codereview.chromium.org/2964943002
      Cr-Commit-Position: refs/heads/master@{#46475}
      17001a05
  5. 14 Apr, 2017 1 commit
  6. 03 Apr, 2017 1 commit
  7. 31 Mar, 2017 1 commit
  8. 27 Mar, 2017 1 commit
    • Eric Holk's avatar
      [wasm] clear and set thread-in-wasm flag on runtime calls · b7e94287
      Eric Holk authored
      This was causing GC stress failures. Garbage collections can happen during
      runtime calls, such was WasmStackGuard. If the collection cleans up Wasm
      objects, then they will have to modify the trap handler data structures, which
      requires taking a lock. This lock can only be taken if the thread-in-wasm flag
      is clear. We were getting crashes because this flag was not clear.
      
      This change fixes the issue by making sure any runtime calls from Wasm clear the
      thread-in-wasm flag and then restore it upon return. In addition, it cleans up
      the code by adding a helper function that generates the code to modify the flag.
      
      BUG= v8:6132
      
      Change-Id: I95d43388dff60ba792c57fe13448a40a02ed4802
      Reviewed-on: https://chromium-review.googlesource.com/458698
      Commit-Queue: Eric Holk <eholk@chromium.org>
      Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#44165}
      b7e94287
  9. 24 Mar, 2017 1 commit
  10. 23 Mar, 2017 1 commit
    • ahaas's avatar
      [wasm][arm] Add an additional stack check for functions with big frames. · 9f01d5c1
      ahaas authored
      Stack overflow checks are typically implemented as part of the TurboFan
      graph of a function. This means that the stack check code is executed
      after frame construction. When a frame is too big, though, there may not
      be enough space on the stack anymore to throw the stack overflow
      exception after frame construction. With this CL we do an additional
      stack check before frame construction for functions with big frames.
      
      As discussed offline with mstarzinger, I do this change currently only
      for WebAssembly.
      
      This CL contains only the changes for arm. I will do the other platforms
      in separate CLs.
      
      R=mstarzinger@chromium.org, v8-arm-ports@googlegroups.com
      
      Review-Url: https://codereview.chromium.org/2763593002
      Cr-Commit-Position: refs/heads/master@{#44065}
      9f01d5c1
  11. 21 Mar, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] [interpreter] Allow different activations · 3214ccf3
      Clemens Hammacher authored
      This CL makes the interpreter reentrant by allowing different
      activations to be live at the same time. The wasm interpreter keeps a
      list of activations and stores the stack height at the start of each
      activation. This information is used to unwind just one activation, or
      show the right portion of the interpreter stack for each interpreter
      entry frame.
      The WasmDebugInfo object stores a mapping from frame pointer (of the
      interpreter entry) to the activation id in order to identify the
      activation based on the physical interpreter entry frame.
      
      R=titzer@chromium.org, ahaas@chromium.org
      BUG=v8:5822
      
      Change-Id: Ibbf93f077f907213173a92e0a2f7f3556515e8eb
      Reviewed-on: https://chromium-review.googlesource.com/453958
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#43976}
      3214ccf3
  12. 20 Mar, 2017 1 commit
  13. 16 Mar, 2017 1 commit
  14. 14 Mar, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] Set and reset the ThreadInWasm flag in interpreter entry · 09369c5e
      Clemens Hammacher authored
      The wasm interpreter entry is only called from wasm code. Hence the
      flag is cleared unconditinally before executing in the interpreter.
      Note that the interpreter does not use trap handling. It can on the
      other hand call to JS functions, hence the flag should not be set while
      executing in the interpreter.
      The flag is reset when returning from the interpreter.
      
      This CL avoids test failures in follow-up CLs which emerged after
      rebasing on the trap handler CL of eholk.
      
      R=titzer@chromium.org, ahaas@chromium.org
      CC=eholk@chromium.org
      BUG=v8:5822, v8:5277
      
      Change-Id: I8106e3a92bd9fd6159c785a718bed2d23cb3d593
      Reviewed-on: https://chromium-review.googlesource.com/454676
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#43801}
      09369c5e
  15. 13 Mar, 2017 3 commits
    • eholk's avatar
      [wasm] Initial signal handler · 118c376f
      eholk authored
      This is basically the minimum viable signal handler for Wasm bounds checks.
      It includes the TLS check and the fine grained instructions checks. These
      two checks provide most of the safety for the signal handler. Future CLs will
      add code range and data range checks for more robustness.
      
      The trap handling code and data structures are all in src/trap-handler, with
      the code that actually runs in the signal handler confined to
      src/trap-handler/signal-handler.cc.
      
      This changes adds a new V8 API that the embedder should call from a signal
      handler that will give V8 the chance to handle the fault first. For hosts that
      do not want to implement their own signal handler, we include the option to
      install a simple one. This simple handler is also used for the tests.
      
      When a Wasm module is instantiated, information about each function is passed
      to the trap handler, which is used to classify faults. These are removed during
      the instance finalizer.
      
      Several future enhancements are planned before turning this on by default.
      Obviously, the additional checks will be added to MaybeHandleFault. We are
      also planning to add a two-level CodeObjectData table that is grouped by
      isolates to make cleanup easier and also reduce potential for contending on
      a single data structure.
      
      BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      
      Review-Url: https://codereview.chromium.org/2371833007
      Cr-Original-Original-Commit-Position: refs/heads/master@{#43523}
      Committed: https://chromium.googlesource.com/v8/v8/+/a5af7fe9ee388a636675f4a6872b1d34fa7d1a7a
      Review-Url: https://codereview.chromium.org/2371833007
      Cr-Original-Commit-Position: refs/heads/master@{#43755}
      Committed: https://chromium.googlesource.com/v8/v8/+/338622d7cae787a63cece1f2e79a8b030023940b
      Review-Url: https://codereview.chromium.org/2371833007
      Cr-Commit-Position: refs/heads/master@{#43759}
      118c376f
    • eholk's avatar
      Revert of [wasm] Initial signal handler (patchset #60 id:1170001 of... · aba151b9
      eholk authored
      Revert of [wasm] Initial signal handler (patchset #60 id:1170001 of https://codereview.chromium.org/2371833007/ )
      
      Reason for revert:
      ASAN breakage, such as https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20ASAN/builds/19111/steps/Check/logs/grow-memory
      
      Original issue's description:
      > [wasm] Initial signal handler
      >
      > This is basically the minimum viable signal handler for Wasm bounds checks.
      > It includes the TLS check and the fine grained instructions checks. These
      > two checks provide most of the safety for the signal handler. Future CLs will
      > add code range and data range checks for more robustness.
      >
      > The trap handling code and data structures are all in src/trap-handler, with
      > the code that actually runs in the signal handler confined to
      > src/trap-handler/signal-handler.cc.
      >
      > This changes adds a new V8 API that the embedder should call from a signal
      > handler that will give V8 the chance to handle the fault first. For hosts that
      > do not want to implement their own signal handler, we include the option to
      > install a simple one. This simple handler is also used for the tests.
      >
      > When a Wasm module is instantiated, information about each function is passed
      > to the trap handler, which is used to classify faults. These are removed during
      > the instance finalizer.
      >
      > Several future enhancements are planned before turning this on by default.
      > Obviously, the additional checks will be added to MaybeHandleFault. We are
      > also planning to add a two-level CodeObjectData table that is grouped by
      > isolates to make cleanup easier and also reduce potential for contending on
      > a single data structure.
      >
      > BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      >
      > Review-Url: https://codereview.chromium.org/2371833007
      > Cr-Original-Commit-Position: refs/heads/master@{#43523}
      > Committed: https://chromium.googlesource.com/v8/v8/+/a5af7fe9ee388a636675f4a6872b1d34fa7d1a7a
      > Review-Url: https://codereview.chromium.org/2371833007
      > Cr-Commit-Position: refs/heads/master@{#43755}
      > Committed: https://chromium.googlesource.com/v8/v8/+/338622d7cae787a63cece1f2e79a8b030023940b
      
      TBR=ahaas@chromium.org,bradnelson@google.com,hpayer@chromium.org,jochen@chromium.org,mark@chromium.org,mseaborn@chromium.org,titzer@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      
      Review-Url: https://codereview.chromium.org/2744383002
      Cr-Commit-Position: refs/heads/master@{#43757}
      aba151b9
    • eholk's avatar
      [wasm] Initial signal handler · 338622d7
      eholk authored
      This is basically the minimum viable signal handler for Wasm bounds checks.
      It includes the TLS check and the fine grained instructions checks. These
      two checks provide most of the safety for the signal handler. Future CLs will
      add code range and data range checks for more robustness.
      
      The trap handling code and data structures are all in src/trap-handler, with
      the code that actually runs in the signal handler confined to
      src/trap-handler/signal-handler.cc.
      
      This changes adds a new V8 API that the embedder should call from a signal
      handler that will give V8 the chance to handle the fault first. For hosts that
      do not want to implement their own signal handler, we include the option to
      install a simple one. This simple handler is also used for the tests.
      
      When a Wasm module is instantiated, information about each function is passed
      to the trap handler, which is used to classify faults. These are removed during
      the instance finalizer.
      
      Several future enhancements are planned before turning this on by default.
      Obviously, the additional checks will be added to MaybeHandleFault. We are
      also planning to add a two-level CodeObjectData table that is grouped by
      isolates to make cleanup easier and also reduce potential for contending on
      a single data structure.
      
      BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      
      Review-Url: https://codereview.chromium.org/2371833007
      Cr-Original-Commit-Position: refs/heads/master@{#43523}
      Committed: https://chromium.googlesource.com/v8/v8/+/a5af7fe9ee388a636675f4a6872b1d34fa7d1a7a
      Review-Url: https://codereview.chromium.org/2371833007
      Cr-Commit-Position: refs/heads/master@{#43755}
      338622d7
  16. 01 Mar, 2017 2 commits
    • bmeurer's avatar
      Revert of [wasm] Initial signal handler (patchset #56 id:1090001 of... · 0b3e554e
      bmeurer authored
      Revert of [wasm] Initial signal handler (patchset #56 id:1090001 of https://codereview.chromium.org/2371833007/ )
      
      Reason for revert:
      Breaks tree, i.e. https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20ASAN/builds/18928/steps/Check/logs/grow-memory
      
      Original issue's description:
      > [wasm] Initial signal handler
      >
      > This is basically the minimum viable signal handler for Wasm bounds checks.
      > It includes the TLS check and the fine grained instructions checks. These
      > two checks provide most of the safety for the signal handler. Future CLs will
      > add code range and data range checks for more robustness.
      >
      > The trap handling code and data structures are all in src/trap-handler, with
      > the code that actually runs in the signal handler confined to
      > src/trap-handler/signal-handler.cc.
      >
      > This changes adds a new V8 API that the embedder should call from a signal
      > handler that will give V8 the chance to handle the fault first. For hosts that
      > do not want to implement their own signal handler, we include the option to
      > install a simple one. This simple handler is also used for the tests.
      >
      > When a Wasm module is instantiated, information about each function is passed
      > to the trap handler, which is used to classify faults. These are removed during
      > the instance finalizer.
      >
      > Several future enhancements are planned before turning this on by default.
      > Obviously, the additional checks will be added to MaybeHandleFault. We are
      > also planning to add a two-level CodeObjectData table that is grouped by
      > isolates to make cleanup easier and also reduce potential for contending on
      > a single data structure.
      >
      > BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      >
      > Review-Url: https://codereview.chromium.org/2371833007
      > Cr-Commit-Position: refs/heads/master@{#43523}
      > Committed: https://chromium.googlesource.com/v8/v8/+/a5af7fe9ee388a636675f4a6872b1d34fa7d1a7a
      
      TBR=ahaas@chromium.org,bradnelson@google.com,hpayer@chromium.org,jochen@chromium.org,mark@chromium.org,mseaborn@chromium.org,titzer@chromium.org,eholk@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      
      Review-Url: https://codereview.chromium.org/2723133003
      Cr-Commit-Position: refs/heads/master@{#43525}
      0b3e554e
    • eholk's avatar
      [wasm] Initial signal handler · a5af7fe9
      eholk authored
      This is basically the minimum viable signal handler for Wasm bounds checks.
      It includes the TLS check and the fine grained instructions checks. These
      two checks provide most of the safety for the signal handler. Future CLs will
      add code range and data range checks for more robustness.
      
      The trap handling code and data structures are all in src/trap-handler, with
      the code that actually runs in the signal handler confined to
      src/trap-handler/signal-handler.cc.
      
      This changes adds a new V8 API that the embedder should call from a signal
      handler that will give V8 the chance to handle the fault first. For hosts that
      do not want to implement their own signal handler, we include the option to
      install a simple one. This simple handler is also used for the tests.
      
      When a Wasm module is instantiated, information about each function is passed
      to the trap handler, which is used to classify faults. These are removed during
      the instance finalizer.
      
      Several future enhancements are planned before turning this on by default.
      Obviously, the additional checks will be added to MaybeHandleFault. We are
      also planning to add a two-level CodeObjectData table that is grouped by
      isolates to make cleanup easier and also reduce potential for contending on
      a single data structure.
      
      BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277
      
      Review-Url: https://codereview.chromium.org/2371833007
      Cr-Commit-Position: refs/heads/master@{#43523}
      a5af7fe9
  17. 24 Feb, 2017 1 commit
    • clemensh's avatar
      [wasm] Remove remaining occurences of the context in wasm code · e0e8b2a2
      clemensh authored
      The only remaining allowed occurence of a context is in WASM_TO_JS
      code, which is regenerated for each instance.
      This CL removes all the rest, to avoid subtle bugs where we might
      forget to patch it. By renaming the BuildCallToRuntime method, we make
      sure that noone accidentially calls the version which embeds a context.
      For consistency, I even remove it from the WasmRunInterpreter stub,
      which is never reused for new instantiations.
      
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2708743003
      Cr-Commit-Position: refs/heads/master@{#43409}
      e0e8b2a2
  18. 22 Feb, 2017 1 commit
  19. 17 Feb, 2017 1 commit
    • clemensh's avatar
      [wasm] Introduce WasmStackGuard builtin · b6bfe7b9
      clemensh authored
      Instead of placing a runtime call to StackGuard in the compiled wasm
      code, we just call the builtin, which is cheaper. By passing Smi::kZero
      as context, we save even more code space and avoid embedding the
      context in the code.
      The WasmStackGuard builtin then calls the new WasmStackGuard runtime
      function, which gets the context from the instance attached to the
      calling wasm code, and then does the usual StackGuard logic.
      
      For the unity benchmark in asm-wasm mode, generated code size reduces
      from 63.0 to 61.6 MB (-2.1%).
      
      R=titzer@chromium.org, ahaas@chromium.org, mstarzinger@chromium.org
      
      Review-Url: https://codereview.chromium.org/2691993004
      Cr-Commit-Position: refs/heads/master@{#43277}
      b6bfe7b9
  20. 01 Feb, 2017 1 commit
    • ahaas's avatar
      [wasm] Acquire the context for TrapIf from a wasm frame · 87d309da
      ahaas authored
      This is the first step to reduce the size of the out-of-line code of
      TrapIf. Instead of passing the context to the runtime call as a
      parameter, we pass Smi::kZero to the runtime call and then get the
      actual context from the WasmFrame on the stack.
      
      BUG=v8:5908
      R=titzer@chromium.org, clemensh@chromium.org
      
      Review-Url: https://codereview.chromium.org/2664273002
      Cr-Commit-Position: refs/heads/master@{#42853}
      87d309da
  21. 27 Jan, 2017 1 commit
    • clemensh's avatar
      [inspector] Expose GetPossibleBreakpoints for wasm · c6663ef1
      clemensh authored
      and add an inspector test for it. Also test that a breakpoint can be
      set on each reported position, and that it is also hit during
      execution.
      This CL also fixes two little things which were uncovered by the new
      test.
      
      R=yangguo@chromium.org, titzer@chromium.org, kozyatinskiy@chromium.org
      BUG=v8:5822
      
      Review-Url: https://codereview.chromium.org/2655653003
      Cr-Commit-Position: refs/heads/master@{#42722}
      c6663ef1
  22. 20 Jan, 2017 1 commit
    • clemensh's avatar
      [wasm] Implement frame inspection for interpreted frames · 09525c8f
      clemensh authored
      Frame inspection is currently limited to locations of execution.
      Further details like local variables or stack content will follow later.
      
      The FrameInspector now stores a pointer to the interpreted wasm frame,
      and redirects certain requests there, just as for deoptimized frames.
      Hitting breakpoints is now also supported for wasm frames.
      
      R=yangguo@chromium.org, titzer@chromium.org
      BUG=v8:5822
      
      Review-Url: https://codereview.chromium.org/2629823003
      Cr-Commit-Position: refs/heads/master@{#42551}
      09525c8f
  23. 11 Jan, 2017 1 commit
    • clemensh's avatar
      [wasm] Add support for compiling WASM_INTERPRETER_ENTRY stubs · a2efde46
      clemensh authored
      Also, add a runtime function to call the interpreter, passing a
      stack-allocated buffer holding the arguments.
      The WASM_INTERPRETER_ENTRY stub allocates the stack slot for the
      arguments, fills it, and calls to the wasm interpreter.
      It's abi is compatible with WASM functions, such that we can just
      replace a call to a WASM_FUNCTION with a call to
      WASM_INTERPRETER_ENTRY.
      See tracking bug to get the overall picture.
      
      BUG=v8:5822
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2619803004
      Cr-Commit-Position: refs/heads/master@{#42242}
      a2efde46
  24. 20 Dec, 2016 1 commit
  25. 15 Dec, 2016 1 commit
    • ahaas's avatar
      [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. · 7bd61b60
      ahaas authored
      Some instructions in WebAssembly trap for some inputs, which means that the
      execution is terminated and (at least at the moment) a JavaScript exception is
      thrown. Examples for traps are out-of-bounds memory accesses, or integer
      divisions by zero.
      
      Without the TrapIf and TrapUnless operators trap check in WebAssembly introduces 5
      TurboFan nodes (branch, if_true, if_false, trap-reason constant, trap-position
      constant), in addition to the trap condition itself. Additionally, each
      WebAssembly function has four TurboFan nodes (merge, effect_phi, 2 phis) whose
      number of inputs is linear to the number of trap checks in the function.
      Especially for functions with high numbers of trap checks we observe a
      significant slowdown in compilation time, down to 0.22 MiB/s in the sqlite
      benchmark instead of the average of 3 MiB/s in other benchmarks. By introducing
      a TrapIf common operator only a single node is necessary per trap check, in
      addition to the trap condition. Also the nodes which are shared between trap
      checks (merge, effect_phi, 2 phis) would disappear. First measurements suggest a
      speedup of 30-50% on average.
      
      This CL only implements TrapIf and TrapUnless on x64. The implementation is also
      hidden behind the --wasm-trap-if flag.
      
      Please take a special look at how the source position is transfered from the
      instruction selector to the code generator, and at the context that is used for
      the runtime call.
      
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2562393002
      Cr-Commit-Position: refs/heads/master@{#41720}
      7bd61b60
  26. 30 Nov, 2016 1 commit
  27. 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
  28. 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
  29. 16 Nov, 2016 1 commit
  30. 05 Oct, 2016 2 commits