Skip to content

Commit 7be9a33

Browse files
jhawthornXrXr
andauthored
YJIT: Allow shareable consts in multi-ractor mode (ruby#11917)
* Update yjit-bindgen deps * YJIT: Allow shareable consts in multi-ractor mode * Update yjit/src/codegen.rs Co-authored-by: Alan Wu <[email protected]> --------- Co-authored-by: Alan Wu <[email protected]>
1 parent e17243d commit 7be9a33

File tree

8 files changed

+179
-209
lines changed

8 files changed

+179
-209
lines changed

vm_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ union ic_serial_entry {
230230
VALUE data[2];
231231
};
232232

233+
#define IMEMO_CONST_CACHE_SHAREABLE IMEMO_FL_USER0
234+
233235
// imemo_constcache
234236
struct iseq_inline_constant_cache_entry {
235237
VALUE flags;

vm_insnhelper.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6273,8 +6273,6 @@ rb_vm_opt_newarray_pack(rb_execution_context_t *ec, rb_num_t num, const VALUE *p
62736273

62746274
#undef id_cmp
62756275

6276-
#define IMEMO_CONST_CACHE_SHAREABLE IMEMO_FL_USER0
6277-
62786276
static void
62796277
vm_track_constant_cache(ID id, void *ic)
62806278
{

yjit.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,12 @@ rb_IMEMO_TYPE_P(VALUE imemo, enum imemo_type imemo_type)
10621062
return IMEMO_TYPE_P(imemo, imemo_type);
10631063
}
10641064

1065+
bool
1066+
rb_yjit_constcache_shareable(const struct iseq_inline_constant_cache_entry *ice)
1067+
{
1068+
return (ice->flags & IMEMO_CONST_CACHE_SHAREABLE) != 0;
1069+
}
1070+
10651071
void
10661072
rb_assert_cme_handle(VALUE handle)
10671073
{

0 commit comments

Comments
 (0)