Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(805)

Unified Diff: runtime/vm/object.cc

Issue 1859273002: Add flag to disable string externalization (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
+ 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;
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698