2022-09-20 17:23:50 +03:00
|
|
|
# frozen_string_literal: true
|
2022-09-18 17:17:22 +03:00
|
|
|
# Part of this file is generated by tool/mjit/bindgen.rb.
|
|
|
|
# Run `make mjit-bindgen` to update code between "MJIT bindgen begin" and "MJIT bindgen end".
|
2022-09-18 15:45:58 +03:00
|
|
|
module RubyVM::MJIT
|
2022-11-14 11:29:28 +03:00
|
|
|
# This `class << C` section is for calling C functions. For importing variables
|
|
|
|
# or macros as is, please consider using tool/mjit/bindgen.rb instead.
|
2022-09-18 17:17:22 +03:00
|
|
|
class << C
|
2022-11-29 11:12:29 +03:00
|
|
|
def rb_hash_values(cdhash_addr)
|
|
|
|
Primitive.cexpr! 'rb_hash_values((VALUE)NUM2PTR(cdhash_addr))'
|
2022-09-18 17:17:22 +03:00
|
|
|
end
|
|
|
|
|
2022-11-29 11:33:49 +03:00
|
|
|
def builtin_compiler(buf, bf_ptr, index, stack_size, builtin_inline_p)
|
2022-11-29 23:46:21 +03:00
|
|
|
_bf_addr = bf_ptr.to_i
|
2022-11-29 11:33:49 +03:00
|
|
|
# Call "mjit_compile_invokebuiltin_for_#{func}" in mk_builtin_loader.rb
|
|
|
|
Primitive.cstmt! %{
|
2022-11-29 23:46:21 +03:00
|
|
|
RB_BUILTIN bf = (RB_BUILTIN)NUM2PTR(_bf_addr);
|
2022-11-29 11:33:49 +03:00
|
|
|
bf->compiler(buf, NIL_P(index) ? -1 : NUM2LONG(index), NUM2UINT(stack_size), RTEST(builtin_inline_p));
|
|
|
|
return Qnil;
|
|
|
|
}
|
2022-09-18 17:17:22 +03:00
|
|
|
end
|
|
|
|
|
2022-11-29 11:33:49 +03:00
|
|
|
def has_cache_for_send(cc_ptr, insn)
|
2022-11-29 23:46:21 +03:00
|
|
|
_cc_addr = cc_ptr.to_i
|
2022-11-29 11:33:49 +03:00
|
|
|
Primitive.cstmt! %{
|
|
|
|
extern bool rb_vm_opt_cfunc_p(CALL_CACHE cc, int insn);
|
2022-11-29 23:46:21 +03:00
|
|
|
CALL_CACHE cc = (CALL_CACHE)NUM2PTR(_cc_addr);
|
2022-11-29 11:33:49 +03:00
|
|
|
bool has_cache = vm_cc_cme(cc) != NULL &&
|
|
|
|
!(vm_cc_cme(cc)->def->type == VM_METHOD_TYPE_CFUNC && rb_vm_opt_cfunc_p(cc, NUM2INT(insn)));
|
|
|
|
return RBOOL(has_cache);
|
|
|
|
}
|
2022-09-18 17:17:22 +03:00
|
|
|
end
|
|
|
|
|
2022-10-13 00:37:02 +03:00
|
|
|
def rb_shape_get_shape_by_id(shape_id)
|
|
|
|
_shape_id = shape_id.to_i
|
|
|
|
shape_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_shape_get_shape_by_id((shape_id_t)NUM2UINT(_shape_id)))'
|
|
|
|
rb_shape_t.new(shape_addr)
|
|
|
|
end
|
|
|
|
|
2022-09-18 17:17:22 +03:00
|
|
|
def rb_iseq_check(iseq)
|
|
|
|
_iseq_addr = iseq.to_i
|
|
|
|
iseq_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_iseq_check((rb_iseq_t *)NUM2PTR(_iseq_addr)))'
|
|
|
|
rb_iseq_t.new(iseq_addr)
|
|
|
|
end
|
|
|
|
|
|
|
|
def rb_iseq_path(iseq)
|
|
|
|
_iseq_addr = iseq.to_i
|
|
|
|
Primitive.cexpr! 'rb_iseq_path((rb_iseq_t *)NUM2PTR(_iseq_addr))'
|
|
|
|
end
|
|
|
|
|
2022-09-25 11:07:18 +03:00
|
|
|
def rb_iseq_first_lineno(iseq)
|
|
|
|
_iseq_addr = iseq.to_i
|
|
|
|
Primitive.cexpr! 'rb_iseq_first_lineno((rb_iseq_t *)NUM2PTR(_iseq_addr))'
|
|
|
|
end
|
|
|
|
|
2022-09-18 17:17:22 +03:00
|
|
|
def vm_ci_argc(ci)
|
|
|
|
_ci_addr = ci.to_i
|
|
|
|
Primitive.cexpr! 'UINT2NUM(vm_ci_argc((CALL_INFO)NUM2PTR(_ci_addr)))'
|
|
|
|
end
|
|
|
|
|
|
|
|
def vm_ci_flag(ci)
|
|
|
|
_ci_addr = ci.to_i
|
|
|
|
Primitive.cexpr! 'UINT2NUM(vm_ci_flag((CALL_INFO)NUM2PTR(_ci_addr)))'
|
|
|
|
end
|
|
|
|
|
|
|
|
def rb_splat_or_kwargs_p(ci)
|
|
|
|
_ci_addr = ci.to_i
|
2022-11-29 11:21:27 +03:00
|
|
|
Primitive.cstmt! %{
|
|
|
|
extern bool rb_splat_or_kwargs_p(const struct rb_callinfo *restrict ci);
|
|
|
|
return RBOOL(rb_splat_or_kwargs_p((CALL_INFO)NUM2PTR(_ci_addr)));
|
|
|
|
}
|
2022-09-18 17:17:22 +03:00
|
|
|
end
|
|
|
|
|
2022-11-29 11:33:49 +03:00
|
|
|
# Returns true if iseq can use fastpath for setup, otherwise NULL. This becomes true in the same condition
|
|
|
|
# as CC_SET_FASTPATH (in vm_callee_setup_arg) is called from vm_call_iseq_setup.
|
|
|
|
def fastpath_applied_iseq_p(ci_ptr, cc_ptr, iseq_ptr)
|
2022-11-29 23:46:21 +03:00
|
|
|
_ci_addr = ci_ptr.to_i
|
|
|
|
_cc_addr = cc_ptr.to_i
|
|
|
|
_iseq_addr = iseq_ptr.to_i
|
2022-11-29 11:33:49 +03:00
|
|
|
Primitive.cstmt! %q{
|
|
|
|
extern bool rb_simple_iseq_p(const rb_iseq_t *iseq);
|
2022-11-29 23:46:21 +03:00
|
|
|
CALL_INFO ci = (CALL_INFO)NUM2PTR(_ci_addr);
|
|
|
|
CALL_CACHE cc = (CALL_CACHE)NUM2PTR(_cc_addr);
|
|
|
|
const rb_iseq_t *iseq = (rb_iseq_t *)NUM2PTR(_iseq_addr);
|
2022-11-29 11:33:49 +03:00
|
|
|
|
|
|
|
bool result = iseq != NULL
|
|
|
|
&& !(vm_ci_flag(ci) & VM_CALL_KW_SPLAT) && rb_simple_iseq_p(iseq) // Top of vm_callee_setup_arg. In this case, opt_pc is 0.
|
|
|
|
&& vm_ci_argc(ci) == (unsigned int)ISEQ_BODY(iseq)->param.lead_num // exclude argument_arity_error (assumption: `calling->argc == ci->orig_argc` in send insns)
|
|
|
|
&& vm_call_iseq_optimizable_p(ci, cc); // CC_SET_FASTPATH condition
|
|
|
|
return RBOOL(result);
|
|
|
|
}
|
2022-09-18 17:17:22 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def mjit_opts
|
|
|
|
addr = Primitive.cexpr! 'PTR2NUM((VALUE)&mjit_opts)'
|
|
|
|
mjit_options.new(addr)
|
|
|
|
end
|
|
|
|
|
|
|
|
def mjit_call_attribute_sp_inc(insn, operands)
|
|
|
|
_operands_addr = operands.to_i
|
|
|
|
Primitive.cexpr! 'LONG2NUM(mjit_call_attribute_sp_inc(NUM2INT(insn), (VALUE *)NUM2PTR(_operands_addr)))'
|
|
|
|
end
|
|
|
|
|
|
|
|
def mjit_capture_cc_entries(compiled_body, captured_body)
|
|
|
|
_compiled_body_addr = compiled_body.to_i
|
|
|
|
_captured_body_addr = captured_body.to_i
|
2022-11-29 11:21:27 +03:00
|
|
|
Primitive.cstmt! %{
|
|
|
|
extern int mjit_capture_cc_entries(const struct rb_iseq_constant_body *compiled_iseq, const struct rb_iseq_constant_body *captured_iseq);
|
|
|
|
return INT2NUM(mjit_capture_cc_entries((struct rb_iseq_constant_body *)NUM2PTR(_compiled_body_addr), (struct rb_iseq_constant_body *)NUM2PTR(_captured_body_addr)));
|
|
|
|
}
|
2022-09-18 17:17:22 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
# Convert encoded VM pointers to insn BINs.
|
|
|
|
def rb_vm_insn_decode(encoded)
|
|
|
|
Primitive.cexpr! 'INT2NUM(rb_vm_insn_decode(NUM2PTR(encoded)))'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Convert insn BINs to encoded VM pointers. This one is not used by the compiler, but useful for debugging.
|
|
|
|
def rb_vm_insn_encode(bin)
|
|
|
|
Primitive.cexpr! 'PTR2NUM((VALUE)rb_vm_get_insns_address_table()[NUM2INT(bin)])'
|
|
|
|
end
|
|
|
|
|
|
|
|
def insn_may_depend_on_sp_or_pc(insn, opes)
|
|
|
|
_opes_addr = opes.to_i
|
|
|
|
Primitive.cexpr! 'RBOOL(insn_may_depend_on_sp_or_pc(NUM2INT(insn), (VALUE *)NUM2PTR(_opes_addr)))'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Convert Integer VALUE to an actual Ruby object
|
|
|
|
def to_ruby(value)
|
|
|
|
Primitive.cexpr! '(VALUE)NUM2PTR(value)'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Convert RubyVM::InstructionSequence to C.rb_iseq_t. Not used by the compiler, but useful for debugging.
|
|
|
|
def rb_iseqw_to_iseq(iseqw)
|
|
|
|
iseq_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_iseqw_to_iseq(iseqw))'
|
|
|
|
rb_iseq_t.new(iseq_addr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
### MJIT bindgen begin ###
|
|
|
|
|
2022-09-18 17:32:59 +03:00
|
|
|
def C.USE_LAZY_LOAD
|
|
|
|
Primitive.cexpr! %q{ RBOOL(USE_LAZY_LOAD != 0) }
|
|
|
|
end
|
2022-09-18 16:44:29 +03:00
|
|
|
|
2022-09-18 17:43:24 +03:00
|
|
|
def C.NOT_COMPILED_STACK_SIZE
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(NOT_COMPILED_STACK_SIZE) }
|
|
|
|
end
|
|
|
|
|
2022-09-18 17:32:59 +03:00
|
|
|
def C.VM_CALL_KW_SPLAT
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(VM_CALL_KW_SPLAT) }
|
|
|
|
end
|
2022-09-18 16:44:29 +03:00
|
|
|
|
2022-09-18 17:43:24 +03:00
|
|
|
def C.VM_CALL_KW_SPLAT_bit
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(VM_CALL_KW_SPLAT_bit) }
|
|
|
|
end
|
|
|
|
|
2022-09-18 17:32:59 +03:00
|
|
|
def C.VM_CALL_TAILCALL
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(VM_CALL_TAILCALL) }
|
|
|
|
end
|
2022-09-18 17:17:22 +03:00
|
|
|
|
2022-09-18 17:43:24 +03:00
|
|
|
def C.VM_CALL_TAILCALL_bit
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(VM_CALL_TAILCALL_bit) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.VM_METHOD_TYPE_CFUNC
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(VM_METHOD_TYPE_CFUNC) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.VM_METHOD_TYPE_ISEQ
|
|
|
|
Primitive.cexpr! %q{ INT2NUM(VM_METHOD_TYPE_ISEQ) }
|
|
|
|
end
|
|
|
|
|
2022-11-14 11:29:28 +03:00
|
|
|
def C.SHAPE_CAPACITY_CHANGE
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_CAPACITY_CHANGE) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.SHAPE_FLAG_SHIFT
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_FLAG_SHIFT) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.SHAPE_FROZEN
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_FROZEN) }
|
|
|
|
end
|
|
|
|
|
2022-11-18 21:29:41 +03:00
|
|
|
def C.SHAPE_ID_NUM_BITS
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_ID_NUM_BITS) }
|
|
|
|
end
|
|
|
|
|
2022-11-14 11:29:28 +03:00
|
|
|
def C.SHAPE_INITIAL_CAPACITY
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_INITIAL_CAPACITY) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.SHAPE_IVAR
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_IVAR) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.SHAPE_ROOT
|
|
|
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_ROOT) }
|
|
|
|
end
|
|
|
|
|
2022-10-03 18:14:32 +03:00
|
|
|
def C.INVALID_SHAPE_ID
|
|
|
|
Primitive.cexpr! %q{ ULONG2NUM(INVALID_SHAPE_ID) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.SHAPE_MASK
|
|
|
|
Primitive.cexpr! %q{ ULONG2NUM(SHAPE_MASK) }
|
|
|
|
end
|
|
|
|
|
2022-11-14 11:24:08 +03:00
|
|
|
def C.rb_cFalseClass
|
|
|
|
Primitive.cexpr! %q{ PTR2NUM(rb_cFalseClass) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cFloat
|
|
|
|
Primitive.cexpr! %q{ PTR2NUM(rb_cFloat) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cInteger
|
|
|
|
Primitive.cexpr! %q{ PTR2NUM(rb_cInteger) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cNilClass
|
|
|
|
Primitive.cexpr! %q{ PTR2NUM(rb_cNilClass) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cSymbol
|
|
|
|
Primitive.cexpr! %q{ PTR2NUM(rb_cSymbol) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cTrueClass
|
|
|
|
Primitive.cexpr! %q{ PTR2NUM(rb_cTrueClass) }
|
|
|
|
end
|
|
|
|
|
2022-09-19 03:25:04 +03:00
|
|
|
def C.CALL_DATA
|
|
|
|
@CALL_DATA ||= self.rb_call_data
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.IC
|
|
|
|
@IC ||= self.iseq_inline_constant_cache
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.IVC
|
|
|
|
@IVC ||= self.iseq_inline_iv_cache_entry
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.RB_BUILTIN
|
|
|
|
@RB_BUILTIN ||= self.rb_builtin_function
|
|
|
|
end
|
|
|
|
|
2022-10-03 18:14:32 +03:00
|
|
|
def C.attr_index_t
|
|
|
|
@attr_index_t ||= CType::Immediate.parse("uint32_t")
|
|
|
|
end
|
|
|
|
|
2022-09-19 03:25:04 +03:00
|
|
|
def C.compile_branch
|
|
|
|
@compile_branch ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"compile_branch", Primitive.cexpr!("SIZEOF(struct compile_branch)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
stack_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct compile_branch *)NULL)), stack_size)")],
|
|
|
|
finish_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_branch *)NULL)), finish_p)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.compile_status
|
|
|
|
@compile_status ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"compile_status", Primitive.cexpr!("SIZEOF(struct compile_status)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
success: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), success)")],
|
|
|
|
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: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), local_stack_p)")],
|
|
|
|
cc_entries_index: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), cc_entries_index)")],
|
|
|
|
compiled_iseq: [CType::Pointer.new { self.rb_iseq_constant_body }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compiled_iseq)")],
|
|
|
|
compiled_id: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compiled_id)")],
|
|
|
|
compile_info: [CType::Pointer.new { self.rb_mjit_compile_info }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), compile_info)")],
|
|
|
|
inlined_iseqs: [CType::Pointer.new { CType::Pointer.new { self.rb_iseq_constant_body } }, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), inlined_iseqs)")],
|
|
|
|
inline_context: [self.inlined_call_context, Primitive.cexpr!("OFFSETOF((*((struct compile_status *)NULL)), inline_context)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.inlined_call_context
|
|
|
|
@inlined_call_context ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"inlined_call_context", Primitive.cexpr!("SIZEOF(struct inlined_call_context)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
orig_argc: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), orig_argc)")],
|
|
|
|
me: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), me)")],
|
|
|
|
param_size: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), param_size)")],
|
|
|
|
local_size: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct inlined_call_context *)NULL)), local_size)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_inline_constant_cache
|
|
|
|
@iseq_inline_constant_cache ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"iseq_inline_constant_cache", Primitive.cexpr!("SIZEOF(struct iseq_inline_constant_cache)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
entry: [CType::Pointer.new { self.iseq_inline_constant_cache_entry }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache *)NULL)), entry)")],
|
|
|
|
segments: [CType::Pointer.new { self.ID }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache *)NULL)), segments)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_inline_constant_cache_entry
|
|
|
|
@iseq_inline_constant_cache_entry ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"iseq_inline_constant_cache_entry", Primitive.cexpr!("SIZEOF(struct iseq_inline_constant_cache_entry)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), flags)")],
|
|
|
|
value: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), value)")],
|
|
|
|
_unused1: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), _unused1)")],
|
|
|
|
_unused2: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), _unused2)")],
|
|
|
|
ic_cref: [CType::Pointer.new { self.rb_cref_t }, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_constant_cache_entry *)NULL)), ic_cref)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_inline_iv_cache_entry
|
|
|
|
@iseq_inline_iv_cache_entry ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"iseq_inline_iv_cache_entry", Primitive.cexpr!("SIZEOF(struct iseq_inline_iv_cache_entry)"),
|
2022-10-03 20:52:40 +03:00
|
|
|
value: [CType::Immediate.parse("uintptr_t"), Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_iv_cache_entry *)NULL)), value)")],
|
2022-12-06 22:52:11 +03:00
|
|
|
iv_set_name: [self.ID, Primitive.cexpr!("OFFSETOF((*((struct iseq_inline_iv_cache_entry *)NULL)), iv_set_name)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_inline_storage_entry
|
|
|
|
@iseq_inline_storage_entry ||= CType::Union.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"iseq_inline_storage_entry", Primitive.cexpr!("SIZEOF(union iseq_inline_storage_entry)"),
|
2022-09-19 03:25:04 +03:00
|
|
|
once: CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((union iseq_inline_storage_entry *)NULL)->once)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
running_thread: [CType::Pointer.new { self.rb_thread_struct }, Primitive.cexpr!("OFFSETOF(((union iseq_inline_storage_entry *)NULL)->once, running_thread)")],
|
|
|
|
value: [self.VALUE, Primitive.cexpr!("OFFSETOF(((union iseq_inline_storage_entry *)NULL)->once, value)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
),
|
|
|
|
ic_cache: self.iseq_inline_constant_cache,
|
|
|
|
iv_cache: self.iseq_inline_iv_cache_entry,
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.mjit_options
|
|
|
|
@mjit_options ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"mjit_options", Primitive.cexpr!("SIZEOF(struct mjit_options)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
on: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), on)")],
|
|
|
|
save_temps: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), save_temps)")],
|
|
|
|
warnings: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), warnings)")],
|
|
|
|
debug: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), debug)")],
|
|
|
|
debug_flags: [CType::Pointer.new { CType::Immediate.parse("char") }, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), debug_flags)")],
|
|
|
|
wait: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), wait)")],
|
2022-11-15 10:38:52 +03:00
|
|
|
call_threshold: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), call_threshold)")],
|
2022-09-22 16:25:33 +03:00
|
|
|
verbose: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), verbose)")],
|
|
|
|
max_cache_size: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), max_cache_size)")],
|
|
|
|
pause: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), pause)")],
|
|
|
|
custom: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct mjit_options *)NULL)), custom)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_builtin_function
|
|
|
|
@rb_builtin_function ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_builtin_function", Primitive.cexpr!("SIZEOF(struct rb_builtin_function)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
func_ptr: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), func_ptr)")],
|
|
|
|
argc: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), argc)")],
|
|
|
|
index: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), index)")],
|
|
|
|
name: [CType::Pointer.new { CType::Immediate.parse("char") }, Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), name)")],
|
|
|
|
compiler: [CType::Immediate.parse("void *"), Primitive.cexpr!("OFFSETOF((*((struct rb_builtin_function *)NULL)), compiler)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_call_data
|
|
|
|
@rb_call_data ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_call_data", Primitive.cexpr!("SIZEOF(struct rb_call_data)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
ci: [CType::Pointer.new { self.rb_callinfo }, Primitive.cexpr!("OFFSETOF((*((struct rb_call_data *)NULL)), ci)")],
|
|
|
|
cc: [CType::Pointer.new { self.rb_callcache }, Primitive.cexpr!("OFFSETOF((*((struct rb_call_data *)NULL)), cc)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_callable_method_entry_struct
|
|
|
|
@rb_callable_method_entry_struct ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_callable_method_entry_struct", Primitive.cexpr!("SIZEOF(struct rb_callable_method_entry_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), flags)")],
|
|
|
|
defined_class: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), defined_class)")],
|
|
|
|
def: [CType::Pointer.new { self.rb_method_definition_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), def)")],
|
|
|
|
called_id: [self.ID, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), called_id)")],
|
|
|
|
owner: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callable_method_entry_struct *)NULL)), owner)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_callcache
|
|
|
|
@rb_callcache ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_callcache", Primitive.cexpr!("SIZEOF(struct rb_callcache)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), flags)")],
|
|
|
|
klass: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), klass)")],
|
|
|
|
cme_: [CType::Pointer.new { self.rb_callable_method_entry_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), cme_)")],
|
|
|
|
call_: [self.vm_call_handler, Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), call_)")],
|
|
|
|
aux_: [CType::Union.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_callcache *)NULL)->aux_)"),
|
2022-10-03 18:14:32 +03:00
|
|
|
attr: CType::Struct.new(
|
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_callcache *)NULL)->aux_.attr)"),
|
2022-10-03 20:52:40 +03:00
|
|
|
value: [CType::Immediate.parse("uintptr_t"), Primitive.cexpr!("OFFSETOF(((struct rb_callcache *)NULL)->aux_.attr, value)")],
|
2022-10-03 18:14:32 +03:00
|
|
|
),
|
2022-09-19 03:25:04 +03:00
|
|
|
method_missing_reason: self.method_missing_reason,
|
|
|
|
v: self.VALUE,
|
2022-09-22 16:25:33 +03:00
|
|
|
), Primitive.cexpr!("OFFSETOF((*((struct rb_callcache *)NULL)), aux_)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_callinfo
|
|
|
|
@rb_callinfo ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_callinfo", Primitive.cexpr!("SIZEOF(struct rb_callinfo)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), flags)")],
|
|
|
|
kwarg: [CType::Pointer.new { self.rb_callinfo_kwarg }, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), kwarg)")],
|
|
|
|
mid: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), mid)")],
|
|
|
|
flag: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), flag)")],
|
|
|
|
argc: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_callinfo *)NULL)), argc)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_control_frame_t
|
|
|
|
@rb_control_frame_t ||= CType::Struct.new(
|
2022-09-22 15:39:54 +03:00
|
|
|
"rb_control_frame_struct", Primitive.cexpr!("SIZEOF(struct rb_control_frame_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
pc: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), pc)")],
|
|
|
|
sp: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), sp)")],
|
|
|
|
iseq: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), iseq)")],
|
|
|
|
self: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), self)")],
|
|
|
|
ep: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), ep)")],
|
|
|
|
block_code: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), block_code)")],
|
|
|
|
__bp__: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), __bp__)")],
|
|
|
|
jit_return: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_control_frame_struct *)NULL)), jit_return)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cref_t
|
|
|
|
@rb_cref_t ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_cref_struct", Primitive.cexpr!("SIZEOF(struct rb_cref_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), flags)")],
|
|
|
|
refinements: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), refinements)")],
|
|
|
|
klass_or_self: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), klass_or_self)")],
|
|
|
|
next: [CType::Pointer.new { self.rb_cref_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), next)")],
|
|
|
|
scope_visi: [self.rb_scope_visibility_t, Primitive.cexpr!("OFFSETOF((*((struct rb_cref_struct *)NULL)), scope_visi)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_execution_context_struct
|
|
|
|
@rb_execution_context_struct ||= CType::Struct.new(
|
2022-09-22 15:39:54 +03:00
|
|
|
"rb_execution_context_struct", Primitive.cexpr!("SIZEOF(struct rb_execution_context_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
vm_stack: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), vm_stack)")],
|
|
|
|
vm_stack_size: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), vm_stack_size)")],
|
|
|
|
cfp: [CType::Pointer.new { self.rb_control_frame_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), cfp)")],
|
|
|
|
tag: [CType::Pointer.new { self.rb_vm_tag }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), tag)")],
|
|
|
|
interrupt_flag: [self.rb_atomic_t, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), interrupt_flag)")],
|
|
|
|
interrupt_mask: [self.rb_atomic_t, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), interrupt_mask)")],
|
|
|
|
fiber_ptr: [CType::Pointer.new { self.rb_fiber_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), fiber_ptr)")],
|
|
|
|
thread_ptr: [CType::Pointer.new { self.rb_thread_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), thread_ptr)")],
|
|
|
|
local_storage: [CType::Pointer.new { self.rb_id_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage)")],
|
|
|
|
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: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), local_storage_recursive_hash_for_trace)")],
|
2022-12-01 13:00:33 +03:00
|
|
|
storage: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), storage)")],
|
2022-09-22 16:25:33 +03:00
|
|
|
root_lep: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), root_lep)")],
|
|
|
|
root_svar: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), root_svar)")],
|
|
|
|
ensure_list: [CType::Pointer.new { self.rb_ensure_list_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), ensure_list)")],
|
|
|
|
trace_arg: [CType::Pointer.new { self.rb_trace_arg_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), trace_arg)")],
|
|
|
|
errinfo: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), errinfo)")],
|
|
|
|
passed_block_handler: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), passed_block_handler)")],
|
|
|
|
raised_flag: [CType::Immediate.parse("uint8_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), raised_flag)")],
|
|
|
|
private_const_reference: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), private_const_reference)")],
|
|
|
|
machine: [CType::Struct.new(
|
2022-09-22 15:39:54 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_execution_context_struct *)NULL)->machine)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
stack_start: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_start)")],
|
|
|
|
stack_end: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_end)")],
|
|
|
|
stack_maxsize: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF(((struct rb_execution_context_struct *)NULL)->machine, stack_maxsize)")],
|
|
|
|
), Primitive.cexpr!("OFFSETOF((*((struct rb_execution_context_struct *)NULL)), machine)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_execution_context_t
|
|
|
|
@rb_execution_context_t ||= self.rb_execution_context_struct
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_iseq_constant_body
|
|
|
|
@rb_iseq_constant_body ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_iseq_constant_body", Primitive.cexpr!("SIZEOF(struct rb_iseq_constant_body)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
type: [self.rb_iseq_type, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), type)")],
|
|
|
|
iseq_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), iseq_size)")],
|
|
|
|
iseq_encoded: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), iseq_encoded)")],
|
|
|
|
param: [CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->param)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->param.flags)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
has_lead: [CType::BitField.new(1, 0), 0],
|
|
|
|
has_opt: [CType::BitField.new(1, 1), 1],
|
|
|
|
has_rest: [CType::BitField.new(1, 2), 2],
|
|
|
|
has_post: [CType::BitField.new(1, 3), 3],
|
|
|
|
has_kw: [CType::BitField.new(1, 4), 4],
|
|
|
|
has_kwrest: [CType::BitField.new(1, 5), 5],
|
|
|
|
has_block: [CType::BitField.new(1, 6), 6],
|
|
|
|
ambiguous_param0: [CType::BitField.new(1, 7), 7],
|
|
|
|
accepts_no_kwarg: [CType::BitField.new(1, 0), 8],
|
|
|
|
ruby2_keywords: [CType::BitField.new(1, 1), 9],
|
|
|
|
), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, flags)")],
|
|
|
|
size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, size)")],
|
|
|
|
lead_num: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, lead_num)")],
|
|
|
|
opt_num: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, opt_num)")],
|
|
|
|
rest_start: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, rest_start)")],
|
|
|
|
post_start: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, post_start)")],
|
|
|
|
post_num: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, post_num)")],
|
|
|
|
block_start: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, block_start)")],
|
|
|
|
opt_table: [CType::Pointer.new { self.VALUE }, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->param, opt_table)")],
|
|
|
|
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: [self.rb_iseq_location_t, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), location)")],
|
|
|
|
insns_info: [self.iseq_insn_info, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), insns_info)")],
|
|
|
|
local_table: [CType::Pointer.new { self.ID }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_table)")],
|
|
|
|
catch_table: [CType::Pointer.new { self.iseq_catch_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), catch_table)")],
|
|
|
|
parent_iseq: [CType::Pointer.new { self.rb_iseq_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), parent_iseq)")],
|
|
|
|
local_iseq: [CType::Pointer.new { self.rb_iseq_struct }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_iseq)")],
|
|
|
|
is_entries: [CType::Pointer.new { self.iseq_inline_storage_entry }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), is_entries)")],
|
|
|
|
call_data: [CType::Pointer.new { self.rb_call_data }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), call_data)")],
|
|
|
|
variable: [CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->variable)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flip_count: [self.rb_snum_t, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, flip_count)")],
|
|
|
|
script_lines: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, script_lines)")],
|
|
|
|
coverage: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, coverage)")],
|
|
|
|
pc2branchindex: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_constant_body *)NULL)->variable, pc2branchindex)")],
|
|
|
|
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: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), local_table_size)")],
|
|
|
|
ic_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ic_size)")],
|
|
|
|
ise_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ise_size)")],
|
|
|
|
ivc_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ivc_size)")],
|
|
|
|
icvarc_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), icvarc_size)")],
|
|
|
|
ci_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), ci_size)")],
|
|
|
|
stack_max: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), stack_max)")],
|
2022-12-01 22:51:18 +03:00
|
|
|
catch_except_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), catch_except_p)")],
|
|
|
|
builtin_inline_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), builtin_inline_p)")],
|
2022-09-22 16:25:33 +03:00
|
|
|
mark_bits: [CType::Union.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_constant_body *)NULL)->mark_bits)"),
|
2022-09-19 03:25:04 +03:00
|
|
|
list: CType::Pointer.new { self.iseq_bits_t },
|
|
|
|
single: self.iseq_bits_t,
|
2022-09-22 16:25:33 +03:00
|
|
|
), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mark_bits)")],
|
|
|
|
outer_variables: [CType::Pointer.new { self.rb_id_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), outer_variables)")],
|
|
|
|
mandatory_only_iseq: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mandatory_only_iseq)")],
|
|
|
|
jit_func: [CType::Immediate.parse("void *"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), jit_func)")],
|
|
|
|
total_calls: [CType::Immediate.parse("unsigned long"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), total_calls)")],
|
2022-12-09 10:41:12 +03:00
|
|
|
mjit_unit: [CType::Pointer.new { self.rb_mjit_unit }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_constant_body *)NULL)), mjit_unit)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_iseq_location_t
|
|
|
|
@rb_iseq_location_t ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_iseq_location_struct", Primitive.cexpr!("SIZEOF(struct rb_iseq_location_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
pathobj: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), pathobj)"), true],
|
|
|
|
base_label: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), base_label)"), true],
|
|
|
|
label: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), label)"), true],
|
2022-09-25 11:07:18 +03:00
|
|
|
first_lineno: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), first_lineno)"), true],
|
2022-09-22 16:25:33 +03:00
|
|
|
node_id: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), node_id)")],
|
|
|
|
code_location: [self.rb_code_location_t, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_location_struct *)NULL)), code_location)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_iseq_struct
|
|
|
|
@rb_iseq_struct ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_iseq_struct", Primitive.cexpr!("SIZEOF(struct rb_iseq_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
flags: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), flags)")],
|
|
|
|
wrapper: [self.VALUE, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), wrapper)")],
|
|
|
|
body: [CType::Pointer.new { self.rb_iseq_constant_body }, Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), body)")],
|
|
|
|
aux: [CType::Union.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux)"),
|
2022-09-19 03:25:04 +03:00
|
|
|
compile_data: CType::Pointer.new { self.iseq_compile_data },
|
|
|
|
loader: CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux.loader)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
obj: [self.VALUE, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.loader, obj)")],
|
|
|
|
index: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.loader, index)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
),
|
|
|
|
exec: CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_iseq_struct *)NULL)->aux.exec)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
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: [self.rb_event_flag_t, Primitive.cexpr!("OFFSETOF(((struct rb_iseq_struct *)NULL)->aux.exec, global_trace_events)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
),
|
2022-09-22 16:25:33 +03:00
|
|
|
), Primitive.cexpr!("OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_iseq_t
|
|
|
|
@rb_iseq_t ||= self.rb_iseq_struct
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_definition_struct
|
|
|
|
@rb_method_definition_struct ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_method_definition_struct", Primitive.cexpr!("SIZEOF(struct rb_method_definition_struct)"),
|
2022-11-15 11:11:44 +03:00
|
|
|
type: [CType::BitField.new(4, 0), 0],
|
2022-09-22 16:25:33 +03:00
|
|
|
iseq_overload: [CType::BitField.new(1, 4), 4],
|
|
|
|
alias_count: [CType::BitField.new(27, 5), 5],
|
|
|
|
complemented_count: [CType::BitField.new(28, 0), 32],
|
|
|
|
no_redef_warning: [CType::BitField.new(1, 4), 60],
|
|
|
|
body: [CType::Union.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"", Primitive.cexpr!("SIZEOF(((struct rb_method_definition_struct *)NULL)->body)"),
|
2022-09-19 03:25:04 +03:00
|
|
|
iseq: self.rb_method_iseq_t,
|
|
|
|
cfunc: self.rb_method_cfunc_t,
|
|
|
|
attr: self.rb_method_attr_t,
|
|
|
|
alias: self.rb_method_alias_t,
|
|
|
|
refined: self.rb_method_refined_t,
|
|
|
|
bmethod: self.rb_method_bmethod_t,
|
|
|
|
optimized: self.rb_method_optimized_t,
|
2022-09-22 16:25:33 +03:00
|
|
|
), Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), body)")],
|
|
|
|
original_id: [self.ID, Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), original_id)")],
|
|
|
|
method_serial: [CType::Immediate.parse("uintptr_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_method_definition_struct *)NULL)), method_serial)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_iseq_t
|
|
|
|
@rb_method_iseq_t ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_method_iseq_struct", Primitive.cexpr!("SIZEOF(struct rb_method_iseq_struct)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
iseqptr: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_method_iseq_struct *)NULL)), iseqptr)")],
|
|
|
|
cref: [CType::Pointer.new { self.rb_cref_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_method_iseq_struct *)NULL)), cref)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_type_t
|
2022-09-20 17:23:50 +03:00
|
|
|
@rb_method_type_t ||= CType::Immediate.parse("int")
|
2022-09-19 03:25:04 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_mjit_compile_info
|
|
|
|
@rb_mjit_compile_info ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_mjit_compile_info", Primitive.cexpr!("SIZEOF(struct rb_mjit_compile_info)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
disable_ivar_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_ivar_cache)")],
|
|
|
|
disable_exivar_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_exivar_cache)")],
|
|
|
|
disable_send_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_send_cache)")],
|
|
|
|
disable_inlining: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_inlining)")],
|
|
|
|
disable_const_cache: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_compile_info *)NULL)), disable_const_cache)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_mjit_unit
|
|
|
|
@rb_mjit_unit ||= CType::Struct.new(
|
2022-09-21 16:32:28 +03:00
|
|
|
"rb_mjit_unit", Primitive.cexpr!("SIZEOF(struct rb_mjit_unit)"),
|
2022-09-22 16:25:33 +03:00
|
|
|
unode: [self.ccan_list_node, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), unode)")],
|
|
|
|
id: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), id)")],
|
2022-12-09 09:53:27 +03:00
|
|
|
type: [self.rb_mjit_unit_type, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), type)")],
|
2022-09-22 16:25:33 +03:00
|
|
|
iseq: [CType::Pointer.new { self.rb_iseq_t }, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), iseq)")],
|
|
|
|
used_code_p: [self._Bool, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), used_code_p)")],
|
|
|
|
compile_info: [self.rb_mjit_compile_info, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), compile_info)")],
|
|
|
|
cc_entries: [CType::Pointer.new { CType::Pointer.new { self.rb_callcache } }, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), cc_entries)")],
|
|
|
|
cc_entries_size: [CType::Immediate.parse("unsigned int"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), cc_entries_size)")],
|
2022-12-11 09:21:06 +03:00
|
|
|
handle: [CType::Pointer.new { CType::Immediate.parse("void") }, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), handle)")],
|
|
|
|
units: [self.rb_mjit_unit_list, Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_unit *)NULL)), units)")],
|
2022-09-19 03:25:04 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_serial_t
|
2022-09-20 17:23:50 +03:00
|
|
|
@rb_serial_t ||= CType::Immediate.parse("unsigned long long")
|
|
|
|
end
|
|
|
|
|
2022-10-13 00:37:02 +03:00
|
|
|
def C.rb_shape
|
|
|
|
@rb_shape ||= CType::Struct.new(
|
|
|
|
"rb_shape", Primitive.cexpr!("SIZEOF(struct rb_shape)"),
|
|
|
|
edges: [CType::Pointer.new { self.rb_id_table }, Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), edges)")],
|
|
|
|
edge_name: [self.ID, Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), edge_name)")],
|
2022-10-21 23:24:29 +03:00
|
|
|
next_iv_index: [self.attr_index_t, Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), next_iv_index)")],
|
2022-11-08 23:35:31 +03:00
|
|
|
capacity: [CType::Immediate.parse("uint32_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), capacity)")],
|
2022-10-13 00:37:02 +03:00
|
|
|
type: [CType::Immediate.parse("uint8_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), type)")],
|
2022-11-08 23:35:31 +03:00
|
|
|
size_pool_index: [CType::Immediate.parse("uint8_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), size_pool_index)")],
|
2022-10-13 00:37:02 +03:00
|
|
|
parent_id: [self.shape_id_t, Primitive.cexpr!("OFFSETOF((*((struct rb_shape *)NULL)), parent_id)")],
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_shape_t
|
|
|
|
@rb_shape_t ||= self.rb_shape
|
|
|
|
end
|
|
|
|
|
2022-09-20 17:23:50 +03:00
|
|
|
def C.VALUE
|
|
|
|
@VALUE ||= CType::Immediate.find(Primitive.cexpr!("SIZEOF(VALUE)"), Primitive.cexpr!("SIGNED_TYPE_P(VALUE)"))
|
2022-09-19 03:25:04 +03:00
|
|
|
end
|
|
|
|
|
2022-10-03 18:14:32 +03:00
|
|
|
def C.shape_id_t
|
|
|
|
@shape_id_t ||= CType::Immediate.find(Primitive.cexpr!("SIZEOF(shape_id_t)"), Primitive.cexpr!("SIGNED_TYPE_P(shape_id_t)"))
|
|
|
|
end
|
|
|
|
|
2022-09-19 03:25:04 +03:00
|
|
|
def C._Bool
|
|
|
|
CType::Bool.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.ID
|
|
|
|
CType::Stub.new(:ID)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_thread_struct
|
|
|
|
CType::Stub.new(:rb_thread_struct)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.vm_call_handler
|
|
|
|
CType::Stub.new(:vm_call_handler)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.method_missing_reason
|
|
|
|
CType::Stub.new(:method_missing_reason)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_callinfo_kwarg
|
|
|
|
CType::Stub.new(:rb_callinfo_kwarg)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_cref_struct
|
|
|
|
CType::Stub.new(:rb_cref_struct)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_scope_visibility_t
|
|
|
|
CType::Stub.new(:rb_scope_visibility_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_vm_tag
|
|
|
|
CType::Stub.new(:rb_vm_tag)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_atomic_t
|
|
|
|
CType::Stub.new(:rb_atomic_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_fiber_t
|
|
|
|
CType::Stub.new(:rb_fiber_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_id_table
|
|
|
|
CType::Stub.new(:rb_id_table)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_ensure_list_t
|
|
|
|
CType::Stub.new(:rb_ensure_list_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_trace_arg_struct
|
|
|
|
CType::Stub.new(:rb_trace_arg_struct)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_iseq_type
|
|
|
|
CType::Stub.new(:rb_iseq_type)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_iseq_param_keyword
|
|
|
|
CType::Stub.new(:rb_iseq_param_keyword)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_insn_info
|
|
|
|
CType::Stub.new(:iseq_insn_info)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_catch_table
|
|
|
|
CType::Stub.new(:iseq_catch_table)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_snum_t
|
|
|
|
CType::Stub.new(:rb_snum_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_bits_t
|
|
|
|
CType::Stub.new(:iseq_bits_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_code_location_t
|
|
|
|
CType::Stub.new(:rb_code_location_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.iseq_compile_data
|
|
|
|
CType::Stub.new(:iseq_compile_data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_hook_list_struct
|
|
|
|
CType::Stub.new(:rb_hook_list_struct)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_event_flag_t
|
|
|
|
CType::Stub.new(:rb_event_flag_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_cfunc_t
|
|
|
|
CType::Stub.new(:rb_method_cfunc_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_attr_t
|
|
|
|
CType::Stub.new(:rb_method_attr_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_alias_t
|
|
|
|
CType::Stub.new(:rb_method_alias_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_refined_t
|
|
|
|
CType::Stub.new(:rb_method_refined_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_bmethod_t
|
|
|
|
CType::Stub.new(:rb_method_bmethod_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.rb_method_optimized_t
|
|
|
|
CType::Stub.new(:rb_method_optimized_t)
|
|
|
|
end
|
|
|
|
|
|
|
|
def C.ccan_list_node
|
|
|
|
CType::Stub.new(:ccan_list_node)
|
|
|
|
end
|
|
|
|
|
2022-12-09 09:53:27 +03:00
|
|
|
def C.rb_mjit_unit_type
|
|
|
|
CType::Stub.new(:rb_mjit_unit_type)
|
|
|
|
end
|
|
|
|
|
2022-12-11 09:21:06 +03:00
|
|
|
def C.rb_mjit_unit_list
|
|
|
|
CType::Stub.new(:rb_mjit_unit_list)
|
|
|
|
end
|
|
|
|
|
2022-09-18 17:17:22 +03:00
|
|
|
### MJIT bindgen end ###
|
2022-11-29 08:33:55 +03:00
|
|
|
end if RubyVM::MJIT.enabled? && RubyVM::MJIT.const_defined?(:C) # not defined for miniruby
|