debase-ruby_core_source 0.10.13 → 0.10.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/debase-ruby_core_source.gemspec +1 -1
  3. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/addr2line.h +0 -0
  4. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/builtin.h +1 -0
  5. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ccan/build_assert/build_assert.h +0 -0
  6. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ccan/check_type/check_type.h +0 -0
  7. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ccan/container_of/container_of.h +0 -0
  8. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ccan/list/list.h +0 -0
  9. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ccan/str/str.h +0 -0
  10. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/constant.h +0 -0
  11. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/darray.h +0 -0
  12. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/debug_counter.h +2 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/dln.h +0 -0
  14. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/encindex.h +0 -0
  15. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/eval_intern.h +32 -1
  16. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/gc.h +0 -1
  17. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/hrtime.h +0 -0
  18. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/id.h +0 -0
  19. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/id_table.h +0 -0
  20. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/insns.inc +4 -2
  21. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/insns_info.inc +309 -224
  22. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/array.h +0 -0
  23. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/bignum.h +0 -0
  24. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/bits.h +0 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/class.h +13 -5
  26. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/compar.h +0 -0
  27. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/compile.h +0 -0
  28. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/compilers.h +0 -0
  29. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/complex.h +0 -0
  30. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/cont.h +0 -0
  31. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/dir.h +0 -0
  32. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/enc.h +0 -0
  33. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/encoding.h +0 -0
  34. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/enum.h +0 -0
  35. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/enumerator.h +0 -0
  36. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/error.h +0 -0
  37. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/eval.h +0 -0
  38. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/file.h +0 -0
  39. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/fixnum.h +0 -0
  40. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/gc.h +12 -1
  41. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/hash.h +0 -0
  42. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/imemo.h +0 -0
  43. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/inits.h +0 -0
  44. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/io.h +0 -0
  45. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/load.h +0 -0
  46. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/loadpath.h +0 -0
  47. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/math.h +0 -0
  48. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/missing.h +0 -0
  49. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/numeric.h +0 -0
  50. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/object.h +0 -0
  51. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/parse.h +0 -0
  52. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/proc.h +0 -0
  53. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/process.h +0 -0
  54. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/random.h +0 -0
  55. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/range.h +0 -0
  56. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/rational.h +0 -0
  57. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/re.h +0 -0
  58. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/sanitizers.h +0 -0
  59. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/serial.h +0 -0
  60. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/signal.h +0 -0
  61. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/static_assert.h +0 -0
  62. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/string.h +0 -0
  63. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/struct.h +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/symbol.h +1 -0
  65. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/thread.h +0 -0
  66. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/time.h +0 -0
  67. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/transcode.h +0 -0
  68. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/util.h +0 -0
  69. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/variable.h +0 -0
  70. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/vm.h +2 -1
  71. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal/warnings.h +0 -0
  72. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/internal.h +0 -0
  73. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/iseq.h +3 -1
  74. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/known_errors.inc +0 -0
  75. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/method.h +14 -6
  76. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/mjit.h +0 -0
  77. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/mjit_compile.inc +64 -7
  78. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/node.h +28 -17
  79. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/node_name.inc +0 -2
  80. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/opt_sc.inc +2 -0
  81. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/optinsn.inc +0 -0
  82. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/optunifs.inc +1 -1
  83. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/parse.h +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/probes_helper.h +0 -0
  85. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ractor_core.h +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/regenc.h +0 -0
  87. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/regint.h +0 -0
  88. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/regparse.h +0 -0
  89. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/revision.h +2 -0
  90. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ruby_assert.h +0 -0
  91. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/ruby_atomic.h +0 -0
  92. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/siphash.h +0 -0
  93. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/symbol.h +0 -0
  94. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/thread_pthread.h +0 -0
  95. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/thread_win32.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/timev.h +0 -0
  97. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/transcode_data.h +0 -0
  98. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/transient_heap.h +0 -0
  99. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/variable.h +0 -0
  100. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/version.h +4 -4
  101. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm.inc +338 -283
  102. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_call_iseq_optimized.inc +0 -0
  103. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_callinfo.h +41 -8
  104. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_core.h +6 -2
  105. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_debug.h +8 -3
  106. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_exec.h +0 -0
  107. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_insnhelper.h +0 -0
  108. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_opts.h +0 -0
  109. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vm_sync.h +1 -1
  110. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/vmtc.inc +4 -2
  111. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/yjit.h +11 -1
  112. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/yjit_asm.h +21 -5
  113. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/yjit_codegen.h +5 -1
  114. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/yjit_core.h +11 -6
  115. data/lib/debase/ruby_core_source/{ruby-3.1.0-preview1 → ruby-3.1.0-p0}/yjit_iface.h +0 -0
  116. data/lib/debase/ruby_core_source/version.rb +1 -1
  117. metadata +116 -116
  118. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/revision.h +0 -2
