Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Typedefs | Functions | Variables
iseq.c File Reference
`#include "internal.h"`
`#include "ruby/util.h"`
`#include "eval_intern.h"`
`#include "gc.h"`
`#include "vm_core.h"`
`#include "iseq.h"`
`#include "id_table.h"`
`#include "builtin.h"`
`#include "insns.inc"`
`#include "insns_info.inc"`
`#include "mjit.h"`
`#include "node_name.inc"`

Go to the source code of this file.

## Data Structures
struct | insn_data_struct
struct | trace_set_local_events_struct
struct | trace_clear_local_events_struct
struct | succ_index_table
struct | succ_index_table::succ_dict_block

## Macros
#define | RUBY_VM_INSNS_INFO 1
#define | hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
#define | SET_COMPILE_OPTION(o, h, mem)
#define | SET_COMPILE_OPTION_NUM(o, h, mem)
#define | SET_COMPILE_OPTION(o, h, mem) rb_hash_aset((h), ID2SYM(rb_intern(#mem)), (o)->mem ? Qtrue : Qfalse)
#define | SET_COMPILE_OPTION_NUM(o, h, mem) rb_hash_aset((h), ID2SYM(rb_intern(#mem)), INT2NUM((o)->mem))
#define | CHECK_ARRAY(v) rb_to_array_type(v)
#define | CHECK_HASH(v) rb_to_hash_type(v)
#define | CHECK_STRING(v) rb_str_to_str(v)
#define | CHECK_SYMBOL(v) rb_to_symbol_type(v)
#define | INITIALIZED volatile /* suppress warnings by gcc 4.8 */
#define | CALL_FLAG(n) if (ci->flag & VM_CALL_##n) rb_ary_push(flags, rb_str_new2(#n))
#define | C(ev, cstr, l) if (events & ev) rb_ary_push(ary, rb_ary_new_from_args(2, l, ID2SYM(rb_intern(cstr))));
#define | DECL_SYMBOL(name) static ID sym_##name
#define | INIT_SYMBOL(name) sym_##name = rb_intern(#name)
#define | CHECK_EVENT(ev) if (events & ev) rb_ary_push(body, ID2SYM(rb_intern(#ev)));
#define | PARAM_TYPE(type) rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))
#define | PARAM_ID(i) body->local_table[(i)]
#define | PARAM(i, type)
#define | INSN_CODE(insn) (insn)
#define | IMMEDIATE_TABLE_SIZE 54 /* a multiple of 9, and < 128 */
#define | imm_block_rank_set(v, i, r) (v) |= (uint64_t)(r) << (7 * (i))
#define | imm_block_rank_get(v, i) (((int)((v) >> ((i) * 7))) & 0x7f)
#define | small_block_rank_set(v, i, r) (v) |= (uint64_t)(r) << (9 * ((i) - 1))
#define | small_block_rank_get(v, i) ((i) == 0 ? 0 : (((int)((v) >> (((i) - 1) * 9))) & 0x1ff))

## Typedefs
typedef VALUE | iseq_value_itr_t(void *ctx, VALUE obj)
typedef VALUE | rb_vm_insns_translator_t(const void *addr)
typedef struct insn_data_struct | insn_data_t

