るりまサーチ

最速Rubyリファレンスマニュアル検索!
499件ヒット [101-200件を表示] (0.069秒)
トップページ > クエリ:b[x] > クエリ:RubyVM[x]

別のキーワード

  1. string b
  2. _builtin b
  3. b string
  4. b
  5. b _builtin

検索結果

<< < 1 2 3 4 ... > >>

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...

RubyVM::InstructionSequence#label -> String (9136.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 hello
pu...
...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#absolute_path -> String | nil (9130.0)

self が表す命令シーケンスの絶対パスを返します。

...ます。

例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...

ObjectSpace.#count_tdata_objects(result_hash = nil) -> Hash (9118.0)

T_DATA の種類ごとにオブジェクトの数を格納したハッシュを返します。

...by プログラマ向けのメソッドではありません。パフォー
マンスに興味のある C Ruby の開発者向けのものです。

//emlist[例][ruby]{
ObjectSpace.count_tdata_objects
# => {RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
# :mutex=>6, Proc=>60, RubyVM...
...::Env=>57, Mutex=>1, Encoding=>99,
# ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
# Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
//}

現在のバージョンでは、戻り値のキーはクラスオブジェクトかシンボルのオブ
ジェクトです。...
...、キーはシンボルです。シンボルの値は
rb_data_type_struct に格納された名前が使用されます。

戻り値のハッシュは処理系に依存します。これは将来変更になるかもしれません。

本メソッドは C Ruby 以外では動作しません。...

RubyVM::InstructionSequence#disassemble -> String (9118.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 o...
...pt_plus <ic:1>
0008 leave

@see RubyVM::InstructionSequence.disasm...

絞り込み条件を変える

RubyVM::MJIT.enabled? -> bool (9112.0)

JIT が有効かどうかを返します。

...JIT が有効かどうかを返します。

@see RubyVM::MJIT.pause, RubyVM::MJIT.resume...

RubyVM::AbstractSyntaxTree (9012.0)

Ruby のコードをパースして得られる抽象構文木を扱うモジュールです。

...Ruby のコードをパースして得られる抽象構文木を扱うモジュールです。

抽象構文木はRubyVM::AbstractSyntaxTree::Nodeクラスのインスタンスとして表されます。


このモジュールはMRIの抽象構文木の実装の詳細を表します。

このモ...
...し安定したAPIやMRI以外の実装で抽象構文木を扱いたい場合、
parser gem (https://github.com/whitequark/parser)や
Ripperの使用を検討してください。
もし RubyVM::AbstractSyntaxTree のAPIを安定にしたい場合、14844 での議論に参加してください。...

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (6277.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...引数 body で指定した Proc、Method オブジェクトを元に
RubyVM
::InstructionSequence オブジェクトを作成して返します。

@param body Proc、Method オブジェクトを指定します。

例1:irb で実行した場合

# proc
> p = proc { num = 1 + 2 }
> RubyVM::Ins...
...# => <RubyVM::InstructionSequence:block in irb_binding@(irb)>

# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/iseq_of.rb
def...
...obal_proc = proc { str = 'a' + 'b' }

# irb
> require '/tmp/iseq_of.rb'

# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>

# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<Ruby...

RubyVM::InstructionSequence.compile_file(file, options = nil) -> RubyVM::InstructionSequence (6247.0)

引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...引数 file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM
::InstructionSequence オブジェクトを作成して返します。

RubyVM
::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。

@param...
...細は
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::Inst...

RubyVM::InstructionSequence.compile(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence (6242.0)

引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM
::InstructionSequence オブジェクトを作成して返します。

@param source Ruby のソースコードを文字列で指定します。

@param file ファイル名を文字列で指定しま...
...かで指定します。詳細は
RubyVM
::InstructionSequence.compile_option= を参照
してください。

RubyVM
::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>

@see RubyVM::InstructionSequence.compile_file...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>