Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: src/conversions.cc

Issue 1148007: Merge bleeding_edge from version 2.1.3 up to revision 4205... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/contexts.h ('k') | src/conversions-inl.h » ('j') | src/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
===================================================================
--- src/conversions.cc (revision 4205)
+++ src/conversions.cc (working copy)
@@ -31,6 +31,7 @@
#include "conversions-inl.h"
#include "factory.h"
+#include "fast-dtoa.h"
#include "scanner.h"
namespace v8 {
@@ -382,8 +383,17 @@
int decimal_point;
int sign;
- char* decimal_rep = dtoa(v, 0, 0, &decimal_point, &sign, NULL);
- int length = StrLength(decimal_rep);
+ char* decimal_rep;
+ bool used_gay_dtoa = false;
+ char fast_dtoa_buffer[kFastDtoaMaximalLength + 1];
+ int length;
+ if (FastDtoa(v, fast_dtoa_buffer, &sign, &length, &decimal_point)) {
+ decimal_rep = fast_dtoa_buffer;
+ } else {
+ decimal_rep = dtoa(v, 0, 0, &decimal_point, &sign, NULL);
+ used_gay_dtoa = true;
+ length = StrLength(decimal_rep);
+ }
if (sign) builder.AddCharacter('-');
@@ -418,7 +428,7 @@
builder.AddFormatted("%d", exponent);
}
- freedtoa(decimal_rep);
+ if (used_gay_dtoa) freedtoa(decimal_rep);
}
}
return builder.Finalize();
« no previous file with comments | « src/contexts.h ('k') | src/conversions-inl.h » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698