Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | 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 "insns.inc"
#include "insns_info.inc"
#include "node_name.inc"
Include dependency graph for iseq.c:

Go to the source code of this file.

Data Structures

struct  set_specifc_data
 

Macros

#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_convert_type((v), T_ARRAY, "Array", "to_ary")
 
#define CHECK_HASH(v)   rb_convert_type((v), T_HASH, "Hash", "to_hash")
 
#define CHECK_STRING(v)   rb_convert_type((v), T_STRING, "String", "to_str")
 
#define CHECK_SYMBOL(v)   rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
 
#define INITIALIZED   volatile /* suppress warnings by gcc 4.8 */
 
#define DECL_SYMBOL(name)   static VALUE sym_##name
 
#define INIT_SYMBOL(name)   sym_##name = ID2SYM(rb_intern(#name))
 
#define PARAM_TYPE(type)   rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))
 
#define PARAM_ID(i)   iseq->body->local_table[(i)]
 
#define PARAM(i, type)
 

Functions

static VALUE iseqw_new (const rb_iseq_t *iseq)
 
static const rb_iseq_tiseqw_check (VALUE iseqw)
 
static VALUE obj_resurrect (VALUE obj)
 
static void compile_data_free (struct iseq_compile_data *compile_data)
 
void rb_iseq_free (const rb_iseq_t *iseq)
 
void rb_iseq_mark (const rb_iseq_t *iseq)
 
static size_t param_keyword_size (const struct rb_iseq_param_keyword *pkw)
 
static size_t iseq_memsize (const rb_iseq_t *iseq)
 
static rb_iseq_tiseq_alloc (void)
 
static rb_iseq_location_tiseq_location_setup (rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, VALUE first_lineno)
 
static void set_relation (rb_iseq_t *iseq, const rb_iseq_t *piseq)
 
void rb_iseq_add_mark_object (const rb_iseq_t *iseq, VALUE obj)
 
static VALUE prepare_iseq_build (rb_iseq_t *iseq, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno, const rb_iseq_t *parent, enum iseq_type type, const rb_compile_option_t *option)
 
static VALUE cleanup_iseq_build (rb_iseq_t *iseq)
 
static void set_compile_option_from_hash (rb_compile_option_t *option, VALUE opt)
 
void rb_iseq_make_compile_option (rb_compile_option_t *option, VALUE opt)
 
static void make_compile_option (rb_compile_option_t *option, VALUE opt)
 
static VALUE make_compile_option_value (rb_compile_option_t *option)
 
rb_iseq_trb_iseq_new (NODE *node, VALUE name, VALUE path, VALUE absolute_path, const rb_iseq_t *parent, enum iseq_type type)
 
rb_iseq_trb_iseq_new_top (NODE *node, VALUE name, VALUE path, VALUE absolute_path, const rb_iseq_t *parent)
 
rb_iseq_trb_iseq_new_main (NODE *node, VALUE path, VALUE absolute_path, const rb_iseq_t *parent)
 
static rb_iseq_tiseq_translate (rb_iseq_t *iseq)
 
rb_iseq_trb_iseq_new_with_opt (NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno, const rb_iseq_t *parent, enum iseq_type type, const rb_compile_option_t *option)
 
const rb_iseq_trb_iseq_load_iseq (VALUE fname)
 
static VALUE CHECK_INTEGER (VALUE v)
 
static enum iseq_type iseq_type_from_sym (VALUE type)
 
static VALUE iseq_load (VALUE data, const rb_iseq_t *parent, VALUE opt)
 
static VALUE iseq_s_load (int argc, VALUE *argv, VALUE self)
 
VALUE rb_iseq_load (VALUE data, VALUE parent, VALUE opt)
 
rb_iseq_trb_iseq_compile_with_option (VALUE src, VALUE file, VALUE absolute_path, VALUE line, const struct rb_block *base_block, VALUE opt)
 
rb_iseq_trb_iseq_compile (VALUE src, VALUE file, VALUE line)
 
rb_iseq_trb_iseq_compile_on_base (VALUE src, VALUE file, VALUE line, const struct rb_block *base_block)
 
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)
 
VALUE rb_iseq_coverage (const rb_iseq_t *iseq)
 
static void iseqw_mark (void *ptr)
 
