mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:27:17 +00:00
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:
parent
720e67ea1a
commit
ab77310444
|
@ -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() &&
|
||||
|
|
Loading…
Reference in a new issue