1. 05 Oct, 2016 2 commits
  2. 03 Oct, 2016 1 commit
    • leszeks's avatar
      [base] Optimise hashmaps with simple key equality · 306f8311
      leszeks authored
      Hashmaps with a simple key equality method (comparing pointers) don't
      need to waste cycles (and branches) comparing hash values, as the key
      comparison is cheap.
      
      This patch modifies the hashmap's MatchFun to take the hashes as well as
      the keys, thus allowing the MatchFun to ignore the hashes. This allows
      slightly cleaner generated code, especially when the MatchFun is
      inlined.
      
      BUG=
      
      Review-Url: https://codereview.chromium.org/2381303002
      Cr-Commit-Position: refs/heads/master@{#39932}
      306f8311
  3. 30 Sep, 2016 4 commits
    • leszeks's avatar
      Instead of having a hashmap with a function pointer defining its · 050bf39d
      leszeks authored
      matching function, creates a hashmap the specialises the case of keys
      that simply check pointer equality.
      
      I measure an average ~1% improvement on Octane code-load.
      
      Review-Url: https://codereview.chromium.org/2369963002
      Cr-Commit-Position: refs/heads/master@{#39920}
      050bf39d
    • rmcilroy's avatar
      [Interpreter] Replace BytecodeRegisterAllocator with a simple bump pointer. · 27fe988b
      rmcilroy authored
      There are only a few occasions where we allocate a register in an outer
      expression allocation scope, which makes the costly free-list approach
      of the BytecodeRegisterAllocator unecessary. This CL replaces all
      occurrences with moves to the accumulator and stores to a register
      allocated in the correct scope. By doing this, we can simplify the
      BytecodeRegisterAllocator to be a simple bump-pointer allocator
      with registers released in the same order as allocated.
      
      The following changes are also made:
       - Make BytecodeRegisterOptimizer able to use registers which have been
         unallocated, but not yet reused
       - Remove RegisterExpressionResultScope and rename
         AccumulatorExpressionResultScope to ValueExpressionResultScope
       - Introduce RegisterList to represent consecutive register
         allocations, and use this for operands to call bytecodes.
      
      By avoiding the free-list handling, this gives another couple of
      percent on CodeLoad.
      
      BUG=v8:4280
      
      Review-Url: https://codereview.chromium.org/2369873002
      Cr-Commit-Position: refs/heads/master@{#39905}
      27fe988b
    • neis's avatar
      Reland: [modules] Properly initialize declared variables. · 42724232
      neis authored
      Before evaluating a module, all variables declared at the top-level
      in _any_ of the modules in the dependency graph must be initialized.
      This is observable because a module A can access a variable imported
      from module B (e.g. a function) at a point when module B's body hasn't
      been evaluated yet.
      
      We achieve this by implementing modules internally as generators with
      two states (not initialized, initialized).
      
      R=adamk@chromium.org
      BUG=v8:1569
      CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_win_dbg
      
      Committed: https://crrev.com/f4dfb6fbe1cdd9a0f287a1a9c496e1f69f6f5d20
      Committed: https://crrev.com/8c52a411583e870bd5ed100864caa58f491c5d88
      Review-Url: https://codereview.chromium.org/2375793002
      Cr-Original-Original-Commit-Position: refs/heads/master@{#39871}
      Cr-Original-Commit-Position: refs/heads/master@{#39892}
      Cr-Commit-Position: refs/heads/master@{#39900}
      42724232
    • bmeurer's avatar
      Revert of Reland: [modules] Properly initialize declared variables. (patchset... · 669cb71e
      bmeurer authored
      Revert of Reland: [modules] Properly initialize declared variables. (patchset #6 id:100001 of https://codereview.chromium.org/2375793002/ )
      
      Reason for revert:
      Speculative revert for christmas tree
      
      Original issue's description:
      > Reland: [modules] Properly initialize declared variables.
      >
      > Before evaluating a module, all variables declared at the top-level
      > in _any_ of the modules in the dependency graph must be initialized.
      > This is observable because a module A can access a variable imported
      > from module B (e.g. a function) at a point when module B's body hasn't
      > been evaluated yet.
      >
      > We achieve this by implementing modules internally as generators with
      > two states (not initialized, initialized).
      >
      > R=adamk@chromium.org
      > BUG=v8:1569
      > CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_win_dbg
      >
      > Committed: https://crrev.com/f4dfb6fbe1cdd9a0f287a1a9c496e1f69f6f5d20
      > Committed: https://crrev.com/8c52a411583e870bd5ed100864caa58f491c5d88
      > Cr-Original-Commit-Position: refs/heads/master@{#39871}
      > Cr-Commit-Position: refs/heads/master@{#39892}
      
      TBR=adamk@chromium.org,mstarzinger@chromium.org,machenbach@chromium.org,neis@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2387593002
      Cr-Commit-Position: refs/heads/master@{#39896}
      669cb71e
  4. 29 Sep, 2016 4 commits
    • neis's avatar
      Reland: [modules] Properly initialize declared variables. · 8c52a411
      neis authored
      Before evaluating a module, all variables declared at the top-level
      in _any_ of the modules in the dependency graph must be initialized.
      This is observable because a module A can access a variable imported
      from module B (e.g. a function) at a point when module B's body hasn't
      been evaluated yet.
      
      We achieve this by implementing modules internally as generators with
      two states (not initialized, initialized).
      
      R=adamk@chromium.org
      BUG=v8:1569
      CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_win_dbg
      
      Committed: https://crrev.com/f4dfb6fbe1cdd9a0f287a1a9c496e1f69f6f5d20
      Review-Url: https://codereview.chromium.org/2375793002
      Cr-Original-Commit-Position: refs/heads/master@{#39871}
      Cr-Commit-Position: refs/heads/master@{#39892}
      8c52a411
    • leszeks's avatar
      [interpreter] Use hashmap for ConstantArrayBuilder's constant map · 0134ddae
      leszeks authored
      Uses the base hashmap to store the ConstantArrayBuilder's constant map,
      which slightly improves the performance of ConstantArrayBuilder::Insert.
      
      Includes a small overload of the hashmap LookupOrInsert method, which
      allows passing in a value creation function instead of just default
      initialising new values.
      
      On Octane's codeload, this gives (on my machine) a 0.27% improvement,
      which doesn't sound like a lot but I guess every little helps.
      
      Review-Url: https://codereview.chromium.org/2336553002
      Cr-Commit-Position: refs/heads/master@{#39883}
      0134ddae
    • machenbach's avatar
      Revert of [modules] Properly initialize declared variables. (patchset #5... · 7496c9de
      machenbach authored
      Revert of [modules] Properly initialize declared variables. (patchset #5 id:80001 of https://codereview.chromium.org/2375793002/ )
      
      Reason for revert:
      Suspect for causing win64 debug problems:
      https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/12646
      
      Original issue's description:
      > [modules] Properly initialize declared variables.
      >
      > Before evaluating a module, all variables declared at the top-level
      > in _any_ of the modules in the dependency graph must be initialized.
      > This is observable because a module A can access a variable imported
      > from module B (e.g. a function) at a point when module B's body hasn't
      > been evaluated yet.
      >
      > We achieve this by implementing modules internally as generators with
      > two states (not initialized, initialized).
      >
      > R=adamk@chromium.org
      > BUG=v8:1569
      >
      > Committed: https://crrev.com/f4dfb6fbe1cdd9a0f287a1a9c496e1f69f6f5d20
      > Cr-Commit-Position: refs/heads/master@{#39871}
      
      TBR=adamk@chromium.org,mstarzinger@chromium.org,neis@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2379063002
      Cr-Commit-Position: refs/heads/master@{#39873}
      7496c9de
    • neis's avatar
      [modules] Properly initialize declared variables. · f4dfb6fb
      neis authored
      Before evaluating a module, all variables declared at the top-level
      in _any_ of the modules in the dependency graph must be initialized.
      This is observable because a module A can access a variable imported
      from module B (e.g. a function) at a point when module B's body hasn't
      been evaluated yet.
      
      We achieve this by implementing modules internally as generators with
      two states (not initialized, initialized).
      
      R=adamk@chromium.org
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2375793002
      Cr-Commit-Position: refs/heads/master@{#39871}
      f4dfb6fb
  5. 26 Sep, 2016 2 commits
    • bmeurer's avatar
      Revert of [compiler] Properly guard the speculative optimizations for... · b9cdb630
      bmeurer authored
      Revert of [compiler] Properly guard the speculative optimizations for instanceof. (patchset #3 id:40001 of https://codereview.chromium.org/2370693002/ )
      
      Reason for revert:
      Tanks EarleyBoyer.
      
      Original issue's description:
      > [compiler] Properly guard the speculative optimizations for instanceof.
      >
      > Add a general feedback slot for instanceof similar to what we already have
      > for for-in, which basically has a fast (indicated by the uninitialized
      > sentinel) and a slow (indicated by the megamorphic sentinel) mode. Now
      > we can only take the fast path when the feedback slot says it hasn't
      > seen any funky inputs and nothing funky appeared in the prototype chain.
      > In the TurboFan code we also deoptimize whenever we see a funky object
      > (i.e. a proxy or an object that requires access checks) in the prototype
      > chain (similar to what Crankshaft already did).
      >
      > Drive-by-fix: Also make Crankshaft respect the mode and therefore
      > address the deopt loop in Crankshaft around instanceof.
      >
      > We might want to introduce an InstanceOfIC mechanism at some point and
      > track the map of the right-hand side.
      >
      > BUG=v8:5267
      > R=mvstanton@chromium.org
      >
      > Committed: https://crrev.com/a0484bc6116ebc2b855de87d862945e2ae07169b
      > Cr-Commit-Position: refs/heads/master@{#39718}
      
      TBR=mvstanton@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:5267
      
      Review-Url: https://codereview.chromium.org/2365223003
      Cr-Commit-Position: refs/heads/master@{#39736}
      b9cdb630
    • bmeurer's avatar
      [compiler] Properly guard the speculative optimizations for instanceof. · a0484bc6
      bmeurer authored
      Add a general feedback slot for instanceof similar to what we already have
      for for-in, which basically has a fast (indicated by the uninitialized
      sentinel) and a slow (indicated by the megamorphic sentinel) mode. Now
      we can only take the fast path when the feedback slot says it hasn't
      seen any funky inputs and nothing funky appeared in the prototype chain.
      In the TurboFan code we also deoptimize whenever we see a funky object
      (i.e. a proxy or an object that requires access checks) in the prototype
      chain (similar to what Crankshaft already did).
      
      Drive-by-fix: Also make Crankshaft respect the mode and therefore
      address the deopt loop in Crankshaft around instanceof.
      
      We might want to introduce an InstanceOfIC mechanism at some point and
      track the map of the right-hand side.
      
      BUG=v8:5267
      R=mvstanton@chromium.org
      
      Review-Url: https://codereview.chromium.org/2370693002
      Cr-Commit-Position: refs/heads/master@{#39718}
      a0484bc6
  6. 22 Sep, 2016 4 commits
    • jyan's avatar
      Fix Endian issue in interpreter in EmitBytecode · 3b1691be
      jyan authored
      R=rmcilroy@chromium.org, mythria@chromium.org, leszeks@chromium.org
      BUG=
      
      Review-Url: https://codereview.chromium.org/2362453003
      Cr-Commit-Position: refs/heads/master@{#39644}
      3b1691be
    • neis's avatar
      [modules] Basic support of import statements. · ca6886c0
      neis authored
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2360063002
      Cr-Commit-Position: refs/heads/master@{#39639}
      ca6886c0
    • rmcilroy's avatar
      [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. · e5ac75c6
      rmcilroy authored
      This CL optimizes the code in BytecodeArrayBuilder and
      BytecodeArrayWriter by making the following main changes:
      
       - Move operand scale calculation out of BytecodeArrayWriter to the
      BytecodeNode constructor, where the decision on which operands are
      scalable can generally be statically decided by the compiler.
       - Move the maximum register calculation out of BytecodeArrayWriter
      and into BytecodeRegisterOptimizer (which is the only place outside
      BytecodeGenerator which updates which registers are used). This
      avoids the BytecodeArrayWriter needing to know the operand types
      of a node as it writes it.
       - Modify EmitBytecodes to use individual push_backs rather than
      building a buffer and calling insert, since this turns out to be faster.
       - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
      bytes,
       - Make common functions in Bytecodes constexpr so that they
      can be statically calculated by the compiler.
       - Move common functions and constructors in Bytecodes and
      BytecodeNode to the header so that they can be inlined.
       - Change large static switch statements in Bytecodes to const array
      lookups, and move to the header to allow inlining.
      
      I also took the opportunity to remove a number of unused helper
      functions, and rework some others for consistency.
      
      This reduces the percentage of time spent in making BytecodeArrays
       in  CodeLoad from ~15% to ~11% according to perf. The
      CoadLoad score increase by around 2%.
      
      BUG=v8:4280
      
      Committed: https://crrev.com/b11a8b4d41bf09d6b3d6cf214fe3fb61faf01a64
      Review-Url: https://codereview.chromium.org/2351763002
      Cr-Original-Commit-Position: refs/heads/master@{#39599}
      Cr-Commit-Position: refs/heads/master@{#39637}
      e5ac75c6
    • hablich's avatar
      Revert of [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter.... · 5d693348
      hablich authored
      Revert of [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. (patchset #6 id:200001 of https://codereview.chromium.org/2351763002/ )
      
      Reason for revert:
      Prime suspect for roll blocker: https://codereview.chromium.org/2362503002/
      
      Original issue's description:
      > [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter.
      >
      > This CL optimizes the code in BytecodeArrayBuilder and
      > BytecodeArrayWriter by making the following main changes:
      >
      >  - Move operand scale calculation out of BytecodeArrayWriter to the
      > BytecodeNode constructor, where the decision on which operands are
      > scalable can generally be statically decided by the compiler.
      >  - Move the maximum register calculation out of BytecodeArrayWriter
      > and into BytecodeRegisterOptimizer (which is the only place outside
      > BytecodeGenerator which updates which registers are used). This
      > avoids the BytecodeArrayWriter needing to know the operand types
      > of a node as it writes it.
      >  - Modify EmitBytecodes to use individual push_backs rather than
      > building a buffer and calling insert, since this turns out to be faster.
      >  - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
      > bytes,
      >  - Make common functions in Bytecodes constexpr so that they
      > can be statically calculated by the compiler.
      >  - Move common functions and constructors in Bytecodes and
      > BytecodeNode to the header so that they can be inlined.
      >  - Change large static switch statements in Bytecodes to const array
      > lookups, and move to the header to allow inlining.
      >
      > I also took the opportunity to remove a number of unused helper
      > functions, and rework some others for consistency.
      >
      > This reduces the percentage of time spent in making BytecodeArrays
      >  in  CodeLoad from ~15% to ~11% according to perf. The
      > CoadLoad score increase by around 2%.
      >
      > BUG=v8:4280
      >
      > Committed: https://crrev.com/b11a8b4d41bf09d6b3d6cf214fe3fb61faf01a64
      > Cr-Commit-Position: refs/heads/master@{#39599}
      
      TBR=mythria@chromium.org,leszeks@chromium.org,rmcilroy@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:4280
      
      Review-Url: https://codereview.chromium.org/2360193003
      Cr-Commit-Position: refs/heads/master@{#39612}
      5d693348
  7. 21 Sep, 2016 1 commit
    • rmcilroy's avatar
      [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. · b11a8b4d
      rmcilroy authored
      This CL optimizes the code in BytecodeArrayBuilder and
      BytecodeArrayWriter by making the following main changes:
      
       - Move operand scale calculation out of BytecodeArrayWriter to the
      BytecodeNode constructor, where the decision on which operands are
      scalable can generally be statically decided by the compiler.
       - Move the maximum register calculation out of BytecodeArrayWriter
      and into BytecodeRegisterOptimizer (which is the only place outside
      BytecodeGenerator which updates which registers are used). This
      avoids the BytecodeArrayWriter needing to know the operand types
      of a node as it writes it.
       - Modify EmitBytecodes to use individual push_backs rather than
      building a buffer and calling insert, since this turns out to be faster.
       - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
      bytes,
       - Make common functions in Bytecodes constexpr so that they
      can be statically calculated by the compiler.
       - Move common functions and constructors in Bytecodes and
      BytecodeNode to the header so that they can be inlined.
       - Change large static switch statements in Bytecodes to const array
      lookups, and move to the header to allow inlining.
      
      I also took the opportunity to remove a number of unused helper
      functions, and rework some others for consistency.
      
      This reduces the percentage of time spent in making BytecodeArrays
       in  CodeLoad from ~15% to ~11% according to perf. The
      CoadLoad score increase by around 2%.
      
      BUG=v8:4280
      
      Review-Url: https://codereview.chromium.org/2351763002
      Cr-Commit-Position: refs/heads/master@{#39599}
      b11a8b4d
  8. 20 Sep, 2016 6 commits
  9. 19 Sep, 2016 1 commit
  10. 16 Sep, 2016 2 commits
  11. 14 Sep, 2016 2 commits
  12. 13 Sep, 2016 4 commits
  13. 12 Sep, 2016 5 commits
  14. 09 Sep, 2016 2 commits