Lines 101-118
Link Here
|
101 |
} |
101 |
} |
102 |
|
102 |
|
103 |
// end of loop |
103 |
// end of loop |
104 |
FlowInfo mergedInfo = FlowInfo.mergedOptimizedBranches( |
104 |
FlowInfo mergedInfo = |
105 |
(loopingContext.initsOnBreak.tagBits & |
105 |
FlowInfo.mergedOptimizedBranches( |
106 |
FlowInfo.UNREACHABLE) != 0 ? |
106 |
(loopingContext.initsOnBreak.tagBits & FlowInfo.UNREACHABLE) != 0 |
107 |
loopingContext.initsOnBreak : |
107 |
? loopingContext.initsOnBreak |
108 |
flowInfo.unconditionalCopy().addInitializationsFrom(loopingContext.initsOnBreak), |
108 |
: flowInfo.unconditionalCopy().addInitializationsFrom(loopingContext.initsOnBreak), |
109 |
// recover upstream null info |
109 |
// recover upstream null info |
110 |
isConditionOptimizedTrue, |
110 |
isConditionOptimizedTrue, |
111 |
(condInfo.tagBits & FlowInfo.UNREACHABLE) == 0 ? |
111 |
(condInfo.tagBits & FlowInfo.UNREACHABLE) == 0 |
112 |
flowInfo.addInitializationsFrom(condInfo.initsWhenFalse()) : condInfo, |
112 |
? flowInfo.addInitializationsFrom(condInfo.initsWhenFalse()) |
113 |
// recover null inits from before condition analysis |
113 |
: condInfo, |
114 |
false, // never consider opt false case for DO loop, since break can always occur (47776) |
114 |
// recover null inits from before condition analysis |
115 |
!isConditionTrue /*do{}while(true); unreachable(); */); |
115 |
false, // never consider opt false case for DO loop, since break can always occur (47776) |
|
|
116 |
!isConditionTrue /*do{}while(true); unreachable(); */); |
116 |
this.mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo); |
117 |
this.mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo); |
117 |
return mergedInfo; |
118 |
return mergedInfo; |
118 |
} |
119 |
} |
Lines 144-162
Link Here
|
144 |
// continue label (135602) |
145 |
// continue label (135602) |
145 |
if (hasContinueLabel) { |
146 |
if (hasContinueLabel) { |
146 |
this.continueLabel.place(); |
147 |
this.continueLabel.place(); |
147 |
} |
148 |
// generate condition |
148 |
// generate condition |
149 |
Constant cst = this.condition.optimizedBooleanConstant(); |
149 |
Constant cst = this.condition.optimizedBooleanConstant(); |
150 |
boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false; |
150 |
boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false; |
151 |
if (isConditionOptimizedFalse){ |
151 |
if (isConditionOptimizedFalse){ |
152 |
this.condition.generateCode(currentScope, codeStream, false); |
152 |
this.condition.generateCode(currentScope, codeStream, false); |
153 |
} else { |
153 |
} else if (hasContinueLabel) { |
154 |
this.condition.generateOptimizedBoolean( |
154 |
this.condition.generateOptimizedBoolean( |
155 |
currentScope, |
155 |
currentScope, |
156 |
codeStream, |
156 |
codeStream, |
157 |
actionLabel, |
157 |
actionLabel, |
158 |
null, |
158 |
null, |
159 |
true); |
159 |
true); |
160 |
} |
160 |
} |
161 |
} |
161 |
// May loose some local variable initializations : affecting the local variable attributes |
162 |
// May loose some local variable initializations : affecting the local variable attributes |
162 |
if (this.mergedInitStateIndex != -1) { |
163 |
if (this.mergedInitStateIndex != -1) { |