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

Unified Diff: src/heap.cc

Issue 506018: Merge r3397 to branches/1.3... (Closed) Base URL: http://v8.googlecode.com/svn/branches/1.3/
Patch Set: Created 11 years 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 3464)
+++ src/heap.cc (working copy)
@@ -1793,10 +1793,19 @@
// Copy the characters into the new object.
char* dest = SeqAsciiString::cast(result)->GetChars();
// Copy first part.
- char* src = SeqAsciiString::cast(first)->GetChars();
+ const char* src;
+ if (first->IsExternalString()) {
+ src = ExternalAsciiString::cast(first)->resource()->data();
+ } else {
+ src = SeqAsciiString::cast(first)->GetChars();
+ }
for (int i = 0; i < first_length; i++) *dest++ = src[i];
// Copy second part.
- src = SeqAsciiString::cast(second)->GetChars();
+ if (second->IsExternalString()) {
+ src = ExternalAsciiString::cast(second)->resource()->data();
+ } else {
+ src = SeqAsciiString::cast(second)->GetChars();
+ }
for (int i = 0; i < second_length; i++) *dest++ = src[i];
return result;
} else {
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698