Skip to content

Commit 7a09df4

Browse files
committed
Name the iseq->body->param struct and update bindings for JITs
This will make reading the parameters nicer for the JITs. Should be no-op for the C side.
1 parent aa9e15c commit 7a09df4

File tree

5 files changed

+787
-16
lines changed

5 files changed

+787
-16
lines changed

vm_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ struct rb_iseq_constant_body {
431431
* size = M+N+O+(*1)+K+(&1)+(**1) // parameter size.
432432
*/
433433

434-
struct {
434+
struct rb_iseq_parameters {
435435
struct {
436436
unsigned int has_lead : 1;
437437
unsigned int has_opt : 1;

yjit/src/cruby_bindings.inc.rs

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zjit/bindgen/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,12 @@ fn main() {
424424
.blocklist_type("VALUE")
425425
.blocklist_type("ID")
426426

427-
.opaque_type("rb_iseq_t")
428-
.blocklist_type("rb_iseq_t")
427+
// Avoid binding to stuff we don't use
428+
.blocklist_item("rb_thread_struct.*")
429+
.opaque_type("rb_thread_struct.*")
430+
.blocklist_item("iseq_inline_storage_entry_.*")
431+
.opaque_type("iseq_inline_storage_entry")
432+
.opaque_type("iseq_compile_data")
429433

430434
// Finish the builder and generate the bindings.
431435
.generate()

zjit/src/cruby.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub type RedefinitionFlag = u32;
104104

105105
#[allow(unsafe_op_in_unsafe_fn)]
106106
#[allow(dead_code)]
107+
#[allow(unnecessary_transmutes)] // https://github.com/rust-lang/rust-bindgen/issues/2807
107108
#[allow(clippy::all)] // warning meant to help with reading; not useful for generated code
108109
mod autogened {
109110
use super::*;
@@ -246,14 +247,6 @@ pub fn insn_len(opcode: usize) -> u32 {
246247
}
247248
}
248249

249-
/// Opaque iseq type for opaque iseq pointers from vm_core.h
250-
/// See: <https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs>
251-
#[repr(C)]
252-
pub struct rb_iseq_t {
253-
_data: [u8; 0],
254-
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
255-
}
256-
257250
/// An object handle similar to VALUE in the C code. Our methods assume
258251
/// that this is a handle. Sometimes the C code briefly uses VALUE as
259252
/// an unsigned integer type and don't necessarily store valid handles but

0 commit comments

Comments
 (0)