@@ -22,6 +22,7 @@
22
22
  struct rb_subclass_entry {
23
23
  VALUE klass;
24
24
  struct rb_subclass_entry *next;
25
+ struct rb_subclass_entry *prev;
25
26
  };
26
27
 
27
28
  struct rb_iv_index_tbl_entry {
@@ -47,13 +48,13 @@ struct rb_classext_struct {
47
48
  struct rb_id_table *cc_tbl; /* ID -> [[ci, cc1], cc2, ...] */
48
49
  struct rb_id_table *cvc_tbl;
49
50
  struct rb_subclass_entry *subclasses;
50
- struct rb_subclass_entry **parent_subclasses;
51
+ struct rb_subclass_entry *subclass_entry;
51
52
  /**
52
53
  * In the case that this is an `ICLASS`, `module_subclasses` points to the link
53
54
  * in the module's `subclasses` list that indicates that the klass has been
54
55
  * included. Hopefully that makes sense.
55
56
  */
56
- struct rb_subclass_entry **module_subclasses;
57
+ struct rb_subclass_entry *module_subclass_entry;
57
58
  #if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
58
59
  rb_serial_t class_serial;
59
60
  #endif
@@ -66,7 +67,9 @@ struct rb_classext_struct {
66
67
  struct RClass {
67
68
  struct RBasic basic;
68
69
  VALUE super;
70
+ #if !USE_RVARGC
69
71
  struct rb_classext_struct *ptr;
72
+ #endif
70
73
  #if SIZEOF_SERIAL_T == SIZEOF_VALUE
71
74
  /* Class serial is as wide as VALUE. Place it here. */
72
75
  rb_serial_t class_serial;
@@ -79,7 +82,11 @@ struct RClass {
79
82
  typedef struct rb_subclass_entry rb_subclass_entry_t;
80
83
  typedef struct rb_classext_struct rb_classext_t;
81
84
 
82
- #define RCLASS_EXT(c) (RCLASS(c)->ptr)
85
+ #if USE_RVARGC
86
+ # define RCLASS_EXT(c) ((rb_classext_t *)((char *)c + sizeof(struct RClass)))
87
+ #else
88
+ # define RCLASS_EXT(c) (RCLASS(c)->ptr)
89
+ #endif
83
90
  #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
84
91
  #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
85
92
  #if SIZEOF_SERIAL_T == SIZEOF_VALUE
@@ -99,8 +106,8 @@ typedef struct rb_classext_struct rb_classext_t;
99
106
  # define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
100
107
  #endif
101
108
  #define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
102
- #define RCLASS_PARENT_SUBCLASSES(c) (RCLASS_EXT(c)->parent_subclasses)
103
- #define RCLASS_MODULE_SUBCLASSES(c) (RCLASS_EXT(c)->module_subclasses)
109
+ #define RCLASS_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->subclass_entry)
110
+ #define RCLASS_MODULE_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->module_subclass_entry)
104
111
  #define RCLASS_ALLOCATOR(c) (RCLASS_EXT(c)->allocator)
105
112
  #define RCLASS_SUBCLASSES(c) (RCLASS_EXT(c)->subclasses)
106
113
 
@@ -111,6 +118,7 @@ typedef struct rb_classext_struct rb_classext_t;
111
118
  /* class.c */
112
119
  void rb_class_subclass_add(VALUE super, VALUE klass);
113
120
  void rb_class_remove_from_super_subclasses(VALUE);
121
+ void rb_class_remove_subclass_head(VALUE);
114
122
  int rb_singleton_class_internal_p(VALUE sklass);
115
123
  VALUE rb_class_boot(VALUE);
116
124
  VALUE rb_class_s_alloc(VALUE klass);
@@ -67,9 +67,19 @@ struct rb_objspace; /* in vm_core.h */
67
67
  rb_obj_write((VALUE)(a), UNALIGNED_MEMBER_ACCESS((VALUE *)(slot)), \
68
68
  (VALUE)(b), __FILE__, __LINE__)
69
69
 
70
- typedef struct ractor_newobj_cache {
70
+ #if USE_RVARGC
71
+ # define SIZE_POOL_COUNT 4
72
+ #else
73
+ # define SIZE_POOL_COUNT 1
74
+ #endif
75
+
76
+ typedef struct ractor_newobj_size_pool_cache {
71
77
  struct RVALUE *freelist;
72
78
  struct heap_page *using_page;
79
+ } rb_ractor_newobj_size_pool_cache_t;
80
+
81
+ typedef struct ractor_newobj_cache {
82
+ rb_ractor_newobj_size_pool_cache_t size_pool_caches[SIZE_POOL_COUNT];
73
83
  } rb_ractor_newobj_cache_t;
74
84
 
75
85
  /* gc.c */
@@ -99,6 +109,7 @@ VALUE rb_class_allocate_instance(VALUE klass);
99
109
  void rb_gc_ractor_newobj_cache_clear(rb_ractor_newobj_cache_t *newobj_cache);
100
110
  size_t rb_gc_obj_slot_size(VALUE obj);
101
111
  bool rb_gc_size_allocatable_p(size_t size);
112
+ int rb_objspace_garbage_object_p(VALUE obj);
102
113
 
103
114
  RUBY_SYMBOL_EXPORT_BEGIN
104
115
  /* gc.c (export) */
@@ -28,6 +28,7 @@ int rb_is_local_name(VALUE name);
28
28
  PUREFUNC(int rb_is_const_sym(VALUE sym));
29
29
  PUREFUNC(int rb_is_attrset_sym(VALUE sym));
30
30
  ID rb_make_internal_id(void);
31
+ ID rb_make_temporary_id(size_t n);
31
32
  void rb_gc_free_dsymbol(VALUE);
32
33
 
33
34
  #if __has_builtin(__builtin_constant_p)
@@ -111,7 +111,8 @@ VALUE rb_backtrace_to_str_ary(VALUE obj);
111
111
  VALUE rb_backtrace_to_location_ary(VALUE obj);
112
112
  void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output);
113
113
  int rb_frame_info_p(VALUE obj);
114
- void rb_frame_info_get(VALUE obj, VALUE *path, VALUE *script_lines, int *node_id);
114
+ int rb_get_node_id_from_frame_info(VALUE obj);
115
+ const struct rb_iseq_struct *rb_get_iseq_from_frame_info(VALUE obj);
115
116
 
116
117
  MJIT_SYMBOL_EXPORT_BEGIN
117
118
  VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec);
@@ -117,6 +117,7 @@ struct iseq_compile_data {
117
117
  const rb_compile_option_t *option;
118
118
  struct rb_id_table *ivar_cache_table;
119
119
  const struct rb_builtin_function *builtin_function_table;
120
+ const NODE *root_node;
120
121
  #if OPT_SUPPORT_JOKE
121
122
  st_table *labels_table;
122
123
  #endif
@@ -159,7 +160,7 @@ const rb_iseq_t *rb_iseq_ibf_load(VALUE str);
159
160
  const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
160
161
  VALUE rb_iseq_ibf_load_extra_data(VALUE str);
161
162
  void rb_iseq_init_trace(rb_iseq_t *iseq);
162
- int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line);
163
+ int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line, bool target_bmethod);
163
164
  int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval);
164
165
  const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
165
166
 
@@ -197,6 +198,7 @@ const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
197
198
 
198
199
  VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */
199
200
  int rb_iseq_from_eval_p(const rb_iseq_t *iseq);
201
+ VALUE rb_iseq_type(const rb_iseq_t *iseq);
200
202
  VALUE rb_iseq_label(const rb_iseq_t *iseq);
201
203
  VALUE rb_iseq_base_label(const rb_iseq_t *iseq);
202
204
  VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq);
@@ -44,7 +44,7 @@ typedef struct rb_scope_visi_struct {
44
44
  typedef struct rb_cref_struct {
45
45
  VALUE flags;
46
46
  VALUE refinements;
47
- VALUE klass;
47
+ VALUE klass_or_self;
48
48
  struct rb_cref_struct * next;
49
49
  const rb_scope_visibility_t scope_visi;
50
50
  } rb_cref_t;
@@ -132,7 +132,7 @@ typedef struct rb_iseq_struct rb_iseq_t;
132
132
  #endif
133
133
 
134
134
  typedef struct rb_method_iseq_struct {
135
- rb_iseq_t * iseqptr; /*!< iseq pointer, should be separated from iseqval */
135
+ const rb_iseq_t * iseqptr; /*!< iseq pointer, should be separated from iseqval */
136
136
  rb_cref_t * cref; /*!< class reference, should be marked */
137
137
  } rb_method_iseq_t; /* check rb_add_method_iseq() when modify the fields */
138
138
 
@@ -166,12 +166,20 @@ enum method_optimized_type {
166
166
  OPTIMIZED_METHOD_TYPE_SEND,
167
167
  OPTIMIZED_METHOD_TYPE_CALL,
168
168
  OPTIMIZED_METHOD_TYPE_BLOCK_CALL,
169
+ OPTIMIZED_METHOD_TYPE_STRUCT_AREF,
170
+ OPTIMIZED_METHOD_TYPE_STRUCT_ASET,
169
171
  OPTIMIZED_METHOD_TYPE__MAX
170
172
  };
171
173
 
174
+ typedef struct rb_method_optimized {
175
+ enum method_optimized_type type;
176
+ unsigned int index;
177
+ } rb_method_optimized_t;
178
+
172
179
  struct rb_method_definition_struct {
173
180
  BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS);
174
- int alias_count : 28;
181
+ unsigned int iseq_overload: 1;
182
+ int alias_count : 27;
175
183
  int complemented_count : 28;
176
184
 
177
185
  union {
@@ -181,8 +189,7 @@ struct rb_method_definition_struct {
181
189
  rb_method_alias_t alias;
182
190
  rb_method_refined_t refined;
183
191
  rb_method_bmethod_t bmethod;
184
-
185
- enum method_optimized_type optimize_type;
192
+ rb_method_optimized_t optimized;
186
193
  } body;
187
194
 
188
195
  ID original_id;
@@ -199,10 +206,11 @@ STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8);
199
206
  ((def)->type == VM_METHOD_TYPE_REFINED && \
200
207
  UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me))
201
208
 
209
+ void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi);
202
210
  void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi);