static size_t iseqw_memsize (const void *ptr)
 
VALUE rb_iseqw_new (const rb_iseq_t *iseq)
 
static VALUE iseqw_s_compile (int argc, VALUE *argv, VALUE self)
 
static VALUE iseqw_s_compile_file (int argc, VALUE *argv, VALUE self)
 
static VALUE iseqw_s_compile_option_set (VALUE self, VALUE opt)
 
static VALUE iseqw_s_compile_option_get (VALUE self)
 
const rb_iseq_trb_iseqw_to_iseq (VALUE iseqw)
 
static VALUE iseqw_eval (VALUE self)
 
static VALUE iseqw_inspect (VALUE self)
 
static VALUE iseqw_path (VALUE self)
 
static VALUE iseqw_absolute_path (VALUE self)
 
static VALUE iseqw_label (VALUE self)
 
static VALUE iseqw_base_label (VALUE self)
 
static VALUE iseqw_first_lineno (VALUE self)
 
static VALUE iseq_data_to_ary (const rb_iseq_t *iseq)
 
static VALUE iseqw_to_a (VALUE self)
 
static const struct iseq_line_info_entryget_line_info (const rb_iseq_t *iseq, size_t pos)
 
static unsigned int find_line_no (const rb_iseq_t *iseq, size_t pos)
 
unsigned int rb_iseq_line_no (const rb_iseq_t *iseq, size_t pos)
 
static VALUE id_to_name (ID id, VALUE default_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...
 
static const char * catch_type (int type)
 
static VALUE iseq_inspect (const rb_iseq_t *iseq)
 
VALUE rb_iseq_disasm (const rb_iseq_t *iseq)
 
static VALUE iseqw_disasm (VALUE self)
 
static VALUE iseqw_s_of (VALUE klass, VALUE body)
 
static VALUE iseqw_s_disasm (VALUE klass, VALUE body)
 
const char * ruby_node_name (int node)
 
static VALUE register_label (struct st_table *table, unsigned long idx)
 
static VALUE exception_type2symbol (VALUE type)
 
static int cdhash_each (VALUE key, VALUE value, VALUE ary)
 
VALUE rb_iseq_parameters (const rb_iseq_t *iseq, int is_proc)
 
VALUE rb_iseq_defined_string (enum defined_type type)
 
int rb_iseqw_line_trace_each (VALUE iseqw, int(*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data)
 
static int collect_trace (int line, rb_event_flag_t *events_ptr, void *ptr)
 
VALUE rb_iseqw_line_trace_all (VALUE iseqw)
 
static int line_trace_specify (int line, rb_event_flag_t *events_ptr, void *ptr)
 
VALUE rb_iseqw_line_trace_specify (VALUE iseqval, VALUE pos, VALUE set)
 
VALUE rb_iseqw_local_variables (VALUE iseqval)
 
static VALUE iseqw_to_binary (int argc, VALUE *argv, VALUE self)
 
static VALUE iseqw_s_load_from_binary (VALUE self, VALUE str)
 
static VALUE iseqw_s_load_from_binary_extra_data (VALUE self, VALUE str)
 
void Init_ISeq (void)
 

Variables

VALUE rb_cISeq
 
static rb_compile_option_t COMPILE_OPTION_DEFAULT
 
static const rb_compile_option_t COMPILE_OPTION_FALSE = {0}
 
static const rb_data_type_t iseqw_data_type
 

Macro Definition Documentation

◆ CHECK_ARRAY

#define CHECK_ARRAY (   v)    rb_convert_type((v), T_ARRAY, "Array", "to_ary")

Definition at line 501 of file iseq.c.

Referenced by iseq_load().

◆ CHECK_HASH

#define CHECK_HASH (   v)    rb_convert_type((v), T_HASH, "Hash", "to_hash")

Definition at line 502 of file iseq.c.

Referenced by iseq_load().

◆ CHECK_STRING

#define CHECK_STRING (   v)    rb_convert_type((v), T_STRING, "String", "to_str")

Definition at line 503 of file iseq.c.

Referenced by iseq_load().

◆ CHECK_SYMBOL

#define CHECK_SYMBOL (   v)    rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")

Definition at line 504 of file iseq.c.

Referenced by iseq_load().

◆ DECL_SYMBOL

#define DECL_SYMBOL (   name)    static VALUE sym_##name

Definition at line 1749 of file iseq.c.

Referenced by iseq_data_to_ary().

◆ hidden_obj_p

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

Definition at line 33 of file iseq.c.

Referenced by obj_resurrect().

◆ INIT_SYMBOL

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

Definition at line 1752 of file iseq.c.

Referenced by iseq_data_to_ary().

◆ INITIALIZED

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

◆ PARAM

#define PARAM (   i,
  type 
)
Value:
( \
PARAM_TYPE(type), \
rb_id2str(PARAM_ID(i)) ? \
rb_ary_push(a, ID2SYM(PARAM_ID(i))) : \
a)
#define PARAM_ID(i)
#define ID2SYM(x)
Definition: ruby.h:383

Referenced by rb_iseq_parameters().

◆ PARAM_ID

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

Referenced by rb_iseq_parameters().

◆ PARAM_TYPE

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

Referenced by rb_iseq_parameters().

◆ 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; } \
}
#define Qtrue
Definition: ruby.h:437
#define Qfalse
Definition: ruby.h:436
unsigned long VALUE
Definition: ruby.h:85
VALUE rb_hash_aref(VALUE hash, VALUE key)
Definition: hash.c:845
#define ID2SYM(x)
Definition: ruby.h:383
#define rb_intern(str)

