debase-ruby_core_source 0.10.11 → 0.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -29,6 +29,8 @@ VALUE rb_ary_tmp_new_fill(long capa);
29
29
  VALUE rb_ary_at(VALUE, VALUE);
30
30
  size_t rb_ary_memsize(VALUE);
31
31
  VALUE rb_to_array_type(VALUE obj);
32
+ void rb_ary_cancel_sharing(VALUE ary);
33
+
32
34
  static inline VALUE rb_ary_entry_internal(VALUE ary, long offset);
33
35
  static inline bool ARY_PTR_USING_P(VALUE ary);
34
36
  static inline void RARY_TRANSIENT_SET(VALUE ary);
@@ -46,6 +48,9 @@ VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *);
46
48
  VALUE rb_check_to_array(VALUE ary);
47
49
  VALUE rb_ary_behead(VALUE, long);
48
50
  VALUE rb_ary_aref1(VALUE ary, VALUE i);
51
+
52
+ struct rb_execution_context_struct;
53
+ VALUE rb_ec_ary_new_from_values(struct rb_execution_context_struct *ec, long n, const VALUE *elts);
49
54
  MJIT_SYMBOL_EXPORT_END
50
55
 
51
56
  static inline VALUE
@@ -25,8 +25,14 @@ struct rb_subclass_entry {
25
25
  struct rb_subclass_entry *next;
26
26
  };
27
27
 
28
+ struct rb_iv_index_tbl_entry {
29
+ uint32_t index;
30
+ rb_serial_t class_serial;
31
+ VALUE class_value;
32
+ };
33
+
28
34
  struct rb_classext_struct {
29
- struct st_table *iv_index_tbl;
35
+ struct st_table *iv_index_tbl; // ID -> struct rb_iv_index_tbl_entry
30
36
  struct st_table *iv_tbl;
31
37
  #if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
32
38
  struct rb_id_table *m_tbl;
@@ -40,13 +40,6 @@
40
40
  #endif
41
41
 
42
42
  /* error.c */
43
- typedef enum {
44
- RB_WARN_CATEGORY_NONE,
45
- RB_WARN_CATEGORY_DEPRECATED,
46
- RB_WARN_CATEGORY_EXPERIMENTAL,
47
- RB_WARN_CATEGORY_ALL_BITS = 0x6, /* no RB_WARN_CATEGORY_NONE bit */
48
- } rb_warning_category_t;
49
-
50
43
  extern long rb_backtrace_length_limit;
51
44
  extern VALUE rb_eEAGAIN;
52
45
  extern VALUE rb_eEWOULDBLOCK;
@@ -61,7 +61,7 @@ rb_fix_plus_fix(VALUE x, VALUE y)
61
61
  * (3) Of course `z = x + (y-1)` may overflow.
62
62
  * At that time true value is
63
63
  * * positive: 0b0 1xxx...1, and z = 0b1xxx...1
64
- * * nevative: 0b1 0xxx...1, and z = 0b0xxx...1
64
+ * * negative: 0b1 0xxx...1, and z = 0b0xxx...1
65
65
  * To convert this true value to long,
66
66
  * (a) Use arithmetic shift
67
67
  * * positive: 0b11xxx...
@@ -30,6 +30,12 @@ struct rb_objspace; /* in vm_core.h */
30
30
  T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
31
31
  rb_wb_protected_newobj_of((c), (f) & ~FL_WB_PROTECTED) : \
32
32
  rb_wb_unprotected_newobj_of((c), (f)))
33
+
34
+ #define RB_EC_NEWOBJ_OF(ec, var, T, c, f) \
35
+ T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
36
+ rb_ec_wb_protected_newobj_of((ec), (c), (f) & ~FL_WB_PROTECTED) : \
37
+ rb_wb_unprotected_newobj_of((c), (f)))
38
+
33
39
  #define NEWOBJ_OF(var, T, c, f) RB_NEWOBJ_OF((var), T, (c), (f))
