Defines | Functions | Variables

vm.c File Reference

#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "gc.h"
#include "vm_core.h"
#include "iseq.h"
#include "eval_intern.h"
#include "vm_insnhelper.h"
#include "vm_insnhelper.c"
#include "vm_exec.h"
#include "vm_exec.c"
#include "vm_method.c"
#include "vm_eval.c"
#include <assert.h>
Include dependency graph for vm.c:

Go to the source code of this file.

Defines

#define BUFSIZE   0x100
#define PROCDEBUG   0
#define ENV_IN_HEAP_P(th, env)   (!((th)->stack < (env) && (env) < ((th)->stack + (th)->stack_size)))
#define ENV_VAL(env)   ((env)[1])
#define OP(mid_, bop_)   (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0)
#define C(k)   add_opt_method(rb_c##k, mid, bop)
#define vm_free   0
#define USE_THREAD_DATA_RECYCLE   1
#define RECYCLE_MAX   64
#define REWIND_CFP(expr)

Functions

static void thread_free (void *ptr)
VALUE rb_insns_name_array (void)
void vm_analysis_operand (int insn, int n, VALUE op)
void vm_analysis_register (int reg, int isset)
void vm_analysis_insn (int insn)
void rb_vm_change_state (void)
void rb_vm_inc_const_missing_count (void)
static VALUE rb_vm_set_finish_env (rb_thread_t *th)
static void vm_set_top_stack (rb_thread_t *th, VALUE iseqval)
static void vm_set_eval_stack (rb_thread_t *th, VALUE iseqval, const NODE *cref)
static void vm_set_main_stack (rb_thread_t *th, VALUE iseqval)
rb_control_frame_trb_vm_get_ruby_level_next_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
static rb_control_frame_tvm_get_ruby_level_caller_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
static void env_mark (void *const ptr)
static void env_free (void *const ptr)
static size_t env_memsize (const void *ptr)
static VALUE env_alloc (void)
static VALUE check_env_value (VALUE envval)
static int check_env (rb_env_t *const env)
static VALUE vm_make_env_each (rb_thread_t *const th, rb_control_frame_t *const cfp, VALUE *envptr, VALUE *const endptr)
static int collect_local_variables_in_iseq (rb_iseq_t *iseq, const VALUE ary)
static int collect_local_variables_in_env (rb_env_t *env, const VALUE ary)
static int vm_collect_local_variables_in_heap (rb_thread_t *th, VALUE *dfp, VALUE ary)
VALUE rb_vm_make_env_object (rb_thread_t *th, rb_control_frame_t *cfp)
void rb_vm_stack_to_heap (rb_thread_t *const th)
static VALUE vm_make_proc_from_block (rb_thread_t *th, rb_block_t *block)
VALUE rb_vm_make_proc (rb_thread_t *th, const rb_block_t *block, VALUE klass)
static VALUE invoke_block_from_c (rb_thread_t *th, const rb_block_t *block, VALUE self, int argc, const VALUE *argv, const rb_block_t *blockptr, const NODE *cref)
static const rb_block_tcheck_block (rb_thread_t *th)
static VALUE vm_yield_with_cref (rb_thread_t *th, int argc, const VALUE *argv, const NODE *cref)
static VALUE vm_yield (rb_thread_t *th, int argc, const VALUE *argv)
VALUE rb_vm_invoke_proc (rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, const rb_block_t *blockptr)
static rb_control_frame_tvm_normal_frame (rb_thread_t *th, rb_control_frame_t *cfp)
static VALUE vm_cfp_svar_get (rb_thread_t *th, rb_control_frame_t *cfp, VALUE key)
static void vm_cfp_svar_set (rb_thread_t *th, rb_control_frame_t *cfp, VALUE key, const VALUE val)
static VALUE vm_svar_get (VALUE key)
static void vm_svar_set (VALUE key, VALUE val)
VALUE rb_backref_get (void)
void rb_backref_set (VALUE val)
VALUE rb_lastline_get (void)
void rb_lastline_set (VALUE val)
int rb_vm_get_sourceline (const rb_control_frame_t *cfp)
static int vm_backtrace_each (rb_thread_t *th, int lev, void(*init)(void *), rb_backtrace_iter_func *iter, void *arg)
static void vm_backtrace_alloc (void *arg)
static int vm_backtrace_push (void *arg, VALUE file, int line_no, VALUE name)
static VALUE vm_backtrace (rb_thread_t *th, int lev)
const char * rb_sourcefile (void)
int rb_sourceline (void)
NODErb_vm_cref (void)
VALUE rb_vm_cbase (void)
static VALUE make_localjump_error (const char *mesg, VALUE value, int reason)
void rb_vm_localjump_error (const char *mesg, VALUE value, int reason)
VALUE rb_vm_make_jump_tag_but_local_jump (int state, VALUE val)
void rb_vm_jump_tag_but_local_jump (int state, VALUE val)
 NORETURN (static void vm_iter_break(rb_thread_t *th))
