Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
compile.c File Reference
#include "internal.h"
#include "ruby/re.h"
#include "encindex.h"
#include <math.h>
#include "vm_core.h"
#include "iseq.h"
#include "insns.inc"
#include "insns_info.inc"
#include "id_table.h"
#include "gc.h"
#include "optinsn.inc"
Include dependency graph for compile.c:

Go to the source code of this file.

Data Structures

struct  iseq_link_element
 
struct  iseq_link_anchor
 
struct  iseq_label_data
 
struct  iseq_insn_data
 
struct  iseq_adjust_data
 
struct  ensure_range
 
struct  iseq_compile_data_ensure_node_stack
 
struct  cdhash_set_label_struct
 
struct  accessor_args
 
struct  ibf_header
 
struct  ibf_id_entry
 
struct  ibf_dump
 
struct  ibf_load
 
struct  ibf_dump_id_list_i_arg
 
struct  ibf_object_header
 
struct  ibf_object_string
 
struct  ibf_object_regexp
 
struct  ibf_object_array
 
struct  ibf_object_hash
 
struct  ibf_object_struct_range
 
struct  ibf_object_bignum
 
struct  ibf_object_complex_rational
 
struct  ibf_object_symbol
 

Macros

#define USE_INSN_STACK_INCREASE   1
 
#define RUBY_UNTYPED_DATA_WARNING   0
 
#define ISEQ_TYPE_ONCE_GUARD   ISEQ_TYPE_DEFINED_GUARD
 
#define FIXNUM_INC(n, i)   ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
 
#define FIXNUM_OR(n, i)   ((n)|INT2FIX(i))
 
#define CPDEBUG   0
 debug function(macro) interface depend on CPDEBUG if it is less than 0, runtime option is in effect. More...
 
#define compile_debug   CPDEBUG
 
#define debugi(header, id)   r_id(id)
 
#define debugp(header, value)   r_value(value)
 
#define debugp_verbose(header, value)   r_value(value)
 
#define debugp_verbose_node(header, value)   r_value(value)
 
#define debugp_param(header, value)   r_value(value)
 
#define debug_node_start(node)   ((void)0)
 
#define debug_node_end()   ((void)0)
 
#define debugs   if(0)printf
 
#define debug_compile(msg, v)   (v)
 
#define LVAR_ERRINFO   (1)
 
#define NEW_LABEL(l)   new_label_body(iseq, (l))
 
#define iseq_path(iseq)   ((iseq)->body->location.path)
 
#define iseq_absolute_path(iseq)   ((iseq)->body->location.absolute_path)
 
#define NEW_ISEQ(node, name, type, line_no)   new_child_iseq(iseq, (node), rb_fstring(name), 0, (type), (line_no))
 
#define NEW_CHILD_ISEQ(node, name, type, line_no)   new_child_iseq(iseq, (node), rb_fstring(name), iseq, (type), (line_no))
 
#define ADD_SEQ(seq1, seq2)   APPEND_LIST((seq1), (seq2))
 
#define ADD_INSN(seq, line, insn)   ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
 
#define INSERT_BEFORE_INSN(prev, line, insn)   INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
 
#define ADD_INSN1(seq, line, insn, op1)
 
#define INSERT_BEFORE_INSN1(prev, line, insn, op1)
 
#define LABEL_REF(label)   ((label)->refcnt++)
 
#define ADD_INSNL(seq, line, insn, label)   (ADD_INSN1(seq, line, insn, label), LABEL_REF(label))
 
#define ADD_INSN2(seq, line, insn, op1, op2)
 
#define ADD_INSN3(seq, line, insn, op1, op2, op3)
 
#define ADD_SEND(seq, line, id, argc)   ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(0), NULL)
 
#define ADD_SEND_WITH_FLAG(seq, line, id, argc, flag)   ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)(flag), NULL)
 
#define ADD_SEND_WITH_BLOCK(seq, line, id, argc, block)   ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(0), NULL)
 
#define ADD_CALL_RECEIVER(seq, line)   ADD_INSN((seq), (line), putself)
 
#define ADD_CALL(seq, line, id, argc)   ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
 
#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block)   ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
 
#define ADD_SEND_R(seq, line, id, argc, block, flag, keywords)   ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_send(iseq, (line), (id), (VALUE)(argc), (block), (VALUE)(flag), (keywords)))
 
#define ADD_TRACE(seq, line, event)
 
#define ADD_GETLOCAL(seq, line, idx, level)
 
#define ADD_SETLOCAL(seq, line, idx, level)
 
#define ADD_LABEL(seq, label)   ADD_ELEM((seq), (LINK_ELEMENT *) (label))
 
#define APPEND_LABEL(seq, before, label)   APPEND_ELEM((seq), (before), (LINK_ELEMENT *) (label))
 
#define ADD_ADJUST(seq, line, label)   ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), (line)))
 
#define ADD_ADJUST_RESTORE(seq, label)   ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), -1))
 
#define LABEL_UNREMOVABLE(label)   ((label) ? (LABEL_REF(label), (label)->unremovable=1) : 0)
 
#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc)
 
#define COMPILE(anchor, desc, node)
 
#define COMPILE_POPPED(anchor, desc, node)
 
#define COMPILE_(anchor, desc, node, popped)
 
#define COMPILE_RECV(anchor, desc, node)
 
#define OPERAND_AT(insn, idx)   (((INSN*)(insn))->operands[(idx)])
 
#define INSN_OF(insn)   (((INSN*)(insn))->insn_id)
 
#define IS_INSN(link)   ((link)->type == ISEQ_ELEMENT_INSN)
 
#define IS_LABEL(link)   ((link)->type == ISEQ_ELEMENT_LABEL)
 
#define IS_ADJUST(link)   ((link)->type == ISEQ_ELEMENT_ADJUST)
 
#define IS_INSN_ID(iobj, insn)   (INSN_OF(iobj) == BIN(insn))
 
#define COMPILE_ERROR   prepare_compile_error(iseq)
 
#define ERROR_ARGS_AT(n)   iseq, nd_line(n),
 
#define ERROR_ARGS   ERROR_ARGS_AT(node)
 
#define EXPECT_NODE(prefix, node, ndtype)
 
#define EXPECT_NODE_NONULL(prefix, parent, ndtype)
 
#define UNKNOWN_NODE(prefix, node)
 
#define COMPILE_OK   1
 
#define COMPILE_NG   0
 
#define CHECK(sub)   if (!(sub)) {BEFORE_RETURN;return COMPILE_NG;}
 
#define BEFORE_RETURN
 
#define DECL_ANCHOR(name)   LINK_ANCHOR name[1] = {{{0,},}}
 
#define INIT_ANCHOR(name)   (name->last = &name->anchor)
 
#define ISEQ_ARG
 
#define ISEQ_ARG_DECLARE
 
#define ruby_sourcefile   RSTRING_PTR(iseq->body->location.path)
 
#define PADDING_SIZE_MAX   0
 
#define IS_TRACE_LINE(insn)
 
#define SP_INSN(opt)   insn_set_specialized_instruction(iseq, iobj, BIN(opt_##opt))
 
#define MEMORY(v)
 
#define private_recv_p(node)   (nd_type((node)->nd_recv) == NODE_SELF)
 
#define defined_expr   defined_expr0
 
#define BEFORE_RETURN   debug_node_end()
 
#define rb_intern(str)   rb_intern_const(str)
 
#define CHECK_ARRAY(v)   rb_convert_type((v), T_ARRAY, "Array", "to_ary")
 
#define CHECK_SYMBOL(v)   rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
 
#define SYM(s)   ID2SYM(rb_intern(#s))
 
#define SYM(s)   ID2SYM(rb_intern(#s))
 
#define INT_PARAM(F)   int_param(&iseq->body->param.F, params, SYM(F))
 
#define IBF_OFFSET(ptr)   ((ibf_offset_t)(VALUE)(ptr))
 
#define IBF_W(b, type, n)   (type *)(VALUE)ibf_dump_write(dump, (b), sizeof(type) * (n))
 
#define IBF_WV(variable)   ibf_dump_write(dump, &(variable), sizeof(variable))
 
#define IBF_WP(b, type, n)   ibf_dump_write(dump, (b), sizeof(type) * (n))
 
#define IBF_R(val, type, n)   (type *)ibf_load_alloc(load, IBF_OFFSET(val), sizeof(type) * (n))
 
#define IBF_OBJECT_INTERNAL   FL_PROMOTED0
 
#define IBF_OBJHEADER(offset)   (struct ibf_object_header *)(load->buff + (offset))
 
#define IBF_OBJBODY(type, offset)   (type *)(load->buff + sizeof(struct ibf_object_header) + (offset))
 

Typedefs

typedef struct iseq_link_element LINK_ELEMENT
 
typedef struct iseq_link_anchor LINK_ANCHOR
 
typedef struct iseq_label_data LABEL
 
typedef struct iseq_insn_data INSN
 
typedef struct iseq_adjust_data ADJUST
 
typedef void(* compile_error_func) (rb_iseq_t *, int, const char *,...)
 
typedef unsigned int ibf_offset_t
 
typedef void(* ibf_dump_object_function) (struct ibf_dump *dump, VALUE obj)
 
typedef VALUE(* ibf_load_object_function) (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t)
 

Enumerations

enum  LABEL_RESCUE_TYPE { LABEL_RESCUE_NONE, LABEL_RESCUE_BEG, LABEL_RESCUE_END, LABEL_RESCUE_TYPE_MAX }
 
enum  compile_array_type_t { COMPILE_ARRAY_TYPE_ARRAY, COMPILE_ARRAY_TYPE_HASH, COMPILE_ARRAY_TYPE_ARGS }
 
enum  ibf_object_class_index { IBF_OBJECT_CLASS_OBJECT, IBF_OBJECT_CLASS_ARRAY, IBF_OBJECT_CLASS_STANDARD_ERROR }
 
enum  ibf_object_data_type { IBF_OBJECT_DATA_ENCODING }
 

Functions

static ID r_id (ID id)
 
static VALUE r_value (VALUE value)
 
static void append_compile_error (rb_iseq_t *iseq, int line, const char *fmt,...)
 
static void compile_bug (rb_iseq_t *iseq, int line, const char *fmt,...)
 
 NOINLINE (static compile_error_func prepare_compile_error(rb_iseq_t *iseq))
 
static compile_error_func prepare_compile_error (rb_iseq_t *iseq)
 
static VALUE freeze_hide_obj (VALUE obj)
 
static void dump_disasm_list (LINK_ELEMENT *elem)
 
static int insn_data_length (INSN *iobj)
 
static int calc_sp_depth (int depth, INSN *iobj)
 
static INSNnew_insn_body (rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc,...)
 
static LABELnew_label_body (rb_iseq_t *iseq, long line)
 
static ADJUSTnew_adjust_body (rb_iseq_t *iseq, LABEL *label, int line)
 
static int iseq_compile_each (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popped)
 compile each node More...
 
