1. 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
  2. 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
  3. 23 Sep, 2015 3 commits
  4. 20 Jul, 2015 1 commit
    • danno's avatar
      [turbofan]: Add a context relaxation Reducer · cca5e74a
      danno authored
      In many cases, the context that TurboFan's ASTGraphBuilder or subsequent
      reduction operations attaches to nodes does not need to be that exact
      context, but rather only needs to be one with the same native context,
      because it is used internally only to fetch the native context, e.g. for
      creating and throwing exceptions.
      
      This reducer recognizes common cases where the context that is specified
      for a node can be relaxed to a canonical, less specific one. This
      relaxed context can either be the enclosing function's context or a specific
      Module or Script context that is explicitly created within the function.
      
      This optimization is especially important for TurboFan-generated code stubs
      which use context specialization and inlining to generate optimal code.
      Without context relaxation, many extraneous moves are generated to pass
      exactly the right context to internal functions like ToNumber and
      AllocateHeapNumber, which only need the native context. By turning context
      relaxation on, these moves disappear because all these common internal
      context uses are unified to the context passed into the stub function, which
      is typically already in the correct context register and remains there for
      short stubs. It also eliminates the explicit use of a specialized context
      constant in the code stub in these cases, which could cause memory leaks.
      
      Review URL: https://codereview.chromium.org/1244583003
      
      Cr-Commit-Position: refs/heads/master@{#29763}
      cca5e74a
  5. 23 Jun, 2015 1 commit
  6. 20 Apr, 2015 1 commit
  7. 19 Mar, 2015 1 commit
    • jarin's avatar
      [turbofan] Remember types for deoptimization during simplified lowering. · b7dc9c58
      jarin authored
      With this change, we remember the types of frame state inputs (in a new
      operator, called TypedStateValues). Instead of inferring the value types
      when building translations, we used the recorded types.
      
      The original approach was not reliable because the passes after
      simplified lowering can change node types, and this in turn confuses
      the translation builder.
      
      BUG=chromium:468727
      LOG=n
      R=bmeurer@chromium.org
      
      Review URL: https://codereview.chromium.org/1015423002
      
      Cr-Commit-Position: refs/heads/master@{#27310}
      b7dc9c58
  8. 17 Mar, 2015 1 commit
    • jarin's avatar
      [turbofan] Variable liveness analysis for deopt. · ca3abde2
      jarin authored
      This change introduces a liveness analyzer for local variables in frame states.
      
      The main idea is to use the AstGraphBuilder::Environment class to build the control flow graph, and record local variable loads, stores and checkpoints in the CFG basic blocks (LivenessAnalyzerBlock class).
      
      After the graph building finishes, we run a simple data flow analysis over the CFG to figure out liveness of each local variable at each checkpoint. Finally, we run a pass over all the checkpoints and replace dead local variables in the frame states with the 'undefined' value.
      
      Performance numbers for Embenchen are below.
      
      ----------- box2d.js
      Current --turbo-deoptimization: EmbenchenBox2d(RunTime): 11265 ms.
      d8-master --turbo-deoptimization: EmbenchenBox2d(RunTime): 11768 ms.
      d8-master: EmbenchenBox2d(RunTime): 10996 ms.
      ----------- bullet.js
      Current --turbo-deoptimization: EmbenchenBullet(RunTime): 17049 ms.
      d8-master --turbo-deoptimization: EmbenchenBullet(RunTime): 17384 ms.
      d8-master: EmbenchenBullet(RunTime): 16153 ms.
      ----------- copy.js
      Current --turbo-deoptimization: EmbenchenCopy(RunTime): 4877 ms.
      d8-master --turbo-deoptimization: EmbenchenCopy(RunTime): 4938 ms.
      d8-master: EmbenchenCopy(RunTime): 4940 ms.
      ----------- corrections.js
      Current --turbo-deoptimization: EmbenchenCorrections(RunTime): 7068 ms.
      d8-master --turbo-deoptimization: EmbenchenCorrections(RunTime): 6718 ms.
      d8-master: EmbenchenCorrections(RunTime): 6858 ms.
      ----------- fannkuch.js
      Current --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4167 ms.
      d8-master --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4608 ms.
      d8-master: EmbenchenFannkuch(RunTime): 4149 ms.
      ----------- fasta.js
      Current --turbo-deoptimization: EmbenchenFasta(RunTime): 9981 ms.
      d8-master --turbo-deoptimization: EmbenchenFasta(RunTime): 9848 ms.
      d8-master: EmbenchenFasta(RunTime): 9640 ms.
      ----------- lua_binarytrees.js
      Current --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 11571 ms.
      d8-master --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 13089 ms.
      d8-master: EmbenchenLuaBinaryTrees(RunTime): 10957 ms.
      ----------- memops.js
      Current --turbo-deoptimization: EmbenchenMemOps(RunTime): 7766 ms.
      d8-master --turbo-deoptimization: EmbenchenMemOps(RunTime): 7346 ms.
      d8-master: EmbenchenMemOps(RunTime): 7738 ms.
      ----------- primes.js
      Current --turbo-deoptimization: EmbenchenPrimes(RunTime): 7459 ms.
      d8-master --turbo-deoptimization: EmbenchenPrimes(RunTime): 7453 ms.
      d8-master: EmbenchenPrimes(RunTime): 7451 ms.
      ----------- skinning.js
      Current --turbo-deoptimization: EmbenchenSkinning(RunTime): 15564 ms.
      d8-master --turbo-deoptimization: EmbenchenSkinning(RunTime): 15611 ms.
      d8-master: EmbenchenSkinning(RunTime): 15583 ms.
      ----------- zlib.js
      Current --turbo-deoptimization: EmbenchenZLib(RunTime): 10825 ms.
      d8-master --turbo-deoptimization: EmbenchenZLib(RunTime): 11180 ms.
      d8-master: EmbenchenZLib(RunTime): 10823 ms.
      
      BUG=
      
      Review URL: https://codereview.chromium.org/949743002
      
      Cr-Commit-Position: refs/heads/master@{#27232}
      ca3abde2