| Index: runtime/vm/object.h
|
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h
|
| index 343bc0bd4dc79bbfcf6b17c648543744852507d1..3c179214d5759a3f50f133b2745b98a553db905c 100644
|
| --- a/runtime/vm/object.h
|
| +++ b/runtime/vm/object.h
|
| @@ -7166,6 +7166,11 @@ class OneByteString : public AllStatic {
|
| return &str.UnsafeMutableNonPointer(raw_ptr(str)->data())[index];
|
| }
|
|
|
| + static uint8_t* DataStart(const String& str) {
|
| + ASSERT(str.IsOneByteString());
|
| + return &str.UnsafeMutableNonPointer(raw_ptr(str)->data())[0];
|
| + }
|
| +
|
| static RawOneByteString* ReadFrom(SnapshotReader* reader,
|
| intptr_t object_id,
|
| intptr_t tags,
|
| @@ -7178,6 +7183,7 @@ class OneByteString : public AllStatic {
|
| friend class ExternalOneByteString;
|
| friend class SnapshotReader;
|
| friend class StringHasher;
|
| + friend class Utf8;
|
| };
|
|
|
| class TwoByteString : public AllStatic {
|
| @@ -7283,6 +7289,11 @@ class TwoByteString : public AllStatic {
|
| return &str.UnsafeMutableNonPointer(raw_ptr(str)->data())[index];
|
| }
|
|
|
| + static uint16_t* DataStart(const String& str) {
|
| + ASSERT(str.IsTwoByteString());
|
| + return &str.UnsafeMutableNonPointer(raw_ptr(str)->data())[0];
|
| + }
|
| +
|
| static RawTwoByteString* ReadFrom(SnapshotReader* reader,
|
| intptr_t object_id,
|
| intptr_t tags,
|
| @@ -7349,6 +7360,11 @@ class ExternalOneByteString : public AllStatic {
|
| return &(raw_ptr(str)->external_data_->data()[index]);
|
| }
|
|
|
| + static const uint8_t* DataStart(const String& str) {
|
| + ASSERT(str.IsExternalOneByteString());
|
| + return &(raw_ptr(str)->external_data_->data()[0]);
|
| + }
|
| +
|
| static void SetExternalData(const String& str,
|
| ExternalStringData<uint8_t>* data) {
|
| ASSERT(str.IsExternalOneByteString());
|
| @@ -7376,6 +7392,7 @@ class ExternalOneByteString : public AllStatic {
|
| friend class String;
|
| friend class SnapshotReader;
|
| friend class Symbols;
|
| + friend class Utf8;
|
| };
|
|
|
| class ExternalTwoByteString : public AllStatic {
|
| @@ -7428,6 +7445,11 @@ class ExternalTwoByteString : public AllStatic {
|
| return &(raw_ptr(str)->external_data_->data()[index]);
|
| }
|
|
|
| + static const uint16_t* DataStart(const String& str) {
|
| + ASSERT(str.IsExternalTwoByteString());
|
| + return &(raw_ptr(str)->external_data_->data()[0]);
|
| + }
|
| +
|
| static void SetExternalData(const String& str,
|
| ExternalStringData<uint16_t>* data) {
|
| ASSERT(str.IsExternalTwoByteString());
|
|
|