1. 08 Sep, 2017 1 commit
  2. 07 Sep, 2017 1 commit
  3. 05 Sep, 2017 2 commits
  4. 01 Sep, 2017 3 commits
    • Benedikt Meurer's avatar
      [turbofan] Utilize UNINITIALIZED state of CompareIC and BinaryOpIC. · d6d72082
      Benedikt Meurer authored
      In the BytecodeGraphBuilder we insert a SOFT deopt whenever we see an
      IC whose state is UNINITIALIZED, i.e. a LOAD_IC or a STORE_IC. This
      greatly reduces the size of the generated graphs (and also helps to
      improve generated code quality). However for COMPARE_IC and BINARY_OP_IC
      we used to stick in the generic JavaScript node instead, which does
      generate code and might block optimizations because its sitting in
      the effect chain. This is changed now to always SOFT deopt for
      UNINITIALIZED instead, consistently with the other ICs.
      
      Bug: v8:6760
      Change-Id: I2ac7469fa86512a2fd909fdde2c6425977694811
      Reviewed-on: https://chromium-review.googlesource.com/645858
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47771}
      d6d72082
    • Benedikt Meurer's avatar
      [turbofan] Optimize fast enum cache driven for..in. · f1ec44e2
      Benedikt Meurer authored
      This CL adds support to optimize for..in in fast enum-cache mode to the
      same degree that it was optimized in Crankshaft, without adding the same
      deoptimization loop that Crankshaft had with missing enum cache indices.
      That means code like
      
        for (var k in o) {
          var v = o[k];
          // ...
        }
      
      and code like
      
        for (var k in o) {
          if (Object.prototype.hasOwnProperty.call(o, k)) {
            var v = o[k];
            // ...
          }
        }
      
      which follows the https://eslint.org/docs/rules/guard-for-in linter
      rule, can now utilize the enum cache indices if o has only fast
      properties on the receiver, which speeds up the access o[k]
      significantly and reduces the pollution of the global megamorphic
      stub cache.
      
      For example the micro-benchmark in the tracking bug v8:6702 now runs
      faster than ever before:
      
       forIn: 1516 ms.
       forInHasOwnProperty: 1674 ms.
       forInHasOwnPropertySafe: 1595 ms.
       forInSum: 2051 ms.
       forInSumSafe: 2215 ms.
      
      Compared to numbers from V8 5.8 which is the last version running with
      Crankshaft
      
       forIn: 1641 ms.
       forInHasOwnProperty: 1719 ms.
       forInHasOwnPropertySafe: 1802 ms.
       forInSum: 2226 ms.
       forInSumSafe: 2409 ms.
      
      and V8 6.0 which is the current stable version with TurboFan:
      
       forIn: 1713 ms.
       forInHasOwnProperty: 5417 ms.
       forInHasOwnPropertySafe: 5324 ms.
       forInSum: 7556 ms.
       forInSumSafe: 11067 ms.
      
      It also improves the throughput on the string-fasta benchmark by
      around 7-10%, and there seems to be a ~5% improvement on the
      Speedometer/React benchmark locally.
      
      For this to work, the ForInPrepare bytecode was split into
      ForInEnumerate and ForInPrepare, which is very similar to how it was
      handled in Fullcodegen initially. In TurboFan we introduce a new
      operator LoadFieldByIndex that does the dynamic property load.
      
      This also removes the CheckMapValue operator again in favor of
      just using LoadField, ReferenceEqual and CheckIf, which work
      automatically with the EscapeAnalysis and the
      BranchConditionElimination.
      
      Bug: v8:6702
      Change-Id: I91235413eea478ba77ace7bd14bb2f62e155dd9a
      Reviewed-on: https://chromium-review.googlesource.com/645949
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47768}
      f1ec44e2
    • Jaroslav Sevcik's avatar
      [turbofan] Introduce LoweringResult in type hint lowering. · d667bf4a
      Jaroslav Sevcik authored
      Bug: v8:5267
      Change-Id: Iea44ba7ee6ba09580176936e6157d63c53d06446
      Reviewed-on: https://chromium-review.googlesource.com/646021
      Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47762}
      d667bf4a
  5. 28 Aug, 2017 3 commits
  6. 24 Aug, 2017 1 commit
  7. 21 Aug, 2017 1 commit
  8. 18 Aug, 2017 1 commit
  9. 17 Aug, 2017 2 commits
    • Leszek Swirski's avatar
      [turbofan] Only create Phis for live registers · a67b7aa2
      Leszek Swirski authored
      In graph building, use liveness information to only create Phis
      for live registers when merging two environments, or when preparing
      a loop header. Similarly, only create loop exit value nodes for
      live registers when exiting a loop.
      
      Bug: v8:6701
      Change-Id: Id6ac6a5518e6f1762530d871e92a46f42397928b
      Reviewed-on: https://chromium-review.googlesource.com/615173
      Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
      Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47389}
      a67b7aa2
    • Leszek Swirski's avatar
      [turbofan] Never generate loop exit phis for the accumulator · 1a302730
      Leszek Swirski authored
      The accumulator should never be alive when jumping back to a loop
      header, or jumping out of a loop. This means that as far as far as
      TurboFan is concerned, we never need to create Phis or LoopExitValues
      for the accumulator, as its value should not escape the loop.
      
      For safety, this also augments the IsLivenessValid DCHECK in the
      liveness analysis to check that the accumulator is not live in these
      cases, and amends the bytecode analysis tests to kill the accumulator
      where necessary to ensure this.
      
      As a drive-by, added some comments to the more complex bytecode analysis
      tests, since figuring out what they were for and how to fix them took a
      non-trivial amount of time.
      
      Change-Id: Idecf76a36681d724134c59768650c23cc6b0e9ef
      Reviewed-on: https://chromium-review.googlesource.com/615168
      Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47388}
      1a302730
  10. 11 Aug, 2017 1 commit
    • Ross McIlroy's avatar
      [Interpreter] Remove new.target from fixed frame slot. · c820b89b
      Ross McIlroy authored
      Removes the new.target slot from the interpreter's fixed frame. Instead
      adds a field to BytecodeArray to get the bytecode's incoming
      new.target or generator object register. The InterpreterEntryTrampoline
      then sets this register with the incoming new.target (or generator object)
      when the function is called. This register can be directly the new.target
      or generator object variable if they are LOCAL location, otherwise it is a
      temporary register which is then moved to the variable's location during the
      function prologue.
      
      This fixes a hack in the deoptimizer where we would set the new.target fixed
      slot to undefined in order to avoid extending it's lifetime through the
      optimized code - now it's just a standard register and can be optimized away
      as normal.
      
      Bug=v8:6644
      
      Change-Id: Ieb8cc34cccefd9fb6634a90cbc77c6002a54f2ae
      Reviewed-on: https://chromium-review.googlesource.com/608966
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47320}
      c820b89b
  11. 27 Jul, 2017 1 commit
  12. 26 Jul, 2017 1 commit
  13. 25 Jul, 2017 2 commits
  14. 24 Jul, 2017 1 commit
    • Benedikt Meurer's avatar
      [turbofan] Add IC support for Call/ConstructWithSpread. · 5ee1b7ad
      Benedikt Meurer authored
      Properly hook up the (existing) IC slots for the CallWithSpread and
      ConstructWithSpread bytecodes, and change the interpreter to collect
      feedback (call counts and regular target function feedback) for those.
      There's no integration with the Array constructor yet, since that
      requires some yak shaving to thread through the AllocationSite to the
      Array constructor stub. Once we have a solution for that, we can also
      remove the current code duplication in the Call/Construct IC logic.
      
      Also properly hook up the newly available feedback in TurboFan. This
      will fix not only the missing target feedback, but more importantly
      the tear-up decisions for optimization are correct now in the presence
      of spread calls, and even more importantly the inlining heurstic has
      proper call frequencies for those.
      
      Some follow-up changes will be necessary to make sure we use the
      feedback even for corner cases that aren't handled properly yet. Also
      we should consider collecting feedback about the map of the spread
      at some point to be able to always inline the spread calls.
      
      Bug: v8:6399, v8:6527, v8:6630
      Change-Id: I818dbcb411fd3951d8e9d31f5d7e794f8d60fa00
      Reviewed-on: https://chromium-review.googlesource.com/582647Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46832}
      5ee1b7ad
  15. 21 Jul, 2017 1 commit
    • Ross McIlroy's avatar
      Revert "[Turbofan] Merged the OSR phase into the graph building phase." · 5d0a4327
      Ross McIlroy authored
      This reverts commit 69c8f16d.
      
      Reason for revert: Causing crashes on Clusterfuzz - http://crbug.com/747154
      
      BUG=chromium:747154
      
      Original change's description:
      > [Turbofan] Merged the OSR phase into the graph building phase.
      > 
      > Now the OSR phase is only used when OSRing from the ast graph builder.
      > When OSRing from Turbofan, the implementation is now in the graph
      > building phase, at the beginning of the VisitBytecode function.
      > We are no longer generating any OSRLoopEntry or OSRNormalEntry nodes,
      > nor nodes for the possible code of the OSRed function which is before
      > the OSRed loops.
      > 
      > The trimming and reducing of the OSR phase is not done either. This
      > change in the way the way the OSR is done enabled to remove the
      > workaround to the bug mentioned below.
      > 
      > Bug: v8:6112
      > Bug: v8:6518
      > Change-Id: I1c9231810b923486d55ea618d550d981d695d797
      > Reviewed-on: https://chromium-review.googlesource.com/543042
      > Commit-Queue: Alexandre Talon <alexandret@google.com>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#46801}
      
      TBR=rmcilroy@chromium.org,mstarzinger@chromium.org,leszeks@chromium.org,alexandret@google.com
      
      Change-Id: Ifa9bf5d86e888a47cad7fb10446b36fda5029604
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:6112, v8:6518
      Reviewed-on: https://chromium-review.googlesource.com/581288Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46817}
      5d0a4327
  16. 20 Jul, 2017 2 commits
    • Adam Klein's avatar
      Revert "[literals] Introduce CreateEmptyArrayLiteral Bytecode" · 62f83377
      Adam Klein authored
      This reverts commit 4851745f.
      
      Reason for revert: Top crasher on Canary, see https://crbug.com/746935
      
      Original change's description:
      > [literals] Introduce CreateEmptyArrayLiteral Bytecode
      > 
      > Empty Array literals are amongst the most commonly used literal types on our
      > top25 page list. Using a custom bytecode we can drop the boilerplate for empty
      > Array literals alltogether. However, we still need a proper AllocationSite to
      > track ElementsKind transitions.
      > 
      > Bug: v8:6211
      > Change-Id: Id5dbdac0ea8e24dd474e679c902c6e4a2957af1d
      > Reviewed-on: https://chromium-review.googlesource.com/567079
      > Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Reviewed-by: Igor Sheludko <ishell@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#46752}
      
      TBR=rmcilroy@chromium.org,mstarzinger@chromium.org,cbruni@chromium.org,ishell@chromium.org,rmcilroy@google.com
      Bug: v8:6211, chromium:746935
      
      Change-Id: Ibf19a923688c071d03bad8661a10e08f8414db56
      Reviewed-on: https://chromium-review.googlesource.com/580193
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46804}
      62f83377
    • Alexandre Talon's avatar
      [Turbofan] Merged the OSR phase into the graph building phase. · 69c8f16d
      Alexandre Talon authored
      Now the OSR phase is only used when OSRing from the ast graph builder.
      When OSRing from Turbofan, the implementation is now in the graph
      building phase, at the beginning of the VisitBytecode function.
      We are no longer generating any OSRLoopEntry or OSRNormalEntry nodes,
      nor nodes for the possible code of the OSRed function which is before
      the OSRed loops.
      
      The trimming and reducing of the OSR phase is not done either. This
      change in the way the way the OSR is done enabled to remove the
      workaround to the bug mentioned below.
      
      Bug: v8:6112
      Bug: v8:6518
      Change-Id: I1c9231810b923486d55ea618d550d981d695d797
      Reviewed-on: https://chromium-review.googlesource.com/543042
      Commit-Queue: Alexandre Talon <alexandret@google.com>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46801}
      69c8f16d
  17. 19 Jul, 2017 2 commits
  18. 18 Jul, 2017 1 commit
  19. 14 Jul, 2017 1 commit
    • Caitlin Potter's avatar
      [generators] remove SuspendFlags enum and related code · 53553f5d
      Caitlin Potter authored
      SuspendFlags was originally used by the suspend operation to determine
      which field to record the bytecode offset of a suspended generator, and
      the value the generator was resumed with. For async generators, await
      operations would use a separate field, in order to preserve the previous
      yield input value. This was important to ensure `function.sent`
      continued to function correctly.
      
      As function.sent is being retired, this allows the removal of support
      for that. Given that this was the only real need for SuspendFlags in the
      first place (with other uses tacked on as a hack), this involves several
      other changes as well:
      
      - Modification of MacroAssembler AssertGeneratorObject. No longer
        accepts a SuspendFlags parameter to determine which type of check to
        perform.
      - Removal of `flags` operand from SuspendGenerator bytecode, and the
        GeneratorStore js-operator.
      - Removal of `flags` parameter from ResumeGeneratorTrampoline builtins.
      - Removal of Runtime functions, interpreter intrinsics and
        AccessBuilders associated with the [[await_input_or_debug_pos]] field
        in JSAsyncGeneratorObject, as this field no longer exists.
      - Addition of a new `Yield` AST node (subclass of Suspend) in order to
        prevent the need for the other SuspendFlag values.
      
      BUG=v8:5855
      TBR=bmeurer@chromium.org
      
      Change-Id: Iff2881e4742497fe5b774915e988c3d9d8fbe487
      Reviewed-on: https://chromium-review.googlesource.com/570485
      Commit-Queue: Caitlin Potter <caitp@igalia.com>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46683}
      53553f5d
  20. 13 Jul, 2017 1 commit
  21. 30 Jun, 2017 1 commit
    • bmeurer's avatar
      [turbofan] Replace uninitialized JSConstruct nodes with SOFT deopt. · fd24deb0
      bmeurer authored
      Similar to JSCall, we can also replace uninitialized JSConstruct nodes
      with SOFT deopts to ensure that we don't generate unnecessary dead code.
      This for example shows up in the hot parts of the Node event emitter
      currently where the generic code for handling events with 4 or more
      parameters might not have been run, but we still generate most of the
      code because the new Array call in the beginning is not turned into
      a SOFT deopt immediately.
      
      Drive-by-fix: Also refactor the BytecodeGraphBuilder's handling of
      Construct bytecodes a bit to reduce the amount of code duplication.
      
      BUG=v8:4551, v8:5267
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2958253002
      Cr-Commit-Position: refs/heads/master@{#46339}
      fd24deb0
  22. 29 Jun, 2017 1 commit
  23. 27 Jun, 2017 2 commits
  24. 22 Jun, 2017 1 commit
    • Daniel Ehrenberg's avatar
      [scopes] Fix sloppy-mode block-scoped function hoisting edge case · d54ffadf
      Daniel Ehrenberg authored
      In edge cases such as the following, sloppy-mode block-scoped function
      hoisting is expected to occur:
      
        eval(`
          with({a: 1}) {
            function a() {}
          }
        `)
      
      In this case, there should be the equivalent of a var declaration
      outside of the eval, which gets set to the value of the local function
      a when the body of the with is executed.
      
      Previously, the way that var declarations are hoisted out of eval
      meant that the assignment to that var was an ordinary DYNAMIC_GLOBAL
      assignment. However, such a lookup mode meant that the object in the
      with scope received the assignment!
      
      This patch fixes that error by marking the assignments produced by
      the sloppy mode block scoped function hoisting desugaring so as to
      generate a different runtime call which skips with scopes.
      
      Bug: chromium:720247, v8:5135
      Change-Id: Ie36322ddc9ca848bf680163e8c016f50d4597748
      Reviewed-on: https://chromium-review.googlesource.com/529230
      Commit-Queue: Daniel Ehrenberg <littledan@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46116}
      d54ffadf
  25. 21 Jun, 2017 1 commit
  26. 08 Jun, 2017 1 commit
  27. 07 Jun, 2017 2 commits
  28. 06 Jun, 2017 2 commits
    • jgruber's avatar
      [coverage] Block coverage with support for IfStatements · b4241540
      jgruber authored
      This CL implements general infrastructure for block coverage together with
      initial support for if-statements.
      
      Coverage output can be generated in lcov format by d8 as follows:
      
      $ d8 --block-coverage --lcov=$(echo ~/simple-if.lcov) ~/simple-if.js
      $ genhtml ~/simple-if.lcov -o ~/simple-if
      $ chrome ~/simple-if/index.html
      
      A high level overview of the implementation follows:
      
      The parser now collects source ranges unconditionally for relevant AST nodes.
      Memory overhead is very low and this seemed like the cleanest and simplest
      alternative.
      
      Bytecode generation uses these ranges to allocate coverage slots and insert
      IncBlockCounter instructions (e.g. at the beginning of then- and else blocks
      for if-statements). The slot-range mapping is generated here and passed on
      through CompilationInfo, and is later accessible through the
      SharedFunctionInfo.
      
      The IncBlockCounter bytecode fetches the slot-range mapping (called
      CoverageInfo) from the shared function info and simply increments the counter.
      We don't collect native-context-specific counts as they are irrelevant to our
      use-cases.
      
      Coverage information is finally generated on-demand through Coverage::Collect.
      The only current consumer is a d8 front-end with lcov-style output, but the
      short-term goal is to expose this through the inspector protocol.
      
      BUG=v8:6000
      CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng
      
      Review-Url: https://codereview.chromium.org/2882973002
      Cr-Commit-Position: refs/heads/master@{#45737}
      b4241540
    • Mythri's avatar
      [Interpreter] Introduce bytecodes that check for hole and throw. · c360c6a1
      Mythri authored
      Introduces ThrowReferenceErrorIfHole / ThrowSuperNotCalledIfHole 
      / ThrowSuperAlreadyCalledIfNotHole bytecodes to handle hole checks.
      In the bytecode-graph builder they are handled by introducing a deopt point
      instead of adding explicit control flow. JumpIfNotHole / JumpIfNotHoleConstant
      bytecodes are removed since they are no longer required.
      
      
      Bug: v8:4280, v8:6383
      Change-Id: I58b70c556b0ffa30e41a0cd44016874c3e9c5fe1
      Reviewed-on: https://chromium-review.googlesource.com/509613
      Commit-Queue: Mythri Alle <mythria@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45720}
      c360c6a1