## Functions
void | rb_iseq_free (const rb_iseq_t *iseq)
void | rb_iseq_update_references (rb_iseq_t *iseq)
void | rb_iseq_mark (const rb_iseq_t *iseq)
size_t | rb_iseq_memsize (const rb_iseq_t *iseq)
struct rb_iseq_constant_body * | rb_iseq_constant_body_alloc (void)
VALUE | rb_iseq_pathobj_new (VALUE path, VALUE realpath)
void | rb_iseq_pathobj_set (const rb_iseq_t *iseq, VALUE path, VALUE realpath)
void | rb_iseq_insns_info_encode_positions (const rb_iseq_t *iseq)
unsigned int * | rb_iseq_insns_info_decode_positions (const struct rb_iseq_constant_body *body)
void | rb_iseq_init_trace (rb_iseq_t *iseq)
rb_iseq_t * | rb_iseq_new (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type type)
rb_iseq_t * | rb_iseq_new_top (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent)
rb_iseq_t * | rb_iseq_new_main (const rb_ast_body_t *ast, VALUE path, VALUE realpath, const rb_iseq_t *parent)
rb_iseq_t * | rb_iseq_new_with_opt (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, enum iseq_type type, const rb_compile_option_t *option)
rb_iseq_t * | rb_iseq_new_with_callback (const struct rb_iseq_new_with_callback_callback_func *ifunc, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, enum iseq_type type, const rb_compile_option_t *option)
const rb_iseq_t * | rb_iseq_load_iseq (VALUE fname)
VALUE | rb_iseq_load (VALUE data, VALUE parent, VALUE opt)
VALUE | rb_iseq_path (const rb_iseq_t *iseq)
VALUE | rb_iseq_realpath (const rb_iseq_t *iseq)
VALUE | rb_iseq_absolute_path (const rb_iseq_t *iseq)
VALUE | rb_iseq_label (const rb_iseq_t *iseq)
VALUE | rb_iseq_base_label (const rb_iseq_t *iseq)
VALUE | rb_iseq_first_lineno (const rb_iseq_t *iseq)
VALUE | rb_iseq_method_name (const rb_iseq_t *iseq)
void | rb_iseq_code_location (const rb_iseq_t *iseq, int *beg_pos_lineno, int *beg_pos_column, int *end_pos_lineno, int *end_pos_column)
VALUE | rb_iseq_coverage (const rb_iseq_t *iseq)
void | rb_iseq_remove_coverage_all (void)
VALUE | rb_iseqw_new (const rb_iseq_t *iseq)
const rb_iseq_t * | rb_iseqw_to_iseq (VALUE iseqw)
unsigned int | rb_iseq_line_no (const rb_iseq_t *iseq, size_t pos)
MJIT_FUNC_EXPORTED rb_event_flag_t | rb_iseq_event_flags (const rb_iseq_t *iseq, size_t pos)
void | rb_iseq_clear_event_flags (const rb_iseq_t *iseq, size_t pos, rb_event_flag_t reset)
int | rb_insn_unified_local_var_level (VALUE)
VALUE | rb_insn_operand_intern (const rb_iseq_t *iseq, VALUE insn, int op_no, VALUE op, int len, size_t pos, const VALUE *pnop, VALUE child)
int | rb_iseq_disasm_insn (VALUE ret, const VALUE *code, size_t pos, const rb_iseq_t *iseq, VALUE child)
| Disassemble a instruction Iseq -> Iseq inspect object. More...
VALUE | rb_iseq_disasm (const rb_iseq_t *iseq)
const char * | ruby_node_name (int node)
VALUE | rb_iseq_parameters (const rb_iseq_t *iseq, int is_proc)
VALUE | rb_iseq_defined_string (enum defined_type type)
void | rb_vm_encoded_insn_data_table_init (void)
int | rb_vm_insn_addr2insn (const void *addr)
void | rb_iseq_trace_flag_cleared (const rb_iseq_t *iseq, size_t pos)
int | rb_iseq_add_local_tracepoint_recursively (const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line)
int | rb_iseq_remove_local_tracepoint_recursively (const rb_iseq_t *iseq, VALUE tpval)
void | rb_iseq_trace_set (const rb_iseq_t *iseq, rb_event_flag_t turnon_events)
void | rb_iseq_trace_set_all (rb_event_flag_t turnon_events)
VALUE | rb_iseqw_local_variables (VALUE iseqval)
void | Init_ISeq (void)

## Variables
VALUE | rb_cISeq

## Macro Definition Documentation

## ◆ C

#define C | ( |  | ev,
|  |  | cstr,
|  |  | l
| ) |  | if (events & ev) rb_ary_push(ary, rb_ary_new_from_args(2, l, ID2SYM(rb_intern(cstr))));

## ◆ CALL_FLAG

#define CALL_FLAG | ( |  | n | ) | if (ci->flag & VM_CALL_##n) rb_ary_push(flags, rb_str_new2(#n))

## ◆ CHECK_ARRAY

#define CHECK_ARRAY | ( |  | v | ) | rb_to_array_type(v)

Definition at line 858 of file iseq.c.

## ◆ CHECK_EVENT

