 
         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()
+        block_chain.compile()
 
         temps = block_chain.get_all_temps()
 
         """
-        #{name}: function(#{param_names.join ", "}) {
+        #{name}: function(#{block_chain.param_names.join ", "}) {
           var label = 0;
           #{if temps.length > 0 then "var #{temps.join ", "};" else ""}
           while (true) {

    @stack = []
    @locals = []
    @next = []
    @stmts = []
    @visited = false


    # the first block has its local vars set from the function params
    unless @start_idx == 0
      @stack =
        for s,i in prev_stack
          if s? then new StackVar i else null
      @locals =
        for l,i in prev_locals
          if l? then new LocalVar i else null

    instr_idx = @start_idx
    for op in @opcodes
