           if m.name is '<init>' then class_name
           else if m.name is '<clinit>' then '__clinit__'
           else m.name
+
         rs = new RuntimeState
+
+        vars = []
+        params_size = 0
+        for p in m.param_types
+          vars.push new Variable rs.var_count++
+          if p.toString() in ['D','J']
+            rs.put_cl2 params_size, _.last vars
+            params_size += 2
+          else
+            rs.put_cl params_size, _.last vars
+            params_size++
+
         m.code.each_opcode (idx, oc) ->
           opcodes[oc.name]?.execute rs, oc, idx
-        "#{name}: function() {\n#{rs.compile()}\n},"
+        "#{name}: function(#{vars.join ", "}) {\n#{rs.compile()}\n},"
+
   "var #{class_name} = {\n#{methods.join "\n"}\n};\n"
 
 # TODO: move to a separate file


  toString: -> @val

class BinaryOp extends Expr
  constructor: (@op_func, @left, @right) ->



opcodes = {
  nop: { execute: -> }
  aconst_null: { execute: (rs) -> rs.push new Primitive null }
  iconst_m1: { execute: (rs) -> rs.push new Primitive -1 }
  iconst_0: { execute: (rs) -> rs.push new Primitive 0 }
  iconst_1: { execute: (rs) -> rs.push new Primitive 1 }