Referenced by make_compile_option_value(), and set_compile_option_from_hash().

◆ 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); \
}
#define NUM2INT(x)
Definition: ruby.h:684
#define NIL_P(v)
Definition: ruby.h:451
unsigned long VALUE
Definition: ruby.h:85
VALUE rb_hash_aref(VALUE hash, VALUE key)
Definition: hash.c:845
#define ID2SYM(x)
Definition: ruby.h:383
#define rb_intern(str)

Referenced by make_compile_option_value(), and set_compile_option_from_hash().

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

Function Documentation

◆ catch_type()

static const char* catch_type ( int  type)
static

Definition at line 1454 of file iseq.c.

References rb_bug().

Referenced by iseq_set_exception_table(), and rb_iseq_disasm().

◆ cdhash_each()

static int cdhash_each ( VALUE  key,
VALUE  value,
VALUE  ary 
)
static

Definition at line 1781 of file iseq.c.

References obj_resurrect(), rb_ary_push(), and ST_CONTINUE.

Referenced by iseq_data_to_ary().

◆ CHECK_INTEGER()

static VALUE CHECK_INTEGER ( VALUE  v)
inlinestatic

Definition at line 505 of file iseq.c.

References NUM2LONG.

Referenced by iseq_load().

◆ cleanup_iseq_build()

static VALUE cleanup_iseq_build ( rb_iseq_t iseq)
static

◆ collect_trace()

static int collect_trace ( int  line,
rb_event_flag_t events_ptr,
void *  ptr 
)
static

Definition at line 2266 of file iseq.c.

References INT2NUM, rb_ary_push(), and result.

Referenced by rb_iseqw_line_trace_all().

◆ compile_data_free()

static void compile_data_free ( struct iseq_compile_data compile_data)
static

◆ exception_type2symbol()

static VALUE exception_type2symbol ( VALUE  type)
static

◆ find_line_no()

static unsigned int find_line_no ( const rb_iseq_t iseq,
size_t  pos 
)
static

◆ get_line_info()

static const struct iseq_line_info_entry* get_line_info ( const rb_iseq_t iseq,
size_t  pos 
)
static

◆ id_to_name()

static VALUE id_to_name ( ID  id,
VALUE  default_value 
)
static

Definition at line 1245 of file iseq.c.

References rb_id2str, rb_str_inspect(), and rb_str_symname_p().

Referenced by rb_insn_operand_intern(), and rb_iseq_disasm().

◆ Init_ISeq()

void Init_ISeq ( void  )

◆ iseq_alloc()

static rb_iseq_t* iseq_alloc ( void  )
static

Definition at line 212 of file iseq.c.

References rb_iseq_struct::body, iseq_imemo_alloc(), and ZALLOC.

Referenced by iseq_load(), and rb_iseq_new_with_opt().

◆ iseq_data_to_ary()

static VALUE iseq_data_to_ary ( const rb_iseq_t iseq)
static

