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

Unified Diff: src/runtime.cc

Issue 12440061: Improve SeqString::Truncate for latest allocated strings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« src/objects.cc ('K') | « src/objects.cc ('k') | src/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index b14cdbdfc3e5b2fa5bd5261bc36c4943da089f47..55555ab73a9d5dcce45036073987c1b608525886 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5140,7 +5140,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TruncateString) {
NoHandleAllocation ha(isolate);
CONVERT_ARG_CHECKED(SeqString, string, 0);
CONVERT_SMI_ARG_CHECKED(new_length, 1);
- return string->Truncate(new_length);
+ if (new_length == 0) return isolate->heap()->empty_string();
Hannes Payer (out of office) 2013/03/21 12:48:30 Again, this could be handled in Truncate().
+ string->Truncate(new_length);
+ return string;
}
« src/objects.cc ('K') | « src/objects.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698