| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 26534)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -13427,6 +13427,23 @@
|
| }
|
|
|
|
|
| +void OneByteString::SetPeer(const String& str,
|
| + void* peer,
|
| + Dart_PeerFinalizer cback) {
|
| + ASSERT(!str.IsNull() && str.IsOneByteString());
|
| + ASSERT(peer != NULL);
|
| + ExternalStringData<uint8_t>* ext_data =
|
| + new ExternalStringData<uint8_t>(NULL, peer, cback);
|
| + AddFinalizer(str, ext_data, OneByteString::Finalize);
|
| +}
|
| +
|
| +
|
| +void OneByteString::Finalize(Dart_WeakPersistentHandle handle, void* peer) {
|
| + delete reinterpret_cast<ExternalStringData<uint8_t>*>(peer);
|
| + DeleteWeakPersistentHandle(handle);
|
| +}
|
| +
|
| +
|
| RawTwoByteString* TwoByteString::EscapeSpecialCharacters(const String& str) {
|
| intptr_t len = str.Length();
|
| if (len > 0) {
|
| @@ -13579,6 +13596,23 @@
|
| }
|
|
|
|
|
| +void TwoByteString::SetPeer(const String& str,
|
| + void* peer,
|
| + Dart_PeerFinalizer cback) {
|
| + ASSERT(!str.IsNull() && str.IsTwoByteString());
|
| + ASSERT(peer != NULL);
|
| + ExternalStringData<uint16_t>* ext_data =
|
| + new ExternalStringData<uint16_t>(NULL, peer, cback);
|
| + AddFinalizer(str, ext_data, TwoByteString::Finalize);
|
| +}
|
| +
|
| +
|
| +void TwoByteString::Finalize(Dart_WeakPersistentHandle handle, void* peer) {
|
| + delete reinterpret_cast<ExternalStringData<uint16_t>*>(peer);
|
| + DeleteWeakPersistentHandle(handle);
|
| +}
|
| +
|
| +
|
| RawExternalOneByteString* ExternalOneByteString::New(
|
| const uint8_t* data,
|
| intptr_t len,
|
|
|