34
40
  #define RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */
35
41
 
@@ -52,8 +58,8 @@ struct rb_objspace; /* in vm_core.h */
52
58
 
53
59
  #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
54
60
  #define RB_OBJ_WRITE(a, slot, b) \
55
- UNALIGNED_MEMBER_ACCESS(\
56
- rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
61
+ rb_obj_write((VALUE)(a), UNALIGNED_MEMBER_ACCESS((VALUE *)(slot)), \
62
+ (VALUE)(b), __FILE__, __LINE__)
57
63
 
58
64
  /* gc.c */
59
65
  extern VALUE *ruby_initial_gc_stress_ptr;
@@ -85,6 +91,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
85
91
  const char *rb_objspace_data_type_name(VALUE obj);
86
92
  VALUE rb_wb_protected_newobj_of(VALUE, VALUE);
87
93
  VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE);
94
+ VALUE rb_ec_wb_protected_newobj_of(struct rb_execution_context_struct *ec, VALUE klass, VALUE flags);
88
95
  size_t rb_obj_memsize_of(VALUE);
89
96
  void rb_gc_verify_internal_consistency(void);
90
97
  size_t rb_obj_gc_flags(VALUE, ID[], size_t);
@@ -83,6 +83,8 @@ VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
83
83
  int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
84
84
  int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
85
85
  int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg);
86
+ extern st_table *rb_hash_st_table(VALUE hash);
87
+
86
88
  static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
87
89
  static inline VALUE RHASH_IFNONE(VALUE h);
88
90
  static inline size_t RHASH_SIZE(VALUE h);
@@ -135,7 +137,6 @@ RHASH_AR_TABLE(VALUE h)
135
137
  static inline st_table *
136
138
  RHASH_ST_TABLE(VALUE h)
137
139
  {
138
- extern st_table *rb_hash_st_table(VALUE hash);
139
140
  return rb_hash_st_table(h)
140
141
  }
141
142
 
@@ -50,11 +50,11 @@ double ruby_float_step_size(double beg, double end, double unit, int excl);
50
50
  int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
51
51
  int rb_num_negative_p(VALUE);
52
52
  VALUE rb_int_succ(VALUE num);
53
- VALUE rb_int_uminus(VALUE num);
54
53
  VALUE rb_float_uminus(VALUE num);
55
54
  VALUE rb_int_plus(VALUE x, VALUE y);
56
55
  VALUE rb_float_plus(VALUE x, VALUE y);
57
56
  VALUE rb_int_minus(VALUE x, VALUE y);
57
+ VALUE rb_float_minus(VALUE x, VALUE y);
58
58
  VALUE rb_int_mul(VALUE x, VALUE y);
59
59
  VALUE rb_float_mul(VALUE x, VALUE y);
60
60
  VALUE rb_float_div(VALUE x, VALUE y);
@@ -79,6 +79,7 @@ int rb_int_positive_p(VALUE num);
79
79
  int rb_int_negative_p(VALUE num);
80
80
  VALUE rb_num_pow(VALUE x, VALUE y);
81
81
  VALUE rb_float_ceil(VALUE num, int ndigits);
82
+ VALUE rb_float_floor(VALUE x, int ndigits);
82
83
  VALUE rb_float_abs(VALUE flt);
83
84
  static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid);
84
85
  static inline int rb_num_positive_int_p(VALUE num);
@@ -110,6 +111,8 @@ VALUE rb_int_even_p(VALUE num);
110
111
  VALUE rb_int_odd_p(VALUE num);
111
112
  VALUE rb_int_abs(VALUE num);
112
113
  VALUE rb_int_bit_length(VALUE num);
114
+ VALUE rb_int_uminus(VALUE num);
115
+ VALUE rb_int_comp(VALUE num);
113
116
  MJIT_SYMBOL_EXPORT_END
114
117
 
115
118
  static inline bool
