別のキーワード
クラス
- RubyVM (37)
-
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (246) - TracePoint (7)
モジュール
- ObjectSpace (12)
-
RubyVM
:: AbstractSyntaxTree (30) -
RubyVM
:: MJIT (21)
キーワード
- AbstractSyntaxTree (7)
-
DEFAULT
_ PARAMS (12) -
INSTRUCTION
_ NAMES (12) - InstructionSequence (12)
- MJIT (7)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) - Node (7)
- OPTS (12)
-
absolute
_ path (12) -
base
_ label (12) - children (7)
- compile (12)
-
compile
_ file (12) -
compile
_ option (12) -
compile
_ option= (12) -
count
_ tdata _ objects (12) - disasm (24)
- disassemble (24)
- enabled? (7)
- eval (12)
-
first
_ column (7) -
first
_ lineno (19) - inspect (19)
-
instruction
_ sequence (7) - label (12)
-
last
_ column (7) -
last
_ lineno (7) -
load
_ from _ binary (10) -
load
_ from _ binary _ extra _ data (10) - new (12)
- of (22)
- parse (10)
-
parse
_ file (10) - path (12)
- pause (7)
-
resolve
_ feature _ path (1) - resume (7)
-
to
_ a (12) -
to
_ binary (10) - type (7)
検索結果
先頭5件
-
RubyVM (44000.0)
-
Ruby の 内部情報へのアクセス手段を提供するクラスです。 デバッグ用、プロトタイピング用、研究用などの とても限定された用途向けです。 一般ユーザーは使うべきではありません。
...Ruby の 内部情報へのアクセス手段を提供するクラスです。
デバッグ用、プロトタイピング用、研究用などの
とても限定された用途向けです。
一般ユーザーは使うべきではありません。... -
RubyVM
:: DEFAULT _ PARAMS -> {Symbol => Integer} (24122.0) -
RubyVM のデフォルトのパラメータを返します。
...
RubyVM のデフォルトのパラメータを返します。
[注意] この値は C Ruby 固有のものです。変更しても RubyVM の動作に
は影響しません。また、仕様は変更される場合があるため、この値に依存すべ
きではありません。... -
RubyVM
:: INSTRUCTION _ NAMES -> [String] (24022.0) -
RubyVM の命令シーケンスの名前の一覧を返します。
...
RubyVM の命令シーケンスの名前の一覧を返します。
@see RubyVM::InstructionSequence... -
RubyVM
:: OPTS -> [String] (24016.0) -
RubyVM のビルドオプションの一覧を返します。
...
RubyVM のビルドオプションの一覧を返します。... -
RubyVM
. resolve _ feature _ path (24006.0) -
require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。
...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。
//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}... -
RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence (9335.0) -
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
...
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起......りません。自分が変換したバイナリデータを使うべきです。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence . load _ from _ binary _ extra _ data(binary) -> String (9218.0) -
バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。
...埋め込まれたextra_dataを取り出します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (9146.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
...して返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソ......to_binary で得たバイナリデータは他のマシンに移動できません。他のバージョンや他のアーキテクチャのRubyで作られたバイナリデータは使用できません。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_bina......ry("extra_data")
# ※表示の都合上改行しているが実際は改行はない
# => "YARB\x02\x00\x00\x00\x03\x00\x00\x00\x16\x02\x00\x00\n\x00\x00\x00\x01
# \x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x84\x01\x00\x00\x88\x01\x00
# \x00\x02\x02\x00\x00x86_64-darwin15\x00*\x00\x00\x00\x00\x0... -
RubyVM
:: InstructionSequence . disassemble(body) -> String (9146.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......------------------------------------------
local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1)
[ 2] num
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 d... -
RubyVM
:: InstructionSequence # base _ label -> String (9136.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
def hello......# 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...