static void vm_iter_break (rb_thread_t *th)
void rb_iter_break (void)
static void rb_vm_check_redefinition_opt_method (const rb_method_entry_t *me)
static void add_opt_method (VALUE klass, ID mid, VALUE bop)
static void vm_init_redefined_flag (void)
static VALUE vm_exec (rb_thread_t *th)
VALUE rb_iseq_eval (VALUE iseqval)
VALUE rb_iseq_eval_main (VALUE iseqval)
int rb_thread_method_id_and_class (rb_thread_t *th, ID *idp, VALUE *klassp)
int rb_frame_method_id_and_class (ID *idp, VALUE *klassp)
VALUE rb_thread_current_status (const rb_thread_t *th)
VALUE rb_vm_call_cfunc (VALUE recv, VALUE(*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename, VALUE filepath)
static int vm_mark_each_thread_func (st_data_t key, st_data_t value, st_data_t dummy)
static void mark_event_hooks (rb_event_hook_t *hook)
void rb_vm_mark (void *ptr)
int ruby_vm_destruct (void *ptr)
static size_t vm_memsize (const void *ptr)
static void vm_init2 (rb_vm_t *vm)
static VALUEthread_recycle_stack (size_t size)
void rb_thread_recycle_stack_release (VALUE *stack)
void rb_gc_mark_machine_stack (rb_thread_t *th)
void rb_thread_mark (void *ptr)
static size_t thread_memsize (const void *ptr)
static VALUE thread_alloc (VALUE klass)
static void th_init2 (rb_thread_t *th, VALUE self)
static void th_init (rb_thread_t *th, VALUE self)
static VALUE ruby_thread_init (VALUE self)
VALUE rb_thread_alloc (VALUE klass)
static void vm_define_method (rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, rb_num_t is_singleton, NODE *cref)
static VALUE m_core_define_method (VALUE self, VALUE cbase, VALUE sym, VALUE iseqval)
static VALUE m_core_define_singleton_method (VALUE self, VALUE cbase, VALUE sym, VALUE iseqval)
static VALUE m_core_set_method_alias (VALUE self, VALUE cbase, VALUE sym1, VALUE sym2)
static VALUE m_core_set_variable_alias (VALUE self, VALUE sym1, VALUE sym2)
static VALUE m_core_undef_method (VALUE self, VALUE cbase, VALUE sym)
static VALUE m_core_set_postexe (VALUE self, VALUE iseqval)
static VALUE sdr (void)
static VALUE nsdr (void)
void Init_VM (void)
void rb_vm_set_progname (VALUE filename)
struct rb_objspacerb_objspace_alloc (void)
void ruby_thread_init_stack (rb_thread_t *th)
void Init_native_thread (void)
void Init_BareVM (void)
static VALUE main_to_s (VALUE obj)
VALUE rb_vm_top_self (void)
void Init_top_self (void)
VALUEruby_vm_verbose_ptr (rb_vm_t *vm)
VALUEruby_vm_debug_ptr (rb_vm_t *vm)
VALUErb_ruby_verbose_ptr (void)
VALUErb_ruby_debug_ptr (void)

Variables

VALUE rb_cRubyVM
VALUE rb_cThread
VALUE rb_cEnv
VALUE rb_mRubyVMFrozenCore
VALUE ruby_vm_global_state_version = 1
VALUE ruby_vm_const_missing_count = 0
char ruby_vm_redefined_flag [BOP_LAST_]
rb_thread_truby_current_thread = 0
rb_vm_truby_current_vm = 0
static const rb_data_type_t env_data_type
static st_tablevm_opt_method_table = 0
static const rb_data_type_t vm_data_type
static VALUEthread_recycle_stack_slot [RECYCLE_MAX]
static int thread_recycle_stack_count = 0
static const rb_data_type_t thread_data_type
VALUErb_gc_stack_start
size_t rb_gc_stack_maxsize

Define Documentation

#define BUFSIZE   0x100

Definition at line 30 of file vm.c.

#define C (   k  )     add_opt_method(rb_c##k, mid, bop)
#define ENV_IN_HEAP_P (   th,
  env 
)    (!((th)->stack < (env) && (env) < ((th)->stack + (th)->stack_size)))

