       b.push val
   ArrayLoadOpcode: (b) ->
     temp = b.new_temp()
-    b.add_stmt """
-    var idx = #{b.pop()};
-    var obj = rs.check_null(#{b.pop()});
+    b.add_stmt new Expr """
+    var idx = $0;
+    var obj = rs.check_null($1);
     var array = obj.array;
     if (!(0 <= idx && idx < array.length))
       java_throw(rs, 'java/lang/ArrayIndexOutOfBoundsException',
         idx + " not in length " + array.length + " array of type " + obj.type.toClassString());
-    #{temp} = array[idx]
-    """
+    $2 = array[idx]
+    """, b.pop(), b.pop(), temp
     if @name.match /[ld]aload/ then b.push2 temp else b.push temp
   UnaryBranchOpcode: (b, idx) ->
     cmpCode = @name[2..]


        block_chain = new BlockChain m

        param_names = ['rs']
        params_size = 0
        unless m.access_flags.static
          param_name = block_chain.new_temp()
          param_names.push param_name
          block_chain.blocks[0].put_cl(params_size++, param_name)

        for p in m.param_types
          param_name = block_chain.new_temp()
          param_names.push param_name
          if p.toString() in ['D','J']
            block_chain.blocks[0].put_cl2(params_size, param_name)
            params_size += 2
          else
            block_chain.blocks[0].put_cl(params_size++, param_name)

        block_chain.blocks[0].compile()

        temps = block_chain.get_all_temps()

        """
        #{name}: function(#{param_names.join ", "}) {
          var label = 0;
          #{if temps.length > 0 then "var #{temps.join ", "};" else ""}
          while (true) {


  arraylength: { compile: (b) ->
    t = b.new_temp()
    b.add_stmt new Move t, new Expr "rs.check_null($0).array.length", b.pop()
    b.push t
  }

  getstatic: { compile: (b) ->
    t = b.new_temp()
    b.add_stmt new Move t, "rs.static_get(#{JSON.stringify @field_spec})"
    if @field_spec.type in ['J','D'] then b.push2 t else b.push t
  }

  'new': { compile: (b) ->
    t = b.new_temp()
    b.add_stmt new Move t, "rs.init_object(#{JSON.stringify @class})"
    b.push t
  }

  goto: { compile: (b, idx) ->
    b.next = [b.block_chain.get_block_from_instr @offset + idx]
    b.add_stmt -> b.compile_epilogue()
    b.add_stmt "label = #{@offset + idx}; continue"
  }

  goto_w: { compile: (b, idx) ->
    b.next = [b.block_chain.get_block_from_instr @offset + idx]
    b.add_stmt -> b.compile_epilogue()
    b.add_stmt "label = #{@offset + idx}; continue"
  }
