1. 03 Apr, 2019 1 commit
    • Paolo Severini's avatar
      Reland "V8 x64 backend doesn't emit ABI compliant stack frames" · 969cb0c7
      Paolo Severini authored
      This is a reland of 3cda21de
      
      Original change's description:
      > V8 x64 backend doesn't emit ABI compliant stack frames
      > 
      > On 64 bit Windows, the OS stack walking does not work because the V8 x64
      > backend doesn't emit unwinding info and also because it doesn't emit ABI
      > compliant stack frames. See
      > https://docs.google.com/document/d/1-wf50jFlii0c_Pr52lm2ZU-49m220nhYMrHDi3vXnh0/edit
      > for more details.
      > 
      > This problem can be fixed by observing that V8 frames usually all have the same
      > prolog and epilog:
      > 
      > push rbp,
      > mov rbp, rsp
      > ...
      > pop rbp
      > ret N
      > 
      > and that it is possible to define XDATA (UNWIND_CODEs) that specify how Windows
      > should walk through V8 frames. Furthermore, since V8 Code objects are all
      > allocated in the same code-range for an Isolate, it is possible to register a
      > single PDATA/XDATA entry to cover stack walking for all the code generated
      > inside that code-range.
      > 
      > This PR contains changes required to enable stack walking on Win64:
      > 
      > EmbeddedFileWriter now adds assembler directives to the builtins
      > snapshot source file (embedded.cc) to emit additional entries in the .pdata and
      > in the .xdata section of the V8 executable. This takes care of stack walking
      > for embedded builtins. (The case of non-embedded builtins is not supported).
      > The x64 Assembler has been modified to collect the information required to emit
      > this unwind info for builtins.
      > 
      > Stack walking for jitted code is handled is Isolate.cpp, by registering
      > dynamically PDATA/XDATA for the whole code-range address space every time a new
      > Isolate is initialized, and by unregistering them when the Isolate is
      > destroyed.
      > 
      > Stack walking for WASM jitted code is handled is the same way in
      > wasm::NativeModule (wasm/wasm-code-manager.cpp).
      > 
      > It is important to note that Crashpad and Breakpad are already registering
      > PDATA/XDATA to manage and report unhandled exceptions (but not for embedded
      > builtins). Since it is not possible to register multiple PDATA entries for the
      > same address range, a new function is added to the V8 API:
      > SetUnhandledExceptionCallback() can be used by an embedder to register its own
      > unhandled exception handler for exceptions that arise in v8-generated code.
      > V8 embedders should be modified accordingly (code for this is in a separate PR
      > in the Chromium repository:
      > https://chromium-review.googlesource.com/c/chromium/src/+/1474703).
      > 
      > All these changes are experimental, behind:
      > 
      > the 'v8_win64_unwinding_info' build flag, and
      > the '--win64-unwinding-info' runtime flag.
      > 
      > Bug: v8:3598
      > Change-Id: Iea455ab6d0e2bf1c556aa1cf870841d44ab6e4b1
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1469329
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Paolo Severini <paolosev@microsoft.com>
      > Cr-Commit-Position: refs/heads/master@{#60330}
      
      Bug: v8:3598
      Change-Id: If988baf7d3e4af165b919d6e54c1ad985f8e25e3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1534618Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Paolo Severini <paolosev@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#60581}
      969cb0c7
  2. 01 Apr, 2019 1 commit
  3. 28 Mar, 2019 2 commits
    • Dan Elphick's avatar
      [compiler] Make source position collection lazier · 5376383c
      Dan Elphick authored
      Previously when lazy source positions were enabled, source positions
      were immediately collected whenever an exception was thrown for every
      frame in the stack trace.
      
      This change makes source position collection trigger only when the
      source positions of a stack frame are actually accessed with the
      exception of the top frame which is still eagerly collected for now.
      
      Additionally when stack overflows occur during source position
      collection, the bytecode is marked with exception in the
      source_position_table field so it can be distinguished from the case
      where source position collection has never been attempted (undefined)
      or is not desired because the bytecode is for natives
      (empty_byte_array).
      
      Bug: v8:8510
      Change-Id: If7ee68edbacc9e2adadf00fe5ec822a8dbe1c79a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1520721Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60504}
      5376383c
    • tzik's avatar
      Use non-primary promise handler as a source of fallback microtask context · 39bfa157
      tzik authored
      A microtask requires a non-detached Context to trigger, and the Context
      is usually pulled from the primary handler.
      On an example below, |on_rejected| is primary, as the attached promise
      is rejected and |on_rejected| will be called as the reaction.
      
        Promise.reject().then(on_fulfilled, on_rejected);
      
      If the primary handler is undefined or invalid, we used to use the
      promise's context as the fallback. E.g. the primary handler is undefined
      on the examlpe below, and the context of |promise| was used.
      
        let promise = Promise.reject();
        promise.then(on_fulfilled);
      
      However, that causes a non-intuitive behavior around a detached
      context:
      
        let DeadPromise = iframe.contentWindow.Promise;
        iframe.src = "http://example.com"; // navigate away.
        // DeadPromise's Context is detached state now.
      
        let p = DeadPromise.reject();
      
        // |on_rejected| is called, as the context is pulled from |on_rejected|.
        p.then(on_fulfilled, on_rejected);
      
        // |on_rejected| was NOT called, as a microtask to settle |q| does not
        // run due to the detached context.
        let q = p.then(on_fulfilled);
        q.catch(on_rejected);
      
      After this CL, we use non-primary handler as a source of fallback context.
      On the last example above, the Context is pulled from |on_fullfilled|,
      so that |q| is settled using that context.
      
      Bug: chromium:941271
      Change-Id: Iff71acf7c3617f3493d100abcd2c5c36bd1bbfd1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535916Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60499}
      39bfa157
  4. 27 Mar, 2019 2 commits
  5. 26 Mar, 2019 3 commits
  6. 25 Mar, 2019 4 commits
  7. 24 Mar, 2019 1 commit
  8. 22 Mar, 2019 2 commits
  9. 20 Mar, 2019 5 commits
    • Igor Sheludko's avatar
      [ptr-compr][arm64] Fix accesses to CodeDataContainer::kind_specific_flags · 6e7c7238
      Igor Sheludko authored
      This field's size is kIntSize but it was read as a 8-byte value in
      assembly code.
      
      Bug: v8:7703
      Change-Id: I16e8c845c27b224b368c8888073cff6d53f28a54
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532324
      Auto-Submit: Igor Sheludko <ishell@chromium.org>
      Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60377}
      6e7c7238
    • Leszek Swirski's avatar
      Revert "V8 x64 backend doesn't emit ABI compliant stack frames" · 9f6ddb48
      Leszek Swirski authored
      This reverts commit 3cda21de.
      
      Reason for revert: Breaks the roll on Windows (see https://cr-buildbucket.appspot.com/build/8918477701097622400)
      
      Original change's description:
      > V8 x64 backend doesn't emit ABI compliant stack frames
      > 
      > On 64 bit Windows, the OS stack walking does not work because the V8 x64
      > backend doesn't emit unwinding info and also because it doesn't emit ABI
      > compliant stack frames. See
      > https://docs.google.com/document/d/1-wf50jFlii0c_Pr52lm2ZU-49m220nhYMrHDi3vXnh0/edit
      > for more details.
      > 
      > This problem can be fixed by observing that V8 frames usually all have the same
      > prolog and epilog:
      > 
      > push rbp,
      > mov rbp, rsp
      > ...
      > pop rbp
      > ret N
      > 
      > and that it is possible to define XDATA (UNWIND_CODEs) that specify how Windows
      > should walk through V8 frames. Furthermore, since V8 Code objects are all
      > allocated in the same code-range for an Isolate, it is possible to register a
      > single PDATA/XDATA entry to cover stack walking for all the code generated
      > inside that code-range.
      > 
      > This PR contains changes required to enable stack walking on Win64:
      > 
      > EmbeddedFileWriter now adds assembler directives to the builtins
      > snapshot source file (embedded.cc) to emit additional entries in the .pdata and
      > in the .xdata section of the V8 executable. This takes care of stack walking
      > for embedded builtins. (The case of non-embedded builtins is not supported).
      > The x64 Assembler has been modified to collect the information required to emit
      > this unwind info for builtins.
      > 
      > Stack walking for jitted code is handled is Isolate.cpp, by registering
      > dynamically PDATA/XDATA for the whole code-range address space every time a new
      > Isolate is initialized, and by unregistering them when the Isolate is
      > destroyed.
      > 
      > Stack walking for WASM jitted code is handled is the same way in
      > wasm::NativeModule (wasm/wasm-code-manager.cpp).
      > 
      > It is important to note that Crashpad and Breakpad are already registering
      > PDATA/XDATA to manage and report unhandled exceptions (but not for embedded
      > builtins). Since it is not possible to register multiple PDATA entries for the
      > same address range, a new function is added to the V8 API:
      > SetUnhandledExceptionCallback() can be used by an embedder to register its own
      > unhandled exception handler for exceptions that arise in v8-generated code.
      > V8 embedders should be modified accordingly (code for this is in a separate PR
      > in the Chromium repository:
      > https://chromium-review.googlesource.com/c/chromium/src/+/1474703).
      > 
      > All these changes are experimental, behind:
      > 
      > the 'v8_win64_unwinding_info' build flag, and
      > the '--win64-unwinding-info' runtime flag.
      > 
      > Bug: v8:3598
      > Change-Id: Iea455ab6d0e2bf1c556aa1cf870841d44ab6e4b1
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1469329
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Paolo Severini <paolosev@microsoft.com>
      > Cr-Commit-Position: refs/heads/master@{#60330}
      
      TBR=bbudge@chromium.org,ulan@chromium.org,mvstanton@chromium.org,mstarzinger@chromium.org,gdeepti@chromium.org,jgruber@chromium.org,paolosev@microsoft.com
      
      Change-Id: If8470da94c58df8c800cbe8887f9f86236e43353
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:3598
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532321Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60372}
      9f6ddb48
    • Michael Starzinger's avatar
      [wasm] Turn {WasmCompileLazy} stub into a runtime stub. · 0feff465
      Michael Starzinger authored
      This removes the special casing for the lazy compilation stub which used
      to have its own code kind, just so that the stack walker would properly
      recognize its frame.
      
      Also, by re-using the existing machinery for runtime stubs we no longer
      need to copy this stub into the native module and get all the niceties
      that come with embedded builtins for free.
      
      Thirdly this will make it easier to start lazy compilation from the
      background or to do it on a per-function basis without requiring yet
      more special machinery, since {NativeModule::SetLazyBuiltin} no longer
      requires access to the Isolate.
      
      Kudos for the inspiration for this cleanup go to Frederik, I merely did
      some of the legwork.
      
      R=clemensh@chromium.org
      BUG=v8:8834
      
      Change-Id: Iac2b51a2e33fb0e88d25d3632fa18998123ee6c3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532064Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60365}
      0feff465
    • Sven Sauleau's avatar
      [wasm] rename BigIntToWasmI64 · f30f503e
      Sven Sauleau authored
      Previously, the builtin BigIntToWasmI64 and its calling descriptor had
      an inconsistent name, not reflecting the signature which is i64 to BigInt.
      
      This CL removes BigIntToWasmI64 in favor of I64ToBigInt. Also for
      consistency the Wasm tranpoline has been renamed from BigIntToWasmI64
      to WasmI64ToBigInt.
      
      Change-Id: I4125ee99a7358797181770f413db70affa657d5c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532065
      Auto-Submit: Sven Sauleau <ssauleau@igalia.com>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60361}
      f30f503e
    • Suraj Sharma's avatar
      [torque] convert GeneratorObjects to torque · 416046ed
      Suraj Sharma authored
      Converted JSGeneratorObject, JSAsyncFunctionObject , JSAsyncGenerator to torque.
      
      Change-Id: I6eb2463d66c118c60fee472776a471120641344c
      
      Bug: v8:8952
      Change-Id: I6eb2463d66c118c60fee472776a471120641344c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1512472
      Commit-Queue: Georg Neis <neis@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60347}
      416046ed
  10. 19 Mar, 2019 1 commit
    • Paolo Severini's avatar
      V8 x64 backend doesn't emit ABI compliant stack frames · 3cda21de
      Paolo Severini authored
      On 64 bit Windows, the OS stack walking does not work because the V8 x64
      backend doesn't emit unwinding info and also because it doesn't emit ABI
      compliant stack frames. See
      https://docs.google.com/document/d/1-wf50jFlii0c_Pr52lm2ZU-49m220nhYMrHDi3vXnh0/edit
      for more details.
      
      This problem can be fixed by observing that V8 frames usually all have the same
      prolog and epilog:
      
      push rbp,
      mov rbp, rsp
      ...
      pop rbp
      ret N
      
      and that it is possible to define XDATA (UNWIND_CODEs) that specify how Windows
      should walk through V8 frames. Furthermore, since V8 Code objects are all
      allocated in the same code-range for an Isolate, it is possible to register a
      single PDATA/XDATA entry to cover stack walking for all the code generated
      inside that code-range.
      
      This PR contains changes required to enable stack walking on Win64:
      
      EmbeddedFileWriter now adds assembler directives to the builtins
      snapshot source file (embedded.cc) to emit additional entries in the .pdata and
      in the .xdata section of the V8 executable. This takes care of stack walking
      for embedded builtins. (The case of non-embedded builtins is not supported).
      The x64 Assembler has been modified to collect the information required to emit
      this unwind info for builtins.
      
      Stack walking for jitted code is handled is Isolate.cpp, by registering
      dynamically PDATA/XDATA for the whole code-range address space every time a new
      Isolate is initialized, and by unregistering them when the Isolate is
      destroyed.
      
      Stack walking for WASM jitted code is handled is the same way in
      wasm::NativeModule (wasm/wasm-code-manager.cpp).
      
      It is important to note that Crashpad and Breakpad are already registering
      PDATA/XDATA to manage and report unhandled exceptions (but not for embedded
      builtins). Since it is not possible to register multiple PDATA entries for the
      same address range, a new function is added to the V8 API:
      SetUnhandledExceptionCallback() can be used by an embedder to register its own
      unhandled exception handler for exceptions that arise in v8-generated code.
      V8 embedders should be modified accordingly (code for this is in a separate PR
      in the Chromium repository:
      https://chromium-review.googlesource.com/c/chromium/src/+/1474703).
      
      All these changes are experimental, behind:
      
      the 'v8_win64_unwinding_info' build flag, and
      the '--win64-unwinding-info' runtime flag.
      
      Bug: v8:3598
      Change-Id: Iea455ab6d0e2bf1c556aa1cf870841d44ab6e4b1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1469329Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Paolo Severini <paolosev@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#60330}
      3cda21de
  11. 18 Mar, 2019 5 commits
  12. 14 Mar, 2019 2 commits
  13. 13 Mar, 2019 2 commits
  14. 12 Mar, 2019 4 commits
  15. 11 Mar, 2019 3 commits
  16. 09 Mar, 2019 1 commit
  17. 08 Mar, 2019 1 commit