| Index: src/heap.cc
|
| diff --git a/src/heap.cc b/src/heap.cc
|
| index aa5c3a9200cdfeecfad159ed9af42970ec2dc983..14c826481b049bfe4b6ed6deac9da6e7439fe40f 100644
|
| --- a/src/heap.cc
|
| +++ b/src/heap.cc
|
| @@ -4811,13 +4811,14 @@ MaybeObject* Heap::AllocateStringFromUtf8Slow(Vector<const char> string,
|
|
|
|
|
| MaybeObject* Heap::AllocateStringFromTwoByte(Vector<const uc16> string,
|
| + bool check_for_one_byte,
|
| PretenureFlag pretenure) {
|
| // Check if the string is an ASCII string.
|
| Object* result;
|
| int length = string.length();
|
| const uc16* start = string.start();
|
|
|
| - if (String::IsOneByte(start, length)) {
|
| + if (check_for_one_byte && String::IsOneByte(start, length)) {
|
| MaybeObject* maybe_result = AllocateRawOneByteString(length, pretenure);
|
| if (!maybe_result->ToObject(&result)) return maybe_result;
|
| CopyChars(SeqOneByteString::cast(result)->GetChars(), start, length);
|
|
|