1. 21 Dec, 2016 1 commit
    • caitp's avatar
      [cctest] print name instead of context index for CallJSRuntime · 3d6a477b
      caitp authored
      Change bytecode-expectations-printer.cc in the cctest application so
      that intrinsic function names are printed rather than their native
      context index.
      
      This minimizes the amount of unnecessary changes to the bytecode
      expectations that need to happen whenever the context fields are
      changed.
      
      BUG=v8:5769
      R=neis@chromium.org, rmcilroy@chromium.org, adamk@chromium.org
      
      Review-Url: https://codereview.chromium.org/2593823002
      Cr-Commit-Position: refs/heads/master@{#41900}
      3d6a477b
  2. 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
  3. 17 Oct, 2016 1 commit
  4. 04 Oct, 2016 2 commits
  5. 13 Sep, 2016 1 commit
  6. 06 Sep, 2016 1 commit
    • leszeks's avatar
      [Interpreter] Remove constant pool type in tests · b28b7e13
      leszeks authored
      For historical reasons, the interpreter's bytecode expectations tests
      required a type for the constant pool. This had two disadvantages:
      
       1. Strings and numbers were not visible in mixed pools, and
       2. Mismatches of pool types (e.g. when rebaselining) would cause parser
          errors
      
      This removes the pool types, making everything 'mixed', but appending
      the values to string and number valued constants. Specifying a pool type
      in the *.golden header now prints a warning (for backwards compatibility).
      
      BUG=v8:5350
      
      Review-Url: https://codereview.chromium.org/2310103002
      Cr-Commit-Position: refs/heads/master@{#39216}
      b28b7e13
  7. 31 Aug, 2016 1 commit
  8. 25 Jul, 2016 1 commit
  9. 28 Jun, 2016 1 commit
  10. 21 Jun, 2016 3 commits
  11. 11 May, 2016 1 commit
  12. 21 Mar, 2016 1 commit
    • oth's avatar
      [interpreter] Add support for scalable operands. · 48d082af
      oth authored
      This change introduces wide prefix bytecodes to support wide (16-bit)
      and extra-wide (32-bit) operands. It retires the previous
      wide-bytecodes and reduces the number of operand types.
      
      Operands are now either scalable or fixed size. Scalable operands
      increase in width when a bytecode is prefixed with wide or extra-wide.
      
      The bytecode handler table is extended to 256*3 entries. The
      first 256 entries are used for bytecodes with 8-bit operands,
      the second 256 entries are used for bytecodes with operands that
      scale to 16-bits, and the third group of 256 entries are used for
      bytecodes with operands that scale to 32-bits.
      
      LOG=N
      BUG=v8:4747,v8:4280
      
      Review URL: https://codereview.chromium.org/1783483002
      
      Cr-Commit-Position: refs/heads/master@{#34955}
      48d082af
  13. 25 Feb, 2016 1 commit
    • ssanfilippo's avatar
      [Interpreter] Refactor bytecode generator test suite. · 6ae03059
      ssanfilippo authored
      Bytecode expectations have been moved to external (.golden) files,
      one per test. Each test in the suite builds a representation of the
      the compiled bytecode using BytecodeExpectationsPrinter. The output is
      then compared to the golden file. If the comparision fails, a textual
      diff can be used to identify the discrepancies.
      
      Only the test snippets are left in the cc file, which also allows to
      make it more compact and meaningful. Leaving the snippets in the cc
      file was a deliberate choice to allow keeping the "truth" about the
      tests in the cc file, which will rarely change, as opposed to golden
      files.
      
      Golden files can be generated and kept up to date using
      generate-bytecode-expectations, which also means that the test suite
      can be batch updated whenever the bytecode or golden format changes.
      
      The golden format has been slightly amended (no more comments about
      `void*`, add size of the bytecode array) following the consideration
      made while converting the tests.
      
      There is also a fix: BytecodeExpectationsPrinter::top_level_ was left
      uninitialized, leading to undefined behaviour.
      
      BUG=v8:4280
      LOG=N
      
      Review URL: https://codereview.chromium.org/1717293002
      
      Cr-Commit-Position: refs/heads/master@{#34285}
      6ae03059
  14. 23 Feb, 2016 1 commit
    • ssanfilippo's avatar
      [Interpreter] Readable representation of runtime function IDs. · bb2f6846
      ssanfilippo authored
      The first operand to the CallRuntime class of bytecodes is the
      ID of the runtime function being called. Before this commit
      the ID was printed as plain uint16_t, now we get something like:
      
        B(CallRuntime) U16(Runtime::Add) ...
      
      This change is intended to make both the golden files more
      resistant to modifications of the i::Runtime::FunctionId enum
      and the output of generate-bytecode-expectations more readable.
      
      BUG=v8:4280
      LOG=N
      
      Review URL: https://codereview.chromium.org/1723223002
      
      Cr-Commit-Position: refs/heads/master@{#34224}
      bb2f6846
  15. 19 Feb, 2016 1 commit
    • ssanfilippo's avatar
      [Interpreter] generate-bytecode-expectations improvements. · d2187182
      ssanfilippo authored
      A few options and features have been added to the tool:
      
      * an output file might be specified using --output=file.name
      * a shortcut when the output file is also the input, which is handy
         when fixing golden files, --rebaseline.
      * the input snippet might be optionally not wrapped in a top function,
         or not executed after compilation (--no-wrap and --no-execute).
      * the name of the wrapper can be configured using --wrapper-name=foo
      
      The same options can be configured via setters on the usual
      BytecodeExpectationsPrinter.
      
      The output file now includes all the relevant flags to reproduce it
      when running again through the tool (usually with --rebaseline).
      
      In particular, when running in --rebaseline mode, options from the
      file header will override options specified in the command line.
      
      A couple of other fixes and improvements:
      
      * description of the handlers is now emitted (closing the TODO).
      * the snippet is now correctly unquoted when double quotes are used.
      * special registers (closure, context etc.) are now emitted as such,
         instead of displaying their numeric value.
      * the tool can now process top level code as well.
      
      BUG=v8:4280
      LOG=N
      
      Review URL: https://codereview.chromium.org/1698403002
      
      Cr-Commit-Position: refs/heads/master@{#34152}
      d2187182
  16. 15 Feb, 2016 1 commit
    • ssanfilippo's avatar
      [Interpreter] Change the output format of generate-bytecode-expectations. · e082ebdb
      ssanfilippo authored
      Now the tool produces a far more readable output format, which bears a
      lot of resemblance to YAML. In fact, the output should be machine
      parseable as such, one document per testcase. However, the output format
      may be subject to changes in future, so don't rely on this property.
      
      In general, the output format has been optimized for producing a meaningful
      textual diff, while keeping a decent readability as well. Therefore, not
      everything is as compact as it could be, e.g. for an empty const pool we get:
      
          constant pool: [
          ]
      
      instead of:
      
          constant pool: []
      
      Also, trailing commas are always inserted in lists.
      
      Additionally, now the tool accepts its output format as input. When
      operating in this mode, all the snippets are extracted, processed and
      the output is then emitted as usual. If nothing has changed, the output
      should match the input. This is very useful for catching bugs in the
      bytecode generation by running a textual diff against a known-good file.
      
      The core (namely bytecode-expectations.cc) has been extracted from the
      original cc file, which provides the utility as usual. The definitions
      in the matching header of the library have been moved into the
      v8::internal::interpreter namespace.
      
      The library exposes a class ExpectationPrinter, with a method
      PrintExpectation, which takes a test snippet as input, and writes the
      formatted expectation to the supplied stream. One might then use a
      std::stringstream to retrieve the results as a string and run it through
      a diff utility.
      
      BUG=v8:4280
      LOG=N
      
      Review URL: https://codereview.chromium.org/1688383003
      
      Cr-Commit-Position: refs/heads/master@{#33997}
      e082ebdb