Swap the positions of offsetof and type

This commit is contained in:
Takashi Kokubun 2022-09-22 22:25:33 +09:00
parent dc5b536468
commit dfc311c0b3
Notes: git 2022-09-23 06:45:05 +09:00
3 changed files with 208 additions and 208 deletions

View File

@ -7,7 +7,7 @@ module RubyVM::MJIT
class Struct class Struct
# @param name [String] # @param name [String]
# @param sizeof [Integer] # @param sizeof [Integer]
# @param members [Hash{ Symbol => [Integer, RubyVM::MJIT::CType::*] }] # @param members [Hash{ Symbol => [RubyVM::MJIT::CType::*, Integer, TrueClass] }]
def initialize(addr, sizeof, members) def initialize(addr, sizeof, members)
@addr = addr @addr = addr
@sizeof = sizeof @sizeof = sizeof
@ -34,7 +34,7 @@ module RubyVM::MJIT
# TODO: remove this? # TODO: remove this?
# @param member [Symbol] # @param member [Symbol]
def [](member) def [](member)
offset, type = @members.fetch(member) type, offset = @members.fetch(member)
type.new(@addr + offset / 8) type.new(@addr + offset / 8)
end end
@ -43,7 +43,7 @@ module RubyVM::MJIT
# @param member [Symbol] # @param member [Symbol]
# @param value [Object] # @param value [Object]
def []=(member, value) def []=(member, value)
offset, type = @members.fetch(member) type, offset = @members.fetch(member)
type[@addr + offset / 8] = value type[@addr + offset / 8] = value
end end
@ -61,7 +61,7 @@ module RubyVM::MJIT
super(addr, sizeof, members) super(addr, sizeof, members)
end end
members.each do |member, (offset, type, to_ruby)| members.each do |member, (type, offset, to_ruby)|
# Intelligent API that does automatic dereference # Intelligent API that does automatic dereference
define_method(member) do define_method(member) do
value = self[member] value = self[member]

406
mjit_c.rb
View File

