From 21468ef419664d9b72f907425c79ba4106877116 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Sat, 7 Feb 2015 10:00:48 -0800 Subject: [PATCH] Fixed issue with the instruction copier. Now it builds ok with synchronized instruction. Getting an error at runtime... --- teavm-core/src/main/java/org/teavm/javascript/Renderer.java | 4 ++-- .../src/main/java/org/teavm/model/InstructionReadVisitor.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/teavm-core/src/main/java/org/teavm/javascript/Renderer.java b/teavm-core/src/main/java/org/teavm/javascript/Renderer.java index a74505f75..e1e24e13f 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/Renderer.java +++ b/teavm-core/src/main/java/org/teavm/javascript/Renderer.java @@ -63,7 +63,7 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext Object.class, "monitorEnter", Object.class, void.class); writer.appendMethodBody(monitorEnterRef).append("("); - statement.acceptVisitor(this); + statement.getObjectRef().acceptVisitor(this); writer.append(");").softNewLine(); } catch (IOException ex){ @@ -80,7 +80,7 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext Object.class, "monitorExit", Object.class, void.class); writer.appendMethodBody(monitorExitRef).append("("); - statement.acceptVisitor(this); + statement.getObjectRef().acceptVisitor(this); writer.append(");").softNewLine(); } catch (IOException ex){ throw new RenderingException("IO error occured", ex); diff --git a/teavm-core/src/main/java/org/teavm/model/InstructionReadVisitor.java b/teavm-core/src/main/java/org/teavm/model/InstructionReadVisitor.java index 446953241..5d7627469 100644 --- a/teavm-core/src/main/java/org/teavm/model/InstructionReadVisitor.java +++ b/teavm-core/src/main/java/org/teavm/model/InstructionReadVisitor.java @@ -204,11 +204,11 @@ class InstructionReadVisitor implements InstructionVisitor { @Override public void visit(MonitorEnterInstruction insn) { - + reader.monitorEnter(insn.getObjectRef()); } @Override public void visit(MonitorExitInstruction insn) { - + reader.monitorExit(insn.getObjectRef()); } }