debase-ruby_core_source 0.10.11 → 0.10.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/addr2line.h +0 -0
  3. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/builtin.h +0 -0
  4. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  5. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/check_type/check_type.h +0 -0
  6. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/container_of/container_of.h +0 -0
  7. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/list/list.h +0 -0
  8. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/str/str.h +0 -0
  9. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/constant.h +0 -0
  10. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/debug_counter.h +38 -4
  11. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/dln.h +0 -0
  12. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/encindex.h +0 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/eval_intern.h +16 -5
  14. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/gc.h +0 -0
  15. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/hrtime.h +0 -0
  16. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/id.h +0 -0
  17. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/id_table.h +0 -0
  18. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/insns.inc +0 -0
  19. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/insns_info.inc +93 -89
  20. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal.h +0 -0
  21. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/array.h +5 -0
  22. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/bignum.h +0 -0
  23. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/bits.h +0 -0
  24. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/class.h +7 -1
  25. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/compar.h +0 -0
  26. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/compile.h +0 -0
  27. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/compilers.h +0 -0
  28. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/complex.h +0 -0
  29. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/cont.h +0 -0
  30. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/dir.h +0 -0
  31. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/enc.h +0 -0
  32. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/encoding.h +0 -0
  33. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/enum.h +0 -0
  34. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/enumerator.h +0 -0
  35. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/error.h +0 -7
  36. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/eval.h +0 -0
  37. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/file.h +0 -0
  38. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/fixnum.h +1 -1
  39. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/gc.h +9 -2
  40. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/hash.h +2 -1
  41. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/imemo.h +0 -0
  42. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/inits.h +0 -0
  43. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/io.h +0 -0
  44. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/load.h +0 -0
  45. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/loadpath.h +0 -0
  46. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/math.h +0 -0
  47. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/missing.h +0 -0
  48. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/numeric.h +4 -1
  49. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/object.h +0 -0
  50. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/parse.h +0 -0
  51. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/proc.h +1 -0
  52. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/process.h +0 -0
  53. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/random.h +0 -0
  54. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/range.h +4 -0
  55. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/rational.h +2 -0
  56. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/re.h +0 -0
  57. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/sanitizers.h +0 -0
  58. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/scheduler.h +9 -0
  59. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/serial.h +0 -0
  60. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/signal.h +0 -0
  61. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/static_assert.h +0 -0
  62. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/string.h +5 -0
  63. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/struct.h +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/symbol.h +0 -0
  65. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/thread.h +0 -6
  66. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/time.h +0 -0
  67. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/transcode.h +0 -0
  68. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/util.h +0 -0
  69. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/variable.h +1 -0
  70. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/vm.h +7 -6
  71. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/warnings.h +0 -0
  72. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/iseq.h +1 -0
  73. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/known_errors.inc +0 -0
  74. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/method.h +0 -0
  75. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/mjit.h +37 -14
  76. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/mjit_compile.inc +715 -557
  77. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/node.h +2 -2
  78. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/node_name.inc +0 -0
  79. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
  80. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/optinsn.inc +0 -0
  81. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/optunifs.inc +0 -0
  82. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/parse.h +0 -0
  83. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/probes_helper.h +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1/ractor.h → ruby-3.0.0-p0/ractor_core.h} +97 -25
  85. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/regenc.h +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/regint.h +0 -0
  87. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/regparse.h +0 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
  89. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ruby_assert.h +0 -0
  90. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
  91. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/siphash.h +0 -0
  92. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/symbol.h +0 -0
  93. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/thread_pthread.h +23 -14
  94. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/thread_win32.h +5 -10
  95. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/timev.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/transcode_data.h +0 -0
  97. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/transient_heap.h +4 -0
  98. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/variable.h +2 -1
  99. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/version.h +3 -3
  100. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm.inc +94 -99
  101. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_call_iseq_optimized.inc +48 -48
  102. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_callinfo.h +2 -3
  103. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_core.h +96 -25
  104. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_debug.h +0 -0
  105. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_exec.h +0 -0
  106. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_insnhelper.h +1 -4
  107. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_opts.h +0 -0
  108. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_sync.h +44 -5
  109. data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vmtc.inc +0 -0
  110. data/lib/debase/ruby_core_source/version.rb +1 -1
  111. metadata +111 -113
  112. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/mjit.h +0 -29
  113. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor_pub.h +0 -50
  114. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/revision.h +0 -2
  115. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_atomic.h +0 -236
