Skip to content

Commit 03f0289

Browse files
committed
Add Chrome issue to unify Math implementations
1 parent e97deec commit 03f0289

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/native_math_bugs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
* [Mozilla optimizations break commutativity][@bug:mozilla:969203]
4545
* [Mozilla debate on speed versus precision][@bug:mozilla:967709]
4646
* [Mozilla division bug to due C library delegation][@bug:mozilla:948321]
47+
* [Fixit to unify Math implementations in Chrome][@bug:v8:5086]
4748

4849

49-
* [Fixit to unify Math implementations in Chrome][30]
5050
* [Fixit to unify Math.pow implementation in Chrome][31]
5151

5252

@@ -101,14 +101,14 @@
101101
[@bug:mozilla:969203]: https://bugzilla.mozilla.org/show_bug.cgi?id=969203#c8
102102
[@bug:mozilla:967709]: https://bugzilla.mozilla.org/show_bug.cgi?id=967709
103103
[@bug:mozilla:948321]: https://bugzilla.mozilla.org/show_bug.cgi?id=948321
104+
[@bug:v8:5086]: https://bugs.chromium.org/p/v8/issues/detail?id=5086
104105

105106

106107
[v8-issue-tracker]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=math&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Component%20Stars&num=100&start=100
107108
[webkit-issue-tracker]: https://bugs.webkit.org/buglist.cgi?quicksearch=math
108109
[mozilla-issue-tracker]: https://bugzilla.mozilla.org/buglist.cgi?quicksearch=math
109110

110111

111-
[30]: https://bugs.chromium.org/p/v8/issues/detail?id=5086
112112
[31]: https://bugs.chromium.org/p/v8/issues/detail?id=5157
113113

114114
<!-- </links> -->

docs/references/bugs.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,3 +353,12 @@ @misc{bug:mozilla:948321
353353
year = {2013}
354354
}
355355

356+
@misc{bug:v8:5086,
357+
abstract = {The ES2015 spec defines a bunch of Math builtins, like Math.exp, Math.log, Math.sin and so on, which we traditionally implemented in various, i.e. some funny mix of hand written assembly, C++, JavaScript and Hydrogen code. It's pretty obvious that this is not only hard to maintain, but also creates a difficult situation for TurboFan, where we'd have to replicate what Crankshaft does. The builtins like Math.sin and Math.cos that are implemented mostly in JavaScript and which have fast paths that can be inlined cause further trouble for TurboFan, because for the slow path they have to have a call to some other JS code in it, which blocks any kind of code motion or value numbering of that. So two uses of Math.sin in a row of the same value cannot be optimized. And there are further optimization obstacles with the current approach. So the unification idea for this years fixit is to have for each (interesting) Math builtin either a.) a dedicated TurboFan machine operator (i.e. Float64Log, Float64Exp, etc.), and which can either use machine specific code or call into the C++ implementation internally, or b.) if the operation can easily be implemented via existing TurboFan operators, desugar it to that, or c.) only offer a C++ implementation, wrapped by a proper C++ builtin. The C++ implementation should ideally use fdlibm where appropriate (i.e. no performance concerns), slightly adapted to JavaScript semantics if necessary. This should live in src/base. The goal for the Fixit is to have math.js and fdlibm.js empty by the end of the quarter and removed all the inconsistent code stubs and builtins (i.e. MathPowStub is a prime example). Bonus points if all of this can be used by asm.js->wasm as well.},
358+
keywords = {math, javascript, v8, chrome, trig, trigonometric, stdlib},
359+
notes = {},
360+
title = {{Unify the implementation of the various Math builtins}},
361+
url = {https://bugs.chromium.org/p/v8/issues/detail?id=5086},
362+
year = {2016}
363+
}
364+

0 commit comments

Comments
 (0)