Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / v8-dtoa / README
1 This directory contains V8's fast dtoa conversion code.  The V8 revision
2 imported was:
3
4    Repository Root: http://v8.googlecode.com/svn
5    Repository UUID: ce2b1a6d-e550-0410-aec6-3dcde31c8c00
6    Revision: 5322
7
8 The function of interest, which is called by SpiderMonkey, is
9 conversions.cc:DoubleToCString().  This is called from jsnum.cpp to provide a
10 fast Number.toString(10) implementation.
11
12 A great deal of code has been removed from the imported files.  The
13 remaining code is more or less the bare minimum required to support this
14 function in a straightforward, standalone manner.
15
16 Two related functions in V8 are DoubleToExponentialCString() and
17 DoubleToPrecisionString(), which can be used to implement
18 Number.toExponential() and Number.toPrecision().  They have not been imported;
19 they both call dtoa() and so are unlikely to be noticeably faster than the
20 existing SpiderMonkey equivalents.
21
22 Another related function in V8 is DoubleToRadixCString(), which can be used to
23 implement Number.toString(base), where base != 10.  This has not been imported;
24 it may well be faster than SpiderMonkey's implementation, but V8 generates its
25 own definition of the modulo() function on Win64 and importing this would
26 require also importing large chunks of the assembler, which is not worthwhile.
27
28 Yet another related function in V8 is DoubleToFixedCString(), which can be used
29 to implement Number.toFixed().  This has not been imported as it was measured
30 as slower than SpiderMonkey's version.
31
32 Comments preceded by the string "MOZ: " indicate places where the code has
33 been changed significantly from the original code.
34