1. 23 Nov, 2016 1 commit
  2. 22 Nov, 2016 1 commit
    • tebbi's avatar
      [cpu-profiler] use new source position information for deoptimization in cpu profiler · 1b320d20
      tebbi authored
      The new SourcePosition class allows for precise tracking of source positions including the stack of inlinings. This CL makes the cpu profiler use this new information. Before, the cpu profiler used the deoptimization data to reconstruct the inlining stack. However, optimizing compilers (especially Turbofan) can hoist out checks such that the inlining stack of the deopt reason and the inlining stack of the position the deoptimizer jumps to can be different (the old cpu profiler tests and the ones introduced in this cl produce such situations for turbofan). In this case, relying on the deoptimization info produces paradoxical results, where the reported position is before the function responsible is called. Even worse, https://codereview.chromium.org/2451853002/ combines the precise position with the wrong inlining stack from the deopt info, leading to completely wrong results.
      
      Other changes in this CL:
      - DeoptInlinedFrame is no longer needed, because we can compute the correct inlining stack up front.
      - I changed the cpu profiler tests back to test situations where deopt checks are hoisted out in Turbofan and made them robust enough to handle the differences between Crankshaft and Turbofan.
      - I reversed the order of SourcePosition::InliningStack to make it match the cpu profiler convention.
      - I removed CodeDeoptEvent::position, as it is no longer used.
      
      R=alph@chromium.org
      
      BUG=v8:5432
      
      Review-Url: https://codereview.chromium.org/2503393002
      Cr-Commit-Position: refs/heads/master@{#41168}
      1b320d20
  3. 14 Nov, 2016 1 commit
    • tebbi's avatar
      This CL enables precise source positions for all V8 compilers. It merges... · c3a6ca68
      tebbi authored
      This CL enables precise source positions for all V8 compilers. It merges compiler::SourcePosition and internal::SourcePosition to a single class used throughout the codebase. The new internal::SourcePosition instances store an id identifying an inlined function in addition to a script offset.
      SourcePosition::InliningId() refers to a the new table DeoptimizationInputData::InliningPositions(), which provides the following data for every inlining id:
       - The inlined SharedFunctionInfo as an offset into DeoptimizationInfo::LiteralArray
       - The SourcePosition of the inlining. Recursively, this yields the full inlining stack.
      Before the Code object is created, the same information can be found in CompilationInfo::inlined_functions().
      
      If SourcePosition::InliningId() is SourcePosition::kNotInlined, it refers to the outer (non-inlined) function.
      So every SourcePosition has full information about its inlining stack, as long as the corresponding Code object is known. The internal represenation of a source position is a positive 64bit integer.
      
      All compilers create now appropriate source positions for inlined functions. In the case of Turbofan, this required using AstGraphBuilderWithPositions for inlined functions too. So this class is now moved to a header file.
      
      At the moment, the additional information in source positions is only used in --trace-deopt and --code-comments. The profiler needs to be updated, at the moment it gets the correct script offsets from the deopt info, but the wrong script id from the reconstructed deopt stack, which can lead to wrong outputs. This should be resolved by making the profiler use the new inlining information for deopts.
      
      I activated the inlined deoptimization tests in test-cpu-profiler.cc for Turbofan, changing them to a case where the deopt stack and the inlining position agree. It is currently still broken for other cases.
      
      The following additional changes were necessary:
       - The source position table (internal::SourcePositionTableBuilder etc.) supports now 64bit source positions. Encoding source positions in a single 64bit int together with the difference encoding in the source position table results in very little overhead for the inlining id, since only 12% of the source positions in Octane have a changed inlining id.
       - The class HPositionInfo was effectively dead code and is now removed.
       - SourcePosition has new printing and information facilities, including computing a full inlining stack.
       - I had to rename compiler/source-position.{h,cc} to compiler/compiler-source-position-table.{h,cc} to avoid clashes with the new src/source-position.cc file.
       - I wrote the new wrapper PodArray for ByteArray. It is a template working with any POD-type. This is used in DeoptimizationInputData::InliningPositions().
       - I removed HInlinedFunctionInfo and HGraph::inlined_function_infos, because they were only used for the now obsolete Crankshaft inlining ids.
       - Crankshaft managed a list of inlined functions in Lithium: LChunk::inlined_functions. This is an analog structure to CompilationInfo::inlined_functions. So I removed LChunk::inlined_functions and made Crankshaft use CompilationInfo::inlined_functions instead, because this was necessary to register the offsets into the literal array in a uniform way. This is a safe change because LChunk::inlined_functions has no other uses and the functions in CompilationInfo::inlined_functions have a strictly longer lifespan, being created earlier (in Hydrogen already).
      
      BUG=v8:5432
      
      Review-Url: https://codereview.chromium.org/2451853002
      Cr-Commit-Position: refs/heads/master@{#40975}
      c3a6ca68
  4. 28 Oct, 2016 1 commit
  5. 10 Oct, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Enforce native context specialization. · f6bd23f2
      bmeurer authored
      There were once plans to generate cross-context code with TurboFan,
      however that doesn't fit into the model anymore, and so all of this
      is essentially dead untested code (and thus most likely already broken
      in subtle ways). With this mode still in place it would also be a lot
      harder to make inlining based on SharedFunctionInfo work.
      
      BUG=v8:2206,v8:5499
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2406803002
      Cr-Commit-Position: refs/heads/master@{#40109}
      f6bd23f2
  6. 07 Oct, 2016 1 commit
  7. 30 Sep, 2016 1 commit
  8. 07 Sep, 2016 1 commit
  9. 31 Aug, 2016 1 commit
  10. 26 Aug, 2016 2 commits
  11. 25 Aug, 2016 1 commit
    • rmcilroy's avatar
      [Compiler] Add compile operations to CompilerDispatcherJob. · c2d2d4d1
      rmcilroy authored
      Adds compile operations to the CompilerDispatcherJob interface. As such,
      introduces Compiler::PrepareUnoptimizedCompilationJob and updates the
      unoptimized compilation path to use CompilationJobs. Also unifies
      FinalizeCompilationJob to deal with both optimized and unoptimized
      compilation jobs.
      
      A dummy FullCodegenCompilationJob is also introduced, where all the work
      is done in the ExecuteJob phase, which cannot be run on a
      background thread.
      
      BUG=v8:5203
      
      Review-Url: https://codereview.chromium.org/2251713002
      Cr-Commit-Position: refs/heads/master@{#38897}
      c2d2d4d1
  12. 22 Aug, 2016 1 commit
  13. 18 Aug, 2016 3 commits
  14. 16 Aug, 2016 4 commits
    • rmcilroy's avatar
      Revert of [Interpreter] Introduce InterpreterCompilationJob (patchset #7... · de2f16d3
      rmcilroy authored
      Revert of [Interpreter] Introduce InterpreterCompilationJob (patchset #7 id:140001 of https://codereview.chromium.org/2240463002/ )
      
      Reason for revert:
      Breaks Win64 bot
      
      Original issue's description:
      > [Interpreter] Introduce InterpreterCompilationJob
      >
      > Adds InterpreterCompilationJob as a sub-class of
      > CompilationJob, to enable off-thread bytecode
      > generation. Currently only used in
      > Interpreter::MakeBytecode.
      >
      > As part of this change, CompilationJob is modified
      > to make it less specific to optimized compilation,
      > renaming the phases as follows:
      >  - CreateGraph -> PrepareJob
      >  - OptimizeGraph -> ExecuteJob
      >  - GenerateCode -> FinalizeJob
      >
      > RegisterWeakObjectsInOptimizedCode is also moved out
      > of CompilationJob and instead becomes a static function
      > on Compiler.
      >
      > BUG=v8:5203
      >
      > Committed: https://crrev.com/1fb6a7e697e8bc5b4af51647553741f966e00cdc
      > Committed: https://crrev.com/785990e9fc0dd9a9d963d25d0bed2909165e4ca9
      > Cr-Original-Commit-Position: refs/heads/master@{#38662}
      > Cr-Commit-Position: refs/heads/master@{#38668}
      
      TBR=mstarzinger@chromium.org,jkummerow@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:5203
      
      Review-Url: https://codereview.chromium.org/2251673003
      Cr-Commit-Position: refs/heads/master@{#38669}
      de2f16d3
    • rmcilroy's avatar
      [Interpreter] Introduce InterpreterCompilationJob · 785990e9
      rmcilroy authored
      Adds InterpreterCompilationJob as a sub-class of
      CompilationJob, to enable off-thread bytecode
      generation. Currently only used in
      Interpreter::MakeBytecode.
      
      As part of this change, CompilationJob is modified
      to make it less specific to optimized compilation,
      renaming the phases as follows:
       - CreateGraph -> PrepareJob
       - OptimizeGraph -> ExecuteJob
       - GenerateCode -> FinalizeJob
      
      RegisterWeakObjectsInOptimizedCode is also moved out
      of CompilationJob and instead becomes a static function
      on Compiler.
      
      BUG=v8:5203
      
      Committed: https://crrev.com/1fb6a7e697e8bc5b4af51647553741f966e00cdc
      Review-Url: https://codereview.chromium.org/2240463002
      Cr-Original-Commit-Position: refs/heads/master@{#38662}
      Cr-Commit-Position: refs/heads/master@{#38668}
      785990e9
    • rmcilroy's avatar
      Revert of [Interpreter] Introduce InterpreterCompilationJob (patchset #7... · ce65e105
      rmcilroy authored
      Revert of [Interpreter] Introduce InterpreterCompilationJob (patchset #7 id:140001 of https://codereview.chromium.org/2240463002/ )
      
      Reason for revert:
      Failing on Win64 bot:
      https://build.chromium.org/p/client.v8/builders/V8%20Win64/builds/12061/steps/Check/logs/regress-635429
      
      Original issue's description:
      > [Interpreter] Introduce InterpreterCompilationJob
      >
      > Adds InterpreterCompilationJob as a sub-class of
      > CompilationJob, to enable off-thread bytecode
      > generation. Currently only used in
      > Interpreter::MakeBytecode.
      >
      > As part of this change, CompilationJob is modified
      > to make it less specific to optimized compilation,
      > renaming the phases as follows:
      >  - CreateGraph -> PrepareJob
      >  - OptimizeGraph -> ExecuteJob
      >  - GenerateCode -> FinalizeJob
      >
      > RegisterWeakObjectsInOptimizedCode is also moved out
      > of CompilationJob and instead becomes a static function
      > on Compiler.
      >
      > BUG=v8:5203
      >
      > Committed: https://crrev.com/1fb6a7e697e8bc5b4af51647553741f966e00cdc
      > Cr-Commit-Position: refs/heads/master@{#38662}
      
      TBR=mstarzinger@chromium.org,jkummerow@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:5203
      
      Review-Url: https://codereview.chromium.org/2249153002
      Cr-Commit-Position: refs/heads/master@{#38663}
      ce65e105
    • rmcilroy's avatar
      [Interpreter] Introduce InterpreterCompilationJob · 1fb6a7e6
      rmcilroy authored
      Adds InterpreterCompilationJob as a sub-class of
      CompilationJob, to enable off-thread bytecode
      generation. Currently only used in
      Interpreter::MakeBytecode.
      
      As part of this change, CompilationJob is modified
      to make it less specific to optimized compilation,
      renaming the phases as follows:
       - CreateGraph -> PrepareJob
       - OptimizeGraph -> ExecuteJob
       - GenerateCode -> FinalizeJob
      
      RegisterWeakObjectsInOptimizedCode is also moved out
      of CompilationJob and instead becomes a static function
      on Compiler.
      
      BUG=v8:5203
      
      Review-Url: https://codereview.chromium.org/2240463002
      Cr-Commit-Position: refs/heads/master@{#38662}
      1fb6a7e6
  15. 05 Aug, 2016 3 commits
  16. 01 Aug, 2016 1 commit
    • bmeurer's avatar
      [turbofan] Add support for accessor inlining. · 35a195e1
      bmeurer authored
      Allow inlining of getters and setters into TurboFan optimized code.
      This just adds the basic machinery required to essentially inline
      the setter and getter dispatch code for the (keyed) load/store ICs.
      There'll be follow up CLs to also actually inline some of the interesting
      accessor functions itself, like the byteLength and friends for the
      TypedArrays.
      
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/2198473002
      Cr-Commit-Position: refs/heads/master@{#38192}
      35a195e1
  17. 25 Jul, 2016 2 commits
  18. 21 Jul, 2016 2 commits
  19. 20 Jul, 2016 1 commit
  20. 14 Jul, 2016 1 commit
    • mstarzinger's avatar
      [turbofan] Remove fallback to TurboFan when Crankshaft bails out. · 8bad9474
      mstarzinger authored
      This removes the fallback path in question. Now the {AstNumbering} phase
      is the only phase deciding whether Crankshaft is supposed to be disabled
      or not. This in turn simplifies reasoning about the paths through the
      compilation pipeline. We can decide early whether we want Ignition to
      kick in depending on whether Crankshaft is enabled or not.
      
      R=mvstanton@chromium.org,rmcilroy@chromium.org
      
      Review-Url: https://codereview.chromium.org/2146573004
      Cr-Commit-Position: refs/heads/master@{#37763}
      8bad9474
  21. 13 Jul, 2016 1 commit
  22. 08 Jul, 2016 1 commit
  23. 02 Jun, 2016 1 commit
    • jarin's avatar
      [turbofan] Initial version of number type feedback. · 216bcf9f
      jarin authored
      This introduces optimized number operations based on type feedback.
      
      Summary of changes:
      
      1. Typed lowering produces SpeculativeNumberAdd/Subtract for JSAdd/Subtract if
         there is suitable feedback. The speculative nodes are connected to both the
         effect chain and the control chain and they retain the eager frame state.
      
      2. Simplified lowering now executes in three phases:
        a. Propagation phase computes truncations by traversing the graph from uses to
           definitions until checkpoint is reached. It also records type-check decisions
           for later typing phase, and computes representation.
        b. The typing phase computes more precise types base on the speculative types (and recomputes
           representation for affected nodes).
        c. The lowering phase performs lowering and inserts representation changes and/or checks.
      
      3. Effect-control linearization lowers the checks to machine graphs.
      
      Notes:
      
      - SimplifiedLowering will be refactored to have handling of each operation one place and
        with clearer input/output protocol for each sub-phase. I would prefer to do this once
        we have more operations implemented, and the pattern is clearer.
      
      - The check operations (Checked<A>To<B>) should have some flags that would affect
        the kind of truncations that they can handle. E.g., if we know that a node produces
        a number, we can omit the oddball check in the CheckedTaggedToFloat64 lowering.
      
      - In future, we want the typer to reuse the logic from OperationTyper.
      
      BUG=v8:4583
      LOG=n
      
      Review-Url: https://codereview.chromium.org/1921563002
      Cr-Commit-Position: refs/heads/master@{#36674}
      216bcf9f
  24. 18 May, 2016 1 commit
  25. 13 May, 2016 2 commits
  26. 11 May, 2016 1 commit
    • mstarzinger's avatar
      [compiler] Pass inlining_id via relocation info. · 32049620
      mstarzinger authored
      This passes the inlining_id of deoptimization points via the relocation
      info instead of via a side-channel to the CPU profiler. This is one step
      towards deprecating the side-channel in question and avoid the need for
      performing a lookup of the return address of the deopt point.
      
      R=jarin@chromium.org
      
      Review-Url: https://codereview.chromium.org/1956693002
      Cr-Commit-Position: refs/heads/master@{#36177}
      32049620
  27. 10 May, 2016 1 commit
  28. 06 May, 2016 1 commit
    • mstarzinger's avatar
      [compiler] Move inline function tracing to Crankshaft. · 69963b4c
      mstarzinger authored
      This moves all the machinery for tracing inlined function that is
      specific to Crankshaft into the appropriate component. Only the old
      side-channel via a list of InlinedFunctionInfo structs remained within
      the CompilationInfo for now. In the long run we will reconstruct that
      information from the deoptimization data on the code objects.
      
      R=bmeurer@chromium.org
      
      Review-Url: https://codereview.chromium.org/1944323002
      Cr-Commit-Position: refs/heads/master@{#36068}
      69963b4c
  29. 04 May, 2016 1 commit