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

Unified Diff: runtime/vm/compiler.cc

Issue 1679373002: Disable reg-exp compilation in background via a flag (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: b Created 4 years, 10 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/code_generator.cc ('k') | runtime/vm/flow_graph.h » ('j') | 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 5b67de0488728362a0a9205fa30cd2a2c3a7cb68..aaf0787fc23f6858bb842c94bac689beebc6bb81 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -518,28 +518,20 @@ void CompileParsedFunctionHelper::FinalizeCompilation(
}
// Register code with the classes it depends on because of CHA and
- // fields it depends on because of store guards.
- // Deoptimize field dependent code first, before registering
- // this yet uninstalled code as dependent on a field.
- // TODO(srdjan): Debugging dart2js crashes;
- // FlowGraphOptimizer::VisitStoreInstanceField populates
- // deoptimize_dependent_code() list, currently disabled.
- for (intptr_t i = 0;
- i < flow_graph->deoptimize_dependent_code().length();
- i++) {
- const Field* field = flow_graph->deoptimize_dependent_code()[i];
- field->DeoptimizeDependentCode();
- }
- 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);
+ // fields it depends on because of store guards, unless we cannot
+ // deopt.
+ if (!FLAG_precompilation) {
rmacnak 2016/02/09 20:26:11 Always true as precompiled code doesn't go through
srdjan 2016/02/09 20:44:43 Thanks, that was a sync issue,.
+ 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 (function.ic_data_array() == Array::null()) {
@@ -1325,8 +1317,11 @@ RawError* Compiler::CompileOptimizedFunction(Thread* thread,
// Optimization must happen in non-mutator/Dart thread if background
// compilation is on. OSR compilation still occurs in the main thread.
+ // TODO(Srdjan): Remove assert allowance for regular expression functions
+ // once they can be compiled in background.
ASSERT((osr_id != kNoOSRDeoptId) || !FLAG_background_compilation ||
- !thread->IsMutatorThread());
+ !thread->IsMutatorThread() ||
+ function.IsIrregexpFunction());
CompilationPipeline* pipeline =
CompilationPipeline::New(thread->zone(), function);
return CompileFunctionHelper(pipeline,
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698