@@ -21,6 +21,7 @@ int rb_block_pair_yield_optimizable(void);
21
21
  int rb_block_arity(void);
22
22
  int rb_block_min_max_arity(int *max);
23
23
  VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info);
24
+ VALUE rb_callable_receiver(VALUE);
24
25
 
25
26
  MJIT_SYMBOL_EXPORT_BEGIN
26
27
  VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val);
@@ -34,4 +34,8 @@ RANGE_EXCL(VALUE r)
34
34
  return RSTRUCT(r)->as.ary[2];
35
35
  }
36
36
 
37
+ VALUE
38
+ rb_range_component_beg_len(VALUE b, VALUE e, int excl,
39
+ long *begp, long *lenp, long len, int err);
40
+
37
41
  #endif /* INTERNAL_RANGE_H */
@@ -29,12 +29,14 @@ VALUE rb_rational_uminus(VALUE self);
29
29
  VALUE rb_rational_plus(VALUE self, VALUE other);
30
30
  VALUE rb_rational_minus(VALUE self, VALUE other);
31
31
  VALUE rb_rational_mul(VALUE self, VALUE other);
32
+ VALUE rb_rational_div(VALUE self, VALUE other);
32
33
  VALUE rb_lcm(VALUE x, VALUE y);
33
34
  VALUE rb_rational_reciprocal(VALUE x);
34
35
  VALUE rb_cstr_to_rat(const char *, int);
35
36
  VALUE rb_rational_abs(VALUE self);
36
37
  VALUE rb_rational_cmp(VALUE self, VALUE other);
37
38
  VALUE rb_rational_pow(VALUE self, VALUE other);
39
+ VALUE rb_rational_floor(VALUE self, int ndigits);
38
40
  VALUE rb_numeric_quo(VALUE x, VALUE y);
39
41
  VALUE rb_float_numerator(VALUE x);
40
42
  VALUE rb_float_denominator(VALUE x);
@@ -12,6 +12,12 @@
12
12
  #include "ruby/ruby.h"
13
13
  #include "ruby/intern.h"
14
14
 
15
+ VALUE rb_scheduler_get();
16
+ VALUE rb_scheduler_set(VALUE scheduler);
17
+
18
+ VALUE rb_scheduler_current();
19
+ VALUE rb_thread_scheduler_current(VALUE thread);
20
+
15
21
  VALUE rb_scheduler_timeout(struct timeval *timeout);
16
22
 
17
23
  VALUE rb_scheduler_close(VALUE scheduler);
@@ -19,6 +25,9 @@ VALUE rb_scheduler_close(VALUE scheduler);
19
25
  VALUE rb_scheduler_kernel_sleep(VALUE scheduler, VALUE duration);
20
26
  VALUE rb_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv);
21
27
 
28
+ int rb_scheduler_supports_process_wait(VALUE scheduler);
29
+ VALUE rb_scheduler_process_wait(VALUE scheduler, rb_pid_t pid, int flags);
30
+
22
31
  VALUE rb_scheduler_block(VALUE scheduler, VALUE blocker, VALUE timeout);
23
32
  VALUE rb_scheduler_unblock(VALUE scheduler, VALUE blocker, VALUE fiber);
24
33
 
@@ -42,6 +42,8 @@ VALUE rb_str_initialize(VALUE str, const char *ptr, long len, rb_encoding *enc);
42
42
  size_t rb_str_memsize(VALUE);
43
43
  char *rb_str_to_cstr(VALUE str);
44
44
  const char *ruby_escaped_char(int c);
45
+ void rb_str_make_independent(VALUE str);
46
+
45
47
  static inline bool STR_EMBED_P(VALUE str);
46
48
  static inline bool STR_SHARED_P(VALUE str);
47
49
  static inline VALUE QUOTE(VALUE v);
@@ -67,6 +69,9 @@ VALUE rb_str_concat_literals(size_t num, const VALUE *strary);
67
69
  VALUE rb_str_eql(VALUE str1, VALUE str2);