static int iseq_setup (rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
 
static int iseq_optimize (rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
 
static int iseq_insns_unification (rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
 
static int iseq_set_local_table (rb_iseq_t *iseq, const ID *tbl)
 
static int iseq_set_exception_local_table (rb_iseq_t *iseq)
 
static int iseq_set_arguments (rb_iseq_t *iseq, LINK_ANCHOR *const anchor, NODE *node)
 
static int iseq_set_sequence_stackcaching (rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
 
static int iseq_set_sequence (rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
 ruby insn object list -> raw instruction sequence More...
 
static int iseq_set_exception_table (rb_iseq_t *iseq)
 
static int iseq_set_optargs_table (rb_iseq_t *iseq)
 
static void verify_list (ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *const anchor)
 
static void ADD_ELEM (ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *elem)
 
static void APPEND_ELEM (ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *before, LINK_ELEMENT *elem)
 
static int iseq_add_mark_object (const rb_iseq_t *iseq, VALUE v)
 
static int iseq_add_mark_object_compile_time (const rb_iseq_t *iseq, VALUE v)
 
static int validate_label (st_data_t name, st_data_t label, st_data_t arg)
 
static void validate_labels (rb_iseq_t *iseq, st_table *labels_table)
 
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)
 
static void * compile_data_alloc (rb_iseq_t *iseq, size_t size)
 
static INSNcompile_data_alloc_insn (rb_iseq_t *iseq)
 
static LABELcompile_data_alloc_label (rb_iseq_t *iseq)
 
static ADJUSTcompile_data_alloc_adjust (rb_iseq_t *iseq)
 
static void INSERT_ELEM_NEXT (LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
 
static void INSERT_ELEM_PREV (LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
 
static void REMOVE_ELEM (LINK_ELEMENT *elem)
 
static LINK_ELEMENTFIRST_ELEMENT (LINK_ANCHOR *const anchor)
 
static LINK_ELEMENTLAST_ELEMENT (LINK_ANCHOR *const anchor)
 
static LINK_ELEMENTPOP_ELEMENT (ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor)
 
static int LIST_SIZE_ZERO (LINK_ANCHOR *const anchor)
 
static void APPEND_LIST (ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
 
static void INSERT_LIST (ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
 
static INSNnew_insn_core (rb_iseq_t *iseq, int line_no, int insn_id, int argc, VALUE *argv)
 
static struct rb_call_infonew_callinfo (rb_iseq_t *iseq, ID mid, int argc, unsigned int flag, struct rb_call_info_kw_arg *kw_arg, int has_blockiseq)
 
static INSNnew_insn_send (rb_iseq_t *iseq, int line_no, ID id, VALUE argc, const rb_iseq_t *blockiseq, VALUE flag, struct rb_call_info_kw_arg *keywords)
 
static rb_iseq_tnew_child_iseq (rb_iseq_t *iseq, NODE *node, VALUE name, const rb_iseq_t *parent, enum iseq_type type, int line_no)
 
static int get_lvar_level (const rb_iseq_t *iseq)
 
static int get_dyna_var_idx_at_raw (const rb_iseq_t *iseq, ID id)
 
static int get_local_var_idx (const rb_iseq_t *iseq, ID id)
 
static int get_dyna_var_idx (const rb_iseq_t *iseq, ID id, int *level, int *ls)
 
static void iseq_calc_param_size (rb_iseq_t *iseq)
 
static void iseq_set_arguments_keywords (rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const struct rb_args_info *args)
 
static int cdhash_cmp (VALUE val, VALUE lit)
 
static st_index_t cdhash_hash (VALUE a)
 
static int cdhash_set_label_i (VALUE key, VALUE val, void *ptr)
 
static VALUE get_ivar_ic_value (rb_iseq_t *iseq, ID id)
 
static int label_get_position (LABEL *lobj)
 
static int label_get_sp (LABEL *lobj)
 
static LINK_ELEMENTget_destination_insn (INSN *iobj)
 
static LINK_ELEMENTget_next_insn (INSN *iobj)
 
static LINK_ELEMENTget_prev_insn (INSN *iobj)
 
static void unref_destination (INSN *iobj, int pos)
 
static void replace_destination (INSN *dobj, INSN *nobj)
 
static int remove_unreachable_chunk (rb_iseq_t *iseq, LINK_ELEMENT *i)
 
static int iseq_peephole_optimize (rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
 
static int insn_set_specialized_instruction (rb_iseq_t *iseq, INSN *iobj, int insn_id)
 
static int iseq_specialized_instruction (rb_iseq_t *iseq, INSN *iobj)
 
static int tailcallable_p (rb_iseq_t *iseq)
 
static int compile_dstr_fragments (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int *cntp)
 
static int compile_dstr (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node)
 
static int compile_dregx (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node)
 
static int compile_flip_flop (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int again, LABEL *then_label, LABEL *else_label)
 
static int compile_branch_condition (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *cond, LABEL *then_label, LABEL *else_label)
 
static int compile_array_keyword_arg (rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const root_node, struct rb_call_info_kw_arg **const kw_arg_ptr)
 
static int static_literal_node_p (NODE *node)
 
static VALUE static_literal_value (NODE *node)
 
static int compile_array_ (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node_root, enum compile_array_type_t type, struct rb_call_info_kw_arg **keywords_ptr, int popped)
 
static VALUE compile_array (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node_root, enum compile_array_type_t type)
 
static VALUE case_when_optimizable_literal (NODE *node)
 
static int when_vals (rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, NODE *vals, LABEL *l1, int only_special_literals, VALUE literals)
 
static int compile_massign_lhs (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node)
 
static int compile_massign_opt_lhs (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *lhsn)
 
static int compile_massign_opt (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *rhsn, NODE *orig_lhsn)
 
static void adjust_stack (rb_iseq_t *iseq, LINK_ANCHOR *const ret, int line, int rlen, int llen)
 
static int compile_massign (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popped)
 
static int compile_colon2 (rb_iseq_t *iseq, NODE *node, LINK_ANCHOR *const pref, LINK_ANCHOR *const body)
 
static VALUE compile_cpath (LINK_ANCHOR *const ret, rb_iseq_t *iseq, NODE *cpath)
 
static int defined_expr (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, LABEL **lfinish, VALUE needstr)
 
static VALUE make_name_for_block (const rb_iseq_t *orig_iseq)
 
static void push_ensure_entry (rb_iseq_t *iseq, struct iseq_compile_data_ensure_node_stack *enl, struct ensure_range *er, NODE *node)
 
static void add_ensure_range (rb_iseq_t *iseq, struct ensure_range *erange, LABEL *lstart, LABEL *lend)
 
static void add_ensure_iseq (LINK_ANCHOR *const ret, rb_iseq_t *iseq, int is_return)
 
static VALUE setup_args (rb_iseq_t *iseq, LINK_ANCHOR *const args, NODE *argn, unsigned int *flag, struct rb_call_info_kw_arg **keywords)
 
static VALUE build_postexe_iseq (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *body)
 
static void compile_named_capture_assign (rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node)
 
static int number_literal_p (NODE *n)
 
static VALUE opobj_inspect (VALUE obj)
 
static VALUE insn_data_to_s_detail (INSN *iobj)
 
const char * rb_insns_name (int i)
 
VALUE rb_insns_name_array (void)
 
static LABELregister_label (rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
 
static VALUE get_exception_sym2type (VALUE sym)
 
static int iseq_build_from_ary_exception (rb_iseq_t *iseq, struct st_table *labels_table, VALUE exception)
 
static struct st_tableinsn_make_insn_table (void)
 
static const rb_iseq_tiseq_build_load_iseq (const rb_iseq_t *iseq, VALUE op)
 
static VALUE iseq_build_callinfo_from_hash (rb_iseq_t *iseq, VALUE op)
 
static int iseq_build_from_ary_body (rb_iseq_t *iseq, LINK_ANCHOR *const anchor, VALUE body, VALUE labels_wrapper)
 
static int int_param (int *dst, VALUE param, VALUE sym)
 
static const struct rb_iseq_param_keyword * iseq_build_kw (rb_iseq_t *iseq, VALUE params, VALUE keywords)
 
void rb_iseq_build_from_ary (rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params, VALUE exception, VALUE body)
 
int rb_dvar_defined (ID id, const struct rb_block *base_block)
 
int rb_local_defined (ID id, const struct rb_block *base_block)
 
static int caller_location (VALUE *path, VALUE *absolute_path)
 
static const rb_iseq_tmethod_for_self (VALUE name, VALUE arg, rb_insn_func_t func, VALUE(*build)(rb_iseq_t *, LINK_ANCHOR *const, VALUE))
 
static VALUE for_self_aref (rb_iseq_t *iseq, LINK_ANCHOR *const ret, VALUE a)
 
static VALUE for_self_aset (rb_iseq_t *iseq, LINK_ANCHOR *const ret, VALUE a)
 
const rb_iseq_trb_method_for_self_aref (VALUE name, VALUE arg, rb_insn_func_t func)
 
const rb_iseq_trb_method_for_self_aset (VALUE name, VALUE arg, rb_insn_func_t func)
 
rb_iseq_tiseq_alloc (void)
 
static ibf_offset_t ibf_dump_pos (struct ibf_dump *dump)
 
static ibf_offset_t ibf_dump_write (struct ibf_dump *dump, const void *buff, unsigned long size)
 
static void ibf_dump_overwrite (struct ibf_dump *dump, void *buff, unsigned int size, long offset)
 
static void * ibf_load_alloc (const struct ibf_load *load, ibf_offset_t offset, int size)
 
static int ibf_table_lookup (struct st_table *table, st_data_t key)
 
static int ibf_table_index (struct st_table *table, st_data_t key)
 
static VALUE ibf_load_object (const struct ibf_load *load, VALUE object_index)
 
static rb_iseq_tibf_load_iseq (const struct ibf_load *load, const rb_iseq_t *index_iseq)
 
static VALUE ibf_dump_object (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_dump_id (struct ibf_dump *dump, ID id)
 
static ID ibf_load_id (const struct ibf_load *load, const ID id_index)
 
static VALUE ibf_dump_callinfo (struct ibf_dump *dump, const struct rb_call_info *ci)
 
static ibf_offset_t ibf_dump_iseq_each (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static rb_iseq_tibf_dump_iseq (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static VALUE ibf_dump_gentry (struct ibf_dump *dump, const struct rb_global_entry *entry)
 
static VALUE ibf_load_gentry (const struct ibf_load *load, const struct rb_global_entry *entry)
 
static VALUEibf_dump_code (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static VALUEibf_load_code (const struct ibf_load *load, const rb_iseq_t *iseq, const struct rb_iseq_constant_body *body)
 
static VALUEibf_dump_param_opt_table (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static VALUEibf_load_param_opt_table (const struct ibf_load *load, const struct rb_iseq_constant_body *body)
 
static struct rb_iseq_param_keyword * ibf_dump_param_keyword (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static const struct rb_iseq_param_keyword * ibf_load_param_keyword (const struct ibf_load *load, const struct rb_iseq_constant_body *body)
 
static struct iseq_line_info_entryibf_dump_line_info_table (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static struct iseq_line_info_entryibf_load_line_info_table (const struct ibf_load *load, const struct rb_iseq_constant_body *body)
 
static IDibf_dump_local_table (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static IDibf_load_local_table (const struct ibf_load *load, const struct rb_iseq_constant_body *body)
 
static struct iseq_catch_table * ibf_dump_catch_table (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static struct iseq_catch_table * ibf_load_catch_table (const struct ibf_load *load, const struct rb_iseq_constant_body *body)
 
static struct rb_call_infoibf_dump_ci_entries (struct ibf_dump *dump, const rb_iseq_t *iseq)
 
static struct rb_call_infoibf_load_ci_entries (const struct ibf_load *load, const struct rb_iseq_constant_body *body)
 
static VALUE ibf_load_location_str (const struct ibf_load *load, VALUE str_index)
 
static void ibf_load_iseq_each (const struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
 
static void ibf_dump_iseq_list (struct ibf_dump *dump, struct ibf_header *header)
 
static int ibf_dump_id_list_i (st_data_t key, st_data_t val, st_data_t ptr)
 
static void ibf_dump_id_list (struct ibf_dump *dump, struct ibf_header *header)
 
static void ibf_dump_object_unsupported (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_unsupported (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_class (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_class (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_float (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_float (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_string (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_string (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_regexp (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_regexp (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_array (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_array (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static int ibf_dump_object_hash_i (st_data_t key, st_data_t val, st_data_t ptr)
 
static void ibf_dump_object_hash (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_hash (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_struct (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_struct (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_bignum (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_bignum (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_data (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_data (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_complex_rational (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_complex_rational (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static void ibf_dump_object_symbol (struct ibf_dump *dump, VALUE obj)
 
static VALUE ibf_load_object_symbol (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
 
static ibf_offset_t lbf_dump_object_object (struct ibf_dump *dump, VALUE obj)
 
static void ibf_dump_object_list (struct ibf_dump *dump, struct ibf_header *header)
 
static void ibf_dump_mark (void *ptr)
 
static void ibf_dump_free (void *ptr)
 
static size_t ibf_dump_memsize (const void *ptr)
 
static void ibf_dump_setup (struct ibf_dump *dump, VALUE dumper_obj)
 
VALUE iseq_ibf_dump (const rb_iseq_t *iseq, VALUE opt)
 
static const ibf_offset_tibf_iseq_list (const struct ibf_load *load)
 
void ibf_load_iseq_complete (rb_iseq_t *iseq)
 
static void ibf_load_setup (struct ibf_load *load, VALUE loader_obj, VALUE str)
 
static void ibf_loader_mark (void *ptr)
 
static void ibf_loader_free (void *ptr)
 
static size_t ibf_loader_memsize (const void *ptr)
 
const rb_iseq_tiseq_ibf_load (VALUE str)
 
VALUE iseq_ibf_load_extra_data (VALUE str)
 

Variables

static const struct st_hash_type cdhash_type
 
static ibf_dump_object_function dump_object_functions [RUBY_T_MASK+1]
 
static ibf_load_object_function load_object_functions [RUBY_T_MASK+1]
 
static const rb_data_type_t ibf_dump_type
 
static const rb_data_type_t ibf_load_type
 

Macro Definition Documentation

◆ ADD_ADJUST

#define ADD_ADJUST (   seq,
  line,
  label 
)    ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), (line)))

Definition at line 288 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_ADJUST_RESTORE

#define ADD_ADJUST_RESTORE (   seq,
  label 
)    ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), -1))

Definition at line 291 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_CALL

#define ADD_CALL (   seq,
  line,
  id,
  argc 
)    ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)

Definition at line 248 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_CALL_RECEIVER

#define ADD_CALL_RECEIVER (   seq,
  line 
)    ADD_INSN((seq), (line), putself)

Definition at line 245 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_CALL_WITH_BLOCK

#define ADD_CALL_WITH_BLOCK (   seq,
  line,
  id,
  argc,
  block 
)    ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), NULL)

Definition at line 251 of file compile.c.

Referenced by build_postexe_iseq(), and iseq_compile_each().

◆ ADD_CATCH_ENTRY

#define ADD_CATCH_ENTRY (   type,
  ls,
  le,
  iseqv,
  lc 
)
Value:
do { \
VALUE _e = rb_ary_new3(5, (type), \
(VALUE)(ls) | 1, (VALUE)(le) | 1, \
(VALUE)(iseqv), (VALUE)(lc) | 1); \
LABEL_UNREMOVABLE(ls); \
LABEL_UNREMOVABLE(le); \
LABEL_UNREMOVABLE(lc); \
rb_ary_push(ISEQ_COMPILE_DATA(iseq)->catch_table_ary, freeze_hide_obj(_e)); \
} while (0)
static VALUE freeze_hide_obj(VALUE obj)
Definition: compile.c:419
#define le(x, y)
Definition: time.c:72
unsigned long VALUE
Definition: ruby.h:85
#define rb_ary_new3
Definition: intern.h:91
#define ISEQ_COMPILE_DATA(iseq)
Definition: iseq.h:77

Definition at line 296 of file compile.c.

Referenced by defined_expr(), iseq_build_from_ary_exception(), iseq_compile_each(), and rb_iseq_compile_node().

◆ ADD_GETLOCAL

#define ADD_GETLOCAL (   seq,
  line,
  idx,
  level 
)
Value:
do { \
ADD_INSN2((seq), (line), getlocal, INT2FIX((idx) + VM_ENV_DATA_SIZE - 1), INT2FIX(level)); \
} while (0)
#define level
#define VM_ENV_DATA_SIZE
Definition: vm_core.h:988
#define INT2FIX(i)
Definition: ruby.h:232

Definition at line 271 of file compile.c.

Referenced by for_self_aset(), iseq_compile_each(), and rb_iseq_compile_node().

◆ ADD_INSN

#define ADD_INSN (   seq,
  line,
  insn 
)    ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))

◆ ADD_INSN1

#define ADD_INSN1 (   seq,
  line,
  insn,
  op1 
)
Value:
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
static void ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *elem)
Definition: compile.c:507
unsigned long VALUE
Definition: ruby.h:85
static INSN * new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc,...)
Definition: compile.c:1062

Definition at line 213 of file compile.c.

Referenced by build_postexe_iseq(), compile_array_(), compile_colon2(), compile_cpath(), compile_dstr(), compile_dstr_fragments(), compile_flip_flop(), compile_massign(), compile_named_capture_assign(), defined_expr(), for_self_aref(), for_self_aset(), iseq_compile_each(), rb_iseq_compile_node(), setup_args(), and when_vals().

◆ ADD_INSN2

#define ADD_INSN2 (   seq,
  line,
  insn,
  op1,
  op2 
)
Value:
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 2, (VALUE)(op1), (VALUE)(op2)))
static void ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *elem)
Definition: compile.c:507
unsigned long VALUE
Definition: ruby.h:85
static INSN * new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc,...)
Definition: compile.c:1062

Definition at line 227 of file compile.c.

Referenced by compile_dregx(), compile_flip_flop(), compile_massign(), compile_named_capture_assign(), and iseq_compile_each().

◆ ADD_INSN3

#define ADD_INSN3 (   seq,
  line,
  insn,
  op1,
  op2,
  op3 
)
Value:
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 3, (VALUE)(op1), (VALUE)(op2), (VALUE)(op3)))
static void ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *elem)
Definition: compile.c:507
unsigned long VALUE
Definition: ruby.h:85
static INSN * new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc,...)
Definition: compile.c:1062

Definition at line 231 of file compile.c.

Referenced by defined_expr(), and iseq_compile_each().

◆ ADD_INSNL

#define ADD_INSNL (   seq,
  line,
  insn,
  label 
)    (ADD_INSN1(seq, line, insn, label), LABEL_REF(label))

◆ ADD_LABEL

#define ADD_LABEL (   seq,
  label 
)    ADD_ELEM((seq), (LINK_ELEMENT *) (label))

◆ ADD_SEND

#define ADD_SEND (   seq,
  line,
  id,
  argc 
)    ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(0), NULL)

Definition at line 236 of file compile.c.

Referenced by compile_array_(), and iseq_compile_each().

◆ ADD_SEND_R

#define ADD_SEND_R (   seq,
  line,
  id,
  argc,
  block,
  flag,
  keywords 
)    ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_send(iseq, (line), (id), (VALUE)(argc), (block), (VALUE)(flag), (keywords)))

Definition at line 254 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_SEND_WITH_BLOCK

#define ADD_SEND_WITH_BLOCK (   seq,
  line,
  id,
  argc,
  block 
)    ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(0), NULL)

Definition at line 242 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_SEND_WITH_FLAG

#define ADD_SEND_WITH_FLAG (   seq,
  line,
  id,
  argc,
  flag 
)    ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)(flag), NULL)

