Index: src/json-stringifier.h |
diff --git a/src/json-stringifier.h b/src/json-stringifier.h |
index a154a4e99a3db613a6ddf555cec9a1762773fff4..3bab324e14c1d6583573963ffe64d2e8156825d9 100644 |
--- a/src/json-stringifier.h |
+++ b/src/json-stringifier.h |
@@ -295,29 +295,23 @@ MaybeObject* BasicJsonStringifier::StringifyString(Isolate* isolate, |
return stringifier.Stringify(object); |
} |
- object = FlattenGetString(object); |
+ FlattenString(object); |
ASSERT(object->IsFlat()); |
- if (object->IsOneByteRepresentation()) { |
+ if (object->IsOneByteRepresentationUnderneath()) { |
Handle<String> result = |
isolate->factory()->NewRawOneByteString(worst_case_length); |
AssertNoAllocation no_alloc; |
- const uint8_t* start = object->IsSeqOneByteString() |
- ? SeqOneByteString::cast(*object)->GetChars() |
- : ExternalAsciiString::cast(*object)->GetChars(); |
return StringifyString_<SeqOneByteString>( |
isolate, |
- Vector<const uint8_t>(start, object->length()), |
+ object->GetFlatContent().ToOneByteVector(), |
result); |
} else { |
Handle<String> result = |
isolate->factory()->NewRawTwoByteString(worst_case_length); |
AssertNoAllocation no_alloc; |
- const uc16* start = object->IsSeqTwoByteString() |
- ? SeqTwoByteString::cast(*object)->GetChars() |
- : ExternalTwoByteString::cast(*object)->GetChars(); |
return StringifyString_<SeqTwoByteString>( |
isolate, |
- Vector<const uc16>(start, object->length()), |
+ object->GetFlatContent().ToUC16Vector(), |
result); |
} |
} |