Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
iseq.h File Reference

Go to the source code of this file.

## Data Structures
struct | iseq_compile_data
struct | rb_compile_option_struct
struct | iseq_insn_info_entry
struct | iseq_catch_table_entry
struct | iseq_compile_data_storage

## Macros
#define | ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])
#define | ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1])
#define | rb_iseq_t rb_iseq_t
#define | ISEQ_COVERAGE(iseq) iseq->body->variable.coverage
#define | ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &iseq->body->variable.coverage, cov)
#define | ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)
#define | ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)
#define | ISEQ_PC2BRANCHINDEX(iseq) iseq->body->variable.pc2branchindex
#define | ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &iseq->body->variable.pc2branchindex, h)
#define | ISEQ_FLIP_CNT(iseq) (iseq)->body->variable.flip_count
#define | ISEQ_TRACE_EVENTS
#define | ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
#define | ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2
#define | ISEQ_TRANSLATED IMEMO_FL_USER3
#define | ISEQ_MARKABLE_ISEQ IMEMO_FL_USER4
#define | ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW((iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0)
#define | INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)

## Typedefs
typedef struct rb_iseq_struct | rb_iseq_t

## Enumerations
enum | defined_type { DEFINED_NOT_DEFINED, DEFINED_NIL = 1, DEFINED_IVAR, DEFINED_LVAR, DEFINED_GVAR, DEFINED_CVAR, DEFINED_CONST, DEFINED_METHOD, DEFINED_YIELD, DEFINED_ZSUPER, DEFINED_SELF, DEFINED_TRUE, DEFINED_FALSE, DEFINED_ASGN, DEFINED_EXPR, DEFINED_IVAR2, DEFINED_REF, DEFINED_FUNC, DEFINED_CONST_FROM, DEFINED_NOT_DEFINED, DEFINED_NIL = 1, DEFINED_IVAR, DEFINED_LVAR, DEFINED_GVAR, DEFINED_CVAR, DEFINED_CONST, DEFINED_METHOD, DEFINED_YIELD, DEFINED_ZSUPER, DEFINED_SELF, DEFINED_TRUE, DEFINED_FALSE, DEFINED_ASGN, DEFINED_EXPR, DEFINED_IVAR2, DEFINED_REF, DEFINED_FUNC, DEFINED_CONST_FROM }

## Functions
VALUE | rb_iseq_ibf_dump (const rb_iseq_t *iseq, VALUE opt)
void | rb_ibf_load_iseq_complete (rb_iseq_t *iseq)
const rb_iseq_t * | rb_iseq_ibf_load (VALUE str)
const rb_iseq_t * | rb_iseq_ibf_load_bytes (const char *cstr, size_t)
VALUE | rb_iseq_ibf_load_extra_data (VALUE str)
void | rb_iseq_init_trace (rb_iseq_t *iseq)
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)
const rb_iseq_t * | rb_iseq_load_iseq (VALUE fname)
RUBY_SYMBOL_EXPORT_BEGIN VALUE | rb_iseq_compile_node (rb_iseq_t *iseq, const NODE *node)
VALUE | rb_iseq_compile_callback (rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func *ifunc)
VALUE * | rb_iseq_original_iseq (const rb_iseq_t *iseq)
void | rb_iseq_build_from_ary (rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE args, VALUE exception, VALUE body)
void | rb_iseq_mark_insn_storage (struct iseq_compile_data_storage *arena)
VALUE | rb_iseq_load (VALUE data, VALUE parent, VALUE opt)
VALUE | rb_iseq_parameters (const rb_iseq_t *iseq, int is_proc)
unsigned int | rb_iseq_line_no (const rb_iseq_t *iseq, size_t pos)
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)
void | rb_iseq_insns_info_encode_positions (const rb_iseq_t *iseq)
struct rb_iseq_constant_body * | rb_iseq_constant_body_alloc (void)
VALUE | rb_iseqw_new (const rb_iseq_t *iseq)
const rb_iseq_t * | rb_iseqw_to_iseq (VALUE iseqw)
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 *first_lineno, int *first_column, int *last_lineno, int *last_column)
void | rb_iseq_remove_coverage_all (void)
const rb_iseq_t * | rb_method_iseq (VALUE body)
const rb_iseq_t * | rb_proc_get_iseq (VALUE proc, int *is_proc)
| PACKED_STRUCT_UNALIGNED (struct iseq_catch_table { unsigned int size;struct iseq_catch_table_entry entries[FLEX_ARY_LEN];})
VALUE | rb_iseq_defined_string (enum defined_type type)
VALUE | rb_iseq_local_variables (const rb_iseq_t *iseq)

## Variables
const RUBY_EXTERN int | ruby_api_version []
const ID | rb_iseq_shared_exc_local_tbl []

## Macro Definition Documentation

## ◆ INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE

#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)

