private boolean hasFallthrough(SpecializationGroup group, TypeMirror forType, LocalContext currentValues, boolean fastPath, List<GuardExpression> ignoreGuards) { for (TypeGuard guard : group.getTypeGuards()) { if (currentValues.getValue(guard.getSignatureIndex()) == null) { LocalVariable value = currentValues.getValue(guard.getSignatureIndex()); if (needsCastTo(value.getTypeMirror(), guard.getType())) { return true;
protected String toString(Object element) { if (element instanceof SpecializationData) { SpecializationData specialization = (SpecializationData) element; if (specialization.isUninitialized()) { return "uninitialized"; } return ElementUtils.createReferenceName(specialization.getMethod()); } else if (element instanceof TypeGuard) { int index = ((TypeGuard) element).getSignatureIndex(); String simpleName = ElementUtils.getSimpleName(((TypeGuard) element).getType()); return index + ":" + simpleName; } return element.toString(); }
boolean canExecuteChild = execution.getIndex() < currentType.getEvaluatedCount(); for (TypeGuard checkedGuard : originalGroup.getTypeGuards()) { if (checkedGuard.getSignatureIndex() == execution.getIndex()) { canExecuteChild = true; break;
CodeTreeBuilder localsBuilder = CodeTreeBuilder.createBuilder(); for (TypeGuard typeGuard : typeGuards) { int signatureIndex = typeGuard.getSignatureIndex(); LocalVariable value = currentValues.getValue(signatureIndex); TypeMirror targetType = typeGuard.getType();
CodeTreeBuilder prepareBuilder = CodeTreeBuilder.createBuilder(); CodeTreeBuilder checkBuilder = CodeTreeBuilder.createBuilder(); int signatureIndex = typeGuard.getSignatureIndex(); LocalVariable value = frameState.getValue(signatureIndex); TypeMirror targetType = typeGuard.getType();
} else if (node.getChildExecutions().get(checkedGuard.getSignatureIndex()).getChild().findExecutableType(checkedGuard.getType()) == null) { if (checkedGuard.getSignatureIndex() == execution.getIndex()) { eliminatedGuard = checkedGuard; break;
private boolean isTypeGuardUsedInAnyGuardOrCacheBelow(SpecializationGroup group, LocalContext currentValues, TypeGuard typeGuard, boolean fastPath) { String localName = currentValues.getValue(typeGuard.getSignatureIndex()).getName(); SpecializationData specialization = group.getSpecialization(); for (GuardExpression guard : group.getGuards()) { if (isVariableBoundIn(specialization, guard.getExpression(), localName, currentValues)) { return true; } } if (!fastPath && specialization != null) { for (CacheExpression cache : specialization.getCaches()) { if (isVariableBoundIn(specialization, cache.getExpression(), localName, currentValues)) { return true; } } } for (SpecializationGroup child : group.getChildren()) { if (isTypeGuardUsedInAnyGuardOrCacheBelow(child, currentValues, typeGuard, fastPath)) { return true; } } return false; }