Definition at line 1789 of file iseq.c.

References rb_iseq_location_struct::absolute_path, rb_iseq_constant_body::block_start, rb_iseq_struct::body, rb_iseq_constant_body::catch_table, cdhash_each(), iseq_catch_table_entry::cont, DECL_SYMBOL, iseq_catch_table_entry::end, exception_type2symbol(), rb_iseq_location_struct::first_lineno, FIX2INT, rb_call_info::flag, rb_iseq_constant_body::flags, hash(), rb_global_entry::id, ID2SYM, INIT_SYMBOL, INT2FIX, rb_iseq_constant_body::is_entries, iseq_catch_table_entry::iseq, ISEQ_MAJOR_VERSION, ISEQ_MINOR_VERSION, rb_iseq_constant_body::iseq_size, key, rb_iseq_constant_body::keyword, rb_call_info_kw_arg::keyword_len, rb_call_info_kw_arg::keywords, rb_call_info_with_kwarg::kw_arg, rb_iseq_location_struct::label, rb_iseq_constant_body::lead_num, len, rb_iseq_constant_body::line_info_table, iseq_line_info_entry::line_no, rb_iseq_constant_body::local_table, rb_iseq_constant_body::local_table_size, rb_iseq_constant_body::location, LONG2NUM, main(), rb_call_info::mid, obj_resurrect(), rb_iseq_constant_body::opt_num, rb_iseq_constant_body::opt_table, rb_call_info::orig_argc, rb_iseq_constant_body::param, rb_iseq_location_struct::path, iseq_line_info_entry::position, rb_iseq_constant_body::post_num, rb_iseq_constant_body::post_start, Qfalse, Qnil, Qtrue, Qundef, RARRAY_AREF, RARRAY_LEN, RARRAY_LENINT, rb_ary_entry(), rb_ary_new(), rb_ary_new2, rb_ary_new_from_args(), rb_ary_push(), rb_ary_store(), rb_bug(), RB_GC_GUARD, rb_hash_aset(), rb_hash_foreach(), rb_hash_new(), rb_id2str, rb_intern, rb_iseq_check(), rb_iseq_original_iseq(), rb_str_new2, register_label(), rb_iseq_constant_body::rest_start, SIGNED_VALUE, rb_iseq_constant_body::size, iseq_catch_table_entry::sp, st_data_t, st_free_table, st_init_numtable, st_lookup, rb_iseq_constant_body::stack_max, iseq_catch_table_entry::start, top, iseq_catch_table_entry::type, rb_iseq_constant_body::type, UINT2NUM, ULONG2NUM, val, and VM_CALL_KWARG.

Referenced by iseqw_first_lineno(), and iseqw_to_a().

◆ iseq_inspect()

static VALUE iseq_inspect ( const rb_iseq_t iseq)
static

◆ iseq_load()

static VALUE iseq_load ( VALUE  data,
const rb_iseq_t parent,
VALUE  opt 
)
static

◆ iseq_location_setup()

static rb_iseq_location_t* iseq_location_setup ( rb_iseq_t iseq,
VALUE  path,
VALUE  absolute_path,
VALUE  name,
VALUE  first_lineno 
)
static

◆ iseq_memsize()

static size_t iseq_memsize ( const rb_iseq_t iseq)
static

◆ iseq_s_load()

static VALUE iseq_s_load ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 596 of file iseq.c.

References iseq_load(), NULL, Qnil, and rb_scan_args().

Referenced by Init_ISeq().

◆ iseq_translate()

static rb_iseq_t* iseq_translate ( rb_iseq_t iseq)
inlinestatic

Definition at line 459 of file iseq.c.

References CLASS_OF, iseqw_check(), iseqw_new(), rb_cISeq, rb_funcall(), rb_intern, and rb_respond_to().

Referenced by rb_iseq_new_with_opt().

◆ iseq_type_from_sym()

static enum iseq_type iseq_type_from_sym ( VALUE  type)
static

Definition at line 508 of file iseq.c.

References id_class, id_ensure, id_method, id_rescue, rb_check_id(), and rb_intern.

Referenced by iseq_load().

◆ iseqw_absolute_path()

static VALUE iseqw_absolute_path ( VALUE  self)
static

Definition at line 1015 of file iseq.c.

