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

Unified Diff: runtime/vm/object.cc

Issue 2300873002: VM: Compute static guarded cid for final instance fields. (Closed)
Patch Set: address comments Created 4 years, 3 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/hash_map.h ('k') | runtime/vm/precompiler.h » ('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 b78a45279e14ebc914ea0cd0dbe4f3ee74655282..2967789997dccef0b3397eb1ee3be56860a89eb3 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -7476,13 +7476,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.
- const bool use_field_guards =
- FLAG_use_field_guards && !isolate->HasAttemptedReload();
- result.set_guarded_cid(use_field_guards ? kIllegalCid : kDynamicCid);
- result.set_is_nullable(use_field_guards ? false : true);
+ const bool use_guarded_cid =
+ FLAG_precompiled_mode ||
+ (FLAG_use_field_guards && !isolate->HasAttemptedReload());
+ 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);
// Presently, we only attempt to remember the list length for final fields.
- if (is_final && use_field_guards) {
+ if (is_final && use_guarded_cid) {
result.set_guarded_list_length(Field::kUnknownFixedLength);
} else {
result.set_guarded_list_length(Field::kNoFixedLength);
@@ -14195,7 +14196,7 @@ const char* Code::ToCString() const {
const char* name = StubCode::NameOfStub(UncheckedEntryPoint());
return zone->PrintToString("[stub: %s]", name);
} else {
- return zone->PrintToString("Code entry:%" Px, UncheckedEntryPoint());
+ return zone->PrintToString("Code entry: 0x%" Px, UncheckedEntryPoint());
}
}
« no previous file with comments | « runtime/vm/hash_map.h ('k') | runtime/vm/precompiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698