From d37da2b07876e599a2e9c70425c3aa5297749354 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Sat, 7 Feb 2015 07:34:02 -0800 Subject: [PATCH] Made small change to statement generator for monitor instructions. --- .../java/org/teavm/javascript/StatementGenerator.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/teavm-core/src/main/java/org/teavm/javascript/StatementGenerator.java b/teavm-core/src/main/java/org/teavm/javascript/StatementGenerator.java index 432bb0d5a..d341d27f6 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/StatementGenerator.java +++ b/teavm-core/src/main/java/org/teavm/javascript/StatementGenerator.java @@ -673,10 +673,7 @@ class StatementGenerator implements InstructionVisitor { MonitorEnterStatement stmt = new MonitorEnterStatement(); stmt.setLocation(currentLocation); - VariableExpr expr = new VariableExpr(); - expr.setIndex(insn.getObjectRef().getIndex()); - expr.setLocation(currentLocation); - stmt.setObjectRef(expr); + stmt.setObjectRef(Expr.var(insn.getObjectRef().getIndex())); statements.add(stmt); } @@ -684,10 +681,8 @@ class StatementGenerator implements InstructionVisitor { public void visit(MonitorExitInstruction insn) { MonitorExitStatement stmt = new MonitorExitStatement(); stmt.setLocation(currentLocation); - VariableExpr expr = new VariableExpr(); - expr.setLocation(currentLocation); - expr.setIndex(insn.getObjectRef().getIndex()); - stmt.setObjectRef(expr); + + stmt.setObjectRef(Expr.var(insn.getObjectRef().getIndex())); statements.add(stmt); } }