Definition at line 272 of file iseq.h.

## ◆ ISEQ_BRANCH_COVERAGE

#define ISEQ_BRANCH_COVERAGE | ( |  | iseq | ) | RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)

Definition at line 37 of file iseq.h.

## ◆ ISEQ_COVERAGE

#define ISEQ_COVERAGE | ( |  | iseq | ) | iseq->body->variable.coverage

Definition at line 34 of file iseq.h.

## ◆ ISEQ_COVERAGE_SET

#define ISEQ_COVERAGE_SET | ( |  | iseq,
|  |  | cov
| ) |  | RB_OBJ_WRITE(iseq, &iseq->body->variable.coverage, cov)

Definition at line 35 of file iseq.h.

## ◆ ISEQ_EXECUTABLE_P

#define ISEQ_EXECUTABLE_P | ( |  | iseq | ) | (FL_TEST_RAW((iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0)

Definition at line 90 of file iseq.h.

## ◆ ISEQ_FLIP_CNT

#define ISEQ_FLIP_CNT | ( |  | iseq | ) | (iseq)->body->variable.flip_count

Definition at line 42 of file iseq.h.

## ◆ ISEQ_LINE_COVERAGE

#define ISEQ_LINE_COVERAGE | ( |  | iseq | ) | RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)

Definition at line 36 of file iseq.h.

## ◆ ISEQ_MAJOR_VERSION

#define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])

Definition at line 16 of file iseq.h.

## ◆ ISEQ_MARKABLE_ISEQ

#define ISEQ_MARKABLE_ISEQ IMEMO_FL_USER4

Definition at line 88 of file iseq.h.

## ◆ ISEQ_MINOR_VERSION

#define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1])

Definition at line 17 of file iseq.h.

## ◆ ISEQ_NOT_LOADED_YET

#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1

Definition at line 85 of file iseq.h.

## ◆ ISEQ_PC2BRANCHINDEX

#define ISEQ_PC2BRANCHINDEX | ( |  | iseq | ) | iseq->body->variable.pc2branchindex

Definition at line 39 of file iseq.h.

## ◆ ISEQ_PC2BRANCHINDEX_SET

#define ISEQ_PC2BRANCHINDEX_SET | ( |  | iseq,
|  |  | h
| ) |  | RB_OBJ_WRITE(iseq, &iseq->body->variable.pc2branchindex, h)

Definition at line 40 of file iseq.h.

## ◆ ISEQ_TRACE_EVENTS

#define ISEQ_TRACE_EVENTS

Value:
(RUBY_EVENT_LINE | \
RUBY_EVENT_CLASS | \
RUBY_EVENT_END | \
RUBY_EVENT_CALL | \
RUBY_EVENT_RETURN| \
RUBY_EVENT_B_CALL| \
RUBY_EVENT_B_RETURN| \
RUBY_EVENT_COVERAGE_LINE| \
RUBY_EVENT_COVERAGE_BRANCH)

Definition at line 75 of file iseq.h.

## ◆ ISEQ_TRANSLATED

#define ISEQ_TRANSLATED IMEMO_FL_USER3

Definition at line 87 of file iseq.h.

## ◆ ISEQ_USE_COMPILE_DATA

#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2

Definition at line 86 of file iseq.h.

## ◆ rb_iseq_t

#define rb_iseq_t rb_iseq_t

Definition at line 21 of file iseq.h.

## Typedef Documentation

## ◆ rb_iseq_t

typedef struct rb_iseq_struct rb_iseq_t

Definition at line 20 of file iseq.h.

## Enumeration Type Documentation

## ◆ defined_type

enum defined_type

Enumerator
DEFINED_NOT_DEFINED |
DEFINED_NIL |
DEFINED_IVAR |
DEFINED_LVAR |
DEFINED_GVAR |
DEFINED_CVAR |
DEFINED_CONST |
DEFINED_METHOD |
DEFINED_YIELD |
DEFINED_ZSUPER |
DEFINED_SELF |
DEFINED_TRUE |
DEFINED_FALSE |
DEFINED_ASGN |
DEFINED_EXPR |
DEFINED_IVAR2 |
DEFINED_REF |
DEFINED_FUNC |
DEFINED_CONST_FROM |
DEFINED_NOT_DEFINED |
DEFINED_NIL |
DEFINED_IVAR |
DEFINED_LVAR |
DEFINED_GVAR |
DEFINED_CVAR |
DEFINED_CONST |
DEFINED_METHOD |
DEFINED_YIELD |
DEFINED_ZSUPER |
DEFINED_SELF |
DEFINED_TRUE |
DEFINED_FALSE |
DEFINED_ASGN |
DEFINED_EXPR |
DEFINED_IVAR2 |
DEFINED_REF |
DEFINED_FUNC |
DEFINED_CONST_FROM |

Definition at line 283 of file iseq.h.

## Function Documentation

