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

Issue 2116753002: [builtins] Unify most of the remaining Math builtins. (Closed)

Created:
4 years, 5 months ago by Benedikt Meurer
Modified:
4 years, 5 months ago
Reviewers:
Franzi
CC:
v8-reviews_googlegroups.com, v8-mips-ports_googlegroups.com, v8-x87-ports_googlegroups.com, v8-ppc-ports_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@2102223005
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[builtins] Unify most of the remaining Math builtins. Import fdlibm versions of acos, acosh, asin and asinh, which are more precise and produce the same result across platforms (we were using libm versions for asin and acos so far, where both speed and precision depended on the operating system so far). Introduce appropriate TurboFan operators for these functions and use them both for inlining and for the generic builtin. Also migrate the Math.imul and Math.fround builtins to TurboFan builtins to ensure that their behavior is always exactly the same as the inlined TurboFan version (i.e. C++ truncation semantics for double to float don't necessarily meet the JavaScript semantics). For completeness, also migrate Math.sign, which can even get some nice love in TurboFan. Drive-by-fix: Some alpha-sorting on the Math related functions, and cleanup the list of Math intrinsics that we have to export via the native context currently. BUG=v8:3266, v8:3496, v8:3509, v8:3952, v8:5169, v8:5170, v8:5171, v8:5172 TBR=rossberg@chromium.org R=franzih@chromium.org Committed: https://crrev.com/0a0fe8fb8b06d5e90b082838739ebf44cab04028 Cr-Commit-Position: refs/heads/master@{#37476}

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+1459 lines, -366 lines) Patch
M src/assembler.h View 1 chunk +5 lines, -1 line 0 comments Download
M src/assembler.cc View 4 chunks +26 lines, -6 lines 0 comments Download
M src/base/ieee754.h View 1 chunk +14 lines, -0 lines 0 comments Download
M src/base/ieee754.cc View 1 chunk +257 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 3 chunks +20 lines, -13 lines 2 comments Download
M src/builtins.h View 6 chunks +26 lines, -9 lines 0 comments Download
M src/builtins.cc View 6 chunks +159 lines, -97 lines 2 comments Download
M src/compiler/arm/code-generator-arm.cc View 2 chunks +15 lines, -3 lines 0 comments Download
M src/compiler/arm64/code-generator-arm64.cc View 2 chunks +15 lines, -3 lines 0 comments Download
M src/compiler/code-assembler.h View 2 chunks +6 lines, -0 lines 0 comments Download
M src/compiler/ia32/code-generator-ia32.cc View 2 chunks +15 lines, -3 lines 0 comments Download
M src/compiler/instruction-codes.h View 1 chunk +5 lines, -1 line 0 comments Download
M src/compiler/instruction-scheduler.cc View 1 chunk +5 lines, -1 line 0 comments Download
M src/compiler/instruction-selector.cc View 2 chunks +30 lines, -6 lines 0 comments Download
M src/compiler/js-builtin-reducer.h View 2 chunks +6 lines, -1 line 0 comments Download
M src/compiler/js-builtin-reducer.cc View 6 chunks +90 lines, -14 lines 2 comments Download
M src/compiler/machine-operator.h View 1 chunk +4 lines, -2 lines 0 comments Download
M src/compiler/machine-operator.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M src/compiler/machine-operator-reducer.cc View 2 chunks +25 lines, -5 lines 0 comments Download
M src/compiler/mips/code-generator-mips.cc View 2 chunks +15 lines, -3 lines 0 comments Download
M src/compiler/mips64/code-generator-mips64.cc View 1 chunk +15 lines, -3 lines 0 comments Download
M src/compiler/opcodes.h View 3 chunks +11 lines, -2 lines 0 comments Download
M src/compiler/raw-machine-assembler.h View 1 chunk +5 lines, -1 line 0 comments Download
M src/compiler/representation-change.cc View 2 chunks +10 lines, -2 lines 0 comments Download
M src/compiler/simplified-lowering.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler/simplified-lowering.cc View 4 chunks +47 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator.h View 2 chunks +5 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M src/compiler/typer.cc View 5 chunks +56 lines, -4 lines 0 comments Download
M src/compiler/verifier.cc View 3 chunks +9 lines, -0 lines 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 1 chunk +15 lines, -3 lines 0 comments Download
M src/contexts.h View 2 chunks +1 line, -5 lines 0 comments Download
M src/external-reference-table.cc View 1 chunk +10 lines, -2 lines 0 comments Download
M src/js/math.js View 1 chunk +0 lines, -40 lines 0 comments Download
M src/js/v8natives.js View 1 chunk +1 line, -1 line 0 comments Download
M src/objects.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/parsing/parser.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/type-cache.h View 1 chunk +2 lines, -0 lines 0 comments Download
M test/cctest/compiler/test-run-machops.cc View 3 chunks +35 lines, -11 lines 0 comments Download
M test/cctest/test-serialize.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M test/mjsunit/compiler/deopt-materialize-accumulator.js View 1 chunk +1 line, -1 line 0 comments Download
M test/unittests/base/ieee754-unittest.cc View 8 chunks +162 lines, -114 lines 0 comments Download
M test/unittests/compiler/js-builtin-reducer-unittest.cc View 3 chunks +234 lines, -0 lines 0 comments Download
M test/unittests/compiler/machine-operator-reducer-unittest.cc View 2 chunks +69 lines, -0 lines 0 comments Download
M test/unittests/compiler/node-test-utils.h View 2 chunks +6 lines, -1 line 0 comments Download
M test/unittests/compiler/node-test-utils.cc View 2 chunks +5 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 16 (6 generated)
Benedikt Meurer
4 years, 5 months ago (2016-07-01 07:44:00 UTC) #1
Benedikt Meurer
Hey Franziska, Here's the cleanup for the remaining Math stuff, except Math.random, which requires some ...
4 years, 5 months ago (2016-07-01 07:44:44 UTC) #2
Franzi
https://codereview.chromium.org/2116753002/diff/1/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2116753002/diff/1/src/bootstrapper.cc#newcode1700 src/bootstrapper.cc:1700: SimpleInstallFunction(math, "pow", Builtins::kMathPow, 2, true); Where are we using ...
4 years, 5 months ago (2016-07-01 09:09:48 UTC) #3
Franzi
lgtm
4 years, 5 months ago (2016-07-01 10:43:10 UTC) #4
Benedikt Meurer
https://codereview.chromium.org/2116753002/diff/1/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2116753002/diff/1/src/bootstrapper.cc#newcode1700 src/bootstrapper.cc:1700: SimpleInstallFunction(math, "pow", Builtins::kMathPow, 2, true); It's used to implement ...
4 years, 5 months ago (2016-07-01 10:48:33 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2116753002/1
4 years, 5 months ago (2016-07-01 10:48:52 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/18641)
4 years, 5 months ago (2016-07-01 10:53:22 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2116753002/1
4 years, 5 months ago (2016-07-01 11:09:33 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 5 months ago (2016-07-01 11:11:48 UTC) #14
commit-bot: I haz the power
4 years, 5 months ago (2016-07-01 11:13:19 UTC) #16
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/0a0fe8fb8b06d5e90b082838739ebf44cab04028
Cr-Commit-Position: refs/heads/master@{#37476}

Powered by Google App Engine
This is Rietveld 408576698