Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Contribute to GitLab
  • Sign in / Register
V
V8
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Linshizhi
  • V8
  • Repository

Switch branch/tag
  • v8
  • test
  • mjsunit
  • compiler
  • consecutive-addition.js
Find file
BlameHistoryPermalink
  • Z Nguyen-Huu's avatar
    [turbofan] Reduce consecutive overflow addition with constants · e93a369f
    Z Nguyen-Huu authored Sep 22, 2020
    Using associative property of addition: (x + A) + B => x + (A + B).
    Note: A and B need to have the same sign and we need to check that
    (x + A) isn't used anywhere else.
    
    20% perf improvement of the following function.
    
    function f(n) {
      var c = 0;
      for (var i = 0; i < n; i++) {
        c = c + 2 + 3;
      }
      return c;
    }
    for n = 10_000_000.
    
    Before: 7.31s.
    After: 6.05s.
    
    Bug: v8:10305
    Change-Id: If45d1cad6128a9a25cb9f43a4828ae28d594a84b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2365221
    Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70064}
    e93a369f
consecutive-addition.js 701 Bytes
EditWeb IDE

Replace consecutive-addition.js

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.