Definition at line 239 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_SEQ

#define ADD_SEQ (   seq1,
  seq2 
)    APPEND_LIST((seq1), (seq2))

◆ ADD_SETLOCAL

#define ADD_SETLOCAL (   seq,
  line,
  idx,
  level 
)
Value:
do { \
ADD_INSN2((seq), (line), setlocal, INT2FIX((idx) + VM_ENV_DATA_SIZE - 1), INT2FIX(level)); \
} while (0)
#define level
#define VM_ENV_DATA_SIZE
Definition: vm_core.h:988
#define INT2FIX(i)
Definition: ruby.h:232

Definition at line 276 of file compile.c.

Referenced by iseq_compile_each().

◆ ADD_TRACE

#define ADD_TRACE (   seq,
  line,
  event 
)
Value:
do { \
if ((event) == RUBY_EVENT_LINE && ISEQ_COVERAGE(iseq) && \
(line) > 0 && \
(line) != ISEQ_COMPILE_DATA(iseq)->last_coverable_line) { \
RARRAY_ASET(ISEQ_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
ISEQ_COMPILE_DATA(iseq)->last_coverable_line = (line); \
ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
if (ISEQ_COMPILE_DATA(iseq)->option->trace_instruction) { \
ADD_INSN1((seq), (line), trace, INT2FIX(event)); \
} \
} while (0)
#define RUBY_EVENT_LINE
Definition: ruby.h:2059
#define ISEQ_COVERAGE(iseq)
Definition: iseq.h:48
#define INT2FIX(i)
Definition: ruby.h:232
#define RUBY_EVENT_COVERAGE
Definition: ruby.h:2079
#define ISEQ_COMPILE_DATA(iseq)
Definition: iseq.h:77

Definition at line 257 of file compile.c.

Referenced by iseq_compile_each(), and rb_iseq_compile_node().

◆ APPEND_LABEL

#define APPEND_LABEL (   seq,
  before,
  label 
)    APPEND_ELEM((seq), (before), (LINK_ELEMENT *) (label))

Definition at line 285 of file compile.c.

Referenced by defined_expr().

◆ BEFORE_RETURN [1/2]

#define BEFORE_RETURN

Definition at line 409 of file compile.c.

◆ BEFORE_RETURN [2/2]

#define BEFORE_RETURN   debug_node_end()

Definition at line 409 of file compile.c.

◆ CHECK

#define CHECK (   sub)    if (!(sub)) {BEFORE_RETURN;return COMPILE_NG;}

◆ CHECK_ARRAY

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

Definition at line 6835 of file compile.c.

Referenced by iseq_build_kw().

◆ CHECK_SYMBOL

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

Definition at line 6836 of file compile.c.

Referenced by rb_iseq_build_from_ary().

◆ COMPILE

#define COMPILE (   anchor,
  desc,
  node 
)
Value:
(debug_compile("== " desc "\n", \
iseq_compile_each(iseq, (anchor), (node), 0)))
static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, NODE *n, int)
compile each node
Definition: compile.c:3970
#define debug_compile(msg, v)
Definition: compile.c:183

Definition at line 307 of file compile.c.

Referenced by compile_array_(), compile_array_keyword_arg(), compile_branch_condition(), compile_colon2(), compile_cpath(), compile_dstr_fragments(), compile_flip_flop(), compile_massign(), compile_massign_opt(), defined_expr(), iseq_compile_each(), rb_iseq_compile_node(), setup_args(), and when_vals().

◆ COMPILE_

#define COMPILE_ (   anchor,
  desc,
  node,
  popped 
)
Value:
(debug_compile("== " desc "\n", \
iseq_compile_each(iseq, (anchor), (node), (popped))))
static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, NODE *n, int)
compile each node
Definition: compile.c:3970
#define debug_compile(msg, v)
Definition: compile.c:183

Definition at line 317 of file compile.c.

Referenced by compile_array_(), and iseq_compile_each().

◆ compile_debug

#define compile_debug   CPDEBUG

Definition at line 117 of file compile.c.

Referenced by iseq_setup(), prepare_compile_error(), and verify_list().

◆ COMPILE_ERROR

#define COMPILE_ERROR   prepare_compile_error(iseq)

◆ COMPILE_NG

#define COMPILE_NG   0

◆ COMPILE_OK

#define COMPILE_OK   1

◆ COMPILE_POPPED

#define COMPILE_POPPED (   anchor,
  desc,
  node 
)
Value:
(debug_compile("== " desc "\n", \
iseq_compile_each(iseq, (anchor), (node), 1)))
static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, NODE *n, int)
compile each node
Definition: compile.c:3970
#define debug_compile(msg, v)
Definition: compile.c:183

Definition at line 312 of file compile.c.

Referenced by add_ensure_iseq(), compile_massign_lhs(), compile_massign_opt(), compile_named_capture_assign(), iseq_compile_each(), iseq_set_arguments(), iseq_set_arguments_keywords(), and rb_iseq_compile_node().

◆ COMPILE_RECV

#define COMPILE_RECV (   anchor,
  desc,
  node 
)
Value:
(private_recv_p(node) ? \
(ADD_INSN(anchor, nd_line(node), putself), VM_CALL_FCALL) : \
(COMPILE(anchor, desc, node->nd_recv), 0))
#define VM_CALL_FCALL
Definition: vm_core.h:905
#define nd_line(n)
Definition: node.h:280
#define ADD_INSN(seq, line, insn)
Definition: compile.c:205
#define COMPILE(anchor, desc, node)
Definition: compile.c:307
#define private_recv_p(node)
Definition: compile.c:3508