Definition at line 185 of file vm.c.

Referenced by vm_collect_local_variables_in_heap(), and vm_make_env_each().

#define ENV_VAL (   env  )     ((env)[1])

Definition at line 187 of file vm.c.

Referenced by vm_collect_local_variables_in_heap(), and vm_make_env_each().

#define OP (   mid_,
  bop_ 
)    (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0)

Referenced by vm_init_redefined_flag().

#define PROCDEBUG   0

Definition at line 31 of file vm.c.

Referenced by rb_vm_make_env_object(), and rb_vm_make_proc().

#define RECYCLE_MAX   64

Definition at line 1589 of file vm.c.

Referenced by rb_thread_recycle_stack_release().

#define REWIND_CFP (   expr  ) 
Value:
do { \
    rb_thread_t *th__ = GET_THREAD(); \
    th__->cfp++; expr; th__->cfp--; \
} while (0)

Definition at line 1879 of file vm.c.

Referenced by m_core_define_method(), m_core_define_singleton_method(), m_core_set_method_alias(), m_core_set_postexe(), m_core_set_variable_alias(), and m_core_undef_method().

#define USE_THREAD_DATA_RECYCLE   1

Definition at line 1586 of file vm.c.

#define vm_free   0

Definition at line 1525 of file vm.c.


Function Documentation

static void add_opt_method ( VALUE  klass,
ID  mid,
VALUE  bop 
) [static]

Definition at line 966 of file vm.c.

References rb_bug(), rb_id2name(), RCLASS_M_TBL, st_insert(), st_lookup(), and VM_METHOD_TYPE_CFUNC.

static const rb_block_t* check_block ( rb_thread_t th  )  [inline, static]
static int check_env ( rb_env_t *const   env  )  [static]

Definition at line 265 of file vm.c.

References rb_env_t::block, check_env_value(), rb_block_struct::dfp, dp, and rb_block_struct::lfp.

Referenced by check_env_value().

static VALUE check_env_value ( VALUE  envval  )  [static]

Definition at line 286 of file vm.c.

References check_env(), GetEnvPtr, and rb_bug().

Referenced by check_env(), rb_vm_make_env_object(), and rb_vm_make_proc().

static int collect_local_variables_in_env ( rb_env_t env,
const VALUE  ary 
) [static]
static int collect_local_variables_in_iseq ( rb_iseq_t iseq,
const VALUE  ary 
) [static]
static VALUE env_alloc ( void   )  [static]
static void env_free ( void *const   ptr  )  [static]

Definition at line 220 of file vm.c.

References rb_env_t::env, env, RUBY_FREE_ENTER, RUBY_FREE_LEAVE, RUBY_FREE_UNLESS_NULL, and ruby_xfree().

static void env_mark ( void *const   ptr  )  [static]
static size_t env_memsize ( const void *  ptr  )  [static]

Definition at line 232 of file vm.c.

References rb_env_t::env, env, rb_env_t::env_size, and size.

void Init_BareVM ( void   ) 
void Init_native_thread ( void   ) 

Referenced by Init_BareVM().

