Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Issue 1841993002: [builtins] Make Math.ceil, Math.trunc and Math.round optimizable. (Closed)

Created:
4 years, 8 months ago by Benedikt Meurer
Modified:
4 years, 8 months ago
Reviewers:
Jarin
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[builtins] Make Math.ceil, Math.trunc and Math.round optimizable. Migrate Math.ceil, Math.round and Math.trunc to TurboFan code stubs, similar to what we did with Math.floor, and make these builtins properly optimizable in TurboFan via appropriate simplified operators NumberCeil, NumberRound and NumberTrunc, which are intended to be reusable for ToInteger and ToLength optimizations that will be done in a followup CL. Also allows us to kill the funky %RoundNumber runtime function, which was quite heavy. Improve test coverage for Math.ceil and Math.trunc a lot, especially making sure that we also properly trigger the TurboFan builtin reducer case. R=jarin@chromium.org BUG=v8:4059 LOG=n Committed: https://crrev.com/8d20f2fe37e43233a61d2c18e5214831fab4a96b Cr-Commit-Position: refs/heads/master@{#35135}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+880 lines, -214 lines) Patch
M src/bootstrapper.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M src/builtins.h View 3 chunks +10 lines, -1 line 0 comments Download
M src/builtins.cc View 5 chunks +33 lines, -3 lines 0 comments Download
M src/compiler/code-stub-assembler.h View 3 chunks +6 lines, -0 lines 0 comments Download
M src/compiler/code-stub-assembler.cc View 3 chunks +170 lines, -77 lines 0 comments Download
M src/compiler/js-builtin-reducer.h View 1 chunk +3 lines, -1 line 0 comments Download
M src/compiler/js-builtin-reducer.cc View 5 chunks +32 lines, -19 lines 0 comments Download
M src/compiler/opcodes.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/raw-machine-assembler.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/compiler/simplified-lowering.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/simplified-lowering.cc View 3 chunks +276 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator-reducer.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/compiler/simplified-operator-reducer.cc View 2 chunks +10 lines, -11 lines 0 comments Download
M src/compiler/typer.cc View 4 chunks +42 lines, -1 line 0 comments Download
M src/compiler/verifier.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/counters.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/js/math.js View 5 chunks +0 lines, -24 lines 0 comments Download
M src/objects.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/runtime/runtime.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/runtime/runtime-maths.cc View 1 chunk +0 lines, -43 lines 0 comments Download
M test/cctest/compiler/test-code-stub-assembler.cc View 2 chunks +6 lines, -6 lines 0 comments Download
M test/mjsunit/es6/math-trunc.js View 1 chunk +75 lines, -22 lines 0 comments Download
A test/mjsunit/math-ceil.js View 1 chunk +78 lines, -0 lines 0 comments Download
M test/mjsunit/math-floor-part1.js View 2 chunks +29 lines, -0 lines 0 comments Download
M test/mjsunit/math-floor-part2.js View 2 chunks +29 lines, -0 lines 0 comments Download
M test/mjsunit/math-floor-part3.js View 2 chunks +29 lines, -0 lines 0 comments Download
M test/mjsunit/math-floor-part4.js View 2 chunks +29 lines, -0 lines 0 comments Download
M test/mjsunit/mirror-script.js View 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 8 (2 generated)
Benedikt Meurer
4 years, 8 months ago (2016-03-30 11:31:37 UTC) #1
Benedikt Meurer
Hey Jaro, Here's the same change as I did for Math.floor for the other rounding ...
4 years, 8 months ago (2016-03-30 11:34:50 UTC) #2
Jarin
lgtm. Nice!
4 years, 8 months ago (2016-03-30 11:48:56 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1841993002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1841993002/1
4 years, 8 months ago (2016-03-30 11:49:12 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 8 months ago (2016-03-30 11:56:37 UTC) #6
commit-bot: I haz the power
4 years, 8 months ago (2016-03-30 11:57:26 UTC) #8
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/8d20f2fe37e43233a61d2c18e5214831fab4a96b
Cr-Commit-Position: refs/heads/master@{#35135}

Powered by Google App Engine
This is Rietveld 408576698