10件ヒット
[1-10件を表示]
(0.080秒)
種類
- インスタンスメソッド (7)
- 特異メソッド (3)
ライブラリ
- ビルトイン (10)
キーワード
-
absolute
_ path (1) -
base
_ label (1) -
compile
_ option (1) - disasm (2)
- disassemble (2)
- inspect (1)
- label (1)
- path (1)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # disasm -> String (9610.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1......( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
@see RubyVM::InstructionSequence.disasm... -
RubyVM
:: InstructionSequence # disassemble -> String (9610.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1......( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
@see RubyVM::InstructionSequence.disasm... -
RubyVM
:: InstructionSequence . disasm(body) -> String (9610.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...引数 body で指定したオブジェクトから作成した
RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。
@param body Proc、Method オブジェクトを指定します。
例1:Proc オブジェクトを指定した場合......# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequence.disasm(p)
出力:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 00......クトを指定した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
puts RubyVM::InstructionSequence.disasm(method(:hello))
出力:
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8... -
RubyVM
:: InstructionSequence . disassemble(body) -> String (9610.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...引数 body で指定したオブジェクトから作成した
RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。
@param body Proc、Method オブジェクトを指定します。
例1:Proc オブジェクトを指定した場合......# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequence.disasm(p)
出力:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 00......クトを指定した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
puts RubyVM::InstructionSequence.disasm(method(:hello))
出力:
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (9607.0) -
self が表す命令シーケンスの絶対パスを返します。
...l を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def......hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # base _ label -> String (9607.0) -
self が表す命令シーケンスの基本ラベルを返します。
...返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
de......# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label... -
RubyVM
:: InstructionSequence # inspect -> String (9607.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
...んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # label -> String (9607.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def......end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@see RubyVM::InstructionSequence#base_label... -
RubyVM
:: InstructionSequence # path -> String (9607.0) -
self が表す命令シーケンスの相対パスを返します。
..." を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def......hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see RubyVM::InstructionSequence#absolute_path... -
RubyVM
:: InstructionSequence . compile _ option -> Hash (9040.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。
...スのコンパイル時のデフォルトの最適化オプションを Hash で返
します。
//emlist[例][ruby]{
require "pp"
pp RubyVM::InstructionSequence.compile_option
# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruc......>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}
@see RubyVM::InstructionSequence.compile_option=...