void Init_top_self ( void   ) 
void Init_VM ( void   ) 
static VALUE invoke_block_from_c ( rb_thread_t th,
const rb_block_t block,
VALUE  self,
int  argc,
const VALUE argv,
const rb_block_t blockptr,
const NODE cref 
) [inline, static]
static VALUE m_core_define_method ( VALUE  self,
VALUE  cbase,
VALUE  sym,
VALUE  iseqval 
) [static]

Definition at line 1885 of file vm.c.

References GET_THREAD, rb_vm_cref(), REWIND_CFP, SYM2ID, and vm_define_method().

Referenced by Init_VM().

static VALUE m_core_define_singleton_method ( VALUE  self,
VALUE  cbase,
VALUE  sym,
VALUE  iseqval 
) [static]

Definition at line 1894 of file vm.c.

References GET_THREAD, rb_vm_cref(), REWIND_CFP, SYM2ID, and vm_define_method().

Referenced by Init_VM().

static VALUE m_core_set_method_alias ( VALUE  self,
VALUE  cbase,
VALUE  sym1,
VALUE  sym2 
) [static]

Definition at line 1903 of file vm.c.

References rb_alias(), REWIND_CFP, and SYM2ID.

Referenced by Init_VM().

static VALUE m_core_set_postexe ( VALUE  self,
VALUE  iseqval 
) [static]
static VALUE m_core_set_variable_alias ( VALUE  self,
VALUE  sym1,
VALUE  sym2 
) [static]

Definition at line 1912 of file vm.c.

References rb_alias_variable(), REWIND_CFP, and SYM2ID.

Referenced by Init_VM().

static VALUE m_core_undef_method ( VALUE  self,
VALUE  cbase,
VALUE  sym 
) [static]

Definition at line 1921 of file vm.c.

References INC_VM_STATE_VERSION, rb_undef(), REWIND_CFP, and SYM2ID.

Referenced by Init_VM().

static VALUE main_to_s ( VALUE  obj  )  [static]

Definition at line 2155 of file vm.c.

References rb_str_new2().

Referenced by Init_top_self().

static VALUE make_localjump_error ( const char *  mesg,
VALUE  value,
int  reason 
) [static]
static void mark_event_hooks ( rb_event_hook_t hook  )  [static]

Definition at line 1482 of file vm.c.

References rb_event_hook_struct::data, rb_event_hook_struct::next, and rb_gc_mark().

Referenced by rb_thread_mark(), and rb_vm_mark().

NORETURN ( static void   vm_iter_breakrb_thread_t *th  ) 
static VALUE nsdr ( void   )  [static]

Definition at line 1971 of file vm.c.

References free, rb_ary_new(), rb_ary_push(), rb_memerror(), and rb_str_new2().

Referenced by Init_VM().

VALUE rb_backref_get ( void   ) 
void rb_backref_set ( VALUE  val  ) 
int rb_frame_method_id_and_class ( ID idp,
VALUE klassp 
)

Definition at line 1424 of file vm.c.

References GET_THREAD, and rb_thread_method_id_and_class().

void rb_gc_mark_machine_stack ( rb_thread_t th  ) 

Definition at line 2229 of file gc.c.

References GET_STACK_BOUNDS, and rb_gc_mark_locations.

Referenced by rb_thread_mark().

VALUE rb_insns_name_array ( void   ) 

Definition at line 5123 of file compile.c.

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

Referenced by Init_VM().

VALUE rb_iseq_eval ( VALUE  iseqval  ) 

Definition at line 1366 of file vm.c.

References GET_THREAD, vm_exec(), and vm_set_top_stack().

Referenced by iseq_eval(), prelude_eval(), and rb_load_internal().

VALUE rb_iseq_eval_main ( VALUE  iseqval  ) 

Definition at line 1380 of file vm.c.

References GET_THREAD, vm_exec(), and vm_set_main_stack().

Referenced by ruby_exec_internal().

void rb_iter_break ( void   ) 
VALUE rb_lastline_get ( void   ) 

Definition at line 673 of file vm.c.

References vm_svar_get().

