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

Unified Diff: runtime/vm/object.cc

Issue 2984883002: Remove fields from Isolate in Product mode (Closed)
Patch Set: Address comments 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
« no previous file with comments | « runtime/vm/metrics.cc ('k') | runtime/vm/pages.cc » ('j') | 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 2ddf729fea1f0cbf3a6d29b3f23b0c3100edf420..1b53fdc204e7a68d46dd444ecb97b68ba1442de0 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -7787,9 +7787,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);
@@ -11032,6 +11037,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.
@@ -11043,6 +11049,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698