1. 29 Aug, 2016 6 commits
    • bmeurer's avatar
      [turbofan] Assign appropriate types to some Date builtins. · 529f4c87
      bmeurer authored
      Infer exact types for the various Date getter builtins, and also inline
      the Date.prototype.getTime() builtin, which just returns the Date value
      and thus doesn't need to check the cache stamp.
      
      R=epertoso@chromium.org
      
      Review-Url: https://codereview.chromium.org/2285213002
      Cr-Commit-Position: refs/heads/master@{#38973}
      529f4c87
    • 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
    • bmeurer's avatar
      [turbofan] Remove special JSForInStep and JSForInDone. · 1915762c
      bmeurer authored
      These JavaScript operators were special hacks to ensure that we always
      operate on Smis for the magic for-in index variable, but this never
      really worked in the OSR case, because the OsrValue for the index
      variable didn't have the proper information (that we have for the
      JSForInPrepare in the non-OSR case).
      
      Now that we have loop induction variable analysis and binary operation
      hints, we can just use JSLessThan and JSAdd instead with appropriate
      Smi hints, which handle the OSR case by inserting Smi checks (that are
      always true). Thanks to OSR deconstruction and loop peeling these Smi
      checks will be hoisted so they don't hurt the OSR case too much.
      
      Drive-by-change: Rename the ForInDone bytecode to ForInContinue, since
      we have to lower it to JSLessThan to get the loop induction variable
      goodness.
      
      R=epertoso@chromium.org
      BUG=v8:5267
      
      Review-Url: https://codereview.chromium.org/2289613002
      Cr-Commit-Position: refs/heads/master@{#38968}
      1915762c
    • bmeurer's avatar
      [turbofan] Nuke the funny typing rule for JSTypedArray constants. · ead8f658
      bmeurer authored
      R=jarin@chromium.org
      BUG=v8:5267
      
      Review-Url: https://codereview.chromium.org/2291433003
      Cr-Commit-Position: refs/heads/master@{#38966}
      ead8f658
    • bmeurer's avatar
      [turbofan] Remove typing rules for SIMD machine operators. · b54759aa
      bmeurer authored
      Typing these operators should never happen and doesn't make any sense
      at all.
      
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2286253002
      Cr-Commit-Position: refs/heads/master@{#38965}
      b54759aa
    • bmeurer's avatar
      [turbofan] Remove the unused asm.js types from TypeCache. · f5a37d13
      bmeurer authored
      For asm.js we now have a dedicated AsmTyper, that uses it's own type
      system (which is tailored towards asm.js), and so we don't need the
      special asm.js types anymore in the TypeCache. This also moves the
      TypeCache into the src/compiler directory, because it doesn't make
      sense to use outside anyways.
      
      TBR=ahaas@chromium.org
      R=jarin@chromium.org
      BUG=v8:5267
      
      Review-Url: https://codereview.chromium.org/2289573002
      Cr-Commit-Position: refs/heads/master@{#38964}
      f5a37d13
  2. 26 Aug, 2016 1 commit
  3. 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
  4. 22 Aug, 2016 2 commits
  5. 11 Aug, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Utilize type information for alias analysis. · c0439051
      bmeurer authored
      If the intersection of the types of nodes a and b is empty, then there's
      no way that a and b could ever refer to the same object, so we can use
      that information for alias analysis.
      
      Drive-by-fix: Improve use of types to enable typed alias analysis to
      become more effective. Also fix an ASAN issue uncovered by this CL.
      
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2237433003
      Cr-Commit-Position: refs/heads/master@{#38567}
      c0439051
  6. 10 Aug, 2016 2 commits
  7. 09 Aug, 2016 1 commit
  8. 08 Aug, 2016 3 commits
    • jarin's avatar
      [turbo] Also weaken induction variables in the typer. · 4f684882
      jarin authored
      Review-Url: https://codereview.chromium.org/2224943002
      Cr-Commit-Position: refs/heads/master@{#38440}
      4f684882
    • ahaas's avatar
      [turbofan] Remove the FloatXXSubPreserveNan operators. · f8938e50
      ahaas authored
      This CL changes the semantics of FloatXXSub to match the semantics of
      the semantics of FloatXXSubPreserveNan. Therefore there is no need
      anymore for the FloatXXSubPreserveNan operators.
      
      The optimizations in VisitFloatXXSub which are removed in this CL have
      already been moved to machine-operator-reducer.cc in
      https://codereview.chromium.org/2226663002
      
      R=bmeurer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2220973002
      Cr-Commit-Position: refs/heads/master@{#38437}
      f8938e50
    • bmeurer's avatar
      [turbofan] Add initial support for growing stores. · e6822a83
      bmeurer authored
      Introduce a dedicated MaybeGrowFastElements simplified operator, which
      tries to grow a fast elements backing store for a given element that
      should be added to an array/object. Use that to lower a growing keyed
      store to a sequence of
      
       1) check index is a valid array index,
       2) check stored value,
       3) maybe grow elements backing store (and deoptimize if it would
          normalize), and
       4) store the actual element.
      
      The actual growing is done by two dedicated GrowFastDoubleElements
      and GrowFastSmiOrObjectElements builtins, which are very similar to
      the GrowArrayElementsStub that is used by Crankshaft.
      
      Drive-by-fix: Turn CopyFixedArray into CopyFastSmiOrObjectElements
      builtin, similar to the new growing builtins, so we don't need to
      inline the store+write barrier for the elements into all optimized
      code objects anymore.
      
      Also fix a bug in the OperationTyper for NumberSilenceNaN, which was
      triggered by this change.
      
      BUG=v8:5272
      
      Review-Url: https://codereview.chromium.org/2227493002
      Cr-Commit-Position: refs/heads/master@{#38418}
      e6822a83
  9. 05 Aug, 2016 4 commits
  10. 03 Aug, 2016 1 commit
  11. 02 Aug, 2016 2 commits
  12. 29 Jul, 2016 3 commits
    • jyan's avatar
      [compiler] [wasm] Introduce Word32/64ReverseBytes as TF Optional Opcode · 77c9cb83
      jyan authored
      This commit fixes wasm little-endian load issue on big-endian platform
      by introducing reverse byte operation immediately after a load.
      
      R=bmeurer@chromium.org, titzer@chromium.org
      BUG=
      
      Review-Url: https://codereview.chromium.org/2045943002
      Cr-Commit-Position: refs/heads/master@{#38183}
      77c9cb83
    • epertoso's avatar
      [turbofan] Adds speculative opcodes for shift right. · 79ebd37d
      epertoso authored
      Drive-by fix: actually match the hint in the IsSpeculativeBinopMatcher.
      
      Review-Url: https://codereview.chromium.org/2191883002
      Cr-Commit-Position: refs/heads/master@{#38176}
      79ebd37d
    • bmeurer's avatar
      [turbofan] Introduce a dedicated CheckMaps simplified operator. · 8201579e
      bmeurer authored
      So far we always create explicit control flow for map checks during
      JSNativeContextSpecialization, or in the monomorphic case we used a
      CheckIf combined with a map comparison. In either case we cannot
      currently effectively utilize the map check information during load
      elimination to optimize (polymorphic) map checks and elements kind
      transitions.
      
      With the introduction of CheckMaps, we can now start optimizing map
      checks in a more effective fashion. This CL doesn't change anything
      in that direction yet, but merely changes the fundamental mechanism.
      
      This also removes the stable map optimization from the Typer, where
      it was always a bit odd, and puts it into the typed lowering and
      the native context specialization instead.
      
      R=epertoso@chromium.org
      BUG=v8:4930,v8:5141
      
      Review-Url: https://codereview.chromium.org/2196653002
      Cr-Commit-Position: refs/heads/master@{#38166}
      8201579e
  13. 27 Jul, 2016 3 commits
  14. 26 Jul, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Fix overly aggressive dead code elimination. · 32346aae
      bmeurer authored
      When we eliminate nodes during truncation analysis that have no value
      uses, we must make sure that we do not eliminate speculative number
      operations that would have side effects depending on the inputs, i.e.
      for example a SpeculativeNumberMultiply(x,y) does ToNumber(x) and
      ToNumber(y) first, so if either x or y could throw an exception during
      ToNumber conversion, we must not eliminate the multiplication, even if
      it has no value uses (some later pass may kill the actual machine
      multiplication, but the checks on the inputs have to remain still).
      So we check whether both x and y are PlainPrimitive, i.e. neither
      Receiver nor Symbol, which could raise exceptions for ToNumber, and
      only in that case we propagate the "unusedness" of the node to its
      inputs.
      
      This also uncovered a bug with the type of Dead, which must be None,
      as this represents an impossible value, so we had to fix that too.
      
      Also the dead code removal will not work correctly for constants (i.e.
      pure nodes with no value inputs), as those might be cached and hence
      we might resurrect them for an unrelated node lowering during
      SimplifiedLowering and only later kill the actual node (replacing its
      uses with Dead), which would then also replace the new use with Dead.
      So that was fixed as well. This shouldn't change anything for the
      result, as unused constants automagically disappear from the graph later
      on anyways.
      
      R=yangguo@chromium.org
      BUG=chromium:631318
      
      Review-Url: https://codereview.chromium.org/2182003002
      Cr-Commit-Position: refs/heads/master@{#38038}
      32346aae
  15. 25 Jul, 2016 1 commit
  16. 22 Jul, 2016 2 commits
    • ivica.bogosavljevic's avatar
      Implement UnaligedLoad and UnaligedStore turbofan operators. · 580fdf3c
      ivica.bogosavljevic authored
      Implement UnalignedLoad and UnalignedStore optional
      turbofan operators and use them in WasmCompiler for unaligned
      memory access.
      
      BUG=
      
      Review-Url: https://codereview.chromium.org/2122853002
      Cr-Commit-Position: refs/heads/master@{#37988}
      580fdf3c
    • bmeurer's avatar
      [turbofan] Change Float64Max/Float64Min to JavaScript semantics. · ba092fb0
      bmeurer authored
      So far we don't have a useful way to inline Math.max or Math.min in
      TurboFan optimized code. This adds new operators NumberMax and NumberMin
      and changes the Float64Max/Float64Min operators to have JavaScript
      semantics instead of the C++ semantics that it had previously.
      
      This also removes support for recognizing the tenary case in the
      CommonOperatorReducer, since that doesn't seem to have any positive
      impact (and actually doesn't show up in regular JavaScript, where
      people use Math.max/Math.min instead).
      
      Drive-by-fix: Also nuke the unused Float32Max/Float32Min operators.
      
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2170343002
      Cr-Commit-Position: refs/heads/master@{#37971}
      ba092fb0
  17. 21 Jul, 2016 1 commit
  18. 19 Jul, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Introduce a TransitionElementsKind simplified operator. · 908cd09f
      bmeurer authored
      Instead of wriring the elements kind transitions into the control flow
      early on, we do instead put this marker into the effect chain, so that
      the elements transitions are visible to the LoadElimination and can
      thus be optimized properly there.
      
      This CL itself doesn't add any of those optimizations, but just adds
      the foundations to make them possible later.
      
      R=jarin@chromium.org
      BUG=v8:4930,v8:5141
      
      Review-Url: https://codereview.chromium.org/2164573003
      Cr-Commit-Position: refs/heads/master@{#37869}
      908cd09f
  19. 14 Jul, 2016 2 commits
    • jarin's avatar
      [turbofan] Introduce explicit loop exits markers. · 7a61bbcf
      jarin authored
      This CL introduces explicit LoopExit control nodes at loop exits.
      We also attach explicit value renames (LoopExitMarker) and effect
      rename (LoopExitEffect) to each loop exit. This is in preparation
      to loop peeling, which will replace LoopExit, LoopExitMarker and
      LoopExitEffect with Merge, Phi and EffectPhi respectively.
      
      At the moment, we insert loop exit at every return, break,
      continue and locally caught throw. We do not yet handle
      uncaught throws (including error throws, such as ReferenceError).
      
      Review-Url: https://codereview.chromium.org/2140673007
      Cr-Commit-Position: refs/heads/master@{#37769}
      7a61bbcf
    • epertoso's avatar
      [turbofan] Introduces the SpeculativeNumberShiftLeft opcode. · d93fd41a
      epertoso authored
      Typed lowering now produces SpeculativeNumberShiftLeft for JSShiftLeft if the type feedback is kSignedSmall or kSigned32.
      
      BUG=v8:4583
      LOG=n
      
      Review-Url: https://codereview.chromium.org/2150553002
      Cr-Commit-Position: refs/heads/master@{#37762}
      d93fd41a