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

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: d 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
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 437c684f6e4ba91b2ccb91e38598b0923c66ad56..7283257c6f275585ad2d92035cfa86050d6629b6 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -694,14 +694,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 uint32_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->top_level_parsing() ||
siva 2016/03/28 17:20:14 This value is set in the mutator thread and access
srdjan 2016/03/28 19:54:54 dito
+ (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*>();

Powered by Google App Engine
This is Rietveld 408576698