Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 0a85a137d8b6507e13e3263a4729c2fbd2cce2ef..004b941cff4208694f812f7f01a8b929b1bcb452 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3581,6 +3581,22 @@ ConsString* String::VisitFlat(Visitor* visitor, |
} |
+template <> |
+inline Vector<const uint8_t> String::GetCharVector() { |
+ String::FlatContent flat = GetFlatContent(); |
+ DCHECK(flat.IsOneByte()); |
+ return flat.ToOneByteVector(); |
+} |
+ |
+ |
+template <> |
+inline Vector<const uc16> String::GetCharVector() { |
+ String::FlatContent flat = GetFlatContent(); |
+ DCHECK(flat.IsTwoByte()); |
+ return flat.ToUC16Vector(); |
+} |
+ |
+ |
uint16_t SeqOneByteString::SeqOneByteStringGet(int index) { |
DCHECK(index >= 0 && index < length()); |
return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); |