種類
- インスタンスメソッド (125)
- 特異メソッド (106)
- 定数 (11)
- クラス (11)
クラス
- RubyVM (11)
-
RubyVM
:: InstructionSequence (225) - TracePoint (6)
キーワード
-
INSTRUCTION
_ NAMES (11) - InstructionSequence (11)
-
absolute
_ path (11) -
base
_ label (11) - compile (11)
-
compile
_ file (11) -
compile
_ option (11) -
compile
_ option= (11) - disasm (22)
- disassemble (22)
- eval (11)
-
first
_ lineno (11) - inspect (11)
-
instruction
_ sequence (6) - label (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - new (11)
- of (11)
- path (11)
-
to
_ a (11) -
to
_ binary (9)
検索結果
先頭5件
- TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence - RubyVM
:: INSTRUCTION _ NAMES -> [String] - RubyVM
:: InstructionSequence - RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence - RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence
-
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (12409.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...iledイベント発生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hell......o'")
end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
RubyVM
:: INSTRUCTION _ NAMES -> [String] (12203.0) -
RubyVM の命令シーケンスの名前の一覧を返します。
...RubyVM の命令シーケンスの名前の一覧を返します。
@see RubyVM::InstructionSequence... -
RubyVM
:: InstructionSequence (12002.0) -
Ruby の Virtual Machine のコンパイル済みの命令シーケンスを表すクラスです。
...y の Virtual Machine のコンパイル済みの命令シーケンスを表すクラスです。
Method、Proc オブジェクトや Ruby のソースコードを表す文字列
から VM の命令シーケンスを得る事ができます。また、
RubyVM::InstructionSequence オブジェクト......コンパイラの設定を
扱う必要がありますが、Ruby の VM がどのように働くかを知るのに有用です。
VM の命令シーケンスの一覧はRuby のソースコード中の insns.def から参照で
きます。
* https://github.com/ruby/ruby/blob/master/insns.def... -
RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (9202.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定しま......す。
@param path 引数 file の絶対パスファイル名を文字列で指定します。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指......定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (9202.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......rue、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!"
# irb
RubyVM::InstructionSequence.compile_file("....../tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (9202.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定しま......す。
@param path 引数 file の絶対パスファイル名を文字列で指定します。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指......定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
RubyVM
:: InstructionSequence . compile _ option -> Hash (9114.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。
...す。
//emlist[例][ruby]{
require "pp"
pp RubyVM::InstructionSequence.compile_option
# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_cac......hing=>false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}
@see RubyVM::InstructionSequence.compile_option=... -
RubyVM
:: InstructionSequence . compile _ option=(options) (9114.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを引数 options で指定します。
...ram options コンパイル時の最適化オプションを true、false、nil、
Hash のいずれかで指定します。true を指定した場合は
全てのオプションを有効にします。false を指定した場合は全
てのオプショ......rue か false を指定する事で個
別に有効、無効を指定します。
//emlist{
* :inline_const_cache
* :instructions_unification
* :operands_unification
* :peephole_optimization
* :specialized_instruction
* :stack_caching
* :tailcall_optimization
* :trace_......:debug_level をキーに指定した場合は値を数値で指定します。
.new、.compile、.compile_file メソッドの実行の際に option 引数を指定し
た場合はその実行のみ最適化オプションを変更する事もできます。
@see RubyVM::InstructionSequence.new,... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (9102.0) -
self が表す命令シーケンスの絶対パスを返します。
...elf が表す命令シーケンスの絶対パスを返します。
self を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
ise......te_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::Instruction......Sequence#path... -
RubyVM
:: InstructionSequence # base _ label -> String (9102.0) -
self が表す命令シーケンスの基本ラベルを返します。
...self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.co......le_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSeq......uence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label...