Referenced by Init_IO(), rb_io_print(), rb_reg_match2(), and uscore_get().

void rb_lastline_set ( VALUE  val  ) 

Definition at line 679 of file vm.c.

References vm_svar_set().

Referenced by argf_gets(), Init_IO(), rb_f_chomp(), rb_f_chop(), rb_f_gsub(), rb_f_sub(), rb_gets(), rb_io_gets_m(), and strio_gets().

struct rb_objspace* rb_objspace_alloc ( void   )  [read]

Definition at line 374 of file gc.c.

References malloc, malloc_limit, ruby_gc_stress, and ruby_initial_gc_stress.

Referenced by Init_BareVM().

VALUE* rb_ruby_debug_ptr ( void   ) 

Definition at line 2197 of file vm.c.

References GET_VM, and ruby_vm_debug_ptr().

VALUE* rb_ruby_verbose_ptr ( void   ) 

Definition at line 2191 of file vm.c.

References GET_VM, and ruby_vm_verbose_ptr().

const char* rb_sourcefile ( void   ) 
int rb_sourceline ( void   ) 
VALUE rb_thread_alloc ( VALUE  klass  ) 

Definition at line 1832 of file vm.c.

References ruby_thread_init(), and thread_alloc().

Referenced by rb_thread_create(), thread_s_new(), and thread_start().

VALUE rb_thread_current_status ( const rb_thread_t th  ) 
void rb_thread_mark ( void *  ptr  ) 
int rb_thread_method_id_and_class ( rb_thread_t th,
ID idp,
VALUE klassp 
)
void rb_thread_recycle_stack_release ( VALUE stack  ) 

Definition at line 1609 of file vm.c.

References RECYCLE_MAX, and ruby_xfree().

Referenced by thread_start_func_2().

VALUE rb_vm_call_cfunc ( VALUE  recv,
VALUE(*)(VALUE func,
VALUE  arg,
const rb_block_t blockptr,
VALUE  filename,
VALUE  filepath 
)
VALUE rb_vm_cbase ( void   ) 
void rb_vm_change_state ( void   ) 
static void rb_vm_check_redefinition_opt_method ( const rb_method_entry_t me  )  [static]
NODE* rb_vm_cref ( void   ) 
rb_control_frame_t* rb_vm_get_ruby_level_next_cfp ( rb_thread_t th,
rb_control_frame_t cfp 
)
int rb_vm_get_sourceline ( const rb_control_frame_t cfp  ) 
void rb_vm_inc_const_missing_count ( void   ) 

Definition at line 61 of file vm.c.

References ruby_vm_const_missing_count.

Referenced by rb_const_get_0().

VALUE rb_vm_invoke_proc ( rb_thread_t th,
rb_proc_t proc,
VALUE  self,
int  argc,
const VALUE argv,
const rb_block_t blockptr 
)
void rb_vm_jump_tag_but_local_jump ( int  state,
VALUE  val 
)

Definition at line 922 of file vm.c.

References JUMP_TAG, Qnil, rb_exc_raise(), and rb_vm_make_jump_tag_but_local_jump().

Referenced by rb_eval_cmd(), and rb_load_internal().

void rb_vm_localjump_error ( const char *  mesg,
VALUE  value,
int  reason 
)

Definition at line 883 of file vm.c.

References make_localjump_error(), and rb_exc_raise().

Referenced by check_block(), rb_need_block(), vm_invoke_block(), and vm_throw().

VALUE rb_vm_make_env_object ( rb_thread_t th,
rb_control_frame_t cfp 
)
VALUE rb_vm_make_jump_tag_but_local_jump ( int  state,
VALUE  val 
)
VALUE rb_vm_make_proc ( rb_thread_t th,
const rb_block_t block,
VALUE  klass 
)
void rb_vm_mark ( void *  ptr  ) 
static VALUE rb_vm_set_finish_env ( rb_thread_t th  )  [inline, static]
void rb_vm_set_progname ( VALUE  filename  ) 
void rb_vm_stack_to_heap ( rb_thread_t *const   th  ) 
VALUE rb_vm_top_self ( void   ) 
static VALUE ruby_thread_init ( VALUE  self  )  [static]
void ruby_thread_init_stack ( rb_thread_t th  ) 

Definition at line 415 of file thread.c.

Referenced by Init_BareVM().

VALUE* ruby_vm_debug_ptr ( rb_vm_t vm  ) 

Definition at line 2185 of file vm.c.

References rb_vm_struct::debug.

Referenced by rb_ruby_debug_ptr().

int ruby_vm_destruct ( void *  ptr  ) 
VALUE* ruby_vm_verbose_ptr ( rb_vm_t vm  ) 

Definition at line 2179 of file vm.c.

References rb_vm_struct::verbose.

Referenced by rb_ruby_verbose_ptr().

static VALUE sdr ( void   )  [static]

Definition at line 1963 of file vm.c.

References rb_vm_bugreport().

Referenced by Init_VM().

static void th_init ( rb_thread_t th,
VALUE  self 
) [static]

Definition at line 1811 of file vm.c.

References th_init2().

Referenced by ruby_thread_init().

static void th_init2 ( rb_thread_t th,
VALUE  self 
) [static]
static VALUE thread_alloc ( VALUE  klass  )  [static]

Definition at line 1774 of file vm.c.

References TypedData_Make_Struct, and TypedData_Wrap_Struct.

Referenced by rb_thread_alloc().

static void thread_free ( void *  ptr  )  [static]
static size_t thread_memsize ( const void *  ptr  )  [static]
static VALUE* thread_recycle_stack ( size_t  size  )  [static]

Definition at line 1594 of file vm.c.

References ALLOC_N.

Referenced by th_init2().

void vm_analysis_insn ( int  insn  ) 
void vm_analysis_operand ( int  insn,
int  n,
VALUE  op 
)
void vm_analysis_register ( int  reg,
int  isset 
)
static VALUE vm_backtrace ( rb_thread_t th,
int  lev 
) [inline, static]
static void vm_backtrace_alloc ( void *  arg  )  [static]

Definition at line 754 of file vm.c.

References rb_ary_new().

Referenced by vm_backtrace().

static int vm_backtrace_each ( rb_thread_t th,
int  lev,
void(*)(void *)  init,
rb_backtrace_iter_func iter,
void *  arg 
) [static]
static int vm_backtrace_push ( void *  arg,
VALUE  file,
int  line_no,
VALUE  name 
) [static]

Definition at line 761 of file vm.c.

References rb_ary_push(), rb_enc_compatible(), rb_enc_sprintf(), and RSTRING_PTR.

Referenced by vm_backtrace().

static VALUE vm_cfp_svar_get ( rb_thread_t th,
rb_control_frame_t cfp,
VALUE  key 
) [static]

Definition at line 633 of file vm.c.

References rb_control_frame_t::lfp, lfp_svar_get(), and vm_normal_frame().

Referenced by vm_svar_get().

static void vm_cfp_svar_set ( rb_thread_t th,
rb_control_frame_t cfp,
VALUE  key,
const VALUE  val 
) [static]

Definition at line 640 of file vm.c.

References rb_control_frame_t::lfp, lfp_svar_set(), and vm_normal_frame().

Referenced by vm_svar_set().

static int vm_collect_local_variables_in_heap ( rb_thread_t th,
VALUE dfp,
VALUE  ary 
) [static]

Definition at line 409 of file vm.c.

References collect_local_variables_in_env(), ENV_IN_HEAP_P, ENV_VAL, and GetEnvPtr.

static void vm_define_method ( rb_thread_t th,
VALUE  obj,
ID  id,
VALUE  iseqval,
rb_num_t  is_singleton,
NODE cref 
) [static]
static VALUE vm_exec ( rb_thread_t th  )  [static]
static rb_control_frame_t* vm_get_ruby_level_caller_cfp ( rb_thread_t th,
rb_control_frame_t cfp 
) [static]
static void vm_init2 ( rb_vm_t vm  )  [static]

Definition at line 1578 of file vm.c.

References MEMZERO, and rb_vm_struct::src_encoding_index.

Referenced by Init_BareVM().

static void vm_init_redefined_flag ( void   )  [static]

Definition at line 979 of file vm.c.

References AREF, C, DIV, MOD, OP, and st_init_numtable().

Referenced by Init_VM().

static void vm_iter_break ( rb_thread_t th  )  [static]
static VALUE vm_make_env_each ( rb_thread_t *const   th,
rb_control_frame_t *const   cfp,
VALUE envptr,
VALUE *const   endptr 
) [static]
static VALUE vm_make_proc_from_block ( rb_thread_t th,
rb_block_t block 
) [static]

Definition at line 454 of file vm.c.

References rb_block_struct::proc, rb_cProc, and rb_vm_make_proc().

Referenced by rb_vm_make_proc().

static int vm_mark_each_thread_func ( st_data_t  key,
st_data_t  value,
st_data_t  dummy 
) [static]

Definition at line 1474 of file vm.c.

References rb_gc_mark().

Referenced by rb_vm_mark().

static size_t vm_memsize ( const void *  ptr  )  [static]

Definition at line 1561 of file vm.c.

References rb_vm_struct::living_threads, and st_memsize().

static rb_control_frame_t* vm_normal_frame ( rb_thread_t th,
rb_control_frame_t cfp 
) [static]
static void vm_set_eval_stack ( rb_thread_t th,
VALUE  iseqval,
const NODE cref 
) [static]
static void vm_set_main_stack ( rb_thread_t th,
VALUE  iseqval 
) [static]
static void vm_set_top_stack ( rb_thread_t th,
VALUE  iseqval 
) [static]
static VALUE vm_svar_get ( VALUE  key  )  [static]

Definition at line 647 of file vm.c.

References rb_thread_struct::cfp, GET_THREAD, and vm_cfp_svar_get().

Referenced by rb_backref_get(), and rb_lastline_get().

static void vm_svar_set ( VALUE  key,
VALUE  val 
) [static]

Definition at line 654 of file vm.c.

References rb_thread_struct::cfp, GET_THREAD, and vm_cfp_svar_set().

Referenced by rb_backref_set(), and rb_lastline_set().

static VALUE vm_yield ( rb_thread_t th,
int  argc,
const VALUE argv 
) [inline, static]

Definition at line 585 of file vm.c.

References check_block(), invoke_block_from_c(), and rb_block_struct::self.

static VALUE vm_yield_with_cref ( rb_thread_t th,
int  argc,
const VALUE argv,
const NODE cref 
) [inline, static]

Definition at line 578 of file vm.c.

References check_block(), invoke_block_from_c(), and rb_block_struct::self.


Variable Documentation

const rb_data_type_t env_data_type [static]
Initial value:
 {
    "VM/env",
    env_mark, env_free, env_memsize,
}

Definition at line 245 of file vm.c.

Definition at line 35 of file vm.c.

Referenced by env_alloc(), and Init_VM().

Definition at line 33 of file vm.c.

Referenced by Init_ISeq(), and Init_VM().

Definition at line 34 of file vm.c.

Definition at line 36 of file vm.c.

Referenced by Init_VM(), and rb_threadptr_exec_event_hooks().

Definition at line 43 of file vm.c.

Definition at line 44 of file vm.c.

Definition at line 39 of file vm.c.

Referenced by rb_vm_inc_const_missing_count().

Definition at line 38 of file vm.c.

char ruby_vm_redefined_flag[BOP_LAST_]

Definition at line 41 of file vm.c.

Referenced by rb_vm_check_redefinition_opt_method().

Initial value:
 {
    "VM/thread",
    rb_thread_mark,
    thread_free,
    thread_memsize,
}

Definition at line 1766 of file vm.c.

int thread_recycle_stack_count = 0 [static]

Definition at line 1591 of file vm.c.

VALUE* thread_recycle_stack_slot[RECYCLE_MAX] [static]

Definition at line 1590 of file vm.c.

const rb_data_type_t vm_data_type [static]
Initial value:
 {
    "VM",
    rb_vm_mark, vm_free, vm_memsize,
}

Definition at line 1572 of file vm.c.

Definition at line 952 of file vm.c.