Definition at line 321 of file compile.c.

Referenced by iseq_compile_each().

◆ CPDEBUG

#define CPDEBUG   0

debug function(macro) interface depend on CPDEBUG if it is less than 0, runtime option is in effect.

debug level: 0: no debug output 1: show node type 2: show node important parameters ... 5: show other parameters 10: show every AST array

Definition at line 113 of file compile.c.

Referenced by compile_array_().

◆ debug_compile

#define debug_compile (   msg,
 
)    (v)

Definition at line 183 of file compile.c.

◆ debug_node_end

#define debug_node_end ( )    ((void)0)

Definition at line 174 of file compile.c.

Referenced by iseq_compile_each().

◆ debug_node_start

#define debug_node_start (   node)    ((void)0)

Definition at line 173 of file compile.c.

Referenced by iseq_compile_each().

◆ debugi

#define debugi (   header,
  id 
)    r_id(id)

Definition at line 168 of file compile.c.

Referenced by compile_colon2(), and iseq_compile_each().

◆ debugp

#define debugp (   header,
  value 
)    r_value(value)

Definition at line 169 of file compile.c.

◆ debugp_param

#define debugp_param (   header,
  value 
)    r_value(value)

Definition at line 172 of file compile.c.

Referenced by compile_dstr_fragments(), iseq_compile_each(), and when_vals().

◆ debugp_verbose

#define debugp_verbose (   header,
  value 
)    r_value(value)

Definition at line 170 of file compile.c.

◆ debugp_verbose_node

#define debugp_verbose_node (   header,
  value 
)    r_value(value)

Definition at line 171 of file compile.c.

◆ debugs

#define debugs   if(0)printf

◆ DECL_ANCHOR

#define DECL_ANCHOR (   name)    LINK_ANCHOR name[1] = {{{0,},}}

◆ defined_expr

#define defined_expr   defined_expr0

Definition at line 3510 of file compile.c.

Referenced by defined_expr(), and iseq_compile_each().

◆ ERROR_ARGS

#define ERROR_ARGS   ERROR_ARGS_AT(node)

◆ ERROR_ARGS_AT

#define ERROR_ARGS_AT (   n)    iseq, nd_line(n),

Definition at line 378 of file compile.c.

Referenced by iseq_compile_each().

◆ EXPECT_NODE

#define EXPECT_NODE (   prefix,
  node,
  ndtype 
)
Value:
do { \
NODE *error_node = (node); \
enum node_type error_type = nd_type(error_node); \
if (error_type != (ndtype)) { \
compile_bug(ERROR_ARGS_AT(error_node) \
prefix ": " #ndtype " is expected, but %s", \
ruby_node_name(error_type)); \
} \
} while (0)
node_type
Definition: node.h:22
#define nd_type(n)
Definition: node.h:274
const char * ruby_node_name(int node)
Definition: iseq.c:1739
#define ERROR_ARGS_AT(n)
Definition: compile.c:378

Definition at line 381 of file compile.c.

Referenced by compile_array_(), and iseq_set_arguments().

◆ EXPECT_NODE_NONULL

#define EXPECT_NODE_NONULL (   prefix,
  parent,
  ndtype 
)
Value:
do { \
compile_bug(ERROR_ARGS_AT(parent) \
prefix ": must be " #ndtype ", but 0"); \
} while (0)
#define ERROR_ARGS_AT(n)
Definition: compile.c:378

Definition at line 392 of file compile.c.

Referenced by iseq_compile_each().

◆ FIXNUM_INC

#define FIXNUM_INC (   n,
 
)    ((n)+(INT2FIX(i)&~FIXNUM_FLAG))

Definition at line 34 of file compile.c.

Referenced by iseq_compile_each().

◆ FIXNUM_OR

#define FIXNUM_OR (   n,
 
)    ((n)|INT2FIX(i))

Definition at line 35 of file compile.c.

◆ IBF_OBJBODY

#define IBF_OBJBODY (   type,
  offset 
)    (type *)(load->buff + sizeof(struct ibf_object_header) + (offset))

◆ IBF_OBJECT_INTERNAL

#define IBF_OBJECT_INTERNAL   FL_PROMOTED0

Definition at line 7842 of file compile.c.

◆ IBF_OBJHEADER

#define IBF_OBJHEADER (   offset)    (struct ibf_object_header *)(load->buff + (offset))

Definition at line 7909 of file compile.c.

Referenced by ibf_load_object().

◆ IBF_OFFSET

#define IBF_OFFSET (   ptr)    ((ibf_offset_t)(VALUE)(ptr))

Definition at line 7161 of file compile.c.

Referenced by ibf_load_catch_table(), ibf_load_ci_entries(), and ibf_load_param_opt_table().

◆ IBF_R

#define IBF_R (   val,
  type,
 
)    (type *)ibf_load_alloc(load, IBF_OFFSET(val), sizeof(type) * (n))

◆ IBF_W

#define IBF_W (   b,
  type,
 
)    (type *)(VALUE)ibf_dump_write(dump, (b), sizeof(type) * (n))

◆ IBF_WP

#define IBF_WP (   b,
  type,
 
)    ibf_dump_write(dump, (b), sizeof(type) * (n))

◆ IBF_WV

#define IBF_WV (   variable)    ibf_dump_write(dump, &(variable), sizeof(variable))

◆ INIT_ANCHOR

#define INIT_ANCHOR (   name)    (name->last = &name->anchor)

◆ INSERT_BEFORE_INSN

#define INSERT_BEFORE_INSN (   prev,
  line,
  insn 
)    INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))

Definition at line 209 of file compile.c.

Referenced by compile_massign_lhs().

◆ INSERT_BEFORE_INSN1

#define INSERT_BEFORE_INSN1 (   prev,
  line,
  insn,
  op1 
)
Value:
new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
int link(const char *, const char *)
Definition: win32.c:4866
unsigned long VALUE
Definition: ruby.h:85
static INSN * new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc,...)
Definition: compile.c:1062
static void INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
Definition: compile.c:869

Definition at line 218 of file compile.c.

Referenced by compile_massign_lhs().

◆ INSN_OF

#define INSN_OF (   insn)    (((INSN*)(insn))->insn_id)

Definition at line 329 of file compile.c.

Referenced by iseq_compile_each(), iseq_peephole_optimize(), and remove_unreachable_chunk().

◆ INT_PARAM

#define INT_PARAM (   F)    int_param(&iseq->body->param.F, params, SYM(F))

Referenced by rb_iseq_build_from_ary().

◆ IS_ADJUST

#define IS_ADJUST (   link)    ((link)->type == ISEQ_ELEMENT_ADJUST)

Definition at line 334 of file compile.c.

Referenced by get_destination_insn(), get_next_insn(), and get_prev_insn().

◆ IS_INSN

#define IS_INSN (   link)    ((link)->type == ISEQ_ELEMENT_INSN)

◆ IS_INSN_ID

#define IS_INSN_ID (   iobj,
  insn 
)    (INSN_OF(iobj) == BIN(insn))

◆ IS_LABEL

#define IS_LABEL (   link)    ((link)->type == ISEQ_ELEMENT_LABEL)

Definition at line 333 of file compile.c.

Referenced by iseq_optimize(), and remove_unreachable_chunk().

◆ IS_TRACE_LINE

#define IS_TRACE_LINE (   insn)
Value:
(IS_INSN_ID(insn, trace) && \
OPERAND_AT(insn, 0) == INT2FIX(RUBY_EVENT_LINE))
#define IS_INSN_ID(iobj, insn)
Definition: compile.c:335
#define RUBY_EVENT_LINE
Definition: ruby.h:2059
#define INT2FIX(i)
Definition: ruby.h:232

Referenced by iseq_peephole_optimize().

◆ iseq_absolute_path

#define iseq_absolute_path (   iseq)    ((iseq)->body->location.absolute_path)

Definition at line 192 of file compile.c.

Referenced by new_child_iseq().

◆ ISEQ_ARG

#define ISEQ_ARG

Definition at line 436 of file compile.c.

◆ ISEQ_ARG_DECLARE

#define ISEQ_ARG_DECLARE

Definition at line 437 of file compile.c.

Referenced by INSERT_LIST().

◆ iseq_path

#define iseq_path (   iseq)    ((iseq)->body->location.path)

Definition at line 191 of file compile.c.

Referenced by new_child_iseq().

◆ ISEQ_TYPE_ONCE_GUARD

#define ISEQ_TYPE_ONCE_GUARD   ISEQ_TYPE_DEFINED_GUARD

Definition at line 32 of file compile.c.

Referenced by iseq_compile_each().

◆ LABEL_REF

#define LABEL_REF (   label)    ((label)->refcnt++)

Definition at line 222 of file compile.c.

Referenced by iseq_compile_each(), and register_label().

◆ LABEL_UNREMOVABLE

#define LABEL_UNREMOVABLE (   label)    ((label) ? (LABEL_REF(label), (label)->unremovable=1) : 0)

Definition at line 294 of file compile.c.

Referenced by new_adjust_body().

◆ LVAR_ERRINFO

#define LVAR_ERRINFO   (1)

Definition at line 186 of file compile.c.

Referenced by iseq_compile_each(), and rb_iseq_compile_node().

◆ MEMORY

#define MEMORY (   v)
Value:
{ \
int i; \
if (memindex == memsize) return 0; \
for (i=0; i<memindex; i++) { \
if (mem[i] == (v)) return 0; \
} \
mem[memindex++] = (v); \
}

Referenced by compile_massign_opt().

◆ NEW_CHILD_ISEQ

#define NEW_CHILD_ISEQ (   node,
  name,
  type,
  line_no 
)    new_child_iseq(iseq, (node), rb_fstring(name), iseq, (type), (line_no))

Definition at line 197 of file compile.c.

Referenced by build_postexe_iseq(), defined_expr(), and iseq_compile_each().

◆ NEW_ISEQ

#define NEW_ISEQ (   node,
  name,
  type,
  line_no 
)    new_child_iseq(iseq, (node), rb_fstring(name), 0, (type), (line_no))

Definition at line 194 of file compile.c.

Referenced by iseq_compile_each().

◆ NEW_LABEL

#define NEW_LABEL (   l)    new_label_body(iseq, (l))

◆ OPERAND_AT

#define OPERAND_AT (   insn,
  idx 
)    (((INSN*)(insn))->operands[(idx)])

◆ PADDING_SIZE_MAX

#define PADDING_SIZE_MAX   0

Definition at line 764 of file compile.c.

Referenced by compile_data_alloc().

◆ private_recv_p

#define private_recv_p (   node)    (nd_type((node)->nd_recv) == NODE_SELF)

Definition at line 3508 of file compile.c.

Referenced by defined_expr(), and iseq_compile_each().

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

◆ ruby_sourcefile

#define ruby_sourcefile   RSTRING_PTR(iseq->body->location.path)

Definition at line 542 of file compile.c.

Referenced by when_vals().

◆ RUBY_UNTYPED_DATA_WARNING

#define RUBY_UNTYPED_DATA_WARNING   0

Definition at line 30 of file compile.c.

◆ SP_INSN

#define SP_INSN (   opt)    insn_set_specialized_instruction(iseq, iobj, BIN(opt_##opt))

◆ SYM [1/2]

#define SYM (   s)    ID2SYM(rb_intern(#s))

◆ SYM [2/2]

#define SYM (   s)    ID2SYM(rb_intern(#s))

◆ UNKNOWN_NODE

#define UNKNOWN_NODE (   prefix,
  node 
)
Value:
do { \
NODE *error_node = (node); \
compile_bug(ERROR_ARGS_AT(error_node) prefix ": unknown node (%s)", \
ruby_node_name(nd_type(error_node))); \
} while (0)
#define nd_type(n)
Definition: node.h:274
const char * ruby_node_name(int node)
Definition: iseq.c:1739
#define ERROR_ARGS_AT(n)
Definition: compile.c:378

Definition at line 398 of file compile.c.

Referenced by iseq_compile_each(), and setup_args().

◆ USE_INSN_STACK_INCREASE

#define USE_INSN_STACK_INCREASE   1

