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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 1834763004: Track loading happening in parallel with background compilation and abort compilation if necessary. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: comments Created 4 years, 9 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/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 206b0fdf43a35c0f7da5128ffa7d950d71fe748a..f3d3406482218c20cd7a02ca77241d8a9113f701 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -702,14 +702,28 @@ class CallSiteInliner : public ValueObject {
// Install bailout jump.
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
+ Isolate* isolate = Isolate::Current();
+ // Makes sure no classes are loaded during parsing in background.
+ const intptr_t loading_invalidation_gen_at_start =
+ isolate->loading_invalidation_gen();
// Parse the callee function.
bool in_cache;
ParsedFunction* parsed_function;
- {
+ {
CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer);
parsed_function = GetParsedFunction(function, &in_cache);
}
+ if (Compiler::IsBackgroundCompilation()) {
+ if (isolate->IsTopLevelParsing() ||
+ (loading_invalidation_gen_at_start !=
+ isolate->loading_invalidation_gen())) {
+ // Loading occured while parsing. We need to abort here because
+ // state changed while compiling.
+ Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId);
+ }
+ }
+
// Load IC data for the callee.
ZoneGrowableArray<const ICData*>* ic_data_array =
new(Z) ZoneGrowableArray<const ICData*>();
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698