eval.c File Reference

#include "eval_intern.h"
#include "iseq.h"
#include "gc.h"
#include "ruby/vm.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "vm_core.h"
#include "probes_helper.h"
#include "eval_error.c"
#include "eval_jump.c"

Go to the source code of this file.

Defines

#define exception_error   GET_VM()->special_exceptions[ruby_error_reenter]
#define CLASS_OR_MODULE_P(obj)

Functions

 NORETURN (void rb_raise_jump(VALUE))
NODErb_vm_get_cref (const rb_iseq_t *, const VALUE *)
int ruby_setup (void)
void ruby_init (void)
void * ruby_options (int argc, char **argv)
 Processes command line arguments and compiles the Ruby source to execute.
static void ruby_finalize_0 (void)
static void ruby_finalize_1 (void)
void ruby_finalize (void)
 Runs the VM finalization processes.
int ruby_cleanup (volatile int ex)
 Destructs the VM.
static int ruby_exec_internal (void *n)
void ruby_stop (int ex)
 Calls ruby_cleanup() and exits the process.
int ruby_executable_node (void *n, int *status)
 Checks the return value of ruby_options().
int ruby_run_node (void *n)
 Runs the given compiled source and exits this process.
int ruby_exec_node (void *n)
 Runs the given compiled source.
static VALUE rb_mod_nesting (void)
static VALUE rb_mod_s_constants (int argc, VALUE *argv, VALUE mod)
void rb_frozen_class_p (VALUE klass)
 NORETURN (static void rb_longjmp(int, volatile VALUE))