References iseqw_check(), and rb_iseq_absolute_path().

Referenced by Init_ISeq().

◆ iseqw_base_label()

static VALUE iseqw_base_label ( VALUE  self)
static

Definition at line 1070 of file iseq.c.

References iseqw_check(), and rb_iseq_base_label().

Referenced by Init_ISeq().

◆ iseqw_check()

static const rb_iseq_t * iseqw_check ( VALUE  iseqw)
static

◆ iseqw_disasm()

static VALUE iseqw_disasm ( VALUE  self)
static

Definition at line 1618 of file iseq.c.

References iseqw_check(), and rb_iseq_disasm().

Referenced by Init_ISeq().

◆ iseqw_eval()

static VALUE iseqw_eval ( VALUE  self)
static

Definition at line 944 of file iseq.c.

References iseqw_check(), rb_iseq_eval(), and rb_secure().

Referenced by Init_ISeq().

◆ iseqw_first_lineno()

static VALUE iseqw_first_lineno ( VALUE  self)
static

Definition at line 1086 of file iseq.c.

References iseq_data_to_ary(), iseqw_check(), and rb_iseq_first_lineno().

Referenced by Init_ISeq().

◆ iseqw_inspect()

static VALUE iseqw_inspect ( VALUE  self)
static

◆ iseqw_label()

static VALUE iseqw_label ( VALUE  self)
static

Definition at line 1044 of file iseq.c.

References iseqw_check(), and rb_iseq_label().

Referenced by Init_ISeq().

◆ iseqw_mark()

static void iseqw_mark ( void *  ptr)
static

Definition at line 723 of file iseq.c.

References rb_gc_mark().

◆ iseqw_memsize()

static size_t iseqw_memsize ( const void *  ptr)
static

Definition at line 729 of file iseq.c.

References iseq_memsize().

◆ iseqw_new()

static VALUE iseqw_new ( const rb_iseq_t iseq)
static

◆ iseqw_path()

static VALUE iseqw_path ( VALUE  self)
static

Definition at line 993 of file iseq.c.

References iseqw_check(), and rb_iseq_path().

Referenced by Init_ISeq().

◆ iseqw_s_compile()

static VALUE iseqw_s_compile ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ iseqw_s_compile_file()

static VALUE iseqw_s_compile_file ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ iseqw_s_compile_option_get()

static VALUE iseqw_s_compile_option_get ( VALUE  self)
static

Definition at line 909 of file iseq.c.

References make_compile_option_value().

Referenced by Init_ISeq().

◆ iseqw_s_compile_option_set()

static VALUE iseqw_s_compile_option_set ( VALUE  self,
VALUE  opt 
)
static

Definition at line 891 of file iseq.c.

References make_compile_option(), iseq_compile_data::option, and rb_secure().

Referenced by Init_ISeq().

◆ iseqw_s_disasm()

static VALUE iseqw_s_disasm ( VALUE  klass,
VALUE  body 
)
static

Definition at line 1732 of file iseq.c.

References iseqw_check(), iseqw_s_of(), NIL_P, Qnil, and rb_iseq_disasm().

Referenced by Init_ISeq().

◆ iseqw_s_load_from_binary()

static VALUE iseqw_s_load_from_binary ( VALUE  self,
VALUE  str 
)
static

Definition at line 2394 of file iseq.c.

References iseq_ibf_load(), and iseqw_new().

Referenced by Init_ISeq().

◆ iseqw_s_load_from_binary_extra_data()

static VALUE iseqw_s_load_from_binary_extra_data ( VALUE  self,
VALUE  str 
)
static

Definition at line 2406 of file iseq.c.

References iseq_ibf_load_extra_data().

Referenced by Init_ISeq().

◆ iseqw_s_of()

static VALUE iseqw_s_of ( VALUE  klass,
VALUE  body 
)
static

◆ iseqw_to_a()

static VALUE iseqw_to_a ( VALUE  self)
static

Definition at line 1175 of file iseq.c.

References iseq_data_to_ary(), iseqw_check(), and rb_secure().

Referenced by Init_ISeq().

◆ iseqw_to_binary()

static VALUE iseqw_to_binary ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 2373 of file iseq.c.

References iseq_ibf_dump(), iseqw_check(), and rb_scan_args().

