Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2011 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 164-173
Link Here
|
164 |
if (hasThenPart) { |
164 |
if (hasThenPart) { |
165 |
BranchLabel falseLabel = null; |
165 |
BranchLabel falseLabel = null; |
166 |
// generate boolean condition only if needed |
166 |
// generate boolean condition only if needed |
167 |
if (((this.bits & ASTNode.IsElseStatementUnreachable) != 0) || |
167 |
if (cst != Constant.NotAConstant && cst.booleanValue() == true) { |
168 |
(cst != Constant.NotAConstant && cst.booleanValue() == true)) { |
|
|
169 |
// No need to generate if condition statement when we know that only the then action |
170 |
// will be executed |
171 |
this.condition.generateCode(currentScope, codeStream, false); |
168 |
this.condition.generateCode(currentScope, codeStream, false); |
172 |
} else { |
169 |
} else { |
173 |
this.condition.generateOptimizedBoolean( |
170 |
this.condition.generateOptimizedBoolean( |
Lines 206-215
Link Here
|
206 |
} |
203 |
} |
207 |
} else if (hasElsePart) { |
204 |
} else if (hasElsePart) { |
208 |
// generate boolean condition only if needed |
205 |
// generate boolean condition only if needed |
209 |
if (((this.bits & ASTNode.IsThenStatementUnreachable) != 0) || |
206 |
if (cst != Constant.NotAConstant && cst.booleanValue() == false) { |
210 |
(cst != Constant.NotAConstant && cst.booleanValue() == false)) { |
|
|
211 |
// No need to generate if condition statement when we know that only the else action |
212 |
// will be executed |
213 |
this.condition.generateCode(currentScope, codeStream, false); |
207 |
this.condition.generateCode(currentScope, codeStream, false); |
214 |
} else { |
208 |
} else { |
215 |
this.condition.generateOptimizedBoolean( |
209 |
this.condition.generateOptimizedBoolean( |