Commit 1fafbe76 authored by floitschV8@gmail.com's avatar floitschV8@gmail.com

Remove Gay's dtoa from sources.

Farewell.

Review URL: http://codereview.chromium.org/5195003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1cfc63cf
......@@ -12,9 +12,6 @@ are:
based on layout tests from webkit.org which are copyrighted by
Apple Computer, Inc. and released under a 3-clause BSD license.
- Dtoa, located under third_party/dtoa. This code is copyrighted by
David M. Gay and released under an MIT license.
- Strongtalk assembler, the basis of the files assembler-arm-inl.h,
assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
assembler-ia32.cc, assembler-ia32.h, assembler.cc and assembler.h.
......
......@@ -297,14 +297,8 @@ def ConfigureObjectFiles():
libraries_src, libraries_empty_src = env.JS2C(['libraries.cc', 'libraries-empty.cc'], library_files, TYPE='CORE')
libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
# Build dtoa.
dtoa_env = env.Copy()
dtoa_env.Replace(**context.flags['dtoa'])
dtoa_files = ['dtoa-config.c']
dtoa_obj = context.ConfigureObject(dtoa_env, dtoa_files)
source_objs = context.ConfigureObject(env, source_files)
non_snapshot_files = [dtoa_obj, source_objs]
non_snapshot_files = [source_objs]
# Create snapshot if necessary. For cross compilation you should either
# do without snapshots and take the performance hit or you should build a
......
/*
* Copyright 2007-2008 the V8 project authors. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Dtoa needs to have a particular environment set up for it so
* instead of using it directly you should use this file.
*
* The way it works is that when you link with it, its definitions
* of dtoa, strtod etc. override the default ones. So if you fail
* to link with this library everything will still work, it's just
* subtly wrong.
*/
#if !(defined(__APPLE__) && defined(__MACH__)) && \
!defined(WIN32) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && \
!defined(__sun)
#include <endian.h>
#endif
#include <math.h>
#include <float.h>
/* The floating point word order on ARM is big endian when floating point
* emulation is used, even if the byte order is little endian */
#if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \
!defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun) && \
__FLOAT_WORD_ORDER == __BIG_ENDIAN
#define IEEE_MC68k
#else
#define IEEE_8087
#endif
#define __MATH_H__
#if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__) || \
defined(__OpenBSD__) || defined(__sun)
/* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle the
* name of strtod. If it's included after strtod is redefined as
* gay_strtod, it will mangle the name of gay_strtod, which is
* unwanted. */
#include <stdlib.h>
#endif
/* stdlib.h on Windows adds __declspec(dllimport) to all functions when using
* the DLL version of the CRT (compiling with /MD or /MDd). If stdlib.h is
* included after strtod is redefined as gay_strtod, it will add
* __declspec(dllimport) to gay_strtod, which causes the compilation of
* gay_strtod in dtoa.c to fail.
*/
#if defined(WIN32) && defined(_DLL)
#include "stdlib.h"
#endif
/* For MinGW, turn on __NO_ISOCEXT so that its strtod doesn't get added */
#ifdef __MINGW32__
#define __NO_ISOCEXT
#endif /* __MINGW32__ */
/* On 64-bit systems, we need to make sure that a Long is only 32 bits. */
#ifdef V8_TARGET_ARCH_X64
#define Long int
#endif /* V8_TARGET_ARCH_X64 */
/* Make sure we use the David M. Gay version of strtod(). On Linux, we
* cannot use the same name (maybe the function does not have weak
* linkage?). */
#define strtod gay_strtod
#include "third_party/dtoa/dtoa.c"
The author of this software is David M. Gay.
Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
Permission to use, copy, modify, and distribute this software for any
purpose without fee is hereby granted, provided that this entire
notice is included in all copies of any software which is or includes
a copy or modification of this software and in all copies of the
supporting documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES
ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
PURPOSE.
This diff is collapsed.
......@@ -141,9 +141,6 @@ TEST(LongNumberStr) {
}
extern "C" double gay_strtod(const char* s00, const char** se);
TEST(MaximumSignificantDigits) {
char num[] =
"4.4501477170144020250819966727949918635852426585926051135169509"
......@@ -160,12 +157,12 @@ TEST(MaximumSignificantDigits) {
"847003580761626016356864581135848683152156368691976240370422601"
"6998291015625000000000000000000000000000000000e-308";
CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
CHECK_EQ(4.4501477170144017780491e-308, StringToDouble(num, NO_FLAGS));
// Changes the result of strtod (at least in glibc implementation).
num[sizeof(num) - 8] = '1';
CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
CHECK_EQ(4.4501477170144022721148e-308, StringToDouble(num, NO_FLAGS));
}
TEST(MinimumExponent) {
......@@ -185,19 +182,19 @@ TEST(MinimumExponent) {
"470035807616260163568645811358486831521563686919762403704226016"
"998291015625000000000000000000000000000000000e-1108";
CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
CHECK_EQ(4.4501477170144017780491e-308, StringToDouble(num, NO_FLAGS));
// Changes the result of strtod (at least in glibc implementation).
num[sizeof(num) - 8] = '1';
CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
CHECK_EQ(4.4501477170144022721148e-308, StringToDouble(num, NO_FLAGS));
}
TEST(MaximumExponent) {
char num[] = "0.16e309";
CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
CHECK_EQ(1.59999999999999997765e+308, StringToDouble(num, NO_FLAGS));
}
......
......@@ -333,7 +333,6 @@
'../../src/disassembler.h',
'../../src/dtoa.cc',
'../../src/dtoa.h',
'../../src/dtoa-config.c',
'../../src/diy-fp.cc',
'../../src/diy-fp.h',
'../../src/double.h',
......@@ -657,11 +656,7 @@
'../../src/platform-win32.cc',
],
# 4355, 4800 came from common.vsprops
# 4018, 4244 were a per file config on dtoa-config.c
# TODO: It's probably possible and desirable to stop disabling the
# dtoa-specific warnings by modifying dtoa as was done in Chromium
# r9255. Refer to that revision for details.
'msvs_disabled_warnings': [4355, 4800, 4018, 4244],
'msvs_disabled_warnings': [4355, 4800],
'link_settings': {
'libraries': [ '-lwinmm.lib' ],
},
......
......@@ -7,8 +7,7 @@ be performed by Visual Studio.
v8_base.vcproj
--------------
Base V8 library containing all the V8 code but no JavaScript library code. This
includes third party code for string/number convertions (dtoa).
Base V8 library containing all the V8 code but no JavaScript library code.
v8.vcproj
---------
......
......@@ -121,70 +121,6 @@
<References>
</References>
<Files>
<Filter
Name="dtoa"
>
<File
RelativePath="..\..\src\dtoa-config.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
DisableSpecificWarnings="4018;4244"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
DisableSpecificWarnings="4018;4244"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\bignum.cc"
>
</File>
<File
RelativePath="..\..\src\bignum.h"
>
</File>
<File
RelativePath="..\..\src\bignum-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\bignum-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\dtoa.h"
>
</File>
<File
RelativePath="..\..\src\fast-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fast-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.h"
>
</File>
</Filter>
<Filter
Name="src"
>
......@@ -296,6 +232,10 @@
RelativePath="..\..\src\bytecodes-irregexp.h"
>
</File>
<File
RelativePath="..\..\src\cached-powers.cc"
>
</File>
<File
RelativePath="..\..\src\cached-powers.h"
>
......@@ -488,6 +428,14 @@
RelativePath="..\..\src\double.h"
>
</File>
<File
RelativePath="..\..\src\dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\dtoa.h"
>
</File>
<File
RelativePath="..\..\src\execution.cc"
>
......@@ -512,6 +460,14 @@
RelativePath="..\..\src\fast-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\flags.cc"
>
......@@ -993,6 +949,14 @@
RelativePath="..\..\src\string-stream.h"
>
</File>
<File
RelativePath="..\..\src\strtod.cc"
>
</File>
<File
RelativePath="..\..\src\strtod.h"
>
</File>
<File
RelativePath="..\..\src\ia32\stub-cache-ia32.cc"
>
......
......@@ -121,30 +121,6 @@
<References>
</References>
<Files>
<Filter
Name="dtoa"
>
<File
RelativePath="..\..\src\dtoa-config.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
DisableSpecificWarnings="4018;4244"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
DisableSpecificWarnings="4018;4244"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="src"
>
......@@ -228,6 +204,22 @@
RelativePath="..\..\src\arm\builtins-arm.cc"
>
</File>
<File
RelativePath="..\..\src\bignum.cc"
>
</File>
<File
RelativePath="..\..\src\bignum.h"
>
</File>
<File
RelativePath="..\..\src\bignum-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\bignum-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\builtins.cc"
>
......@@ -240,6 +232,14 @@
RelativePath="..\..\src\bytecodes-irregexp.h"
>
</File>
<File
RelativePath="..\..\src\cached-powers.cc"
>
</File>
<File
RelativePath="..\..\src\cached-powers.h"
>
</File>
<File
RelativePath="..\..\src\char-predicates-inl.h"
>
......@@ -424,6 +424,26 @@
RelativePath="..\..\src\disassembler.h"
>
</File>
<File
RelativePath="..\..\src\diy-fp.cc"
>
</File>
<File
RelativePath="..\..\src\diy-fp.h"
>
</File>
<File
RelativePath="..\..\src\double.h"
>
</File>
<File
RelativePath="..\..\src\dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\dtoa.h"
>
</File>
<File
RelativePath="..\..\src\execution.cc"
>
......@@ -440,6 +460,22 @@
RelativePath="..\..\src\factory.h"
>
</File>
<File
RelativePath="..\..\src\fast-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fast-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\flags.cc"
>
......@@ -927,6 +963,14 @@
RelativePath="..\..\src\string-stream.h"
>
</File>
<File
RelativePath="..\..\src\strtod.cc"
>
</File>
<File
RelativePath="..\..\src\strtod.h"
>
</File>
<File
RelativePath="..\..\src\arm\stub-cache-arm.cc"
>
......
......@@ -121,30 +121,6 @@
<References>
</References>
<Files>
<Filter
Name="dtoa"
>
<File
RelativePath="..\..\src\dtoa-config.c"
>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
DisableSpecificWarnings="4018;4244"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
DisableSpecificWarnings="4018;4244"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="src"
>
......@@ -216,6 +192,22 @@
RelativePath="..\..\src\ast.h"
>
</File>
<File
RelativePath="..\..\src\bignum.cc"
>
</File>
<File
RelativePath="..\..\src\bignum.h"
>
</File>
<File
RelativePath="..\..\src\bignum-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\bignum-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\bootstrapper.cc"
>
......@@ -240,6 +232,14 @@
RelativePath="..\..\src\bytecodes-irregexp.h"
>
</File>
<File
RelativePath="..\..\src\cached-powers.cc"
>
</File>
<File
RelativePath="..\..\src\cached-powers.h"
>
</File>
<File
RelativePath="..\..\src\char-predicates-inl.h"
>
......@@ -416,6 +416,26 @@
RelativePath="..\..\src\disassembler.h"
>
</File>
<File
RelativePath="..\..\src\diy-fp.cc"
>
</File>
<File
RelativePath="..\..\src\diy-fp.h"
>
</File>
<File
RelativePath="..\..\src\double.h"
>
</File>
<File
RelativePath="..\..\src\dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\dtoa.h"
>
</File>
<File
RelativePath="..\..\src\execution.cc"
>
......@@ -432,6 +452,22 @@
RelativePath="..\..\src\factory.h"
>
</File>
<File
RelativePath="..\..\src\fast-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fast-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.cc"
>
</File>
<File
RelativePath="..\..\src\fixed-dtoa.h"
>
</File>
<File
RelativePath="..\..\src\flags.cc"
>
......@@ -913,6 +949,14 @@
RelativePath="..\..\src\string-stream.h"
>
</File>
<File
RelativePath="..\..\src\strtod.cc"
>
</File>
<File
RelativePath="..\..\src\strtod.h"
>
</File>
<File
RelativePath="..\..\src\x64\stub-cache-x64.cc"
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment