Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Typedefs | Enumerations | Functions
iseq.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rb_compile_option_struct
 
struct  iseq_line_info_entry
 
struct  iseq_catch_table_entry
 
struct  iseq_compile_data_storage
 
struct  iseq_compile_data
 

Macros

#define ISEQ_MAJOR_VERSION   2
 
#define ISEQ_MINOR_VERSION   3
 
#define rb_iseq_t   rb_iseq_t
 
#define ISEQ_MARK_ARY(iseq)   (iseq)->body->mark_ary
 
#define ISEQ_COVERAGE(iseq)   RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE)
 
#define ISEQ_COVERAGE_SET(iseq, cov)   RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE, cov)
 
#define ISEQ_FLIP_CNT(iseq)   FIX2INT(RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_FLIP_CNT))
 
#define ISEQ_COMPILE_DATA(iseq)   (iseq)->aux.compile_data
 
#define ISEQ_NOT_LOADED_YET   IMEMO_FL_USER1
 
#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE   (512)
 
#define SIZEOF_ISEQ_COMPILE_DATA_STORAGE   (sizeof(struct iseq_compile_data_storage) - 1)
 

Typedefs

typedef struct rb_iseq_struct rb_iseq_t
 

Enumerations

enum  iseq_mark_ary_index { ISEQ_MARK_ARY_COVERAGE, ISEQ_MARK_ARY_FLIP_CNT, ISEQ_MARK_ARY_ORIGINAL_ISEQ, ISEQ_MARK_ARY_INITIAL_SIZE }
 
enum  defined_type {
  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
}
 

Functions

static size_t rb_call_info_kw_arg_bytes (int keyword_len)
 
static VALUE iseq_mark_ary_create (int flip_cnt)
 
static int ISEQ_FLIP_CNT_INCREMENT (const rb_iseq_t *iseq)
 
static VALUEISEQ_ORIGINAL_ISEQ (const rb_iseq_t *iseq)
 
static VALUEISEQ_ORIGINAL_ISEQ_ALLOC (const rb_iseq_t *iseq, long size)
 
static rb_iseq_tiseq_imemo_alloc (void)
 
VALUE iseq_ibf_dump (const rb_iseq_t *iseq, VALUE opt)
 
void ibf_load_iseq_complete (rb_iseq_t *iseq)
 
const rb_iseq_tiseq_ibf_load (VALUE str)
 
VALUE iseq_ibf_load_extra_data (VALUE str)
 
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_compile_node (rb_iseq_t *iseq, NODE *node)
 
int rb_iseq_translate_threaded_code (rb_iseq_t *iseq)
 
VALUErb_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_add_mark_object (const rb_iseq_t *iseq, VALUE obj)
 
VALUE rb_iseq_load (VALUE data, VALUE parent, VALUE opt)
 
VALUE rb_iseq_parameters (const rb_iseq_t *iseq, int is_proc)
 
struct st_tableruby_insn_make_insn_table (void)
 
unsigned int rb_iseq_line_no (const rb_iseq_t *iseq, size_t pos)
 
int rb_iseqw_line_trace_each (VALUE iseqval, int(*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data)
 
VALUE rb_iseqw_line_trace_all (VALUE iseqval)
 
VALUE rb_iseqw_line_trace_specify (VALUE iseqval, VALUE pos, VALUE set)
 
VALUE rb_iseqw_new (const rb_iseq_t *iseq)
 
const rb_iseq_trb_iseqw_to_iseq (VALUE iseqw)
 
VALUE rb_iseq_path (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)
 
const rb_iseq_trb_method_iseq (VALUE body)
 
const rb_iseq_trb_proc_get_iseq (VALUE proc, int *is_proc)
 
 PACKED_STRUCT_UNALIGNED (struct iseq_catch_table { unsigned int size;struct iseq_catch_table_entry entries[1];})
 
static int iseq_catch_table_bytes (int n)
 
VALUE rb_iseq_defined_string (enum defined_type type)
 
void rb_iseq_make_compile_option (struct rb_compile_option_struct *option, VALUE opt)
 
VALUE rb_iseq_local_variables (const rb_iseq_t *iseq)
 

Macro Definition Documentation

◆ INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE

#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE   (512)

Definition at line 178 of file iseq.h.

Referenced by prepare_iseq_build().

◆ ISEQ_COMPILE_DATA

#define ISEQ_COMPILE_DATA (   iseq)    (iseq)->aux.compile_data

◆ ISEQ_COVERAGE

#define ISEQ_COVERAGE (   iseq)    RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE)

Definition at line 48 of file iseq.h.

Referenced by iseq_ibf_dump(), and rb_iseq_coverage().

◆ ISEQ_COVERAGE_SET

#define ISEQ_COVERAGE_SET (   iseq,
  cov 
)    RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE, cov)