@@ -8,171 +8,171 @@
8
8
  */
9
9
 
10
10
  static VALUE
11
- vm_call_iseq_setup_normal_0start_0params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
11
+ vm_call_iseq_setup_normal_0start_0params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
12
12
  {
13
13
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
14
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 0, 0);
14
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 0);
15
15
  }
16
16
 
17
17
  static VALUE
18
- vm_call_iseq_setup_normal_0start_0params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
18
+ vm_call_iseq_setup_normal_0start_0params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
19
19
  {
20
20
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
21
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 0, 1);
21
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 1);
22
22
  }
23
23
 
24
24
  static VALUE
25
- vm_call_iseq_setup_normal_0start_0params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
25
+ vm_call_iseq_setup_normal_0start_0params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
26
26
  {
27
27
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
28
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 0, 2);
28
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 2);
29
29
  }
30
30
 
31
31
  static VALUE
32
- vm_call_iseq_setup_normal_0start_0params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
32
+ vm_call_iseq_setup_normal_0start_0params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
33
33
  {
34
34
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
35
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 0, 3);
35
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 3);
36
36
  }
37
37
 
38
38
  static VALUE
39
- vm_call_iseq_setup_normal_0start_0params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
39
+ vm_call_iseq_setup_normal_0start_0params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
40
40
  {
41
41
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
42
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 0, 4);
42
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 4);
43
43
  }
44
44
 
45
45
  static VALUE
46
- vm_call_iseq_setup_normal_0start_0params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
46
+ vm_call_iseq_setup_normal_0start_0params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
47
47
  {
48
48
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
49
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 0, 5);
49
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 5);
50
50
  }
51
51
 
52
52
  static VALUE
53
- vm_call_iseq_setup_normal_0start_1params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
53
+ vm_call_iseq_setup_normal_0start_1params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
54
54
  {
55
55
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
56
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 1, 0);
56
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 0);
57
57
  }
58
58
 
59
59
  static VALUE
60
- vm_call_iseq_setup_normal_0start_1params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
60
+ vm_call_iseq_setup_normal_0start_1params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
61
61
  {
62
62
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
63
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 1, 1);
63
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 1);
64
64
  }
65
65
 
66
66
  static VALUE
67
- vm_call_iseq_setup_normal_0start_1params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
67
+ vm_call_iseq_setup_normal_0start_1params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
68
68
  {
69
69
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
70
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 1, 2);
70
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 2);
71
71
  }
72
72
 
73
73
  static VALUE
74
- vm_call_iseq_setup_normal_0start_1params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
74
+ vm_call_iseq_setup_normal_0start_1params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
75
75
  {
76
76
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
77
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 1, 3);
77
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 3);
78
78
  }
79
79
 
80
80
  static VALUE
81
- vm_call_iseq_setup_normal_0start_1params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
81
+ vm_call_iseq_setup_normal_0start_1params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
82
82
  {
83
83
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
84
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 1, 4);
84
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 4);
85
85
  }
86
86
 
87
87
  static VALUE
88
- vm_call_iseq_setup_normal_0start_1params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
88
+ vm_call_iseq_setup_normal_0start_1params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
89
89
  {
90
90
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
91
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 1, 5);
91
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 5);
92
92
  }
93
93
 
94
94
  static VALUE
95
- vm_call_iseq_setup_normal_0start_2params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
95
+ vm_call_iseq_setup_normal_0start_2params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
96
96
  {
97
97
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
98
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 2, 0);
98
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 0);
99
99
  }
100
100
 
101
101
  static VALUE
102
- vm_call_iseq_setup_normal_0start_2params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
102
+ vm_call_iseq_setup_normal_0start_2params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
103
103
  {
104
104
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
105
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 2, 1);
105
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 1);
106
106
  }
107
107
 
108
108
  static VALUE
109
- vm_call_iseq_setup_normal_0start_2params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
109
+ vm_call_iseq_setup_normal_0start_2params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
110
110
  {
111
111
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
112
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 2, 2);
112
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 2);
113
113
  }
114
114
 
115
115
  static VALUE
116
- vm_call_iseq_setup_normal_0start_2params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
116
+ vm_call_iseq_setup_normal_0start_2params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
117
117
  {
118
118
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
119
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 2, 3);
119
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 3);
120
120
  }
121
121
 
122
122
  static VALUE
