/****************************************************************
*
* 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.
*
***************************************************************/
/* Please send bug reports to David M. Gay (dmg at acm dot org,
* with " at " changed at "@" and " dot " changed to "."). */
/* On a machine with IEEE extended-precision registers, it is
* necessary to specify double-precision (53-bit) rounding precision
* before invoking strtod or dtoa. If the machine uses (the equivalent
* of) Intel 80x87 arithmetic, the call
* _control87(PC_53, MCW_PC);
* does this with many compilers. Whether this or another call is
* appropriate depends on the compiler; for this to work, it may be
* necessary to #include "float.h" or another system-dependent header
* file.
*/
/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.
*
* This strtod returns a nearest machine number to the input decimal
* string (or sets errno to ERANGE). With IEEE arithmetic, ties are
* broken by the IEEE round-even rule. Otherwise ties are broken by
* biased rounding (add half and chop).
*
* Inspired loosely by William D. Clinger's paper "How to Read Floating
* Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
*
* Modifications:
*
* 1. We only require IEEE, IBM, or VAX double-precision
* arithmetic (not IEEE double-extended).
* 2. We get by with floating-point arithmetic in a case that
* Clinger missed -- when we're computing d * 10^n
* for a small integer d and the integer n is not too
* much larger than 22 (the maximum integer k for which
* we can represent 10^k exactly), we may be able to
* compute (d*10^k) * 10^(e-k) with just one roundoff.
* 3. Rather than a bit-at-a-time adjustment of the binary
* result in the hard case, we use floating-point
* arithmetic to determine the adjustment to within
* one bit; only in really hard cases do we need to
* compute a second residual.
* 4. Because of 3., we don't need a large table of powers of 10
* for ten-to-e (just some small tables, e.g. of 10^k
* for 0 <= k <= 22).
*/
/*
* #define IEEE_8087 for IEEE-arithmetic machines where the least
* significant byte has the lowest address.
* #define IEEE_MC68k for IEEE-arithmetic machines where the most
* significant byte has the lowest address.
* #define Long int on machines with 32-bit ints and 64-bit longs.
* #define IBM for IBM mainframe-style floating-point arithmetic.
* #define VAX for VAX-style floating-point arithmetic (D_floating).
* #define No_leftright to omit left-right logic in fast floating-point
* computation of dtoa.
* #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
* and strtod and dtoa should round accordingly.
* #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
* and Honor_FLT_ROUNDS is not #defined.
* #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
* that use extended-precision instructions to compute rounded
* products and quotients) with IBM.
* #define ROUND_BIASED for IEEE-format with biased rounding.
* #define Inaccurate_Divide for IEEE-format with correctly rounded
* products but inaccurate quotients, e.g., for Intel i860.
* #define NO_LONG_LONG on machines that do not have a "long long"
* integer type (of >= 64 bits). On such machines, you can
* #define Just_16 to store 16 bits per 32-bit Long when doing
* high-precision integer arithmetic. Whether this speeds things
* up or slows things down depends on the machine and the number
* being converted. If long long is available and the name is
* something other than "long long", #define Llong to be the name,
* and if "unsigned Llong" does not work as an unsigned version of
* Llong, #define #ULLong to be the corresponding unsigned type.
* #define KR_headers for old-style C function headers.
* #define Bad_float_h if your system lacks a float.h or if it does not
* define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
* FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
* #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
* if memory is available and otherwise does something you deem
* appropriate. If MALLOC is undefined, malloc will be invoked
* directly -- and assumed always to succeed.
* #define Omit_Private_Memory to omit logic (added Jan. 1998) for making
* memory allocations from a private pool of memory when possible.
* When used, the private pool is PRIVATE_MEM bytes long: 2304 bytes,
* unless #defined to be a different length. This default length
* suffices to get rid of MALLOC calls except for unusual cases,
* such as decimal-to-binary conversion of a very long string of
* digits. The longest string dtoa can return is about 751 bytes
* long. For conversions by strtod of strings of 800 digits and
* all dtoa conversions in single-threaded executions with 8-byte
* pointers, PRIVATE_MEM >= 7400 appears to suffice; with 4-byte
* pointers, PRIVATE_MEM >= 7112 appears adequate.
* #define INFNAN_CHECK on IEEE systems to cause strtod to check for
* Infinity and NaN (case insensitively). On some systems (e.g.,
* some HP systems), it may be necessary to #define NAN_WORD0
* appropriately -- to the most significant word of a quiet NaN.
* (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.)
* When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined,
* strtod also accepts (case insensitively) strings of the form
* NaN(x), where x is a string of hexadecimal digits and spaces;
* if there is only one string of hexadecimal digits, it is taken
* for the 52 fraction bits of the resulting NaN; if there are two
* or more strings of hex digits, the first is for the high 20 bits,
* the second and subsequent for the low 32 bits, with intervening
* white space ignored; but if this results in none of the 52
* fraction bits being on (an IEEE Infinity symbol), then NAN_WORD0
* and NAN_WORD1 are used instead.
* #define MULTIPLE_THREADS if the system offers preemptively scheduled
* multiple threads. In this case, you must provide (or suitably
* #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed
* by FREE_DTOA_LOCK(n) for n = 0 or 1. (The second lock, accessed
* in pow5mult, ensures lazy evaluation of only one copy of high
* powers of 5; omitting this lock would introduce a small
* probability of wasting memory, but would otherwise be harmless.)
* You must also invoke freedtoa(s) to free the value s returned by
* dtoa. You may do so whether or not MULTIPLE_THREADS is #defined.
* #define NO_IEEE_Scale to disable new (Feb. 1997) logic in strtod that
* avoids underflows on inputs whose result does not underflow.
* If you #define NO_IEEE_Scale on a machine that uses IEEE-format
* floating-point numbers and flushes underflows to zero rather
* than implementing gradual underflow, then you must also #define
* Sudden_Underflow.
* #define YES_ALIAS to permit aliasing certain double values with
* arrays of ULongs. This leads to slightly better code with
* some compilers and was always used prior to 19990916, but it
* is not strictly legal and can cause trouble with aggressively
* opt
没有合适的资源?快使用搜索试试~ 我知道了~
V8Javascript脚本引擎源码
共2062个文件
svn-base:1280个
js:390个
cc:143个
5星 · 超过95%的资源 需积分: 31 238 下载量 144 浏览量
2009-04-19
17:34:02
上传
评论 4
收藏 4.92MB RAR 举报
温馨提示
谷歌浏览器的脚本引擎、JavaScript解释器:V8。checkout日期:2009-4-19
资源推荐
资源详情
资源评论
收起资源包目录
V8Javascript脚本引擎源码 (2062个子文件)
all-wcprops 31KB
all-wcprops 27KB
all-wcprops 14KB
all-wcprops 4KB
all-wcprops 4KB
all-wcprops 3KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 728B
all-wcprops 629B
all-wcprops 601B
all-wcprops 540B
all-wcprops 484B
all-wcprops 484B
all-wcprops 333B
all-wcprops 302B
all-wcprops 234B
all-wcprops 99B
all-wcprops 98B
all-wcprops 87B
AUTHORS 491B
dtoa.c 71KB
dtoa-config.c 4KB
objects.cc 250KB
codegen-ia32.cc 249KB
runtime.cc 231KB
test-api.cc 202KB
codegen-arm.cc 172KB
jsregexp.cc 156KB
unicode.cc 151KB
parser.cc 148KB
test-debug.cc 145KB
heap.cc 108KB
api.cc 107KB
spaces.cc 83KB
debug.cc 73KB
mark-compact.cc 63KB
bootstrapper.cc 58KB
platform-win32.cc 56KB
assembler-ia32.cc 52KB
test-regexp.cc 49KB
simulator-arm.cc 49KB
serialize.cc 48KB
assembler-arm.cc 46KB
regexp-macro-assembler-ia32.cc 45KB
ic.cc 42KB
stub-cache-ia32.cc 42KB
stub-cache-arm.cc 39KB
macro-assembler-ia32.cc 36KB
disasm-ia32.cc 35KB
virtual-frame-ia32.cc 35KB
stub-cache.cc 34KB
scopes.cc 33KB
macro-assembler-arm.cc 33KB
log.cc 32KB
factory.cc 32KB
top.cc 31KB
ic-ia32.cc 31KB
objects-debug.cc 31KB
prettyprinter.cc 28KB
ic-arm.cc 27KB
builtins-ia32.cc 26KB
disasm-arm.cc 25KB
handles.cc 24KB
test-heap.cc 24KB
frames.cc 23KB
builtins.cc 23KB
d8.cc 23KB
scanner.cc 23KB
conversions.cc 22KB
d8-posix.cc 22KB
jump-target.cc 22KB
builtins-arm.cc 22KB
rewriter.cc 21KB
process.cc 21KB
codegen.cc 21KB
execution.cc 20KB
interpreter-irregexp.cc 20KB
assembler.cc 19KB
platform-linux.cc 19KB
scopeinfo.cc 18KB
test-decls.cc 17KB
string-stream.cc 17KB
platform-freebsd.cc 17KB
virtual-frame.cc 17KB
flags.cc 16KB
accessors.cc 15KB
platform-macos.cc 15KB
ast.cc 15KB
test-strings.cc 14KB
regexp-macro-assembler-tracer.cc 13KB
compiler.cc 13KB
regexp-macro-assembler-irregexp.cc 13KB
virtual-frame-arm.cc 13KB
debug-agent.cc 13KB
jump-target-ia32.cc 12KB
jump-target-arm.cc 12KB
v8threads.cc 12KB
usage-analyzer.cc 12KB
global-handles.cc 11KB
共 2062 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
heiing
- 粉丝: 7
- 资源: 44
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页