#define CHECK_EVENT | ( |  | ev | ) | if (events & ev) rb_ary_push(body, ID2SYM(rb_intern(#ev)));

## ◆ CHECK_HASH

#define CHECK_HASH | ( |  | v | ) | rb_to_hash_type(v)

Definition at line 859 of file iseq.c.

## ◆ CHECK_STRING

#define CHECK_STRING | ( |  | v | ) | rb_str_to_str(v)

Definition at line 860 of file iseq.c.

## ◆ CHECK_SYMBOL

#define CHECK_SYMBOL | ( |  | v | ) | rb_to_symbol_type(v)

Definition at line 861 of file iseq.c.

## ◆ DECL_SYMBOL

#define DECL_SYMBOL | ( |  | name | ) | static ID sym_##name

Definition at line 2544 of file iseq.c.

## ◆ hidden_obj_p

#define hidden_obj_p | ( |  | obj | ) | (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)

Definition at line 42 of file iseq.c.

## ◆ imm_block_rank_get

#define imm_block_rank_get | ( |  | v,
|  |  | i
| ) |  | (((int)((v) >> ((i) * 7))) & 0x7f)

Definition at line 3426 of file iseq.c.

## ◆ imm_block_rank_set

#define imm_block_rank_set | ( |  | v,
|  |  | i,
|  |  | r
| ) |  | (v) |= (uint64_t)(r) << (7 * (i))

Definition at line 3425 of file iseq.c.

## ◆ IMMEDIATE_TABLE_SIZE

#define IMMEDIATE_TABLE_SIZE 54 /* a multiple of 9, and < 128 */

Definition at line 3414 of file iseq.c.

## ◆ INIT_SYMBOL

#define INIT_SYMBOL | ( |  | name | ) | sym_##name = rb_intern(#name)

Definition at line 2547 of file iseq.c.

## ◆ INITIALIZED

#define INITIALIZED volatile /* suppress warnings by gcc 4.8 */

## ◆ INSN_CODE

#define INSN_CODE | ( |  | insn | ) | (insn)

## ◆ PARAM

#define PARAM | ( |  | i,
|  |  | type
| ) |  |

Value:
( \
PARAM_TYPE(type), \
rb_id2str(PARAM_ID(i)) ? \
rb_ary_push(a, ID2SYM(PARAM_ID(i))) : \
a)

## ◆ PARAM_ID

#define PARAM_ID | ( |  | i | ) | body->local_table[(i)]

## ◆ PARAM_TYPE

#define PARAM_TYPE | ( |  | type | ) | rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))

## ◆ RUBY_VM_INSNS_INFO

#define RUBY_VM_INSNS_INFO 1

Definition at line 20 of file iseq.c.

## ◆ SET_COMPILE_OPTION [1/2]

#define SET_COMPILE_OPTION | ( |  | o,
|  |  | h,
|  |  | mem
| ) |  |