68
70
  VALUE rb_id_quote_unprintable(ID);
69
71
  VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc);
72
+
73
+ struct rb_execution_context_struct;
74
+ VALUE rb_ec_str_resurrect(struct rb_execution_context_struct *ec, VALUE str);
70
75
  MJIT_SYMBOL_EXPORT_END
71
76
 
72
77
  #define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str))
@@ -39,12 +39,6 @@ VALUE rb_mutex_owned_p(VALUE self);
39
39
 
40
40
  int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
41
41
 
42
- VALUE rb_thread_scheduler_get(VALUE thread);
43
- VALUE rb_thread_scheduler_set(VALUE thread, VALUE scheduler);
44
-
45
- VALUE rb_thread_scheduler_if_nonblocking(VALUE thread);
46
- VALUE rb_thread_current_scheduler();
47
-
48
42
  RUBY_SYMBOL_EXPORT_BEGIN
49
43
  /* Temporary. This API will be removed (renamed). */
50
44
  VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
@@ -52,6 +52,7 @@ VALUE rb_gvar_get(ID);
52
52
  VALUE rb_gvar_set(ID, VALUE);
53
53
  VALUE rb_gvar_defined(ID);
54
54
  void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID);
55
+ void rb_init_iv_list(VALUE obj);
55
56
  MJIT_SYMBOL_EXPORT_END
56
57
 
57
58
  static inline bool
@@ -27,8 +27,7 @@ struct rb_callable_method_entry_struct; /* in method.h */
27
27
  struct rb_method_definition_struct; /* in method.h */
28
28
  struct rb_execution_context_struct; /* in vm_core.h */
29
29
  struct rb_control_frame_struct; /* in vm_core.h */
30
- struct rb_calling_info; /* in vm_core.h */
31
- struct rb_call_data;
30
+ struct rb_callinfo; /* in vm_core.h */
32
31
 
33
32
  enum method_missing_reason {
34
33
  MISSING_NOENTRY = 0x00,
@@ -47,13 +46,14 @@ rb_serial_t rb_next_class_serial(void);
47
46
  /* vm.c */
48
47
  VALUE rb_obj_is_thread(VALUE obj);
49
48
  void rb_vm_mark(void *ptr);
49
+ void rb_vm_each_stack_value(void *ptr, void (*cb)(VALUE, void*), void *ctx);
50
50
  PUREFUNC(VALUE rb_vm_top_self(void));
51
51
  void rb_vm_inc_const_missing_count(void);
52
52
  const void **rb_vm_get_insns_address_table(void);
53
53
  VALUE rb_source_location(int *pline);
54
54
  const char *rb_source_location_cstr(int *pline);
55
55
  MJIT_STATIC void rb_vm_pop_cfunc_frame(void);
56
- int rb_vm_add_root_module(ID id, VALUE module);
56
+ int rb_vm_add_root_module(VALUE module);
57
57
  void rb_vm_check_redefinition_by_prepend(VALUE klass);
58
58
  int rb_vm_check_optimizable_mid(VALUE mid);
59
59
  VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
@@ -61,7 +61,7 @@ MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE);
61
61
  PUREFUNC(st_table *rb_vm_fstring_table(void));
62
62
 
63
63
  MJIT_SYMBOL_EXPORT_BEGIN
64
- VALUE vm_exec(struct rb_execution_context_struct *, int); /* used in JIT-ed code */
64
+ VALUE vm_exec(struct rb_execution_context_struct *, bool); /* used in JIT-ed code */
65
65
  MJIT_SYMBOL_EXPORT_END
66
66
 
67
67
  /* vm_eval.c */
@@ -74,6 +74,7 @@ VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *a
74
74
  rb_check_funcall_hook *hook, VALUE arg, int kw_splat);
75
75
  const char *rb_type_str(enum ruby_value_type type);
76
76
  VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
