Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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 #if defined(_WIN32)
28 #include "thread_win32.h"
29 #elif defined(HAVE_PTHREAD_H)
30 #include "thread_pthread.h"
31 #else
32 #error "unsupported thread type"
33 #endif
34
35 #ifndef ENABLE_VM_OBJSPACE
36 #ifdef _WIN32
37 /*
38 * TODO: object space independent st_table.
39 * socklist needs st_table in rb_w32_sysinit(), before object space
40 * initialization.
41 * It is too early now to change st_hash_type, since it breaks binary
42 * compatibility.
43 */
44 #define ENABLE_VM_OBJSPACE 0
45 #else
46 #define ENABLE_VM_OBJSPACE 1
47 #endif
48 #endif
49
50 #include <setjmp.h>
51 #include <signal.h>
52
53 #ifndef NSIG
54 # define NSIG (_SIGMAX + 1) /* For QNX */
55 #endif
56
57 #define RUBY_NSIG NSIG
58
59 #ifdef HAVE_STDARG_PROTOTYPES
60 #include <stdarg.h>
61 #define va_init_list(a,b) va_start((a),(b))
62 #else
63 #include <varargs.h>
64 #define va_init_list(a,b) va_start((a))
65 #endif
66
67 #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
68 #define USE_SIGALTSTACK
69 #endif
70
71 /*****************/
72 /* configuration */
73 /*****************/
74
75 /* gcc ver. check */
76 #if defined(__GNUC__) && __GNUC__ >= 2
77
78 #if OPT_TOKEN_THREADED_CODE
79 #if OPT_DIRECT_THREADED_CODE
80 #undef OPT_DIRECT_THREADED_CODE
81 #endif
82 #endif
83
84 #else /* defined(__GNUC__) && __GNUC__ >= 2 */
85
86 /* disable threaded code options */
87 #if OPT_DIRECT_THREADED_CODE
88 #undef OPT_DIRECT_THREADED_CODE
89 #endif
90 #if OPT_TOKEN_THREADED_CODE
91 #undef OPT_TOKEN_THREADED_CODE
92 #endif
93 #endif
94
95 #ifdef __native_client__
96 #undef OPT_DIRECT_THREADED_CODE
97 #endif
98
99 /* call threaded code */
100 #if OPT_CALL_THREADED_CODE
101 #if OPT_DIRECT_THREADED_CODE
102 #undef OPT_DIRECT_THREADED_CODE
103 #endif /* OPT_DIRECT_THREADED_CODE */
104 #if OPT_STACK_CACHING
105 #undef OPT_STACK_CACHING
106 #endif /* OPT_STACK_CACHING */
107 #endif /* OPT_CALL_THREADED_CODE */
108
109 /* likely */
110 #if __GNUC__ >= 3
111 #define LIKELY(x) (__builtin_expect((x), 1))
112 #define UNLIKELY(x) (__builtin_expect((x), 0))
113 #else /* __GNUC__ >= 3 */
114 #define LIKELY(x) (x)
115 #define UNLIKELY(x) (x)
116 #endif /* __GNUC__ >= 3 */
117
118 #if __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
128 struct iseq_compile_data_ensure_node_stack;
129
130 typedef struct rb_compile_option_struct rb_compile_option_t;
131
132 struct iseq_inline_cache_entry {
133 VALUE ic_vmstat;
134 VALUE ic_class;
135 union {
136 VALUE value;
137 long index;
138 } ic_value;
139 };
140
141 /* to avoid warning */
142 struct rb_thread_struct;
143 struct rb_control_frame_struct;
144
145 /* rb_call_info_t contains calling information including inline cache */
146 typedef struct rb_call_info_struct {
147 /* fixed at compile time */
148 ID mid;
149 VALUE flag;
150 int orig_argc;
151 rb_iseq_t *blockiseq;
152
153 /* inline cache: keys */
154 VALUE vmstat;
155 VALUE klass;
156
157 /* inline cache: values */
158 const rb_method_entry_t *me;
159 VALUE defined_class;
160
161 /* temporary values for method calling */
162 int argc;
163 struct rb_block_struct *blockptr;
164 VALUE recv;
165 union {
166 int opt_pc; /* used by iseq */
167 long index; /* used by ivar */
168 int missing_reason; /* used by method_missing */
169 int inc_sp; /* used by cfunc */
170 } aux;
171
172 VALUE (*call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci);
173 } rb_call_info_t;
174
175 #if 1
176 #define GetCoreDataFromValue(obj, type, ptr) do { \
177 (ptr) = (type*)DATA_PTR(obj); \
178 } while (0)
179 #else
180 #define GetCoreDataFromValue(obj, type, ptr) Data_Get_Struct((obj), type, (ptr))
181 #endif
182
183 #define GetISeqPtr(obj, ptr) \
184 GetCoreDataFromValue((obj), rb_iseq_t, (ptr))
185
186 typedef struct rb_iseq_location_struct {
187 VALUE path;
188 VALUE absolute_path;
189 VALUE base_label;
190 VALUE label;
191 size_t first_lineno;
192 } rb_iseq_location_t;
193
194 struct rb_iseq_struct;
195
196 struct rb_iseq_struct {
197 /***************/
198 /* static data */
199 /***************/
200
201 enum iseq_type {
202 ISEQ_TYPE_TOP,
203 ISEQ_TYPE_METHOD,
204 ISEQ_TYPE_BLOCK,
205 ISEQ_TYPE_CLASS,
206 ISEQ_TYPE_RESCUE,
207 ISEQ_TYPE_ENSURE,
208 ISEQ_TYPE_EVAL,
209 ISEQ_TYPE_MAIN,
210 ISEQ_TYPE_DEFINED_GUARD
211 } type; /* instruction sequence type */
212
213 rb_iseq_location_t location;
214
215 VALUE *iseq; /* iseq (insn number and operands) */
216 VALUE *iseq_encoded; /* encoded iseq */
217 unsigned long iseq_size;
218 VALUE mark_ary; /* Array: includes operands which should be GC marked */
219 VALUE coverage; /* coverage array */
220
221 /* insn info, must be freed */
222 struct iseq_line_info_entry *line_info_table;
223 size_t line_info_size;
224
225 ID *local_table; /* must free */
226 int local_table_size;
227
228 /* sizeof(vars) + 1 */
229 int local_size;
230
231 struct iseq_inline_cache_entry *ic_entries;
232 int ic_size;
233
234 rb_call_info_t *callinfo_entries;
235 int callinfo_size;
236
264 int argc;
265 int arg_simple;
266 int arg_rest;
267 int arg_block;
268 int arg_opts;
269 int arg_post_len;
270 int arg_post_start;
271 int arg_size;
272 VALUE *arg_opt_table;
273 int arg_keyword;
274 int arg_keyword_check; /* if this is true, raise an ArgumentError when unknown keyword argument is passed */
275 int arg_keywords;
276 ID *arg_keyword_table;
277
278 size_t stack_max; /* for stack overflow check */
279
280 /* catch table */
281 struct iseq_catch_table_entry *catch_table;
282 int catch_table_size;
283
284 /* for child iseq */
285 struct rb_iseq_struct *parent_iseq;
286 struct rb_iseq_struct *local_iseq;
287
288 /****************/
289 /* dynamic data */
290 /****************/
291
292 VALUE self;
293 VALUE orig; /* non-NULL if its data have origin */
294
295 /* block inlining */
296 /*
297 * NODE *node;
298 * void *special_block_builder;
299 * void *cached_special_block_builder;
300 * VALUE cached_special_block;
301 */
302
303 /* klass/module nest information stack (cref) */
304 NODE *cref_stack;
305 VALUE klass;
306
307 /* misc */
308 ID defined_method_id; /* for define_method */
309 rb_num_t flip_cnt;
310
311 /* used at compile time */
312 struct iseq_compile_data *compile_data;
313 };
314
315 enum ruby_special_exceptions {
316 ruby_error_reenter,
317 ruby_error_nomemory,
318 ruby_error_sysstack,
319 ruby_error_closed_stream,
320 ruby_special_error_count
321 };
322
323 #define GetVMPtr(obj, ptr) \
324 GetCoreDataFromValue((obj), rb_vm_t, (ptr))
325
326 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
327 struct rb_objspace;
328 void rb_objspace_free(struct rb_objspace *);
329 #endif
330
331 typedef struct rb_hook_list_struct {
332 struct rb_event_hook_struct *hooks;
333 rb_event_flag_t events;
334 int need_clean;
335 } rb_hook_list_t;
336
337 typedef struct rb_vm_struct {
338 VALUE self;
339
340 rb_global_vm_lock_t gvl;
341 rb_thread_lock_t thread_destruct_lock;
342
343 struct rb_thread_struct *main_thread;
344 struct rb_thread_struct *running_thread;
345
346 st_table *living_threads;
347 VALUE thgroup_default;
348
349 int running;
350 int thread_abort_on_exception;
351 int trace_running;
352 volatile int sleeper;
353
354 /* object management */
355 VALUE mark_object_ary;
356
357 VALUE special_exceptions[ruby_special_error_count];
358
359 /* load */
360 VALUE top_self;
361 VALUE load_path;
362 VALUE load_path_snapshot;
363 VALUE load_path_check_cache;
364 VALUE expanded_load_path;
365 VALUE loaded_features;
366 VALUE loaded_features_snapshot;
367 struct st_table *loaded_features_index;
368 struct st_table *loading_table;
369
370 /* signal */
371 struct {
372 VALUE cmd;
373 int safe;
374 } trap_list[RUBY_NSIG];
375
376 /* hook */
377 rb_hook_list_t event_hooks;
378
379 int src_encoding_index;
380
381 VALUE verbose, debug, progname;
382 VALUE coverages;
383
384 struct unlinked_method_entry_list_entry *unlinked_method_entry_list;
385
386 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
387 struct rb_objspace *objspace;
388 #endif
389
390 /*
391 * @shyouhei notes that this is not for storing normal Ruby
392 * objects so do *NOT* mark this when you GC.
393 */
394 struct RArray at_exit;
395
396 VALUE *defined_strings;
397
398 /* params */
399 struct { /* size in byte */
400 size_t thread_vm_stack_size;
401 size_t thread_machine_stack_size;
402 size_t fiber_vm_stack_size;
403 size_t fiber_machine_stack_size;
404 } default_params;
405 } rb_vm_t;
406
407 /* default values */
408
409 #define RUBY_VM_SIZE_ALIGN 4096
410
411 #define RUBY_VM_THREAD_VM_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
412 #define RUBY_VM_THREAD_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
413 #define RUBY_VM_THREAD_MACHINE_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
414 #define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
415
416 #define RUBY_VM_FIBER_VM_STACK_SIZE ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
417 #define RUBY_VM_FIBER_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
418 #define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */
419 #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
420
421 #ifndef VM_DEBUG_BP_CHECK
422 #define VM_DEBUG_BP_CHECK 0
423 #endif
424
425 typedef struct rb_control_frame_struct {
426 VALUE *pc; /* cfp[0] */
427 VALUE *sp; /* cfp[1] */
428 rb_iseq_t *iseq; /* cfp[2] */
429 VALUE flag; /* cfp[3] */
430 VALUE self; /* cfp[4] / block[0] */
431 VALUE klass; /* cfp[5] / block[1] */
432 VALUE *ep; /* cfp[6] / block[2] */
433 rb_iseq_t *block_iseq; /* cfp[7] / block[3] */
434 VALUE proc; /* cfp[8] / block[4] */
435 const rb_method_entry_t *me;/* cfp[9] */
436
437 #if VM_DEBUG_BP_CHECK
438 VALUE *bp_check; /* cfp[10] */
439 #endif
440 } rb_control_frame_t;
441
442 typedef struct rb_block_struct {
443 VALUE self; /* share with method frame if it's only block */
444 VALUE klass; /* share with method frame if it's only block */
445 VALUE *ep; /* share with method frame if it's only block */
446 rb_iseq_t *iseq;
447 VALUE proc;
448 } rb_block_t;
449
450 extern const rb_data_type_t ruby_threadptr_data_type;
451
452 #define GetThreadPtr(obj, ptr) \
453 TypedData_Get_Struct((obj), rb_thread_t, &ruby_threadptr_data_type, (ptr))
454
455 enum rb_thread_status {
456 THREAD_RUNNABLE,
457 THREAD_STOPPED,
458 THREAD_STOPPED_FOREVER,
459 THREAD_KILLED
460 };
461
462 typedef RUBY_JMP_BUF rb_jmpbuf_t;
463
464 /*
465 the members which are written in TH_PUSH_TAG() should be placed at
466 the beginning and the end, so that entire region is accessible.
467 */
468 struct rb_vm_tag {
469 VALUE tag;
470 VALUE retval;
471 rb_jmpbuf_t buf;
472 struct rb_vm_tag *prev;
473 };
474
475 struct rb_vm_protect_tag {
476 struct rb_vm_protect_tag *prev;
477 };
478
479 struct rb_unblock_callback {
480 rb_unblock_function_t *func;
481 void *arg;
482 };
483
484 struct rb_mutex_struct;
485
486 struct rb_thread_struct;
487 typedef struct rb_thread_list_struct{
488 struct rb_thread_list_struct *next;
489 struct rb_thread_struct *th;
490 } rb_thread_list_t;
491
492
493 typedef struct rb_thread_struct {
494 VALUE self;
495 rb_vm_t *vm;
496
497 /* execution information */
498 VALUE *stack; /* must free, must mark */
499 size_t stack_size; /* size in word (byte size / sizeof(VALUE)) */
500 rb_control_frame_t *cfp;
501 int safe_level;
502 int raised_flag;
503 VALUE last_status; /* $? */
504
505 /* passing state */
506 int state;
507
508 int waiting_fd;
509
510 /* for rb_iterate */
511 const rb_block_t *passed_block;
512
513 /* for bmethod */
514 const rb_method_entry_t *passed_me;
515
516 /* for cfunc */
517 rb_call_info_t *passed_ci;
518
519 /* for load(true) */
520 VALUE top_self;
521 VALUE top_wrapper;
522
523 /* eval env */
524 rb_block_t *base_block;
525
526 VALUE *root_lep;
527 VALUE root_svar;
528
529 /* thread control */
530 rb_thread_id_t thread_id;
531 enum rb_thread_status status;
532 int to_kill;
533 int priority;
534
535 native_thread_data_t native_thread_data;
536 void *blocking_region_buffer;
537
538 VALUE thgroup;
539 VALUE value;
540
541 /* temporary place of errinfo */
542 VALUE errinfo;
543
544 /* temporary place of retval on OPT_CALL_THREADED_CODE */
545 #if OPT_CALL_THREADED_CODE
546 VALUE retval;
547 #endif
548
549 /* async errinfo queue */
550 VALUE pending_interrupt_queue;
551 int pending_interrupt_queue_checked;
552 VALUE pending_interrupt_mask_stack;
553
554 rb_atomic_t interrupt_flag;
555 unsigned long interrupt_mask;
556 rb_thread_lock_t interrupt_lock;
557 struct rb_unblock_callback unblock;
558 VALUE locking_mutex;
559 struct rb_mutex_struct *keeping_mutexes;
560
561 struct rb_vm_tag *tag;
562 struct rb_vm_protect_tag *protect_tag;
563
570 int parse_in_eval;
571
576 int mild_compile_error;
577
578 /* storage */
579 st_table *local_storage;
580
581 rb_thread_list_t *join_list;
582
583 VALUE first_proc;
584 VALUE first_args;
585 VALUE (*first_func)(ANYARGS);
586
587 /* for GC */
588 VALUE *machine_stack_start;
589 VALUE *machine_stack_end;
590 size_t machine_stack_maxsize;
591 #ifdef __ia64
592 VALUE *machine_register_stack_start;
593 VALUE *machine_register_stack_end;
594 size_t machine_register_stack_maxsize;
595 #endif
596 jmp_buf machine_regs;
597 int mark_stack_len;
598
599 /* statistics data for profiler */
600 VALUE stat_insn_usage;
601
602 /* tracer */
603 rb_hook_list_t event_hooks;
604 struct rb_trace_arg_struct *trace_arg; /* trace information */
605
606 /* fiber */
607 VALUE fiber;
608 VALUE root_fiber;
609 rb_jmpbuf_t root_jmpbuf;
610
611 /* misc */
612 int method_missing_reason;
613 int abort_on_exception;
614 #ifdef USE_SIGALTSTACK
615 void *altstack;
616 #endif
617 unsigned long running_time_us;
618 } rb_thread_t;
619
620 typedef enum {
621 VM_DEFINECLASS_TYPE_CLASS = 0x00,
622 VM_DEFINECLASS_TYPE_SINGLETON_CLASS = 0x01,
623 VM_DEFINECLASS_TYPE_MODULE = 0x02,
624 /* 0x03..0x06 is reserved */
625 VM_DEFINECLASS_TYPE_MASK = 0x07,
626 } rb_vm_defineclass_type_t;
627
628 #define VM_DEFINECLASS_TYPE(x) ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK)
629 #define VM_DEFINECLASS_FLAG_SCOPED 0x08
630 #define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS 0x10
631 #define VM_DEFINECLASS_SCOPED_P(x) ((x) & VM_DEFINECLASS_FLAG_SCOPED)
632 #define VM_DEFINECLASS_HAS_SUPERCLASS_P(x) \
633 ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS)
634
635 /* iseq.c */
636 #if defined __GNUC__ && __GNUC__ >= 4
637 #pragma GCC visibility push(default)
638 #endif
639
640 /* node -> iseq */
641 VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE, enum iseq_type);
642 VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent);
643 VALUE rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path);
644 VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, VALUE);
645 VALUE rb_iseq_new_with_opt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, const rb_compile_option_t*);
646
647 /* src -> iseq */
648 VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line);
649 VALUE rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_block);
650 VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt);
651
652 VALUE rb_iseq_disasm(VALUE self);
653 int rb_iseq_disasm_insn(VALUE str, VALUE *iseqval, size_t pos, rb_iseq_t *iseq, VALUE child);
654 const char *ruby_node_name(int node);
655 int rb_iseq_first_lineno(const rb_iseq_t *iseq);
656
657 RUBY_EXTERN VALUE rb_cISeq;
658 RUBY_EXTERN VALUE rb_cRubyVM;
659 RUBY_EXTERN VALUE rb_cEnv;
660 RUBY_EXTERN VALUE rb_mRubyVMFrozenCore;
661 #if defined __GNUC__ && __GNUC__ >= 4
662 #pragma GCC visibility pop
663 #endif
664
665 #define GetProcPtr(obj, ptr) \
666 GetCoreDataFromValue((obj), rb_proc_t, (ptr))
667
668 typedef struct {
669 rb_block_t block;
670
671 VALUE envval; /* for GC mark */
672 VALUE blockprocval;
673 int safe_level;
674 int is_from_method;
675 int is_lambda;
676 } rb_proc_t;
677
678 #define GetEnvPtr(obj, ptr) \
679 GetCoreDataFromValue((obj), rb_env_t, (ptr))
680
681 typedef struct {
682 VALUE *env;
683 int env_size;
684 int local_size;
685 VALUE prev_envval; /* for GC mark */
686 rb_block_t block;
687 } rb_env_t;
688
689 #define GetBindingPtr(obj, ptr) \
690 GetCoreDataFromValue((obj), rb_binding_t, (ptr))
691
692 typedef struct {
693 VALUE env;
694 VALUE path;
695 unsigned short first_lineno;
696 } rb_binding_t;
697
698 /* used by compile time and send insn */
699
700 enum vm_check_match_type {
701 VM_CHECKMATCH_TYPE_WHEN = 1,
702 VM_CHECKMATCH_TYPE_CASE = 2,
703 VM_CHECKMATCH_TYPE_RESCUE = 3
704 };
705
706 #define VM_CHECKMATCH_TYPE_MASK 0x03
707 #define VM_CHECKMATCH_ARRAY 0x04
708
709 #define VM_CALL_ARGS_SPLAT (0x01 << 1) /* m(*args) */
710 #define VM_CALL_ARGS_BLOCKARG (0x01 << 2) /* m(&block) */
711 #define VM_CALL_FCALL (0x01 << 3) /* m(...) */
712 #define VM_CALL_VCALL (0x01 << 4) /* m */
713 #define VM_CALL_TAILCALL (0x01 << 5) /* located at tail position */
714 #define VM_CALL_SUPER (0x01 << 6) /* super */
715 #define VM_CALL_OPT_SEND (0x01 << 7) /* internal flag */
716 #define VM_CALL_ARGS_SKIP_SETUP (0x01 << 8) /* (flag & (SPLAT|BLOCKARG)) && blockiseq == 0 */
717
718 enum vm_special_object_type {
719 VM_SPECIAL_OBJECT_VMCORE = 1,
720 VM_SPECIAL_OBJECT_CBASE,
721 VM_SPECIAL_OBJECT_CONST_BASE
722 };
723
724 #define VM_FRAME_MAGIC_METHOD 0x11
725 #define VM_FRAME_MAGIC_BLOCK 0x21
726 #define VM_FRAME_MAGIC_CLASS 0x31
727 #define VM_FRAME_MAGIC_TOP 0x41
728 #define VM_FRAME_MAGIC_CFUNC 0x61
729 #define VM_FRAME_MAGIC_PROC 0x71
730 #define VM_FRAME_MAGIC_IFUNC 0x81
731 #define VM_FRAME_MAGIC_EVAL 0x91
732 #define VM_FRAME_MAGIC_LAMBDA 0xa1
733 #define VM_FRAME_MAGIC_MASK_BITS 8
734 #define VM_FRAME_MAGIC_MASK (~(~0<<VM_FRAME_MAGIC_MASK_BITS))
735
736 #define VM_FRAME_TYPE(cfp) ((cfp)->flag & VM_FRAME_MAGIC_MASK)
737
738 /* other frame flag */
739 #define VM_FRAME_FLAG_PASSED 0x0100
740 #define VM_FRAME_FLAG_FINISH 0x0200
741 #define VM_FRAME_TYPE_FINISH_P(cfp) (((cfp)->flag & VM_FRAME_FLAG_FINISH) != 0)
742
743 #define RUBYVM_CFUNC_FRAME_P(cfp) \
744 (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
745
746 /* inline cache */
747 typedef struct iseq_inline_cache_entry *IC;
748 typedef rb_call_info_t *CALL_INFO;
749
750 void rb_vm_change_state(void);
751
752 typedef VALUE CDHASH;
753
754 #ifndef FUNC_FASTCALL
755 #define FUNC_FASTCALL(x) x
756 #endif
757
758 typedef rb_control_frame_t *
759 (FUNC_FASTCALL(*rb_insn_func_t))(rb_thread_t *, rb_control_frame_t *);
760
761 #define GC_GUARDED_PTR(p) ((VALUE)((VALUE)(p) | 0x01))
762 #define GC_GUARDED_PTR_REF(p) ((void *)(((VALUE)(p)) & ~0x03))
763 #define GC_GUARDED_PTR_P(p) (((VALUE)(p)) & 0x01)
764
765 /*
766 * block frame:
767 * ep[ 0]: prev frame
768 * ep[-1]: CREF (for *_eval)
769 *
770 * method frame:
771 * ep[ 0]: block pointer (ptr | VM_ENVVAL_BLOCK_PTR_FLAG)
772 */
773
774 #define VM_ENVVAL_BLOCK_PTR_FLAG 0x02
775 #define VM_ENVVAL_BLOCK_PTR(v) (GC_GUARDED_PTR(v) | VM_ENVVAL_BLOCK_PTR_FLAG)
776 #define VM_ENVVAL_BLOCK_PTR_P(v) ((v) & VM_ENVVAL_BLOCK_PTR_FLAG)
777 #define VM_ENVVAL_PREV_EP_PTR(v) ((VALUE)GC_GUARDED_PTR(v))
778 #define VM_ENVVAL_PREV_EP_PTR_P(v) (!(VM_ENVVAL_BLOCK_PTR_P(v)))
779
780 #define VM_EP_PREV_EP(ep) ((VALUE *)GC_GUARDED_PTR_REF((ep)[0]))
781 #define VM_EP_BLOCK_PTR(ep) ((rb_block_t *)GC_GUARDED_PTR_REF((ep)[0]))
782 #define VM_EP_LEP_P(ep) VM_ENVVAL_BLOCK_PTR_P((ep)[0])
783
784 VALUE *rb_vm_ep_local_ep(VALUE *ep);
785 rb_block_t *rb_vm_control_frame_block_ptr(rb_control_frame_t *cfp);
786
787 #define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) ((cfp)+1)
788 #define RUBY_VM_NEXT_CONTROL_FRAME(cfp) ((cfp)-1)
789 #define RUBY_VM_END_CONTROL_FRAME(th) \
790 ((rb_control_frame_t *)((th)->stack + (th)->stack_size))
791 #define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \
792 ((void *)(ecfp) > (void *)(cfp))
793 #define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp) \
794 (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th)))
795
796 #define RUBY_VM_IFUNC_P(ptr) (BUILTIN_TYPE(ptr) == T_NODE)
797 #define RUBY_VM_NORMAL_ISEQ_P(ptr) \
798 ((ptr) && !RUBY_VM_IFUNC_P(ptr))
799
800 #define RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp) ((rb_block_t *)(&(cfp)->self))
801 #define RUBY_VM_GET_CFP_FROM_BLOCK_PTR(b) \
802 ((rb_control_frame_t *)((VALUE *)(b) - 4))
803 /* magic number `4' is depend on rb_control_frame_t layout. */
804
805 /* VM related object allocate functions */
806 VALUE rb_thread_alloc(VALUE klass);
807 VALUE rb_proc_alloc(VALUE klass);
808
809 /* for debug */
810 extern void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *);
811 extern void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp);
812 extern void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp);
813
814 #define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)
815 #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))
816 void rb_vm_bugreport(void);
817
818 /* functions about thread/vm execution */
819 #if defined __GNUC__ && __GNUC__ >= 4
820 #pragma GCC visibility push(default)
821 #endif
822 VALUE rb_iseq_eval(VALUE iseqval);
823 VALUE rb_iseq_eval_main(VALUE iseqval);
824 #if defined __GNUC__ && __GNUC__ >= 4
825 #pragma GCC visibility pop
826 #endif
827 int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp);
828
829 VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc,
830 int argc, const VALUE *argv, const rb_block_t *blockptr);
831 VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass);
832 VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
833 VALUE rb_binding_new_with_cfp(rb_thread_t *th, const rb_control_frame_t *src_cfp);
834 void rb_vm_inc_const_missing_count(void);
835 void rb_vm_gvl_destroy(rb_vm_t *vm);
836 VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc,
837 const VALUE *argv, const rb_method_entry_t *me,
838 VALUE defined_class);
839 void rb_unlink_method_entry(rb_method_entry_t *me);
840 void rb_gc_mark_unlinked_live_method_entries(void *pvm);
841
842 void rb_thread_start_timer_thread(void);
843 void rb_thread_stop_timer_thread(int);
844 void rb_thread_reset_timer_thread(void);
845 void rb_thread_wakeup_timer_thread(void);
846
847 int ruby_thread_has_gvl_p(void);
848 typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
849 rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp);
850 rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp);
851 int rb_vm_get_sourceline(const rb_control_frame_t *);
852 VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method);
853 void rb_vm_stack_to_heap(rb_thread_t *th);
854 void ruby_thread_init_stack(rb_thread_t *th);
855 int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, VALUE *klassp);
856
857 void rb_gc_mark_machine_stack(rb_thread_t *th);
858
859 int rb_autoloading_value(VALUE mod, ID id, VALUE* value);
860
861 #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
862
863 #define CHECK_VM_STACK_OVERFLOW(cfp, margin) do \
864 if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)(cfp))) { \
865 vm_stackoverflow(); \
866 } \
867 while (0)
868
869 /* for thread */
870
871 #if RUBY_VM_THREAD_MODEL == 2
872 extern rb_thread_t *ruby_current_thread;
873 extern rb_vm_t *ruby_current_vm;
874 extern rb_event_flag_t ruby_vm_event_flags;
875
876 #define GET_VM() ruby_current_vm
877
878 #ifndef OPT_CALL_CFUNC_WITHOUT_FRAME
879 #define OPT_CALL_CFUNC_WITHOUT_FRAME 0
880 #endif
881
882 static inline rb_thread_t *
883 GET_THREAD(void)
884 {
885 rb_thread_t *th = ruby_current_thread;
886 #if OPT_CALL_CFUNC_WITHOUT_FRAME
887 if (UNLIKELY(th->passed_ci != 0)) {
888 void vm_call_cfunc_push_frame(rb_thread_t *th);
889 vm_call_cfunc_push_frame(th);
890 }
891 #endif
892 return th;
893 }
894
895 #define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th))
896 #define rb_thread_set_current(th) do { \
897 if ((th)->vm->running_thread != (th)) { \
898 (th)->running_time_us = 0; \
899 } \
900 rb_thread_set_current_raw(th); \
901 (th)->vm->running_thread = (th); \
902 } while (0)
903
904 #else
905 #error "unsupported thread model"
906 #endif
907
908 enum {
909 TIMER_INTERRUPT_MASK = 0x01,
910 PENDING_INTERRUPT_MASK = 0x02,
911 FINALIZER_INTERRUPT_MASK = 0x04,
912 TRAP_INTERRUPT_MASK = 0x08
913 };
914
915 #define RUBY_VM_SET_TIMER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TIMER_INTERRUPT_MASK)
916 #define RUBY_VM_SET_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, PENDING_INTERRUPT_MASK)
917 #define RUBY_VM_SET_FINALIZER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, FINALIZER_INTERRUPT_MASK)
918 #define RUBY_VM_SET_TRAP_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TRAP_INTERRUPT_MASK)
919 #define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & ~(th)->interrupt_mask & (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
920 #define RUBY_VM_INTERRUPTED_ANY(th) ((th)->interrupt_flag & ~(th)->interrupt_mask)
921
922 int rb_signal_buff_size(void);
923 void rb_signal_exec(rb_thread_t *th, int sig);
924 void rb_threadptr_check_signal(rb_thread_t *mth);
925 void rb_threadptr_signal_raise(rb_thread_t *th, int sig);
926 void rb_threadptr_signal_exit(rb_thread_t *th);
927 void rb_threadptr_execute_interrupts(rb_thread_t *, int);
928 void rb_threadptr_interrupt(rb_thread_t *th);
929 void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th);
930 void rb_threadptr_pending_interrupt_clear(rb_thread_t *th);
931 void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v);
932 int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th);
933
934 void rb_thread_lock_unlock(rb_thread_lock_t *);
935 void rb_thread_lock_destroy(rb_thread_lock_t *);
936
937 #define RUBY_VM_CHECK_INTS_BLOCKING(th) do { \
938 if (UNLIKELY(!rb_threadptr_pending_interrupt_empty_p(th))) { \
939 th->pending_interrupt_queue_checked = 0; \
940 RUBY_VM_SET_INTERRUPT(th); \
941 rb_threadptr_execute_interrupts(th, 1); \
942 } \
943 else if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
944 rb_threadptr_execute_interrupts(th, 1); \
945 } \
946 } while (0)
947
948 #define RUBY_VM_CHECK_INTS(th) do { \
949 if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
950 rb_threadptr_execute_interrupts(th, 0); \
951 } \
952 } while (0)
953
954 /* tracer */
955 struct rb_trace_arg_struct {
956 rb_event_flag_t event;
957 rb_thread_t *th;
958 rb_control_frame_t *cfp;
959 VALUE self;
960 ID id;
961 VALUE klass;
962 VALUE data;
963
964 int klass_solved;
965
966 /* calc from cfp */
967 int lineno;
968 VALUE path;
969 };
970
971 void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg);
972 void rb_threadptr_exec_event_hooks_and_pop_frame(struct rb_trace_arg_struct *trace_arg);
973
974 #define EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, pop_p_) do { \
975 if (UNLIKELY(ruby_vm_event_flags & (flag_))) { \
976 if (((th)->event_hooks.events | (th)->vm->event_hooks.events) & (flag_)) { \
977 struct rb_trace_arg_struct trace_arg; \
978 trace_arg.event = (flag_); \
979 trace_arg.th = (th_); \
980 trace_arg.cfp = (trace_arg.th)->cfp; \
981 trace_arg.self = (self_); \
982 trace_arg.id = (id_); \
983 trace_arg.klass = (klass_); \
984 trace_arg.data = (data_); \
985 trace_arg.path = Qundef; \
986 trace_arg.klass_solved = 0; \
987 if (pop_p_) rb_threadptr_exec_event_hooks_and_pop_frame(&trace_arg); \
988 else rb_threadptr_exec_event_hooks(&trace_arg); \
989 } \
990 } \
991 } while (0)
992
993 #define EXEC_EVENT_HOOK(th_, flag_, self_, id_, klass_, data_) \
994 EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 0)
995
996 #define EXEC_EVENT_HOOK_AND_POP_FRAME(th_, flag_, self_, id_, klass_, data_) \
997 EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 1)
998
999 #if defined __GNUC__ && __GNUC__ >= 4
1000 #pragma GCC visibility push(default)
1001 #endif
1002
1003 int rb_thread_check_trap_pending(void);
1004
1005 extern VALUE rb_get_coverages(void);
1006 extern void rb_set_coverages(VALUE);
1007 extern void rb_reset_coverages(void);
1008
1009 #if defined __GNUC__ && __GNUC__ >= 4
1010 #pragma GCC visibility pop
1011 #endif
1012
1013 #endif /* RUBY_VM_CORE_H */
rb_thread_struct::passed_block
const rb_block_t * passed_block
Definition: vm_core.h:511
rb_proc_t::is_from_method
int is_from_method
Definition: vm_core.h:674
rb_iseq_struct::ISEQ_TYPE_MAIN
Definition: vm_core.h:209
rb_thread_struct::cfp
rb_control_frame_t * cfp
Definition: vm_core.h:500
rb_threadptr_unlock_all_locking_mutexes
void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
Definition: thread.c:390
rb_thread_struct::join_list
rb_thread_list_t * join_list
Definition: vm_core.h:581
rb_trace_arg_struct::klass
VALUE klass
Definition: vm_core.h:961
rb_call_info_struct::blockptr
struct rb_block_struct * blockptr
Definition: vm_core.h:163
rb_iseq_disasm_insn
int rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, size_t pos, rb_iseq_t *iseqdat, VALUE child)
Disassemble a instruction Iseq -&gt; Iseq inspect object.
Definition: iseq.c:1262
rb_env_t::env
VALUE * env
Definition: vm_core.h:682
rb_iseq_struct::arg_simple
int arg_simple
Definition: vm_core.h:265
rb_thread_struct::running_time_us
unsigned long running_time_us
Definition: vm_core.h:617
rb_thread_struct::vm
rb_vm_t * vm
Definition: vm_core.h:495
rb_hook_list_struct::need_clean
int need_clean
Definition: vm_core.h:334
rb_vm_struct::expanded_load_path
VALUE expanded_load_path
Definition: vm_core.h:364
block
int register char * block
Definition: crypt.c:949
rb_env_t::prev_envval
VALUE prev_envval
Definition: vm_core.h:685
iseq_inline_cache_entry::ic_class
VALUE ic_class
Definition: vm_core.h:134
rb_proc_alloc
VALUE rb_proc_alloc(VALUE klass)
Definition: proc.c:84
rb_call_info_struct::mid
ID mid
Definition: vm_core.h:148
rb_thread_check_trap_pending
int rb_thread_check_trap_pending()
Definition: thread.c:1100
ruby_thread_has_gvl_p
int ruby_thread_has_gvl_p(void)
Definition: thread.c:1443
rb_get_coverages
VALUE rb_get_coverages(void)
Definition: thread.c:5162
rb_thread_struct::root_lep
VALUE * root_lep
Definition: vm_core.h:526
rb_vm_struct::at_exit
struct RArray at_exit
Definition: vm_core.h:394
rb_vm_get_binding_creatable_next_cfp
rb_control_frame_t * rb_vm_get_binding_creatable_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp)
Definition: vm.c:189
rb_iseq_struct::arg_rest
int arg_rest
Definition: vm_core.h:266
rb_thread_struct::protect_tag
struct rb_vm_protect_tag * protect_tag
Definition: vm_core.h:562
th
static VALUE VALUE th
Definition: tcltklib.c:2948
rb_vm_struct::running_thread
struct rb_thread_struct * running_thread
Definition: vm_core.h:344
rb_iseq_new
VALUE rb_iseq_new(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent, enum iseq_type type)
Definition: iseq.c:410
rb_objspace_free
void rb_objspace_free(rb_objspace_t *objspace)
Definition: gc.c:389
rb_vm_get_sourceline
int rb_vm_get_sourceline(const rb_control_frame_t *cfp)
Definition: vm_backtrace.c:33
st_table
Definition: ripper.y:77
rb_vm_struct::cmd
VALUE cmd
Definition: vm_core.h:372
rb_thread_struct::local_storage
st_table * local_storage
Definition: vm_core.h:579
rb_thread_lock_unlock
void rb_thread_lock_unlock(rb_thread_lock_t *lock)
Definition: thread.c:281
rb_thread_struct::pending_interrupt_queue_checked
int pending_interrupt_queue_checked
Definition: vm_core.h:551
rb_iseq_struct::arg_keyword_table
ID * arg_keyword_table
Definition: vm_core.h:276
rb_control_frame_struct::klass
VALUE klass
Definition: vm_core.h:431
node.h
rb_threadptr_execute_interrupts
void rb_threadptr_execute_interrupts(rb_thread_t *th, int blocking_timing)
Definition: thread.c:1891
rb_thread_struct::passed_me
const rb_method_entry_t * passed_me
Definition: vm_core.h:514
ruby.h
rb_mutex_struct
Definition: thread.c:376
rb_thread_struct::interrupt_lock
rb_thread_lock_t interrupt_lock
Definition: vm_core.h:556
rb_vm_struct::top_self
VALUE top_self
Definition: vm_core.h:360
rb_thread_lock_t
pthread_mutex_t rb_thread_lock_t
Definition: thread_pthread.h:19
rb_vm_struct::thread_destruct_lock
rb_thread_lock_t thread_destruct_lock
Definition: vm_core.h:341
method.h
rb_env_t::block
rb_block_t block
Definition: vm_core.h:686
rb_vm_struct::progname
VALUE progname
Definition: vm_core.h:381
proc
VALUE proc
Definition: tcltklib.c:2959
rb_thread_list_struct::th
struct rb_thread_struct * th
Definition: vm_core.h:489
rb_call_info_struct::klass
VALUE klass
Definition: vm_core.h:155
rb_unblock_callback::func
rb_unblock_function_t * func
Definition: vm_core.h:480
rb_iseq_struct::ISEQ_TYPE_ENSURE
Definition: vm_core.h:207
ruby_error_reenter
Definition: vm_core.h:316
rb_iseq_struct::compile_data
struct iseq_compile_data * compile_data
Definition: vm_core.h:312
rb_event_hook_struct
Definition: vm_trace.c:34
rb_vm_struct::loaded_features_index
struct st_table * loaded_features_index
Definition: vm_core.h:367
vm_check_match_type
vm_check_match_type
Definition: vm_core.h:700
rb_block_struct::iseq
rb_iseq_t * iseq
Definition: vm_core.h:446
ruby_error_sysstack
Definition: vm_core.h:318
rb_thread_struct::pending_interrupt_mask_stack
VALUE pending_interrupt_mask_stack
Definition: vm_core.h:552
TIMER_INTERRUPT_MASK
Definition: vm_core.h:909
rb_iseq_struct::coverage
VALUE coverage
Definition: vm_core.h:219
rb_call_info_struct::flag
VALUE flag
Definition: vm_core.h:149
rb_vm_struct::defined_strings
VALUE * defined_strings
Definition: vm_core.h:396
rb_threadptr_signal_raise
void rb_threadptr_signal_raise(rb_thread_t *th, int sig)
Definition: thread.c:2007
rb_iseq_struct::callinfo_entries
rb_call_info_t * callinfo_entries
Definition: vm_core.h:234
rb_env_t::env_size
int env_size
Definition: vm_core.h:683
VM_SPECIAL_OBJECT_CBASE
Definition: vm_core.h:720
rb_block_struct
Definition: vm_core.h:442
rb_trace_arg_struct::th
rb_thread_t * th
Definition: vm_core.h:957
rb_vm_struct::mark_object_ary
VALUE mark_object_ary
Definition: vm_core.h:355
rb_name_err_mesg_new
VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method)
Definition: error.c:1027
RUBY_NSIG
#define RUBY_NSIG
Definition: vm_core.h:57
rb_vm_inc_const_missing_count
void rb_vm_inc_const_missing_count(void)
Definition: vm.c:128
VM_SPECIAL_OBJECT_CONST_BASE
Definition: vm_core.h:721
rb_unlink_method_entry
void rb_unlink_method_entry(rb_method_entry_t *me)
Definition: vm_method.c:99
rb_control_frame_struct::sp
VALUE * sp
Definition: vm_core.h:427
rb_iseq_location_struct::path
VALUE path
Definition: vm_core.h:187
rb_thread_struct::waiting_fd
int waiting_fd
Definition: vm_core.h:508
rb_iseq_struct::ISEQ_TYPE_DEFINED_GUARD
Definition: vm_core.h:210
rb_iseq_struct::ISEQ_TYPE_CLASS
Definition: vm_core.h:205
path
gz path
Definition: zlib.c:2279
rb_vm_struct::living_threads
st_table * living_threads
Definition: vm_core.h:346
rb_signal_exec
void rb_signal_exec(rb_thread_t *th, int sig)
Definition: signal.c:712
rb_vm_struct::fiber_machine_stack_size
size_t fiber_machine_stack_size
Definition: vm_core.h:403
rb_call_info_struct::call
VALUE(* call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci)
Definition: vm_core.h:172
rb_iseq_compile_with_option
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
rb_vm_struct::verbose
VALUE verbose
Definition: vm_core.h:381
rb_vm_make_proc
VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass)
Definition: vm.c:574
rb_iseq_struct::local_table_size
int local_table_size
Definition: vm_core.h:226
ruby_special_error_count
Definition: vm_core.h:320
vm_debug.h
rb_hook_list_t
struct rb_hook_list_struct rb_hook_list_t
rb_threadptr_pending_interrupt_enque
void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v)
Definition: thread.c:1495
rb_iseq_struct::local_iseq
struct rb_iseq_struct * local_iseq
Definition: vm_core.h:286
rb_thread_alloc
VALUE rb_thread_alloc(VALUE klass)
Definition: vm.c:2002
rb_vm_protect_tag::prev
struct rb_vm_protect_tag * prev
Definition: vm_core.h:476
thread_pthread.h
rb_iseq_struct::ic_entries
struct iseq_inline_cache_entry * ic_entries
Definition: vm_core.h:231
rb_iseq_location_struct::label
VALUE label
Definition: vm_core.h:190
rb_thread_struct::thgroup
VALUE thgroup
Definition: vm_core.h:538
rb_iseq_struct::stack_max
size_t stack_max
Definition: vm_core.h:278
rb_iseq_struct::arg_keyword
int arg_keyword
Definition: vm_core.h:273
iseq_inline_cache_entry::index
long index
Definition: vm_core.h:137
rb_control_frame_t
struct rb_control_frame_struct rb_control_frame_t
rb_hook_list_struct
Definition: vm_core.h:331
VM_DEFINECLASS_TYPE_CLASS
Definition: vm_core.h:621
rb_thread_struct::last_status
VALUE last_status
Definition: vm_core.h:503
rb_iseq_struct::defined_method_id
ID defined_method_id
Definition: vm_core.h:308
native_thread_data_struct
Definition: thread_pthread.h:28
rb_vm_invoke_proc
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:712
rb_binding_t::env
VALUE env
Definition: vm_core.h:693
rb_thread_list_t
struct rb_thread_list_struct rb_thread_list_t
rb_vm_defineclass_type_t
rb_vm_defineclass_type_t
Definition: vm_core.h:620
rb_vm_change_state
void rb_vm_change_state(void)
Definition: vm.c:103
rb_hook_list_struct::events
rb_event_flag_t events
Definition: vm_core.h:333
rb_thread_struct
Definition: vm_core.h:493
rb_iseq_struct::ISEQ_TYPE_METHOD
Definition: vm_core.h:203
VM_SPECIAL_OBJECT_VMCORE
Definition: vm_core.h:719
rb_iseq_struct::arg_post_len
int arg_post_len
Definition: vm_core.h:269
rb_iseq_struct::ic_size
int ic_size
Definition: vm_core.h:232
rb_vmdebug_stack_dump_raw
void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *)
Definition: vm_dump.c:138
rb_iseq_struct::orig
VALUE orig
Definition: vm_core.h:293
rb_iseq_struct::iseq_type
iseq_type
Definition: vm_core.h:201
rb_thread_struct::value
VALUE value
Definition: vm_core.h:539
iseq_inline_cache_entry::value
VALUE value
Definition: vm_core.h:136
thread_win32.h
rb_thread_start_timer_thread
void rb_thread_start_timer_thread(void)
Definition: thread.c:3782
rb_iseq_eval_main
VALUE rb_iseq_eval_main(VALUE iseqval)
Definition: vm.c:1442
rb_event_flag_t
unsigned long rb_event_flag_t
Definition: ripper.y:1603
rb_vm_call
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:243
rb_proc_t::envval
VALUE envval
Definition: vm_core.h:671
TRAP_INTERRUPT_MASK
Definition: vm_core.h:912
rb_vm_struct::thgroup_default
VALUE thgroup_default
Definition: vm_core.h:347
id.h
RNode
Definition: ripper.y:240
rb_call_info_struct::argc
int argc
Definition: vm_core.h:162
rb_cISeq
VALUE rb_cISeq
Definition: iseq.c:29
rb_thread_struct::first_func
VALUE(* first_func)(ANYARGS)
Definition: vm_core.h:585
rb_thread_id_t
pthread_t rb_thread_id_t
Definition: thread_pthread.h:18
rb_iseq_struct::iseq
VALUE * iseq
Definition: vm_core.h:215
rb_thread_struct::stack
VALUE * stack
Definition: vm_core.h:498
rb_vm_control_frame_id_and_class
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, VALUE *klassp)
Definition: vm.c:1455
rb_iseq_struct::type
enum rb_iseq_struct::iseq_type type
rb_control_frame_struct::proc
VALUE proc
Definition: vm_core.h:434
rb_iseq_location_struct::absolute_path
VALUE absolute_path
Definition: vm_core.h:188
rb_call_info_struct::defined_class
VALUE defined_class
Definition: vm_core.h:159
rb_binding_t::first_lineno
unsigned short first_lineno
Definition: vm_core.h:695
rb_iseq_new_main
VALUE rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path)
Definition: iseq.c:425
rb_iseq_new_top
VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent)
Definition: iseq.c:418
rb_thread_method_id_and_class
int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp)
Definition: vm.c:1483
rb_call_info_struct::missing_reason
int missing_reason
Definition: vm_core.h:168
rb_iseq_struct::cref_stack
NODE * cref_stack
Definition: vm_core.h:304
rb_thread_wakeup_timer_thread
void rb_thread_wakeup_timer_thread(void)
rb_trace_arg_struct::klass_solved
int klass_solved
Definition: vm_core.h:964
rb_vm_struct::src_encoding_index
int src_encoding_index
Definition: vm_core.h:379
rb_vm_struct::trace_running
int trace_running
Definition: vm_core.h:351
ruby_atomic.h
rb_thread_struct::locking_mutex
VALUE locking_mutex
Definition: vm_core.h:558
rb_iseq_first_lineno
int rb_iseq_first_lineno(const rb_iseq_t *iseq)
Definition: iseq.c:1054
rb_vm_get_ruby_level_next_cfp
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp)
Definition: vm.c:201
rb_vm_ep_local_ep
VALUE * rb_vm_ep_local_ep(VALUE *ep)
Definition: vm.c:36
rb_control_frame_struct::block_iseq
rb_iseq_t * block_iseq
Definition: vm_core.h:433
vm_opts.h
rb_call_info_struct::recv
VALUE recv
Definition: vm_core.h:164
THREAD_KILLED
Definition: vm_core.h:459
str
static VALUE char * str
Definition: tcltklib.c:3547
ruby_threadptr_data_type
const rb_data_type_t ruby_threadptr_data_type
Definition: vm.c:1918
rb_vm_struct::fiber_vm_stack_size
size_t fiber_vm_stack_size
Definition: vm_core.h:402
rb_vm_t
struct rb_vm_struct rb_vm_t
rb_iseq_struct::ISEQ_TYPE_BLOCK
Definition: vm_core.h:204
rb_binding_new_with_cfp
VALUE rb_binding_new_with_cfp(rb_thread_t *th, const rb_control_frame_t *src_cfp)
Definition: proc.c:314
rb_thread_struct::blocking_region_buffer
void * blocking_region_buffer
Definition: vm_core.h:536
ID
unsigned long ID
Definition: ripper.y:105
rb_iseq_struct::argc
int argc
argument information
Definition: vm_core.h:264
rb_vm_struct::load_path_check_cache
VALUE load_path_check_cache
Definition: vm_core.h:363
RArray
Definition: ripper.y:881
THREAD_STOPPED_FOREVER
Definition: vm_core.h:458
rb_control_frame_struct::iseq
rb_iseq_t * iseq
Definition: vm_core.h:428
rb_iseq_struct::arg_post_start
int arg_post_start
Definition: vm_core.h:270
rb_threadptr_exec_event_hooks_and_pop_frame
void rb_threadptr_exec_event_hooks_and_pop_frame(struct rb_trace_arg_struct *trace_arg)
Definition: vm_trace.c:332
rb_vm_struct::running
int running
Definition: vm_core.h:349
rb_thread_stop_timer_thread
void rb_thread_stop_timer_thread(int close_anyway)
Definition: thread.c:3768
UNLIKELY
#define UNLIKELY(x)
Definition: vm_core.h:115
rb_trace_arg_struct::cfp
rb_control_frame_t * cfp
Definition: vm_core.h:958
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
rb_thread_struct::machine_regs
jmp_buf machine_regs
Definition: vm_core.h:596
rb_call_info_struct::orig_argc
int orig_argc
Definition: vm_core.h:150
rb_iseq_struct::arg_opt_table
VALUE * arg_opt_table
Definition: vm_core.h:272
rb_vm_tag::tag
VALUE tag
Definition: vm_core.h:469
ANYARGS
#define ANYARGS
signal.h
rb_iseq_struct::arg_keywords
int arg_keywords
Definition: vm_core.h:275
rb_cRubyVM
VALUE rb_cRubyVM
Definition: vm.c:89
rb_threadptr_check_signal
void rb_threadptr_check_signal(rb_thread_t *mth)
Definition: thread.c:3727
rb_thread_struct::top_self
VALUE top_self
Definition: vm_core.h:520
rb_iseq_struct::flip_cnt
rb_num_t flip_cnt
Definition: vm_core.h:309
rb_vm_struct::thread_abort_on_exception
int thread_abort_on_exception
Definition: vm_core.h:350
rb_vm_struct::unlinked_method_entry_list
struct unlinked_method_entry_list_entry * unlinked_method_entry_list
Definition: vm_core.h:384
method
volatile ID method
Definition: tcltklib.c:3599
vm_special_object_type
vm_special_object_type
Definition: vm_core.h:718
rb_vm_struct::loading_table
struct st_table * loading_table
Definition: vm_core.h:368
rb_thread_status
rb_thread_status
Definition: vm_core.h:455
rb_vm_bugreport
void rb_vm_bugreport(void)
Definition: vm_dump.c:609
rb_iseq_location_t
struct rb_iseq_location_struct rb_iseq_location_t
ruby_thread_init_stack
void ruby_thread_init_stack(rb_thread_t *th)
Definition: thread.c:474
rb_method_entry_struct
Definition: method.h:95
rb_vm_protect_tag
Definition: vm_core.h:475
rb_vmdebug_debug_print_pre
void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp)
Definition: vm_dump.c:352
rb_call_info_struct::blockiseq
rb_iseq_t * blockiseq
Definition: vm_core.h:151
rb_objspace
Definition: gc.c:208
rb_thread_struct::base_block
rb_block_t * base_block
Definition: vm_core.h:524
rb_unblock_function_t
void rb_unblock_function_t(void *)
Definition: ripper.y:835
rb_vm_struct::sleeper
volatile int sleeper
Definition: vm_core.h:352
ruby_error_nomemory
Definition: vm_core.h:317
rb_vm_make_env_object
VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp)
Definition: vm.c:495
rb_thread_struct::machine_stack_start
VALUE * machine_stack_start
Definition: vm_core.h:588
VM_DEFINECLASS_TYPE_SINGLETON_CLASS
Definition: vm_core.h:622
rb_vm_struct::default_params
struct rb_vm_struct::@153 default_params
rb_iseq_struct::local_table
ID * local_table
Definition: vm_core.h:225
rb_hook_list_struct::hooks
struct rb_event_hook_struct * hooks
Definition: vm_core.h:332
rb_control_frame_struct
Definition: vm_core.h:425
rb_num_t
unsigned long rb_num_t
Definition: vm_core.h:124
rb_gc_mark_machine_stack
void rb_gc_mark_machine_stack(rb_thread_t *th)
Definition: gc.c:2528
rb_iseq_struct::arg_block
int arg_block
Definition: vm_core.h:267
rb_iseq_struct::arg_opts
int arg_opts
Definition: vm_core.h:268
rb_vm_struct::safe
int safe
Definition: vm_core.h:373
iseq_inline_cache_entry
Definition: vm_core.h:132
argv
VALUE * argv
Definition: tcltklib.c:1971
rb_thread_struct::event_hooks
rb_hook_list_t event_hooks
Definition: vm_core.h:603
iseq_inline_cache_entry::ic_vmstat
VALUE ic_vmstat
Definition: vm_core.h:133
VM_CHECKMATCH_TYPE_CASE
Definition: vm_core.h:702
rb_vm_struct::special_exceptions
VALUE special_exceptions[ruby_special_error_count]
Definition: vm_core.h:357
rb_vm_stack_to_heap
void rb_vm_stack_to_heap(rb_thread_t *th)
Definition: vm.c:553
rb_thread_struct::keeping_mutexes
struct rb_mutex_struct * keeping_mutexes
Definition: vm_core.h:559
rb_iseq_struct::ISEQ_TYPE_EVAL
Definition: vm_core.h:208
value
volatile VALUE value
Definition: tcltklib.c:9442
rb_proc_t
Definition: vm_core.h:668
rb_iseq_struct::mark_ary
VALUE mark_ary
Definition: vm_core.h:218
ruby_error_closed_stream
Definition: vm_core.h:319
rb_vm_struct::loaded_features
VALUE loaded_features
Definition: vm_core.h:365
rb_call_info_struct::opt_pc
int opt_pc
Definition: vm_core.h:166
rb_iseq_location_struct
Definition: vm_core.h:186
rb_thread_list_struct
Definition: vm_core.h:487
rb_trace_arg_struct::id
ID id
Definition: vm_core.h:960
rb_iseq_struct::parent_iseq
struct rb_iseq_struct * parent_iseq
Definition: vm_core.h:285
retval
VALUE retval
Definition: tcltklib.c:7830
rb_vm_struct::thread_vm_stack_size
size_t thread_vm_stack_size
Definition: vm_core.h:400
rb_env_t::local_size
int local_size
Definition: vm_core.h:684
CALL_INFO
rb_call_info_t * CALL_INFO
Definition: vm_core.h:748
rb_cEnv
VALUE rb_cEnv
Definition: vm.c:91
rb_iseq_struct::iseq_encoded
VALUE * iseq_encoded
Definition: vm_core.h:216
rb_autoloading_value
int rb_autoloading_value(VALUE mod, ID id, VALUE *value)
Definition: variable.c:1711
argc
int argc
Definition: tcltklib.c:1970
iseq_compile_data
Definition: iseq.h:82
rb_iseq_eval
VALUE rb_iseq_eval(VALUE iseqval)
Definition: vm.c:1429
rb_thread_struct::to_kill
int to_kill
Definition: vm_core.h:532
rb_jmpbuf_t
RUBY_JMP_BUF rb_jmpbuf_t
Definition: vm_core.h:462
rb_iseq_struct::catch_table_size
int catch_table_size
Definition: vm_core.h:282
iseq_catch_table_entry
Definition: iseq.h:57
rb_vm_struct::main_thread
struct rb_thread_struct * main_thread
Definition: vm_core.h:343
ruby_current_thread
rb_thread_t * ruby_current_thread
Definition: vm.c:96
rb_thread_struct::first_proc
VALUE first_proc
Definition: vm_core.h:583
rb_threadptr_pending_interrupt_clear
void rb_threadptr_pending_interrupt_clear(rb_thread_t *th)
Definition: thread.c:1489
rb_iseq_struct::location
rb_iseq_location_t location
Definition: vm_core.h:213
VM_CHECKMATCH_TYPE_WHEN
Definition: vm_core.h:701
rb_thread_struct::interrupt_flag
rb_atomic_t interrupt_flag
Definition: vm_core.h:554
rb_backtrace_iter_func
int rb_backtrace_iter_func(void *, VALUE, int, VALUE)
Definition: vm_core.h:848
rb_thread_struct::priority
int priority
Definition: vm_core.h:533
rb_thread_struct::raised_flag
int raised_flag
Definition: vm_core.h:502
rb_control_frame_struct::flag
VALUE flag
Definition: vm_core.h:429
rb_iseq_new_with_bopt
VALUE rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno, VALUE parent, enum iseq_type type, VALUE bopt)
Definition: iseq.c:461
rb_thread_struct::abort_on_exception
int abort_on_exception
Definition: vm_core.h:613
rb_proc_t::blockprocval
VALUE blockprocval
Definition: vm_core.h:672
rb_thread_struct::status
enum rb_thread_status status
Definition: vm_core.h:531
ruby_special_exceptions
ruby_special_exceptions
Definition: vm_core.h:315
rb_block_t
struct rb_block_struct rb_block_t
rb_mRubyVMFrozenCore
VALUE rb_mRubyVMFrozenCore
Definition: vm.c:92
rb_iseq_struct::callinfo_size
int callinfo_size
Definition: vm_core.h:235
rb_thread_struct::machine_stack_end
VALUE * machine_stack_end
Definition: vm_core.h:589
src
VALUE src
Definition: tcltklib.c:7953
rb_thread_struct::first_args
VALUE first_args
Definition: vm_core.h:584
rb_vm_tag
Definition: vm_core.h:468
rb_reset_coverages
void rb_reset_coverages(void)
Definition: thread.c:5175
rb_block_struct::proc
VALUE proc
Definition: vm_core.h:447
rb_vm_struct::objspace
struct rb_objspace * objspace
Definition: vm_core.h:387
rb_proc_t::is_lambda
int is_lambda
Definition: vm_core.h:675
rb_thread_struct::top_wrapper
VALUE top_wrapper
Definition: vm_core.h:521
rb_thread_struct::mark_stack_len
int mark_stack_len
Definition: vm_core.h:597
ruby_current_vm
rb_vm_t * ruby_current_vm
Definition: vm.c:97
rb_iseq_struct::arg_size
int arg_size
Definition: vm_core.h:271
rb_proc_t::safe_level
int safe_level
Definition: vm_core.h:673
rb_iseq_struct::arg_keyword_check
int arg_keyword_check
Definition: vm_core.h:274
rb_thread_lock_destroy
void rb_thread_lock_destroy(rb_thread_lock_t *lock)
Definition: thread.c:287
rb_thread_struct::root_svar
VALUE root_svar
Definition: vm_core.h:527
rb_proc_t::block
rb_block_t block
Definition: vm_core.h:669
rb_iseq_struct::klass
VALUE klass
Definition: vm_core.h:305
rb_thread_struct::mild_compile_error
int mild_compile_error
Thread-local state of compiling context.
Definition: vm_core.h:576
rb_control_frame_struct::pc
VALUE * pc
Definition: vm_core.h:426
rb_thread_struct::interrupt_mask
unsigned long interrupt_mask
Definition: vm_core.h:555
rb_iseq_struct::ISEQ_TYPE_RESCUE
Definition: vm_core.h:206
rb_iseq_location_struct::base_label
VALUE base_label
Definition: vm_core.h:189
rb_iseq_struct::line_info_size
size_t line_info_size
Definition: vm_core.h:223
rb_control_frame_struct::me
const rb_method_entry_t * me
Definition: vm_core.h:435
rb_thread_struct::unblock
struct rb_unblock_callback unblock
Definition: vm_core.h:557
rb_data_type_struct
Definition: ripper.y:960
rb_vm_struct::event_hooks
rb_hook_list_t event_hooks
Definition: vm_core.h:377
rb_unblock_callback::arg
void * arg
Definition: vm_core.h:481
FUNC_FASTCALL
#define FUNC_FASTCALL(x)
Definition: vm_core.h:755
rb_trace_arg_struct::path
VALUE path
Definition: vm_core.h:968
ruby_node_name
const char * ruby_node_name(int node)
Definition: iseq.c:1578
rb_call_info_struct
Definition: vm_core.h:146
rb_thread_reset_timer_thread
void rb_thread_reset_timer_thread(void)
Definition: thread.c:3776
rb_iseq_struct::catch_table
struct iseq_catch_table_entry * catch_table
Definition: vm_core.h:281
rb_insn_func_t
rb_control_frame_t *FUNC_FASTCALL rb_insn_func_t(rb_thread_t *, rb_control_frame_t *)
Definition: vm_core.h:759
rb_signal_buff_size
int rb_signal_buff_size(void)
Definition: signal.c:560
rb_iseq_compile_on_base
VALUE rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_block)
Definition: iseq.c:640
rb_iseq_location_struct::first_lineno
size_t first_lineno
Definition: vm_core.h:191
rb_control_frame_struct::ep
VALUE * ep
Definition: vm_core.h:432
rb_trace_arg_struct
Definition: vm_core.h:955
rb_thread_struct::root_fiber
VALUE root_fiber
Definition: vm_core.h:608
klass
klass
Definition: tcltklib.c:3504
rb_iseq_struct::local_size
int local_size
Definition: vm_core.h:229
rb_thread_struct::fiber
VALUE fiber
Definition: vm_core.h:607
ruby_vm_event_flags
rb_event_flag_t ruby_vm_event_flags
Definition: vm.c:98
CDHASH
VALUE CDHASH
Definition: vm_core.h:752
IC
struct iseq_inline_cache_entry * IC
Definition: vm_core.h:747
rb_gc_mark_unlinked_live_method_entries
void rb_gc_mark_unlinked_live_method_entries(void *pvm)
Definition: vm_method.c:108
rb_thread_struct::native_thread_data
native_thread_data_t native_thread_data
Definition: vm_core.h:535
rb_vm_struct::thread_machine_stack_size
size_t thread_machine_stack_size
Definition: vm_core.h:401
rb_vm_struct::load_path_snapshot
VALUE load_path_snapshot
Definition: vm_core.h:362
rb_vm_control_frame_block_ptr
rb_block_t * rb_vm_control_frame_block_ptr(rb_control_frame_t *cfp)
Definition: vm.c:61
rb_iseq_struct::line_info_table
struct iseq_line_info_entry * line_info_table
Definition: vm_core.h:222
rb_binding_t
Definition: vm_core.h:692
rb_call_info_struct::inc_sp
int inc_sp
Definition: vm_core.h:169
rb_iseq_struct::iseq_size
unsigned long iseq_size
Definition: vm_core.h:217
st.h
rb_thread_struct::state
int state
Definition: vm_core.h:506
rb_unblock_callback
Definition: vm_core.h:479
rb_vm_struct::loaded_features_snapshot
VALUE loaded_features_snapshot
Definition: vm_core.h:366
iseq_inline_cache_entry::ic_value
union iseq_inline_cache_entry::@150 ic_value
rb_thread_struct::root_jmpbuf
rb_jmpbuf_t root_jmpbuf
Definition: vm_core.h:609
rb_vm_struct::debug
VALUE debug
Definition: vm_core.h:381
rb_atomic_t
int rb_atomic_t
Definition: ruby_atomic.h:93
RUBY_EXTERN
#define RUBY_EXTERN
Definition: defines.h:188
VM_DEFINECLASS_TYPE_MASK
Definition: vm_core.h:625
rb_trace_arg_struct::lineno
int lineno
Definition: vm_core.h:967
rb_thread_struct::passed_ci
rb_call_info_t * passed_ci
Definition: vm_core.h:517
rb_compile_option_struct
Definition: iseq.h:40
rb_vm_struct::gvl
rb_global_vm_lock_t gvl
Definition: vm_core.h:340
rb_vm_struct
Definition: vm_core.h:337
rb_iseq_struct
Definition: vm_core.h:196
rb_call_info_struct::vmstat
VALUE vmstat
Definition: vm_core.h:154
THREAD_RUNNABLE
Definition: vm_core.h:456
rb_block_struct::klass
VALUE klass
Definition: vm_core.h:444
rb_trace_arg_struct::event
rb_event_flag_t event
Definition: vm_core.h:956
rb_vmdebug_debug_print_post
void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp)
Definition: vm_dump.c:378
rb_thread_struct::safe_level
int safe_level
Definition: vm_core.h:501
rb_vm_tag::buf
rb_jmpbuf_t buf
Definition: vm_core.h:471
rb_thread_struct::stack_size
size_t stack_size
Definition: vm_core.h:499
rb_thread_list_struct::next
struct rb_thread_list_struct * next
Definition: vm_core.h:488
rb_thread_t
struct rb_thread_struct rb_thread_t
rb_thread_struct::tag
struct rb_vm_tag * tag
Definition: vm_core.h:561
rb_vm_tag::prev
struct rb_vm_tag * prev
Definition: vm_core.h:472
VALUE
unsigned long VALUE
Definition: ripper.y:104
rb_vm_gvl_destroy
void rb_vm_gvl_destroy(rb_vm_t *vm)
Definition: thread.c:273
rb_threadptr_pending_interrupt_active_p
int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th)
Definition: thread.c:1604
VM_DEFINECLASS_TYPE_MODULE
Definition: vm_core.h:623
rb_vm_tag::retval
VALUE retval
Definition: vm_core.h:470
rb_call_info_struct::index
long index
Definition: vm_core.h:167
rb_trace_arg_struct::data
VALUE data
Definition: vm_core.h:962
rb_call_info_t
struct rb_call_info_struct rb_call_info_t
rb_vm_struct::load_path
VALUE load_path
Definition: vm_core.h:361
rb_threadptr_exec_event_hooks
void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg)
Definition: vm_trace.c:338
rb_thread_struct::pending_interrupt_queue
VALUE pending_interrupt_queue
Definition: vm_core.h:550
iseq_line_info_entry
Definition: iseq.h:52
v
BDIGIT v
Definition: bigdecimal.c:5656
PENDING_INTERRUPT_MASK
Definition: vm_core.h:910
mod
#define mod(x, y)
Definition: date_strftime.c:28
rb_thread_struct::machine_stack_maxsize
size_t machine_stack_maxsize
Definition: vm_core.h:590
rb_binding_t::path
VALUE path
Definition: vm_core.h:694
name
const char * name
Definition: nkf.c:208
rb_thread_struct::method_missing_reason
int method_missing_reason
Definition: vm_core.h:612
rb_thread_struct::stat_insn_usage
VALUE stat_insn_usage
Definition: vm_core.h:600
rb_thread_struct::errinfo
VALUE errinfo
Definition: vm_core.h:542
rb_threadptr_interrupt
void rb_threadptr_interrupt(rb_thread_t *th)
Definition: thread.c:347
rb_call_info_struct::aux
union rb_call_info_struct::@151 aux
GET_THREAD
static rb_thread_t * GET_THREAD(void)
Definition: vm_core.h:883
rb_global_vm_lock_struct
Definition: thread_pthread.h:40
rb_iseq_disasm
VALUE rb_iseq_disasm(VALUE self)
Definition: iseq.c:1354
rb_set_coverages
void rb_set_coverages(VALUE coverages)
Definition: thread.c:5168
rb_vm_struct::trap_list
struct rb_vm_struct::@152 trap_list[RUBY_NSIG]
rb_thread_struct::trace_arg
struct rb_trace_arg_struct * trace_arg
Definition: vm_core.h:604
rb_vm_struct::coverages
VALUE coverages
Definition: vm_core.h:382
rb_iseq_compile
VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line)
Definition: iseq.c:634
rb_thread_struct::thread_id
rb_thread_id_t thread_id
Definition: vm_core.h:530
unlinked_method_entry_list_entry
Definition: method.h:103
FINALIZER_INTERRUPT_MASK
Definition: vm_core.h:911
rb_iseq_new_with_opt
VALUE rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno, VALUE parent, enum iseq_type type, const rb_compile_option_t *option)
Definition: iseq.c:451
rb_threadptr_signal_exit
void rb_threadptr_signal_exit(rb_thread_t *th)
Definition: thread.c:2017
VM_CHECKMATCH_TYPE_RESCUE
Definition: vm_core.h:703
rb_iseq_struct::ISEQ_TYPE_TOP
Definition: vm_core.h:202
iseq_compile_data_ensure_node_stack
Definition: compile.c:72
rb_call_info_struct::me
const rb_method_entry_t * me
Definition: vm_core.h:158
THREAD_STOPPED
Definition: vm_core.h:457
rb_block_struct::ep
VALUE * ep
Definition: vm_core.h:445
rb_thread_struct::parse_in_eval
int parse_in_eval
Thread-local state of evaluation context.
Definition: vm_core.h:570
rb_env_t
Definition: vm_core.h:681