Value:
{ VALUE flag = rb_hash_aref((h), ID2SYM(rb_intern(#mem))); \
if (flag == Qtrue) { (o)->mem = 1; } \
else if (flag == Qfalse) { (o)->mem = 0; } \
}

## ◆ SET_COMPILE_OPTION [2/2]

#define SET_COMPILE_OPTION | ( |  | o,
|  |  | h,
|  |  | mem
| ) |  | rb_hash_aset((h), ID2SYM(rb_intern(#mem)), (o)->mem ? Qtrue : Qfalse)

## ◆ SET_COMPILE_OPTION_NUM [1/2]

#define SET_COMPILE_OPTION_NUM | ( |  | o,
|  |  | h,
|  |  | mem
| ) |  |

Value:
{ VALUE num = rb_hash_aref(opt, ID2SYM(rb_intern(#mem))); \
if (!NIL_P(num)) (o)->mem = NUM2INT(num); \
}

## ◆ SET_COMPILE_OPTION_NUM [2/2]

#define SET_COMPILE_OPTION_NUM | ( |  | o,
|  |  | h,
|  |  | mem
| ) |  | rb_hash_aset((h), ID2SYM(rb_intern(#mem)), INT2NUM((o)->mem))

## ◆ small_block_rank_get

#define small_block_rank_get | ( |  | v,
|  |  | i
| ) |  | ((i) == 0 ? 0 : (((int)((v) >> (((i) - 1) * 9))) & 0x1ff))

Definition at line 3428 of file iseq.c.

## ◆ small_block_rank_set

#define small_block_rank_set | ( |  | v,
|  |  | i,
|  |  | r
| ) |  | (v) |= (uint64_t)(r) << (9 * ((i) - 1))

Definition at line 3427 of file iseq.c.

## Typedef Documentation

## ◆ insn_data_t

typedef struct insn_data_struct insn_data_t

## ◆ iseq_value_itr_t

typedef VALUE iseq_value_itr_t(void *ctx, VALUE obj)

Definition at line 147 of file iseq.c.

## ◆ rb_vm_insns_translator_t

typedef VALUE rb_vm_insns_translator_t(const void *addr)

Definition at line 148 of file iseq.c.

## Function Documentation

## ◆ Init_ISeq()

void Init_ISeq | ( | void |  | ) |

Definition at line 3541 of file iseq.c.

References rb_cISeq, rb_cObject, rb_cRubyVM, rb_define_class_under(), rb_define_method(), and rb_undef_alloc_func().

## ◆ rb_insn_operand_intern()

VALUE rb_insn_operand_intern | ( | const rb_iseq_t * | iseq,
|  | VALUE | insn,
|  | int | op_no,
|  | VALUE | op,
|  | int | len,
|  | size_t | pos,
|  | const VALUE * | pnop,
|  | VALUE | child
| ) |  |

Definition at line 1828 of file iseq.c.

References BIN, DEFINED_CONST_FROM, DEFINED_FUNC, DEFINED_REF, len, PRIdVALUE, PRIuVALUE, Qundef, rb_fstring_lit, rb_iseq_defined_string(), rb_sprintf(), rb_str_new_cstr, rb_type_str(), and types.

Referenced by rb_iseq_disasm_insn().

## ◆ rb_insn_unified_local_var_level()

int rb_insn_unified_local_var_level | ( | VALUE |  | ) |

## ◆ rb_iseq_absolute_path()

VALUE rb_iseq_absolute_path | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1039 of file iseq.c.

References iseq, and rb_iseq_realpath().

## ◆ rb_iseq_add_local_tracepoint_recursively()

int rb_iseq_add_local_tracepoint_recursively | ( | const rb_iseq_t * | iseq,
|  | rb_event_flag_t | turnon_events,
|  | VALUE | tpval,
|  | unsigned int | target_line
| ) |  |

Definition at line 3202 of file iseq.c.

References trace_set_local_events_struct::n, trace_set_local_events_struct::target_line, trace_set_local_events_struct::tpval, and trace_set_local_events_struct::turnon_events.

## ◆ rb_iseq_base_label()

VALUE rb_iseq_base_label | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1051 of file iseq.c.

References rb_iseq_location_struct::base_label, rb_iseq_struct::body, iseq, and rb_iseq_constant_body::location.

## ◆ rb_iseq_clear_event_flags()

void rb_iseq_clear_event_flags | ( | const rb_iseq_t * | iseq,
|  | size_t | pos,
|  | rb_event_flag_t | reset
| ) |  |

Definition at line 1786 of file iseq.c.

## ◆ rb_iseq_code_location()

void rb_iseq_code_location | ( | const rb_iseq_t * | iseq,
|  | int * | beg_pos_lineno,
|  | int * | beg_pos_column,
|  | int * | end_pos_lineno,
|  | int * | end_pos_column
| ) |  |

Definition at line 1076 of file iseq.c.

References rb_code_location_struct::beg_pos, rb_iseq_struct::body, rb_iseq_location_struct::code_location, rb_code_position_struct::column, rb_code_location_struct::end_pos, iseq, rb_code_position_struct::lineno, and rb_iseq_constant_body::location.

## ◆ rb_iseq_constant_body_alloc()

struct rb_iseq_constant_body* rb_iseq_constant_body_alloc | ( | void |  | ) |

Definition at line 433 of file iseq.c.

References rb_iseq_constant_body::iseq_unique_id, and ZALLOC.

## ◆ rb_iseq_coverage()

VALUE rb_iseq_coverage | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1086 of file iseq.c.

References iseq, and ISEQ_COVERAGE.

## ◆ rb_iseq_defined_string()

VALUE rb_iseq_defined_string | ( | enum defined_type | type | ) |

Definition at line 3033 of file iseq.c.

References GET_VM, numberof, OBJ_FREEZE, rb_gc_register_mark_object(), rb_str_new_cstr, ruby_xcalloc(), and str.

Referenced by rb_insn_operand_intern().

## ◆ rb_iseq_disasm()

VALUE rb_iseq_disasm | ( | const rb_iseq_t * | iseq | ) |

Definition at line 2278 of file iseq.c.

## ◆ rb_iseq_disasm_insn()

int rb_iseq_disasm_insn | ( | VALUE | ret,
|  | const VALUE * | code,
|  | size_t | pos,
|  | const rb_iseq_t * | iseq,
|  | VALUE | child
| ) |  |

Disassemble a instruction Iseq -> Iseq inspect object.

Definition at line 2021 of file iseq.c.

References iseq, len, PRIuSIZE, rb_insn_operand_intern(), rb_iseq_event_flags(), rb_iseq_line_no(), rb_str_cat2, rb_str_catf(), rb_str_concat(), rb_str_new, RSTRING_LEN, RUBY_EVENT_B_CALL, RUBY_EVENT_B_RETURN, RUBY_EVENT_C_CALL, RUBY_EVENT_C_RETURN, RUBY_EVENT_CALL, RUBY_EVENT_CLASS, RUBY_EVENT_COVERAGE_BRANCH, RUBY_EVENT_COVERAGE_LINE, RUBY_EVENT_END, RUBY_EVENT_LINE, RUBY_EVENT_RETURN, str, strcspn(), and types.

Referenced by rb_vmdebug_debug_print_pre().

## ◆ rb_iseq_event_flags()

MJIT_FUNC_EXPORTED rb_event_flag_t rb_iseq_event_flags | ( | const rb_iseq_t * | iseq,
|  | size_t | pos
| ) |  |

Definition at line 1774 of file iseq.c.

Referenced by rb_iseq_disasm_insn(), and rb_iseq_trace_set().

## ◆ rb_iseq_first_lineno()

VALUE rb_iseq_first_lineno | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1057 of file iseq.c.

References rb_iseq_struct::body, rb_iseq_location_struct::first_lineno, iseq, and rb_iseq_constant_body::location.

## ◆ rb_iseq_free()

void rb_iseq_free | ( | const rb_iseq_t * | iseq | ) |

Definition at line 89 of file iseq.c.

References rb_iseq_constant_body::iseq_insn_info::body, rb_iseq_struct::body, rb_iseq_constant_body::call_data, rb_iseq_constant_body::catch_table, rb_kwarg_call_data::ci_kw, rb_iseq_constant_body::ci_kw_size, rb_iseq_constant_body::ci_size, i, rb_iseq_constant_body::insns_info, rb_iseq_constant_body::is_entries, iseq, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::keyword, rb_call_info_with_kwarg::kw_arg, LIKELY, rb_iseq_constant_body::local_table, mjit_free_iseq(), NULL, rb_iseq_constant_body::opt_table, rb_iseq_constant_body::param, rb_iseq_constant_body::iseq_insn_info::positions, rb_iseq_shared_exc_local_tbl, RUBY_FREE_ENTER, ruby_xfree(), and rb_iseq_constant_body::iseq_insn_info::succ_index_table.

## ◆ rb_iseq_init_trace()

void rb_iseq_init_trace | ( | rb_iseq_t * | iseq | ) |

Definition at line 623 of file iseq.c.

References rb_iseq_struct::aux, rb_iseq_struct::exec, iseq, ISEQ_TRACE_EVENTS, rb_iseq_trace_set(), and ruby_vm_event_enabled_global_flags.

## ◆ rb_iseq_insns_info_decode_positions()

unsigned int* rb_iseq_insns_info_decode_positions | ( | const struct rb_iseq_constant_body * | body | ) |

Definition at line 613 of file iseq.c.

References rb_iseq_constant_body::insns_info, rb_iseq_constant_body::iseq_size, size, rb_iseq_constant_body::iseq_insn_info::size, and rb_iseq_constant_body::iseq_insn_info::succ_index_table.

## ◆ rb_iseq_insns_info_encode_positions()

void rb_iseq_insns_info_encode_positions | ( | const rb_iseq_t * | iseq | ) |

Definition at line 595 of file iseq.c.

References rb_iseq_struct::body, if(), rb_iseq_constant_body::insns_info, iseq, rb_iseq_constant_body::iseq_size, rb_iseq_constant_body::iseq_insn_info::positions, ruby_xfree(), size, rb_iseq_constant_body::iseq_insn_info::size, and rb_iseq_constant_body::iseq_insn_info::succ_index_table.

## ◆ rb_iseq_label()

VALUE rb_iseq_label | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1045 of file iseq.c.

References rb_iseq_struct::body, iseq, rb_iseq_location_struct::label, and rb_iseq_constant_body::location.

## ◆ rb_iseq_line_no()

unsigned int rb_iseq_line_no | ( | const rb_iseq_t * | iseq,
|  | size_t | pos
| ) |  |

Definition at line 1761 of file iseq.c.

Referenced by rb_iseq_disasm_insn().

## ◆ rb_iseq_load()

VALUE rb_iseq_load | ( | VALUE | data,
|  | VALUE | parent,
|  | VALUE | opt
| ) |  |

Definition at line 972 of file iseq.c.

## ◆ rb_iseq_load_iseq()

const rb_iseq_t* rb_iseq_load_iseq | ( | VALUE | fname | ) |

Definition at line 847 of file iseq.c.

References rb_check_funcall(), rb_cISeq, rb_intern, RBASIC_CLASS, and SPECIAL_CONST_P.

## ◆ rb_iseq_mark()

void rb_iseq_mark | ( | const rb_iseq_t * | iseq | ) |

Definition at line 287 of file iseq.c.

References rb_iseq_struct::body, FL_TEST, iseq, ISEQ_MARKABLE_ISEQ, RUBY_MARK_ENTER, RUBY_MARK_UNLESS_NULL, and rb_iseq_struct::wrapper.

## ◆ rb_iseq_memsize()

size_t rb_iseq_memsize | ( | const rb_iseq_t * | iseq | ) |

Definition at line 373 of file iseq.c.

References rb_iseq_struct::body, rb_iseq_constant_body::call_data, rb_iseq_constant_body::catch_table, rb_iseq_constant_body::ci_size, rb_iseq_constant_body::insns_info, int, iseq, ISEQ_EXECUTABLE_P, rb_iseq_constant_body::iseq_size, rb_iseq_constant_body::local_table_size, size, rb_iseq_constant_body::iseq_insn_info::size, and unsigned.

## ◆ rb_iseq_method_name()

VALUE rb_iseq_method_name | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1063 of file iseq.c.

References rb_iseq_location_struct::base_label, rb_iseq_struct::body, iseq, rb_iseq_constant_body::ISEQ_TYPE_METHOD, rb_iseq_constant_body::local_iseq, rb_iseq_constant_body::location, Qnil, and rb_iseq_constant_body::type.

## ◆ rb_iseq_new()

rb_iseq_t* rb_iseq_new | ( | const rb_ast_body_t * | ast,
|  | VALUE | name,
|  | VALUE | path,
|  | VALUE | realpath,
|  | const rb_iseq_t * | parent,
|  | enum iseq_type | type
| ) |  |

Definition at line 761 of file iseq.c.

References INT2FIX, name, path, rb_iseq_new_with_opt(), and realpath().

Referenced by rb_vm_call_cfunc().

## ◆ rb_iseq_new_main()

rb_iseq_t* rb_iseq_new_main | ( | const rb_ast_body_t * | ast,
|  | VALUE | path,
|  | VALUE | realpath,
|  | const rb_iseq_t * | parent
| ) |  |

Definition at line 785 of file iseq.c.

References INT2FIX, rb_iseq_constant_body::ISEQ_TYPE_MAIN, path, rb_fstring_lit, rb_iseq_new_with_opt(), and realpath().

## ◆ rb_iseq_new_top()

rb_iseq_t* rb_iseq_new_top | ( | const rb_ast_body_t * | ast,
|  | VALUE | name,
|  | VALUE | path,
|  | VALUE | realpath,
|  | const rb_iseq_t * | parent
| ) |  |

Definition at line 769 of file iseq.c.

References rb_iseq_constant_body::coverage, COVERAGE_TARGET_ONESHOT_LINES, INT2FIX, rb_iseq_constant_body::ISEQ_TYPE_TOP, len, rb_ast_body_struct::line_count, name, path, rb_default_coverage(), rb_get_coverage_mode(), rb_get_coverages(), rb_hash_aset(), rb_iseq_new_with_opt(), realpath(), and RTEST.

## ◆ rb_iseq_new_with_callback()

rb_iseq_t* rb_iseq_new_with_callback | ( | const struct rb_iseq_new_with_callback_callback_func * | ifunc,
|  | VALUE | name,
|  | VALUE | path,
|  | VALUE | realpath,
|  | VALUE | first_lineno,
|  | const rb_iseq_t * | parent,
|  | enum iseq_type | type,
|  | const rb_compile_option_t * | option
| ) |  |

Definition at line 828 of file iseq.c.

References iseq, and iseq_alloc().

## ◆ rb_iseq_new_with_opt()

rb_iseq_t* rb_iseq_new_with_opt | ( | const rb_ast_body_t * | ast,
|  | VALUE | name,
|  | VALUE | path,
|  | VALUE | realpath,
|  | VALUE | first_lineno,
|  | const rb_iseq_t * | parent,
|  | enum iseq_type | type,
|  | const rb_compile_option_t * | option
| ) |  |

Definition at line 807 of file iseq.c.

References iseq, iseq_alloc(), and rb_ast_body_struct::root.

Referenced by rb_iseq_new(), rb_iseq_new_main(), and rb_iseq_new_top().

## ◆ rb_iseq_parameters()

VALUE rb_iseq_parameters | ( | const rb_iseq_t * | iseq,
|  | int | is_proc
| ) |  |

Definition at line 2939 of file iseq.c.

References rb_iseq_constant_body::block_start, rb_iseq_struct::body, CONST_ID, rb_iseq_constant_body::flags, i, ID2SYM, iseq, key, rb_iseq_constant_body::keyword, rb_iseq_constant_body::lead_num, rb_iseq_constant_body::opt_num, rb_iseq_constant_body::param, PARAM, PARAM_ID, PARAM_TYPE, rb_iseq_constant_body::post_num, rb_iseq_constant_body::post_start, Qnil, rb_ary_new2, rb_ary_push(), rb_id2str, rb_iseq_constant_body::rest_start, and rb_iseq_constant_body::size.

## ◆ rb_iseq_path()

VALUE rb_iseq_path | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1027 of file iseq.c.

Referenced by rb_resolve_me_location(), and rb_sourcefile().

## ◆ rb_iseq_pathobj_new()

VALUE rb_iseq_pathobj_new | ( | VALUE | path,
|  | VALUE | realpath
| ) |  |

Definition at line 450 of file iseq.c.

References NIL_P, path, Qnil, rb_ary_new_from_args, rb_fstring(), rb_obj_freeze(), rb_str_cmp(), RB_TYPE_P, realpath(), T_STRING, and VM_ASSERT.

Referenced by rb_iseq_pathobj_set().

## ◆ rb_iseq_pathobj_set()

void rb_iseq_pathobj_set | ( | const rb_iseq_t * | iseq,
|  | VALUE | path,
|  | VALUE | realpath
| ) |  |

Definition at line 469 of file iseq.c.

References rb_iseq_struct::body, iseq, rb_iseq_constant_body::location, path, rb_iseq_location_struct::pathobj, rb_iseq_pathobj_new(), RB_OBJ_WRITE, and realpath().

Referenced by rb_vm_set_progname().

## ◆ rb_iseq_realpath()

VALUE rb_iseq_realpath | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1033 of file iseq.c.

Referenced by rb_iseq_absolute_path(), and rb_vm_set_progname().

## ◆ rb_iseq_remove_coverage_all()

void rb_iseq_remove_coverage_all | ( | void |  | ) |

Definition at line 1110 of file iseq.c.

References rb_objspace_each_objects().

Referenced by rb_reset_coverages().

## ◆ rb_iseq_remove_local_tracepoint_recursively()

int rb_iseq_remove_local_tracepoint_recursively | ( | const rb_iseq_t * | iseq,
|  | VALUE | tpval
| ) |  |

Definition at line 3258 of file iseq.c.

References trace_clear_local_events_struct::n, and trace_clear_local_events_struct::tpval.

## ◆ rb_iseq_trace_flag_cleared()

void rb_iseq_trace_flag_cleared | ( | const rb_iseq_t * | iseq,
|  | size_t | pos
| ) |  |

Definition at line 3140 of file iseq.c.

References rb_iseq_struct::body, iseq, and rb_iseq_constant_body::iseq_encoded.

## ◆ rb_iseq_trace_set()

void rb_iseq_trace_set | ( | const rb_iseq_t * | iseq,
|  | rb_event_flag_t | turnon_events
| ) |  |

Definition at line 3269 of file iseq.c.

References rb_iseq_struct::aux, rb_iseq_struct::body, rb_iseq_struct::exec, iseq, rb_iseq_constant_body::iseq_encoded, ISEQ_EXECUTABLE_P, rb_iseq_constant_body::iseq_size, pc, and rb_iseq_event_flags().

Referenced by rb_iseq_init_trace().

## ◆ rb_iseq_trace_set_all()

void rb_iseq_trace_set_all | ( | rb_event_flag_t | turnon_events | ) |

Definition at line 3315 of file iseq.c.

References rb_objspace_each_objects().

## ◆ rb_iseq_update_references()

void rb_iseq_update_references | ( | rb_iseq_t * | iseq | ) |

Definition at line 221 of file iseq.c.

References rb_iseq_location_struct::base_label, rb_iseq_struct::body, rb_iseq_constant_body::coverage, FL_TEST, iseq, ISEQ_MARKABLE_ISEQ, rb_iseq_location_struct::label, rb_iseq_constant_body::local_iseq, rb_iseq_constant_body::location, rb_iseq_constant_body::parent_iseq, rb_iseq_location_struct::pathobj, rb_iseq_constant_body::pc2branchindex, rb_gc_location(), and rb_iseq_constant_body::variable.

## ◆ rb_iseqw_to_iseq()

const rb_iseq_t* rb_iseqw_to_iseq | ( | VALUE | iseqw | ) |

Definition at line 1350 of file iseq.c.

## ◆ rb_vm_encoded_insn_data_table_init()

void rb_vm_encoded_insn_data_table_init | ( | void |  | ) |

Definition at line 3085 of file iseq.c.

References rb_vm_get_insns_address_table().

Referenced by ruby_setup().

## ◆ rb_vm_insn_addr2insn()

int rb_vm_insn_addr2insn | ( | const void * | addr | ) |

Definition at line 3111 of file iseq.c.

References key, st_data_t, and st_lookup().

## ◆ ruby_node_name()

const char* ruby_node_name | ( | int | node | ) |

Definition at line 2534 of file iseq.c.

References rb_bug().

Referenced by ruby_debug_print_node().

## Variable Documentation

## ◆ rb_cISeq

VALUE rb_cISeq

Definition at line 32 of file iseq.c.

Referenced by Init_ISeq(), and rb_iseq_load_iseq().

rb_hash_aref
VALUE rb_hash_aref(VALUE hash, VALUE key)
Definition: hash.c:1964
VALUE
unsigned long VALUE
Definition: ruby.h:102
rb_intern
#define rb_intern(str)
Qfalse
#define Qfalse
Definition: ruby.h:467
ID2SYM
#define ID2SYM(x)
Definition: ruby.h:414
PARAM_ID
#define PARAM_ID(i)
i
uint32_t i
Definition: rb_mjit_min_header-2.7.0.h:5464
NIL_P
#define NIL_P(v)
Definition: ruby.h:482
Qtrue
#define Qtrue
Definition: ruby.h:468
NUM2INT
#define NUM2INT(x)
Definition: ruby.h:715
h
size_t st_index_t h
Definition: rb_mjit_min_header-2.7.0.h:5462
ruby::backward::cxxanyargs::type
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:39