static VALUE get_errinfo (void)
static VALUE get_thread_errinfo (rb_thread_t *th)
static VALUE exc_setup_cause (VALUE exc, VALUE cause)
static void setup_exception (rb_thread_t *th, int tag, volatile VALUE mesg)
static void rb_longjmp (int tag, volatile VALUE mesg)
static VALUE make_exception (int argc, VALUE *argv, int isstr)
void rb_exc_raise (VALUE mesg)
void rb_exc_fatal (VALUE mesg)
void rb_interrupt (void)
static VALUE rb_f_raise (int argc, VALUE *argv)
VALUE rb_make_exception (int argc, VALUE *argv)
void rb_raise_jump (VALUE mesg)
void rb_jump_tag (int tag)
int rb_block_given_p (void)
int rb_iterator_p (void)
void rb_need_block (void)
VALUE rb_rescue2 (VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*r_proc)(ANYARGS), VALUE data2,...)
VALUE rb_rescue (VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*r_proc)(ANYARGS), VALUE data2)
VALUE rb_protect (VALUE(*proc)(VALUE), VALUE data, int *state)
VALUE rb_ensure (VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
static const rb_method_entry_tmethod_entry_of_iseq (rb_control_frame_t *cfp, rb_iseq_t *iseq)
static ID frame_func_id (rb_control_frame_t *cfp)
static ID frame_called_id (rb_control_frame_t *cfp)
ID rb_frame_this_func (void)
ID rb_frame_callee (void)
static rb_control_frame_tprevious_frame (rb_thread_t *th)
static ID prev_frame_callee (void)
static ID prev_frame_func (void)
static VALUE rb_mod_append_features (VALUE module, VALUE include)
static VALUE rb_mod_include (int argc, VALUE *argv, VALUE module)
static VALUE rb_mod_prepend_features (VALUE module, VALUE prepend)
static VALUE rb_mod_prepend (int argc, VALUE *argv, VALUE module)
static VALUE hidden_identity_hash_new ()
void rb_using_refinement (NODE *cref, VALUE klass, VALUE module)
static int using_refinement (VALUE klass, VALUE module, VALUE arg)
static void using_module_recursive (NODE *cref, VALUE klass)
void rb_using_module (NODE *cref, VALUE module)
VALUE rb_refinement_module_get_refined_class (VALUE module)
static void add_activated_refinement (VALUE activated_refinements, VALUE klass, VALUE refinement)
VALUE rb_yield_refine_block (VALUE refinement, VALUE refinements)
static VALUE rb_mod_refine (VALUE module, VALUE klass)
static VALUE mod_using (VALUE self, VALUE module)
void rb_obj_call_init (VALUE obj, int argc, VALUE *argv)
void rb_extend_object (VALUE obj, VALUE module)
static VALUE rb_mod_extend_object (VALUE mod, VALUE obj)
static VALUE rb_obj_extend (int argc, VALUE *argv, VALUE obj)
static VALUE top_include (int argc, VALUE *argv, VALUE self)
static VALUE top_using (VALUE self, VALUE module)
static VALUE * errinfo_place (rb_thread_t *th)
static VALUE errinfo_getter (ID id)
VALUE rb_errinfo (void)
void rb_set_errinfo (VALUE err)
VALUE rb_rubylevel_errinfo (void)
static VALUE errat_getter (ID id)
static void errat_setter (VALUE val, ID id, VALUE *var)
static VALUE rb_f_method_name (void)
static VALUE rb_f_callee_name (void)
static VALUE f_current_dirname (void)
void Init_eval (void)

Variables

VALUE rb_eLocalJumpError
VALUE rb_eSysStackError
VALUE rb_eThreadError


Define Documentation

#define CLASS_OR_MODULE_P ( obj   ) 

Value:

(!SPECIAL_CONST_P(obj) && \
     (BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE))

Definition at line 35 of file eval.c.

Referenced by rb_class_inherited_p(), rb_mod_append_features(), rb_mod_cmp(), rb_mod_ge(), rb_mod_prepend_features(), and rb_mod_to_s().

#define exception_error   GET_VM()->special_exceptions[ruby_error_reenter]

Definition at line 30 of file eval.c.

Referenced by Init_eval(), and setup_exception().


Function Documentation

static void add_activated_refinement ( VALUE  activated_refinements,
VALUE  klass,
VALUE  refinement 
) [static]

Definition at line 1186 of file eval.c.

References FL_SET, NIL_P, rb_hash_aset(), rb_hash_lookup, rb_include_class_new(), RB_TYPE_P, RBASIC, RCLASS_REFINED_CLASS, RCLASS_SET_SUPER(), RCLASS_SUPER, RMODULE_IS_OVERLAID, T_ICLASS, and VALUE.

Referenced by rb_mod_refine().

static VALUE errat_getter ( ID  id  )  [static]

Definition at line 1519 of file eval.c.

References err, get_backtrace(), get_errinfo(), NIL_P, Qnil, and VALUE.

Referenced by Init_eval().

static void errat_setter ( VALUE  val,
ID  id,
VALUE *  var 
) [static]

Definition at line 1531 of file eval.c.

References err, get_errinfo(), NIL_P, rb_eArgError, rb_raise(), set_backtrace(), and VALUE.

Referenced by Init_eval().

static VALUE errinfo_getter ( ID  id  )  [static]

Definition at line 1472 of file eval.c.

References get_errinfo().

Referenced by Init_eval().

static VALUE* errinfo_place ( rb_thread_t th  )  [static]

Definition at line 1432 of file eval.c.

References rb_thread_struct::cfp, rb_control_frame_struct::ep, FIXNUM_P, rb_control_frame_struct::iseq, RB_TYPE_P, RUBY_VM_END_CONTROL_FRAME, RUBY_VM_NORMAL_ISEQ_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, RUBY_VM_VALID_CONTROL_FRAME_P, T_NODE, and rb_iseq_struct::type.

Referenced by get_thread_errinfo().

static VALUE exc_setup_cause ( VALUE  exc,
VALUE  cause 
) [static]

Definition at line 439 of file eval.c.

References CONST_ID, INT2FIX, NIL_P, OBJ_FREEZE, rb_attr_get(), rb_eFatal, rb_exc_new_cstr(), and rb_ivar_set().

Referenced by setup_exception().

static VALUE f_current_dirname ( void   )  [static]

Definition at line 1596 of file eval.c.

References NIL_P, Qnil, rb_current_realfilepath(), rb_file_dirname(), and VALUE.

Referenced by Init_eval().

static ID frame_called_id ( rb_control_frame_t cfp  )  [static]

Definition at line 913 of file eval.c.

References rb_method_entry_struct::called_id, idIFUNC, rb_control_frame_struct::iseq, rb_control_frame_struct::me, method_entry_of_iseq(), and RUBY_VM_IFUNC_P.

Referenced by prev_frame_callee(), and rb_frame_callee().

static ID frame_func_id ( rb_control_frame_t cfp  )  [static]

Definition at line 883 of file eval.c.

References rb_method_entry_struct::def, idIFUNC, rb_control_frame_struct::iseq, rb_control_frame_struct::me, method_entry_of_iseq(), rb_method_definition_struct::original_id, and RUBY_VM_IFUNC_P.

Referenced by prev_frame_func(), and rb_frame_this_func().

static VALUE get_errinfo ( void   )  [static]

Definition at line 1466 of file eval.c.

References GET_THREAD(), and get_thread_errinfo().

Referenced by errat_getter(), errat_setter(), errinfo_getter(), rb_f_raise(), and rb_rubylevel_errinfo().

static VALUE get_thread_errinfo ( rb_thread_t th  )  [static]

Definition at line 1454 of file eval.c.

References rb_thread_struct::errinfo, errinfo_place(), and VALUE.

Referenced by get_errinfo(), and setup_exception().

static VALUE hidden_identity_hash_new (  )  [static]

Definition at line 1077 of file eval.c.

References hash(), rb_funcall(), rb_hash_new(), rb_intern, RBASIC_CLEAR_CLASS, and VALUE.

Referenced by rb_mod_refine(), and rb_using_refinement().

void Init_eval ( void   ) 

Definition at line 1607 of file eval.c.

References errat_getter(), errat_setter(), errinfo_getter(), exception_error, f_current_dirname(), Init_eval_method(), Init_vm_eval(), mod_using(), OBJ_FREEZE, OBJ_TAINT, rb_cClass, rb_cModule, rb_define_global_function(), rb_define_method(), rb_define_private_method(), rb_define_singleton_method(), rb_define_virtual_variable(), rb_eFatal, rb_exc_new3, rb_f_callee_name(), rb_f_global_variables(), rb_f_method_name(), rb_f_raise(), rb_f_trace_var(), rb_f_untrace_var(), rb_mKernel, rb_mod_append_features(), rb_mod_extend_object(), rb_mod_include(), rb_mod_nesting(), rb_mod_prepend(), rb_mod_prepend_features(), rb_mod_refine(), rb_mod_s_constants(), rb_obj_extend(), rb_obj_freeze(), rb_singleton_class(), rb_str_new2, rb_undef_method(), rb_vm_top_self(), top_include(), and top_using().

static VALUE make_exception ( int  argc,
VALUE *  argv,
int  isstr 
) [static]

Definition at line 631 of file eval.c.

References CONST_ID, NIL_P, Qnil, Qundef, rb_check_arity, rb_check_funcall(), rb_check_string_type(), rb_eException, rb_eRuntimeError, rb_eTypeError, rb_exc_new3, rb_obj_is_kind_of(), rb_raise(), set_backtrace(), sysstack_error, and VALUE.

Referenced by parse(), rb_exc_fatal(), rb_exc_raise(), and rb_make_exception().

static const rb_method_entry_t* method_entry_of_iseq ( rb_control_frame_t cfp,
rb_iseq_t iseq 
) [static]

Definition at line 868 of file eval.c.

References GET_THREAD(), rb_control_frame_struct::iseq, rb_control_frame_struct::me, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_thread_struct::stack, and rb_thread_struct::stack_size.

Referenced by frame_called_id(), and frame_func_id().

static VALUE mod_using ( VALUE  self,
VALUE  module 
) [static]

Definition at line 1281 of file eval.c.

References GET_THREAD(), prev_frame_func(), previous_frame(), rb_eRuntimeError, rb_raise(), rb_using_module(), rb_vm_cref(), and rb_control_frame_struct::self.

Referenced by Init_eval().

NORETURN ( static void   rb_longjmp(int, volatile VALUE)  ) 

NORETURN ( void   rb_raise_jump(VALUE)  ) 

static ID prev_frame_callee ( void   )  [static]

Definition at line 966 of file eval.c.

References frame_called_id(), GET_THREAD(), and previous_frame().

Referenced by rb_f_callee_name().

static ID prev_frame_func ( void   )  [static]

Definition at line 974 of file eval.c.

References frame_func_id(), GET_THREAD(), and previous_frame().

Referenced by mod_using(), and rb_f_method_name().

static rb_control_frame_t* previous_frame ( rb_thread_t th  )  [static]

Definition at line 955 of file eval.c.

References rb_thread_struct::cfp, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_thread_struct::stack, and rb_thread_struct::stack_size.

Referenced by mod_using(), prev_frame_callee(), prev_frame_func(), and top_using().

int rb_block_given_p ( void   ) 

Definition at line 712 of file eval.c.

References rb_thread_struct::cfp, FALSE, GET_THREAD(), rb_vm_control_frame_block_ptr(), and TRUE.

Referenced by argf_bytes(), argf_chars(), argf_codepoints(), argf_lines(), dh_generate(), dir_s_chdir(), dir_s_glob(), dir_s_open(), dsa_generate(), enum_chunk(), enum_count(), enum_find_index(), enum_grep(), enum_inject(), enum_max(), enum_min(), enum_minmax(), enum_slice_before(), enum_zip(), enumerator_each(), enumerator_initialize(), env_delete_m(), env_fetch(), env_update_i(), etc_group(), etc_passwd(), fdbm_delete(), fdbm_fetch(), fdbm_fetch_m(), fdbm_s_open(), fgdbm_fetch(), fgdbm_fetch_m(), fgdbm_s_open(), fsdbm_delete(), fsdbm_fetch(), fsdbm_fetch_m(), fsdbm_s_open(), generator_initialize(), gzfile_wrap(), lazy_drop_while(), lazy_flat_map(), lazy_grep(), lazy_initialize(), lazy_map(), lazy_reject(), lazy_select(), lazy_take_while(), lazy_to_enum(), lazy_zip(), mSyslog_open(), obj_to_enum(), ossl_pem_passwd_cb(), ossl_x509store_verify(), p_gid_switch(), p_uid_switch(), pack_unpack(), path_each_line(), path_open(), path_s_glob(), path_sub(), proc_call(), pty_getpty(), pty_open(), range_max(), range_min(), rb_ary_count(), rb_ary_delete(), rb_ary_fetch(), rb_ary_fill(), rb_ary_index(), rb_ary_initialize(), rb_ary_product(), rb_ary_rindex(), rb_ary_sort_bang(), rb_ary_uniq(), rb_ary_uniq_bang(), rb_ary_zip(), rb_dlhandle_initialize(), rb_f_at_exit(), rb_f_open(), rb_fiddle_handle_initialize(), rb_gzreader_bytes(), rb_gzreader_lines(), rb_hash_delete(), rb_hash_fetch_m(), rb_hash_initialize(), rb_hash_update(), rb_io_bytes(), rb_io_chars(), rb_io_codepoints(), rb_io_lines(), rb_io_s_new(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_iterator_p(), rb_method_call(), rb_mod_initialize(), rb_mutex_synchronize_m(), rb_need_block(), rb_reg_match_m(), rb_scan_args(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_match_m(), rb_str_scan(), rb_str_scrub(), rb_str_sub_bang(), rb_struct_s_def(), rb_thread_s_handle_interrupt(), rsa_generate(), specific_eval(), strio_bytes(), strio_chars(), strio_codepoints(), strio_lines(), strio_s_open(), thread_initialize(), tk_s_new(), tracepoint_disable_m(), tracepoint_enable_m(), tracepoint_new_s(), zstream_detach_buffer(), zstream_expand_buffer(), and zstream_run().

VALUE rb_ensure ( VALUE(*)(ANYARGS)  b_proc,
VALUE  data1,
VALUE(*)(ANYARGS)  e_proc,
VALUE  data2 
)

Definition at line 839 of file eval.c.

References rb_ensure_entry::data2, rb_ensure_entry::e_proc, rb_thread_struct::ensure_list, rb_ensure_list::entry, rb_thread_struct::errinfo, EXEC_TAG, GET_THREAD(), JUMP_TAG, rb_ensure_entry::marker, rb_ensure_list::next, POP_TAG, PUSH_TAG, Qnil, result, and VALUE.

Referenced by _thread_call_proc(), check_autoload_required(), dir_entries(), dir_foreach(), dir_s_chdir(), dir_s_open(), fdbm_s_open(), fgdbm_s_open(), fole_each(), fsdbm_s_open(), gzfile_reader_end(), gzfile_wrap(), gzfile_writer_end(), io_s_write(), lib_eventloop_launcher(), lib_mainloop_watchdog(), load_file(), mSyslog_open(), p_gid_switch(), p_uid_switch(), pipe_pair_close(), pty_getpty(), pty_open(), queue_do_pop(), rb_autoload_load(), rb_condvar_wait(), rb_deflate_s_deflate(), rb_dlhandle_initialize(), rb_f_open(), rb_f_select(), rb_fiddle_handle_initialize(), rb_gvar_set(), rb_hash_assoc(), rb_hash_foreach(), rb_inflate_s_inflate(), rb_io_s_binread(), rb_io_s_copy_stream(), rb_io_s_foreach(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_io_s_read(), rb_io_s_readlines(), rb_io_sysread(), rb_mutex_sleep(), rb_mutex_synchronize(), rb_objspace_each_objects(), rb_str_locktmp_ensure(), rb_szqueue_push(), rb_uninterruptible(), rb_wait_for_single_fd(), rsock_init_inetsock(), rsock_make_hostent(), strio_s_open(), thread_join(), trace_object_allocations(), tracepoint_disable_m(), tracepoint_enable_m(), and udp_connect().

VALUE rb_errinfo ( void   ) 

Definition at line 1497 of file eval.c.

References rb_thread_struct::errinfo, and GET_THREAD().

void rb_exc_fatal ( VALUE  mesg  ) 

Definition at line 576 of file eval.c.

References FALSE, make_exception(), NIL_P, rb_longjmp(), and TAG_FATAL.

Referenced by rb_fatal().

void rb_exc_raise ( VALUE  mesg  ) 

Definition at line 567 of file eval.c.

References FALSE, make_exception(), NIL_P, rb_longjmp(), and TAG_RAISE.

Referenced by argument_error(), cannot_be_coerced_into_BigDecimal(), check_funcall_failed(), cleanup_iseq_build(), cont_capture(), econv_convert(), econv_finish(), econv_init(), econv_s_search_convpath(), eval_string_with_cref(), fiber_store(), fiber_switch(), float_value(), fptr_finalize(), get_next_values(), gzfile_raise(), ignore_closed_stream(), ip_eval(), ip_invoke_with_position(), lib_eventloop_core(), lib_thread_callback(), make_readconv(), make_writeconv(), more_char(), ole_raise(), ossl_raise(), parse(), parser_set_encode(), pending_exception_check0(), pending_exception_check1(), process_sflag(), raise_from_check(), raise_loaderror(), raise_method_missing(), raise_zlib_error(), rand_random(), rb_econv_check_error(), rb_enc_raise(), rb_enc_reg_raise(), rb_error_arity(), rb_exit(), rb_f_abort(), rb_io_initialize(), rb_iseq_compile_with_option(), rb_load_internal0(), rb_memerror(), rb_mod_sys_fail(), rb_mod_sys_fail_str(), rb_mod_syserr_fail(), rb_mod_syserr_fail_str(), rb_name_error(), rb_name_error_str(), rb_raise(), rb_readwrite_sys_fail(), rb_reg_raise_str(), rb_sys_fail(), rb_sys_fail_str(), rb_syserr_fail(), rb_syserr_fail_str(), rb_threadptr_execute_interrupts(), rb_vm_jump_tag_but_local_jump(), rb_vm_localjump_error(), read_all(), read_would_block(), ruby_thread_stack_overflow(), send_internal(), stack_check(), thread_join(), tk_funcall(), transcode_loop(), validate_labels(), vm_call_opt_send(), vm_stackoverflow(), and write_would_block().

void rb_extend_object ( VALUE  obj,
VALUE  module 
)

Definition at line 1305 of file eval.c.

References rb_include_module(), and rb_singleton_class().

Referenced by append_extmod(), Init_etc(), Init_Hash(), Init_readline(), mSyslogMacros_included(), r_object0(), rb_eval_string_wrap(), rb_load_internal0(), rb_mod_extend_object(), rb_mod_sys_fail(), rb_mod_sys_fail_str(), rb_mod_syserr_fail(), and rb_mod_syserr_fail_str().

static VALUE rb_f_callee_name ( void   )  [static]

Definition at line 1573 of file eval.c.

References ID2SYM, prev_frame_callee(), and Qnil.

Referenced by Init_eval().

static VALUE rb_f_method_name ( void   )  [static]

Definition at line 1551 of file eval.c.

References ID2SYM, prev_frame_func(), and Qnil.

Referenced by Init_eval().

static VALUE rb_f_raise ( int  argc,
VALUE *  argv 
) [static]

Definition at line 615 of file eval.c.

References err, get_errinfo(), NIL_P, rb_make_exception(), rb_raise_jump(), UNREACHABLE, and VALUE.

Referenced by Init_eval().

ID rb_frame_callee ( void   ) 

Definition at line 949 of file eval.c.

References frame_called_id(), and GET_THREAD().

Referenced by error_pos(), rb_insecure_operation(), rb_secure(), set_const_visibility(), and set_method_visibility().

ID rb_frame_this_func ( void   ) 

Definition at line 943 of file eval.c.

References frame_func_id(), and GET_THREAD().

Referenced by argf_forward(), lazy_set_method(), rb_iterate(), rb_notimplement(), rb_struct_ref(), rb_struct_set(), recursive_list_access(), and recursive_pop().

void rb_frozen_class_p ( VALUE  klass  ) 

Definition at line 406 of file eval.c.

References BUILTIN_TYPE, Check_Type, FL_SINGLETON, FL_TEST, OBJ_FROZEN, rb_error_frozen(), SPECIAL_CONST_P, T_CLASS, T_ICLASS, and T_MODULE.

Referenced by rb_alias(), rb_include_module(), rb_prepend_module(), and rb_undef().

void rb_interrupt ( void   ) 

Definition at line 585 of file eval.c.

References rb_eInterrupt, and rb_raise().

Referenced by rb_signal_exec().

int rb_iterator_p ( void   ) 

Definition at line 725 of file eval.c.

References rb_block_given_p().

void rb_jump_tag ( int  tag  ) 

Definition at line 706 of file eval.c.

References JUMP_TAG.

Referenced by BigDecimal_save_exception_mode(), BigDecimal_save_limit(), BigDecimal_save_rounding_mode(), decode_enum(), decode_int(), decode_time(), dh_generate(), dsa_generate(), establishShell(), fdbm_delete_if(), fgdbm_delete_if(), fsdbm_delete_if(), gzfile_wrap(), io_s_write(), ossl_buf2str(), ossl_membio2str(), ossl_pkcs12_initialize(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_sign(), ossl_pkcs7_verify(), ossl_start_ssl(), parse(), pending_exception_check0(), pending_exception_check1(), rb_autoload_load(), rb_io_s_pipe(), rb_io_s_read(), readline_readline(), rsa_generate(), ttymode(), zstream_expand_buffer(), and zstream_run().

static void rb_longjmp ( int  tag,
volatile VALUE  mesg 
) [static]

Definition at line 556 of file eval.c.

References GET_THREAD(), JUMP_TAG, rb_thread_raised_clear, and setup_exception().

Referenced by rb_exc_fatal(), and rb_exc_raise().

VALUE rb_make_exception ( int  argc,
VALUE *  argv 
)

Definition at line 682 of file eval.c.

References make_exception(), and TRUE.

Referenced by parser_set_encode(), rb_f_raise(), and rb_threadptr_raise().

static VALUE rb_mod_append_features ( VALUE  module,
VALUE  include 
) [static]

Definition at line 994 of file eval.c.

References Check_Type, CLASS_OR_MODULE_P, rb_include_module(), and T_CLASS.

Referenced by Init_eval().

static VALUE rb_mod_extend_object ( VALUE  mod,
VALUE  obj 
) [static]

Definition at line 1338 of file eval.c.

References rb_extend_object().

Referenced by Init_eval().

static VALUE rb_mod_include ( int  argc,
VALUE *  argv,
VALUE  module 
) [static]

Definition at line 1012 of file eval.c.

References Check_Type, CONST_ID, rb_funcall(), and T_MODULE.

Referenced by Init_eval(), and top_include().

static VALUE rb_mod_nesting ( void   )  [static]

Definition at line 337 of file eval.c.

References RNode::flags, NIL_P, NODE_FL_CREF_PUSHED_BY_EVAL, rb_ary_new(), rb_ary_push(), rb_vm_cref(), and VALUE.

Referenced by Init_eval().

static VALUE rb_mod_prepend ( int  argc,
VALUE *  argv,
VALUE  module 
) [static]

Definition at line 1060 of file eval.c.

References Check_Type, CONST_ID, rb_funcall(), and T_MODULE.

Referenced by Init_eval().

static VALUE rb_mod_prepend_features ( VALUE  module,
VALUE  prepend 
) [static]

Definition at line 1042 of file eval.c.

References Check_Type, CLASS_OR_MODULE_P, rb_prepend_module(), and T_CLASS.

Referenced by Init_eval().

static VALUE rb_mod_refine ( VALUE  module,
VALUE  klass 
) [static]

Definition at line 1226 of file eval.c.

References add_activated_refinement(), rb_thread_struct::cfp, Check_Type, CONST_ID, FL_SET, GET_THREAD(), hidden_identity_hash_new(), NIL_P, rb_block_struct::proc, rb_attr_get(), rb_eArgError, rb_hash_aset(), rb_hash_lookup, rb_ivar_set(), rb_module_new(), rb_raise(), rb_vm_control_frame_block_ptr(), rb_yield_refine_block(), RCLASS_SET_SUPER(), RMODULE_IS_REFINEMENT, T_CLASS, and VALUE.

Referenced by Init_eval().

static VALUE rb_mod_s_constants ( int  argc,
VALUE *  argv,
VALUE  mod 
) [static]

Definition at line 376 of file eval.c.

References bug_reporters::data, RNode::flags, NIL_P, NODE_FL_CREF_PUSHED_BY_EVAL, rb_cModule, rb_const_list(), rb_mod_const_at(), rb_mod_const_of(), rb_mod_constants(), rb_vm_cref(), and VALUE.

Referenced by Init_eval().

void rb_need_block ( void   ) 

Definition at line 733 of file eval.c.

References Qnil, rb_block_given_p(), and rb_vm_localjump_error().

Referenced by generator_initialize(), and yielder_initialize().

void rb_obj_call_init ( VALUE  obj,
int  argc,
VALUE *  argv 
)

Definition at line 1298 of file eval.c.

References PASS_PASSED_BLOCK, and rb_funcall2.

Referenced by rb_class_new_instance(), rb_digest_class_s_digest(), rb_proc_s_new(), and thread_s_new().

static VALUE rb_obj_extend ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 1370 of file eval.c.

References Check_Type, CONST_ID, rb_check_arity, rb_funcall(), T_MODULE, and UNLIMITED_ARGUMENTS.

Referenced by Init_eval().

VALUE rb_protect ( VALUE(*)(VALUE)  proc,
VALUE  data,
int *  state 
)

Definition at line 807 of file eval.c.

References rb_thread_struct::cfp, GET_THREAD(), MEMCPY, rb_vm_protect_tag::prev, rb_thread_struct::protect_tag, Qnil, rb_vm_rewind_cfp(), result, SAVE_ROOT_JMPBUF, TH_EXEC_TAG, TH_POP_TAG, and TH_PUSH_TAG.

Referenced by BigDecimal_save_exception_mode(), BigDecimal_save_limit(), BigDecimal_save_rounding_mode(), decode_enum(), decode_int(), decode_time(), EVENTSINK_Invoke(), exc_equal(), fdbm_delete_if(), fgdbm_delete_if(), fsdbm_delete_if(), goruby_run_node(), gzfile_wrap(), init_libraries(), io_s_write(), ip_eval_real(), ip_invoke_core(), ip_ruby_cmd_receiver_get(), lib_eventloop_core(), lib_eventloop_main(), lib_thread_callback(), load_encoding(), name_err_mesg_to_str(), ossl_buf2str(), ossl_client_cert_cb(), ossl_pem_passwd_cb(), ossl_pkcs12_initialize(), ossl_protect_membio2str(), ossl_protect_obj2bio(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_tmp_dh_callback(), ossl_verify_cb(), parse(), pruby_obj_to_var(), rb_autoload_load(), rb_eval_string_protect(), rb_glob_caller(), rb_hash_fetch_m(), rb_io_s_pipe(), rb_io_s_read(), readline_readline(), ruby_eval_string_from_file_protect(), run_finalizer(), tcl_protect_core(), ttymode(), zstream_expand_buffer(), and zstream_expand_buffer_protect().

void rb_raise_jump ( VALUE  mesg  ) 

Definition at line 688 of file eval.c.

References rb_method_entry_struct::called_id, rb_thread_struct::cfp, EXEC_EVENT_HOOK, GET_THREAD(), JUMP_TAG, rb_method_entry_struct::klass, rb_control_frame_struct::me, Qnil, rb_thread_raised_clear, RUBY_EVENT_C_RETURN, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_control_frame_struct::self, setup_exception(), TAG_RAISE, and VALUE.

Referenced by rb_f_raise().

VALUE rb_refinement_module_get_refined_class ( VALUE  module  ) 

Definition at line 1177 of file eval.c.

References CONST_ID, and rb_attr_get().

Referenced by include_modules_at(), rb_method_entry_make(), and rb_mod_to_s().

VALUE rb_rescue ( VALUE(*)(ANYARGS)  b_proc,
VALUE  data1,
VALUE(*)(ANYARGS)  r_proc,
VALUE  data2 
)

Definition at line 799 of file eval.c.

References rb_eStandardError, rb_rescue2(), and VALUE.

Referenced by cmp_equal(), do_coerce(), range_init(), and time_mload().

VALUE rb_rescue2 ( VALUE(*)(ANYARGS)  b_proc,
VALUE  data1,
VALUE(*)(ANYARGS)  r_proc,
VALUE  data2,
  ... 
)

Definition at line 741 of file eval.c.

References args, rb_thread_struct::cfp, rb_thread_struct::errinfo, FALSE, GET_THREAD(), JUMP_TAG, Qfalse, Qnil, rb_obj_is_kind_of(), rb_vm_rewind_cfp(), result, TAG_RAISE, TAG_RETRY, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, TRUE, va_init_list, and VALUE.

Referenced by argf_getpartial(), check_funcall_missing(), copy_stream_fallback(), gzfile_read_raw(), io_close(), lazy_zip_func(), path_unlink(), rb_f_loop(), rb_rescue(), tcl2rb_num_or_str(), tkstr_rescue_float(), tkstr_to_number(), and zip_i().

VALUE rb_rubylevel_errinfo ( void   ) 

Definition at line 1513 of file eval.c.

References get_errinfo().

void rb_set_errinfo ( VALUE  err  ) 

Definition at line 1504 of file eval.c.

References rb_thread_struct::errinfo, GET_THREAD(), NIL_P, rb_eException, rb_eTypeError, rb_obj_is_kind_of(), and rb_raise().

Referenced by exc_equal(), load_encoding(), name_err_mesg_to_str(), ossl_pem_passwd_cb(), ossl_verify_cb(), pruby_eval(), rb_reg_compile(), reg_compile_gen(), and run_finalizer().

void rb_using_module ( NODE cref,
VALUE  module 
)

Definition at line 1169 of file eval.c.

References Check_Type, rb_clear_method_cache_by_class(), rb_cObject, T_MODULE, and using_module_recursive().

Referenced by mod_using(), and top_using().

void rb_using_refinement ( NODE cref,
VALUE  klass,
VALUE  module 
)

Definition at line 1087 of file eval.c.

References Check_Type, FL_SET, RNode::flags, hidden_identity_hash_new(), NIL_P, NODE_FL_CREF_OMOD_SHARED, OBJ_WB_UNPROTECT, rb_hash_aset(), rb_hash_dup(), rb_hash_lookup, rb_include_class_new(), RB_OBJ_WRITE, RB_TYPE_P, RBASIC, RCLASS_M_TBL_WRAPPER, RCLASS_REFINED_CLASS, RCLASS_SET_SUPER(), RCLASS_SUPER, RMODULE_IS_OVERLAID, T_CLASS, T_ICLASS, T_MODULE, and VALUE.

Referenced by using_refinement().

NODE* rb_vm_get_cref ( const rb_iseq_t ,
const VALUE *   
)

Definition at line 271 of file vm_insnhelper.c.

References rb_bug(), and vm_get_cref0().

Referenced by eval_string_with_cref(), rb_vm_cref(), rb_vm_cref_in_context(), vm_call_method(), vm_get_cbase(), vm_get_const_base(), and vm_get_ev_const().

VALUE rb_yield_refine_block ( VALUE  refinement,
VALUE  refinements 
)

Definition at line 1527 of file vm_eval.c.

References rb_thread_struct::cfp, RNode::flags, GET_THREAD(), NODE_FL_CREF_PUSHED_BY_EVAL, NOEX_PUBLIC, NULL, RB_OBJ_WRITE, rb_block_struct::self, VM_CF_BLOCK_PTR(), VM_CF_LEP(), vm_cref_push(), VM_ENVVAL_BLOCK_PTR, and vm_yield_with_cref().

Referenced by rb_mod_refine().

static int ruby_exec_internal ( void *  n  )  [static]

Definition at line 243 of file eval.c.

References rb_thread_struct::base_block, EXEC_TAG, GET_THREAD(), POP_TAG, PUSH_TAG, rb_iseq_eval_main(), SAVE_ROOT_JMPBUF, and VALUE.

Referenced by ruby_exec_node().

static void ruby_finalize_0 ( void   )  [static]

Definition at line 113 of file eval.c.

References EXEC_TAG, POP_TAG, PUSH_TAG, rb_clear_trace_func(), rb_exec_end_proc(), and rb_trap_exit().

Referenced by ruby_cleanup(), and ruby_finalize().

static void ruby_finalize_1 ( void   )  [static]

Definition at line 125 of file eval.c.

References rb_thread_struct::errinfo, GET_THREAD(), Qnil, rb_gc_call_finalizer_at_exit(), and ruby_sig_finalize().

Referenced by ruby_cleanup(), and ruby_finalize().

void ruby_stop ( int  ex  ) 

Calls ruby_cleanup() and exits the process.

Definition at line 264 of file eval.c.

References ruby_cleanup().

Referenced by thread_start_func_2().

static void setup_exception ( rb_thread_t th,
int  tag,
volatile VALUE  mesg 
) [static]

Definition at line 465 of file eval.c.

References rb_thread_struct::cfp, rb_thread_struct::errinfo, exc_setup_cause(), exception_error, EXEC_EVENT_HOOK, EXEC_TAG, get_backtrace(), get_thread_errinfo(), INTERNAL_EXCEPTION_P, JUMP_TAG, NIL_P, OBJ_FROZEN, POP_TAG, PRIsVALUE, PUSH_TAG, Qnil, rb_ary_new3, rb_enc_sprintf(), rb_eRuntimeError, rb_eSystemExit, rb_exc_new(), rb_iv_set(), rb_obj_as_string(), rb_obj_classname(), rb_obj_dup(), rb_obj_is_kind_of(), rb_sourcefile, rb_sourceline(), rb_threadptr_reset_raised(), rb_threadptr_set_raised(), rb_usascii_encoding(), rb_vm_backtrace_object(), RTEST, ruby_debug, RUBY_DTRACE_RAISE, RUBY_DTRACE_RAISE_ENABLED, RUBY_EVENT_RAISE, rb_control_frame_struct::self, set_backtrace(), sysstack_error, TAG_FATAL, VALUE, and warn_printf().

Referenced by rb_longjmp(), and rb_raise_jump().

static VALUE top_include ( int  argc,
VALUE *  argv,
VALUE  self 
) [static]

Definition at line 1398 of file eval.c.

References GET_THREAD(), rb_cObject, rb_mod_include(), rb_warning(), and rb_thread_struct::top_wrapper.

Referenced by Init_eval().

static VALUE top_using ( VALUE  self,
VALUE  module 
) [static]

Definition at line 1418 of file eval.c.

References GET_THREAD(), rb_control_frame_struct::me, previous_frame(), rb_eRuntimeError, rb_raise(), rb_using_module(), and rb_vm_cref().

Referenced by Init_eval().

static void using_module_recursive ( NODE cref,
VALUE  klass 
) [static]

Definition at line 1139 of file eval.c.

References BUILTIN_TYPE, CONST_ID, NIL_P, rb_attr_get(), rb_eTypeError, rb_hash_foreach(), rb_obj_classname(), rb_raise(), RBASIC, RCLASS_SUPER, T_ICLASS, T_MODULE, using_refinement(), and VALUE.

Referenced by rb_using_module().

static int using_refinement ( VALUE  klass,
VALUE  module,
VALUE  arg 
) [static]

Definition at line 1130 of file eval.c.

References rb_using_refinement(), and ST_CONTINUE.

Referenced by using_module_recursive().


Variable Documentation

VALUE rb_eLocalJumpError

Definition at line 27 of file eval.c.

Referenced by Init_Proc(), and make_localjump_error().

VALUE rb_eSysStackError

Definition at line 28 of file eval.c.

Referenced by error_print(), and Init_Proc().

VALUE rb_eThreadError

Definition at line 730 of file eval.c.

Referenced by Init_Thread(), queue_do_pop(), rb_mutex_lock(), rb_mutex_synchronize_m(), rb_mutex_unlock(), rb_thread_stop(), rb_thread_wakeup(), rb_threadptr_pending_interrupt_check_mask(), thgroup_add(), thread_create_core(), thread_initialize(), thread_join(), thread_s_new(), and tracepoint_new_s().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7