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

Unified Diff: runtime/vm/parser.cc

Issue 2006793002: VM: Fix race between background compiler and guarded cid update. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« runtime/vm/object.h ('K') | « 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/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 7819cd780ac26f66bf7a1621d56cd8d5c8611bac..a07dbe304b39d9d08dac8acc735d3173b8a50ed5 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -161,12 +161,19 @@ void ParsedFunction::AddToGuardedFields(const Field* field) const {
(field->guarded_cid() == kIllegalCid)) {
return;
}
+
for (intptr_t j = 0; j < guarded_fields_->length(); j++) {
- if ((*guarded_fields_)[j]->raw() == field->raw()) {
+ if ((*guarded_fields_)[j]->Original() == field->Original()) {
return;
}
}
- guarded_fields_->Add(&Field::ZoneHandle(Z, field->Original()));
+
+ // Note: the list of guarded fields must contain copies during background
+ // compilation because we will look at their guarded_cid when copying
+ // the array of guarded fields from callee into the caller during
+ // inlining.
+ ASSERT(!field->IsOriginal() || Thread::Current()->IsMutatorThread());
+ guarded_fields_->Add(&Field::ZoneHandle(Z, field->raw()));
}
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698