Skip to content

Commit

Permalink
Use AbstractBool in AbstractValueDomain and add TrivialAbstractValueD…
Browse files Browse the repository at this point in the history
…omain

Change-Id: I01c8ca95d48b89c47748e91ba7e4709c3e6f2e78
Reviewed-on: https://dart-review.googlesource.com/c/86700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
  • Loading branch information
johnniwinther authored and commit-bot@chromium.org committed Dec 10, 2018
1 parent e4df0c2 commit be532c0
Show file tree
Hide file tree
Showing 26 changed files with 1,374 additions and 613 deletions.
4 changes: 3 additions & 1 deletion pkg/compiler/lib/src/common_elements.dart
Expand Up @@ -1239,7 +1239,9 @@ class CommonElementsImpl
}
return selector.applies(_jsStringSplit) &&
(receiver == null ||
abstractValueDomain.canHit(receiver, jsStringSplit, selector));
abstractValueDomain
.isTargetingMember(receiver, jsStringSplit, selector)
.isPotentiallyTrue);
}

FunctionEntity _jsStringSplit;
Expand Down
4 changes: 3 additions & 1 deletion pkg/compiler/lib/src/dump_info.dart
Expand Up @@ -116,7 +116,9 @@ class ElementInfoCollector {
AbstractValue inferredType = _resultOfMember(field).type;
// If a field has an empty inferred type it is never used.
if (inferredType == null ||
closedWorld.abstractValueDomain.isEmpty(inferredType)) {
closedWorld.abstractValueDomain
.isEmpty(inferredType)
.isDefinitelyTrue) {
return null;
}

Expand Down
296 changes: 173 additions & 123 deletions pkg/compiler/lib/src/inferrer/abstract_value_domain.dart

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/compiler/lib/src/inferrer/inferrer_engine.dart
Expand Up @@ -833,7 +833,7 @@ class InferrerEngineImpl extends InferrerEngine {
MemberEntity member = info.calledElement;
inferredDataBuilder.addFunctionCalledInLoop(member);
} else if (info.mask != null &&
!abstractValueDomain.containsAll(info.mask)) {
abstractValueDomain.containsAll(info.mask).isDefinitelyFalse) {
// For instance methods, we only register a selector called in a
// loop if it is a typed selector, to avoid marking too many
// methods as being called from within a loop. This cuts down
Expand Down

0 comments on commit be532c0

Please sign in to comment.