1. 10 Jan, 2017 1 commit
  2. 16 Dec, 2016 1 commit
    • ahaas's avatar
      [wasm] TrapIf and TrapUnless TurboFan operators implemented on arm. · ca8d3ba7
      ahaas authored
      Original commit message:
      [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code.
      
      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, v8-arm-ports@googlegroups.com
      
      Review-Url: https://codereview.chromium.org/2584603002
      Cr-Commit-Position: refs/heads/master@{#41774}
      ca8d3ba7
  3. 07 Dec, 2016 1 commit
    • caitp's avatar
      [ignition] desugar GetIterator() via bytecode rather than via AST · b5f146a0
      caitp authored
      Introduces:
      - a new AST node representing the GetIterator() algorithm in the specification, to be used by ForOfStatement, YieldExpression (in the case of delegating yield*), and the future `for-await-of` loop proposed in http://tc39.github.io/proposal-async-iteration/#sec-async-iterator-value-unwrap-functions.
      - a new opcode (JumpIfJSReceiver), which is useful for `if Type(object) is not Object` checks which are common throughout the specification. This node is easily eliminated by TurboFan.
      
      The AST node is desugared specially in bytecode, rather than manually when building the AST. The benefit of this is that desugaring in the BytecodeGenerator is much simpler and easier to understand than desugaring the AST.
      
      This also reduces parse time very slightly, and allows us to use LoadIC rather than KeyedLoadIC, which seems to have  better baseline performance. This results in a ~20% improvement in test/js-perf-test/Iterators micro-benchmarks, which I believe owes to the use of the slightly faster LoadIC as opposed to the KeyedLoadIC in the baseline case. Both produce identical optimized code via TurboFan when the type check can be eliminated, and the load can be replaced with a constant value.
      
      BUG=v8:4280
      R=bmeurer@chromium.org, rmcilroy@chromium.org, adamk@chromium.org, neis@chromium.org, jarin@chromium.org
      TBR=rossberg@chromium.org
      
      Review-Url: https://codereview.chromium.org/2557593004
      Cr-Commit-Position: refs/heads/master@{#41555}
      b5f146a0
  4. 02 Dec, 2016 1 commit
    • bmeurer's avatar
      [compiler] Consistently use Ignition+TurboFan for lexical variables. · 5529430d
      bmeurer authored
      Crankshaft has this highly unpredictable performance cliff around the
      "Unsupported phi use of const or let variable", which is due to the
      fact that Crankshaft refuses to do hole checks (for a couple of
      reasons). So ideally we should not even try to send any lexically bound
      variables to fullcodegen+Crankshaft, but instead give them to Ignition
      and TurboFan.
      
      This CL only adds the appropriate check to the AstNumbering, but doesn't
      remove the functionality from fullcodegen/Crankshaft yet. This would be
      step two in case this CL sticks. If you see any major performance
      regressions with this CL in the range, just revert it and ping me.
      
      See Node.js issue https://github.com/nodejs/node/issues/9729 for
      additional information.
      
      BUG=v8:5666
      R=hablich@chromium.org, mstarzinger@chromium.org, rmcilroy@chromium.org
      
      Review-Url: https://codereview.chromium.org/2525243002
      Cr-Commit-Position: refs/heads/master@{#41445}
      5529430d
  5. 29 Nov, 2016 1 commit
  6. 22 Nov, 2016 1 commit
  7. 21 Nov, 2016 1 commit
    • mstarzinger's avatar
      [fullcodegen] Remove deprecated generator implementation. · 09255541
      mstarzinger authored
      This removes the deprecated generator support for resumable functions
      from {FullCodeGenerator}. The existing {AstNumbering} heuristic already
      triggers Ignition for most resumable functions, with this change we make
      said heuristic a hard choice and remove the deprecated code. This also
      has the advantage that any suspended {JSGeneratorObject} instance on the
      heap is guaranteed to have code based on a bytecode array.
      
      R=bmeurer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2504223002
      Cr-Commit-Position: refs/heads/master@{#41135}
      09255541
  8. 15 Nov, 2016 1 commit
  9. 08 Nov, 2016 2 commits
  10. 27 Oct, 2016 1 commit
    • ishell's avatar
      [ic] Remove unnecessary access rights checks from the IC handlers. · 8ba4af44
      ishell authored
      The reasons are:
      1) Type feedback vectors are not shared between different native contexts and
         therefore the IC handler created for one native context will not be reused
         in other native context.
      2) Access rights revocation is not supported at all, therefore given (1) once
         we pass the access check we don't have to check access rights again.
      
      BUG=v8:5561
      
      Review-Url: https://codereview.chromium.org/2455953002
      Cr-Commit-Position: refs/heads/master@{#40627}
      8ba4af44
  11. 26 Oct, 2016 1 commit
    • bmeurer's avatar
      [compiler] Properly validate stable map assumption for globals. · 2bd7464e
      bmeurer authored
      For global object property cells, we did not check that the map on the
      previous object is still the same for which we actually optimized. So
      the optimized code was not in sync with the actual state of the property
      cell. When loading from such a global object property cell, Crankshaft
      optimizes away any map checks (based on the stable map assumption),
      leading to arbitrary memory access in the worst case.
      
      TurboFan has the same bug for stores, but is safe on loads because we
      do appropriate map checks there. However mixing TurboFan and Crankshaft
      still exposes the bug.
      
      R=yangguo@chromium.org
      BUG=chromium:659475
      
      Review-Url: https://codereview.chromium.org/2444233004
      Cr-Commit-Position: refs/heads/master@{#40592}
      2bd7464e
  12. 20 Oct, 2016 1 commit
  13. 17 Oct, 2016 1 commit
  14. 23 Sep, 2016 1 commit
  15. 20 Sep, 2016 1 commit
  16. 31 Aug, 2016 1 commit
    • adamk's avatar
      Remove CONST_LEGACY VariableMode · 7516fe1e
      adamk authored
      The only remaining use of this VariableMode is for the names of sloppy
      named function expressions. This patch instead uses CONST for such
      bindings (just as we do in strict mode) and instead marks those
      Variables specially. During code generation a new helper method,
      Variable::throw_on_const_assignment(), is called to decide whether
      to throw or silently ignore the assignment.
      
      Review-Url: https://codereview.chromium.org/2233673003
      Cr-Commit-Position: refs/heads/master@{#39052}
      7516fe1e
  17. 25 Aug, 2016 3 commits
    • jarin's avatar
      Reland of [turbofan] Insert dummy values when changing from None type. · 2a97b1bc
      jarin authored
      This reverts commit a55fdb1e, relands
      https://codereview.chromium.org/2266823002/.
      
      BUG=chromium:638132
      
      Review-Url: https://codereview.chromium.org/2277283002
      Cr-Commit-Position: refs/heads/master@{#38917}
      2a97b1bc
    • bmeurer's avatar
      Revert of [turbofan] Insert dummy values when changing from None type.... · a55fdb1e
      bmeurer authored
      Revert of [turbofan] Insert dummy values when changing from None type. (patchset #5 id:80001 of https://codereview.chromium.org/2266823002/ )
      
      Reason for revert:
      Octane/Mandreel aborts with an exception now:
      
      TypeError: __FUNCTION_TABLE__[(r2 >> 2)] is not a function
      
      Original issue's description:
      > [turbofan] Insert dummy values when changing from None type.
      >
      > Currently we choose the MachineRepresentation::kNone representation for
      > values of Type::None, and when converting values from the kNone representation
      > we use "impossible" conversions that will crash at runtime. This
      > assumes that the impossible conversions should never be hit (the only
      > way to produce the impossible values is to perform an always-failing
      > runtime check on a value, such as Smi-checking a string). Note that
      > this assumes that the runtime check is executed before the impossible
      > convesrion.
      >
      > Introducing BitwiseOr type feedback broke this in two ways:
      >
      > - we always pick Word32 representation for bitwise-or, so the
      >   impossible conversion does not trigger (it only triggers with
      >   None representation), and we could end up with unsupported
      >   conversions from Word32.
      >
      > - even if we inserted impossible conversions, they are pure conversions.
      >   Since untagging, bitwise-or operations are also pure, we could hoist
      >   all these before the smi check of the inputs and we could hit the
      >   impossible conversions before we get to the smi check.
      >
      > This CL addresses this by just providing dummy values for conversions
      > from the Type::None type. It also removes the impossible-to-* conversions.
      >
      > BUG=chromium:638132
      >
      > Committed: https://crrev.com/c83b21ab755f1420b6da85b3ff43d7e96ead9bbe
      > Cr-Commit-Position: refs/heads/master@{#38883}
      
      TBR=mstarzinger@chromium.org,jarin@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=chromium:638132
      
      Review-Url: https://codereview.chromium.org/2280613002
      Cr-Commit-Position: refs/heads/master@{#38893}
      a55fdb1e
    • jarin's avatar
      [turbofan] Insert dummy values when changing from None type. · c83b21ab
      jarin authored
      Currently we choose the MachineRepresentation::kNone representation for
      values of Type::None, and when converting values from the kNone representation
      we use "impossible" conversions that will crash at runtime. This
      assumes that the impossible conversions should never be hit (the only
      way to produce the impossible values is to perform an always-failing
      runtime check on a value, such as Smi-checking a string). Note that
      this assumes that the runtime check is executed before the impossible
      convesrion.
      
      Introducing BitwiseOr type feedback broke this in two ways:
      
      - we always pick Word32 representation for bitwise-or, so the
        impossible conversion does not trigger (it only triggers with
        None representation), and we could end up with unsupported
        conversions from Word32.
      
      - even if we inserted impossible conversions, they are pure conversions.
        Since untagging, bitwise-or operations are also pure, we could hoist
        all these before the smi check of the inputs and we could hit the
        impossible conversions before we get to the smi check.
      
      This CL addresses this by just providing dummy values for conversions
      from the Type::None type. It also removes the impossible-to-* conversions.
      
      BUG=chromium:638132
      
      Review-Url: https://codereview.chromium.org/2266823002
      Cr-Commit-Position: refs/heads/master@{#38883}
      c83b21ab
  18. 05 Aug, 2016 1 commit
  19. 25 Jul, 2016 1 commit
  20. 18 Jul, 2016 1 commit
    • neis's avatar
      [modules] AST and parser rework. · 0e000a87
      neis authored
      Highlights:
      - Record all imports and exports in the ModuleDescriptor.
      - Remove ImportDeclaration; instead, introduce a new variable kind for imports.
      - Set name on default exported anonymous functions.
      
      Still to do: declaration of namespace imports.
      
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2108193003
      Cr-Commit-Position: refs/heads/master@{#37815}
      0e000a87
  21. 05 Jul, 2016 1 commit
  22. 28 Jun, 2016 1 commit
  23. 13 Jun, 2016 1 commit
  24. 18 May, 2016 1 commit
  25. 17 May, 2016 5 commits
  26. 16 May, 2016 1 commit
  27. 13 May, 2016 1 commit
  28. 11 May, 2016 1 commit
    • rmcilroy's avatar
      [Interpreter] Fix incorrect frame walking in arguments create stubs · 40f34541
      rmcilroy authored
      The previous approach taken by FastNew[Sloppy,Strict,Rest]ArgumentsStub
      looked at the function slot in order to skip stub frames
      and find the JS frame. However, stub frames do not have a
      function slot (in fact their fixed frame ends one slot
      before the JS frame's function slot). Therefore, if this
      location in the stub frame happens to have the function
      object the create arguments stubs won't skip this frame
      correctly.
      
      Replace this approach with one where the stub is
      specialized to either skip a frame if required (since
      there will only ever be one extra frame on Ignition
      the loop approach isn't necessary).
      
      BUG=v8:4928
      LOG=N
      CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_nosnap_dbg
      
      Review-Url: https://codereview.chromium.org/1949023003
      Cr-Commit-Position: refs/heads/master@{#36181}
      40f34541
  29. 10 May, 2016 1 commit
  30. 28 Apr, 2016 1 commit
  31. 11 Apr, 2016 1 commit
    • mstarzinger's avatar
      [compiler] Make OptimizedCompileJob agnostic from backend. · dea67cf0
      mstarzinger authored
      This refactors the OptimizedCompileJob class to be agnostic from the
      actual underlying compiler. Instead it represents a base class for all
      compilation jobs. The implementation is provided by the backend by just
      overriding the phase methods.
      
      Also note that this contains the semantics change of not falling back to
      Crankshaft when TurboFan optimization fails. This fallback is no longer
      needed and will not be supported going forward.
      
      R=bmeurer@chromium.org
      
      Review URL: https://codereview.chromium.org/1872483002
      
      Cr-Commit-Position: refs/heads/master@{#35377}
      dea67cf0
  32. 06 Apr, 2016 1 commit
    • bmeurer's avatar
      [generators] Decouple generator resume from fullcodegen. · 974721c6
      bmeurer authored
      Introduce a ResumeGeneratorTrampoline, which does the actual stack state
      reconstruction (currently always restores a fullcodegen frame), and
      introduce appropriate TurboFan builtins for %GeneratorPrototype%.next,
      %GeneratorPrototype%.return and %GeneratorPrototype%.throw based on
      this native builtin.
      
      Also unify the flooding in case of step-in to always work based on
      JSFunction and remove the special casing for JSGeneratorObject.
      
      R=mstarzinger@chromium.org, neis@chromium.org
      TBR=rossberg@chromium.org
      BUG=chromium:513471
      LOG=n
      
      Review URL: https://codereview.chromium.org/1865833002
      
      Cr-Commit-Position: refs/heads/master@{#35283}
      974721c6
  33. 22 Mar, 2016 1 commit
    • adamk's avatar
      Remove support for legacy const, part 1 · ed18aa65
      adamk authored
      Now that ES2015 const has shipped, in Chrome 49, legacy const declarations
      are no more. This lets us remove a bunch of code from many parts of the
      codebase.
      
      In this patch, I remove parser support for generating legacy const variables
      from const declarations. This also removes the special "illegal declaration"
      bit from Scope, which has ripples into all compiler backends.
      
      Also gone are any tests which relied on legacy const declarations.
      
      Note that we do still generate a Variable in mode CONST_LEGACY in one case:
      function name bindings in sloppy mode. The likely fix there is to add a new
      Variable::Kind for this case and handle it appropriately for stores in each
      backend, but I leave that for a later patch to make this one completely
      subtractive.
      
      Review URL: https://codereview.chromium.org/1819123002
      
      Cr-Commit-Position: refs/heads/master@{#35002}
      ed18aa65