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

Unified Diff: src/heap.cc

Issue 597007: Faster implementation of integer-to-ascii conversion. I think.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 10 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/conversions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 3813)
+++ src/heap.cc (working copy)
@@ -1786,14 +1786,16 @@
char arr[100];
Vector<char> buffer(arr, ARRAY_SIZE(arr));
const char* str;
+ int length = 0;
if (number->IsSmi()) {
int num = Smi::cast(number)->value();
- str = IntToCString(num, buffer);
+ str = IntToCString(num, &length);
} else {
double num = HeapNumber::cast(number)->value();
str = DoubleToCString(num, buffer);
+ length = strlen(str);
}
- Object* result = AllocateStringFromAscii(CStrVector(str));
+ Object* result = AllocateStringFromAscii(Vector<const char>(str, length));
if (!result->IsFailure()) {
SetNumberStringCache(number, String::cast(result));
« no previous file with comments | « src/conversions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698