Definition at line 17 of file compile.c.

Typedef Documentation

◆ ADJUST

typedef struct iseq_adjust_data ADJUST

◆ compile_error_func

typedef void(* compile_error_func) (rb_iseq_t *, int, const char *,...)

Definition at line 338 of file compile.c.

◆ ibf_dump_object_function

typedef void(* ibf_dump_object_function) (struct ibf_dump *dump, VALUE obj)

Definition at line 8240 of file compile.c.

◆ ibf_load_object_function

typedef VALUE(* ibf_load_object_function) (const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t)

Definition at line 8307 of file compile.c.

◆ ibf_offset_t

typedef unsigned int ibf_offset_t

Definition at line 7160 of file compile.c.

◆ INSN

typedef struct iseq_insn_data INSN

◆ LABEL

typedef struct iseq_label_data LABEL

◆ LINK_ANCHOR

typedef struct iseq_link_anchor LINK_ANCHOR

◆ LINK_ELEMENT

Enumeration Type Documentation

◆ compile_array_type_t

Enumerator
COMPILE_ARRAY_TYPE_ARRAY 
COMPILE_ARRAY_TYPE_HASH 
COMPILE_ARRAY_TYPE_ARGS 

Definition at line 2970 of file compile.c.

◆ ibf_object_class_index

Enumerator
IBF_OBJECT_CLASS_OBJECT 
IBF_OBJECT_CLASS_ARRAY 
IBF_OBJECT_CLASS_STANDARD_ERROR 

Definition at line 7857 of file compile.c.

◆ ibf_object_data_type

Enumerator
IBF_OBJECT_DATA_ENCODING 

Definition at line 7897 of file compile.c.

◆ LABEL_RESCUE_TYPE

Enumerator
LABEL_RESCUE_NONE 
LABEL_RESCUE_BEG 
LABEL_RESCUE_END 
LABEL_RESCUE_TYPE_MAX 

Definition at line 53 of file compile.c.

Function Documentation

◆ ADD_ELEM()

static void ADD_ELEM ( ISEQ_ARG_DECLARE LINK_ANCHOR *const  anchor,
LINK_ELEMENT elem 
)
static

Definition at line 507 of file compile.c.

References iseq_link_element::next, iseq_link_element::prev, and verify_list().

Referenced by iseq_build_from_ary_body().

◆ add_ensure_iseq()

static void add_ensure_iseq ( LINK_ANCHOR *const  ret,
rb_iseq_t iseq,
int  is_return 
)
static

◆ add_ensure_range()

static void add_ensure_range ( rb_iseq_t iseq,
struct ensure_range erange,
LABEL lstart,
LABEL lend 
)
static

Definition at line 3750 of file compile.c.

References ensure_range::begin, compile_data_alloc(), ensure_range::end, ne, and ensure_range::next.

Referenced by add_ensure_iseq().

◆ adjust_stack()

static void adjust_stack ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
int  line,
int  rlen,
int  llen 
)
static

Definition at line 3365 of file compile.c.

References ADD_INSN.

Referenced by compile_massign().

◆ append_compile_error()

static void append_compile_error ( rb_iseq_t iseq,
int  line,
const char *  fmt,
  ... 
)
static

◆ APPEND_ELEM()

static void APPEND_ELEM ( ISEQ_ARG_DECLARE LINK_ANCHOR *const  anchor,
LINK_ELEMENT before,
LINK_ELEMENT elem 
)
static

Definition at line 519 of file compile.c.

References iseq_link_element::next, iseq_link_element::prev, and verify_list().

◆ APPEND_LIST()

static void APPEND_LIST ( ISEQ_ARG_DECLARE LINK_ANCHOR *const  anc1,
LINK_ANCHOR *const  anc2 
)
static

◆ build_postexe_iseq()

static VALUE build_postexe_iseq ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE body 
)
static

◆ calc_sp_depth()

static int calc_sp_depth ( int  depth,
INSN iobj 
)
static

Definition at line 6348 of file compile.c.

References iseq_insn_data::insn_id, and iseq_insn_data::operands.

Referenced by iseq_set_sequence().

◆ caller_location()

static int caller_location ( VALUE path,
VALUE absolute_path 
)
static

◆ case_when_optimizable_literal()

static VALUE case_when_optimizable_literal ( NODE node)
static

◆ cdhash_cmp()

static int cdhash_cmp ( VALUE  val,
VALUE  lit 
)
static

Definition at line 1510 of file compile.c.

References BUILTIN_TYPE, rb_eql(), rb_str_hash_cmp(), SPECIAL_CONST_P, and T_STRING.

◆ cdhash_hash()

static st_index_t cdhash_hash ( VALUE  a)
static

Definition at line 1526 of file compile.c.

References FIX2LONG, hval, rb_hash(), rb_str_hash(), RB_TYPE_P, SPECIAL_CONST_P, and T_STRING.

◆ cdhash_set_label_i()

static int cdhash_set_label_i ( VALUE  key,
VALUE  val,
void *  ptr 
)
static

◆ compile_array()

static VALUE compile_array ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node_root,
enum compile_array_type_t  type 
)
static

Definition at line 3171 of file compile.c.

References compile_array_(), and NULL.

Referenced by iseq_compile_each(), and setup_args().

◆ compile_array_()

static int compile_array_ ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node_root,
enum compile_array_type_t  type,
struct rb_call_info_kw_arg **  keywords_ptr,
int  popped 
)
static

◆ compile_array_keyword_arg()

static int compile_array_keyword_arg ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
const NODE *const  root_node,
struct rb_call_info_kw_arg **const  kw_arg_ptr 
)
static

Definition at line 2923 of file compile.c.

References assert, COMPILE, FALSE, len, nd_type, NODE_ARRAY, NODE_HASH, NODE_LIT, NULL, RB_TYPE_P, ruby_xmalloc(), T_SYMBOL, and TRUE.

Referenced by compile_array_().

◆ compile_branch_condition()

static int compile_branch_condition ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE cond,
LABEL then_label,
LABEL else_label 
)
static

◆ compile_bug()

static void compile_bug ( rb_iseq_t iseq,
int  line,
const char *  fmt,
  ... 
)
static

◆ compile_colon2()

static int compile_colon2 ( rb_iseq_t iseq,
NODE node,
LINK_ANCHOR *const  pref,
LINK_ANCHOR *const  body 
)
static

◆ compile_cpath()

static VALUE compile_cpath ( LINK_ANCHOR *const  ret,
rb_iseq_t iseq,
NODE cpath 
)
static

◆ compile_data_alloc()

static void* compile_data_alloc ( rb_iseq_t iseq,
size_t  size 
)
static

◆ compile_data_alloc_adjust()

static ADJUST* compile_data_alloc_adjust ( rb_iseq_t iseq)
static

Definition at line 846 of file compile.c.

References compile_data_alloc().

Referenced by new_adjust_body().

◆ compile_data_alloc_insn()

static INSN* compile_data_alloc_insn ( rb_iseq_t iseq)
static

Definition at line 834 of file compile.c.

References compile_data_alloc().

Referenced by new_insn_core().

◆ compile_data_alloc_label()

static LABEL* compile_data_alloc_label ( rb_iseq_t iseq)
static

Definition at line 840 of file compile.c.

References compile_data_alloc().

Referenced by new_label_body().

◆ compile_dregx()

static int compile_dregx ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node 
)
static

Definition at line 2828 of file compile.c.

References ADD_INSN2, CHECK, cnt, compile_dstr_fragments(), COMPILE_OK, INT2FIX, and nd_line.

Referenced by iseq_compile_each().

◆ compile_dstr()

static int compile_dstr ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node 
)
static

Definition at line 2819 of file compile.c.

References ADD_INSN1, CHECK, cnt, compile_dstr_fragments(), COMPILE_OK, INT2FIX, and nd_line.

Referenced by iseq_compile_each().

◆ compile_dstr_fragments()

static int compile_dstr_fragments ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node,
int *  cntp 
)
static

◆ compile_flip_flop()

static int compile_flip_flop ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node,
int  again,
LABEL then_label,
LABEL else_label 
)
static

◆ compile_massign()

static int compile_massign ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node,
int  popped 
)
static

◆ compile_massign_lhs()

static int compile_massign_lhs ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node 
)
static

◆ compile_massign_opt()

static int compile_massign_opt ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE rhsn,
NODE orig_lhsn 
)
static

◆ compile_massign_opt_lhs()

static int compile_massign_opt_lhs ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE lhsn 
)
static

Definition at line 3290 of file compile.c.

References CHECK, compile_massign_lhs(), and COMPILE_OK.

Referenced by compile_massign_opt().

◆ compile_named_capture_assign()

static void compile_named_capture_assign ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node 
)
static

◆ defined_expr()

static int defined_expr ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node,
LABEL **  lfinish,
VALUE  needstr 
)
static

◆ dump_disasm_list()

static void dump_disasm_list ( LINK_ELEMENT elem)
static

◆ FIRST_ELEMENT()

static LINK_ELEMENT* FIRST_ELEMENT ( LINK_ANCHOR *const  anchor)
static

◆ for_self_aref()

static VALUE for_self_aref ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
VALUE  a 
)
static

◆ for_self_aset()

static VALUE for_self_aset ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
VALUE  a 
)
static

◆ freeze_hide_obj()

static VALUE freeze_hide_obj ( VALUE  obj)
inlinestatic

Definition at line 419 of file compile.c.

References OBJ_FREEZE, and RBASIC_CLEAR_CLASS.

Referenced by iseq_set_sequence().

◆ get_destination_insn()

static LINK_ELEMENT* get_destination_insn ( INSN iobj)
static

Definition at line 1955 of file compile.c.

References IS_ADJUST, IS_INSN, iseq_label_data::link, list, iseq_link_element::next, and OPERAND_AT.

Referenced by iseq_peephole_optimize().

◆ get_dyna_var_idx()

static int get_dyna_var_idx ( const rb_iseq_t iseq,
ID  id,
int *  level,
int *  ls 
)
static

◆ get_dyna_var_idx_at_raw()

static int get_dyna_var_idx_at_raw ( const rb_iseq_t iseq,
ID  id 
)
static

◆ get_exception_sym2type()

static VALUE get_exception_sym2type ( VALUE  sym)
static

Definition at line 6547 of file compile.c.

References ID2SYM, PRIsVALUE, rb_eSyntaxError, rb_intern, and rb_raise().

Referenced by iseq_build_from_ary_exception().

◆ get_ivar_ic_value()

static VALUE get_ivar_ic_value ( rb_iseq_t iseq,
ID  id 
)
inlinestatic

◆ get_local_var_idx()

static int get_local_var_idx ( const rb_iseq_t iseq,
ID  id 
)
static

◆ get_lvar_level()

static int get_lvar_level ( const rb_iseq_t iseq)
static

◆ get_next_insn()

static LINK_ELEMENT* get_next_insn ( INSN iobj)
static

Definition at line 1971 of file compile.c.

References IS_ADJUST, IS_INSN, iseq_insn_data::link, list, and iseq_link_element::next.

Referenced by iseq_peephole_optimize().

◆ get_prev_insn()

static LINK_ELEMENT* get_prev_insn ( INSN iobj)
static

◆ ibf_dump_callinfo()

static VALUE ibf_dump_callinfo ( struct ibf_dump dump,
const struct rb_call_info ci 
)
static

Definition at line 7321 of file compile.c.

References rb_call_info::flag, ibf_dump_iseq_each(), Qfalse, Qtrue, and VM_CALL_KWARG.

Referenced by ibf_dump_code().

◆ ibf_dump_catch_table()

static struct iseq_catch_table* ibf_dump_catch_table ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_ci_entries()

static struct rb_call_info* ibf_dump_ci_entries ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_code()

static VALUE* ibf_dump_code ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_free()

static void ibf_dump_free ( void *  ptr)
static

Definition at line 8406 of file compile.c.

References ibf_dump::id_table, ibf_dump::iseq_table, ruby_xfree(), and st_free_table.

Referenced by iseq_ibf_dump().

◆ ibf_dump_gentry()

