Commit Graph

21 Commits

Author SHA1 Message Date
jochen@chromium.org
a4506cd3f2 Move platform abstraction to base library
Also split v8-core independent methods from checks.h to base/logging.h and
merge v8checks with the rest of checks.

The CPU::FlushICache method is moved to CpuFeatures::FlushICache

RoundUp and related methods are moved to base/macros.h

Remove all layering violations from src/libplatform

BUG=none
R=jkummerow@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/358363002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22092 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-06-30 13:25:46 +00:00
jochen@chromium.org
56a486c322 Use full include paths everywhere
- this avoids using relative include paths which are forbidden by the style guide
- makes the code more readable since it's clear which header is meant
- allows for starting to use checkdeps

BUG=none
R=jkummerow@chromium.org, danno@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/304153016

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21625 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-06-03 08:12:43 +00:00
bmeurer@chromium.org
5a564648dd Improve reproducibility of test runs.
Add random seed to run-tests.py, using either a user supplied
value or a random number generated by random.SystemRandom().
This same random seed is passed to all test cases, making sure
that we can easily reproduce test failures that depend on
random numbers (i.e. bugs related to our handwritten ASLR).

Also fix all uses of rand() to make use of our RNG class
instead.

R=machenbach@chromium.org

Review URL: https://codereview.chromium.org/231443002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20637 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-10 07:25:49 +00:00
bmeurer@chromium.org
7f0f84c0a5 Fix MSVC compiler warning after commit r16612.
TBR=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/23534052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-10 11:33:14 +00:00
bmeurer@chromium.org
eb381b9444 Introduce a RandonNumberGenerator class. Refactor the random/private_random uses in Isolate/Context.
The RandomNumberGenerator is a pseudorandom number generator
with 48-bit state. It is properly seeded using either

(1) the --random-seed if specified, or
(2) the entropy_source function if configured, or
(3) /dev/urandom if available, or
(4) falls back to Time and TimeTicks based seeding.

Each Isolate now contains a RandomNumberGenerator, which replaces
the previous private_random_seed.

Every native context still has its own random_seed. But this random
seed is now properly initialized during bootstrapping,
instead of on-demand initialization. This will allow us to cleanup
and speedup the HRandom implementation quite a lot (this is delayed
for a followup CL)!

Also stop messing with the system rand()/random(), which should
not be done from a library anyway! We probably re-seeded the
libc rand()/random() after the application (i.e. Chrome) already
seeded it (with better entropy than what we used).

Another followup CL will replace the use of the per-isolate
random number generator for the address randomization and
thereby get rid of the Isolate::UncheckedCurrent() usage in
the platform code.

TEST=cctest/test-random-number-generator,cctest/test-random
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/23548024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-10 11:13:55 +00:00
jkummerow@chromium.org
ed6c366f98 Add missing license headers.
BUG=chromium:98597

Review URL: https://codereview.chromium.org/12486003
Patch from Paweł Hajdan Jr. <phajdan.jr@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-07 11:12:26 +00:00
yangguo@chromium.org
4279f87395 Revert r10913.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9602006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-05 07:55:27 +00:00
yangguo@chromium.org
df78fcc384 Set x86 FPU precision to 64-bit for MinGW. Original patch by Jonathan Liu <net147@gmail.com>.
BUG=v8:1062
TEST=test-strtod.cc

Review URL: https://chromiumcodereview.appspot.com/9599006
Patch from Jonathan Liu <net147@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10913 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-04 10:49:25 +00:00
floitschV8@gmail.com
96c4f62b73 Add two tests to strtod.
Review URL: http://codereview.chromium.org/6461018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 14:12:31 +00:00
floitschV8@gmail.com
121adebfde Fix strtod.
Strtod function used buffer that was allocated inside a nested scope.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-11 16:32:32 +00:00
floitschV8@gmail.com
d80413160c Work around windows compiler bug.
Doubles that lie exactly between two doubles should round to the even one.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-08 13:04:47 +00:00
floitschV8@gmail.com
808d00f8ef Bignum implementation of Strtod.
This removes the dependency on Gay's strtod.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5778 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-08 11:49:47 +00:00
floitschV8@gmail.com
29ae2f08cb Strtod fast-case that uses DiyFps and cached powers of ten.
This is a fixed version of r5677.
Review URL: http://codereview.chromium.org/3898007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5686 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-21 11:54:32 +00:00
floitschV8@gmail.com
9bcdac5fef Fix build-breakage.
Revert "Strtod fast-case that uses DiyFps and cached powers of ten."

This reverts commit 493da023514021a63e1d3ba3f70348a275ac4042.

TBR: whesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-20 15:30:59 +00:00
floitschV8@gmail.com
6232cd8000 Strtod fast-case that uses DiyFps and cached powers of ten.
Review URL: http://codereview.chromium.org/3760013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5677 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-20 15:13:34 +00:00
floitschV8@gmail.com
1193987313 Fix double-rounding in strtod.
Don't use floating-point operations on Linux,x86 to compute strtod. Since the
floating-point stack on Linux is set to 80bit double rounding may occure.

When falling back to gay_strtod append several '0's so that Gay doesn't take
the same shortcut either.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5650 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-18 15:19:39 +00:00
floitschV8@gmail.com
43fd9a542c Work around Windows bug. Use different constants.
Windows' strtod doesn't correctly read 3e-324 a the lowest denormal, but returns 0.0 instead.
Using 4e-324 is still the same value and works.

BUG=
TEST=
Review URL: http://codereview.chromium.org/3744008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-14 15:54:51 +00:00
floitschV8@gmail.com
2b226c598f Weed out extreme exponents in strtod.
If a decimal exponent is less than -309 return 0.0.
If a decimal exponent is greater than +324 return +infinity.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5623 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-14 13:47:48 +00:00
floitschV8@gmail.com
4cd03a4f6a Implement fast case for strtod.
Reapply r5603 with additional fix: use OS::StrNCpy instead of posix strncpy.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-07 12:53:59 +00:00
ager@chromium.org
dfacc926fc Revert strtod fast-case change (r5603) because of Windows compilation
errors.

TBR=floitschV8@gmail.com
Review URL: http://codereview.chromium.org/3582017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5604 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-07 12:24:02 +00:00
floitschV8@gmail.com
ce666fc2fe Implement fast case for strtod.
If there are few non-zero digits and the 10^exponent fits into a double then
we can compute the result using 1 (or 2) double operations.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5603 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-07 12:01:25 +00:00