| Ruby
    2.5.0dev(2017-10-22revision60238)
    | 
#include "ruby/ruby.h"#include "vm_core.h"#include <stdio.h>#include <setjmp.h>#include <sys/types.h>#include <signal.h>#include <errno.h>#include <sys/stat.h>Go to the source code of this file.
| Macros | |
| #define | PASS_PASSED_BLOCK_HANDLER_TH(th) pass_passed_block_handler(th) | 
| #define | PASS_PASSED_BLOCK_HANDLER() pass_passed_block_handler(GET_THREAD()) | 
| #define | EXIT_SUCCESS 0 | 
| #define | EXIT_FAILURE 1 | 
| #define | ruby_setjmp(env) RUBY_SETJMP(env) | 
| #define | ruby_longjmp(env, val) RUBY_LONGJMP((env),(val)) | 
| #define | SAVE_ROOT_JMPBUF_BEFORE_STMT | 
| #define | SAVE_ROOT_JMPBUF_AFTER_STMT | 
| #define | SAVE_ROOT_JMPBUF(th, stmt) | 
| #define | TH_PUSH_TAG(th) | 
| #define | TH_POP_TAG() | 
| #define | TH_TMPPOP_TAG() _th->ec.tag = _tag.prev | 
| #define | TH_REPUSH_TAG() (void)(_th->ec.tag = &_tag) | 
| #define | PUSH_TAG() TH_PUSH_TAG(GET_THREAD()) | 
| #define | POP_TAG() TH_POP_TAG() | 
| #define | VAR_FROM_MEMORY(var) (var) | 
| #define | VAR_INITIALIZED(var) ((void)&(var)) | 
| #define | VAR_NOCLOBBERED(var) var | 
| #define | UNALIGNED_MEMBER_ACCESS(expr) expr | 
| #define | UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) | 
| #define | RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)) | 
| #define | TH_EXEC_TAG() (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0)) | 
| #define | EXEC_TAG() TH_EXEC_TAG() | 
| #define | TH_JUMP_TAG(th, st) rb_threadptr_tag_jump(th, st) | 
| #define | JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), (st)) | 
| #define | INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc) | 
| #define | CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1 | 
| #define | CREF_FL_OMOD_SHARED IMEMO_FL_USER2 | 
| #define | rb_thread_raised_set(th, f) ((th)->ec.raised_flag |= (f)) | 
| #define | rb_thread_raised_reset(th, f) ((th)->ec.raised_flag &= ~(f)) | 
| #define | rb_thread_raised_p(th, f) (((th)->ec.raised_flag & (f)) != 0) | 
| #define | rb_thread_raised_clear(th) ((th)->ec.raised_flag = 0) | 
| #define | CharNext(p) ((p) + 1) | 
| Enumerations | |
| enum | { RAISED_EXCEPTION = 1, RAISED_STACKOVERFLOW = 2, RAISED_NOMEMORY = 4 } | 
| #define CharNext | ( | p | ) | ((p) + 1) | 
Definition at line 325 of file eval_intern.h.
| #define CREF_FL_OMOD_SHARED IMEMO_FL_USER2 | 
Definition at line 213 of file eval_intern.h.
| #define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1 | 
Definition at line 212 of file eval_intern.h.
| #define EXEC_TAG | ( | ) | TH_EXEC_TAG() | 
Definition at line 201 of file eval_intern.h.
Referenced by rb_exec_end_proc(), rb_fiber_start(), rb_load_protect(), rb_postponed_job_flush(), rb_require_internal(), rb_thread_io_blocking_region(), ruby_cleanup(), ruby_options(), and ruby_setup().
| #define EXIT_FAILURE 1 | 
Definition at line 33 of file eval_intern.h.
Referenced by Init_BareVM(), Init_Method(), rb_thread_call_with_gvl(), and ruby_executable_node().
| #define EXIT_SUCCESS 0 | 
Definition at line 30 of file eval_intern.h.
| #define INTERNAL_EXCEPTION_P | ( | exc | ) | FIXNUM_P(exc) | 
Definition at line 208 of file eval_intern.h.
| #define JUMP_TAG | ( | st | ) | TH_JUMP_TAG(GET_THREAD(), (st)) | 
Definition at line 206 of file eval_intern.h.
Referenced by rb_jump_tag(), and rb_require_safe().
| #define PASS_PASSED_BLOCK_HANDLER | ( | ) | pass_passed_block_handler(GET_THREAD()) | 
Definition at line 24 of file eval_intern.h.
Referenced by rb_funcall_passing_block(), and rb_obj_call_init().
| #define PASS_PASSED_BLOCK_HANDLER_TH | ( | th | ) | pass_passed_block_handler(th) | 
Definition at line 23 of file eval_intern.h.
Referenced by rb_call_super().
| #define POP_TAG | ( | ) | TH_POP_TAG() | 
Definition at line 148 of file eval_intern.h.
Referenced by ruby_setup().
| #define PUSH_TAG | ( | ) | TH_PUSH_TAG(GET_THREAD()) | 
Definition at line 147 of file eval_intern.h.
Referenced by rb_load_protect(), ruby_options(), and ruby_setup().
| #define RB_OBJ_WRITE | ( | a, | |
| slot, | |||
| b | |||
| ) | UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)) | 
Definition at line 175 of file eval_intern.h.
Referenced by rb_iseq_pathobj_set(), and rb_proc_create_from_captured().
| #define rb_thread_raised_clear | ( | th | ) | ((th)->ec.raised_flag = 0) | 
Definition at line 288 of file eval_intern.h.
Referenced by rb_threadptr_error_print().
Definition at line 287 of file eval_intern.h.
Definition at line 286 of file eval_intern.h.
Definition at line 285 of file eval_intern.h.
Definition at line 60 of file eval_intern.h.
Definition at line 59 of file eval_intern.h.
| #define SAVE_ROOT_JMPBUF | ( | th, | |
| stmt | |||
| ) | 
Definition at line 121 of file eval_intern.h.
Referenced by ruby_cleanup(), and ruby_options().
| #define SAVE_ROOT_JMPBUF_AFTER_STMT | 
Definition at line 118 of file eval_intern.h.
| #define SAVE_ROOT_JMPBUF_BEFORE_STMT | 
Definition at line 117 of file eval_intern.h.
| #define TH_EXEC_TAG | ( | ) | (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0)) | 
Definition at line 198 of file eval_intern.h.
Referenced by rb_eval_cmd(), rb_thread_terminate_all(), and rb_threadptr_error_print().
| #define TH_JUMP_TAG | ( | th, | |
| st | |||
| ) | rb_threadptr_tag_jump(th, st) | 
Definition at line 204 of file eval_intern.h.
Referenced by rb_eval_string_wrap(), rb_thread_io_blocking_region(), and rb_threadptr_stack_overflow().
| #define TH_POP_TAG | ( | ) | 
Definition at line 138 of file eval_intern.h.
Referenced by rb_fiber_start(), rb_postponed_job_flush(), and rb_thread_io_blocking_region().
| #define TH_PUSH_TAG | ( | th | ) | 
Definition at line 131 of file eval_intern.h.
Referenced by rb_eval_cmd(), rb_exec_end_proc(), rb_fiber_start(), rb_postponed_job_flush(), rb_require_internal(), rb_thread_io_blocking_region(), rb_thread_terminate_all(), rb_threadptr_error_print(), and ruby_cleanup().
| #define TH_REPUSH_TAG | ( | ) | (void)(_th->ec.tag = &_tag) | 
Definition at line 145 of file eval_intern.h.
| #define TH_TMPPOP_TAG | ( | ) | _th->ec.tag = _tag.prev | 
Definition at line 142 of file eval_intern.h.
| #define UNALIGNED_MEMBER_ACCESS | ( | expr | ) | expr | 
Definition at line 170 of file eval_intern.h.
| #define UNALIGNED_MEMBER_PTR | ( | ptr, | |
| mem | |||
| ) | UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) | 
Definition at line 172 of file eval_intern.h.
| #define VAR_FROM_MEMORY | ( | var | ) | (var) | 
Definition at line 155 of file eval_intern.h.
Referenced by rb_fiber_start().
| #define VAR_INITIALIZED | ( | var | ) | ((void)&(var)) | 
Definition at line 156 of file eval_intern.h.
| #define VAR_NOCLOBBERED | ( | var | ) | var | 
Definition at line 157 of file eval_intern.h.
Referenced by rb_eval_cmd().
| anonymous enum | 
| Enumerator | |
|---|---|
| RAISED_EXCEPTION | |
| RAISED_STACKOVERFLOW | |
| RAISED_NOMEMORY | |
Definition at line 278 of file eval_intern.h.
| NORETURN | ( | static inline void | rb_threadptr_tag_jumprb_thread_t *, enum ruby_tag_type st | ) | 
| NORETURN | ( | void | rb_method_name_errorVALUE, VALUE | ) | 
| NORETURN | ( | void | rb_fiber_startvoid | ) | 
| NORETURN | ( | void | rb_print_undefVALUE, ID, rb_method_visibility_t | ) | 
| NORETURN | ( | void | rb_vm_localjump_errorconst char *, VALUE, int | ) | 
| NORETURN | ( | void | rb_raise_method_missingrb_thread_t *th, int argc, const VALUE *argv, VALUE obj, int call_status | ) | 
Definition at line 1385 of file vm_eval.c.
References NIL_P, NUM2INT, Qundef, rb_scan_args(), SafeStringValue, and StringValue.
Referenced by Init_vm_eval().
| void rb_thread_cleanup | ( | void | ) | 
| void rb_thread_terminate_all | ( | void | ) | 
Definition at line 479 of file thread.c.
References GET_THREAD, rb_vm_struct::main_thread, rb_bug(), rb_threadptr_unlock_all_locking_mutexes(), TAG_NONE, TH_EXEC_TAG, TH_PUSH_TAG, thread_debug, and rb_thread_struct::vm.
| void rb_thread_wait_other_threads | ( | void | ) | 
| VALUE rb_threadptr_backtrace_location_ary | ( | rb_thread_t * | th, | 
| long | lev, | ||
| long | n | ||
| ) | 
Definition at line 659 of file vm_backtrace.c.
| VALUE rb_threadptr_backtrace_object | ( | rb_thread_t * | th | ) | 
Definition at line 515 of file vm_backtrace.c.
References bt_iter_arg::prev_loc.
| VALUE rb_threadptr_backtrace_str_ary | ( | rb_thread_t * | th, | 
| long | lev, | ||
| long | n | ||
| ) | 
Definition at line 653 of file vm_backtrace.c.
Referenced by rb_make_backtrace().
| int rb_threadptr_reset_raised | ( | rb_thread_t * | th | ) | 
Definition at line 2183 of file thread.c.
References rb_thread_struct::ec, RAISED_EXCEPTION, and rb_execution_context_struct::raised_flag.
| int rb_threadptr_set_raised | ( | rb_thread_t * | th | ) | 
Definition at line 2173 of file thread.c.
References rb_thread_struct::ec, RAISED_EXCEPTION, and rb_execution_context_struct::raised_flag.
| int rb_threadptr_stack_check | ( | rb_thread_t * | th | ) | 
| VALUE rb_vm_call_cfunc | ( | VALUE | recv, | 
| VALUE(*)(VALUE) | func, | ||
| VALUE | arg, | ||
| VALUE | block_handler, | ||
| VALUE | filename | ||
| ) | 
Definition at line 2100 of file vm.c.
References rb_execution_context_struct::cfp, rb_thread_struct::ec, GET_THREAD, Qnil, rb_iseq_new(), and rb_captured_block::val.
| VALUE rb_vm_cbase | ( | void | ) | 
Definition at line 1368 of file vm.c.
References rb_execution_context_struct::cfp, rb_thread_struct::ec, GET_THREAD, rb_eRuntimeError, rb_raise(), and rb_vm_get_ruby_level_next_cfp().
| rb_cref_t* rb_vm_cref | ( | void | ) | 
Definition at line 1321 of file vm.c.
References rb_execution_context_struct::cfp, rb_thread_struct::ec, GET_THREAD, NULL, and rb_vm_get_ruby_level_next_cfp().
| rb_cref_t* rb_vm_cref_replace_with_duplicated_cref | ( | void | ) | 
Definition at line 1334 of file vm.c.
References rb_execution_context_struct::cfp, rb_thread_struct::ec, GET_THREAD, and rb_vm_get_ruby_level_next_cfp().
Definition at line 1421 of file vm.c.
References GET_THREAD, Qnil, Qundef, TAG_BREAK, TAG_NEXT, TAG_REDO, TAG_RETRY, and TAG_RETURN.
Referenced by rb_fiber_start().
| void rb_vm_set_progname | ( | VALUE | filename | ) | 
Definition at line 3110 of file vm.c.
References rb_thread_struct::ec, GET_VM, rb_control_frame_struct::iseq, rb_iseq_pathobj_set(), rb_iseq_realpath(), rb_str_dup(), rb_execution_context_struct::vm_stack, and rb_execution_context_struct::vm_stack_size.
Referenced by ruby_set_script_name().
Referenced by rb_feature_provided().
 1.8.13
 1.8.13