77
+ VALUE rb_check_funcall_basic_kw(VALUE, ID, VALUE, int, const VALUE*, int);
77
78
  VALUE rb_yield_1(VALUE val);
78
79
  VALUE rb_yield_force_blockarg(VALUE values);
79
80
  VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
@@ -92,13 +93,13 @@ VALUE rb_eql_opt(VALUE obj1, VALUE obj2);
92
93
 
93
94
  struct rb_iseq_struct;
94
95
  MJIT_SYMBOL_EXPORT_BEGIN
95
- void rb_vm_search_method_slowpath(VALUE cd_owner, struct rb_call_data *cd, VALUE klass);
96
+ const struct rb_callcache *rb_vm_search_method_slowpath(const struct rb_callinfo *ci, VALUE klass);
96
97
  MJIT_SYMBOL_EXPORT_END
97
98
 
98
99
  /* vm_method.c */
99
100
  struct rb_execution_context_struct;
100
101
  MJIT_SYMBOL_EXPORT_BEGIN
101
- int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE obj, ID id, int priv);
102
+ int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE klass, VALUE obj, ID id, int priv);
102
103
  MJIT_SYMBOL_EXPORT_END
103
104
 
104
105
  /* vm_dump.c */
@@ -105,6 +105,7 @@ struct iseq_compile_data {
105
105
  int last_line;
106
106
  int label_no;
107
107
  int node_level;
108
+ int isolated_depth;
108
109
  unsigned int ci_index;
109
110
  const rb_compile_option_t *option;
110
111
  struct rb_id_table *ivar_cache_table;
@@ -8,13 +8,14 @@
8
8
 
9
9
  **********************************************************************/
10
10
 
11
- #include "ruby/internal/config.h"
11
+ #include "ruby/internal/config.h" // defines USE_MJIT
12
+ #include "ruby/internal/stdbool.h"
13
+ #include "vm_core.h"
12
14
 
13
- #if USE_MJIT
15
+ # if USE_MJIT
14
16
 
15
17
  #include "debug_counter.h"
16
18
  #include "ruby.h"
17
- #include "vm_core.h"
18
19
 
19
20
  // Special address values of a function generated from the
20
21
  // corresponding iseq by MJIT:
@@ -69,6 +70,8 @@ struct rb_mjit_compile_info {
69
70
  bool disable_send_cache;
70
71
  // Disable method inlining
71
72
  bool disable_inlining;
73
+ // Disable opt_getinlinecache inlining
74
+ bool disable_const_cache;
72
75
  };
73
76
 
74
77
  typedef VALUE (*mjit_func_t)(rb_execution_context_t *, rb_control_frame_t *);
@@ -80,10 +83,13 @@ RUBY_EXTERN bool mjit_call_p;
80
83
  extern void rb_mjit_add_iseq_to_process(const rb_iseq_t *iseq);
81
84
  extern VALUE rb_mjit_wait_call(rb_execution_context_t *ec, struct rb_iseq_constant_body *body);
82
85
  extern struct rb_mjit_compile_info* rb_mjit_iseq_compile_info(const struct rb_iseq_constant_body *body);
86
+ extern void rb_mjit_before_vm_ic_update(void);
87
+ extern void rb_mjit_after_vm_ic_update(void);
83
88
  extern void rb_mjit_recompile_send(const rb_iseq_t *iseq);
84
89
  extern void rb_mjit_recompile_ivar(const rb_iseq_t *iseq);
85
90
  extern void rb_mjit_recompile_exivar(const rb_iseq_t *iseq);
86
91
  extern void rb_mjit_recompile_inlining(const rb_iseq_t *iseq);
92
+ extern void rb_mjit_recompile_const(const rb_iseq_t *iseq);
87
93
  RUBY_SYMBOL_EXPORT_END
88
94
 
89
95
  extern bool mjit_compile(FILE *f, const rb_iseq_t *iseq, const char *funcname, int id);
@@ -112,11 +118,11 @@ mjit_target_iseq_p(struct rb_iseq_constant_body *body)
112
118
  && body->iseq_size < JIT_ISEQ_SIZE_THRESHOLD;
113
119
  }
