1. 31 Aug, 2018 10 commits
    • Simon Zünd's avatar
      [array] Fix wrong receiver when copying from the prototype chain · e7ca2b7c
      Simon Zünd authored
      This CL fixes an issue where getters/setters would get called on a
      prototype with the wrong receiver. This happens in the pre-processing
      for Array.p.sort when values get copied down from the prototype chain.
      
      R=jgruber@chromium.org
      
      Bug: v8:7682
      Change-Id: I0d8ff1dc721c33bd721aaca54ffd357b3d2a2096
      Reviewed-on: https://chromium-review.googlesource.com/1198767Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Simon Zünd <szuend@google.com>
      Cr-Commit-Position: refs/heads/master@{#55546}
      e7ca2b7c
    • Camillo Bruni's avatar
      Use NumberToStringCache by default for Uint32ToString · 6ecca197
      Camillo Bruni authored
      Bug: v8:7717, chromium:879304
      Change-Id: I524a9cf45f6a69efe0445b4ffaddfffc85c5560d
      Reviewed-on: https://chromium-review.googlesource.com/1199282
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55545}
      6ecca197
    • Georg Neis's avatar
      Revert "[interpreter] Add bytecode for leading array spreads." · ef569028
      Georg Neis authored
      This reverts commit 1c48d52b.
      
      Reason for revert: Clusterfuzz found something.
      
      Original change's description:
      > [interpreter] Add bytecode for leading array spreads.
      > 
      > This CL improves the performance of creating [...a, b] or [...a].
      > If the array literal has a leading spread, this CL emits the bytecode
      > [CreateArrayFromIterable] to create the literal. CreateArrayFromIterable
      > is implemented by [IterableToListDefault] builtin to create the initial
      > array for the leading spread. IterableToListDefault has a fast path to
      > clone efficiently if the spread is an actual array.
      > 
      > The bytecode generated is now shorter. Bytecode generation is refactored
      > into to BuildCreateArrayLiteral, which allows VisitCallSuper to benefit
      > from this optimization also.
      > For now, turbofan also lowers the bytecode to the builtin.
      > 
      > The idiomatic use of [...a] to clone the array a now performs better
      > than a simple for-loop, but still does not match the performance of slice.
      > 
      > Bug: v8:7980
      > 
      > Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      > Change-Id: Ibde659c82d3c7aa1b1777a3d2f6426ac8cc15e35
      > Reviewed-on: https://chromium-review.googlesource.com/1181024
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Commit-Queue: Georg Neis <neis@chromium.org>
      > Commit-Queue: Hai Dang <dhai@google.com>
      > Cr-Commit-Position: refs/heads/master@{#55520}
      
      TBR=rmcilroy@chromium.org,neis@chromium.org,sigurds@chromium.org,gsathya@chromium.org,jgruber@chromium.org,dhai@google.com
      
      Change-Id: I1c86ddcc24274da9f5a8dd3d8bf8d869cbb55cb6
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7980
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/1199303Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Commit-Queue: Georg Neis <neis@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55544}
      ef569028
    • Mathias Bynens's avatar
      Ship globalThis 🎉 · 4dac9872
      Mathias Bynens authored
      Proposal repository:
      https://github.com/tc39/proposal-global
      
      Intent to ship:
      https://groups.google.com/d/msg/v8-users/Vkoh0wXRwaM/Yt7MpzhkAgAJ
      
      Bug: v8:5537
      Change-Id: I60a6c5375165d89548db12fef454a64137d04c27
      Reviewed-on: https://chromium-review.googlesource.com/1195494Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Commit-Queue: Mathias Bynens <mathias@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55543}
      4dac9872
    • Bret Sepulveda's avatar
      profview: View source code of functions with samples inline. · b9cb78a7
      Bret Sepulveda authored
      If profiling is done with --log-source-code profview will now display
      a "View source" link for each function in the tree view. Clicking this
      will show a new source viewer, with sampled lines highlighted. See the
      associated bug for screenshots.
      
      This patch also fixes a bug in the profiler where the source info of
      only the first code object for each function would be logged, and
      includes some refactoring.
      
      Bug: v8:6240
      Change-Id: Ib96a9cfc54543d0dc9bef4657cdeb96ce28b223c
      Reviewed-on: https://chromium-review.googlesource.com/1194231
      Commit-Queue: Bret Sepulveda <bsep@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55542}
      b9cb78a7
    • Benedikt Meurer's avatar
      [runtime] Remove unused %GetPrototype. · 33f2012e
      Benedikt Meurer authored
      The %GetPrototype runtime function is not used anymore. Also remove the
      cctests that were introduced to guard the Crankshaft optimizations for
      the %_GetPrototype intrinsic.
      
      Bug: v8:8015
      Change-Id: I4b848f2c8d67209dae002d260a26867299d6b4a5
      Reviewed-on: https://chromium-review.googlesource.com/1199106Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55541}
      33f2012e
    • Benedikt Meurer's avatar
      [ic] Teach KeyedLoadICGeneric about ToName. · 923127f8
      Benedikt Meurer authored
      In the KeyedLoadICGeneric case the engine previously immediately fell
      back to the %KeyedGetProperty runtime function if the key was not a
      Name or a valid array index. This turns out to be really slow if a
      program passes for example objects as keys. Since we already have all
      the logic in place to convert an arbitrary JavaScript value to a Name,
      we can just call into ToName first and then operate on the result of
      that, which is significantly faster since C++ usually doesn't need to
      call back into JavaScript then to convert a JSReceiver into a Name.
      
      This also changes the ToName builtin to use the existing builtin for
      NonPrimitiveToPrimitive, which stays in JavaScript land completely.
      Since there's not really a point in inlining ToName into the call
      sites, the other uses were also changed to call the builtin instead,
      which saves some space and might also help with instruction cache
      utilization (especially when the ToName logic is more involved now).
      
      This improves the performance on the microbenchmark
      
      ```js
      const n = 1e7;
      const obj = {};
      const key = [1,2];
      
      const start = Date.now();
      for (let i = 0; i < n; ++i) {
        if (obj[key] === undefined) obj[key] = key;
      }
      print(`time: ${Date.now() - start} ms.`);
      ```
      
      by up to 36%. On the ARES-6 ML benchmark the steady state improves by up
      to ~7% and the overall mean for ARES-6 ML improves by up to ~6%. Further
      improvements might be possible here if the GetProperty builtin could be
      made faster for common prototype lookups like Symbol.toPrimitive and the
      "valueOf" and "toString" functions.
      
      Bug: v8:6344, v8:6670
      Change-Id: Ic3ac2bc4d4277836ef03039de4eda5c5f66a85da
      Reviewed-on: https://chromium-review.googlesource.com/1199022
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55540}
      923127f8
    • Benedikt Meurer's avatar
      [es2015] Handle proxies in GetProperty builtin. · 87199f52
      Benedikt Meurer authored
      Teach the GetProperty builtin how to perform [[Get]] on JSProxy
      instances by calling into the dedicated ProxyGetProperty builtin
      that we already use for the LOAD_IC / KEYED_LOAD_IC. This is
      important when proxies are used in places were GetProperty builtin
      is used like for example as iterables in for..of loops or in spreads.
      
      On a simple micro-benchmark like the following
      
      ```js
      const proxy = new Proxy([1, 2, 3], {
        get(target, property) { return target[property]; }
      });
      const TESTS = [
          function testForOfProxy() { for (const x of proxy) {} },
          function testSpreadProxy() { return [...proxy]; }
      ];
      
      function test(fn) {
        var result;
        for (var i = 0; i < 1e6; ++i) result = fn();
        return result;
      }
      test(x => x);
      
      for (var j = 0; j < TESTS.length; ++j) test(TESTS[j]);
      for (var j = 0; j < TESTS.length; ++j) {
        var startTime = Date.now();
        test(TESTS[j]);
        print(TESTS[j].name + ':', (Date.now() - startTime), 'ms.');
      }
      ```
      
      improves from around
      
        testForOfProxy: 1672.6 ms.
        testSpreadProxy: 1956.6 ms.
      
      to
      
        testForOfProxy: 408.4 ms.
        testSpreadProxy: 530.8 ms.
      
      on average, which corresponds to a 4-5x performance improvement, even
      for small arrays. On the ARES-6 Air benchmark this completely eliminates
      all calls to the %GetProperty runtime function, and thereby improves the
      steady state mean by 2-3%.
      
      Bug: v8:6344, v8:6557, v8:6559
      Change-Id: Ifebdaff8f3ae5899a33ce408ecd54655247f3a02
      Reviewed-on: https://chromium-review.googlesource.com/1199023Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55539}
      87199f52
    • Jao-ke Chin-Lee's avatar
      [CQ] Remove deleted builder from experimental set. · 0b0f0623
      Jao-ke Chin-Lee authored
      chromeos_daisy_chromium_compile_only_ng has been
      deleted and was removed from Buildbucket in
      https://chromium-review.googlesource.com/c/chromium/src/+/1195731
      
      BUG=v8:8058
      
      Change-Id: I42adaca73f0b04cf553e16f215f92ed2f5a7a010
      Reviewed-on: https://chromium-review.googlesource.com/1198242Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55538}
      0b0f0623
    • Frank Tang's avatar
      Revert "Revert "Reland "[Intl] move Date.prototype.toLocale{,Date,Time}String to C++""" · 273c83db
      Frank Tang authored
      The expectation is changed in https://chromium-review.googlesource.com/c/chromium/src/+/1196032
      
      revert of https://chromium-review.googlesource.com/c/v8/v8/+/1188143
      to reland https://chromium-review.googlesource.com/c/v8/v8/+/1185763
      
      v8:7961
      
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng;luci.chromium.try:linux_chromium_rel_ng;luci.v8.try:v8_linux_blink_rel
      Change-Id: I461db83b377c31abda72f2ce9c4501fcdd3b2663
      Reviewed-on: https://chromium-review.googlesource.com/1195539Reviewed-by: 's avatarJungshik Shin <jshin@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Commit-Queue: Frank Tang <ftang@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55537}
      273c83db
  2. 30 Aug, 2018 27 commits
  3. 29 Aug, 2018 3 commits
    • Alexey Kozyatinskiy's avatar
      Reland "inspector: do not convert and store String16 for script source" · 3ca15cdd
      Alexey Kozyatinskiy authored
      This is a reland of e987606a
      
      Original change's description:
      > inspector: do not convert and store String16 for script source
      >
      > We need script source for:
      > - calculating hash to report as part of scriptParsed event,
      > - reporting it as response on getScriptSource request,
      > - searching inside as response on searchInContent request,
      > - breakpoints hints.
      >
      > In all cases there is no need to store source on inspector side.
      >
      > R=alph@chromium.org
      >
      > Bug: chromium:873865,v8:7731
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
      > Change-Id: Ice24ddc72cfff36fb9a2dff2d7c4543defe3f668
      > Reviewed-on: https://chromium-review.googlesource.com/1182603
      > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      > Reviewed-by: Alexei Filippov <alph@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#55286}
      
      TBR=alph@chromium.org
      
      Bug: chromium:873865, v8:7731
      Change-Id: I0a0e93cd9d7797e4b3c57b1ab4f1a20af27fea9c
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
      Reviewed-on: https://chromium-review.googlesource.com/1195907Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55509}
      3ca15cdd
    • Ujjwal Sharma's avatar
      [Intl] Add a CreateBoundFunction helper function · 3ed9f606
      Ujjwal Sharma authored
      Add a C++ helper function called "CreateBoundFunction" as a static
      function to the Intl class, and change all existing builtins involving
      the creation of a bound function to use it instead.
      
      Also remove the redundant ContextSlot enums on all Intl objects in favor
      of a single BoundFunctionContextSlot enum in the Intl class.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      Change-Id: Ibd541f5e79828cd1e2cd573a0e23fc93b348a8ad
      Reviewed-on: https://chromium-review.googlesource.com/1194817
      Commit-Queue: Ujjwal Sharma <usharma1998@gmail.com>
      Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55508}
      3ed9f606
    • Alexey Kozyatinskiy's avatar
      Reland "inspector: find magic comment using V8 scanner" · cd7f9c63
      Alexey Kozyatinskiy authored
      This is a reland of 1b3b808a
      
      Original change's description:
      > inspector: find magic comment using V8 scanner
      >
      > Inspector tries to provide sourceURL and sourceMappingURL for scripts
      > with parser errors. Without this CL we convert source of each script
      > to inspector string and search for magic comment there. Some web sites
      > use pattern when they get some data from network and constantly try to
      > parse this data as JSON, in this case we do a lot of useless work.
      >
      > So we can parse magic comments on V8 side only for compilation errors
      > (excluding parse JSON errors), to do it we can reuse scanner by running
      > it on each potential comment.
      >
      > R=alph@chromium.org,verwaest@chromium.org,yangguo@chromium.org
      >
      > Bug: chromium:873865,v8:7731
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
      > Change-Id: I77c270fd0e95cd7b2c9ee4b7f72ef344bc1fa104
      > Reviewed-on: https://chromium-review.googlesource.com/1182446
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Reviewed-by: Alexei Filippov <alph@chromium.org>
      > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#55280}
      
      TBR=alph@chromium.org,verwaest@chromium.org,yangguo@chromium.org
      
      Bug: chromium:873865, v8:7731
      Change-Id: I097678fda0ebdcbd35a85be0bb6cf0fcb052bcbd
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
      Reviewed-on: https://chromium-review.googlesource.com/1195533
      Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55507}
      cd7f9c63