Don't register code for CHA or field guard deopt when precompiling.

dart2js ARM -0.5% size

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1430973005 .
This commit is contained in:
Ryan Macnak 2015-11-05 12:55:28 -08:00
parent 720e67ea1a
commit ab77310444

View file

@ -795,20 +795,23 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
function.InstallOptimizedCode(code, is_osr); function.InstallOptimizedCode(code, is_osr);
} }
// TODO(srdjan): In background compilation, verify that CHA has not // TODO(srdjan): In background compilation, verify that CHA and field
// been invalidated in the meantime. // guards have not been invalidated in the meantime.
// Register code with the classes it depends on because of CHA. // Register code with the classes it depends on because of CHA and
for (intptr_t i = 0; // fields it depends on because of store guards, unless we cannot
i < thread->cha()->leaf_classes().length(); // deopt.
++i) { if (Compiler::allow_recompilation()) {
thread->cha()->leaf_classes()[i]->RegisterCHACode(code); for (intptr_t i = 0;
} i < thread->cha()->leaf_classes().length();
++i) {
for (intptr_t i = 0; thread->cha()->leaf_classes()[i]->RegisterCHACode(code);
i < flow_graph->guarded_fields()->length(); }
i++) { for (intptr_t i = 0;
const Field* field = (*flow_graph->guarded_fields())[i]; i < flow_graph->guarded_fields()->length();
field->RegisterDependentCode(code); i++) {
const Field* field = (*flow_graph->guarded_fields())[i];
field->RegisterDependentCode(code);
}
} }
} else { // not optimized. } else { // not optimized.
if (!Compiler::always_optimize() && if (!Compiler::always_optimize() &&