るりまサーチ

最速Rubyリファレンスマニュアル検索!
52件ヒット [1-52件を表示] (1.799秒)
トップページ > クラス:RubyVM::InstructionSequence[x] > クエリ:disassemble[x]

別のキーワード

  1. _builtin disassemble
  2. instructionsequence disassemble
  3. disassemble rubyvm::instructionsequence
  4. disassemble _builtin

ライブラリ

検索結果

RubyVM::InstructionSequence#disassemble -> String (15102.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...ンスを人間が読める形式の文字列に変換して返します。

```ruby
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
```

```text title="出力"
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1...
...( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
```

- **SEE** [m:RubyVM::InstructionSequence.disasm]...

RubyVM::InstructionSequence.disassemble(body) -> String (15102.0)

引数 body で指定したオブジェクトから作成した [c:RubyVM::InstructionSequence] オブジェクトを人間が読める形式の文字列に変換して返します。

...引数 body で指定したオブジェクトから作成した
[c:RubyVM::InstructionSequence] オブジェクトを人間が読める形式の文字列に変換して返します。

- **param** `body` -- [c:Proc]、[c:Method] オブジェクトを指定します。

例1:[c:Proc] オブジェク...
...トを指定した場合

```ruby
# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequence.disasm(p)
```

```text title="出力"
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch...
...を指定した場合

```ruby
# /tmp/method.rb
def hello
puts "hello, world"
end

puts RubyVM::InstructionSequence.disasm(method(:hello))
```

```text title="出力"
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8...

RubyVM::InstructionSequence#disasm -> String (2.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...ンスを人間が読める形式の文字列に変換して返します。

```ruby
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
```

```text title="出力"
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1...
...( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
```

- **SEE** [m:RubyVM::InstructionSequence.disasm]...

RubyVM::InstructionSequence.disasm(body) -> String (2.0)

引数 body で指定したオブジェクトから作成した [c:RubyVM::InstructionSequence] オブジェクトを人間が読める形式の文字列に変換して返します。

...引数 body で指定したオブジェクトから作成した
[c:RubyVM::InstructionSequence] オブジェクトを人間が読める形式の文字列に変換して返します。

- **param** `body` -- [c:Proc]、[c:Method] オブジェクトを指定します。

例1:[c:Proc] オブジェク...
...トを指定した場合

```ruby
# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequence.disasm(p)
```

```text title="出力"
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch...
...を指定した場合

```ruby
# /tmp/method.rb
def hello
puts "hello, world"
end

puts RubyVM::InstructionSequence.disasm(method(:hello))
```

```text title="出力"
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8...