Referenced by Init_ISeq().

◆ line_trace_specify()

static int line_trace_specify ( int  line,
rb_event_flag_t events_ptr,
void *  ptr 
)
static

◆ make_compile_option()

static void make_compile_option ( rb_compile_option_t option,
VALUE  opt 
)
static

◆ make_compile_option_value()

static VALUE make_compile_option_value ( rb_compile_option_t option)
static

Definition at line 409 of file iseq.c.

References rb_hash_new(), SET_COMPILE_OPTION, and SET_COMPILE_OPTION_NUM.

Referenced by iseqw_s_compile_option_get().

◆ obj_resurrect()

static VALUE obj_resurrect ( VALUE  obj)
inlinestatic

◆ param_keyword_size()

static size_t param_keyword_size ( const struct rb_iseq_param_keyword *  pkw)
static

Definition at line 137 of file iseq.c.

References size.

Referenced by iseq_memsize().

◆ prepare_iseq_build()

static VALUE prepare_iseq_build ( rb_iseq_t iseq,
VALUE  name,
VALUE  path,
VALUE  absolute_path,
VALUE  first_lineno,
const rb_iseq_t parent,
enum iseq_type  type,
const rb_compile_option_t option 
)
static

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

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

rb_iseq_t* rb_iseq_compile ( VALUE  src,
VALUE  file,
VALUE  line 
)

Definition at line 658 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

◆ rb_iseq_compile_on_base()

rb_iseq_t* rb_iseq_compile_on_base ( VALUE  src,
VALUE  file,
VALUE  line,
const struct rb_block base_block 
)

Definition at line 664 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

◆ rb_iseq_compile_with_option()

rb_iseq_t* rb_iseq_compile_with_option ( VALUE  src,
VALUE  file,
VALUE  absolute_path,
VALUE  line,
const struct rb_block base_block,
VALUE  opt 
)

◆ rb_iseq_coverage()

VALUE rb_iseq_coverage ( const rb_iseq_t iseq)

Definition at line 715 of file iseq.c.

References ISEQ_COVERAGE.

Referenced by update_coverage().

◆ rb_iseq_defined_string()

VALUE rb_iseq_defined_string ( enum defined_type  type)

◆ rb_iseq_disasm()

VALUE rb_iseq_disasm ( const rb_iseq_t iseq)

◆ 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 1402 of file iseq.c.

References find_line_no(), len, PRIuSIZE, rb_insn_operand_intern(), rb_str_cat2(), rb_str_catf(), rb_str_concat(), rb_str_new(), RSTRING_LEN, and RSTRING_PTR.

Referenced by rb_iseq_disasm(), and rb_vmdebug_debug_print_pre().

◆ rb_iseq_first_lineno()

VALUE rb_iseq_first_lineno ( const rb_iseq_t iseq)

◆ rb_iseq_free()

