mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Add rb_jit_vm_unlock and share it in ZJIT and YJIT
This commit is contained in:
parent
561050496c
commit
3f3a54efff
8
jit.c
8
jit.c
@ -484,3 +484,11 @@ rb_jit_vm_lock_then_barrier(unsigned int *recursive_lock_level, const char *file
|
||||
rb_vm_lock_enter(recursive_lock_level, file, line);
|
||||
rb_vm_barrier();
|
||||
}
|
||||
|
||||
// Release the VM lock. The lock level must point to the same integer used to
|
||||
// acquire the lock.
|
||||
void
|
||||
rb_jit_vm_unlock(unsigned int *recursive_lock_level, const char *file, int line)
|
||||
{
|
||||
rb_vm_lock_leave(recursive_lock_level, file, line);
|
||||
}
|
||||
|
||||
8
yjit.c
8
yjit.c
@ -686,14 +686,6 @@ rb_yjit_obj_written(VALUE old, VALUE young, const char *file, int line)
|
||||
rb_obj_written(old, Qundef, young, file, line);
|
||||
}
|
||||
|
||||
// Release the VM lock. The lock level must point to the same integer used to
|
||||
// acquire the lock.
|
||||
void
|
||||
rb_yjit_vm_unlock(unsigned int *recursive_lock_level, const char *file, int line)
|
||||
{
|
||||
rb_vm_lock_leave(recursive_lock_level, file, line);
|
||||
}
|
||||
|
||||
void
|
||||
rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception)
|
||||
{
|
||||
|
||||
@ -328,7 +328,6 @@ fn main() {
|
||||
.allowlist_function("rb_set_cfp_(pc|sp)")
|
||||
.allowlist_function("rb_c_method_tracing_currently_enabled")
|
||||
.allowlist_function("rb_full_cfunc_return")
|
||||
.allowlist_function("rb_yjit_vm_unlock")
|
||||
.allowlist_function("rb_assert_(iseq|cme)_handle")
|
||||
.allowlist_function("rb_IMEMO_TYPE_P")
|
||||
.allowlist_function("rb_yjit_constcache_shareable")
|
||||
@ -355,6 +354,7 @@ fn main() {
|
||||
.allowlist_function("rb_jit_shape_too_complex_p")
|
||||
.allowlist_function("rb_jit_multi_ractor_p")
|
||||
.allowlist_function("rb_jit_vm_lock_then_barrier")
|
||||
.allowlist_function("rb_jit_vm_unlock")
|
||||
.allowlist_type("robject_offsets")
|
||||
|
||||
// from vm_sync.h
|
||||
|
||||
@ -697,7 +697,7 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
unsafe { rb_yjit_vm_unlock(&mut recursive_lock_level, file, line) };
|
||||
unsafe { rb_jit_vm_unlock(&mut recursive_lock_level, file, line) };
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
10
yjit/src/cruby_bindings.inc.rs
generated
10
yjit/src/cruby_bindings.inc.rs
generated
@ -1226,11 +1226,6 @@ extern "C" {
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
pub fn rb_yjit_vm_unlock(
|
||||
recursive_lock_level: *mut ::std::os::raw::c_uint,
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
pub fn rb_object_shape_count() -> VALUE;
|
||||
pub fn rb_yjit_shape_obj_too_complex_p(obj: VALUE) -> bool;
|
||||
pub fn rb_yjit_shape_capacity(shape_id: shape_id_t) -> attr_index_t;
|
||||
@ -1328,4 +1323,9 @@ extern "C" {
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
pub fn rb_jit_vm_unlock(
|
||||
recursive_lock_level: *mut ::std::os::raw::c_uint,
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
}
|
||||
|
||||
7
zjit.c
7
zjit.c
@ -181,13 +181,6 @@ rb_zjit_constcache_shareable(const struct iseq_inline_constant_cache_entry *ice)
|
||||
return (ice->flags & IMEMO_CONST_CACHE_SHAREABLE) != 0;
|
||||
}
|
||||
|
||||
// Release the VM lock. The lock level must point to the same integer used to
|
||||
// acquire the lock.
|
||||
void
|
||||
rb_zjit_vm_unlock(unsigned int *recursive_lock_level, const char *file, int line)
|
||||
{
|
||||
rb_vm_lock_leave(recursive_lock_level, file, line);
|
||||
}
|
||||
|
||||
bool
|
||||
rb_zjit_mark_writable(void *mem_block, uint32_t mem_size)
|
||||
|
||||
@ -347,7 +347,6 @@ fn main() {
|
||||
.allowlist_function("rb_set_cfp_(pc|sp)")
|
||||
.allowlist_function("rb_c_method_tracing_currently_enabled")
|
||||
.allowlist_function("rb_full_cfunc_return")
|
||||
.allowlist_function("rb_zjit_vm_unlock")
|
||||
.allowlist_function("rb_assert_(iseq|cme)_handle")
|
||||
.allowlist_function("rb_IMEMO_TYPE_P")
|
||||
.allowlist_function("rb_iseq_reset_jit_func")
|
||||
@ -368,6 +367,7 @@ fn main() {
|
||||
.allowlist_function("rb_jit_shape_too_complex_p")
|
||||
.allowlist_function("rb_jit_multi_ractor_p")
|
||||
.allowlist_function("rb_jit_vm_lock_then_barrier")
|
||||
.allowlist_function("rb_jit_vm_unlock")
|
||||
.allowlist_type("robject_offsets")
|
||||
|
||||
// from vm_sync.h
|
||||
|
||||
@ -845,7 +845,7 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
unsafe { rb_zjit_vm_unlock(&mut recursive_lock_level, file, line) };
|
||||
unsafe { rb_jit_vm_unlock(&mut recursive_lock_level, file, line) };
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
10
zjit/src/cruby_bindings.inc.rs
generated
10
zjit/src/cruby_bindings.inc.rs
generated
@ -921,11 +921,6 @@ unsafe extern "C" {
|
||||
pub fn rb_zjit_profile_disable(iseq: *const rb_iseq_t);
|
||||
pub fn rb_vm_base_ptr(cfp: *mut rb_control_frame_struct) -> *mut VALUE;
|
||||
pub fn rb_zjit_constcache_shareable(ice: *const iseq_inline_constant_cache_entry) -> bool;
|
||||
pub fn rb_zjit_vm_unlock(
|
||||
recursive_lock_level: *mut ::std::os::raw::c_uint,
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
pub fn rb_zjit_mark_writable(mem_block: *mut ::std::os::raw::c_void, mem_size: u32) -> bool;
|
||||
pub fn rb_zjit_mark_executable(mem_block: *mut ::std::os::raw::c_void, mem_size: u32);
|
||||
pub fn rb_zjit_mark_unused(mem_block: *mut ::std::os::raw::c_void, mem_size: u32) -> bool;
|
||||
@ -1029,4 +1024,9 @@ unsafe extern "C" {
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
pub fn rb_jit_vm_unlock(
|
||||
recursive_lock_level: *mut ::std::os::raw::c_uint,
|
||||
file: *const ::std::os::raw::c_char,
|
||||
line: ::std::os::raw::c_int,
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user