## ◆ PACKED_STRUCT_UNALIGNED()

PACKED_STRUCT_UNALIGNED | ( | struct iseq_catch_table { unsigned int size;struct iseq_catch_table_entry entries[FLEX_ARY_LEN];} |  | ) |

## ◆ rb_ibf_load_iseq_complete()

void rb_ibf_load_iseq_complete | ( | rb_iseq_t * | iseq | ) |

Definition at line 11436 of file compile.c.

## ◆ rb_iseq_absolute_path()

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

Definition at line 1039 of file iseq.c.

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

## ◆ rb_iseq_base_label()

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

Definition at line 1051 of file iseq.c.

## ◆ rb_iseq_build_from_ary()

void rb_iseq_build_from_ary | ( | rb_iseq_t * | iseq,
|  | VALUE | misc,
|  | VALUE | locals,
|  | VALUE | args,
|  | VALUE | exception,
|  | VALUE | body
| ) |  |

Definition at line 9249 of file compile.c.

## ◆ rb_iseq_code_location()

void rb_iseq_code_location | ( | const rb_iseq_t * | iseq,
|  | int * | first_lineno,
|  | int * | first_column,
|  | int * | last_lineno,
|  | int * | last_column
| ) |  |

Definition at line 1076 of file iseq.c.

## ◆ rb_iseq_compile_callback()

VALUE rb_iseq_compile_callback | ( | rb_iseq_t * | iseq,
|  | const struct rb_iseq_new_with_callback_callback_func * | ifunc
| ) |  |

Definition at line 630 of file compile.c.

## ◆ rb_iseq_compile_node()

RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_compile_node | ( | rb_iseq_t * | iseq,
|  | const NODE * | node
| ) |  |

Definition at line 644 of file compile.c.

## ◆ rb_iseq_constant_body_alloc()

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

Definition at line 433 of file iseq.c.

## ◆ rb_iseq_defined_string()

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

Definition at line 3033 of file iseq.c.

## ◆ rb_iseq_first_lineno()

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

Definition at line 1057 of file iseq.c.

## ◆ rb_iseq_ibf_dump()

VALUE rb_iseq_ibf_dump | ( | const rb_iseq_t * | iseq,
|  | VALUE | opt
| ) |  |

Definition at line 11378 of file compile.c.

## ◆ rb_iseq_ibf_load()

const rb_iseq_t* rb_iseq_ibf_load | ( | VALUE | str | ) |

Definition at line 11602 of file compile.c.

## ◆ rb_iseq_ibf_load_bytes()

const rb_iseq_t* rb_iseq_ibf_load_bytes | ( | const char * | cstr,
|  | size_t |
| ) |  |

Definition at line 11616 of file compile.c.

## ◆ rb_iseq_ibf_load_extra_data()

VALUE rb_iseq_ibf_load_extra_data | ( | VALUE | str | ) |

Definition at line 11630 of file compile.c.

## ◆ rb_iseq_init_trace()

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

Definition at line 623 of file iseq.c.

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

## ◆ rb_iseq_label()

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

Definition at line 1045 of file iseq.c.

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

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

## ◆ rb_iseq_local_variables()

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

Definition at line 849 of file vm.c.

Referenced by rb_iseqw_local_variables().

## ◆ rb_iseq_mark_insn_storage()

void rb_iseq_mark_insn_storage | ( | struct iseq_compile_data_storage * | arena | ) |

Definition at line 9197 of file compile.c.

## ◆ rb_iseq_method_name()

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

Definition at line 1063 of file iseq.c.

## ◆ rb_iseq_original_iseq()

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

Definition at line 778 of file compile.c.

## ◆ rb_iseq_parameters()

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

Definition at line 2939 of file iseq.c.

## ◆ rb_iseq_remove_coverage_all()

void rb_iseq_remove_coverage_all | ( | void |  | ) |

Definition at line 1110 of file iseq.c.

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

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

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

## ◆ rb_iseqw_to_iseq()

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

Definition at line 1350 of file iseq.c.

## ◆ rb_method_iseq()

const rb_iseq_t* rb_method_iseq | ( | VALUE | body | ) |

Definition at line 2679 of file proc.c.

## ◆ rb_proc_get_iseq()

const rb_iseq_t* rb_proc_get_iseq | ( | VALUE | proc,
|  | int * | is_proc
| ) |  |

Definition at line 1194 of file proc.c.

Referenced by rb_resolve_me_location().

## Variable Documentation

## ◆ rb_iseq_shared_exc_local_tbl

const ID rb_iseq_shared_exc_local_tbl[]

Definition at line 110 of file compile.c.

## ◆ ruby_api_version

const RUBY_EXTERN int ruby_api_version[]

Definition at line 15 of file iseq.h.

RUBY_EVENT_LINE
#define RUBY_EVENT_LINE
Definition: ruby.h:2242