vm/codegen/instructions_gen.rb
# Using an array of Implementation objects, +methods+, print out
# the code for each instruction. This uses an indirect threaded
# goto to jump between instructions.
#
Using an array of Implementation objects, +methods+, print out
the code for each instruction. This uses an indirect threaded
goto to jump between instructions.
Using an array of Implementation objects + methods + print out the code for each instruction . This uses an indirect threaded goto to jump between instructions .
def generate_jump_implementations(methods, io, flow=false)
    io.puts generate_jump_table(methods)
    io.puts "DISPATCH;"
    methods.each do |impl|
      io.puts "  op_impl_#{impl.name.opcode}: {"
      if impl.super_insn?
        io.puts "  #{impl.body}"
      else
        args = impl.args
        case args.size
        when 2
          io.puts "  int #{args[0]} = next_int;"
          io.puts "  int #{args[1]} = next_int;"
          io.puts "  #{impl.body}"
        when 1
          io.puts "  int #{args[0]} = next_int;"
          io.puts "  #{impl.body}"
        when 0
          io.puts "  #{impl.body}"
        end
      end
      io.puts "  DISPATCH;"
      io.puts "  }"
    end
  end
def generate_jump_implementations ( methods , io , flow = false ) io . puts generate_jump_table ( methods ) io . puts "DISPATCH;" methods . each do | impl | io . puts "  op_impl_#{impl.name.opcode}: {" if impl . super_insn? io . puts "  #{impl.body}" else args = impl . args case args . size when 2 io . puts "  int #{args[0]} = next_int;" io . puts "  int #{args[1]} = next_int;" io . puts "  #{impl.body}" when 1 io . puts "  int #{args[0]} = next_int;" io . puts "  #{impl.body}" when 0 io . puts "  #{impl.body}" end end io . puts "  DISPATCH;" io . puts "  }" end end
Using an array of Implementation objects, +methods+, print out
the code for each instruction.
Using an array of Implementation objects + methods + print out the code for each instruction .
#if impl.name.check_interrupts? #  io.puts "    if(unlikely(state->interrupts.check)) return;" #end
methods
<not_specific>
io
<not_specific>
flow
<not_specific>