203
211
  void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi);
212
+ void rb_add_method_optimized(VALUE klass, ID mid, enum method_optimized_type, unsigned int index, rb_method_visibility_t visi);
204
213
  void rb_add_refined_method_entry(VALUE refined_class, ID mid);
205
- void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi);
206
214
 
207
215
  rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex);
208
216
  rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def);
@@ -578,9 +578,8 @@ switch (insn) {
578
578
  fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
579
579
  }
580
580
  fprintf(f, " {\n");
581
- fprintf(f, " rb_cref_t * cref = vm_get_cref(GET_EP());\n");
582
581
  fprintf(f, " rb_control_frame_t *cfp = GET_CFP();\n");
583
- fprintf(f, " val = vm_getclassvariable(GET_ISEQ(), cref, cfp, id, (ICVARC)ic);\n");
582
+ fprintf(f, " val = vm_getclassvariable(GET_ISEQ(), cfp, id, (ICVARC)ic);\n");
584
583
  fprintf(f, " }\n");
585
584
  fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_getclassvariable(id, ic) - 1);
586
585
  fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
@@ -626,7 +625,7 @@ switch (insn) {
626
625
  }
627
626
  fprintf(f, " {\n");
628
627
  fprintf(f, " vm_ensure_not_refinement_module(GET_SELF());\n");