Definition at line 49 of file iseq.h.

Referenced by prepare_iseq_build().

◆ ISEQ_FLIP_CNT

#define ISEQ_FLIP_CNT (   iseq)    FIX2INT(RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_FLIP_CNT))

Definition at line 51 of file iseq.h.

Referenced by ibf_dump_iseq_each(), and ISEQ_FLIP_CNT_INCREMENT().

◆ ISEQ_MAJOR_VERSION

#define ISEQ_MAJOR_VERSION   2

Definition at line 15 of file iseq.h.

Referenced by ibf_load_setup(), iseq_data_to_ary(), and iseq_ibf_dump().

◆ ISEQ_MARK_ARY

#define ISEQ_MARK_ARY (   iseq)    (iseq)->body->mark_ary

◆ ISEQ_MINOR_VERSION

#define ISEQ_MINOR_VERSION   3

Definition at line 16 of file iseq.h.

Referenced by ibf_load_setup(), iseq_data_to_ary(), and iseq_ibf_dump().

◆ ISEQ_NOT_LOADED_YET

#define ISEQ_NOT_LOADED_YET   IMEMO_FL_USER1

Definition at line 85 of file iseq.h.

Referenced by ibf_load_iseq(), ibf_load_iseq_complete(), and rb_iseq_mark().

◆ rb_iseq_t

#define rb_iseq_t   rb_iseq_t

Definition at line 20 of file iseq.h.

◆ SIZEOF_ISEQ_COMPILE_DATA_STORAGE

#define SIZEOF_ISEQ_COMPILE_DATA_STORAGE   (sizeof(struct iseq_compile_data_storage) - 1)

Definition at line 188 of file iseq.h.

Referenced by compile_data_alloc(), iseq_memsize(), and prepare_iseq_build().

Typedef Documentation

◆ rb_iseq_t

typedef struct rb_iseq_struct rb_iseq_t

Definition at line 19 of file iseq.h.

Enumeration Type Documentation

◆ defined_type

Enumerator
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 

Definition at line 224 of file iseq.h.

◆ iseq_mark_ary_index

Enumerator
ISEQ_MARK_ARY_COVERAGE 
ISEQ_MARK_ARY_FLIP_CNT 
ISEQ_MARK_ARY_ORIGINAL_ISEQ 
ISEQ_MARK_ARY_INITIAL_SIZE 

Definition at line 29 of file iseq.h.

Function Documentation

◆ ibf_load_iseq_complete()

void ibf_load_iseq_complete ( rb_iseq_t iseq)

◆ iseq_catch_table_bytes()

static int iseq_catch_table_bytes ( int  n)
inlinestatic

Definition at line 168 of file iseq.h.

References rb_fatal().

Referenced by ibf_dump_catch_table(), ibf_load_catch_table(), iseq_memsize(), and iseq_set_exception_table().

◆ ISEQ_FLIP_CNT_INCREMENT()

static int ISEQ_FLIP_CNT_INCREMENT ( const rb_iseq_t iseq)
inlinestatic

Definition at line 54 of file iseq.h.

References cnt, INT2FIX, ISEQ_FLIP_CNT, ISEQ_MARK_ARY, ISEQ_MARK_ARY_FLIP_CNT, and RARRAY_ASET.

Referenced by compile_flip_flop().

◆ iseq_ibf_dump()

VALUE iseq_ibf_dump ( const rb_iseq_t iseq,
VALUE  opt 
)

◆ iseq_ibf_load()

const rb_iseq_t* iseq_ibf_load ( VALUE  str)

◆ iseq_ibf_load_extra_data()

VALUE iseq_ibf_load_extra_data ( VALUE  str)

◆ iseq_imemo_alloc()

static rb_iseq_t* iseq_imemo_alloc ( void  )
inlinestatic

Definition at line 80 of file iseq.h.

References imemo_iseq, and rb_imemo_new().

Referenced by ibf_load_iseq(), and iseq_alloc().

◆ iseq_mark_ary_create()

static VALUE iseq_mark_ary_create ( int  flip_cnt)
inlinestatic

Definition at line 37 of file iseq.h.

References INT2FIX, ISEQ_MARK_ARY_INITIAL_SIZE, Qnil, rb_ary_push(), and rb_ary_tmp_new().

Referenced by ibf_load_iseq_each(), and prepare_iseq_build().

◆ ISEQ_ORIGINAL_ISEQ()

static VALUE* ISEQ_ORIGINAL_ISEQ ( const rb_iseq_t iseq)
inlinestatic

Definition at line 62 of file iseq.h.

References ISEQ_MARK_ARY, ISEQ_MARK_ARY_ORIGINAL_ISEQ, NULL, RARRAY_AREF, RSTRING_PTR, and RTEST.