114
120
 
115
- #ifdef MJIT_HEADER
121
+ # ifdef MJIT_HEADER
116
122
  NOINLINE(static COLDFUNC VALUE mjit_exec_slowpath(rb_execution_context_t *ec, const rb_iseq_t *iseq, struct rb_iseq_constant_body *body));
117
- #else
123
+ # else
118
124
  static inline VALUE mjit_exec_slowpath(rb_execution_context_t *ec, const rb_iseq_t *iseq, struct rb_iseq_constant_body *body);
119
- #endif
125
+ # endif
120
126
  static VALUE
121
127
  mjit_exec_slowpath(rb_execution_context_t *ec, const rb_iseq_t *iseq, struct rb_iseq_constant_body *body)
122
128
  {
@@ -162,26 +168,38 @@ mjit_exec(rb_execution_context_t *ec)
162
168
 
163
169
  mjit_func_t func = body->jit_func;
164
170
  if (UNLIKELY((uintptr_t)func <= LAST_JIT_ISEQ_FUNC)) {
165
- # ifdef MJIT_HEADER
171
+ # ifdef MJIT_HEADER
166
172
  RB_DEBUG_COUNTER_INC(mjit_frame_JT2VM);
167
- # else
173
+ # else
168
174
  RB_DEBUG_COUNTER_INC(mjit_frame_VM2VM);
169
- # endif
175
+ # endif
170
176
  return mjit_exec_slowpath(ec, iseq, body);
171
177
  }
172
178
 
173
- # ifdef MJIT_HEADER
179
+ # ifdef MJIT_HEADER
174
180
  RB_DEBUG_COUNTER_INC(mjit_frame_JT2JT);
175
- # else
181
+ # else
176
182
  RB_DEBUG_COUNTER_INC(mjit_frame_VM2JT);
177
- # endif
183
+ # endif
178
184
  RB_DEBUG_COUNTER_INC(mjit_exec_call_func);
179
185
  return func(ec, ec->cfp);
180
186
  }
181
187
 
182
188
  void mjit_child_after_fork(void);
183
189
 
184
- #else // USE_MJIT
190
+ # ifdef MJIT_HEADER
191
+ #define mjit_enabled true
192
+ # else // MJIT_HEADER
193
+ extern bool mjit_enabled;
194
+ # endif // MJIT_HEADER
195
+ VALUE mjit_pause(bool wait_p);
196
+ VALUE mjit_resume(void);
197
+ void mjit_finish(bool close_handle_p);
198
+
199
+ # else // USE_MJIT
200
+
201
+ static inline void rb_mjit_before_vm_ic_update(void){}
202
+ static inline void rb_mjit_after_vm_ic_update(void){}
185
203
  static inline struct mjit_cont *mjit_cont_new(rb_execution_context_t *ec){return NULL;}
186
204
  static inline void mjit_cont_free(struct mjit_cont *cont){}
187
205
  static inline void mjit_gc_start_hook(void){}
@@ -193,5 +211,10 @@ static inline void mjit_remove_class_serial(rb_serial_t class_serial){}
193
211
  static inline VALUE mjit_exec(rb_execution_context_t *ec) { return Qundef; /* unreachable */ }
194
212
  static inline void mjit_child_after_fork(void){}
195
213
 
196
- #endif // USE_MJIT
214
+ #define mjit_enabled false
215
+ static inline VALUE mjit_pause(bool wait_p){ return Qnil; } // unreachable
216
+ static inline VALUE mjit_resume(void){ return Qnil; } // unreachable
217
+ static inline void mjit_finish(bool close_handle_p){}
218
+
219
+ # endif // USE_MJIT
197
220
  #endif // RUBY_MJIT_H