Project

General

Profile

Feature #13924

Add headings/hints to RubyVM::InstructionSequence#disasm

Added by tonytonyjan (Wei-Hang Jian) about 2 years ago. Updated about 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:82896]

Description

As the official document mentions, this method will return a String with the human readable instructions. However, it is quite hard to read since we can not understand the definition of each column, for example:

puts RubyVM::InstructionSequence.compile("[4, 5].max").disasm
== disasm: #<ISeq:<compiled>@<compiled>>================================
0000 trace            1                                               (   1)
0002 duparray         [4, 5]
0004 opt_send_without_block <callinfo!mid:max, argc:0, ARGS_SIMPLE>, <callcache>
0007 leave

There is no clue can inform us that "( 1)" stands for the line number, is it possible to either improve documentation or add some hints to the output string?

History

#1

Updated by tonytonyjan (Wei-Hang Jian) about 2 years ago

  • Subject changed from Add a headings/hints to RubyVM::InstructionSequence#disasm to Add headings/hints to RubyVM::InstructionSequence#disasm

Also available in: Atom PDF