datadog-ruby_core_source 3.5.1 → 3.5.3
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.
- checksums.yaml +4 -4
- data/datadog-ruby_core_source.gemspec +1 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/id.h +3 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/id_table.h +10 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/array.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/basic_operators.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/bignum.h +21 -10
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/bits.h +14 -17
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/box.h +18 -3
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/class.h +39 -95
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/cont.h +0 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/eval.h +2 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/gc.h +7 -5
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/imemo.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/inits.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/load.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/numeric.h +48 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/rational.h +3 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/thread.h +2 -2
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/time.h +2 -5
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/variable.h +2 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/vm.h +2 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/iseq.h +3 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/method.h +7 -2
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/ast.h +38 -17
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/diagnostic.h +2 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/extension.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/options.h +4 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/prism.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/version.h +3 -3
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ractor_core.h +25 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ruby_atomic.h +7 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/rubyparser.h +0 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/shape.h +30 -10
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/thread_pthread.h +11 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/vm_core.h +70 -12
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- data/lib/datadog/ruby_core_source.rb +2 -2
- metadata +108 -110
- data/spec/datadog/ruby_core_source_spec.rb +0 -85
- data/spec/spec_helper.rb +0 -94
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ccan/build_assert/build_assert.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ccan/check_type/check_type.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ccan/container_of/container_of.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ccan/list/list.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ccan/str/str.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/cmdlineopt.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/compar.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/compile.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/compilers.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/complex.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/concurrent_set.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/dir.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/enc.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/encoding.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/enum.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/enumerator.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/error.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/file.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/fixnum.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/hash.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/io.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/loadpath.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/math.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/missing.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/object.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/parse.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/proc.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/process.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/ractor.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/random.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/range.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/re.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/ruby_parser.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/sanitizers.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/serial.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/set_table.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/signal.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/st.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/static_assert.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/string.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/struct.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/symbol.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/transcode.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/util.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal/warnings.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/internal.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/node.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/parser_st.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/parser_value.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/defines.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/encoding.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/node.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/pack.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/parser.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/prettyprint.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/regexp.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/static_literals.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_buffer.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_char.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_constant_pool.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_integer.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_list.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_memchr.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_newline_list.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_string.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_strncasecmp.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism/util/pm_strpbrk.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/prism_compile.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/ruby_assert.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/thread_none.h +0 -0
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/vm_debug.h +4 -4
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.6-p0}/vm_opts.h +0 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
/* load.c */
|
|
14
14
|
VALUE rb_get_expanded_load_path(void);
|
|
15
|
-
VALUE rb_load_entrypoint(VALUE
|
|
15
|
+
VALUE rb_load_entrypoint(VALUE fname, VALUE wrap);
|
|
16
16
|
VALUE rb_require_relative_entrypoint(VALUE fname);
|
|
17
17
|
int rb_require_internal(VALUE fname);
|
|
18
18
|
NORETURN(void rb_load_fail(VALUE, const char*));
|
|
@@ -127,6 +127,54 @@ VALUE rb_int_bit_length(VALUE num);
|
|
|
127
127
|
VALUE rb_int_uminus(VALUE num);
|
|
128
128
|
VALUE rb_int_comp(VALUE num);
|
|
129
129
|
|
|
130
|
+
// Unified 128-bit integer structures that work with or without native support:
|
|
131
|
+
union rb_uint128 {
|
|
132
|
+
#ifdef WORDS_BIGENDIAN
|
|
133
|
+
struct {
|
|
134
|
+
uint64_t high;
|
|
135
|
+
uint64_t low;
|
|
136
|
+
} parts;
|
|
137
|
+
#else
|
|
138
|
+
struct {
|
|
139
|
+
uint64_t low;
|
|
140
|
+
uint64_t high;
|
|
141
|
+
} parts;
|
|
142
|
+
#endif
|
|
143
|
+
#ifdef HAVE_UINT128_T
|
|
144
|
+
uint128_t value;
|
|
145
|
+
#endif
|
|
146
|
+
};
|
|
147
|
+
typedef union rb_uint128 rb_uint128_t;
|
|
148
|
+
|
|
149
|
+
union rb_int128 {
|
|
150
|
+
#ifdef WORDS_BIGENDIAN
|
|
151
|
+
struct {
|
|
152
|
+
uint64_t high;
|
|
153
|
+
uint64_t low;
|
|
154
|
+
} parts;
|
|
155
|
+
#else
|
|
156
|
+
struct {
|
|
157
|
+
uint64_t low;
|
|
158
|
+
uint64_t high;
|
|
159
|
+
} parts;
|
|
160
|
+
#endif
|
|
161
|
+
#ifdef HAVE_UINT128_T
|
|
162
|
+
int128_t value;
|
|
163
|
+
#endif
|
|
164
|
+
};
|
|
165
|
+
typedef union rb_int128 rb_int128_t;
|
|
166
|
+
|
|
167
|
+
union uint128_int128_conversion {
|
|
168
|
+
rb_uint128_t uint128;
|
|
169
|
+
rb_int128_t int128;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Conversion functions for 128-bit integers:
|
|
173
|
+
rb_uint128_t rb_numeric_to_uint128(VALUE x);
|
|
174
|
+
rb_int128_t rb_numeric_to_int128(VALUE x);
|
|
175
|
+
VALUE rb_uint128_to_numeric(rb_uint128_t n);
|
|
176
|
+
VALUE rb_int128_to_numeric(rb_int128_t n);
|
|
177
|
+
|
|
130
178
|
static inline bool
|
|
131
179
|
INT_POSITIVE_P(VALUE num)
|
|
132
180
|
{
|
|
@@ -37,7 +37,9 @@ VALUE rb_rational_cmp(VALUE self, VALUE other);
|
|
|
37
37
|
VALUE rb_rational_pow(VALUE self, VALUE other);
|
|
38
38
|
VALUE rb_rational_floor(VALUE self, int ndigits);
|
|
39
39
|
VALUE rb_numeric_quo(VALUE x, VALUE y);
|
|
40
|
-
VALUE rb_flo_round_by_rational(
|
|
40
|
+
VALUE rb_flo_round_by_rational(VALUE num, int ndigits, enum ruby_num_rounding_mode mode);
|
|
41
|
+
VALUE rb_flo_ceil_by_rational(VALUE num, int ndigits);
|
|
42
|
+
VALUE rb_flo_floor_by_rational(VALUE num, int ndigits);
|
|
41
43
|
VALUE rb_float_numerator(VALUE x);
|
|
42
44
|
VALUE rb_float_denominator(VALUE x);
|
|
43
45
|
|
|
@@ -56,8 +56,8 @@ VALUE rb_mutex_owned_p(VALUE self);
|
|
|
56
56
|
VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid);
|
|
57
57
|
void ruby_mn_threads_params(void);
|
|
58
58
|
|
|
59
|
-
int rb_thread_io_wait(struct rb_io *io, int events, struct timeval * timeout);
|
|
60
|
-
int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
|
|
59
|
+
int rb_thread_io_wait(struct rb_thread_struct *th, struct rb_io *io, int events, struct timeval * timeout);
|
|
60
|
+
int rb_thread_wait_for_single_fd(struct rb_thread_struct *th, int fd, int events, struct timeval * timeout);
|
|
61
61
|
|
|
62
62
|
size_t rb_thread_io_close_interrupt(struct rb_io *);
|
|
63
63
|
void rb_thread_io_close_wait(struct rb_io *);
|
|
@@ -27,11 +27,8 @@ struct timeval rb_time_timeval(VALUE);
|
|
|
27
27
|
|
|
28
28
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
29
29
|
/* time.c (export) */
|
|
30
|
-
void ruby_reset_leap_second_info(void);
|
|
31
|
-
#ifdef RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY
|
|
32
|
-
RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY()
|
|
33
|
-
#endif
|
|
34
|
-
void ruby_reset_timezone(const char *);
|
|
35
30
|
RUBY_SYMBOL_EXPORT_END
|
|
36
31
|
|
|
32
|
+
void ruby_reset_timezone(const char *);
|
|
33
|
+
|
|
37
34
|
#endif /* INTERNAL_TIME_H */
|
|
@@ -29,6 +29,7 @@ rb_gvar_setter_t *rb_gvar_setter_function_of(ID);
|
|
|
29
29
|
void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
|
|
30
30
|
void rb_gvar_ractor_local(const char *name);
|
|
31
31
|
void rb_gvar_box_ready(const char *name);
|
|
32
|
+
void rb_gvar_box_dynamic(const char *name);
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Sets the name of a module.
|
|
@@ -51,6 +52,7 @@ void rb_obj_init_too_complex(VALUE obj, st_table *table);
|
|
|
51
52
|
void rb_evict_ivars_to_hash(VALUE obj);
|
|
52
53
|
VALUE rb_obj_field_get(VALUE obj, shape_id_t target_shape_id);
|
|
53
54
|
void rb_ivar_set_internal(VALUE obj, ID id, VALUE val);
|
|
55
|
+
void rb_ivar_foreach_buffered(VALUE obj, int (*func)(ID name, VALUE val, st_data_t arg), st_data_t arg);
|
|
54
56
|
attr_index_t rb_ivar_set_index(VALUE obj, ID id, VALUE val);
|
|
55
57
|
attr_index_t rb_obj_field_set(VALUE obj, shape_id_t target_shape_id, ID field_name, VALUE val);
|
|
56
58
|
VALUE rb_ivar_get_at(VALUE obj, attr_index_t index, ID id);
|
|
@@ -69,6 +69,7 @@ const char *rb_type_str(enum ruby_value_type type);
|
|
|
69
69
|
VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
|
|
70
70
|
VALUE rb_check_funcall_basic_kw(VALUE, ID, VALUE, int, const VALUE*, int);
|
|
71
71
|
VALUE rb_yield_1(VALUE val);
|
|
72
|
+
VALUE rb_ec_yield(struct rb_execution_context_struct *ec, VALUE val);
|
|
72
73
|
VALUE rb_yield_force_blockarg(VALUE values);
|
|
73
74
|
VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
|
|
74
75
|
rb_block_call_func_t bl_proc, int min_argc, int max_argc,
|
|
@@ -78,6 +79,7 @@ void rb_check_stack_overflow(void);
|
|
|
78
79
|
VALUE rb_block_call2(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, VALUE data2, long flags);
|
|
79
80
|
struct vm_ifunc *rb_current_ifunc(void);
|
|
80
81
|
VALUE rb_gccct_clear_table(VALUE);
|
|
82
|
+
VALUE rb_eval_cmd_call_kw(VALUE cmd, int argc, const VALUE *argv, int kw_splat);
|
|
81
83
|
|
|
82
84
|
#if USE_YJIT || USE_ZJIT
|
|
83
85
|
/* vm_exec.c */
|
|
@@ -190,10 +190,12 @@ const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
|
|
|
190
190
|
VALUE rb_iseq_ibf_load_extra_data(VALUE str);
|
|
191
191
|
void rb_iseq_init_trace(rb_iseq_t *iseq);
|
|
192
192
|
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);
|
|
193
|
-
int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval);
|
|
193
|
+
int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval, rb_ractor_t *r);
|
|
194
194
|
const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
|
|
195
195
|
const rb_iseq_t *rb_iseq_compile_iseq(VALUE str, VALUE fname);
|
|
196
196
|
int rb_iseq_opt_frozen_string_literal(void);
|
|
197
|
+
rb_hook_list_t *rb_iseq_local_hooks(const rb_iseq_t *iseq, rb_ractor_t *r, bool create);
|
|
198
|
+
|
|
197
199
|
|
|
198
200
|
#if VM_INSN_INFO_TABLE_IMPL == 2
|
|
199
201
|
unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body);
|
|
@@ -166,8 +166,8 @@ typedef struct rb_method_refined_struct {
|
|
|
166
166
|
|
|
167
167
|
typedef struct rb_method_bmethod_struct {
|
|
168
168
|
VALUE proc; /* should be marked */
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
rb_serial_t defined_ractor_id;
|
|
170
|
+
unsigned int local_hooks_cnt;
|
|
171
171
|
} rb_method_bmethod_t;
|
|
172
172
|
|
|
173
173
|
enum method_optimized_type {
|
|
@@ -208,6 +208,8 @@ struct rb_method_definition_struct {
|
|
|
208
208
|
};
|
|
209
209
|
|
|
210
210
|
struct rb_id_table;
|
|
211
|
+
struct rb_ractor_struct;
|
|
212
|
+
struct rb_hook_list_struct;
|
|
211
213
|
|
|
212
214
|
typedef struct rb_method_definition_struct rb_method_definition_t;
|
|
213
215
|
STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8);
|
|
@@ -267,5 +269,8 @@ void rb_vm_delete_cc_refinement(const struct rb_callcache *cc);
|
|
|
267
269
|
void rb_clear_method_cache(VALUE klass_or_module, ID mid);
|
|
268
270
|
void rb_clear_all_refinement_method_cache(void);
|
|
269
271
|
void rb_invalidate_method_caches(struct rb_id_table *cm_tbl, VALUE cc_tbl);
|
|
272
|
+
struct rb_hook_list_struct *rb_method_def_local_hooks(rb_method_definition_t *def, struct rb_ractor_struct *cr, bool create);
|
|
273
|
+
void rb_method_definition_addref(rb_method_definition_t *def);
|
|
274
|
+
void rb_method_definition_release(rb_method_definition_t *def);
|
|
270
275
|
|
|
271
276
|
#endif /* RUBY_METHOD_H */
|
|
@@ -1050,22 +1050,6 @@ typedef uint16_t pm_node_flags_t;
|
|
|
1050
1050
|
static const pm_node_flags_t PM_NODE_FLAG_NEWLINE = 0x1;
|
|
1051
1051
|
static const pm_node_flags_t PM_NODE_FLAG_STATIC_LITERAL = 0x2;
|
|
1052
1052
|
|
|
1053
|
-
/**
|
|
1054
|
-
* Cast the type to an enum to allow the compiler to provide exhaustiveness
|
|
1055
|
-
* checking.
|
|
1056
|
-
*/
|
|
1057
|
-
#define PM_NODE_TYPE(node) ((enum pm_node_type) (node)->type)
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Return true if the type of the given node matches the given type.
|
|
1061
|
-
*/
|
|
1062
|
-
#define PM_NODE_TYPE_P(node, type) (PM_NODE_TYPE(node) == (type))
|
|
1063
|
-
|
|
1064
|
-
/**
|
|
1065
|
-
* Return true if the given flag is set on the given node.
|
|
1066
|
-
*/
|
|
1067
|
-
#define PM_NODE_FLAG_P(node, flag) ((((pm_node_t *)(node))->flags & (flag)) != 0)
|
|
1068
|
-
|
|
1069
1053
|
/**
|
|
1070
1054
|
* This is the base structure that represents a node in the syntax tree. It is
|
|
1071
1055
|
* embedded into every node type.
|
|
@@ -1096,6 +1080,32 @@ typedef struct pm_node {
|
|
|
1096
1080
|
pm_location_t location;
|
|
1097
1081
|
} pm_node_t;
|
|
1098
1082
|
|
|
1083
|
+
/**
|
|
1084
|
+
* Cast the given node to the base pm_node_t type.
|
|
1085
|
+
*/
|
|
1086
|
+
#define PM_NODE_UPCAST(node_) ((pm_node_t *) (node_))
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Cast the type to an enum to allow the compiler to provide exhaustiveness
|
|
1090
|
+
* checking.
|
|
1091
|
+
*/
|
|
1092
|
+
#define PM_NODE_TYPE(node_) ((enum pm_node_type) (node_)->type)
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Return true if the type of the given node matches the given type.
|
|
1096
|
+
*/
|
|
1097
|
+
#define PM_NODE_TYPE_P(node_, type_) (PM_NODE_TYPE(node_) == (type_))
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Return the flags associated with the given node.
|
|
1101
|
+
*/
|
|
1102
|
+
#define PM_NODE_FLAGS(node_) (PM_NODE_UPCAST(node_)->flags)
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* Return true if the given flag is set on the given node.
|
|
1106
|
+
*/
|
|
1107
|
+
#define PM_NODE_FLAG_P(node_, flag_) ((PM_NODE_FLAGS(node_) & (flag_)) != 0)
|
|
1108
|
+
|
|
1099
1109
|
/**
|
|
1100
1110
|
* AliasGlobalVariableNode
|
|
1101
1111
|
*
|
|
@@ -4097,11 +4107,16 @@ typedef struct pm_forwarding_parameter_node {
|
|
|
4097
4107
|
/**
|
|
4098
4108
|
* ForwardingSuperNode
|
|
4099
4109
|
*
|
|
4100
|
-
* Represents the use of the `super` keyword without parentheses or arguments.
|
|
4110
|
+
* Represents the use of the `super` keyword without parentheses or arguments, but which might have a block.
|
|
4101
4111
|
*
|
|
4102
4112
|
* super
|
|
4103
4113
|
* ^^^^^
|
|
4104
4114
|
*
|
|
4115
|
+
* super { 123 }
|
|
4116
|
+
* ^^^^^^^^^^^^^
|
|
4117
|
+
*
|
|
4118
|
+
* If it has any other arguments, it would be a `SuperNode` instead.
|
|
4119
|
+
*
|
|
4105
4120
|
* Type: ::PM_FORWARDING_SUPER_NODE
|
|
4106
4121
|
*
|
|
4107
4122
|
* @extends pm_node_t
|
|
@@ -4113,6 +4128,8 @@ typedef struct pm_forwarding_super_node {
|
|
|
4113
4128
|
|
|
4114
4129
|
/**
|
|
4115
4130
|
* ForwardingSuperNode#block
|
|
4131
|
+
*
|
|
4132
|
+
* All other arguments are forwarded as normal, except the original block is replaced with the new block.
|
|
4116
4133
|
*/
|
|
4117
4134
|
struct pm_block_node *block;
|
|
4118
4135
|
} pm_forwarding_super_node_t;
|
|
@@ -7552,6 +7569,8 @@ typedef struct pm_string_node {
|
|
|
7552
7569
|
* super foo, bar
|
|
7553
7570
|
* ^^^^^^^^^^^^^^
|
|
7554
7571
|
*
|
|
7572
|
+
* If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead.
|
|
7573
|
+
*
|
|
7555
7574
|
* Type: ::PM_SUPER_NODE
|
|
7556
7575
|
*
|
|
7557
7576
|
* @extends pm_node_t
|
|
@@ -7573,6 +7592,8 @@ typedef struct pm_super_node {
|
|
|
7573
7592
|
|
|
7574
7593
|
/**
|
|
7575
7594
|
* SuperNode#arguments
|
|
7595
|
+
*
|
|
7596
|
+
* Can be only `nil` when there are empty parentheses, like `super()`.
|
|
7576
7597
|
*/
|
|
7577
7598
|
struct pm_arguments_node *arguments;
|
|
7578
7599
|
|
|
@@ -48,6 +48,8 @@ typedef enum {
|
|
|
48
48
|
PM_ERR_ARGUMENT_FORWARDING_UNBOUND,
|
|
49
49
|
PM_ERR_ARGUMENT_NO_FORWARDING_AMPERSAND,
|
|
50
50
|
PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES,
|
|
51
|
+
PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES_LAMBDA,
|
|
52
|
+
PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES_BLOCK,
|
|
51
53
|
PM_ERR_ARGUMENT_NO_FORWARDING_STAR,
|
|
52
54
|
PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR,
|
|
53
55
|
PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT,
|
|
@@ -97,8 +97,11 @@ typedef enum {
|
|
|
97
97
|
/** The vendored version of prism in CRuby 4.0.x. */
|
|
98
98
|
PM_OPTIONS_VERSION_CRUBY_4_0 = 3,
|
|
99
99
|
|
|
100
|
+
/** The vendored version of prism in CRuby 4.1.x. */
|
|
101
|
+
PM_OPTIONS_VERSION_CRUBY_4_1 = 4,
|
|
102
|
+
|
|
100
103
|
/** The current version of prism. */
|
|
101
|
-
PM_OPTIONS_VERSION_LATEST =
|
|
104
|
+
PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_1
|
|
102
105
|
} pm_options_version_t;
|
|
103
106
|
|
|
104
107
|
/**
|
|
@@ -314,7 +314,7 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint
|
|
|
314
314
|
* dependencies. It is currently being integrated into
|
|
315
315
|
* [CRuby](https://github.com/ruby/ruby),
|
|
316
316
|
* [JRuby](https://github.com/jruby/jruby),
|
|
317
|
-
* [TruffleRuby](https://github.com/
|
|
317
|
+
* [TruffleRuby](https://github.com/truffleruby/truffleruby),
|
|
318
318
|
* [Sorbet](https://github.com/sorbet/sorbet), and
|
|
319
319
|
* [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree).
|
|
320
320
|
*
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* The minor version of the Prism library as an int.
|
|
16
16
|
*/
|
|
17
|
-
#define PRISM_VERSION_MINOR
|
|
17
|
+
#define PRISM_VERSION_MINOR 8
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The patch version of the Prism library as an int.
|
|
21
21
|
*/
|
|
22
|
-
#define PRISM_VERSION_PATCH
|
|
22
|
+
#define PRISM_VERSION_PATCH 1
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The version of the Prism library as a constant string.
|
|
26
26
|
*/
|
|
27
|
-
#define PRISM_VERSION "1.
|
|
27
|
+
#define PRISM_VERSION "1.8.1"
|
|
28
28
|
|
|
29
29
|
#endif
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
#define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE)
|
|
10
10
|
#endif
|
|
11
11
|
|
|
12
|
+
// experimental flag because it is not sure it is the common pattern
|
|
13
|
+
#define RUBY_TYPED_FROZEN_SHAREABLE_NO_REC RUBY_FL_FINALIZE
|
|
14
|
+
|
|
12
15
|
struct rb_ractor_sync {
|
|
13
16
|
// ractor lock
|
|
14
17
|
rb_nativethread_lock_t lock;
|
|
@@ -88,6 +91,8 @@ struct rb_ractor_struct {
|
|
|
88
91
|
|
|
89
92
|
// ractor local data
|
|
90
93
|
|
|
94
|
+
rb_serial_t next_ec_serial;
|
|
95
|
+
|
|
91
96
|
st_table *local_storage;
|
|
92
97
|
struct rb_id_table *idkey_local_storage;
|
|
93
98
|
VALUE local_storage_store_lock;
|
|
@@ -139,6 +144,7 @@ VALUE rb_ractor_require(VALUE feature, bool silent);
|
|
|
139
144
|
VALUE rb_ractor_autoload_load(VALUE space, ID id);
|
|
140
145
|
|
|
141
146
|
VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name);
|
|
147
|
+
st_table *rb_ractor_targeted_hooks(rb_ractor_t *cr);
|
|
142
148
|
|
|
143
149
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
144
150
|
void rb_ractor_finish_marking(void);
|
|
@@ -245,6 +251,25 @@ rb_ractor_id(const rb_ractor_t *r)
|
|
|
245
251
|
return r->pub.id;
|
|
246
252
|
}
|
|
247
253
|
|
|
254
|
+
static inline void
|
|
255
|
+
rb_ractor_targeted_hooks_incr(rb_ractor_t *cr)
|
|
256
|
+
{
|
|
257
|
+
cr->pub.targeted_hooks_cnt++;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
static inline void
|
|
261
|
+
rb_ractor_targeted_hooks_decr(rb_ractor_t *cr)
|
|
262
|
+
{
|
|
263
|
+
RUBY_ASSERT(cr->pub.targeted_hooks_cnt > 0);
|
|
264
|
+
cr->pub.targeted_hooks_cnt--;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
static inline unsigned int
|
|
268
|
+
rb_ractor_targeted_hooks_cnt(rb_ractor_t *cr)
|
|
269
|
+
{
|
|
270
|
+
return cr->pub.targeted_hooks_cnt;
|
|
271
|
+
}
|
|
272
|
+
|
|
248
273
|
#if RACTOR_CHECK_MODE > 0
|
|
249
274
|
# define RACTOR_BELONGING_ID(obj) (*(uint32_t *)(((uintptr_t)(obj)) + rb_gc_obj_slot_size(obj)))
|
|
250
275
|
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
#define INTERNAL_ATOMIC_H
|
|
3
3
|
|
|
4
4
|
#include "ruby/atomic.h"
|
|
5
|
+
#ifdef HAVE_STDATOMIC_H
|
|
6
|
+
# include <stdatomic.h>
|
|
7
|
+
#endif
|
|
5
8
|
|
|
6
9
|
#define RUBY_ATOMIC_VALUE_LOAD(x) rbimpl_atomic_value_load(&(x), RBIMPL_ATOMIC_SEQ_CST)
|
|
7
10
|
|
|
@@ -43,6 +46,8 @@ rbimpl_atomic_u64_load_relaxed(const volatile rbimpl_atomic_uint64_t *value)
|
|
|
43
46
|
uint64_t val = *value;
|
|
44
47
|
return atomic_cas_64(value, val, val);
|
|
45
48
|
#else
|
|
49
|
+
// TODO: stdatomic
|
|
50
|
+
|
|
46
51
|
return *value;
|
|
47
52
|
#endif
|
|
48
53
|
}
|
|
@@ -58,6 +63,8 @@ rbimpl_atomic_u64_set_relaxed(volatile rbimpl_atomic_uint64_t *address, uint64_t
|
|
|
58
63
|
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
|
|
59
64
|
atomic_swap_64(address, value);
|
|
60
65
|
#else
|
|
66
|
+
// TODO: stdatomic
|
|
67
|
+
|
|
61
68
|
*address = value;
|
|
62
69
|
#endif
|
|
63
70
|
}
|
|
@@ -163,10 +163,8 @@ bool rb_shape_verify_consistency(VALUE obj, shape_id_t shape_id);
|
|
|
163
163
|
#endif
|
|
164
164
|
|
|
165
165
|
static inline void
|
|
166
|
-
|
|
166
|
+
RBASIC_SET_SHAPE_ID_NO_CHECKS(VALUE obj, shape_id_t shape_id)
|
|
167
167
|
{
|
|
168
|
-
RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj));
|
|
169
|
-
RUBY_ASSERT(!RB_TYPE_P(obj, T_IMEMO) || IMEMO_TYPE_P(obj, imemo_fields));
|
|
170
168
|
#if RBASIC_SHAPE_ID_FIELD
|
|
171
169
|
RBASIC(obj)->shape_id = (VALUE)shape_id;
|
|
172
170
|
#else
|
|
@@ -174,6 +172,16 @@ RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
|
|
|
174
172
|
RBASIC(obj)->flags &= SHAPE_FLAG_MASK;
|
|
175
173
|
RBASIC(obj)->flags |= ((VALUE)(shape_id) << SHAPE_FLAG_SHIFT);
|
|
176
174
|
#endif
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
static inline void
|
|
178
|
+
RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
|
|
179
|
+
{
|
|
180
|
+
RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj));
|
|
181
|
+
RUBY_ASSERT(!RB_TYPE_P(obj, T_IMEMO) || IMEMO_TYPE_P(obj, imemo_fields));
|
|
182
|
+
|
|
183
|
+
RBASIC_SET_SHAPE_ID_NO_CHECKS(obj, shape_id);
|
|
184
|
+
|
|
177
185
|
RUBY_ASSERT(rb_shape_verify_consistency(obj, shape_id));
|
|
178
186
|
}
|
|
179
187
|
|
|
@@ -217,7 +225,7 @@ shape_id_t rb_shape_transition_frozen(VALUE obj);
|
|
|
217
225
|
shape_id_t rb_shape_transition_complex(VALUE obj);
|
|
218
226
|
shape_id_t rb_shape_transition_remove_ivar(VALUE obj, ID id, shape_id_t *removed_shape_id);
|
|
219
227
|
shape_id_t rb_shape_transition_add_ivar(VALUE obj, ID id);
|
|
220
|
-
shape_id_t rb_shape_transition_add_ivar_no_warnings(VALUE
|
|
228
|
+
shape_id_t rb_shape_transition_add_ivar_no_warnings(VALUE klass, shape_id_t original_shape_id, ID id);
|
|
221
229
|
shape_id_t rb_shape_transition_object_id(VALUE obj);
|
|
222
230
|
shape_id_t rb_shape_transition_heap(VALUE obj, size_t heap_index);
|
|
223
231
|
shape_id_t rb_shape_object_id(shape_id_t original_shape_id);
|
|
@@ -367,23 +375,35 @@ ROBJECT_SET_FIELDS_HASH(VALUE obj, const st_table *tbl)
|
|
|
367
375
|
ROBJECT(obj)->as.heap.fields = (VALUE *)tbl;
|
|
368
376
|
}
|
|
369
377
|
|
|
378
|
+
static inline uint32_t
|
|
379
|
+
ROBJECT_FIELDS_COUNT_COMPLEX(VALUE obj)
|
|
380
|
+
{
|
|
381
|
+
return (uint32_t)rb_st_table_size(ROBJECT_FIELDS_HASH(obj));
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
static inline uint32_t
|
|
385
|
+
ROBJECT_FIELDS_COUNT_NOT_COMPLEX(VALUE obj)
|
|
386
|
+
{
|
|
387
|
+
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
388
|
+
RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
|
|
389
|
+
return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
|
|
390
|
+
}
|
|
391
|
+
|
|
370
392
|
static inline uint32_t
|
|
371
393
|
ROBJECT_FIELDS_COUNT(VALUE obj)
|
|
372
394
|
{
|
|
373
395
|
if (rb_shape_obj_too_complex_p(obj)) {
|
|
374
|
-
return (
|
|
396
|
+
return ROBJECT_FIELDS_COUNT_COMPLEX(obj);
|
|
375
397
|
}
|
|
376
398
|
else {
|
|
377
|
-
|
|
378
|
-
RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
|
|
379
|
-
return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
|
|
399
|
+
return ROBJECT_FIELDS_COUNT_NOT_COMPLEX(obj);
|
|
380
400
|
}
|
|
381
401
|
}
|
|
382
402
|
|
|
383
403
|
static inline uint32_t
|
|
384
404
|
RBASIC_FIELDS_COUNT(VALUE obj)
|
|
385
405
|
{
|
|
386
|
-
return RSHAPE(
|
|
406
|
+
return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
|
|
387
407
|
}
|
|
388
408
|
|
|
389
409
|
static inline bool
|
|
@@ -417,7 +437,7 @@ rb_shape_obj_has_fields(VALUE obj)
|
|
|
417
437
|
}
|
|
418
438
|
|
|
419
439
|
static inline bool
|
|
420
|
-
|
|
440
|
+
rb_obj_gen_fields_p(VALUE obj)
|
|
421
441
|
{
|
|
422
442
|
switch (TYPE(obj)) {
|
|
423
443
|
case T_NONE:
|
|
@@ -39,6 +39,7 @@ struct rb_thread_sched_waiting {
|
|
|
39
39
|
#else
|
|
40
40
|
uint64_t timeout;
|
|
41
41
|
#endif
|
|
42
|
+
uint32_t event_serial;
|
|
42
43
|
int fd; // -1 for timeout only
|
|
43
44
|
int result;
|
|
44
45
|
} data;
|
|
@@ -47,7 +48,7 @@ struct rb_thread_sched_waiting {
|
|
|
47
48
|
struct ccan_list_node node;
|
|
48
49
|
};
|
|
49
50
|
|
|
50
|
-
// per-
|
|
51
|
+
// per-Thread scheduler helper data
|
|
51
52
|
struct rb_thread_sched_item {
|
|
52
53
|
struct {
|
|
53
54
|
struct ccan_list_node ubf;
|
|
@@ -55,6 +56,9 @@ struct rb_thread_sched_item {
|
|
|
55
56
|
// connected to ractor->threads.sched.reqdyq
|
|
56
57
|
// locked by ractor->threads.sched.lock
|
|
57
58
|
struct ccan_list_node readyq;
|
|
59
|
+
// Indicates whether thread is on the readyq.
|
|
60
|
+
// There is no clear relationship between this and th->status.
|
|
61
|
+
bool is_ready;
|
|
58
62
|
|
|
59
63
|
// connected to vm->ractor.sched.timeslice_threads
|
|
60
64
|
// locked by vm->ractor.sched.lock
|
|
@@ -69,6 +73,7 @@ struct rb_thread_sched_item {
|
|
|
69
73
|
} node;
|
|
70
74
|
|
|
71
75
|
struct rb_thread_sched_waiting waiting_reason;
|
|
76
|
+
uint32_t event_serial;
|
|
72
77
|
|
|
73
78
|
bool finished;
|
|
74
79
|
bool malloc_stack;
|
|
@@ -125,6 +130,11 @@ struct rb_thread_sched {
|
|
|
125
130
|
struct rb_thread_struct *lock_owner;
|
|
126
131
|
#endif
|
|
127
132
|
struct rb_thread_struct *running; // running thread or NULL
|
|
133
|
+
// Most recently running thread or NULL. If this thread wakes up before the newly running
|
|
134
|
+
// thread completes the transfer of control, it can interrupt and resume running.
|
|
135
|
+
// The new thread clears this field when it takes control.
|
|
136
|
+
struct rb_thread_struct *runnable_hot_th;
|
|
137
|
+
int runnable_hot_th_waiting;
|
|
128
138
|
bool is_running;
|
|
129
139
|
bool is_running_timeslice;
|
|
130
140
|
bool enable_mn_threads;
|