@ -179,63 +179,63 @@ module RubyVM::MJIT
def C.compile_branch def C.compile_branch
@compile_branch ||= CType::Struct.new( @compile_branch ||= CType::Struct.new(
"compile_branch", Primitive.cexpr!("SIZEOF(struct compile_branch)"), "compile_branch", Primitive.cexpr!("SIZEOF(struct compile_branch)"),
stack_size: [Primitive.cexpr!("OFFSETOF((*((struct compile_branch *)NULL)), stack_size)"), CType::Immediate.parse("unsigned int")], stack_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct compile_branch *)NULL)), stack_size)")],
finish_p: [Primitive.cexpr!("OFFSETOF((*((struct compile_branch *)NULL)), finish_p)"), self._Bool], finish_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_branch *)NULL)), finish_p)")],
) )
end end
def C.compile_status def C.compile_status
@compile_status ||= CType::Struct.new( @compile_status ||= CType::Struct.new(
"compile_status", Primitive.cexpr!("SIZEOF(struct compile_status)"), "compile_status", Primitive.cexpr!("SIZEOF(struct compile_status)"),
success: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), success)"), self._Bool], success: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), success)")],
stack_size_for_pos: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), stack_size_for_pos)"), CType::Pointer.new { CType::Immediate.parse("int") }], stack_size_for_pos: [CType::Pointer.new { CType::Immediate.parse("int") }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), stack_size_for_pos)")],
local_stack_p: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), local_stack_p)"), self._Bool], local_stack_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), local_stack_p)")],
is_entries: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), is_entries)"), CType::Pointer.new { self.iseq_inline_storage_entry }], is_entries: [CType::Pointer.new { self.iseq_inline_storage_entry }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), is_entries)")],
cc_entries_index: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), cc_entries_index)"), CType::Immediate.parse("int")], cc_entries_index: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), cc_entries_index)")],
compiled_iseq: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compiled_iseq)"), CType::Pointer.new { self.rb_iseq_constant_body }], compiled_iseq: [CType::Pointer.new { self.rb_iseq_constant_body }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compiled_iseq)")],
compiled_id: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compiled_id)"), CType::Immediate.parse("int")], compiled_id: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compiled_id)")],
compile_info: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compile_info)"), CType::Pointer.new { self.rb_mjit_compile_info }], compile_info: [CType::Pointer.new { self.rb_mjit_compile_info }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compile_info)")],
merge_ivar_guards_p: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), merge_ivar_guards_p)"), self._Bool], merge_ivar_guards_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), merge_ivar_guards_p)")],
ivar_serial: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), ivar_serial)"), self.rb_serial_t], ivar_serial: [self.rb_serial_t, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), ivar_serial)")],
max_ivar_index: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), max_ivar_index)"), CType::Immediate.parse("size_t")], max_ivar_index: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), max_ivar_index)")],
inlined_iseqs: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), inlined_iseqs)"), CType::Pointer.new { CType::Pointer.new { self.rb_iseq_constant_body } }], inlined_iseqs: [CType::Pointer.new { CType::Pointer.new { self.rb_iseq_constant_body } }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), inlined_iseqs)")],
inline_context: [Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), inline_context)"), self.inlined_call_context], inline_context: [self.inlined_call_context, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), inline_context)")],
) )
end end
def C.inlined_call_context def C.inlined_call_context
@inlined_call_context ||= CType::Struct.new( @inlined_call_context ||= CType::Struct.new(
"inlined_call_context", Primitive.cexpr!("SIZEOF(struct inlined_call_context)"), "inlined_call_context", Primitive.cexpr!("SIZEOF(struct inlined_call_context)"),
orig_argc: [Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), orig_argc)"), CType::Immediate.parse("int")], orig_argc: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), orig_argc)")],
me: [Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), me)"), self.VALUE], me: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), me)")],
param_size: [Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), param_size)"), CType::Immediate.parse("int")], param_size: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), param_size)")],
local_size: [Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), local_size)"), CType::Immediate.parse("int")], local_size: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), local_size)")],
) )
end end
def C.iseq_inline_constant_cache def C.iseq_inline_constant_cache
@iseq_inline_constant_cache ||= CType::Struct.new( @iseq_inline_constant_cache ||= CType::Struct.new(
"iseq_inline_constant_cache", Primitive.cexpr!("SIZEOF(struct iseq_inline_constant_cache)"), "iseq_inline_constant_cache", Primitive.cexpr!("SIZEOF(struct iseq_inline_constant_cache)"),
entry: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache *)NULL)), entry)"), CType::Pointer.new { self.iseq_inline_constant_cache_entry }], entry: [CType::Pointer.new { self.iseq_inline_constant_cache_entry }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache *)NULL)), entry)")],
segments: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache *)NULL)), segments)"), CType::Pointer.new { self.ID }], segments: [CType::Pointer.new { self.ID }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache *)NULL)), segments)")],
) )
end end
def C.iseq_inline_constant_cache_entry def C.iseq_inline_constant_cache_entry
@iseq_inline_constant_cache_entry ||= CType::Struct.new( @iseq_inline_constant_cache_entry ||= CType::Struct.new(
"iseq_inline_constant_cache_entry", Primitive.cexpr!("SIZEOF(struct iseq_inline_constant_cache_entry)"), "iseq_inline_constant_cache_entry", Primitive.cexpr!("SIZEOF(struct iseq_inline_constant_cache_entry)"),
flags: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), flags)"), self.VALUE], flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), flags)")],
value: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), value)"), self.VALUE], value: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), value)")],
_unused1: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), _unused1)"), self.VALUE], _unused1: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), _unused1)")],
_unused2: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), _unused2)"), self.VALUE], _unused2: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), _unused2)")],
ic_cref: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), ic_cref)"), CType::Pointer.new { self.rb_cref_t }], ic_cref: [CType::Pointer.new { self.rb_cref_t }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), ic_cref)")],
) )
end end
def C.iseq_inline_iv_cache_entry def C.iseq_inline_iv_cache_entry
@iseq_inline_iv_cache_entry ||= CType::Struct.new( @iseq_inline_iv_cache_entry ||= CType::Struct.new(
"iseq_inline_iv_cache_entry", Primitive.cexpr!("SIZEOF(struct iseq_inline_iv_cache_entry)"), "iseq_inline_iv_cache_entry", Primitive.cexpr!("SIZEOF(struct iseq_inline_iv_cache_entry)"),
entry: [Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_iv_cache_entry *)NULL)), entry)"), CType::Pointer.new { self.rb_iv_index_tbl_entry }], entry: [CType::Pointer.new { self.rb_iv_index_tbl_entry }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_iv_cache_entry *)NULL)), entry)")],
) )
end end
@ -244,8 +244,8 @@ module RubyVM::MJIT
"iseq_inline_storage_entry", Primitive.cexpr!("SIZEOF(union iseq_inline_storage_entry)"), "iseq_inline_storage_entry", Primitive.cexpr!("SIZEOF(union iseq_inline_storage_entry)"),
once: CType::Struct.new( once: CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((union iseq_inline_storage_entry *)NULL)->once)"), "", Primitive.cexpr!("SIZEOF(((union iseq_inline_storage_entry *)NULL)->once)"),
running_thread: [Primitive.cexpr!("OFFSETOF(((union iseq_inline_storage_entry *)NULL)->once, running_thread)"), CType::Pointer.new { self.rb_thread_struct }], running_thread: [CType::Pointer.new { self.rb_thread_struct }, Primitive.cexpr!("OFFSETOF(((union iseq_inline_storage_entry *)NULL)->once, running_thread)")],
value: [Primitive.cexpr!("OFFSETOF(((union iseq_inline_storage_entry *)NULL)->once, value)"), self.VALUE], value: [self.VALUE, Primitive.cexpr!("OFFSETOF(((union iseq_inline_storage_entry *)NULL)->once, value)")],
), ),
ic_cache: self.iseq_inline_constant_cache, ic_cache: self.iseq_inline_constant_cache,
iv_cache: self.iseq_inline_iv_cache_entry, iv_cache: self.iseq_inline_iv_cache_entry,
@ -255,132 +255,132 @@ module RubyVM::MJIT
def C.mjit_options def C.mjit_options
@mjit_options ||= CType::Struct.new( @mjit_options ||= CType::Struct.new(
"mjit_options", Primitive.cexpr!("SIZEOF(struct mjit_options)"), "mjit_options", Primitive.cexpr!("SIZEOF(struct mjit_options)"),
on: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), on)"), self._Bool], on: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), on)")],
save_temps: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), save_temps)"), self._Bool], save_temps: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), save_temps)")],
warnings: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), warnings)"), self._Bool], warnings: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), warnings)")],
debug: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), debug)"), self._Bool], debug: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), debug)")],
debug_flags: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), debug_flags)"), CType::Pointer.new { CType::Immediate.parse("char") }], debug_flags: [CType::Pointer.new { CType::Immediate.parse("char") }, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), debug_flags)")],
wait: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), wait)"), self._Bool], wait: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), wait)")],
min_calls: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), min_calls)"), CType::Immediate.parse("unsigned int")], min_calls: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), min_calls)")],
verbose: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), verbose)"), CType::Immediate.parse("int")], verbose: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), verbose)")],
max_cache_size: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), max_cache_size)"), CType::Immediate.parse("int")], max_cache_size: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), max_cache_size)")],
pause: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), pause)"), self._Bool], pause: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), pause)")],
custom: [Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), custom)"), self._Bool], custom: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), custom)")],
) )
end end
def C.rb_builtin_function def C.rb_builtin_function
@rb_builtin_function ||= CType::Struct.new( @rb_builtin_function ||= CType::Struct.new(
"rb_builtin_function", Primitive.cexpr!("SIZEOF(struct rb_builtin_function)"), "rb_builtin_function", Primitive.cexpr!("SIZEOF(struct rb_builtin_function)"),
func_ptr: [Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), func_ptr)"), CType::Pointer.new { CType::Immediate.parse("void") }], func_ptr: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), func_ptr)")],
argc: [Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), argc)"), CType::Immediate.parse("int")], argc: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), argc)")],
index: [Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), index)"), CType::Immediate.parse("int")], index: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), index)")],
name: [Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), name)"), CType::Pointer.new { CType::Immediate.parse("char") }], name: [CType::Pointer.new { CType::Immediate.parse("char") }, Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), name)")],
compiler: [Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), compiler)"), CType::Immediate.parse("void *")], compiler: [CType::Immediate.parse("void *"), Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), compiler)")],
) )
end end
def C.rb_call_data def C.rb_call_data
@rb_call_data ||= CType::Struct.new( @rb_call_data ||= CType::Struct.new(
"rb_call_data", Primitive.cexpr!("SIZEOF(struct rb_call_data)"), "rb_call_data", Primitive.cexpr!("SIZEOF(struct rb_call_data)"),
ci: [Primitive.cexpr!("OFFSETOF((*((struct rb_call_data *)NULL)), ci)"), CType::Pointer.new { self.rb_callinfo }], ci: [CType::Pointer.new { self.rb_callinfo }, Primitive.cexpr!("OFFSETOF((*((struct rb_call_data *)NULL)), ci)")],
cc: [Primitive.cexpr!("OFFSETOF((*((struct rb_call_data *)NULL)), cc)"), CType::Pointer.new { self.rb_callcache }], cc: [CType::Pointer.new { self.rb_callcache }, Primitive.cexpr!("OFFSETOF((*((struct rb_call_data *)NULL)), cc)")],
) )
end end
def C.rb_callable_method_entry_struct def C.rb_callable_method_entry_struct
@rb_callable_method_entry_struct ||= CType::Struct.new( @rb_callable_method_entry_struct ||= CType::Struct.new(
"rb_callable_method_entry_struct", Primitive.cexpr!("SIZEOF(struct rb_callable_method_entry_struct)"), "rb_callable_method_entry_struct", Primitive.cexpr!("SIZEOF(struct rb_callable_method_entry_struct)"),
flags: [Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), flags)"), self.VALUE], flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), flags)")],
defined_class: [Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), defined_class)"), self.VALUE], defined_class: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), defined_class)")],
def: [Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), def)"), CType::Pointer.new { self.rb_method_definition_struct }], def: [CType::Pointer.new { self.rb_method_definition_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), def)")],
called_id: [Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), called_id)"), self.ID], called_id: [self.ID, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), called_id)")],
owner: [Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), owner)"), self.VALUE], owner: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), owner)")],
) )
end end
def C.rb_callcache def C.rb_callcache
@rb_callcache ||= CType::Struct.new( @rb_callcache ||= CType::Struct.new(
"rb_callcache", Primitive.cexpr!("SIZEOF(struct rb_callcache)"), "rb_callcache", Primitive.cexpr!("SIZEOF(struct rb_callcache)"),
flags: [Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), flags)"), self.VALUE], flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), flags)")],
klass: [Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), klass)"), self.VALUE], klass: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), klass)")],
cme_: [Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), cme_)"), CType::Pointer.new { self.rb_callable_method_entry_struct }], cme_: [CType::Pointer.new { self.rb_callable_method_entry_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), cme_)")],
call_: [Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), call_)"), self.vm_call_handler], call_: [self.vm_call_handler, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), call_)")],
aux_: [Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), aux_)"), CType::Union.new( aux_: [CType::Union.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_callcache *)NULL)->aux_)"), "", Primitive.cexpr!("SIZEOF(((struct rb_callcache *)NULL)->aux_)"),
attr_index: CType::Immediate.parse("unsigned int"), attr_index: CType::Immediate.parse("unsigned int"),
method_missing_reason: self.method_missing_reason, method_missing_reason: self.method_missing_reason,
v: self.VALUE, v: self.VALUE,
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), aux_)")],
) )
end end
def C.rb_callinfo def C.rb_callinfo
@rb_callinfo ||= CType::Struct.new( @rb_callinfo ||= CType::Struct.new(
"rb_callinfo", Primitive.cexpr!("SIZEOF(struct rb_callinfo)"), "rb_callinfo", Primitive.cexpr!("SIZEOF(struct rb_callinfo)"),
flags: [Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), flags)"), self.VALUE], flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), flags)")],
kwarg: [Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), kwarg)"), CType::Pointer.new { self.rb_callinfo_kwarg }], kwarg: [CType::Pointer.new { self.rb_callinfo_kwarg }, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), kwarg)")],
mid: [Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), mid)"), self.VALUE], mid: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), mid)")],
flag: [Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), flag)"), self.VALUE], flag: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), flag)")],
argc: [Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), argc)"), self.VALUE], argc: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), argc)")],
) )
end end
def C.rb_control_frame_t def C.rb_control_frame_t
@rb_control_frame_t ||= CType::Struct.new( @rb_control_frame_t ||= CType::Struct.new(
"rb_control_frame_struct", Primitive.cexpr!("SIZEOF(struct rb_control_frame_struct)"), "rb_control_frame_struct", Primitive.cexpr!("SIZEOF(struct rb_control_frame_struct)"),
pc: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), pc)"), CType::Pointer.new { self.VALUE }], pc: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), pc)")],
sp: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), sp)"), CType::Pointer.new { self.VALUE }], sp: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), sp)")],
iseq: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), iseq)"), CType::Pointer.new { self.rb_iseq_t }], iseq: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), iseq)")],
self: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), self)"), self.VALUE], self: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), self)")],
ep: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), ep)"), CType::Pointer.new { self.VALUE }], ep: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), ep)")],
block_code: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), block_code)"), CType::Pointer.new { CType::Immediate.parse("void") }], block_code: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), block_code)")],
__bp__: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), __bp__)"), CType::Pointer.new { self.VALUE }], __bp__: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), __bp__)")],
jit_return: [Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), jit_return)"), CType::Pointer.new { CType::Immediate.parse("void") }], jit_return: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), jit_return)")],
) )
end end
def C.rb_cref_t def C.rb_cref_t
@rb_cref_t ||= CType::Struct.new( @rb_cref_t ||= CType::Struct.new(
"rb_cref_struct", Primitive.cexpr!("SIZEOF(struct rb_cref_struct)"), "rb_cref_struct", Primitive.cexpr!("SIZEOF(struct rb_cref_struct)"),
flags: [Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), flags)"), self.VALUE], flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), flags)")],
refinements: [Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), refinements)"), self.VALUE], refinements: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), refinements)")],
klass_or_self: [Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), klass_or_self)"), self.VALUE], klass_or_self: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), klass_or_self)")],
next: [Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), next)"), CType::Pointer.new { self.rb_cref_struct }], next: [CType::Pointer.new { self.rb_cref_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), next)")],
scope_visi: [Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), scope_visi)"), self.rb_scope_visibility_t], scope_visi: [self.rb_scope_visibility_t, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), scope_visi)")],
) )
end end
def C.rb_execution_context_struct def C.rb_execution_context_struct
@rb_execution_context_struct ||= CType::Struct.new( @rb_execution_context_struct ||= CType::Struct.new(
"rb_execution_context_struct", Primitive.cexpr!("SIZEOF(struct rb_execution_context_struct)"), "rb_execution_context_struct", Primitive.cexpr!("SIZEOF(struct rb_execution_context_struct)"),
vm_stack: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), vm_stack)"), CType::Pointer.new { self.VALUE }], vm_stack: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), vm_stack)")],
vm_stack_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), vm_stack_size)"), CType::Immediate.parse("size_t")], vm_stack_size: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), vm_stack_size)")],
cfp: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), cfp)"), CType::Pointer.new { self.rb_control_frame_t }], cfp: [CType::Pointer.new { self.rb_control_frame_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), cfp)")],
tag: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), tag)"), CType::Pointer.new { self.rb_vm_tag }], tag: [CType::Pointer.new { self.rb_vm_tag }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), tag)")],
interrupt_flag: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), interrupt_flag)"), self.rb_atomic_t], interrupt_flag: [self.rb_atomic_t, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), interrupt_flag)")],
interrupt_mask: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), interrupt_mask)"), self.rb_atomic_t], interrupt_mask: [self.rb_atomic_t, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), interrupt_mask)")],
fiber_ptr: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), fiber_ptr)"), CType::Pointer.new { self.rb_fiber_t }], fiber_ptr: [CType::Pointer.new { self.rb_fiber_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), fiber_ptr)")],
thread_ptr: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), thread_ptr)"), CType::Pointer.new { self.rb_thread_struct }], thread_ptr: [CType::Pointer.new { self.rb_thread_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), thread_ptr)")],
local_storage: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage)"), CType::Pointer.new { self.rb_id_table }], local_storage: [CType::Pointer.new { self.rb_id_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage)")],
local_storage_recursive_hash: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage_recursive_hash)"), self.VALUE], local_storage_recursive_hash: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage_recursive_hash)")],
local_storage_recursive_hash_for_trace: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage_recursive_hash_for_trace)"), self.VALUE], local_storage_recursive_hash_for_trace: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage_recursive_hash_for_trace)")],
root_lep: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), root_lep)"), CType::Pointer.new { self.VALUE }], root_lep: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), root_lep)")],
root_svar: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), root_svar)"), self.VALUE], root_svar: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), root_svar)")],
ensure_list: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), ensure_list)"), CType::Pointer.new { self.rb_ensure_list_t }], ensure_list: [CType::Pointer.new { self.rb_ensure_list_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), ensure_list)")],
trace_arg: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), trace_arg)"), CType::Pointer.new { self.rb_trace_arg_struct }], trace_arg: [CType::Pointer.new { self.rb_trace_arg_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), trace_arg)")],
errinfo: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), errinfo)"), self.VALUE], errinfo: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), errinfo)")],
passed_block_handler: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), passed_block_handler)"), self.VALUE], passed_block_handler: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), passed_block_handler)")],
raised_flag: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), raised_flag)"), CType::Immediate.parse("uint8_t")], raised_flag: [CType::Immediate.parse("uint8_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), raised_flag)")],
method_missing_reason: [nil, self.method_missing_reason], method_missing_reason: [self.method_missing_reason, nil],
private_const_reference: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), private_const_reference)"), self.VALUE], private_const_reference: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), private_const_reference)")],
machine: [Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), machine)"), CType::Struct.new( machine: [CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_execution_context_struct *)NULL)->machine)"), "", Primitive.cexpr!("SIZEOF(((struct rb_execution_context_struct *)NULL)->machine)"),
stack_start: [Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_start)"), CType::Pointer.new { self.VALUE }], stack_start: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_start)")],
stack_end: [Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_end)"), CType::Pointer.new { self.VALUE }], stack_end: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_end)")],
stack_maxsize: [Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_maxsize)"), CType::Immediate.parse("size_t")], stack_maxsize: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_maxsize)")],
regs: [Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, regs)"), CType::Immediate.parse("int")], regs: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, regs)")],
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), machine)")],
) )
end end
@ -391,105 +391,105 @@ module RubyVM::MJIT
def C.rb_iseq_constant_body def C.rb_iseq_constant_body
@rb_iseq_constant_body ||= CType::Struct.new( @rb_iseq_constant_body ||= CType::Struct.new(
"rb_iseq_constant_body", Primitive.cexpr!("SIZEOF(struct rb_iseq_constant_body)"), "rb_iseq_constant_body", Primitive.cexpr!("SIZEOF(struct rb_iseq_constant_body)"),
type: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), type)"), self.rb_iseq_type], type: [self.rb_iseq_type, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), type)")],
iseq_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), iseq_size)"), CType::Immediate.parse("unsigned int")], iseq_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), iseq_size)")],
iseq_encoded: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), iseq_encoded)"), CType::Pointer.new { self.VALUE }], iseq_encoded: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), iseq_encoded)")],
param: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), param)"), CType::Struct.new( param: [CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->param)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->param)"),
flags: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, flags)"), CType::Struct.new( flags: [CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->param.flags)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->param.flags)"),
has_lead: [0, CType::BitField.new(1, 0)], has_lead: [CType::BitField.new(1, 0), 0],
has_opt: [1, CType::BitField.new(1, 1)], has_opt: [CType::BitField.new(1, 1), 1],
has_rest: [2, CType::BitField.new(1, 2)], has_rest: [CType::BitField.new(1, 2), 2],
has_post: [3, CType::BitField.new(1, 3)], has_post: [CType::BitField.new(1, 3), 3],
has_kw: [4, CType::BitField.new(1, 4)], has_kw: [CType::BitField.new(1, 4), 4],
has_kwrest: [5, CType::BitField.new(1, 5)], has_kwrest: [CType::BitField.new(1, 5), 5],
has_block: [6, CType::BitField.new(1, 6)], has_block: [CType::BitField.new(1, 6), 6],
ambiguous_param0: [7, CType::BitField.new(1, 7)], ambiguous_param0: [CType::BitField.new(1, 7), 7],
accepts_no_kwarg: [8, CType::BitField.new(1, 0)], accepts_no_kwarg: [CType::BitField.new(1, 0), 8],
ruby2_keywords: [9, CType::BitField.new(1, 1)], ruby2_keywords: [CType::BitField.new(1, 1), 9],
)], ), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, flags)")],
size: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, size)"), CType::Immediate.parse("unsigned int")], size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, size)")],
lead_num: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, lead_num)"), CType::Immediate.parse("int")], lead_num: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, lead_num)")],
opt_num: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, opt_num)"), CType::Immediate.parse("int")], opt_num: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, opt_num)")],
rest_start: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, rest_start)"), CType::Immediate.parse("int")], rest_start: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, rest_start)")],
post_start: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, post_start)"), CType::Immediate.parse("int")], post_start: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, post_start)")],
post_num: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, post_num)"), CType::Immediate.parse("int")], post_num: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, post_num)")],
block_start: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, block_start)"), CType::Immediate.parse("int")], block_start: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, block_start)")],
opt_table: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, opt_table)"), CType::Pointer.new { self.VALUE }], opt_table: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, opt_table)")],
keyword: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, keyword)"), CType::Pointer.new { self.rb_iseq_param_keyword }], keyword: [CType::Pointer.new { self.rb_iseq_param_keyword }, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, keyword)")],
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), param)")],
location: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), location)"), self.rb_iseq_location_t], location: [self.rb_iseq_location_t, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), location)")],
insns_info: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), insns_info)"), self.iseq_insn_info], insns_info: [self.iseq_insn_info, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), insns_info)")],
local_table: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_table)"), CType::Pointer.new { self.ID }], local_table: [CType::Pointer.new { self.ID }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_table)")],
catch_table: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), catch_table)"), CType::Pointer.new { self.iseq_catch_table }], catch_table: [CType::Pointer.new { self.iseq_catch_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), catch_table)")],
parent_iseq: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), parent_iseq)"), CType::Pointer.new { self.rb_iseq_struct }], parent_iseq: [CType::Pointer.new { self.rb_iseq_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), parent_iseq)")],
local_iseq: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_iseq)"), CType::Pointer.new { self.rb_iseq_struct }], local_iseq: [CType::Pointer.new { self.rb_iseq_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_iseq)")],
is_entries: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), is_entries)"), CType::Pointer.new { self.iseq_inline_storage_entry }], is_entries: [CType::Pointer.new { self.iseq_inline_storage_entry }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), is_entries)")],
call_data: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), call_data)"), CType::Pointer.new { self.rb_call_data }], call_data: [CType::Pointer.new { self.rb_call_data }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), call_data)")],
variable: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), variable)"), CType::Struct.new( variable: [CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->variable)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->variable)"),
flip_count: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, flip_count)"), self.rb_snum_t], flip_count: [self.rb_snum_t, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, flip_count)")],
script_lines: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, script_lines)"), self.VALUE], script_lines: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, script_lines)")],
coverage: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, coverage)"), self.VALUE], coverage: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, coverage)")],
pc2branchindex: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, pc2branchindex)"), self.VALUE], pc2branchindex: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, pc2branchindex)")],
original_iseq: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, original_iseq)"), CType::Pointer.new { self.VALUE }], original_iseq: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, original_iseq)")],
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), variable)")],
local_table_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_table_size)"), CType::Immediate.parse("unsigned int")], local_table_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_table_size)")],
ic_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ic_size)"), CType::Immediate.parse("unsigned int")], ic_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ic_size)")],
ise_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ise_size)"), CType::Immediate.parse("unsigned int")], ise_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ise_size)")],
ivc_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ivc_size)"), CType::Immediate.parse("unsigned int")], ivc_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ivc_size)")],
icvarc_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), icvarc_size)"), CType::Immediate.parse("unsigned int")], icvarc_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), icvarc_size)")],
ci_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ci_size)"), CType::Immediate.parse("unsigned int")], ci_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ci_size)")],
stack_max: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), stack_max)"), CType::Immediate.parse("unsigned int")], stack_max: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), stack_max)")],
mark_bits: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mark_bits)"), CType::Union.new( mark_bits: [CType::Union.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->mark_bits)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->mark_bits)"),
list: CType::Pointer.new { self.iseq_bits_t }, list: CType::Pointer.new { self.iseq_bits_t },
single: self.iseq_bits_t, single: self.iseq_bits_t,
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mark_bits)")],
catch_except_p: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), catch_except_p)"), self._Bool], catch_except_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), catch_except_p)")],
builtin_inline_p: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), builtin_inline_p)"), self._Bool], builtin_inline_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), builtin_inline_p)")],
outer_variables: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), outer_variables)"), CType::Pointer.new { self.rb_id_table }], outer_variables: [CType::Pointer.new { self.rb_id_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), outer_variables)")],
mandatory_only_iseq: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mandatory_only_iseq)"), CType::Pointer.new { self.rb_iseq_t }], mandatory_only_iseq: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mandatory_only_iseq)")],
jit_func: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), jit_func)"), CType::Immediate.parse("void *")], jit_func: [CType::Immediate.parse("void *"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), jit_func)")],
total_calls: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), total_calls)"), CType::Immediate.parse("unsigned long")], total_calls: [CType::Immediate.parse("unsigned long"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), total_calls)")],
jit_unit: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), jit_unit)"), CType::Pointer.new { self.rb_mjit_unit }], jit_unit: [CType::Pointer.new { self.rb_mjit_unit }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), jit_unit)")],
yjit_payload: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), yjit_payload)"), CType::Pointer.new { CType::Immediate.parse("void") }], yjit_payload: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), yjit_payload)")],
) )
end end
def C.rb_iseq_location_t def C.rb_iseq_location_t
@rb_iseq_location_t ||= CType::Struct.new( @rb_iseq_location_t ||= CType::Struct.new(
"rb_iseq_location_struct", Primitive.cexpr!("SIZEOF(struct rb_iseq_location_struct)"), "rb_iseq_location_struct", Primitive.cexpr!("SIZEOF(struct rb_iseq_location_struct)"),
pathobj: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), pathobj)"), self.VALUE, true], pathobj: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), pathobj)"), true],
base_label: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), base_label)"), self.VALUE, true], base_label: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), base_label)"), true],
label: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), label)"), self.VALUE, true], label: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), label)"), true],
first_lineno: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), first_lineno)"), self.VALUE, true], first_lineno: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), first_lineno)"), true],
node_id: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), node_id)"), CType::Immediate.parse("int")], node_id: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), node_id)")],
code_location: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), code_location)"), self.rb_code_location_t], code_location: [self.rb_code_location_t, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), code_location)")],
) )
end end
def C.rb_iseq_struct def C.rb_iseq_struct
@rb_iseq_struct ||= CType::Struct.new( @rb_iseq_struct ||= CType::Struct.new(
"rb_iseq_struct", Primitive.cexpr!("SIZEOF(struct rb_iseq_struct)"), "rb_iseq_struct", Primitive.cexpr!("SIZEOF(struct rb_iseq_struct)"),
flags: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), flags)"), self.VALUE], flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), flags)")],
wrapper: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), wrapper)"), self.VALUE], wrapper: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), wrapper)")],
body: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), body)"), CType::Pointer.new { self.rb_iseq_constant_body }], body: [CType::Pointer.new { self.rb_iseq_constant_body }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), body)")],
aux: [Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)"), CType::Union.new( aux: [CType::Union.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux)"),
compile_data: CType::Pointer.new { self.iseq_compile_data }, compile_data: CType::Pointer.new { self.iseq_compile_data },
loader: CType::Struct.new( loader: CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux.loader)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux.loader)"),
obj: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.loader, obj)"), self.VALUE], obj: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.loader, obj)")],
index: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.loader, index)"), CType::Immediate.parse("int")], index: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.loader, index)")],
), ),
exec: CType::Struct.new( exec: CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux.exec)"), "", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux.exec)"),
local_hooks: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.exec, local_hooks)"), CType::Pointer.new { self.rb_hook_list_struct }], local_hooks: [CType::Pointer.new { self.rb_hook_list_struct }, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.exec, local_hooks)")],
global_trace_events: [Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.exec, global_trace_events)"), self.rb_event_flag_t], global_trace_events: [self.rb_event_flag_t, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.exec, global_trace_events)")],
), ),
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)")],
) )
end end
@ -500,21 +500,21 @@ module RubyVM::MJIT
def C.rb_iv_index_tbl_entry def C.rb_iv_index_tbl_entry
@rb_iv_index_tbl_entry ||= CType::Struct.new( @rb_iv_index_tbl_entry ||= CType::Struct.new(
"rb_iv_index_tbl_entry", Primitive.cexpr!("SIZEOF(struct rb_iv_index_tbl_entry)"), "rb_iv_index_tbl_entry", Primitive.cexpr!("SIZEOF(struct rb_iv_index_tbl_entry)"),
index: [Primitive.cexpr!("OFFSETOF((*((struct rb_iv_index_tbl_entry *)NULL)), index)"), CType::Immediate.parse("uint32_t")], index: [CType::Immediate.parse("uint32_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_iv_index_tbl_entry *)NULL)), index)")],
class_serial: [Primitive.cexpr!("OFFSETOF((*((struct rb_iv_index_tbl_entry *)NULL)), class_serial)"), self.rb_serial_t], class_serial: [self.rb_serial_t, Primitive.cexpr!("OFFSETOF((*((struct rb_iv_index_tbl_entry *)NULL)), class_serial)")],
class_value: [Primitive.cexpr!("OFFSETOF((*((struct rb_iv_index_tbl_entry *)NULL)), class_value)"), self.VALUE], class_value: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iv_index_tbl_entry *)NULL)), class_value)")],
) )
end end
def C.rb_method_definition_struct def C.rb_method_definition_struct
@rb_method_definition_struct ||= CType::Struct.new( @rb_method_definition_struct ||= CType::Struct.new(
"rb_method_definition_struct", Primitive.cexpr!("SIZEOF(struct rb_method_definition_struct)"), "rb_method_definition_struct", Primitive.cexpr!("SIZEOF(struct rb_method_definition_struct)"),
type: [0, self.rb_method_type_t], type: [self.rb_method_type_t, 0],
iseq_overload: [4, CType::BitField.new(1, 4)], iseq_overload: [CType::BitField.new(1, 4), 4],
alias_count: [5, CType::BitField.new(27, 5)], alias_count: [CType::BitField.new(27, 5), 5],
complemented_count: [32, CType::BitField.new(28, 0)], complemented_count: [CType::BitField.new(28, 0), 32],
no_redef_warning: [60, CType::BitField.new(1, 4)], no_redef_warning: [CType::BitField.new(1, 4), 60],
body: [Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), body)"), CType::Union.new( body: [CType::Union.new(
"", Primitive.cexpr!("SIZEOF(((struct rb_method_definition_struct *)NULL)->body)"), "", Primitive.cexpr!("SIZEOF(((struct rb_method_definition_struct *)NULL)->body)"),
iseq: self.rb_method_iseq_t, iseq: self.rb_method_iseq_t,
cfunc: self.rb_method_cfunc_t, cfunc: self.rb_method_cfunc_t,
@ -523,17 +523,17 @@ module RubyVM::MJIT
refined: self.rb_method_refined_t, refined: self.rb_method_refined_t,
bmethod: self.rb_method_bmethod_t, bmethod: self.rb_method_bmethod_t,
optimized: self.rb_method_optimized_t, optimized: self.rb_method_optimized_t,
)], ), Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), body)")],
original_id: [Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), original_id)"), self.ID], original_id: [self.ID, Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), original_id)")],
method_serial: [Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), method_serial)"), CType::Immediate.parse("uintptr_t")], method_serial: [CType::Immediate.parse("uintptr_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), method_serial)")],
) )
end end
def C.rb_method_iseq_t def C.rb_method_iseq_t
@rb_method_iseq_t ||= CType::Struct.new( @rb_method_iseq_t ||= CType::Struct.new(
"rb_method_iseq_struct", Primitive.cexpr!("SIZEOF(struct rb_method_iseq_struct)"), "rb_method_iseq_struct", Primitive.cexpr!("SIZEOF(struct rb_method_iseq_struct)"),
iseqptr: [Primitive.cexpr!("OFFSETOF((*((struct rb_method_iseq_struct *)NULL)), iseqptr)"), CType::Pointer.new { self.rb_iseq_t }], iseqptr: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_method_iseq_struct *)NULL)), iseqptr)")],
cref: [Primitive.cexpr!("OFFSETOF((*((struct rb_method_iseq_struct *)NULL)), cref)"), CType::Pointer.new { self.rb_cref_t }], cref: [CType::Pointer.new { self.rb_cref_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_method_iseq_struct *)NULL)), cref)")],
) )
end end
@ -544,26 +544,26 @@ module RubyVM::MJIT
def C.rb_mjit_compile_info def C.rb_mjit_compile_info
@rb_mjit_compile_info ||= CType::Struct.new( @rb_mjit_compile_info ||= CType::Struct.new(
"rb_mjit_compile_info", Primitive.cexpr!("SIZEOF(struct rb_mjit_compile_info)"), "rb_mjit_compile_info", Primitive.cexpr!("SIZEOF(struct rb_mjit_compile_info)"),
disable_ivar_cache: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_ivar_cache)"), self._Bool], disable_ivar_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_ivar_cache)")],
disable_exivar_cache: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_exivar_cache)"), self._Bool], disable_exivar_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_exivar_cache)")],
disable_send_cache: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_send_cache)"), self._Bool], disable_send_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_send_cache)")],
disable_inlining: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_inlining)"), self._Bool], disable_inlining: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_inlining)")],
disable_const_cache: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_const_cache)"), self._Bool], disable_const_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_const_cache)")],
) )
end end
def C.rb_mjit_unit def C.rb_mjit_unit
@rb_mjit_unit ||= CType::Struct.new( @rb_mjit_unit ||= CType::Struct.new(
"rb_mjit_unit", Primitive.cexpr!("SIZEOF(struct rb_mjit_unit)"), "rb_mjit_unit", Primitive.cexpr!("SIZEOF(struct rb_mjit_unit)"),
unode: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), unode)"), self.ccan_list_node], unode: [self.ccan_list_node, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), unode)")],
id: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), id)"), CType::Immediate.parse("int")], id: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), id)")],
handle: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), handle)"), CType::Pointer.new { CType::Immediate.parse("void") }], handle: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), handle)")],
iseq: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), iseq)"), CType::Pointer.new { self.rb_iseq_t }], iseq: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), iseq)")],
used_code_p: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), used_code_p)"), self._Bool], used_code_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), used_code_p)")],
compact_p: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), compact_p)"), self._Bool], compact_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), compact_p)")],
compile_info: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), compile_info)"), self.rb_mjit_compile_info], compile_info: [self.rb_mjit_compile_info, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), compile_info)")],
cc_entries: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), cc_entries)"), CType::Pointer.new { CType::Pointer.new { self.rb_callcache } }], cc_entries: [CType::Pointer.new { CType::Pointer.new { self.rb_callcache } }, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), cc_entries)")],
cc_entries_size: [Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), cc_entries_size)"), CType::Immediate.parse("unsigned int")], cc_entries_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), cc_entries_size)")],
) )
end end

View File

@ -219,7 +219,7 @@ class BindingGenerator
off_type = sizeof_type || "(*((#{node.type} *)NULL))" off_type = sizeof_type || "(*((#{node.type} *)NULL))"
offsetof = "Primitive.cexpr!(\"OFFSETOF(#{off_type}, #{field})\")" offsetof = "Primitive.cexpr!(\"OFFSETOF(#{off_type}, #{field})\")"
end end
" #{field}: [#{offsetof}, #{type}#{', true' if to_ruby}],\n" " #{field}: [#{type}, #{offsetof}#{', true' if to_ruby}],\n"
else else
" #{field}: #{type},\n" " #{field}: #{type},\n"
end end