Referenced by rb_iseq_original_iseq().

◆ ISEQ_ORIGINAL_ISEQ_ALLOC()

static VALUE* ISEQ_ORIGINAL_ISEQ_ALLOC ( const rb_iseq_t iseq,
long  size 
)
inlinestatic

◆ PACKED_STRUCT_UNALIGNED()

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

◆ rb_call_info_kw_arg_bytes()

static size_t rb_call_info_kw_arg_bytes ( int  keyword_len)
inlinestatic

Definition at line 24 of file iseq.h.

Referenced by iseq_build_callinfo_from_hash(), and iseq_memsize().

◆ rb_iseq_absolute_path()

VALUE rb_iseq_absolute_path ( const rb_iseq_t iseq)

◆ rb_iseq_add_mark_object()

void rb_iseq_add_mark_object ( const rb_iseq_t iseq,
VALUE  obj 
)

Definition at line 262 of file iseq.c.

References ISEQ_MARK_ARY, and rb_ary_push().

Referenced by iseq_add_mark_object(), and iseq_build_from_ary_body().

◆ rb_iseq_base_label()

VALUE rb_iseq_base_label ( const rb_iseq_t iseq)

◆ 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 
)

◆ rb_iseq_compile_node()

RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_compile_node ( rb_iseq_t iseq,
NODE node 
)

◆ rb_iseq_defined_string()

VALUE rb_iseq_defined_string ( enum defined_type  type)

◆ rb_iseq_first_lineno()

VALUE rb_iseq_first_lineno ( const rb_iseq_t iseq)

◆ rb_iseq_label()

VALUE rb_iseq_label ( const rb_iseq_t iseq)

◆ rb_iseq_line_no()

unsigned int rb_iseq_line_no ( const rb_iseq_t iseq,
size_t  pos 
)

Definition at line 1234 of file iseq.c.

References find_line_no().

Referenced by calc_lineno().

◆ rb_iseq_load()

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

Definition at line 604 of file iseq.c.

References iseq_load(), NULL, and RTEST.

Referenced by iseq_build_from_ary_exception(), and iseq_build_load_iseq().

◆ rb_iseq_local_variables()

VALUE rb_iseq_local_variables ( const rb_iseq_t iseq)

◆ rb_iseq_make_compile_option()

void rb_iseq_make_compile_option ( struct rb_compile_option_struct option,
VALUE  opt 
)

Definition at line 379 of file iseq.c.

References Check_Type, set_compile_option_from_hash(), and T_HASH.

Referenced by iseq_compile_each().

◆ rb_iseq_method_name()

VALUE rb_iseq_method_name ( const rb_iseq_t iseq)

◆ rb_iseq_original_iseq()

VALUE* rb_iseq_original_iseq ( const rb_iseq_t iseq)

◆ rb_iseq_parameters()

VALUE rb_iseq_parameters ( const rb_iseq_t iseq,
int  is_proc 
)

◆ rb_iseq_path()

VALUE rb_iseq_path ( const rb_iseq_t iseq)

◆ rb_iseq_translate_threaded_code()

int rb_iseq_translate_threaded_code ( rb_iseq_t iseq)

◆ rb_iseqw_line_trace_all()

VALUE rb_iseqw_line_trace_all ( VALUE  iseqval)

Definition at line 2279 of file iseq.c.

References collect_trace(), rb_ary_new(), rb_iseqw_line_trace_each(), and result.

Referenced by Init_ISeq().

◆ rb_iseqw_line_trace_each()

int rb_iseqw_line_trace_each ( VALUE  iseqval,
int(*)(int line, rb_event_flag_t *events_ptr, void *d)  func,
void *  data 
)

◆ rb_iseqw_line_trace_specify()

VALUE rb_iseqw_line_trace_specify ( VALUE  iseqval,
VALUE  pos,
VALUE  set 
)

◆ rb_iseqw_new()

VALUE rb_iseqw_new ( const rb_iseq_t iseq)

Definition at line 754 of file iseq.c.

References iseqw_new().

◆ rb_iseqw_to_iseq()

const rb_iseq_t* rb_iseqw_to_iseq ( VALUE  iseqw)

Definition at line 930 of file iseq.c.

References iseqw_check().

Referenced by iseq_build_from_ary_exception(), and iseq_build_load_iseq().

◆ rb_method_iseq()

const rb_iseq_t* rb_method_iseq ( VALUE  body)

Definition at line 2467 of file proc.c.

References method_def(), and method_def_iseq().

Referenced by iseqw_s_of(), proc_binding(), rb_method_parameters(), and rb_proc_get_iseq().

◆ rb_proc_get_iseq()

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

◆ ruby_insn_make_insn_table()

struct st_table* ruby_insn_make_insn_table ( void  )