static VALUE ibf_dump_gentry ( struct ibf_dump dump,
const struct rb_global_entry entry 
)
static

Definition at line 7345 of file compile.c.

References ibf_dump_id(), and rb_global_entry::id.

Referenced by ibf_dump_code().

◆ ibf_dump_id()

static VALUE ibf_dump_id ( struct ibf_dump dump,
ID  id 
)
static

◆ ibf_dump_id_list()

static void ibf_dump_id_list ( struct ibf_dump dump,
struct ibf_header header 
)
static

◆ ibf_dump_id_list_i()

static int ibf_dump_id_list_i ( st_data_t  key,
st_data_t  val,
st_data_t  ptr 
)
static

◆ ibf_dump_iseq()

static rb_iseq_t* ibf_dump_iseq ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_iseq_each()

static ibf_offset_t ibf_dump_iseq_each ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_iseq_list()

static void ibf_dump_iseq_list ( struct ibf_dump dump,
struct ibf_header header 
)
static

◆ ibf_dump_line_info_table()

static struct iseq_line_info_entry* ibf_dump_line_info_table ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_local_table()

static ID* ibf_dump_local_table ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_mark()

static void ibf_dump_mark ( void *  ptr)
static

Definition at line 8397 of file compile.c.

References ibf_dump::iseq_list, ibf_dump::obj_list, rb_gc_mark(), and ibf_dump::str.

◆ ibf_dump_memsize()

static size_t ibf_dump_memsize ( const void *  ptr)
static

Definition at line 8421 of file compile.c.

References ibf_dump::id_table, ibf_dump::iseq_table, size, and st_memsize().

◆ ibf_dump_object()

static VALUE ibf_dump_object ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ ibf_dump_object_array()

static void ibf_dump_object_array ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 8041 of file compile.c.

References ibf_dump_object(), IBF_WV, len, RARRAY_AREF, and RARRAY_LEN.

◆ ibf_dump_object_bignum()

static void ibf_dump_object_bignum ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 8140 of file compile.c.

References BDIGIT, BIGNUM_DIGITS, BIGNUM_LEN, BIGNUM_SIGN, IBF_WP, IBF_WV, and len.

◆ ibf_dump_object_class()

static void ibf_dump_object_class ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ ibf_dump_object_complex_rational()

static void ibf_dump_object_complex_rational ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 8199 of file compile.c.

References ibf_dump_object(), IBF_WV, and RCOMPLEX.

◆ ibf_dump_object_data()

static void ibf_dump_object_data ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ ibf_dump_object_float()

static void ibf_dump_object_float ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 7967 of file compile.c.

References ibf_dump_write(), and RFLOAT_VALUE.

◆ ibf_dump_object_hash()

static void ibf_dump_object_hash ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 8080 of file compile.c.

References ibf_dump_object_hash_i(), IBF_WV, len, RHASH, RHASH_SIZE, st_data_t, and st_foreach.

◆ ibf_dump_object_hash_i()

static int ibf_dump_object_hash_i ( st_data_t  key,
st_data_t  val,
st_data_t  ptr 
)
static

Definition at line 8069 of file compile.c.

References ibf_dump_object(), IBF_WV, key, ST_CONTINUE, and val.

Referenced by ibf_dump_object_hash().

◆ ibf_dump_object_list()

static void ibf_dump_object_list ( struct ibf_dump dump,
struct ibf_header header 
)
static

◆ ibf_dump_object_regexp()

static void ibf_dump_object_regexp ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ ibf_dump_object_string()

static void ibf_dump_object_string ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ ibf_dump_object_struct()

static void ibf_dump_object_struct ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ ibf_dump_object_symbol()

static void ibf_dump_object_symbol ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 8223 of file compile.c.

References ibf_dump_object(), IBF_WV, and rb_sym2str.

◆ ibf_dump_object_unsupported()

static void ibf_dump_object_unsupported ( struct ibf_dump dump,
VALUE  obj 
)
static

Definition at line 7913 of file compile.c.

References rb_bug(), and rb_obj_info_dump().

Referenced by ibf_dump_object_data().

◆ ibf_dump_overwrite()

static void ibf_dump_overwrite ( struct ibf_dump dump,
void *  buff,
unsigned int  size,
long  offset 
)
static

Definition at line 7225 of file compile.c.

References memcpy, rb_bug(), RSTRING_LEN, RSTRING_PTR, and ibf_dump::str.

Referenced by iseq_ibf_dump().

◆ ibf_dump_param_keyword()

static struct rb_iseq_param_keyword* ibf_dump_param_keyword ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_param_opt_table()

static VALUE* ibf_dump_param_opt_table ( struct ibf_dump dump,
const rb_iseq_t iseq 
)
static

◆ ibf_dump_pos()

static ibf_offset_t ibf_dump_pos ( struct ibf_dump dump)
static

◆ ibf_dump_setup()

static void ibf_dump_setup ( struct ibf_dump dump,
VALUE  dumper_obj 
)
static

◆ ibf_dump_write()

static ibf_offset_t ibf_dump_write ( struct ibf_dump dump,
const void *  buff,
unsigned long  size 
)
static

◆ ibf_iseq_list()

static const ibf_offset_t* ibf_iseq_list ( const struct ibf_load load)
static

Definition at line 8503 of file compile.c.

References ibf_load::buff, ibf_load::header, and ibf_header::iseq_list_offset.

Referenced by ibf_load_iseq_complete().

◆ ibf_load_alloc()

static void* ibf_load_alloc ( const struct ibf_load load,
ibf_offset_t  offset,
int  size 
)
static

Definition at line 7235 of file compile.c.

References ibf_load::buff, memcpy, and ruby_xmalloc().

Referenced by ibf_load_catch_table(), and ibf_load_ci_entries().

◆ ibf_load_catch_table()

