Ruby  2.1.10p492(2016-04-01revision54464)
vm_core.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  vm_core.h -
4 
5  $Author: nagachika $
6  created at: 04/01/01 19:41:38 JST
7 
8  Copyright (C) 2004-2007 Koichi Sasada
9 
10 **********************************************************************/
11 
12 #ifndef RUBY_VM_CORE_H
13 #define RUBY_VM_CORE_H
14 
15 #define RUBY_VM_THREAD_MODEL 2
16 
17 #include "ruby/ruby.h"
18 #include "ruby/st.h"
19 
20 #include "node.h"
21 #include "vm_debug.h"
22 #include "vm_opts.h"
23 #include "id.h"
24 #include "method.h"
25 #include "ruby_atomic.h"
26 
27 #include "thread_native.h"
28 
29 #ifndef ENABLE_VM_OBJSPACE
30 #ifdef _WIN32
31 /*
32  * TODO: object space independent st_table.
33  * socklist needs st_table in rb_w32_sysinit(), before object space
34  * initialization.
35  * It is too early now to change st_hash_type, since it breaks binary
36  * compatibility.
37  */
38 #define ENABLE_VM_OBJSPACE 0
39 #else
40 #define ENABLE_VM_OBJSPACE 1
41 #endif
42 #endif
43 
44 #include <setjmp.h>
45 #include <signal.h>
46 
47 #ifndef NSIG
48 # define NSIG (_SIGMAX + 1) /* For QNX */
49 #endif
50 
51 #define RUBY_NSIG NSIG
52 
53 #ifdef HAVE_STDARG_PROTOTYPES
54 #include <stdarg.h>
55 #define va_init_list(a,b) va_start((a),(b))
56 #else
57 #include <varargs.h>
58 #define va_init_list(a,b) va_start((a))
59 #endif
60 
61 #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
62 #define USE_SIGALTSTACK
63 #endif
64 
65 /*****************/
66 /* configuration */
67 /*****************/
68 
69 /* gcc ver. check */
70 #if defined(__GNUC__) && __GNUC__ >= 2
71 
72 #if OPT_TOKEN_THREADED_CODE
73 #if OPT_DIRECT_THREADED_CODE
74 #undef OPT_DIRECT_THREADED_CODE
75 #endif
76 #endif
77 
78 #else /* defined(__GNUC__) && __GNUC__ >= 2 */
79 
80 /* disable threaded code options */
81 #if OPT_DIRECT_THREADED_CODE
82 #undef OPT_DIRECT_THREADED_CODE
83 #endif
84 #if OPT_TOKEN_THREADED_CODE
85 #undef OPT_TOKEN_THREADED_CODE
86 #endif
87 #endif
88 
89 #ifdef __native_client__
90 #undef OPT_DIRECT_THREADED_CODE
91 #endif
92 
93 /* call threaded code */
94 #if OPT_CALL_THREADED_CODE
95 #if OPT_DIRECT_THREADED_CODE
96 #undef OPT_DIRECT_THREADED_CODE
97 #endif /* OPT_DIRECT_THREADED_CODE */
98 #if OPT_STACK_CACHING
99 #undef OPT_STACK_CACHING
100 #endif /* OPT_STACK_CACHING */
101 #endif /* OPT_CALL_THREADED_CODE */
102 
103 /* likely */
104 #if __GNUC__ >= 3
105 #define LIKELY(x) (__builtin_expect((x), 1))
106 #define UNLIKELY(x) (__builtin_expect((x), 0))
107 #else /* __GNUC__ >= 3 */
108 #define LIKELY(x) (x)
109 #define UNLIKELY(x) (x)
110 #endif /* __GNUC__ >= 3 */
111 
112 #ifndef __has_attribute
113 # define __has_attribute(x) 0
114 #endif
115 
116 #if __has_attribute(unused)
117 #define UNINITIALIZED_VAR(x) x __attribute__((unused))
118 #elif defined(__GNUC__) && __GNUC__ >= 3
119 #define UNINITIALIZED_VAR(x) x = x
120 #else
121 #define UNINITIALIZED_VAR(x) x
122 #endif
123 
124 typedef unsigned long rb_num_t;
125 
126 /* iseq data type */
127 
129 
131 
132 
135  union {
136  size_t index;
138  } ic_value;
139 };
140 
142  struct {
146  } once;
148 };
149 
150 /* to avoid warning */
151 struct rb_thread_struct;
153 
154 /* rb_call_info_t contains calling information including inline cache */
155 typedef struct rb_call_info_struct {
156  /* fixed at compile time */
161 
162  /* inline cache: keys */
166 
167  /* inline cache: values */
170 
171  /* temporary values for method calling */
172  int argc;
175  union {
176  int opt_pc; /* used by iseq */
177  long index; /* used by ivar */
178  int missing_reason; /* used by method_missing */
179  int inc_sp; /* used by cfunc */
180  } aux;
181 
182  VALUE (*call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci);
184 
185 #if 1
186 #define GetCoreDataFromValue(obj, type, ptr) do { \
187  (ptr) = (type*)DATA_PTR(obj); \
188 } while (0)
189 #else
190 #define GetCoreDataFromValue(obj, type, ptr) Data_Get_Struct((obj), type, (ptr))
191 #endif
192 
193 #define GetISeqPtr(obj, ptr) \
194  GetCoreDataFromValue((obj), rb_iseq_t, (ptr))
195 
196 typedef struct rb_iseq_location_struct {
197  const VALUE path;
200  const VALUE label;
201  size_t first_lineno;
203 
204 struct rb_iseq_struct;
205 
207  /***************/
208  /* static data */
209  /***************/
210 
211  enum iseq_type {
221  } type; /* instruction sequence type */
222 
224 
225  VALUE *iseq; /* iseq (insn number and operands) */
226  VALUE *iseq_encoded; /* encoded iseq */
227  unsigned long iseq_size;
228  const VALUE mark_ary; /* Array: includes operands which should be GC marked */
229  const VALUE coverage; /* coverage array */
230 
231  /* insn info, must be freed */
234 
235  ID *local_table; /* must free */
237 
238  /* sizeof(vars) + 1 */
240 
242  int is_size;
243 
246 
274  int argc;
276  int arg_rest;
278  int arg_opts;
281  int arg_size;
284  int arg_keyword_check; /* if this is true, raise an ArgumentError when unknown keyword argument is passed */
288 
289  size_t stack_max; /* for stack overflow check */
290 
291  /* catch table */
294 
295  /* for child iseq */
298 
299  /****************/
300  /* dynamic data */
301  /****************/
302 
303  VALUE self;
304  const VALUE orig; /* non-NULL if its data have origin */
305 
306  /* block inlining */
307  /*
308  * NODE *node;
309  * void *special_block_builder;
310  * void *cached_special_block_builder;
311  * VALUE cached_special_block;
312  */
313 
314  /* klass/module nest information stack (cref) */
315  NODE * const cref_stack;
316  const VALUE klass;
317 
318  /* misc */
319  ID defined_method_id; /* for define_method */
321 
322  /* used at compile time */
324 };
325 
332 };
333 
334 #define GetVMPtr(obj, ptr) \
335  GetCoreDataFromValue((obj), rb_vm_t, (ptr))
336 
337 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
338 struct rb_objspace;
339 void rb_objspace_free(struct rb_objspace *);
340 #endif
341 
342 typedef struct rb_hook_list_struct {
347 
348 typedef struct rb_vm_struct {
349  VALUE self;
350 
353 
356 
359 
360  int running;
363  volatile int sleeper;
364 
365  /* object management */
367 
369 
370  /* load */
380 
381  /* signal */
382  struct {
384  int safe;
385  } trap_list[RUBY_NSIG];
386 
387  /* hook */
389 
390  /* relation table of ensure - rollback for callcc */
392 
393  /* postponed_job */
396 
398 
401 
403 
405 
406 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
408 #endif
409 
410  /*
411  * @shyouhei notes that this is not for storing normal Ruby
412  * objects so do *NOT* mark this when you GC.
413  */
414  struct RArray at_exit;
415 
417 
418  /* params */
419  struct { /* size in byte */
424  } default_params;
425 } rb_vm_t;
426 
427 /* default values */
428 
429 #define RUBY_VM_SIZE_ALIGN 4096
430 
431 #define RUBY_VM_THREAD_VM_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
432 #define RUBY_VM_THREAD_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
433 #define RUBY_VM_THREAD_MACHINE_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
434 #define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
435 
436 #define RUBY_VM_FIBER_VM_STACK_SIZE ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
437 #define RUBY_VM_FIBER_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
438 #define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */
439 #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
440 
441 #ifndef VM_DEBUG_BP_CHECK
442 #define VM_DEBUG_BP_CHECK 0
443 #endif
444 
445 typedef struct rb_control_frame_struct {
446  VALUE *pc; /* cfp[0] */
447  VALUE *sp; /* cfp[1] */
448  rb_iseq_t *iseq; /* cfp[2] */
449  VALUE flag; /* cfp[3] */
450  VALUE self; /* cfp[4] / block[0] */
451  VALUE klass; /* cfp[5] / block[1] */
452  VALUE *ep; /* cfp[6] / block[2] */
453  rb_iseq_t *block_iseq; /* cfp[7] / block[3] */
454  VALUE proc; /* cfp[8] / block[4] */
455  const rb_method_entry_t *me;/* cfp[9] */
456 
457 #if VM_DEBUG_BP_CHECK
458  VALUE *bp_check; /* cfp[10] */
459 #endif
461 
462 typedef struct rb_block_struct {
463  VALUE self; /* share with method frame if it's only block */
464  VALUE klass; /* share with method frame if it's only block */
465  VALUE *ep; /* share with method frame if it's only block */
468 } rb_block_t;
469 
471 
472 #define GetThreadPtr(obj, ptr) \
473  TypedData_Get_Struct((obj), rb_thread_t, &ruby_threadptr_data_type, (ptr))
474 
480 };
481 
482 typedef RUBY_JMP_BUF rb_jmpbuf_t;
483 
484 /*
485  the members which are written in TH_PUSH_TAG() should be placed at
486  the beginning and the end, so that entire region is accessible.
487 */
488 struct rb_vm_tag {
492  struct rb_vm_tag *prev;
493 };
494 
497 };
498 
501  void *arg;
502 };
503 
504 struct rb_mutex_struct;
505 
506 struct rb_thread_struct;
507 typedef struct rb_thread_list_struct{
511 
512 
513 typedef struct rb_ensure_entry {
518 
519 typedef struct rb_ensure_list {
523 
524 typedef struct rb_thread_struct {
525  VALUE self;
527 
528  /* execution information */
529  VALUE *stack; /* must free, must mark */
530  size_t stack_size; /* size in word (byte size / sizeof(VALUE)) */
534  VALUE last_status; /* $? */
535 
536  /* passing state */
537  int state;
538 
540 
541  /* for rb_iterate */
543 
544  /* for bmethod */
546 
547  /* for cfunc */
549 
550  /* for load(true) */
553 
554  /* eval env */
556 
559 
560  /* thread control */
563  int to_kill;
564  int priority;
565 
568 
571 
572  /* temporary place of errinfo */
574 
575  /* temporary place of retval on OPT_CALL_THREADED_CODE */
576 #if OPT_CALL_THREADED_CODE
577  VALUE retval;
578 #endif
579 
580  /* async errinfo queue */
584 
586  unsigned long interrupt_mask;
592 
593  struct rb_vm_tag *tag;
595 
603 
609 
610  /* storage */
612 
614 
618 
619  /* for GC */
620  struct {
624 #ifdef __ia64
625  VALUE *register_stack_start;
626  VALUE *register_stack_end;
627  size_t register_stack_maxsize;
628 #endif
629  jmp_buf regs;
630  } machine;
632 
633  /* statistics data for profiler */
635 
636  /* tracer */
638  struct rb_trace_arg_struct *trace_arg; /* trace information */
639 
640  /* fiber */
644 
645  /* ensure & callcc */
647 
648  /* misc */
651 #ifdef USE_SIGALTSTACK
652  void *altstack;
653 #endif
654  unsigned long running_time_us;
655 } rb_thread_t;
656 
657 typedef enum {
661  /* 0x03..0x06 is reserved */
664 
665 #define VM_DEFINECLASS_TYPE(x) ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK)
666 #define VM_DEFINECLASS_FLAG_SCOPED 0x08
667 #define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS 0x10
668 #define VM_DEFINECLASS_SCOPED_P(x) ((x) & VM_DEFINECLASS_FLAG_SCOPED)
669 #define VM_DEFINECLASS_HAS_SUPERCLASS_P(x) \
670  ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS)
671 
672 /* iseq.c */
674 
675 /* node -> iseq */
676 VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE, enum iseq_type);
677 VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent);
678 VALUE rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path);
681 
682 /* src -> iseq */
683 VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line);
684 VALUE rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_block);
685 VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt);
686 
688 int rb_iseq_disasm_insn(VALUE str, VALUE *iseqval, size_t pos, rb_iseq_t *iseq, VALUE child);
689 const char *ruby_node_name(int node);
690 
696 
697 #define GetProcPtr(obj, ptr) \
698  GetCoreDataFromValue((obj), rb_proc_t, (ptr))
699 
700 typedef struct {
702 
703  VALUE envval; /* for GC mark */
708 } rb_proc_t;
709 
710 #define GetEnvPtr(obj, ptr) \
711  GetCoreDataFromValue((obj), rb_env_t, (ptr))
712 
713 typedef struct {
715  int env_size;
717  VALUE prev_envval; /* for GC mark */
719 } rb_env_t;
720 
722 
723 #define GetBindingPtr(obj, ptr) \
724  GetCoreDataFromValue((obj), rb_binding_t, (ptr))
725 
726 typedef struct {
729  VALUE blockprocval; /* for GC mark */
730  unsigned short first_lineno;
731 } rb_binding_t;
732 
733 /* used by compile time and send insn */
734 
739 };
740 
741 #define VM_CHECKMATCH_TYPE_MASK 0x03
742 #define VM_CHECKMATCH_ARRAY 0x04
743 
744 #define VM_CALL_ARGS_SPLAT (0x01 << 1) /* m(*args) */
745 #define VM_CALL_ARGS_BLOCKARG (0x01 << 2) /* m(&block) */
746 #define VM_CALL_FCALL (0x01 << 3) /* m(...) */
747 #define VM_CALL_VCALL (0x01 << 4) /* m */
748 #define VM_CALL_TAILCALL (0x01 << 5) /* located at tail position */
749 #define VM_CALL_SUPER (0x01 << 6) /* super */
750 #define VM_CALL_OPT_SEND (0x01 << 7) /* internal flag */
751 #define VM_CALL_ARGS_SKIP_SETUP (0x01 << 8) /* (flag & (SPLAT|BLOCKARG)) && blockiseq == 0 */
752 
757 };
758 
759 #define VM_FRAME_MAGIC_METHOD 0x11
760 #define VM_FRAME_MAGIC_BLOCK 0x21
761 #define VM_FRAME_MAGIC_CLASS 0x31
762 #define VM_FRAME_MAGIC_TOP 0x41
763 #define VM_FRAME_MAGIC_CFUNC 0x61
764 #define VM_FRAME_MAGIC_PROC 0x71
765 #define VM_FRAME_MAGIC_IFUNC 0x81
766 #define VM_FRAME_MAGIC_EVAL 0x91
767 #define VM_FRAME_MAGIC_LAMBDA 0xa1
768 #define VM_FRAME_MAGIC_RESCUE 0xb1
769 #define VM_FRAME_MAGIC_MASK_BITS 8
770 #define VM_FRAME_MAGIC_MASK (~(~0<<VM_FRAME_MAGIC_MASK_BITS))
771 
772 #define VM_FRAME_TYPE(cfp) ((cfp)->flag & VM_FRAME_MAGIC_MASK)
773 
774 /* other frame flag */
775 #define VM_FRAME_FLAG_PASSED 0x0100
776 #define VM_FRAME_FLAG_FINISH 0x0200
777 #define VM_FRAME_FLAG_BMETHOD 0x0400
778 #define VM_FRAME_TYPE_FINISH_P(cfp) (((cfp)->flag & VM_FRAME_FLAG_FINISH) != 0)
779 #define VM_FRAME_TYPE_BMETHOD_P(cfp) (((cfp)->flag & VM_FRAME_FLAG_BMETHOD) != 0)
780 
781 #define RUBYVM_CFUNC_FRAME_P(cfp) \
782  (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
783 
784 /* inline cache */
785 typedef struct iseq_inline_cache_entry *IC;
787 
788 void rb_vm_change_state(void);
789 
790 typedef VALUE CDHASH;
791 
792 #ifndef FUNC_FASTCALL
793 #define FUNC_FASTCALL(x) x
794 #endif
795 
796 typedef rb_control_frame_t *
798 
799 #define GC_GUARDED_PTR(p) ((VALUE)((VALUE)(p) | 0x01))
800 #define GC_GUARDED_PTR_REF(p) ((void *)(((VALUE)(p)) & ~0x03))
801 #define GC_GUARDED_PTR_P(p) (((VALUE)(p)) & 0x01)
802 
803 /*
804  * block frame:
805  * ep[ 0]: prev frame
806  * ep[-1]: CREF (for *_eval)
807  *
808  * method frame:
809  * ep[ 0]: block pointer (ptr | VM_ENVVAL_BLOCK_PTR_FLAG)
810  */
811 
812 #define VM_ENVVAL_BLOCK_PTR_FLAG 0x02
813 #define VM_ENVVAL_BLOCK_PTR(v) (GC_GUARDED_PTR(v) | VM_ENVVAL_BLOCK_PTR_FLAG)
814 #define VM_ENVVAL_BLOCK_PTR_P(v) ((v) & VM_ENVVAL_BLOCK_PTR_FLAG)
815 #define VM_ENVVAL_PREV_EP_PTR(v) ((VALUE)GC_GUARDED_PTR(v))
816 #define VM_ENVVAL_PREV_EP_PTR_P(v) (!(VM_ENVVAL_BLOCK_PTR_P(v)))
817 
818 #define VM_EP_PREV_EP(ep) ((VALUE *)GC_GUARDED_PTR_REF((ep)[0]))
819 #define VM_EP_BLOCK_PTR(ep) ((rb_block_t *)GC_GUARDED_PTR_REF((ep)[0]))
820 #define VM_EP_LEP_P(ep) VM_ENVVAL_BLOCK_PTR_P((ep)[0])
821 
824 
825 #define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) ((cfp)+1)
826 #define RUBY_VM_NEXT_CONTROL_FRAME(cfp) ((cfp)-1)
827 #define RUBY_VM_END_CONTROL_FRAME(th) \
828  ((rb_control_frame_t *)((th)->stack + (th)->stack_size))
829 #define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \
830  ((void *)(ecfp) > (void *)(cfp))
831 #define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp) \
832  (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th)))
833 
834 #define RUBY_VM_IFUNC_P(ptr) (BUILTIN_TYPE(ptr) == T_NODE)
835 #define RUBY_VM_NORMAL_ISEQ_P(ptr) \
836  ((ptr) && !RUBY_VM_IFUNC_P(ptr))
837 
838 #define RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp) ((rb_block_t *)(&(cfp)->self))
839 #define RUBY_VM_GET_CFP_FROM_BLOCK_PTR(b) \
840  ((rb_control_frame_t *)((VALUE *)(b) - 4))
841 /* magic number `4' is depend on rb_control_frame_t layout. */
842 
843 /* VM related object allocate functions */
845 VALUE rb_proc_alloc(VALUE klass);
847 
848 /* for debug */
852 
853 #define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)
854 #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))
855 void rb_vm_bugreport(void);
856 
857 /* functions about thread/vm execution */
859 VALUE rb_iseq_eval(VALUE iseqval);
860 VALUE rb_iseq_eval_main(VALUE iseqval);
862 int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp);
863 
865  int argc, const VALUE *argv, const rb_block_t *blockptr);
866 VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass);
870 VALUE *rb_binding_add_dynavars(rb_binding_t *bind, int dyncount, const ID *dynvars);
872 void rb_vm_gvl_destroy(rb_vm_t *vm);
873 VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc,
874  const VALUE *argv, const rb_method_entry_t *me,
875  VALUE defined_class);
878 
883 
884 int ruby_thread_has_gvl_p(void);
885 typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
889 VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method);
892 int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, VALUE *klassp);
894 
896 
898 
899 void rb_vm_rewrite_cref_stack(NODE *node, VALUE old_klass, VALUE new_klass, NODE **new_cref_ptr);
900 
901 #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
902 
903 #define RUBY_CONST_ASSERT(expr) (1/!!(expr)) /* expr must be a compile-time constant */
904 #define VM_STACK_OVERFLOWED_P(cfp, sp, margin) \
905  (!RUBY_CONST_ASSERT(sizeof(*(sp)) == sizeof(VALUE)) || \
906  !RUBY_CONST_ASSERT(sizeof(*(cfp)) == sizeof(rb_control_frame_t)) || \
907  ((rb_control_frame_t *)((sp) + (margin)) + 1) >= (cfp))
908 #define WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) \
909  if (LIKELY(!VM_STACK_OVERFLOWED_P(cfp, sp, margin))) {(void)0;} else /* overflowed */
910 #define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) \
911  WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) vm_stackoverflow()
912 #define CHECK_VM_STACK_OVERFLOW(cfp, margin) \
913  WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stackoverflow()
914 
915 /* for thread */
916 
917 #if RUBY_VM_THREAD_MODEL == 2
919 extern rb_vm_t *ruby_current_vm;
921 
922 #define GET_VM() ruby_current_vm
923 
924 #ifndef OPT_CALL_CFUNC_WITHOUT_FRAME
925 #define OPT_CALL_CFUNC_WITHOUT_FRAME 0
926 #endif
927 
928 static inline rb_thread_t *
930 {
932 #if OPT_CALL_CFUNC_WITHOUT_FRAME
933  if (UNLIKELY(th->passed_ci != 0)) {
934  void vm_call_cfunc_push_frame(rb_thread_t *th);
935  vm_call_cfunc_push_frame(th);
936  }
937 #endif
938  return th;
939 }
940 
941 #define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th))
942 #define rb_thread_set_current(th) do { \
943  if ((th)->vm->running_thread != (th)) { \
944  (th)->running_time_us = 0; \
945  } \
946  rb_thread_set_current_raw(th); \
947  (th)->vm->running_thread = (th); \
948 } while (0)
949 
950 #else
951 #error "unsupported thread model"
952 #endif
953 
954 enum {
959 };
960 
961 #define RUBY_VM_SET_TIMER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TIMER_INTERRUPT_MASK)
962 #define RUBY_VM_SET_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, PENDING_INTERRUPT_MASK)
963 #define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK)
964 #define RUBY_VM_SET_TRAP_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TRAP_INTERRUPT_MASK)
965 #define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & ~(th)->interrupt_mask & (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
966 #define RUBY_VM_INTERRUPTED_ANY(th) ((th)->interrupt_flag & ~(th)->interrupt_mask)
967 
968 int rb_signal_buff_size(void);
969 void rb_signal_exec(rb_thread_t *th, int sig);
971 void rb_threadptr_signal_raise(rb_thread_t *th, int sig);
979 
980 #define RUBY_VM_CHECK_INTS_BLOCKING(th) do { \
981  if (UNLIKELY(!rb_threadptr_pending_interrupt_empty_p(th))) { \
982  th->pending_interrupt_queue_checked = 0; \
983  RUBY_VM_SET_INTERRUPT(th); \
984  rb_threadptr_execute_interrupts(th, 1); \
985  } \
986  else if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
987  rb_threadptr_execute_interrupts(th, 1); \
988  } \
989  } while (0)
990 
991 #define RUBY_VM_CHECK_INTS(th) do { \
992  if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
993  rb_threadptr_execute_interrupts(th, 0); \
994  } \
995 } while (0)
996 
997 /* tracer */
1002  VALUE self;
1006 
1008 
1009  /* calc from cfp */
1010  int lineno;
1012 };
1013 
1014 void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg);
1016 
1017 #define EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, pop_p_) do { \
1018  if (UNLIKELY(ruby_vm_event_flags & (flag_))) { \
1019  if (((th)->event_hooks.events | (th)->vm->event_hooks.events) & (flag_)) { \
1020  struct rb_trace_arg_struct trace_arg; \
1021  trace_arg.event = (flag_); \
1022  trace_arg.th = (th_); \
1023  trace_arg.cfp = (trace_arg.th)->cfp; \
1024  trace_arg.self = (self_); \
1025  trace_arg.id = (id_); \
1026  trace_arg.klass = (klass_); \
1027  trace_arg.data = (data_); \
1028  trace_arg.path = Qundef; \
1029  trace_arg.klass_solved = 0; \
1030  if (pop_p_) rb_threadptr_exec_event_hooks_and_pop_frame(&trace_arg); \
1031  else rb_threadptr_exec_event_hooks(&trace_arg); \
1032  } \
1033  } \
1034 } while (0)
1035 
1036 #define EXEC_EVENT_HOOK(th_, flag_, self_, id_, klass_, data_) \
1037  EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 0)
1038 
1039 #define EXEC_EVENT_HOOK_AND_POP_FRAME(th_, flag_, self_, id_, klass_, data_) \
1040  EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 1)
1041 
1044 
1046 
1048 
1049 extern VALUE rb_get_coverages(void);
1050 extern void rb_set_coverages(VALUE);
1051 extern void rb_reset_coverages(void);
1052 
1054 
1056 
1057 #endif /* RUBY_VM_CORE_H */
const rb_block_t * passed_block
Definition: vm_core.h:542
rb_serial_t class_serial
Definition: vm_core.h:164
int is_from_method
Definition: vm_core.h:706
VALUE done
Definition: vm_core.h:145
rb_control_frame_t * cfp
Definition: vm_core.h:531
void rb_objspace_free(struct rb_objspace *)
Definition: gc.c:890
rb_thread_list_t * join_list
Definition: vm_core.h:613
struct rb_block_struct * blockptr
Definition: vm_core.h:173
void rb_vm_bugreport(void)
Definition: vm_dump.c:713
struct rb_ensure_entry rb_ensure_entry_t
VALUE * stack_end
Definition: vm_core.h:622
VALUE * env
Definition: vm_core.h:714
int arg_simple
Definition: vm_core.h:275
unsigned long running_time_us
Definition: vm_core.h:654
rb_vm_t * vm
Definition: vm_core.h:526
VALUE rb_get_coverages(void)
Definition: thread.c:5297
VALUE expanded_load_path
Definition: vm_core.h:375
VALUE prev_envval
Definition: vm_core.h:717
struct rb_ensure_entry entry
Definition: vm_core.h:521
void rb_threadptr_pending_interrupt_clear(rb_thread_t *th)
Definition: thread.c:1542
NODE *const cref_stack
Definition: vm_core.h:315
void rb_threadptr_signal_raise(rb_thread_t *th, int sig)
Definition: thread.c:2064
VALUE * root_lep
Definition: vm_core.h:557
rb_block_t * rb_vm_control_frame_block_ptr(rb_control_frame_t *cfp)
Definition: vm.c:59
VALUE rb_iseq_new_with_bopt(NODE *, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, VALUE)
Definition: iseq.c:464
void rb_postponed_job_flush(rb_vm_t *vm)
Definition: vm_trace.c:1514
struct RArray at_exit
Definition: vm_core.h:414
struct rb_vm_protect_tag * protect_tag
Definition: vm_core.h:594
struct rb_thread_struct * running_thread
Definition: vm_core.h:355
Definition: st.h:69
VALUE cmd
Definition: vm_core.h:383
st_table * local_storage
Definition: vm_core.h:611
void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
Definition: thread.c:404
int pending_interrupt_queue_checked
Definition: vm_core.h:582
rb_serial_t method_state
Definition: vm_core.h:163
ID * arg_keyword_table
Definition: vm_core.h:287
VALUE rb_proc_alloc(VALUE klass)
Definition: proc.c:87
VALUE value
Definition: vm_core.h:144
const VALUE coverage
Definition: vm_core.h:229
VALUE top_self
Definition: vm_core.h:371
rb_block_t block
Definition: vm_core.h:718
VALUE progname
Definition: vm_core.h:399
struct rb_thread_struct * th
Definition: vm_core.h:509
void rb_unblock_function_t(void *)
Definition: intern.h:864
void rb_thread_start_timer_thread(void)
Definition: thread.c:3874
rb_unblock_function_t * func
Definition: vm_core.h:500
struct iseq_compile_data * compile_data
Definition: vm_core.h:323
struct st_table * loaded_features_index
Definition: vm_core.h:378
vm_check_match_type
Definition: vm_core.h:735
rb_iseq_t * iseq
Definition: vm_core.h:466
VALUE pending_interrupt_mask_stack
Definition: vm_core.h:583
jmp_buf regs
Definition: vm_core.h:629
VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent)
Definition: iseq.c:421
RUBY_EXTERN VALUE rb_cRubyVM
Definition: vm_core.h:692
VALUE * defined_strings
Definition: vm_core.h:416
VALUE rb_binding_new_with_cfp(rb_thread_t *th, const rb_control_frame_t *src_cfp)
Definition: proc.c:320
VALUE rb_thread_alloc(VALUE klass)
Definition: vm.c:2233
rb_call_info_t * callinfo_entries
Definition: vm_core.h:244
int env_size
Definition: vm_core.h:715
VALUE data2
Definition: vm_core.h:516
rb_thread_t * th
Definition: vm_core.h:1000
VALUE mark_object_ary
Definition: vm_core.h:366
#define RUBY_NSIG
Definition: vm_core.h:51
const rb_data_type_t ruby_binding_data_type
Definition: proc.c:276
void rb_unlink_method_entry(rb_method_entry_t *me)
Definition: vm_method.c:114
VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp)
Definition: vm.c:577
int rb_autoloading_value(VALUE mod, ID id, VALUE *value)
Definition: variable.c:1715
void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp, VALUE *_pc)
Definition: vm_dump.c:357
int rb_iseq_disasm_insn(VALUE str, VALUE *iseqval, size_t pos, rb_iseq_t *iseq, VALUE child)
Disassemble a instruction Iseq -> Iseq inspect object.
Definition: iseq.c:1287
st_table * living_threads
Definition: vm_core.h:357
size_t fiber_machine_stack_size
Definition: vm_core.h:423
rb_vm_t * ruby_current_vm
Definition: vm.c:105
VALUE verbose
Definition: vm_core.h:399
void ruby_thread_init_stack(rb_thread_t *th)
Definition: thread.c:497
int local_table_size
Definition: vm_core.h:236
struct rb_hook_list_struct rb_hook_list_t
struct rb_iseq_struct * local_iseq
Definition: vm_core.h:297
VALUE rb_threadptr_reset_recursive_data(rb_thread_t *th)
Definition: thread.c:4799
struct rb_vm_protect_tag * prev
Definition: vm_core.h:496
pthread_mutex_t rb_nativethread_lock_t
const VALUE klass
Definition: vm_core.h:316
size_t stack_max
Definition: vm_core.h:289
int arg_keyword
Definition: vm_core.h:283
struct rb_control_frame_struct rb_control_frame_t
VALUE last_status
Definition: vm_core.h:534
ID defined_method_id
Definition: vm_core.h:319
RUBY_SYMBOL_EXPORT_END int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp)
Definition: vm.c:1700
RUBY_EXTERN VALUE rb_cEnv
Definition: vm_core.h:693
Definition: vm_core.h:513
VALUE env
Definition: vm_core.h:727
struct rb_thread_list_struct rb_thread_list_t
rb_vm_defineclass_type_t
Definition: vm_core.h:657
rb_event_flag_t events
Definition: vm_core.h:344
int arg_post_len
Definition: vm_core.h:279
void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *)
Definition: vm_dump.c:141
union iseq_inline_cache_entry::@164 ic_value
VALUE value
Definition: vm_core.h:137
int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th)
Definition: thread.c:1657
void rb_vm_stack_to_heap(rb_thread_t *th)
Definition: vm.c:635
struct rb_thread_struct::@169 machine
void rb_thread_stop_timer_thread(int)
Definition: thread.c:3860
const VALUE mark_ary
Definition: vm_core.h:228
struct iseq_inline_storage_entry::@165 once
VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_method_entry_t *me, VALUE defined_class)
Definition: vm_eval.c:244
VALUE envval
Definition: vm_core.h:703
VALUE thgroup_default
Definition: vm_core.h:358
Definition: node.h:239
VALUE * iseq
Definition: vm_core.h:225
VALUE * stack
Definition: vm_core.h:529
enum rb_iseq_struct::iseq_type type
VALUE defined_module_hash
Definition: vm_core.h:404
void rb_thread_reset_timer_thread(void)
Definition: thread.c:3868
int arg_keyword_required
Definition: vm_core.h:286
unsigned short first_lineno
Definition: vm_core.h:730
void rb_thread_wakeup_timer_thread(void)
int src_encoding_index
Definition: vm_core.h:397
int trace_running
Definition: vm_core.h:362
VALUE locking_mutex
Definition: vm_core.h:590
struct st_table * ensure_rollback_table
Definition: vm_core.h:391
void rb_gc_mark_machine_stack(rb_thread_t *th)
Definition: gc.c:3509
rb_iseq_t * block_iseq
Definition: vm_core.h:453
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, VALUE *klassp)
Definition: vm.c:1672
void rb_signal_exec(rb_thread_t *th, int sig)
Definition: signal.c:873
size_t fiber_vm_stack_size
Definition: vm_core.h:422
VALUE(* e_proc)(ANYARGS)
Definition: vm_core.h:515
struct rb_vm_struct rb_vm_t
void * blocking_region_buffer
Definition: vm_core.h:567
void rb_vm_rewind_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
Definition: vm.c:291
int argc
argument information
Definition: vm_core.h:274
VALUE load_path_check_cache
Definition: vm_core.h:374
struct rb_ensure_list rb_ensure_list_t
Definition: ruby.h:860
rb_iseq_t * iseq
Definition: vm_core.h:448
struct rb_vm_struct::@167 trap_list[RUBY_NSIG]
int arg_post_start
Definition: vm_core.h:280
void rb_threadptr_exec_event_hooks_and_pop_frame(struct rb_trace_arg_struct *trace_arg)
Definition: vm_trace.c:378
int running
Definition: vm_core.h:360
#define UNLIKELY(x)
Definition: vm_core.h:109
rb_control_frame_t * cfp
Definition: vm_core.h:1001
VALUE * arg_opt_table
Definition: vm_core.h:282
VALUE tag
Definition: vm_core.h:489
int arg_keywords
Definition: vm_core.h:285
VALUE rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path)
Definition: iseq.c:428
Definition: vm_core.h:141
VALUE top_self
Definition: vm_core.h:551
VALUE * rb_vm_ep_local_ep(VALUE *ep)
Definition: vm.c:34
int postponed_job_index
Definition: vm_core.h:395
rb_num_t flip_cnt
Definition: vm_core.h:320
int thread_abort_on_exception
Definition: vm_core.h:361
int argc
Definition: ruby.c:131
struct unlinked_method_entry_list_entry * unlinked_method_entry_list
Definition: vm_core.h:402
vm_special_object_type
Definition: vm_core.h:753
struct st_table * loading_table
Definition: vm_core.h:379
rb_thread_status
Definition: vm_core.h:475
struct rb_iseq_location_struct rb_iseq_location_t
Definition: method.h:97
rb_iseq_t * blockiseq
Definition: vm_core.h:160
rb_block_t * base_block
Definition: vm_core.h:555
void rb_threadptr_signal_exit(rb_thread_t *th)
Definition: thread.c:2074
volatile int sleeper
Definition: vm_core.h:363
ID * local_table
Definition: vm_core.h:235
struct rb_event_hook_struct * hooks
Definition: vm_core.h:343
union rb_call_info_struct::@166 aux
unsigned long rb_num_t
Definition: vm_core.h:124
int rb_signal_buff_size(void)
Definition: signal.c:666
const char * ruby_node_name(int node)
Definition: iseq.c:1604
Definition: vm_core.h:133
rb_hook_list_t event_hooks
Definition: vm_core.h:637
#define RUBY_EXTERN
Definition: missing.h:67
VALUE special_exceptions[ruby_special_error_count]
Definition: vm_core.h:368
VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass)
Definition: vm.c:656
struct rb_mutex_struct * keeping_mutexes
Definition: vm_core.h:591
unsigned long rb_serial_t
Definition: internal.h:260
VALUE loaded_features
Definition: vm_core.h:376
VALUE blockprocval
Definition: vm_core.h:729
pthread_t rb_nativethread_id_t
#define RUBY_SYMBOL_EXPORT_END
Definition: missing.h:39
rb_event_flag_t ruby_vm_event_flags
Definition: vm.c:106
void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v)
Definition: thread.c:1548
struct rb_iseq_struct * parent_iseq
Definition: vm_core.h:296
const VALUE path
Definition: vm_core.h:197
unsigned long ID
Definition: ruby.h:89
const VALUE orig
Definition: vm_core.h:304
size_t thread_vm_stack_size
Definition: vm_core.h:420
rb_thread_t * ruby_current_thread
Definition: vm.c:104
VALUE rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp)
Definition: vm.c:694
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_new(NODE *, VALUE, VALUE, VALUE, VALUE, enum iseq_type)
Definition: iseq.c:413
int local_size
Definition: vm_core.h:716
rb_call_info_t * CALL_INFO
Definition: vm_core.h:786
VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line)
Definition: iseq.c:643
VALUE * iseq_encoded
Definition: vm_core.h:226
unsigned long VALUE
Definition: ruby.h:88
const rb_data_type_t ruby_threadptr_data_type
Definition: vm.c:2148
RUBY_JMP_BUF rb_jmpbuf_t
Definition: vm_core.h:482
int catch_table_size
Definition: vm_core.h:293
Definition: iseq.h:55
struct rb_thread_struct * main_thread
Definition: vm_core.h:354
VALUE first_proc
Definition: vm_core.h:615
#define RUBY_SYMBOL_EXPORT_BEGIN
Definition: missing.h:38
RUBY_SYMBOL_EXPORT_BEGIN int rb_thread_check_trap_pending(void)
Definition: thread.c:1153
rb_iseq_location_t location
Definition: vm_core.h:223
rb_atomic_t interrupt_flag
Definition: vm_core.h:585
rb_nativethread_cond_t interrupt_cond
Definition: vm_core.h:588
int rb_backtrace_iter_func(void *, VALUE, int, VALUE)
Definition: vm_core.h:885
VALUE rb_binding_alloc(VALUE klass)
Definition: proc.c:287
struct rb_ensure_list * next
Definition: vm_core.h:520
rb_serial_t ic_serial
Definition: vm_core.h:134
int abort_on_exception
Definition: vm_core.h:650
VALUE blockprocval
Definition: vm_core.h:704
VALUE(* first_func)(ANYARGS)
Definition: vm_core.h:617
enum rb_thread_status status
Definition: vm_core.h:562
VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, int argc, const VALUE *argv, const rb_block_t *blockptr)
Definition: vm.c:897
ruby_special_exceptions
Definition: vm_core.h:326
struct rb_block_struct rb_block_t
void rb_vm_change_state(void)
int callinfo_size
Definition: vm_core.h:245
VALUE rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_block)
Definition: iseq.c:649
VALUE first_args
Definition: vm_core.h:616
void rb_vm_gvl_destroy(rb_vm_t *vm)
Definition: thread.c:272
struct rb_objspace * objspace
Definition: vm_core.h:407
int is_lambda
Definition: vm_core.h:707
VALUE top_wrapper
Definition: vm_core.h:552
int mark_stack_len
Definition: vm_core.h:631
int safe_level
Definition: vm_core.h:705
int arg_keyword_check
Definition: vm_core.h:284
struct rb_vm_struct::@168 default_params
VALUE root_svar
Definition: vm_core.h:558
rb_block_t block
Definition: vm_core.h:701
int mild_compile_error
Thread-local state of compiling context.
Definition: vm_core.h:608
VALUE * stack_start
Definition: vm_core.h:621
size_t index
Definition: vm_core.h:136
unsigned long interrupt_mask
Definition: vm_core.h:586
void rb_threadptr_interrupt(rb_thread_t *th)
Definition: thread.c:359
size_t line_info_size
Definition: vm_core.h:233
#define ANYARGS
Definition: defines.h:98
const rb_method_entry_t * me
Definition: vm_core.h:455
struct rb_unblock_callback unblock
Definition: vm_core.h:589
VALUE marker
Definition: vm_core.h:514
unsigned long rb_event_flag_t
Definition: ruby.h:1748
rb_hook_list_t event_hooks
Definition: vm_core.h:388
VALUE * rb_binding_add_dynavars(rb_binding_t *bind, int dyncount, const ID *dynvars)
Definition: vm.c:725
#define FUNC_FASTCALL(x)
Definition: vm_core.h:793
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_eval(VALUE iseqval)
Definition: vm.c:1646
rb_nativethread_id_t thread_id
Definition: vm_core.h:561
struct iseq_catch_table_entry * catch_table
Definition: vm_core.h:292
rb_nativethread_lock_t thread_destruct_lock
Definition: vm_core.h:352
rb_control_frame_t *FUNC_FASTCALL rb_insn_func_t(rb_thread_t *, rb_control_frame_t *)
Definition: vm_core.h:797
void rb_set_coverages(VALUE)
Definition: thread.c:5303
VALUE orig_progname
Definition: vm_core.h:399
VALUE root_fiber
Definition: vm_core.h:642
int local_size
Definition: vm_core.h:239
VALUE CDHASH
Definition: vm_core.h:790
struct iseq_inline_cache_entry * IC
Definition: vm_core.h:785
void rb_gc_mark_unlinked_live_method_entries(void *pvm)
Definition: vm_method.c:123
native_thread_data_t native_thread_data
Definition: vm_core.h:566
size_t thread_machine_stack_size
Definition: vm_core.h:421
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt)
Definition: iseq.c:589
struct rb_thread_struct * running_thread
Definition: vm_core.h:143
VALUE load_path_snapshot
Definition: vm_core.h:373
struct iseq_line_info_entry * line_info_table
Definition: vm_core.h:232
void rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old)
Definition: thread.c:4807
VALUE rb_iseq_disasm(VALUE self)
Definition: iseq.c:1379
struct iseq_inline_cache_entry cache
Definition: vm_core.h:147
unsigned long iseq_size
Definition: vm_core.h:227
void rb_reset_coverages(void)
Definition: thread.c:5310
int rb_vm_get_sourceline(const rb_control_frame_t *)
Definition: vm_backtrace.c:33
void rb_vm_inc_const_missing_count(void)
Definition: vm.c:111
rb_ensure_list_t * ensure_list
Definition: vm_core.h:646
VALUE loaded_features_snapshot
Definition: vm_core.h:377
VALUE rb_iseq_new_with_opt(NODE *, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, const rb_compile_option_t *)
Definition: iseq.c:454
rb_jmpbuf_t root_jmpbuf
Definition: vm_core.h:643
VALUE debug
Definition: vm_core.h:399
int rb_atomic_t
Definition: ruby_atomic.h:120
const rb_method_entry_t * passed_bmethod_me
Definition: vm_core.h:545
rb_call_info_t * passed_ci
Definition: vm_core.h:548
rb_global_vm_lock_t gvl
Definition: vm_core.h:351
const char * name
Definition: nkf.c:208
rb_event_flag_t event
Definition: vm_core.h:999
void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp)
Definition: vm_dump.c:385
rb_jmpbuf_t buf
Definition: vm_core.h:491
size_t stack_size
Definition: vm_core.h:530
const VALUE absolute_path
Definition: vm_core.h:198
struct rb_thread_list_struct * next
Definition: vm_core.h:508
struct rb_thread_struct rb_thread_t
struct rb_vm_tag * tag
Definition: vm_core.h:593
struct rb_vm_tag * prev
Definition: vm_core.h:492
VALUE retval
Definition: vm_core.h:490
struct rb_call_info_struct rb_call_info_t
struct rb_postponed_job_struct * postponed_job_buffer
Definition: vm_core.h:394
VALUE(* call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci)
Definition: vm_core.h:182
rb_nativethread_lock_t interrupt_lock
Definition: vm_core.h:587
VALUE load_path
Definition: vm_core.h:372
void rb_threadptr_check_signal(rb_thread_t *mth)
Definition: thread.c:3819
void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg)
Definition: vm_trace.c:384
VALUE pending_interrupt_queue
Definition: vm_core.h:581
RUBY_EXTERN VALUE rb_mRubyVMFrozenCore
Definition: vm_core.h:694
Definition: iseq.h:50
void rb_threadptr_execute_interrupts(rb_thread_t *, int)
Definition: thread.c:1957
size_t stack_maxsize
Definition: vm_core.h:623
#define mod(x, y)
Definition: date_strftime.c:28
rb_control_frame_t * rb_vm_get_binding_creatable_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp)
Definition: vm.c:235
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp)
Definition: vm.c:247
VALUE path
Definition: vm_core.h:728
int method_missing_reason
Definition: vm_core.h:649
VALUE stat_insn_usage
Definition: vm_core.h:634
const VALUE label
Definition: vm_core.h:200
const VALUE base_label
Definition: vm_core.h:199
static rb_thread_t * GET_THREAD(void)
Definition: vm_core.h:929
VALUE rb_iseq_eval_main(VALUE iseqval)
Definition: vm.c:1659
VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method)
Definition: error.c:1078
RUBY_EXTERN VALUE rb_cISeq
Definition: vm_core.h:691
struct rb_trace_arg_struct * trace_arg
Definition: vm_core.h:638
int ruby_thread_has_gvl_p(void)
Definition: thread.c:1496
void rb_vm_rewrite_cref_stack(NODE *node, VALUE old_klass, VALUE new_klass, NODE **new_cref_ptr)
VALUE coverages
Definition: vm_core.h:400
Definition: method.h:105
const rb_method_entry_t * me
Definition: vm_core.h:168
char ** argv
Definition: ruby.c:132
VALUE * ep
Definition: vm_core.h:465
int parse_in_eval
Thread-local state of evaluation context.
Definition: vm_core.h:602
union iseq_inline_storage_entry * is_entries
Definition: vm_core.h:241