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

Unified Diff: runtime/vm/compiler.cc

Issue 1430973005: Don't register code for CHA or field guard deopt when precompiling. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index bbf1430aa12cf3eccf45bf1e1a984ac7ba9e40a2..17fa6f7973f0cc52a2412bb74278a45c7f1bd9b5 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -795,20 +795,23 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
function.InstallOptimizedCode(code, is_osr);
}
- // TODO(srdjan): In background compilation, verify that CHA has not
- // been invalidated in the meantime.
- // Register code with the classes it depends on because of CHA.
- for (intptr_t i = 0;
- i < thread->cha()->leaf_classes().length();
- ++i) {
- thread->cha()->leaf_classes()[i]->RegisterCHACode(code);
- }
-
- for (intptr_t i = 0;
- i < flow_graph->guarded_fields()->length();
- i++) {
- const Field* field = (*flow_graph->guarded_fields())[i];
- field->RegisterDependentCode(code);
+ // TODO(srdjan): In background compilation, verify that CHA and field
+ // guards have not been invalidated in the meantime.
+ // Register code with the classes it depends on because of CHA and
+ // fields it depends on because of store guards, unless we cannot
+ // deopt.
+ if (Compiler::allow_recompilation()) {
+ for (intptr_t i = 0;
+ i < thread->cha()->leaf_classes().length();
+ ++i) {
+ thread->cha()->leaf_classes()[i]->RegisterCHACode(code);
+ }
+ for (intptr_t i = 0;
+ i < flow_graph->guarded_fields()->length();
+ i++) {
+ const Field* field = (*flow_graph->guarded_fields())[i];
+ field->RegisterDependentCode(code);
+ }
}
} else { // not optimized.
if (!Compiler::always_optimize() &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698