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; |