static struct iseq_catch_table* ibf_load_catch_table ( const struct ibf_load load,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_ci_entries()

static struct rb_call_info* ibf_load_ci_entries ( const struct ibf_load load,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_code()

static VALUE* ibf_load_code ( const struct ibf_load load,
const rb_iseq_t iseq,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_gentry()

static VALUE ibf_load_gentry ( const struct ibf_load load,
const struct rb_global_entry entry 
)
static

Definition at line 7351 of file compile.c.

References ibf_load_id(), and rb_global_entry().

Referenced by ibf_load_code().

◆ ibf_load_id()

static ID ibf_load_id ( const struct ibf_load load,
const ID  id_index 
)
static

◆ ibf_load_iseq()

static rb_iseq_t * ibf_load_iseq ( const struct ibf_load load,
const rb_iseq_t index_iseq 
)
static

◆ ibf_load_iseq_complete()

void ibf_load_iseq_complete ( rb_iseq_t iseq)

◆ ibf_load_iseq_each()

static void ibf_load_iseq_each ( const struct ibf_load load,
rb_iseq_t iseq,
ibf_offset_t  offset 
)
static

◆ ibf_load_line_info_table()

static struct iseq_line_info_entry* ibf_load_line_info_table ( const struct ibf_load load,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_local_table()

static ID* ibf_load_local_table ( const struct ibf_load load,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_location_str()

static VALUE ibf_load_location_str ( const struct ibf_load load,
VALUE  str_index 
)
static

Definition at line 7736 of file compile.c.

References ibf_load_object(), Qnil, and rb_fstring().

Referenced by ibf_load_iseq_each().

◆ ibf_load_object()

static VALUE ibf_load_object ( const struct ibf_load load,
VALUE  object_index 
)
static

◆ ibf_load_object_array()

static VALUE ibf_load_object_array ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_bignum()

static VALUE ibf_load_object_bignum ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_class()

static VALUE ibf_load_object_class ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_complex_rational()

static VALUE ibf_load_object_complex_rational ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_data()

static VALUE ibf_load_object_data ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_float()

static VALUE ibf_load_object_float ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

Definition at line 7974 of file compile.c.

References DBL2NUM, and IBF_OBJBODY.

◆ ibf_load_object_hash()

static VALUE ibf_load_object_hash ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_regexp()

static VALUE ibf_load_object_regexp ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_string()

static VALUE ibf_load_object_string ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_struct()

static VALUE ibf_load_object_struct ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

◆ ibf_load_object_symbol()

static VALUE ibf_load_object_symbol ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

Definition at line 8231 of file compile.c.

References ibf_load_object(), IBF_OBJBODY, ID2SYM, rb_intern_str, and ibf_object_symbol::str.

◆ ibf_load_object_unsupported()

static VALUE ibf_load_object_unsupported ( const struct ibf_load load,
const struct ibf_object_header header,
ibf_offset_t  offset 
)
static

Definition at line 7920 of file compile.c.

References Qnil, and rb_bug().

Referenced by ibf_load_object_data().

◆ ibf_load_param_keyword()

static const struct rb_iseq_param_keyword* ibf_load_param_keyword ( const struct ibf_load load,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_param_opt_table()

static VALUE* ibf_load_param_opt_table ( const struct ibf_load load,
const struct rb_iseq_constant_body body 
)
static

◆ ibf_load_setup()

static void ibf_load_setup ( struct ibf_load load,
VALUE  loader_obj,
VALUE  str 
)
static

◆ ibf_loader_free()

static void ibf_loader_free ( void *  ptr)
static

Definition at line 8607 of file compile.c.

References ibf_load::id_list, and ruby_xfree().

◆ ibf_loader_mark()

static void ibf_loader_mark ( void *  ptr)
static

Definition at line 8596 of file compile.c.

References ibf_load::iseq_list, ibf_load::obj_list, rb_gc_mark(), and ibf_load::str.

◆ ibf_loader_memsize()

static size_t ibf_loader_memsize ( const void *  ptr)
static

Definition at line 8617 of file compile.c.

◆ ibf_table_index()

static int ibf_table_index ( struct st_table table,
st_data_t  key 
)
static

◆ ibf_table_lookup()

static int ibf_table_lookup ( struct st_table table,
st_data_t  key 
)
static

Definition at line 7248 of file compile.c.

References st_data_t, st_lookup, and val.

Referenced by ibf_dump_iseq(), and ibf_table_index().

◆ INSERT_ELEM_NEXT()

static void INSERT_ELEM_NEXT ( LINK_ELEMENT elem1,
LINK_ELEMENT elem2 
)
static

Definition at line 855 of file compile.c.

References iseq_link_element::next, and iseq_link_element::prev.

Referenced by iseq_peephole_optimize().

◆ INSERT_ELEM_PREV()

static void INSERT_ELEM_PREV ( LINK_ELEMENT elem1,
LINK_ELEMENT elem2 
)
static

Definition at line 869 of file compile.c.

References iseq_link_element::next, and iseq_link_element::prev.

Referenced by compile_named_capture_assign().

◆ INSERT_LIST()

static void INSERT_LIST ( ISEQ_ARG_DECLARE LINK_ANCHOR *const  anc1,
LINK_ANCHOR *const  anc2 
)
static

◆ insn_data_length()

static int insn_data_length ( INSN iobj)
static

Definition at line 6342 of file compile.c.

References iseq_insn_data::insn_id.

Referenced by dump_disasm_list(), and iseq_set_sequence().

◆ insn_data_to_s_detail()

static VALUE insn_data_to_s_detail ( INSN iobj)
static

◆ insn_make_insn_table()

static struct st_table* insn_make_insn_table ( void  )
static

Definition at line 6615 of file compile.c.

References ID2SYM, rb_intern, st_init_numtable, and st_insert.

Referenced by iseq_build_from_ary_body().

◆ insn_set_specialized_instruction()

static int insn_set_specialized_instruction ( rb_iseq_t iseq,
INSN iobj,
int  insn_id 
)
static

◆ int_param()

static int int_param ( int *  dst,
VALUE  param,
VALUE  sym 
)
static

Definition at line 6839 of file compile.c.

References FALSE, FIX2INT, PRIsVALUE, rb_eTypeError, rb_hash_aref(), rb_raise(), T_FIXNUM, T_NIL, TRUE, TYPE, and val.

Referenced by iseq_build_kw(), and rb_iseq_build_from_ary().

◆ iseq_add_mark_object()

static int iseq_add_mark_object ( const rb_iseq_t iseq,
VALUE  v 
)
static

◆ iseq_add_mark_object_compile_time()

static int iseq_add_mark_object_compile_time ( const rb_iseq_t iseq,
VALUE  v 
)
static

Definition at line 545 of file compile.c.

References COMPILE_OK, ISEQ_COMPILE_DATA, rb_ary_push(), and SPECIAL_CONST_P.

Referenced by compile_array_(), and iseq_compile_each().

◆ iseq_alloc()

rb_iseq_t* iseq_alloc ( void  )

◆ iseq_build_callinfo_from_hash()

static VALUE iseq_build_callinfo_from_hash ( rb_iseq_t iseq,
VALUE  op 
)
static

◆ iseq_build_from_ary_body()

static int iseq_build_from_ary_body ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor,
VALUE  body,
VALUE  labels_wrapper 
)
static

◆ iseq_build_from_ary_exception()

static int iseq_build_from_ary_exception ( rb_iseq_t iseq,
struct st_table labels_table,
VALUE  exception 
)
static

◆ iseq_build_kw()

static const struct rb_iseq_param_keyword* iseq_build_kw ( rb_iseq_t iseq,
VALUE  params,
VALUE  keywords 
)
static

◆ iseq_build_load_iseq()

static const rb_iseq_t* iseq_build_load_iseq ( const rb_iseq_t iseq,
VALUE  op 
)
static

◆ iseq_calc_param_size()

static void iseq_calc_param_size ( rb_iseq_t iseq)
static

◆ iseq_compile_each()

static int iseq_compile_each ( rb_iseq_t iseq,
LINK_ANCHOR *const  ret,
NODE node,
int  popped 
)
static

compile each node

self: InstructionSequence node: Ruby compiled node popped: This node will be popped

Definition at line 3970 of file compile.c.

References ADD_ADJUST, ADD_ADJUST_RESTORE, ADD_CALL, ADD_CALL_RECEIVER, ADD_CALL_WITH_BLOCK, ADD_CATCH_ENTRY, add_ensure_iseq(), ADD_GETLOCAL, ADD_INSN, ADD_INSN1, ADD_INSN2, ADD_INSN3, ADD_INSNL, ADD_LABEL, ADD_SEND, ADD_SEND_R, ADD_SEND_WITH_BLOCK, ADD_SEND_WITH_FLAG, ADD_SEQ, ADD_SETLOCAL, ADD_TRACE, argc, ensure_range::begin, rb_iseq_struct::body, build_postexe_iseq(), cdhash_type, CHECK, COMPILE, COMPILE_, compile_array(), compile_array_(), COMPILE_ARRAY_TYPE_ARRAY, COMPILE_ARRAY_TYPE_HASH, compile_branch_condition(), compile_bug(), compile_colon2(), compile_cpath(), compile_dregx(), compile_dstr(), COMPILE_ERROR, compile_massign(), compile_named_capture_assign(), COMPILE_NG, COMPILE_OK, COMPILE_POPPED, COMPILE_RECV, CONST_ID, debug_node_end, debug_node_start, debugi, debugp_param, debugs, DECL_ANCHOR, DEFINED_CONST, defined_expr, DEFINED_NIL, ensure_range::end, ERROR_ARGS, ERROR_ARGS_AT, EXPECT_NODE_NONULL, FALSE, FIX2INT, FIXNUM_INC, RNode::flags, rb_iseq_constant_body::flags, get_dyna_var_idx(), get_ivar_ic_value(), get_local_var_idx(), get_lvar_level(), RNode::id, ID2SYM, id_core_define_method, id_core_define_singleton_method, id_core_hash_merge_ptr, id_core_set_method_alias, id_core_set_variable_alias, id_core_undef_method, id_debug_created_info, idAREF, idASET, idBackquote, idEq, idEqq, idEqTilde, IFUNC_NEW, INIT_ANCHOR, INSN_OF, INT2FIX, IS_INSN, IS_INSN_ID, rb_iseq_constant_body::is_size, iseq_add_mark_object(), iseq_add_mark_object_compile_time(), ISEQ_COMPILE_DATA, ISEQ_TYPE_ONCE_GUARD, rb_iseq_constant_body::keyword, rb_call_info_kw_arg::keywords, rb_iseq_location_struct::label, LABEL_REF, LABEL_RESCUE_BEG, LABEL_RESCUE_END, iseq_link_anchor::last, last, rb_iseq_constant_body::lead_num, level, iseq_label_data::link, list, LIST_SIZE_ZERO(), rb_iseq_constant_body::local_iseq, rb_iseq_constant_body::local_table_size, rb_iseq_constant_body::location, LVAR_ERRINFO, make_name_for_block(), nd_line, nd_type, new_callinfo(), NEW_CHILD_ISEQ, NEW_ISEQ, NEW_LABEL, NEW_NODE, iseq_link_element::next, ensure_range::next, RNode::node, NODE_ALIAS, NODE_AND, NODE_ARGSCAT, NODE_ARGSPUSH, NODE_ARRAY, NODE_ATTRASGN, NODE_BACK_REF, NODE_BEGIN, NODE_BLOCK, NODE_BLOCK_PASS, NODE_BREAK, NODE_CALL, NODE_CASE, NODE_CDECL, NODE_CLASS, NODE_COLON2, NODE_COLON3, NODE_CONST, NODE_CVAR, NODE_CVASGN, NODE_DASGN, NODE_DASGN_CURR, NODE_DEFINED, NODE_DEFN, NODE_DEFS, NODE_DOT2, NODE_DOT3, NODE_DREGX, NODE_DREGX_ONCE, NODE_DSTR, NODE_DSYM, NODE_DVAR, NODE_DXSTR, NODE_ENSURE, NODE_ERRINFO, NODE_EVSTR, NODE_FALSE, NODE_FCALL, NODE_FL_NEWLINE, NODE_FLIP2, NODE_FLIP3, NODE_FOR, NODE_GASGN, NODE_GVAR, NODE_HASH, NODE_IASGN, NODE_IASGN2, NODE_IF, NODE_ITER, NODE_IVAR, NODE_KW_ARG, NODE_LAMBDA, NODE_LASGN, NODE_LIT, NODE_LVAR, NODE_MASGN, NODE_MATCH, NODE_MATCH2, NODE_MATCH3, NODE_MODULE, NODE_NEXT, NODE_NIL, NODE_NTH_REF, NODE_OP_ASGN1, NODE_OP_ASGN2, NODE_OP_ASGN_AND, NODE_OP_ASGN_OR, NODE_OP_CDECL, NODE_OPT_N, NODE_OR, NODE_POSTEXE, NODE_PRELUDE, NODE_QCALL, NODE_REDO, NODE_RESBODY, NODE_RESCUE, NODE_RETRY, NODE_RETURN, NODE_SCLASS, NODE_SCOPE, NODE_SELF, NODE_SPLAT, NODE_STR, NODE_SUPER, NODE_TRUE, NODE_UNDEF, NODE_UNTIL, NODE_VALIAS, NODE_VALUES, NODE_VCALL, NODE_WHEN, NODE_WHILE, NODE_XSTR, NODE_YIELD, NODE_ZARRAY, NODE_ZSUPER, NULL, number_literal_p(), OPERAND_AT, rb_iseq_constant_body::opt_num, rb_iseq_constant_body::param, rb_iseq_constant_body::parent_iseq, rb_iseq_location_struct::path, POP_ELEMENT(), iseq_label_data::position, rb_iseq_constant_body::post_num, rb_iseq_constant_body::post_start, iseq_compile_data_ensure_node_stack::prev, PRIsVALUE, private_recv_p, push_ensure_entry(), Qfalse, Qnil, Qtrue, Qundef, rb_ary_new_from_args(), rb_cArray, rb_cObject, rb_eStandardError, rb_fstring(), rb_hash_new(), rb_hash_tbl_raw(), rb_id2str, rb_id_attrset(), rb_intern, rb_is_attrset_id(), rb_is_const_id(), rb_iseq_defined_string(), rb_iseq_make_compile_option(), rb_iseqw_new(), rb_ivar_set(), rb_obj_freeze(), rb_range_new(), rb_sprintf(), rb_str_concat(), rb_str_dup(), rb_str_new2, iseq_label_data::rescued, rb_iseq_constant_body::rest_start, RTEST, ruby_debug, RUBY_EVENT_LINE, RUBY_EVENT_RETURN, ruby_node_name(), setup_args(), st_data_t, st_init_numtable, st_insert, st_lookup, SYM2ID, SYMBOL_P, TAG_BREAK, TAG_NEXT, TAG_REDO, TAG_RETRY, TAG_RETURN, iseq_link_element::type, st_table::type, rb_iseq_constant_body::type, RNode::u1, RNode::u2, RNode::u3, UNKNOWN_NODE, val, RNode::value, VM_CALL_ARGS_BLOCKARG, VM_CALL_ARGS_SPLAT, VM_CALL_FCALL, VM_CALL_SUPER, VM_CALL_VCALL, VM_CHECKMATCH_ARRAY, VM_CHECKMATCH_TYPE_CASE, VM_CHECKMATCH_TYPE_RESCUE, VM_CHECKMATCH_TYPE_WHEN, VM_DEFINECLASS_FLAG_HAS_SUPERCLASS, VM_DEFINECLASS_FLAG_SCOPED, VM_DEFINECLASS_TYPE_CLASS, VM_DEFINECLASS_TYPE_MODULE, VM_DEFINECLASS_TYPE_SINGLETON_CLASS, VM_ENV_DATA_SIZE, VM_SPECIAL_OBJECT_CBASE, VM_SPECIAL_OBJECT_CONST_BASE, VM_SPECIAL_OBJECT_VMCORE, VM_THROW_LEVEL_SHIFT, VM_THROW_NO_ESCAPE_FLAG, and when_vals().

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

static int iseq_insns_unification ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor 
)
static

◆ iseq_optimize()

static int iseq_optimize ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor 
)
static

◆ iseq_peephole_optimize()

static int iseq_peephole_optimize ( rb_iseq_t iseq,
LINK_ELEMENT list,
const int  do_tailcallopt 
)
static

◆ iseq_set_arguments()

static int iseq_set_arguments ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor,
NODE node 
)
static

◆ iseq_set_arguments_keywords()

static void iseq_set_arguments_keywords ( rb_iseq_t iseq,
LINK_ANCHOR *const  optargs,
const struct rb_args_info args 
)
static

◆ iseq_set_exception_local_table()

static int iseq_set_exception_local_table ( rb_iseq_t iseq)
static

◆ iseq_set_exception_table()

static int iseq_set_exception_table ( rb_iseq_t iseq)
static

◆ iseq_set_local_table()

static int iseq_set_local_table ( rb_iseq_t iseq,
const ID tbl 
)
static

◆ iseq_set_optargs_table()

static int iseq_set_optargs_table ( rb_iseq_t iseq)
static

◆ iseq_set_sequence()

static int iseq_set_sequence ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor 
)
static

ruby insn object list -> raw instruction sequence

Definition at line 1580 of file compile.c.

References ALLOC_N, assert, rb_iseq_struct::body, calc_sp_depth(), rb_iseq_constant_body::cc_entries, cdhash_set_label_i(), rb_iseq_constant_body::ci_entries, rb_iseq_constant_body::ci_kw_size, rb_iseq_constant_body::ci_size, compile_bug(), COMPILE_ERROR, COMPILE_NG, COMPILE_OK, dump_disasm_list(), FIRST_ELEMENT(), FIX2INT, FIX2UINT, rb_call_info::flag, freeze_hide_obj(), cdhash_set_label_struct::hash, if(), insn_data_length(), iseq_insn_data::insn_id, rb_iseq_constant_body::is_entries, rb_iseq_constant_body::is_size, iseq_add_mark_object(), ISEQ_COMPILE_DATA, iseq_link_element::ISEQ_ELEMENT_ADJUST, iseq_link_element::ISEQ_ELEMENT_INSN, iseq_link_element::ISEQ_ELEMENT_LABEL, iseq_link_element::ISEQ_ELEMENT_NONE, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::iseq_size, iseq_adjust_data::label, len, cdhash_set_label_struct::len, rb_iseq_constant_body::line_info_size, rb_iseq_constant_body::line_info_table, iseq_insn_data::line_no, iseq_adjust_data::line_no, iseq_line_info_entry::line_no, list, iseq_link_element::next, iseq_insn_data::operand_size, iseq_insn_data::operands, cdhash_set_label_struct::pos, iseq_label_data::position, iseq_line_info_entry::position, rb_bug(), rb_hash_foreach(), rb_hash_rehash(), REALLOC_N, ruby_xmalloc(), iseq_label_data::set, iseq_label_data::sp, rb_iseq_constant_body::stack_max, SYM2ID, TRUE, iseq_link_element::type, UNLIKELY, VM_CALL_KWARG, xfree(), and ZALLOC_N.

Referenced by iseq_setup().

◆ iseq_set_sequence_stackcaching()

static int iseq_set_sequence_stackcaching ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor 
)
static