629
- fprintf(f, " vm_setclassvariable(GET_ISEQ(), vm_get_cref(GET_EP()), GET_CFP(), id, val, (ICVARC)ic);\n");
628
+ fprintf(f, " vm_setclassvariable(GET_ISEQ(), GET_CFP(), id, val, (ICVARC)ic);\n");
630
629
  fprintf(f, " }\n");
631
630
  fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
632
631
  fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_setclassvariable(id, ic));
@@ -904,7 +903,7 @@ switch (insn) {
904
903
  fprintf(f, " value_type = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
905
904
  fprintf(f, "\n");
906
905
  MAYBE_UNUSED(bool pc_moved_p) = false;
907
- if (false) {
906
+ if (true) {
908
907
  fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
909
908
  pc_moved_p = true;
910
909
  }
@@ -920,6 +919,14 @@ switch (insn) {
920
919
  fprintf(f, " val = vm_get_special_object(GET_EP(), type);\n");
921
920
  fprintf(f, " }\n");
922
921
  fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_putspecialobject(value_type) - 1);
922
+ fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
923
+ fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_putspecialobject(value_type));
924
+ if (!pc_moved_p) {
925
+ fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
926
+ }
927
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
928
+ fprintf(f, " goto cancel;\n");
929
+ fprintf(f, " }\n");
923
930
  b->stack_size += attr_sp_inc_putspecialobject(value_type);
924
931
  }
925
932
  fprintf(f, "}\n");
@@ -996,7 +1003,7 @@ switch (insn) {
996
1003
  fprintf(f, "}\n");
997
1004
  break;
998
1005
  }
999
- case BIN(tostring): {
1006
+ case BIN(anytostring): {
1000
1007
  fprintf(f, "{\n");
1001
1008
  {
1002
1009
  if (status->local_stack_p) {
@@ -1019,8 +1026,8 @@ switch (insn) {
1019
1026
  fprintf(f, " {\n");
1020
1027
  fprintf(f, " val = rb_obj_as_string_result(str, val);\n");
1021
1028
  fprintf(f, " }\n");
1022
- fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_tostring() - 1);
1023
- b->stack_size += attr_sp_inc_tostring();
1029
+ fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_anytostring() - 1);
1030
+ b->stack_size += attr_sp_inc_anytostring();
1024
1031
  }
1025
1032
  fprintf(f, "}\n");
1026
1033
  break;
@@ -2250,6 +2257,56 @@ switch (insn) {
2250
2257
  fprintf(f, "}\n");
2251
2258
  break;
2252
2259
  }
2260
+ case BIN(objtostring): {
2261
+ fprintf(f, "{\n");
2262
+ {
2263
+ MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
2264
+ if (status->local_stack_p) {
2265
+ fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
2266
+ }
2267
+ fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
2268
+ fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
2269
+
2270
+ fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
2271
+ comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
2272
+ fprintf(f, "\n");
2273
+ fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
2274
+ MAYBE_UNUSED(bool pc_moved_p) = false;
2275
+ if (true) {
2276
+ fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
2277
+ pc_moved_p = true;
2278
+ }
2279
+ if (status->local_stack_p) {
2280
+ }
2281
+ else {
2282
+ fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
2283
+ }
2284
+ fprintf(f, " {\n");
2285
+ fprintf(f, " val = vm_objtostring(GET_ISEQ(), recv, cd);\n");
2286
+ fprintf(f, "\n");
2287
+ fprintf(f, " if (val == Qundef) {\n");
2288
+ if (status->local_stack_p) {
2289
+ fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
2290
+ }
2291
+ fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
2292
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_opt_insn);\n");
2293
+ fprintf(f, " goto cancel;\n");
2294
+ fprintf(f, " }\n");
2295
+ fprintf(f, " }\n");
2296
+ fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_objtostring(cd) - 1);
2297
+ fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
2298
+ fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_objtostring(cd));
2299
+ if (!pc_moved_p) {
2300
+ fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
2301
+ }
2302
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
2303
+ fprintf(f, " goto cancel;\n");
2304
+ fprintf(f, " }\n");
2305
+ b->stack_size += attr_sp_inc_objtostring(cd);
2306
+ }
2307
+ fprintf(f, "}\n");
2308
+ break;
2309
+ }
2253
2310
  case BIN(opt_str_freeze): {
2254
2311
  fprintf(f, "{\n");
2255
2312
  {
@@ -11,6 +11,8 @@
11
11
 
12
12
  **********************************************************************/
13
13
 
14
+ #include "internal/compilers.h"
15
+
14
16
  #if defined(__cplusplus)
15
17
  extern "C" {
16
18
  #if 0
@@ -46,7 +48,6 @@ enum node_type {
46
48
  NODE_MASGN,
47
49
  NODE_LASGN,
48
50
  NODE_DASGN,
49
- NODE_DASGN_CURR,
50
51
  NODE_GASGN,
51
52
  NODE_IASGN,
52
53
  NODE_CDECL,
@@ -146,13 +147,18 @@ code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2)
146
147
  return loc;
147
148
  }
148
149
 
150
+ typedef struct rb_ast_id_table {
151
+ int size;
152
+ ID ids[FLEX_ARY_LEN];
153
+ } rb_ast_id_table_t;
154
+
149
155
  typedef struct RNode {
150
156
  VALUE flags;
151
157
  union {
152
158
  struct RNode *node;
153
159
  ID id;
154
160
  VALUE value;
155
- ID *tbl;
161
+ rb_ast_id_table_t *tbl;
156
162
  } u1;
157
163
  union {
158
164
  struct RNode *node;
@@ -231,11 +237,6 @@ typedef struct RNode {
231
237
 
232
238
  #define nd_entry u3.id
233
239
  #define nd_vid u1.id
234
- #define nd_cflag u2.id
235
- #define nd_cval u3.value
236
-
237
- #define nd_oid u1.id
238
- #define nd_tbl u1.tbl
239
240
 
240
241
  #define nd_var u1.node
241
242
  #define nd_iter u3.node
@@ -245,11 +246,6 @@ typedef struct RNode {
245
246
 
246
247
  #define nd_lit u1.value
247
248
 
248
- #define nd_rest u1.id
249
- #define nd_opt u1.node
250
- #define nd_pid u1.id
251
- #define nd_plen u2.argc
252
-
253
249
  #define nd_recv u1.node
254
250
  #define nd_mid u2.id
255
251
  #define nd_args u3.node
@@ -263,12 +259,9 @@ typedef struct RNode {
263
259
  #define nd_beg u1.node
264
260
  #define nd_end u2.node
265
261
  #define nd_state u3.state
266
- #define nd_rval u2.value
267
262
 
268
263
  #define nd_nth u2.argc
269
264
 
270
- #define nd_tag u1.id
271
-
272
265
  #define nd_alias u1.id
273
266
  #define nd_orig u2.id
274
267
  #define nd_undef u2.node
@@ -283,6 +276,19 @@ typedef struct RNode {
283
276
 
284
277
  #define nd_fpinfo u3.fpinfo
285
278
 
279
+ // for NODE_SCOPE
280
+ #define nd_tbl u1.tbl
281
+
282
+ // for NODE_ARGS_AUX
283
+ #define nd_pid u1.id
284
+ #define nd_plen u2.argc
285
+ #define nd_cflag u2.id
286
+
287
+ // for ripper
288
+ #define nd_cval u3.value
289
+ #define nd_rval u2.value
290
+ #define nd_tag u1.id
291
+
286
292
  #define NEW_NODE(t,a0,a1,a2,loc) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2),loc)
287
293
  #define NEW_NODE_WITH_LOCALS(t,a1,a2,loc) node_newnode_with_locals(p, (t),(VALUE)(a1),(VALUE)(a2),loc)
288
294
 
@@ -320,7 +326,6 @@ typedef struct RNode {
320
326
  #define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,v,loc)
321
327
  #define NEW_LASGN(v,val,loc) NEW_NODE(NODE_LASGN,v,val,0,loc)
322
328
  #define NEW_DASGN(v,val,loc) NEW_NODE(NODE_DASGN,v,val,0,loc)
323
- #define NEW_DASGN_CURR(v,val,loc) NEW_NODE(NODE_DASGN_CURR,v,val,0,loc)
324
329
  #define NEW_IASGN(v,val,loc) NEW_NODE(NODE_IASGN,v,val,0,loc)
325
330
  #define NEW_CDECL(v,val,path,loc) NEW_NODE(NODE_CDECL,v,val,path,loc)
326
331
  #define NEW_CVASGN(v,val,loc) NEW_NODE(NODE_CVASGN,v,val,0,loc)
@@ -411,13 +416,14 @@ typedef struct rb_ast_struct {
411
416
  rb_ast_t *rb_ast_new(void);
412
417
  void rb_ast_mark(rb_ast_t*);
413
418
  void rb_ast_update_references(rb_ast_t*);
414
- void rb_ast_add_local_table(rb_ast_t*, ID *buf);
415
419
  void rb_ast_dispose(rb_ast_t*);
416
420
  void rb_ast_free(rb_ast_t*);
417
421
  size_t rb_ast_memsize(const rb_ast_t*);
418
422
  void rb_ast_add_mark_object(rb_ast_t*, VALUE);
419
423
  NODE *rb_ast_newnode(rb_ast_t*, enum node_type type);
420
424
  void rb_ast_delete_node(rb_ast_t*, NODE *n);
425
+ rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int);
426
+ rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int);
421
427
 
422
428
  VALUE rb_parser_new(void);
423
429
  VALUE rb_parser_end_seen_p(VALUE);
@@ -489,6 +495,11 @@ rb_node_set_type(NODE *n, enum node_type t)
489
495
  return nd_init_type(n, t);
490
496
  }
491
497
 
498
+ static inline bool
499
+ nd_type_p(const NODE *n, enum node_type t)
500
+ {
501
+ return (enum node_type)nd_type(n) == t;
502
+ }
492
503
  #if defined(__cplusplus)
493
504
  #if 0
494
505
  { /* satisfy cc-mode */
@@ -52,8 +52,6 @@
52
52
  return "NODE_LASGN";
53
53
  case NODE_DASGN:
54
54
  return "NODE_DASGN";
55
- case NODE_DASGN_CURR:
56
- return "NODE_DASGN_CURR";
57
55
  case NODE_GASGN:
58
56
  return "NODE_GASGN";
59
57
  case NODE_IASGN:
@@ -73,6 +73,7 @@ static const VALUE sc_insn_info[][SC_STATE_SIZE] = {
73
73
  NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC,
74
74
  NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC,
75
75
  NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC,
76
+ NO_SC, NO_SC,
76
77
  #undef NO_SC
77
78
  };
78
79
 
@@ -102,6 +103,7 @@ static const VALUE sc_insn_next[] = {
102
103
  SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX,
103
104
  SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX,
104
105
  SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX,
106
+ SCS_XX, SCS_XX,
105
107
  };
106
108
 
107
109
  ASSERT_VM_INSTRUCTION_SIZE(sc_insn_next);
@@ -38,6 +38,6 @@
38
38
 
39
39
  /* Let .bss section automatically initialize this variable */
40
40
  /* cf. Section 6.7.8 of ISO/IEC 9899:1999 */
41
- static const int *const *const unified_insns_data[200];
41
+ static const int *const *const unified_insns_data[202];
42
42
 
43
43
  ASSERT_VM_INSTRUCTION_SIZE(unified_insns_data);
@@ -0,0 +1,2 @@
1
+ #define RUBY_REVISION "fb4df44d16"
2
+ #define RUBY_FULL_REVISION "fb4df44d1670e9d25aef6b235a7281199a177edb"