1. 21 May, 2019 2 commits
  2. 20 May, 2019 3 commits
  3. 17 May, 2019 2 commits
  4. 16 May, 2019 1 commit
  5. 15 May, 2019 3 commits
    • Toon Verwaest's avatar
      [json] Preallocate mutable heap numbers so object verification doesn't fail · a7985022
      Toon Verwaest authored
      Additionally pass WriteBarrierMode while building the object
      
      Change-Id: Ibc8ad592f822ee3b046406013cc36ae64f6b099b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613251Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Toon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61547}
      a7985022
    • Toon Verwaest's avatar
      [json] Make json parsing iterative · 4b60b40a
      Toon Verwaest authored
      This avoids the need to throw range errors when we run out of stack, limiting
      us only by available memory.
      
      The main parser loop is implemented by two subloops.
      
      The first subloop finishes whenever it generates primitive values, empty
      arrays, or empty objects. If a non-empty object or array is started, the loop
      continues to parse its first member.
      
      The second subloop consumes produced values and either adds them to the parent
      array or object, or returns it. The second loop finishes whenever a next value
      needs to be produced. When the loop itself produces a finished array or object,
      the loop continues.
      
      Exceptions are handled by moving the cursor to end-of-input. Upon end-of-input,
      the first loop sets the continuation to "kFail". That causes the second loop to
      tear down continuation stack and related handle scopes, resulting in an empty
      handle.
      
      The CL additionally buffers all named properties and elements so we can
      immediately allocate a correctly shaped object. For object elements we'll take
      flat array or dictionary encoding depending on what is more efficient.
      
      This means that element handles are now allocated in their parent HandleScope,
      rather than having local handlescopes per-property (of big objects); which is
      why I've adjusted the handle-count test to not allocate as many properties. In
      the future it would be nice to not have to allocate (as many) handles since
      almost everything in the JSON graph will survive JSON parsing...
      
      Bug: chromium:710383
      Change-Id: Ia3a7fd0ac260fb1c0e5f929276792b2f8e5fc0ca
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609802Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Toon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61533}
      4b60b40a
    • Mythri A's avatar
      [future] Enable lazy feedback allocation in 'future' configuration · d9cff61e
      Mythri A authored
      Bug: v8:8394
      Change-Id: I5b4c02f5f36710b3fa15037e1fa1520b759447c4
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611798Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Commit-Queue: Mythri Alle <mythria@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61501}
      d9cff61e
  6. 14 May, 2019 3 commits
    • Benedikt Meurer's avatar
      [map] Properly share the map for builtin iterator result objects. · d2ea316f
      Benedikt Meurer authored
      Previously we had a special, unshared map on the native context that was
      used for results of builtin iterators, which was different from the map
      that is created from an object literal like `{value, done}`. This not
      only leads to unnecessary polymorphism, but also makes it impossible
      for user defined iterators to take the fast-paths that we have in
      various places (i.e. in collections or promises).
      
      With this change we now properly share the map for `{value, done}` and
      use that for the builtin iterator result objects, as well as the
      fast-paths.
      
      Drive-by-fix: Remove the restrictions on map caching and transition
      caching during bootstrapping. This no longer makes sense.
      
      Bug: v8:9114, v8:9243
      Change-Id: I19eb9071f7ec0ed58f8a6f87eed781bc790174b7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609794
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61488}
      d2ea316f
    • Benedikt Meurer's avatar
      [constant-tracking] Disable `delete` optimization for constant fields. · f0e054c2
      Benedikt Meurer authored
      When using the fast-properties optimization for `delete` with constant
      fields we don't properly invalidate the constness on the original map
      and might thereby just follow the same transition again later with the
      same object, effectively violating the constness of that field. This
      disables the fast-properties optimization for `delete` in case of a
      field marked as "const" as a quick-fix. We might still want to change
      the logic to properly invalidate the "const" bit later.
      
      Bug: chromium:962588, v8:9233
      Change-Id: I1d0a8649d117731a0cd5ebdb4b6d0b22a900f33d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609796Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61484}
      f0e054c2
    • Benedikt Meurer's avatar
      [ic] Disallow growing stores with TypedArrays in the prototype chain. · bd17f12a
      Benedikt Meurer authored
      For keyed stores to JSArrays we can generally allow the receiver to grow
      to the necessary size by bumping the magical length property. This works
      for regular Arrays, but not in the case the prototype chain contains a
      TypedArray, as that is going to swallow all stores that are considered
      out-of-bounds for it.
      
      We don't wanna deal with that kind of complexity in the IC handlers, so
      we just refuse to handle that case (also giving TurboFan the signal that
      it shouldn't attempt to handle growing stores in that case).
      
      Bug: chromium:960134, chromium:961709
      Change-Id: Ia886de590c32ae51ed4ebe38fc237ed975a635aa
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609790Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61465}
      bd17f12a
  7. 13 May, 2019 3 commits
  8. 10 May, 2019 2 commits
    • Clemens Hammacher's avatar
      [wasm][gc] Fix NativeModule::GetCode for nonexisting code · 0975c554
      Clemens Hammacher authored
      {NativeModule::GetCode} can actually return {nullptr} if no code was
      compiled yet for a function, e.g. in asm.js where we use lazy
      compilation. In that case, we must not try to increment the ref count
      on the nonexisting code object.
      
      We had a few errors recently that were hard to reproduce because we do
      not have a flag to enable code logging. Clusterfuzz managed to
      accomplish this by passing --trace-ic.
      In order to test bugs in code logging properly, this CL introduces a
      new runtime function called "EnableCodeLoggingForTesting". It registers
      a noop {CodeEventListener} and enables code logging in the wasm engine.
      We should whitelist this flag in ClusterFuzz to potentially flush out
      more bugs.
      
      R=mstarzinger@chromium.org
      CC=frgossen@chromium.org
      
      Bug: v8:8217, chromium:961129, chromium:961245, chromium:961128
      Change-Id: I2f97c109db70b41531d58580b71f6781beeb8dcb
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1602700
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61404}
      0975c554
    • Maya Lekova's avatar
      [turbofan] Fix wrong assumption in inlining · 9df690f3
      Maya Lekova authored
      JSInliner class wrongly assumed that all functions passing through
      JSInliningHeuristic have feedback vectors, but that's not the case
      when the inlining candidate hasn't been called yet.
      
      Bug: chromium:961522
      Change-Id: I89c0f2098add19d9b59394f1e7230cbec426119d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605720Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61400}
      9df690f3
  9. 09 May, 2019 1 commit
  10. 08 May, 2019 3 commits
  11. 07 May, 2019 3 commits
    • Benedikt Meurer's avatar
      [map] Make field representation updates work with elements kind transitions. · 6564c6df
      Benedikt Meurer authored
      Generalize the existing work-around in the method
      `Map::GeneralizeIfCanHaveTransitionableFastElementsKind()` to also go to
      the most general field representation (in addition to going to the most
      field type) for objects with transitionable fast elements kinds. That
      means that we essentially disable field representation tracking for
      arrays, arguments objects and value wrappers (for which the field type
      tracking is already disabled).
      
      Drive-by-fix: Remove the `constness` parameter to the above mentioned
      helper method. And fix the printing of the descriptor expectations to
      properly print the field type.
      
      Change-Id: I1bba9415f4bdd2c916f9d105d9120c7071d2c498
      Cq-Include-Trybots: luci.chromium.try:linux-rel,win7-rel
      Doc: http://bit.ly/v8-in-place-field-representation-changes
      Bug: v8:8749, v8:8865, v8:9114, chromium:959645, chromium:952682
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1598756
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61284}
      6564c6df
    • Peter Marshall's avatar
      Reland "[typedarray] Make JSTypedArray::length authoritative." · 330e5ba2
      Peter Marshall authored
      This is a reland of ad44c258
      
      Patchset 2 is the original CL
      Patchset 3 fixes some misuses of FixedArrayBase::length() and adds some
      DCHECKS to flush out any more misuses.
      Patchset 4 adds the PPC/S390 port by miladfar@ca.ibm.com.
      
      Original change's description:
      > [typedarray] Make JSTypedArray::length authoritative.
      >
      > This is the first step towards full huge typed array support in V8.
      > Before this change, the JSTypedArray::length and the elements backing
      > store length (FixedTypedArrayBase::length) were used more or less
      > interchangeably to determine the number of elements in a JSTypedArray.
      >
      > With this change we disentangle these two lengths, and instead make
      > JSTypedArray::length authoritative. For on-heap typed arrays, the
      > FixedTypedArrayBase::length will remain the number of elements in the
      > backing store, but for the off-heap typed arrays, this length will be
      > set to 0 (matching the fact that the FixedTypedArrayBase instance does
      > not contain any elements itself).
      >
      > This also unifies the JSTypedArray::set_/length() and length_value()
      > methods to only have JSTypedArray::set_/length() which returns/takes
      > size_t values. Currently this still requires the values to be in Smi
      > range, but later we will extend this to allow arbitrary size_t values
      > (in the safe integer range).
      >
      > Bug: v8:4153, v8:7881
      > Change-Id: Iff9089130bb31fa9e08e0cf913e7ab52c3dbf107
      > Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
      > Doc: http://doc/1Z-wM2qwvAuxH46e9ivtkYvKzzwYZg8ymm0x0wJaomow
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1543729
      > Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
      > Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Reviewed-by: Hannes Payer <hpayer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#60648}
      
      Bug: v8:4153, v8:7881, v8:9105
      Change-Id: Ic38f833071a723642ebc6f82a4012dbc0878ef98
      Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1594435Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61275}
      330e5ba2
    • Mythri A's avatar
      Reland [ic] Remove the check for fast prototypes in LoadIC_Uninitialized · 9fe37d23
      Mythri A authored
      This is a reland of d14ed12e
      with fix for test failures in lite mode.
      
      When handling load named properties (without feedback vectors) we used
      to miss to runtimes if the prototypes aren't set. This was because we
      wanted to give the prototype a chance to become fast, since most prototypes
      start in slow mode but move to fast after the initial setup. Though this
      check is not really useful when we don't have feedback vectors, and once
      feedback vectors are allocated we will turn the prototypes fast anyway.
      
      Bug: v8:8394, v8:8860
      Change-Id: I5c7b5061e1d9068c72d6f0eea47517880940a054
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591772Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Mythri Alle <mythria@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61267}
      9fe37d23
  12. 04 May, 2019 1 commit
  13. 03 May, 2019 3 commits
  14. 02 May, 2019 1 commit
  15. 30 Apr, 2019 2 commits
  16. 26 Apr, 2019 1 commit
    • Andreas Haas's avatar
      [wasm] Disable asan for memory_copy_wrapper · eb131dcc
      Andreas Haas authored
      The function {memory_copy_wrapper} is called directly from WebAssembly.
      Before calling {memory_copy_wrapper} we do not reset the
      tread-in-wasm flag. On asan builds on Windows this causes the problem
      observed in the crash report.
      
      My theory is the following: asan on Windows uses exceptions to allocate
      shadow memory lazily. When {memory_copy_wrapper} accesses memory, asan
      causes an exception to allocate shadow memory. This exception is first
      caught by the WebAssembly trap handler, which resets the
      thread-in-wasm flag but then does not handle the exception because it
      cannot find a proper landing pad. Asan then handles the exception and
      continues execution. However. the thread-in-wasm flag is not set
      anymore. A later check of the thread-in-wasm flag then fails.
      
      This CL disables asan for {memory_copy_wrapper} and thereby fixes the
      problem. As indicated above, another solution would be to reset and set
      the thread-in-wasm flag before and after the call to the C function,
      respectively. However, we do not do that for other uses of direct calls
      to C.
      
      R=binji@chromium.org
      
      Bug: chromium:952342
      Change-Id: I2adb2eccf2ac25be58392d21f8f43a04414c7811
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584326Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61040}
      eb131dcc
  17. 25 Apr, 2019 4 commits
    • Simon Zünd's avatar
      Reland "[typedarray] Fix crash when sorting SharedArrayBuffers" · ff3a26af
      Simon Zünd authored
      This is a reland of 3d846115
      
      Reland changes mjsunit.status to skip the regression test on
      all bots except ASAN.
      
      Original change's description:
      > [typedarray] Fix crash when sorting SharedArrayBuffers
      >
      > TypedArray#sort has a fast-path when the user does not provide a
      > comparison function. This fast-path utilizes std::sort which operates
      > directly on the raw data. Per spec, std::sort requires the "less than"
      > operation to be anti-symmetric and transitive.
      >
      > When sorting SharedArrayBuffers (SAB) that are concurrently modified during
      > sorting, the "less than" operator stops being consistent as the
      > underlying data is constantly modified. This breaks some invariants
      > in std::sort resulting in infinite loops or straight out segfaults.
      >
      > This CL fixes this by copying the data before sorting SABs and
      > writing the sorted result back.
      >
      > Note: The added regression test is tailored for ASAN bots as a
      > normal build would need too many iterations to consistently crash.
      >
      > R=neis@chromium.org, petermarshall@chromium.org
      >
      > Bug: v8:9161
      > Change-Id: Ic089928652f75865bfdb11e7453806faa6ecb988
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581641
      > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Commit-Queue: Simon Zünd <szuend@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#61004}
      
      Bug: v8:9161
      Change-Id: Idffc3fbb5f28f4966c8f1ac6770d5b5d6003a7e7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1583726Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Commit-Queue: Simon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61011}
      ff3a26af
    • Michael Achenbach's avatar
      Revert "[typedarray] Fix crash when sorting SharedArrayBuffers" · a5941ac9
      Michael Achenbach authored
      This reverts commit 3d846115.
      
      Reason for revert: The test hangs flakily on windows:
      https://ci.chromium.org/p/v8/builders/ci/V8%20Win32/20612
      https://ci.chromium.org/p/v8/builders/ci/V8%20Win32%20-%20nosnap%20-%20shared/33147
      https://ci.chromium.org/p/v8/builders/ci/V8%20Win32%20-%20debug/19945
      
      Original change's description:
      > [typedarray] Fix crash when sorting SharedArrayBuffers
      > 
      > TypedArray#sort has a fast-path when the user does not provide a
      > comparison function. This fast-path utilizes std::sort which operates
      > directly on the raw data. Per spec, std::sort requires the "less than"
      > operation to be anti-symmetric and transitive.
      > 
      > When sorting SharedArrayBuffers (SAB) that are concurrently modified during
      > sorting, the "less than" operator stops being consistent as the
      > underlying data is constantly modified. This breaks some invariants
      > in std::sort resulting in infinite loops or straight out segfaults.
      > 
      > This CL fixes this by copying the data before sorting SABs and
      > writing the sorted result back.
      > 
      > Note: The added regression test is tailored for ASAN bots as a
      > normal build would need too many iterations to consistently crash.
      > 
      > R=​neis@chromium.org, petermarshall@chromium.org
      > 
      > Bug: v8:9161
      > Change-Id: Ic089928652f75865bfdb11e7453806faa6ecb988
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581641
      > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Commit-Queue: Simon Zünd <szuend@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#61004}
      
      TBR=neis@chromium.org,petermarshall@chromium.org,szuend@chromium.org
      
      Change-Id: I046da3e4228bb1a8a3aa89d9c9d8de11875a9273
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:9161
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1583725Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61007}
      a5941ac9
    • peterwmwong's avatar
      Remove always-true --harmony-string-matchall runtime flag · 3632d5ae
      peterwmwong authored
      It shipped in Chrome 73.
      
      Bug: v8:6890
      Change-Id: Idd8c98cf05a0d6e8fa58c5b0a34d079631f68b1b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1582879Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
      Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
      Cr-Commit-Position: refs/heads/master@{#61005}
      3632d5ae
    • Simon Zünd's avatar
      [typedarray] Fix crash when sorting SharedArrayBuffers · 3d846115
      Simon Zünd authored
      TypedArray#sort has a fast-path when the user does not provide a
      comparison function. This fast-path utilizes std::sort which operates
      directly on the raw data. Per spec, std::sort requires the "less than"
      operation to be anti-symmetric and transitive.
      
      When sorting SharedArrayBuffers (SAB) that are concurrently modified during
      sorting, the "less than" operator stops being consistent as the
      underlying data is constantly modified. This breaks some invariants
      in std::sort resulting in infinite loops or straight out segfaults.
      
      This CL fixes this by copying the data before sorting SABs and
      writing the sorted result back.
      
      Note: The added regression test is tailored for ASAN bots as a
      normal build would need too many iterations to consistently crash.
      
      R=neis@chromium.org, petermarshall@chromium.org
      
      Bug: v8:9161
      Change-Id: Ic089928652f75865bfdb11e7453806faa6ecb988
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581641Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Commit-Queue: Simon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61004}
      3d846115
  18. 24 Apr, 2019 1 commit
  19. 23 Apr, 2019 1 commit