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

Unified Diff: runtime/vm/object.cc

Issue 2984883002: Remove fields from Isolate in Product mode (Closed)
Patch Set: Created 3 years, 5 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 248622662a4be3a742e84099c3c422939abaa036..271667094fca662263f060588e3df839fa0429cf 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -7785,9 +7785,14 @@ void Field::InitializeNew(const Field& result,
// Use field guards if they are enabled and the isolate has never reloaded.
// TODO(johnmccutchan): The reload case assumes the worst case (everything is
// dynamic and possibly null). Attempt to relax this later.
+#if defined(PRODUCT)
+ const bool use_guarded_cid =
+ FLAG_precompiled_mode || isolate->use_field_guards();
+#else
const bool use_guarded_cid =
FLAG_precompiled_mode ||
(isolate->use_field_guards() && !isolate->HasAttemptedReload());
+#endif // !defined(PRODUCT)
result.set_guarded_cid(use_guarded_cid ? kIllegalCid : kDynamicCid);
result.set_is_nullable(use_guarded_cid ? false : true);
result.set_guarded_list_length_in_object_offset(Field::kUnknownLengthOffset);
@@ -11030,6 +11035,7 @@ void Library::AllocatePrivateKey() const {
Zone* zone = thread->zone();
Isolate* isolate = thread->isolate();
+#if !defined(PRODUCT)
if (FLAG_support_reload && isolate->IsReloading()) {
// When reloading, we need to make sure we use the original private key
// if this library previously existed.
@@ -11041,6 +11047,7 @@ void Library::AllocatePrivateKey() const {
return;
}
}
+#endif // !defined(PRODUCT)
// Format of the private key is: "@<sequence number><6 digits of hash>
const intptr_t hash_mask = 0x7FFFF;
« no previous file with comments | « runtime/vm/metrics.cc ('k') | runtime/vm/pages.cc » ('j') | runtime/vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698