Type:
Class

The InstructionSequence class represents a compiled sequence of instructions for the Ruby Virtual Machine.

With it, you can get a handle to the instructions that make up a method or a proc, compile strings of Ruby code down to VM instructions, and disassemble instruction sequences to strings for easy inspection. It is mostly useful if you want to learn how the Ruby VM works, but it also lets you control various settings for the Ruby iseq compiler.

You can find the source for the VM instructions in insns.def in the Ruby source.

The instruction sequence results will almost certainly change as Ruby changes, so example output in this documentation may be different from what you see.

first_lineno
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

first_lineno() Instance Public methods Returns the number of the first source

2025-01-10 15:47:30
disassemble
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

InstructionSequence.disasm(body) â strInstructionSequence.disassemble(body) â str Class Public methods

2025-01-10 15:47:30
compile_option=
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

InstructionSequence.compile_option = options Class Public methods Sets the

2025-01-10 15:47:30
disasm
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

InstructionSequence.disasm(body) â strInstructionSequence.disassemble(body) â str Class Public methods

2025-01-10 15:47:30
path
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

path() Instance Public methods Returns the path of this instruction sequence

2025-01-10 15:47:30
disassemble 2
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

iseq.disassemble â str Instance Public methods Returns the instruction sequence

2025-01-10 15:47:30
compile_file
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

InstructionSequence.compile_file(file[, options]) â iseq Class Public methods Takes

2025-01-10 15:47:30
disasm 2
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

iseq.disasm â str Instance Public methods Returns the instruction sequence as

2025-01-10 15:47:30
of
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

of(p1) Class Public methods Returns the instruction sequence containing the

2025-01-10 15:47:30
line_trace_specify
  • References/Ruby on Rails/Ruby/Classes/RubyVM/RubyVM::InstructionSequence

line_trace_specify(p1, p2) Instance Public methods Experimental MRI

2025-01-10 15:47:30