FlowContext flowContext,
FlowInfo flowInfo) {
+ // TODO (philippe) shouldn't it be protected by a check whether reachable statement ?
+
// mark the synthetic variable as being used
synchroVariable.useFlag = LocalVariableBinding.USED;
* @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream
*/
public void generateCode(BlockScope currentScope, CodeStream codeStream) {
-
+
if ((bits & IsReachableMASK) == 0) {
return;
}
this.anyExceptionLabelsCount = 0;
}
int pc = codeStream.position;
-
+
// generate the synchronization expression
expression.generateCode(scope, codeStream, true);
if (block.isEmptyBlock()) {
// enter the monitor
codeStream.store(synchroVariable, true);
codeStream.monitorenter();
-
+
// generate the body of the synchronized block
this.enterAnyExceptionHandler(codeStream);
block.generateCode(scope, codeStream);
if (!blockExit) {
codeStream.load(synchroVariable);
codeStream.monitorexit();
+ this.exitAnyExceptionHandler();
codeStream.goto_(endLabel);
+ this.enterAnyExceptionHandler(codeStream);
}
// generate the body of the exception handler
- this.exitAnyExceptionHandler();
this.placeAllAnyExceptionHandlers();
codeStream.incrStackSize(1);
codeStream.load(synchroVariable);
codeStream.monitorexit();
+ this.exitAnyExceptionHandler();
codeStream.athrow();
if (!blockExit) {
endLabel.place();
//continue even on errors in order to have the TC done into the statements
synchroVariable = new LocalVariableBinding(SecretLocalDeclarationName, type, AccDefault, false);
scope.addLocalVariable(synchroVariable);
- synchroVariable.constant = NotAConstant; // not inlinable
- expression.implicitWidening(type, type);
+ synchroVariable.setConstant(NotAConstant); // not inlinable
+ expression.computeConversion(scope, type, type);
block.resolveUsing(scope);
}