Class: Optimize::IR::CallData
- Inherits:
-
Struct
- Object
- Struct
- Optimize::IR::CallData
- Defined in:
- lib/optimize/ir/call_data.rb
Overview
One call-site’s calldata record. Mirrors the on-disk shape at research/cruby/ibf-format.md §4.1 “call info (ci) entries”: per-cd: mid_idx, flag, argc, kwlen, kw_indices.
mid_idx and kw_indices are OBJECT-TABLE indices (ID refs), not resolved symbols — that mirrors how other operands are stored and preserves byte-identical round-trip. Resolution to Symbol happens via the passed object table (see IR::CallData#mid_symbol).
Constant Summary collapse
- FLAG_ARGS_SPLAT =
Calldata flag bits we care about in v1. Values from vm_callinfo.h (iseq.c). These are the exact C enum values.
0x01- FLAG_ARGS_BLOCKARG =
0x02- FLAG_FCALL =
0x04- FLAG_VCALL =
0x08- FLAG_ARGS_SIMPLE =
0x10- FLAG_BLOCKISEQ =
0x20- FLAG_KWARG =
0x40- FLAG_KW_SPLAT =
0x80- FLAG_TAILCALL =
0x100- FLAG_SUPER =
0x200- FLAG_ZSUPER =
0x400- FLAG_OPT_SEND =
0x800- FLAG_KW_SPLAT_MUT =
0x1000- FLAG_FORWARDING =
0x2000
Instance Attribute Summary collapse
-
#argc ⇒ Object
Returns the value of attribute argc.
-
#flag ⇒ Object
Returns the value of attribute flag.
-
#kw_indices ⇒ Object
Returns the value of attribute kw_indices.
-
#kwlen ⇒ Object
Returns the value of attribute kwlen.
-
#mid_idx ⇒ Object
Returns the value of attribute mid_idx.
Instance Method Summary collapse
- #args_simple? ⇒ Boolean
- #blockarg? ⇒ Boolean
- #fcall? ⇒ Boolean
- #has_kwargs? ⇒ Boolean
- #has_splat? ⇒ Boolean
- #mid_symbol(object_table) ⇒ Object
Instance Attribute Details
#argc ⇒ Object
Returns the value of attribute argc
13 14 15 |
# File 'lib/optimize/ir/call_data.rb', line 13 def argc @argc end |
#flag ⇒ Object
Returns the value of attribute flag
13 14 15 |
# File 'lib/optimize/ir/call_data.rb', line 13 def flag @flag end |
#kw_indices ⇒ Object
Returns the value of attribute kw_indices
13 14 15 |
# File 'lib/optimize/ir/call_data.rb', line 13 def kw_indices @kw_indices end |
#kwlen ⇒ Object
Returns the value of attribute kwlen
13 14 15 |
# File 'lib/optimize/ir/call_data.rb', line 13 def kwlen @kwlen end |
#mid_idx ⇒ Object
Returns the value of attribute mid_idx
13 14 15 |
# File 'lib/optimize/ir/call_data.rb', line 13 def mid_idx @mid_idx end |
Instance Method Details
#args_simple? ⇒ Boolean
32 |
# File 'lib/optimize/ir/call_data.rb', line 32 def args_simple? = (flag & FLAG_ARGS_SIMPLE) != 0 |
#blockarg? ⇒ Boolean
33 |
# File 'lib/optimize/ir/call_data.rb', line 33 def blockarg? = (flag & FLAG_ARGS_BLOCKARG) != 0 |
#fcall? ⇒ Boolean
31 |
# File 'lib/optimize/ir/call_data.rb', line 31 def fcall? = (flag & FLAG_FCALL) != 0 |
#has_kwargs? ⇒ Boolean
34 |
# File 'lib/optimize/ir/call_data.rb', line 34 def has_kwargs? = kwlen.positive? |
#has_splat? ⇒ Boolean
35 |
# File 'lib/optimize/ir/call_data.rb', line 35 def has_splat? = (flag & FLAG_ARGS_SPLAT) != 0 |
#mid_symbol(object_table) ⇒ Object
37 38 39 |
# File 'lib/optimize/ir/call_data.rb', line 37 def mid_symbol(object_table) object_table.resolve(mid_idx) end |