protected void compile(MethodVisitor mv) { object.visit(mv); box(object.getType(), mv); prop.visit(mv); box(prop.getType(), mv); mv.visitMethodInsn( INVOKESTATIC, "org/codehaus/groovy/runtime/InvokerHelper", "getProperty", "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;"); }
public BytecodeExpr createAssign( ASTNode parent, final BytecodeExpr right, final CompilerTransformer compiler) { return new BytecodeExpr(parent, right.getType()) { protected void compile(MethodVisitor mv) { object.visit(mv); box(object.getType(), mv); prop.visit(mv); box(prop.getType(), mv); right.visit(mv); dup_x2(right.getType(), mv); box(right.getType(), mv); mv.visitMethodInsn( INVOKESTATIC, "org/codehaus/groovy/runtime/InvokerHelper", "setProperty", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V"); } }; }