mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 15:17:07 +00:00
Revert "VM: Handle null-comparisons in the flow graph type propagation"
This reverts commit 2cd2ffa949
.
Reason for revert:
This seems to have caused crashes on various windows builders
on service tests. The crashes seem to be slightly flaky.
Review-Url: https://codereview.chromium.org/2764753008 .
This commit is contained in:
parent
4d3719f54e
commit
30a942f728
2 changed files with 7 additions and 19 deletions
|
@ -350,7 +350,7 @@ void FlowGraphTypePropagator::VisitBranch(BranchInstr* instr) {
|
|||
} else if ((call != NULL) &&
|
||||
call->MatchesCoreName(Symbols::_simpleInstanceOf()) &&
|
||||
comparison->InputAt(1)->BindsToConstant() &&
|
||||
comparison->InputAt(1)->BoundConstant().IsBool()) {
|
||||
(comparison->InputAt(1)->BoundConstant().IsBool())) {
|
||||
ASSERT(call->ArgumentAt(1)->IsConstant());
|
||||
if (comparison->InputAt(1)->BoundConstant().raw() == Bool::False().raw()) {
|
||||
negated = !negated;
|
||||
|
@ -367,24 +367,8 @@ void FlowGraphTypePropagator::VisitBranch(BranchInstr* instr) {
|
|||
true_successor, call->ArgumentAt(0),
|
||||
CompileType::FromAbstractType(Type::Cast(type), is_nullable));
|
||||
}
|
||||
} else if (comparison->InputAt(0)->BindsToConstant() &&
|
||||
comparison->InputAt(0)->BoundConstant().IsNull()) {
|
||||
// Handle for expr != null.
|
||||
BlockEntryInstr* true_successor =
|
||||
negated ? instr->true_successor() : instr->false_successor();
|
||||
redef = flow_graph_->EnsureRedefinition(
|
||||
true_successor, comparison->InputAt(1)->definition(),
|
||||
comparison->InputAt(1)->Type()->CopyNonNullable());
|
||||
|
||||
} else if (comparison->InputAt(1)->BindsToConstant() &&
|
||||
comparison->InputAt(1)->BoundConstant().IsNull()) {
|
||||
// Handle for null != expr.
|
||||
BlockEntryInstr* true_successor =
|
||||
negated ? instr->true_successor() : instr->false_successor();
|
||||
redef = flow_graph_->EnsureRedefinition(
|
||||
true_successor, comparison->InputAt(0)->definition(),
|
||||
comparison->InputAt(0)->Type()->CopyNonNullable());
|
||||
}
|
||||
// TODO(fschneider): Add propagation for null-comparisons.
|
||||
// TODO(fschneider): Add propagation for generic is-tests.
|
||||
|
||||
// Grow types array if a new redefinition was inserted.
|
||||
|
|
|
@ -104,7 +104,11 @@ class CompileType : public ZoneAllocated {
|
|||
static CompileType Create(intptr_t cid, const AbstractType& type);
|
||||
|
||||
CompileType CopyNonNullable() const {
|
||||
return CompileType(kNonNullable, kIllegalCid, type_);
|
||||
return CompileType(kNonNullable, cid_, type_);
|
||||
}
|
||||
|
||||
static CompileType CreateNullable(bool is_nullable, intptr_t cid) {
|
||||
return CompileType(is_nullable, cid, NULL);
|
||||
}
|
||||
|
||||
// Create a new CompileType representing given abstract type. By default
|
||||
|
|
Loading…
Reference in a new issue