void rb_iseq_free ( 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_load_iseq()

const rb_iseq_t* rb_iseq_load_iseq ( VALUE  fname)

Definition at line 490 of file iseq.c.

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

Referenced by rb_load_internal0(), and rb_provide().

◆ rb_iseq_make_compile_option()

void rb_iseq_make_compile_option ( rb_compile_option_t 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_mark()

void rb_iseq_mark ( const rb_iseq_t iseq)

◆ rb_iseq_method_name()

VALUE rb_iseq_method_name ( const rb_iseq_t iseq)

◆ rb_iseq_new()

rb_iseq_t* rb_iseq_new ( NODE node,
VALUE  name,
VALUE  path,
VALUE  absolute_path,
const rb_iseq_t parent,
enum iseq_type  type 
)

Definition at line 436 of file iseq.c.

References INT2FIX, and rb_iseq_new_with_opt().

Referenced by Init_VM(), proc_binding(), rb_binding_add_dynavars(), and rb_vm_call_cfunc().

◆ rb_iseq_new_main()

rb_iseq_t* rb_iseq_new_main ( NODE node,
VALUE  path,
VALUE  absolute_path,
const rb_iseq_t parent 
)

Definition at line 451 of file iseq.c.

References INT2FIX, rb_fstring_cstr(), and rb_iseq_new_with_opt().

Referenced by process_options().

◆ rb_iseq_new_top()

rb_iseq_t* rb_iseq_new_top ( NODE node,
VALUE  name,
VALUE  path,
VALUE  absolute_path,
const rb_iseq_t parent 
)

Definition at line 444 of file iseq.c.

References INT2FIX, and rb_iseq_new_with_opt().

Referenced by rb_binding_add_dynavars(), and rb_load_internal0().

◆ rb_iseq_new_with_opt()

rb_iseq_t* rb_iseq_new_with_opt ( NODE node,
VALUE  name,
VALUE  path,
VALUE  absolute_path,
VALUE  first_lineno,
const rb_iseq_t parent,
enum iseq_type  type,
const rb_compile_option_t option 
)

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

VALUE rb_iseqw_line_trace_all ( VALUE  iseqw)

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  iseqw,
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_local_variables()

VALUE rb_iseqw_local_variables ( VALUE  iseqval)

Definition at line 2350 of file iseq.c.

References iseqw_check(), and rb_iseq_local_variables().

Referenced by name_err_local_variables().

◆ rb_iseqw_new()

VALUE rb_iseqw_new ( const rb_iseq_t iseq)

Definition at line 754 of file iseq.c.

References iseqw_new().

Referenced by iseq_compile_each(), name_err_initialize(), and rb_debug_inspector_frame_iseq_get().

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

◆ register_label()

static VALUE register_label ( struct st_table table,
unsigned long  idx 
)
static

Definition at line 1756 of file iseq.c.

References rb_sprintf(), rb_str_intern(), st_insert, and sym.

Referenced by iseq_data_to_ary().

◆ ruby_node_name()

const char* ruby_node_name ( int  node)

Definition at line 1739 of file iseq.c.

References rb_bug().

Referenced by dump_node(), dump_object(), iseq_compile_each(), rb_raw_obj_info(), and ruby_debug_print_node().

◆ set_compile_option_from_hash()

static void set_compile_option_from_hash ( rb_compile_option_t option,
VALUE  opt 
)
static

Definition at line 351 of file iseq.c.

References SET_COMPILE_OPTION, and SET_COMPILE_OPTION_NUM.

Referenced by make_compile_option(), and rb_iseq_make_compile_option().

◆ set_relation()

static void set_relation ( rb_iseq_t iseq,
const rb_iseq_t piseq 
)
static

Variable Documentation

◆ COMPILE_OPTION_DEFAULT

rb_compile_option_t COMPILE_OPTION_DEFAULT
static
Initial value:
= {
TRUE,
}
#define OPT_DEBUG_FROZEN_STRING_LITERAL
Definition: vm_opts.h:27
#define OPT_INLINE_CONST_CACHE
Definition: vm_opts.h:25
#define OPT_TAILCALL_OPTIMIZATION
Definition: vm_opts.h:22
#define OPT_PEEPHOLE_OPTIMIZATION
Definition: vm_opts.h:23
#define OPT_INSTRUCTIONS_UNIFICATION
Definition: vm_opts.h:46
#define TRUE
Definition: nkf.h:175
#define OPT_TRACE_INSTRUCTION
Definition: vm_opts.h:21
#define OPT_STACK_CACHING
Definition: vm_opts.h:48
#define OPT_FROZEN_STRING_LITERAL
Definition: vm_opts.h:26
#define OPT_SPECIALISED_INSTRUCTION
Definition: vm_opts.h:24
#define OPT_OPERANDS_UNIFICATION
Definition: vm_opts.h:45

Definition at line 334 of file iseq.c.

Referenced by make_compile_option(), and rb_iseq_new_with_opt().

◆ COMPILE_OPTION_FALSE

const rb_compile_option_t COMPILE_OPTION_FALSE = {0}
static

Definition at line 348 of file iseq.c.

Referenced by make_compile_option().

◆ iseqw_data_type

const rb_data_type_t iseqw_data_type
static
Initial value:
= {
"T_IMEMO/iseq",
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
#define RUBY_TYPED_WB_PROTECTED
Definition: ruby.h:1146
static size_t iseqw_memsize(const void *ptr)
Definition: iseq.c:729
static void iseqw_mark(void *ptr)
Definition: iseq.c:723
#define NULL
Definition: _sdbm.c:102

Definition at line 734 of file iseq.c.

◆ rb_cISeq

VALUE rb_cISeq