Chromium Code Reviews| Index: runtime/vm/object.cc |
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
| index 4f9f8d06a259a357c61a453189db396660bf058f..de97d0bd1759dd6aaea0a02b2c3ec08fdc583f1a 100644 |
| --- a/runtime/vm/object.cc |
| +++ b/runtime/vm/object.cc |
| @@ -65,6 +65,7 @@ DECLARE_FLAG(bool, show_invisible_frames); |
| DECLARE_FLAG(bool, trace_deoptimization); |
| DECLARE_FLAG(bool, trace_deoptimization_verbose); |
| DECLARE_FLAG(bool, write_protect_code); |
| +DECLARE_FLAG(bool, support_externalizable_strings); |
| static const char* const kGetterPrefix = "get:"; |
| @@ -7815,6 +7816,15 @@ const char* Field::GuardedPropertiesAsCString() const { |
| } |
| +bool Field::IsExternalizableCid(intptr_t cid) { |
|
srdjan
2016/04/07 16:47:36
I wonder why we put this static method in Field?
rmacnak
2016/04/07 20:22:37
Field guard logic uses it.
|
| + if (FLAG_support_externalizable_strings) { |
| + return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); |
| + } else { |
| + return false; |
| + } |
| +} |
| + |
| + |
| void Field::InitializeGuardedListLengthInObjectOffset() const { |
| ASSERT(IsOriginal()); |
| if (needs_length_check() && |
| @@ -19601,6 +19611,7 @@ RawString* String::MakeExternal(void* array, |
| intptr_t length, |
| void* peer, |
| Dart_PeerFinalizer cback) const { |
| + ASSERT(FLAG_support_externalizable_strings); |
| String& result = String::Handle(); |
| void* external_data; |
| Dart_WeakPersistentHandleFinalizer finalizer; |