123
- vm_call_iseq_setup_normal_0start_2params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
123
+ vm_call_iseq_setup_normal_0start_2params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
124
124
  {
125
125
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
126
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 2, 4);
126
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 4);
127
127
  }
128
128
 
129
129
  static VALUE
130
- vm_call_iseq_setup_normal_0start_2params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
130
+ vm_call_iseq_setup_normal_0start_2params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
131
131
  {
132
132
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
133
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 2, 5);
133
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 5);
134
134
  }
135
135
 
136
136
  static VALUE
137
- vm_call_iseq_setup_normal_0start_3params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
137
+ vm_call_iseq_setup_normal_0start_3params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
138
138
  {
139
139
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
140
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 3, 0);
140
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 0);
141
141
  }
142
142
 
143
143
  static VALUE
144
- vm_call_iseq_setup_normal_0start_3params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
144
+ vm_call_iseq_setup_normal_0start_3params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
145
145
  {
146
146
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
147
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 3, 1);
147
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 1);
148
148
  }
149
149
 
150
150
  static VALUE
151
- vm_call_iseq_setup_normal_0start_3params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
151
+ vm_call_iseq_setup_normal_0start_3params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
152
152
  {
153
153
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
154
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 3, 2);
154
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 2);
155
155
  }
156
156
 
157
157
  static VALUE
158
- vm_call_iseq_setup_normal_0start_3params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
158
+ vm_call_iseq_setup_normal_0start_3params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
159
159
  {
160
160
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
161
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 3, 3);
161
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 3);
162
162
  }
163
163
 
164
164
  static VALUE
165
- vm_call_iseq_setup_normal_0start_3params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
165
+ vm_call_iseq_setup_normal_0start_3params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
166
166
  {
167
167
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
168
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 3, 4);
168
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 4);
169
169
  }
170
170
 
171
171
  static VALUE
172
- vm_call_iseq_setup_normal_0start_3params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
172
+ vm_call_iseq_setup_normal_0start_3params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
173
173
  {
174
174
  RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
175
- return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cd->cc), 0, 3, 5);
175
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 5);
176
176
  }
177
177
 
178
178
  /* vm_call_iseq_handlers[param][local] */
@@ -267,8 +267,7 @@ vm_ci_markable(const struct rb_callinfo *ci)
267
267
  typedef VALUE (*vm_call_handler)(
268
268
  struct rb_execution_context_struct *ec,
269
269
  struct rb_control_frame_struct *cfp,
270
- struct rb_calling_info *calling,
271
- struct rb_call_data *cd);
270
+ struct rb_calling_info *calling);
272
271
 
273
272
  // imemo_callcache
274
273
 
@@ -374,7 +373,7 @@ vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *c
374
373
  extern const struct rb_callcache *rb_vm_empty_cc(void);
375
374
  #define vm_cc_empty() rb_vm_empty_cc()
376
375
 
377
- /* callcache: mutete */
376
+ /* callcache: mutate */
378
377
 
379
378
  static inline void
380
379
  vm_cc_cme_set(const struct rb_callcache *cc, const struct rb_callable_method_entry_struct *cme)
@@ -225,8 +225,7 @@ struct iseq_inline_cache_entry {
225
225
  };
226
226
 
227
227
  struct iseq_inline_iv_cache_entry {
228
- rb_serial_t ic_serial;
229
- size_t index;
228
+ struct rb_iv_index_tbl_entry *entry;
230
229
  };
231
230
 