◆ iseq_setup()

static int iseq_setup ( rb_iseq_t iseq,
LINK_ANCHOR *const  anchor 
)
static

◆ iseq_specialized_instruction()

static int iseq_specialized_instruction ( rb_iseq_t iseq,
INSN iobj 
)
static

◆ label_get_position()

static int label_get_position ( LABEL lobj)
static

Definition at line 1866 of file compile.c.

References iseq_label_data::position.

Referenced by iseq_set_exception_table(), and iseq_set_optargs_table().

◆ label_get_sp()

static int label_get_sp ( LABEL lobj)
static

Definition at line 1872 of file compile.c.

References iseq_label_data::sp.

Referenced by iseq_set_exception_table().

◆ LAST_ELEMENT()

static LINK_ELEMENT* LAST_ELEMENT ( LINK_ANCHOR *const  anchor)
static

Definition at line 913 of file compile.c.

References iseq_link_anchor::last.

Referenced by compile_dstr_fragments(), and compile_massign_lhs().

◆ lbf_dump_object_object()

static ibf_offset_t lbf_dump_object_object ( struct ibf_dump dump,
VALUE  obj 
)
static

◆ LIST_SIZE_ZERO()

static int LIST_SIZE_ZERO ( LINK_ANCHOR *const  anchor)
static

Definition at line 932 of file compile.c.

References iseq_link_anchor::anchor, and iseq_link_element::next.

Referenced by iseq_compile_each(), and setup_args().

◆ make_name_for_block()

static VALUE make_name_for_block ( const rb_iseq_t orig_iseq)
static

◆ method_for_self()

static const rb_iseq_t* method_for_self ( VALUE  name,
VALUE  arg,
rb_insn_func_t  func,
VALUE(*)(rb_iseq_t *, LINK_ANCHOR *const, VALUE build 
)
static

◆ new_adjust_body()

static ADJUST * new_adjust_body ( rb_iseq_t iseq,
LABEL label,
int  line 
)
static

◆ new_callinfo()

static struct rb_call_info* new_callinfo ( rb_iseq_t iseq,
ID  mid,
int  argc,
unsigned int  flag,
struct rb_call_info_kw_arg kw_arg,
int  has_blockiseq 
)
static

◆ new_child_iseq()

static rb_iseq_t* new_child_iseq ( rb_iseq_t iseq,
NODE node,
VALUE  name,
const rb_iseq_t parent,
enum iseq_type  type,
int  line_no 
)
static

◆ new_insn_body()

static INSN * new_insn_body ( rb_iseq_t iseq,
int  line_no,
enum ruby_vminsn_type  insn_id,
int  argc,
  ... 
)
static

Definition at line 1062 of file compile.c.

References argc, argv, compile_data_alloc(), new_insn_core(), and va_init_list.

Referenced by iseq_set_sequence_stackcaching().

◆ new_insn_core()

static INSN* new_insn_core ( rb_iseq_t iseq,
int  line_no,
int  insn_id,
int  argc,
VALUE argv 
)
static

◆ new_insn_send()

static INSN* new_insn_send ( rb_iseq_t iseq,
int  line_no,
ID  id,
VALUE  argc,
const rb_iseq_t blockiseq,
VALUE  flag,
struct rb_call_info_kw_arg keywords 
)
static

Definition at line 1108 of file compile.c.

References compile_data_alloc(), FIX2INT, new_callinfo(), new_insn_core(), NULL, and Qfalse.

Referenced by compile_named_capture_assign().

◆ new_label_body()

static LABEL * new_label_body ( rb_iseq_t iseq,
long  line 
)
static

◆ NOINLINE()

NOINLINE ( static compile_error_func   prepare_compile_errorrb_iseq_t *iseq)

Referenced by compile_bug().

◆ number_literal_p()

static int number_literal_p ( NODE n)
static

Definition at line 3957 of file compile.c.

References nd_type, NODE_LIT, and RB_INTEGER_TYPE_P.

Referenced by iseq_compile_each().

◆ opobj_inspect()

static VALUE opobj_inspect ( VALUE  obj)
static

◆ POP_ELEMENT()

static LINK_ELEMENT* POP_ELEMENT ( ISEQ_ARG_DECLARE LINK_ANCHOR *const  anchor)
static

Definition at line 919 of file compile.c.

References iseq_link_element::next, iseq_link_element::prev, and verify_list().

Referenced by compile_massign(), and iseq_compile_each().

◆ prepare_compile_error()

static compile_error_func prepare_compile_error ( rb_iseq_t iseq)
static

Definition at line 370 of file compile.c.

References append_compile_error(), compile_bug(), and compile_debug.

Referenced by compile_bug().

◆ push_ensure_entry()

static void push_ensure_entry ( rb_iseq_t iseq,
struct iseq_compile_data_ensure_node_stack enl,
struct ensure_range er,
NODE node 
)
static

◆ r_id()

static ID r_id ( ID  id)
inlinestatic

Definition at line 157 of file compile.c.

References id.

◆ r_value()

static VALUE r_value ( VALUE  value)
inlinestatic

Definition at line 163 of file compile.c.

◆ rb_dvar_defined()

int rb_dvar_defined ( ID  id,
const struct rb_block base_block 
)

◆ rb_insns_name()

const char* rb_insns_name ( int  i)

Definition at line 6512 of file compile.c.

◆ rb_insns_name_array()

VALUE rb_insns_name_array ( void  )

Definition at line 6518 of file compile.c.

References numberof, rb_ary_new(), rb_ary_push(), rb_fstring(), rb_obj_freeze(), and rb_str_new2.

Referenced by Init_VM().

◆ rb_iseq_build_from_ary()

void rb_iseq_build_from_ary ( rb_iseq_t iseq,
VALUE  misc,
VALUE  locals,
VALUE  params,
VALUE  exception,
VALUE  body 
)

◆ rb_iseq_compile_node()

VALUE rb_iseq_compile_node ( rb_iseq_t iseq,
NODE node 
)

◆ rb_iseq_original_iseq()

VALUE* rb_iseq_original_iseq ( const rb_iseq_t iseq)

◆ rb_iseq_translate_threaded_code()

int rb_iseq_translate_threaded_code ( rb_iseq_t iseq)

◆ rb_local_defined()

int rb_local_defined ( ID  id,
const struct rb_block base_block 
)

◆ rb_method_for_self_aref()

const rb_iseq_t* rb_method_for_self_aref ( VALUE  name,
VALUE  arg,
rb_insn_func_t  func 
)

Definition at line 7144 of file compile.c.

References for_self_aref(), and method_for_self().

Referenced by define_aref_method().

◆ rb_method_for_self_aset()

const rb_iseq_t* rb_method_for_self_aset ( VALUE  name,
VALUE  arg,
rb_insn_func_t  func 
)

Definition at line 7153 of file compile.c.

References for_self_aset(), and method_for_self().

Referenced by define_aset_method().

◆ register_label()

static LABEL* register_label ( rb_iseq_t iseq,
struct st_table labels_table,
VALUE  obj 
)
static

◆ REMOVE_ELEM()

static void REMOVE_ELEM ( LINK_ELEMENT elem)
static

◆ remove_unreachable_chunk()

static int remove_unreachable_chunk ( rb_iseq_t iseq,
LINK_ELEMENT i 
)
static

◆ replace_destination()

static void replace_destination ( INSN dobj,
INSN nobj 
)
static

Definition at line 2007 of file compile.c.

References iseq_label_data::link, OPERAND_AT, iseq_label_data::refcnt, and REMOVE_ELEM().

Referenced by iseq_peephole_optimize().

◆ setup_args()

static VALUE setup_args ( rb_iseq_t iseq,
LINK_ANCHOR *const  args,
NODE argn,
unsigned int *  flag,
struct rb_call_info_kw_arg **  keywords 
)
static

◆ static_literal_node_p()

static int static_literal_node_p ( NODE node)
inlinestatic

Definition at line 2977 of file compile.c.

References FALSE, nd_type, NODE_FALSE, NODE_LIT, NODE_NIL, NODE_TRUE, and TRUE.

Referenced by compile_array_().

◆ static_literal_value()

static VALUE static_literal_value ( NODE node)
inlinestatic

Definition at line 2992 of file compile.c.

References nd_type, NODE_FALSE, NODE_NIL, NODE_TRUE, Qfalse, Qnil, and Qtrue.

Referenced by compile_array_().

◆ tailcallable_p()

static int tailcallable_p ( rb_iseq_t iseq)
inlinestatic

Definition at line 2466 of file compile.c.

References rb_iseq_struct::body, FALSE, TRUE, and rb_iseq_constant_body::type.

Referenced by iseq_optimize().

◆ unref_destination()

static void unref_destination ( INSN iobj,
int  pos 
)
static

◆ validate_label()

static int validate_label ( st_data_t  name,
st_data_t  label,
st_data_t  arg 
)
static

◆ validate_labels()

static void validate_labels ( rb_iseq_t iseq,
st_table labels_table 
)
static

Definition at line 569 of file compile.c.

References st_data_t, st_foreach, st_free_table, and validate_label().

Referenced by iseq_build_from_ary_body(), and rb_iseq_compile_node().

◆ verify_list()

static void verify_list ( ISEQ_ARG_DECLARE const char *  info,
LINK_ANCHOR *const  anchor 
)
static

◆ when_vals()

static int when_vals ( rb_iseq_t iseq,
LINK_ANCHOR *const  cond_seq,
NODE vals,
LABEL l1,
int  only_special_literals,
VALUE  literals 
)
static

Variable Documentation

◆ cdhash_type

const struct st_hash_type cdhash_type
static
Initial value:
= {
}
static int cdhash_cmp(VALUE val, VALUE lit)
Definition: compile.c:1510
static st_index_t cdhash_hash(VALUE a)
Definition: compile.c:1526

Definition at line 1536 of file compile.c.

Referenced by iseq_build_from_ary_body(), and iseq_compile_each().

◆ dump_object_functions

ibf_dump_object_function dump_object_functions[RUBY_T_MASK+1]
static

Definition at line 8241 of file compile.c.

◆ ibf_dump_type

const rb_data_type_t ibf_dump_type
static
Initial value:
= {
"ibf_dump",
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static void ibf_dump_mark(void *ptr)
Definition: compile.c:8397
#define RUBY_TYPED_WB_PROTECTED
Definition: ruby.h:1146
static void ibf_dump_free(void *ptr)
Definition: compile.c:8406
static size_t ibf_dump_memsize(const void *ptr)
Definition: compile.c:8421

Definition at line 8430 of file compile.c.

◆ ibf_load_type

const rb_data_type_t ibf_load_type
static
Initial value:
= {
"ibf_loader",
}
static void ibf_loader_mark(void *ptr)
Definition: compile.c:8596
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
#define RUBY_TYPED_WB_PROTECTED
Definition: ruby.h:1146
static size_t ibf_loader_memsize(const void *ptr)
Definition: compile.c:8617
static void ibf_loader_free(void *ptr)
Definition: compile.c:8607

Definition at line 8623 of file compile.c.

◆ load_object_functions

ibf_load_object_function load_object_functions[RUBY_T_MASK+1]
static

Definition at line 8308 of file compile.c.