[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-25 Thread floitschV8
LGTM. http://codereview.chromium.org/1096002/diff/3003/39003 File src/conversions.cc (right): http://codereview.chromium.org/1096002/diff/3003/39003#newcode280 src/conversions.cc:280: // Hexidecomal may have (52) / 4 + 1 significant digit. Mean of 2 On 2010/03/25 12:26:16, Erik Corry wrote: He

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-25 Thread erik . corry
LGTM http://codereview.chromium.org/1096002/diff/3003/39003 File src/conversions.cc (right): http://codereview.chromium.org/1096002/diff/3003/39003#newcode280 src/conversions.cc:280: // Hexidecomal may have (52) / 4 + 1 significant digit. Mean of 2 Hexidecomal -> Hexadecimal digit -> digits I c

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-23 Thread serya
Buffer size enlarged to 772. Added code checking if all of the dropped digits are zeros and appenging '1' (or '.1') if not. Added a test for 1000-digit number. http://codereview.chromium.org/1096002/diff/21004/27003 File src/conversions.cc (right): http://codereview.chromium.org/1096002/diff/

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-23 Thread floitschV8
LGTM if you increase the buffer size to the max-double string. Please upload a new version here before committing (just to make comparison easier). http://codereview.chromium.org/1096002/diff/21004/27003 File src/conversions.cc (right): http://codereview.chromium.org/1096002/diff/21004/27003#ne

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-23 Thread Florian Loitsch
Great. thanks. This should remove any remaining doubts (if there were any). Btw: if you want to play with doubles have a look at doubles.h (recently checked in). It gives easy access to significands and exponents. // florian On Tue, Mar 23, 2010 at 12:36 PM, Sergey Ryazanov wrote: > > 4.45014771

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-23 Thread Sergey Ryazanov
4.450147717014402025081996672794991863585242658592605113516950912287262231249312640695305412711894243178380137008083052315457825154530323827726959236845743044099361970891187471508150509418060480375117378320411851935338796416115205148741308316327252012460602310586905362063117526562176521464664318142

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-23 Thread Florian Loitsch
It's a pity that most of the time more than 700 bytes on the stack are wasted, but I don't see any easier solution. I agree with Erik (offline discussion) that ~780 bytes on the stack should not be a big issue since the memory is not initialized and we are not calling this function recursively. I v

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-22 Thread Sergey Ryazanov
It seems that strtod rounds a decimal to a closest number representable in double ("24414062505131250" parses as 24414062505131248 and "24414062505131250.0.01" 24414062505131252). As I get from GNU source code it uses "multipercision numbers" for exact representation of numbers. Any double is

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-20 Thread floitschV8
I will discuss the 1000.01 issue with the V8 team on monday. The way I see it we have two options: 1. Follow ECMA-262 and round down, thus being incompatible with older versions. 2. Fallback to a more expensive reading when ther

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-19 Thread serya
I'm not sure what to do about 1000.01 (by the way, Firefox also spots removing the last 1). Does it stick us to implementation which require memory allocation? http://codereview.chromium.org/1096002/diff/3002/4003 File src/conv

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-19 Thread floitschV8
http://codereview.chromium.org/1096002/diff/3002/4003 File src/conversions.cc (right): http://codereview.chromium.org/1096002/diff/3002/4003#newcode162 src/conversions.cc:162: if (*s == '-' || *s == '+') s++; Not really important: compilers are usually better with array indices than with pointer

[v8-dev] Re: StringToDouble rewritten not using String::Get and memory allocations.... (issue1096002)

2010-03-18 Thread erik . corry
LGTM http://codereview.chromium.org/1096002/diff/3002/4003 File src/conversions.cc (right): http://codereview.chromium.org/1096002/diff/3002/4003#newcode109 src/conversions.cc:109: bool operator != (EndMarker const& m) const { return !(*this == m); } Some funky C++ here :-). return !end_; seem