if (detector.failureInducing) {
return;
}
log.debug("Considering invariance of {}", that);
EffectSet exprEffects = ((AJCEffectAnnotatedTree) that.wrappedNode).effects.getEffectSet();
log.debug("Effects: {}", exprEffects);
// Escaping symbol uses are omitted to avoid concurrency problems.
// Write effects cause something to be omitted from moving out of the loop.
if (exprEffects.contains(EffectSet.EffectType.READ_ESCAPING)
|| exprEffects.contains(EffectSet.EffectType.WRITE_ESCAPING)
|| exprEffects.contains(EffectSet.EffectType.IO)) {
log.debug("No good - contains unacceptable writes of escaping reads.");
return;
}
if (exprEffects.contains(EffectSet.EffectType.READ_INTERNAL)) {
// Determine if this expression reads any symbols that are written in the loop.
SymbolSet readSymbols = new SymbolSet(exprEffects.readInternal);
log.debug("ReadSymbols: {}", readSymbols);
readSymbols.retainAll(writtenInLoop);
log.debug("After dropping: {}", readSymbols);
if (!readSymbols.isEmpty()) {
log.debug("No good - reads symbols written in the loop.");
return;
}
}
if (exprEffects.contains(EffectSet.EffectType.WRITE_INTERNAL)) {
// Determine if this expression writes any symbols that are read in the loop.
SymbolSet writeSymbols = new SymbolSet(exprEffects.writeInternal);
log.debug("ReadSymbols: {}", writeSymbols);
writeSymbols.retainAll(readInLoop);