1. 02 Dec, 2017 1 commit
    • Mathias Bynens's avatar
      Normalize casing of hexadecimal digits · 822be9b2
      Mathias Bynens authored
      This patch normalizes the casing of hexadecimal digits in escape
      sequences of the form `\xNN` and integer literals of the form
      `0xNNNN`.
      
      Previously, the V8 code base used an inconsistent mixture of uppercase
      and lowercase.
      
      Google’s C++ style guide uses uppercase in its examples:
      https://google.github.io/styleguide/cppguide.html#Non-ASCII_Characters
      
      Moreover, uppercase letters more clearly stand out from the lowercase
      `x` (or `u`) characters at the start, as well as lowercase letters
      elsewhere in strings.
      
      BUG=v8:7109
      TBR=marja@chromium.org,titzer@chromium.org,mtrofin@chromium.org,mstarzinger@chromium.org,rossberg@chromium.org,yangguo@chromium.org,mlippautz@chromium.org
      NOPRESUBMIT=true
      
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I790e21c25d96ad5d95c8229724eb45d2aa9e22d6
      Reviewed-on: https://chromium-review.googlesource.com/804294
      Commit-Queue: Mathias Bynens <mathias@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49810}
      822be9b2
  2. 01 Dec, 2017 2 commits
  3. 13 Jul, 2017 1 commit
  4. 04 Jan, 2017 1 commit
  5. 30 Nov, 2016 1 commit
  6. 27 Sep, 2016 1 commit
  7. 16 Sep, 2016 1 commit
  8. 13 Sep, 2016 1 commit
  9. 29 Aug, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Remove invalid typing rules. · 285e1e15
      bmeurer authored
      Drop the typing rules for the machine operators and replace them
      with UNREACHABLE. These typing rules were never correct and there's
      also no need to have those rules at all.
      
      Drive-by-fix: Remove the extremely annoying test-simplified-lowering.cc
      file, which is not very useful, but consumes a large amount of time to
      keep it compiling and passing. Instead we should introduce appropriate
      tests for the SimplifiedLowering that also test something meaningful
      w/o just cementing the implementation.
      
      R=jarin@chromium.org
      BUG=v8:5267
      
      Review-Url: https://codereview.chromium.org/2292463002
      Cr-Commit-Position: refs/heads/master@{#38970}
      285e1e15
  10. 10 Aug, 2016 1 commit
  11. 08 Aug, 2016 1 commit
  12. 03 Aug, 2016 1 commit
  13. 25 Jul, 2016 1 commit
  14. 14 Jul, 2016 1 commit
  15. 01 Jul, 2016 1 commit
    • bmeurer's avatar
      [builtins] Unify most of the remaining Math builtins. · 0a0fe8fb
      bmeurer authored
      Import fdlibm versions of acos, acosh, asin and asinh, which are more
      precise and produce the same result across platforms (we were using
      libm versions for asin and acos so far, where both speed and precision
      depended on the operating system so far). Introduce appropriate TurboFan
      operators for these functions and use them both for inlining and for the
      generic builtin.
      
      Also migrate the Math.imul and Math.fround builtins to TurboFan builtins
      to ensure that their behavior is always exactly the same as the inlined
      TurboFan version (i.e. C++ truncation semantics for double to float
      don't necessarily meet the JavaScript semantics).
      
      For completeness, also migrate Math.sign, which can even get some nice
      love in TurboFan.
      
      Drive-by-fix: Some alpha-sorting on the Math related functions, and
      cleanup the list of Math intrinsics that we have to export via the
      native context currently.
      
      BUG=v8:3266,v8:3496,v8:3509,v8:3952,v8:5169,v8:5170,v8:5171,v8:5172
      TBR=rossberg@chromium.org
      R=franzih@chromium.org
      
      Review-Url: https://codereview.chromium.org/2116753002
      Cr-Commit-Position: refs/heads/master@{#37476}
      0a0fe8fb
  16. 30 Jun, 2016 1 commit
  17. 21 Jun, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Address the useless overflow bit materialization. · 00889cc2
      bmeurer authored
      Add control dependencies to Projection and Int32Add/SubWithOverflow
      operators, to prevent the scheduler from moving the Projection nodes
      into the wrong place. This way the instruction selection can combine
      the Int32Add/SubWithOverflow operations with the DeoptimizeIf and/or
      DeoptimizeUnless nodes. This needs new operators CheckedInt32Add and
      CheckedInt32Sub so that we can delay the actual lowering until the
      effect/control linearizer.
      
      This also makes CheckIf operator obsolete, so we can drop it.
      
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2082993002
      Cr-Commit-Position: refs/heads/master@{#37148}
      00889cc2
  18. 20 Jun, 2016 1 commit
    • bmeurer's avatar
      [builtins] Introduce proper Float64Tan operator. · c87168bc
      bmeurer authored
      Import base::ieee754::tan() from fdlibm and introduce Float64Tan TurboFan
      operator based on that, similar to what we do for Float64Cos and Float64Sin.
      Rewrite Math.tan() as TurboFan builtin and use those operators to also
      inline Math.tan() into optimized TurboFan functions.
      
      Drive-by-fix: Kill the %_ConstructDouble intrinsics, and provide only
      the %ConstructDouble runtime entry for writing tests.
      
      BUG=v8:5086,v8:5126
      R=yangguo@chromium.org
      
      Review-Url: https://codereview.chromium.org/2083453002
      Cr-Commit-Position: refs/heads/master@{#37087}
      c87168bc
  19. 17 Jun, 2016 3 commits
  20. 16 Jun, 2016 2 commits
  21. 13 Jun, 2016 2 commits
    • bmeurer's avatar
      [builtins] Introduce proper Float64Atan and Float64Atan2 operators. · 89d8c57b
      bmeurer authored
      Import base::ieee754::atan() and base::ieee754::atan2() from fdlibm and
      introduce Float64Atan and Float64Atan2 TurboFan operators based on those,
      similar to what we already did for Float64Log and Float64Log1p. Rewrite
      Math.atan() and Math.atan2() as TurboFan builtin and use the operators
      to also inline Math.atan() and Math.atan2() into optimized TurboFan functions.
      
      R=yangguo@chromium.org
      BUG=v8:5086,v8:5095
      
      Review-Url: https://codereview.chromium.org/2065503002
      Cr-Commit-Position: refs/heads/master@{#36916}
      89d8c57b
    • bmeurer's avatar
      [builtins] Introduce proper Float64Log1p operator. · 7ceed92a
      bmeurer authored
      Import base::ieee754::log1p() from fdlibm and introduce a Float64Log1p
      TurboFan operator based on that, similar to what we do for Float64Log.
      Rewrite Math.log1p() as TurboFan builtin and use that operator to also
      inline Math.log1p() into optimized TurboFan functions.
      
      Also unify the handling of the special IEEE 754 functions somewhat in
      the TurboFan backends. At some point we can hopefully express this
      completely in the InstructionSelector (once we have an idea what to do
      with the ST(0) return issue on IA-32/X87).
      
      Drive-by-fix: Add some more test coverage for the log function.
      
      R=yangguo@chromium.org
      BUG=v8:5086,v8:5092
      
      Review-Url: https://codereview.chromium.org/2060743002
      Cr-Commit-Position: refs/heads/master@{#36914}
      7ceed92a
  22. 10 Jun, 2016 1 commit
    • bmeurer's avatar
      [builtins] Introduce proper base::ieee754::log. · d0c7775d
      bmeurer authored
      This switches Math.log to use an fdlibm based version of log, imported
      as base::ieee754::log, and use that consistently everywhere, i.e. change
      the Float64Log TurboFan operators on Intel to use the C++ implementation
      as well (same for Crankshaft).
      
      R=yangguo@chromium.org
      BUG=v8:5065,v8:5086
      
      Review-Url: https://codereview.chromium.org/2053893003
      Cr-Commit-Position: refs/heads/master@{#36880}
      d0c7775d
  23. 03 Jun, 2016 1 commit
    • bmeurer's avatar
      [builtins] Migrate Math.log to TurboFan. · f2da19fe
      bmeurer authored
      Introduce a dedicated Float64Log machine operator, that is either
      implemented by a direct C call or by platform specific code, i.e.
      using the FPU on x64 and ia32.
      
      This operator is used to implement Math.log as a proper TurboFan
      builtin on top of the CodeStubAssembler.
      
      Also introduce a NumberLog simplified operator on top of Float64Log
      and use that for the fast inline path of Math.log inside TurboFan
      optimized code.
      
      BUG=v8:5065
      
      Review-Url: https://codereview.chromium.org/2029413005
      Cr-Commit-Position: refs/heads/master@{#36703}
      f2da19fe
  24. 24 Apr, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Introduce TruncateTaggedToWord32 simplified operator. · 0231a7ef
      bmeurer authored
      This allows us to get rid of the "push TruncateFloat64ToInt32 into Phi"
      trick that was used in the MachineOperatorReducer to combine the
      ChangeTaggedToFloat64 and TruncateFloat64ToInt32 operations. Instead of
      doing that later, we can just introduce the proper operator during the
      representation selection directly.
      
      Also separate the TruncateFloat64ToInt32 machine operator, which had two
      different meanings depending on a flag (either JavaScript truncation or
      C++ style round to zero). Now there's a TruncateFloat64ToWord32 which
      represents the JavaScript truncation (implemented via TruncateDoubleToI
      macro + code stub) and the RoundFloat64ToInt32, which implements the C++
      round towards zero operation (in the same style as the other WebAssembly
      driven Round* machine operators).
      
      R=jarin@chromium.org
      
      Review URL: https://codereview.chromium.org/1919513002
      
      Cr-Commit-Position: refs/heads/master@{#35743}
      0231a7ef
  25. 11 Dec, 2015 1 commit
  26. 10 Dec, 2015 1 commit
    • jarin's avatar
      [turbofan] Make MachineType a pair of enums. · bb2a830d
      jarin authored
      MachineType is now a class with two enum fields:
      - MachineRepresentation
      - MachineSemantic
      
      Both enums are usable on their own, and this change switches some places from using MachineType to use just MachineRepresentation. Most notably:
      - register allocator now uses just the representation.
      - Phi and Select nodes only refer to representations.
      
      Review URL: https://codereview.chromium.org/1513543003
      
      Cr-Commit-Position: refs/heads/master@{#32738}
      bb2a830d
  27. 26 Nov, 2015 3 commits
    • bmeurer's avatar
      Revert of binary-operator-reducer: reduce mul+div(shift) (patchset #11... · 5d18e93b
      bmeurer authored
      Revert of binary-operator-reducer: reduce mul+div(shift) (patchset #11 id:200001 of https://codereview.chromium.org/1350223006/ )
      
      Reason for revert:
      This is also unsound for the reasons outlined in
      https://codereview.chromium.org/1473073004/
      Will help Fedor to implement a solution based on simplified operators.
      
      Original issue's description:
      > binary-operator-reducer: reduce mul+div(shift)
      >
      > Reduction Input:
      >
      >     ChangeInt32ToFloat64=>          TruncateFloat64ToInt32
      >                          Float64Mul=>
      >     ChangeInt32ToFloat64=>          Float64Div=>TruncateFloat64ToInt32
      >
      > Output:
      >
      >          =>  TruncateInt64ToInt32
      > Int64Mul
      >          =>  Int64Shr => TruncateInt64ToInt32
      >
      > Test code:
      >
      >     function mul(a, b) {
      >       var l = a & 0x3ffffff;
      >       var h = b & 0x3ffffff;
      >       var m = l * h;
      >
      >       var rl = m & 0x3ffffff;
      >       var rh = (m / 0x4000000) | 0;
      >
      >       return rl | rh;
      >     }
      >
      >     mul(1, 2);
      >     var a0 = mul(0x3ffffff, 0x3ffffff);
      >     mul(0x0, 0x0);
      >     %OptimizeFunctionOnNextCall(mul);
      >     var a1 = mul(0x3ffffff, 0x3ffffff);
      >
      >     print(a0 + ' == ' + a1);
      >
      > BUG=
      > R=mstarzinger@chromium.org
      >
      > Committed: https://crrev.com/461e5b49d022335a7fc4e9d172397a4bd48b93d4
      > Cr-Commit-Position: refs/heads/master@{#31899}
      
      TBR=mstarzinger@chromium.org,danno@chromium.org,titzer@chromium.org,fedor@indutny.com
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=
      
      Review URL: https://codereview.chromium.org/1478923002
      
      Cr-Commit-Position: refs/heads/master@{#32313}
      5d18e93b
    • bmeurer's avatar
      Revert of [machine-operator-reducer] fix float truncation (patchset #8... · dc554059
      bmeurer authored
      Revert of [machine-operator-reducer] fix float truncation (patchset #8 id:140001 of https://codereview.chromium.org/1433353006/ )
      
      Reason for revert:
      This is also unsound for the reasons outlined in
      https://codereview.chromium.org/1473073004/
      Will reland the mjsunit test separately and help Fedor to implement a solution based on simplified operators.
      
      Original issue's description:
      > [machine-operator-reducer] fix float truncation
      >
      > Don't replace `TruncateFloat64ToInt32(RoundInt64ToFloat64(value))` with
      > `value`. Generally, `value` may have a range bigger than the one that
      > could fit into Int32. Replace it with `TruncateInt64ToInt32(value)`
      > instead, and only if the `value` fits into Float64 without precision
      > loss.
      >
      > Add missing mjsunit test for 52bit multiplication/division optimization
      > that has landed in refs/heads/master@{#31899}.
      >
      > BUG=
      > R=titzer@google.com
      >
      > Committed: https://crrev.com/64efa2a904773816968992628f0bf0f1b7ae82be
      > Cr-Commit-Position: refs/heads/master@{#32227}
      
      TBR=titzer@chromium.org,fedor@indutny.com
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=
      
      Review URL: https://codereview.chromium.org/1468313009
      
      Cr-Commit-Position: refs/heads/master@{#32312}
      dc554059
    • bmeurer's avatar
      Revert of [compiler] merge binary-operator-reducer (patchset #2 id:20001 of... · b0c179da
      bmeurer authored
      Revert of [compiler] merge binary-operator-reducer (patchset #2 id:20001 of https://codereview.chromium.org/1473073004/ )
      
      Reason for revert:
      Unsound use of types in the MachineOperatorReducer. Will work on a sound solution with Fedor.
      
      Original issue's description:
      > [compiler] merge binary-operator-reducer
      >
      > Merge BinaryOperatorReducer into the MachineOperatorReducer class.
      > It does not need `Revisit()` calls, because the newly inserted nodes are
      > visited anyway, and there are no other methods that need AdvancedReducer
      > there.
      >
      > BUG=
      > R=titzer@chromium.org
      >
      > Committed: https://crrev.com/993ba9d2529a6401b3040b9263f8d06db7dbb4f1
      > Cr-Commit-Position: refs/heads/master@{#32298}
      
      TBR=titzer@chromium.org,fedor@indutny.com
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=
      
      Review URL: https://codereview.chromium.org/1476763006
      
      Cr-Commit-Position: refs/heads/master@{#32310}
      b0c179da
  28. 25 Nov, 2015 1 commit
    • fedor's avatar
      [compiler] merge binary-operator-reducer · 993ba9d2
      fedor authored
      Merge BinaryOperatorReducer into the MachineOperatorReducer class.
      It does not need `Revisit()` calls, because the newly inserted nodes are
      visited anyway, and there are no other methods that need AdvancedReducer
      there.
      
      BUG=
      R=titzer@chromium.org
      
      Review URL: https://codereview.chromium.org/1473073004
      
      Cr-Commit-Position: refs/heads/master@{#32298}
      993ba9d2
  29. 24 Nov, 2015 1 commit
    • fedor's avatar
      [machine-operator-reducer] fix float truncation · 64efa2a9
      fedor authored
      Don't replace `TruncateFloat64ToInt32(RoundInt64ToFloat64(value))` with
      `value`. Generally, `value` may have a range bigger than the one that
      could fit into Int32. Replace it with `TruncateInt64ToInt32(value)`
      instead, and only if the `value` fits into Float64 without precision
      loss.
      
      Add missing mjsunit test for 52bit multiplication/division optimization
      that has landed in refs/heads/master@{#31899}.
      
      BUG=
      R=titzer@google.com
      
      Review URL: https://codereview.chromium.org/1433353006
      
      Cr-Commit-Position: refs/heads/master@{#32227}
      64efa2a9
  30. 09 Nov, 2015 1 commit
    • fedor's avatar
      binary-operator-reducer: reduce mul+div(shift) · 461e5b49
      fedor authored
      Reduction Input:
      
          ChangeInt32ToFloat64=>          TruncateFloat64ToInt32
                               Float64Mul=>
          ChangeInt32ToFloat64=>          Float64Div=>TruncateFloat64ToInt32
      
      Output:
      
               =>  TruncateInt64ToInt32
      Int64Mul
               =>  Int64Shr => TruncateInt64ToInt32
      
      Test code:
      
          function mul(a, b) {
            var l = a & 0x3ffffff;
            var h = b & 0x3ffffff;
            var m = l * h;
      
            var rl = m & 0x3ffffff;
            var rh = (m / 0x4000000) | 0;
      
            return rl | rh;
          }
      
          mul(1, 2);
          var a0 = mul(0x3ffffff, 0x3ffffff);
          mul(0x0, 0x0);
          %OptimizeFunctionOnNextCall(mul);
          var a1 = mul(0x3ffffff, 0x3ffffff);
      
          print(a0 + ' == ' + a1);
      
      BUG=
      R=mstarzinger@chromium.org
      
      Review URL: https://codereview.chromium.org/1350223006
      
      Cr-Commit-Position: refs/heads/master@{#31899}
      461e5b49
  31. 16 Oct, 2015 1 commit
    • mstarzinger's avatar
      [turbofan] Move SimplifiedOperatorBuilder into JSGraph. · b7990793
      mstarzinger authored
      This fixes the lifetime of nodes created by JSGlobalSpecialization that
      contain a simplified operator. In the case where this reducer runs as
      part of the inliner, the SimplifiedOperatorBuilder was instantiated with
      the wrong zone. This led to use-after-free of simplified operators.
      
      To avoid such situations in the future, we decided to move this operator
      builder into the JSGraph and make the situation uniform with all other
      operator builders.
      
      R=bmeurer@chromium.org
      BUG=chromium:543528
      LOG=n
      
      Review URL: https://codereview.chromium.org/1409993002
      
      Cr-Commit-Position: refs/heads/master@{#31334}
      b7990793
  32. 24 Sep, 2015 1 commit
  33. 15 Sep, 2015 1 commit