https://github.com/mozilla/gecko-dev
Raw File
Tip revision: be9467a241a197004d72131f89b0547b0bd60959 authored by tbirdbld on 30 August 2011, 17:58:03 UTC
Added tag THUNDERBIRD_6_0_1_RELEASE for changeset 41ea1b3fb0a9. CLOSED TREE a=release
Tip revision: be9467a
README
This directory contains V8's fast dtoa conversion code.  The V8 revision
imported was:

   Repository Root: http://v8.googlecode.com/svn
   Repository UUID: ce2b1a6d-e550-0410-aec6-3dcde31c8c00
   Revision: 5322

The function of interest, which is called by SpiderMonkey, is
conversions.cc:DoubleToCString().  This is called from jsnum.cpp to provide a
fast Number.toString(10) implementation.

A great deal of code has been removed from the imported files.  The
remaining code is more or less the bare minimum required to support this
function in a straightforward, standalone manner.

Two related functions in V8 are DoubleToExponentialCString() and
DoubleToPrecisionString(), which can be used to implement
Number.toExponential() and Number.toPrecision().  They have not been imported;
they both call dtoa() and so are unlikely to be noticeably faster than the
existing SpiderMonkey equivalents.

Another related function in V8 is DoubleToRadixCString(), which can be used to
implement Number.toString(base), where base != 10.  This has not been imported;
it may well be faster than SpiderMonkey's implementation, but V8 generates its
own definition of the modulo() function on Win64 and importing this would
require also importing large chunks of the assembler, which is not worthwhile.

Yet another related function in V8 is DoubleToFixedCString(), which can be used
to implement Number.toFixed().  This has not been imported as it was measured
as slower than SpiderMonkey's version.

Comments preceded by the string "MOZ: " indicate places where the code has
been changed significantly from the original code.

back to top