232
231
  union iseq_inline_storage_entry {
@@ -239,6 +238,8 @@ union iseq_inline_storage_entry {
239
238
  };
240
239
 
241
240
  struct rb_calling_info {
241
+ const struct rb_callinfo *ci;
242
+ const struct rb_callcache *cc;
242
243
  VALUE block_handler;
243
244
  VALUE recv;
244
245
  int argc;
@@ -419,7 +420,7 @@ struct rb_iseq_constant_body {
419
420
 
420
421
  char catch_except_p; /* If a frame of this ISeq may catch exception, set TRUE */
421
422
  bool builtin_inline_p; // This ISeq's builtin func is safe to be inlined by MJIT
422
- char access_outer_variables;
423
+ struct rb_id_table *outer_variables;
423
424
 
424
425
  #if USE_MJIT
425
426
  /* The following fields are MJIT related info. */
@@ -596,7 +597,7 @@ typedef struct rb_vm_struct {
596
597
  unsigned int running: 1;
597
598
  unsigned int thread_abort_on_exception: 1;
598
599
  unsigned int thread_report_on_exception: 1;
599
- unsigned int safe_level_: 1;
600
+ unsigned int thread_ignore_deadlock: 1;
600
601
 
601
602
  /* object management */
602
603
  VALUE mark_object_ary;
@@ -618,9 +619,6 @@ typedef struct rb_vm_struct {
618
619
  VALUE cmd[RUBY_NSIG];
619
620
  } trap_list;
620
621
 
621
- /* hook */
622
- rb_hook_list_t global_hooks;
623
-
624
622
  /* relation table of ensure - rollback for callcc */
625
623
  struct st_table *ensure_rollback_table;
626
624
 
@@ -634,7 +632,7 @@ typedef struct rb_vm_struct {
634
632
  struct list_head workqueue; /* <=> rb_workqueue_job.jnode */
635
633
  rb_nativethread_lock_t workqueue_lock;
636
634
 
637
- VALUE verbose, debug, orig_progname, progname;
635
+ VALUE orig_progname, progname;
638
636
  VALUE coverages;
639
637
  int coverage_mode;
640
638
 
@@ -650,6 +648,12 @@ typedef struct rb_vm_struct {
650
648
  const struct rb_builtin_function *builtin_function_table;
651
649
  int builtin_inline_index;
652
650
 
651
+ struct rb_id_table *negative_cme_table;
652
+
653
+ #if USE_VM_CLOCK
654
+ uint32_t clock;
655
+ #endif
656
+
653
657
  /* params */
654
658
  struct { /* size in byte */
655
659
  size_t thread_vm_stack_size;
@@ -794,6 +798,7 @@ struct rb_vm_tag {
794
798
  rb_jmpbuf_t buf;
795
799
  struct rb_vm_tag *prev;
796
800
  enum ruby_tag_type state;
801
+ unsigned int lock_rec;
797
802
  };
798
803
 
799
804
  STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0);
@@ -845,6 +850,9 @@ struct rb_execution_context_struct {
845
850
  /* interrupt flags */
846
851
  rb_atomic_t interrupt_flag;
847
852
  rb_atomic_t interrupt_mask; /* size should match flag */
853
+ #if USE_VM_CLOCK
854
+ uint32_t checked_clock;
855
+ #endif
848
856
 
849
857
  rb_fiber_t *fiber_ptr;
850
858
  struct rb_thread_struct *thread_ptr;
@@ -905,6 +913,10 @@ void rb_ec_initialize_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t
905
913
  // @param ec the execution context to update.
906
914
  void rb_ec_clear_vm_stack(rb_execution_context_t *ec);
907
915
 
916
+ struct rb_ext_config {
917
+ bool ractor_safe;
918
+ };
919
+
908
920
  typedef struct rb_ractor_struct rb_ractor_t;
909
921
 
910
922
  typedef struct rb_thread_struct {
@@ -993,6 +1005,8 @@ typedef struct rb_thread_struct {
993
1005
  /* misc */
994
1006
  VALUE name;
995
1007
 
1008
+ struct rb_ext_config ext_config;
1009
+
996
1010
  #ifdef USE_SIGALTSTACK
997
1011
  void *altstack;
998
1012
  #endif
@@ -1017,11 +1031,13 @@ typedef enum {
1017
1031
  RUBY_SYMBOL_EXPORT_BEGIN
1018
1032
 
1019
1033
  /* node -> iseq */
1020
- rb_iseq_t *rb_iseq_new (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type);
1021
- rb_iseq_t *rb_iseq_new_top (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1022
- rb_iseq_t *rb_iseq_new_main (const rb_ast_body_t *ast, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1023
- rb_iseq_t *rb_iseq_new_with_opt(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno,
1024
- const rb_iseq_t *parent, enum iseq_type, const rb_compile_option_t*);
1034
+ rb_iseq_t *rb_iseq_new (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type);
1035
+ rb_iseq_t *rb_iseq_new_top (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1036
+ rb_iseq_t *rb_iseq_new_main (const rb_ast_body_t *ast, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1037
+ rb_iseq_t *rb_iseq_new_eval (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, int isolated_depth);
1038
+ rb_iseq_t *rb_iseq_new_with_opt(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, int isolated_depth,
1039
+ enum iseq_type, const rb_compile_option_t*);
1040
+
1025
1041
  struct iseq_link_anchor;
1026
1042
  struct rb_iseq_new_with_callback_callback_func {
1027
1043
  VALUE flags;
@@ -1063,6 +1079,7 @@ typedef struct {
1063
1079
 
1064
1080
  VALUE rb_proc_isolate(VALUE self);
1065
1081
  VALUE rb_proc_isolate_bang(VALUE self);
1082
+ VALUE rb_proc_ractor_make_shareable(VALUE self);
1066
1083
 
1067
1084
  typedef struct {
1068
1085
  VALUE flags; /* imemo header */
@@ -1156,18 +1173,19 @@ enum {
1156
1173
  VM_FRAME_MAGIC_MASK = 0x7fff0001,
1157
1174
 
1158
1175
  /* frame flag */
1159
- VM_FRAME_FLAG_PASSED = 0x0010,
1160
1176
  VM_FRAME_FLAG_FINISH = 0x0020,
1161
1177
  VM_FRAME_FLAG_BMETHOD = 0x0040,
1162
1178
  VM_FRAME_FLAG_CFRAME = 0x0080,
1163
1179
  VM_FRAME_FLAG_LAMBDA = 0x0100,
1164
1180
  VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM = 0x0200,
1165
1181
  VM_FRAME_FLAG_CFRAME_KW = 0x0400,
1182
+ VM_FRAME_FLAG_PASSED = 0x0800,
1166
1183
 
1167
1184
  /* env flag */
1168
1185
  VM_ENV_FLAG_LOCAL = 0x0002,
1169
1186
  VM_ENV_FLAG_ESCAPED = 0x0004,
1170
- VM_ENV_FLAG_WB_REQUIRED = 0x0008
1187
+ VM_ENV_FLAG_WB_REQUIRED = 0x0008,
1188
+ VM_ENV_FLAG_ISOLATED = 0x0010,
1171
1189
  };
1172
1190
 
1173
1191
  #define VM_ENV_DATA_SIZE ( 3)
@@ -1614,7 +1632,7 @@ extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const
1614
1632
  #define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp)
1615
1633
  #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp))
1616
1634
  void rb_vm_bugreport(const void *);
1617
- typedef RETSIGTYPE (*ruby_sighandler_t)(int);
1635
+ typedef void (*ruby_sighandler_t)(int);
1618
1636
  NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...));
1619
1637
 
1620
1638
  /* functions about thread/vm execution */
@@ -1716,13 +1734,12 @@ rb_execution_context_t *rb_vm_main_ractor_ec(rb_vm_t *vm); // ractor.c
1716
1734
  #if RUBY_VM_THREAD_MODEL == 2
1717
1735
  RUBY_SYMBOL_EXPORT_BEGIN
1718
1736
 
1737
+ RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
1719
1738
  RUBY_EXTERN rb_vm_t *ruby_current_vm_ptr;
1720
1739
  RUBY_EXTERN rb_event_flag_t ruby_vm_event_flags;
1721
1740
  RUBY_EXTERN rb_event_flag_t ruby_vm_event_enabled_global_flags;
1722
1741
  RUBY_EXTERN unsigned int ruby_vm_event_local_num;
1723
1742
 
1724
- RUBY_EXTERN native_tls_key_t ruby_current_ec_key;
1725
-
1726
1743
  RUBY_SYMBOL_EXPORT_END
1727
1744
 
1728
1745
  #define GET_VM() rb_current_vm()
@@ -1764,7 +1781,15 @@ rb_ec_vm_ptr(const rb_execution_context_t *ec)
1764
1781
  static inline rb_execution_context_t *
1765
1782
  rb_current_execution_context(void)
1766
1783
  {
1784
+ #ifdef RB_THREAD_LOCAL_SPECIFIER
1785
+ #if __APPLE__
1786
+ rb_execution_context_t *ec = rb_current_ec();
1787
+ #else
1788
+ rb_execution_context_t *ec = ruby_current_ec;
1789
+ #endif
1790
+ #else
1767
1791
  rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
1792
+ #endif
1768
1793
  VM_ASSERT(ec != NULL);
1769
1794
  return ec;
1770
1795
  }
@@ -1779,8 +1804,13 @@ rb_current_thread(void)
1779
1804
  static inline rb_ractor_t *
1780
1805
  rb_current_ractor(void)
1781
1806
  {
1782
- const rb_execution_context_t *ec = GET_EC();
1783
- return rb_ec_ractor_ptr(ec);
1807
+ if (ruby_single_main_ractor) {
1808
+ return ruby_single_main_ractor;
1809
+ }
1810
+ else {
1811
+ const rb_execution_context_t *ec = GET_EC();
1812
+ return rb_ec_ractor_ptr(ec);
1813
+ }
1784
1814
  }
1785
1815
 
1786
1816
  static inline rb_vm_t *
@@ -1797,6 +1827,23 @@ rb_current_vm(void)
1797
1827
  return ruby_current_vm_ptr;
1798
1828
  }
1799
1829
 
1830
+ void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec,
1831
+ unsigned int recorded_lock_rec,
1832
+ unsigned int current_lock_rec);
1833
+
1834
+ static inline unsigned int
1835
+ rb_ec_vm_lock_rec(const rb_execution_context_t *ec)
1836
+ {
1837
+ rb_vm_t *vm = rb_ec_vm_ptr(ec);
1838
+
1839
+ if (vm->ractor.sync.lock_owner != rb_ec_ractor_ptr(ec)) {
1840
+ return 0;
1841
+ }
1842
+ else {
1843
+ return vm->ractor.sync.lock_rec;
1844
+ }
1845
+ }
1846
+
1800
1847
  #else
1801
1848
  #error "unsupported thread model"
1802
1849
  #endif
@@ -1818,7 +1865,20 @@ enum {
1818
1865
  #define RUBY_VM_SET_VM_BARRIER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, VM_BARRIER_INTERRUPT_MASK)
1819
1866
  #define RUBY_VM_INTERRUPTED(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask & \
1820
1867
  (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
1821
- #define RUBY_VM_INTERRUPTED_ANY(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask)
1868
+
1869
+ static inline bool
1870
+ RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec)
1871
+ {
1872
+ #if USE_VM_CLOCK
1873
+ uint32_t current_clock = rb_ec_vm_ptr(ec)->clock;
1874
+
1875
+ if (current_clock != ec->checked_clock) {
1876
+ ec->checked_clock = current_clock;
1877
+ RUBY_VM_SET_TIMER_INTERRUPT(ec);
1878
+ }
1879
+ #endif
1880
+ return ec->interrupt_flag & ~(ec)->interrupt_mask;
1881
+ }
1822
1882
 
1823
1883
  VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
1824
1884
  int rb_signal_buff_size(void);
@@ -1910,17 +1970,24 @@ rb_exec_event_hook_orig(rb_execution_context_t *ec, rb_hook_list_t *hooks, rb_ev
1910
1970
  rb_exec_event_hooks(&trace_arg, hooks, pop_p);
1911
1971
  }
1912
1972
 
1973
+ struct rb_ractor_pub {
1974
+ VALUE self;
1975
+ uint32_t id;
1976
+ rb_hook_list_t hooks;
1977
+ };
1978
+
1913
1979
  static inline rb_hook_list_t *
1914
- rb_vm_global_hooks(const rb_execution_context_t *ec)
1980
+ rb_ec_ractor_hooks(const rb_execution_context_t *ec)
1915
1981
  {
1916
- return &rb_ec_vm_ptr(ec)->global_hooks;
1982
+ struct rb_ractor_pub *cr_pub = (struct rb_ractor_pub *)rb_ec_ractor_ptr(ec);
1983
+ return &cr_pub->hooks;
1917
1984
  }
1918
1985
 
1919
1986
  #define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \
1920
- EXEC_EVENT_HOOK_ORIG(ec_, rb_vm_global_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0)
1987
+ EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0)
1921
1988
 
1922
1989
  #define EXEC_EVENT_HOOK_AND_POP_FRAME(ec_, flag_, self_, id_, called_id_, klass_, data_) \
1923
- EXEC_EVENT_HOOK_ORIG(ec_, rb_vm_global_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1)
1990
+ EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1)
1924
1991
 
1925
1992
  static inline void
1926
1993
  rb_exec_event_hook_script_compiled(rb_execution_context_t *ec, const rb_iseq_t *iseq, VALUE eval_script)
@@ -1947,6 +2014,10 @@ extern void rb_reset_coverages(void);
1947
2014
 
1948
2015
  void rb_postponed_job_flush(rb_vm_t *vm);
1949
2016
 
2017
+ // ractor.c
2018
+ RUBY_EXTERN VALUE rb_eRactorUnsafeError;
2019
+ RUBY_EXTERN VALUE rb_eRactorIsolationError;
2020
+
1950
2021
  RUBY_SYMBOL_EXPORT_END
1951
2022
 
1952
2023
  #endif /* RUBY_VM_CORE_H */