add rb_execution_context

This commit is contained in:
Aaron Patterson 2022-09-21 12:27:59 -07:00 committed by Aaron Patterson
parent 083b4bb655
commit ec93d09c94
Notes: git 2022-09-22 14:21:02 +09:00
3 changed files with 104 additions and 4 deletions

View File

@ -216,6 +216,43 @@ module RubyVM::MJIT
)
end
def C.rb_execution_context_struct
@rb_execution_context_struct ||= CType::Struct.new(
"rb_execution_context_struct", 244,
vm_stack: [0, CType::Pointer.new { self.VALUE }],
vm_stack_size: [32, CType::Immediate.new(-4)],
cfp: [64, CType::Pointer.new { self.rb_control_frame_t }],
tag: [96, CType::Pointer.new { self.rb_vm_tag }],
interrupt_flag: [128, self.rb_atomic_t],
interrupt_mask: [160, self.rb_atomic_t],
fiber_ptr: [192, CType::Pointer.new { self.rb_fiber_t }],
thread_ptr: [224, CType::Pointer.new { self.rb_thread_struct }],
local_storage: [256, CType::Pointer.new { self.rb_id_table }],
local_storage_recursive_hash: [288, self.VALUE],
local_storage_recursive_hash_for_trace: [320, self.VALUE],
root_lep: [352, CType::Pointer.new { self.VALUE }],
root_svar: [384, self.VALUE],
ensure_list: [416, CType::Pointer.new { self.rb_ensure_list_t }],
trace_arg: [448, CType::Pointer.new { self.rb_trace_arg_struct }],
errinfo: [480, self.VALUE],
passed_block_handler: [512, self.VALUE],
raised_flag: [544, CType::Immediate.new(-2)],
method_missing_reason: [552, self.method_missing_reason],
private_const_reference: [576, self.VALUE],
machine: [608, CType::Struct.new(
"", 168,
stack_start: [0, CType::Pointer.new { self.VALUE }],
stack_end: [32, CType::Pointer.new { self.VALUE }],
stack_maxsize: [64, CType::Immediate.new(-4)],
regs: [96, self.jmp_buf],
)],
)
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(
"rb_iseq_constant_body", 204,
@ -414,6 +451,20 @@ module RubyVM::MJIT
def C.rb_scope_visibility_t = CType::Stub.new(:rb_scope_visibility_t)
def C.rb_vm_tag = CType::Stub.new(:rb_vm_tag)
def C.rb_atomic_t = CType::Stub.new(:rb_atomic_t)
def C.rb_fiber_t = CType::Stub.new(:rb_fiber_t)
def C.rb_id_table = CType::Stub.new(:rb_id_table)
def C.rb_ensure_list_t = CType::Stub.new(:rb_ensure_list_t)
def C.rb_trace_arg_struct = CType::Stub.new(:rb_trace_arg_struct)
def C.jmp_buf = CType::Stub.new(:jmp_buf)
def C.rb_iseq_type = CType::Stub.new(:rb_iseq_type)
def C.rb_iseq_param_keyword = CType::Stub.new(:rb_iseq_param_keyword)
@ -426,8 +477,6 @@ module RubyVM::MJIT
def C.iseq_bits_t = CType::Stub.new(:iseq_bits_t)
def C.rb_id_table = CType::Stub.new(:rb_id_table)
def C.rb_code_location_t = CType::Stub.new(:rb_code_location_t)
def C.iseq_compile_data = CType::Stub.new(:iseq_compile_data)

View File

@ -216,6 +216,43 @@ module RubyVM::MJIT
)
end
def C.rb_execution_context_struct
@rb_execution_context_struct ||= CType::Struct.new(
"rb_execution_context_struct", 368,
vm_stack: [0, CType::Pointer.new { self.VALUE }],
vm_stack_size: [64, CType::Immediate.new(-5)],
cfp: [128, CType::Pointer.new { self.rb_control_frame_t }],
tag: [192, CType::Pointer.new { self.rb_vm_tag }],
interrupt_flag: [256, self.rb_atomic_t],
interrupt_mask: [288, self.rb_atomic_t],
fiber_ptr: [320, CType::Pointer.new { self.rb_fiber_t }],
thread_ptr: [384, CType::Pointer.new { self.rb_thread_struct }],
local_storage: [448, CType::Pointer.new { self.rb_id_table }],
local_storage_recursive_hash: [512, self.VALUE],
local_storage_recursive_hash_for_trace: [576, self.VALUE],
root_lep: [640, CType::Pointer.new { self.VALUE }],
root_svar: [704, self.VALUE],
ensure_list: [768, CType::Pointer.new { self.rb_ensure_list_t }],
trace_arg: [832, CType::Pointer.new { self.rb_trace_arg_struct }],
errinfo: [896, self.VALUE],
passed_block_handler: [960, self.VALUE],
raised_flag: [1024, CType::Immediate.new(-2)],
method_missing_reason: [1032, self.method_missing_reason],
private_const_reference: [1088, self.VALUE],
machine: [1152, CType::Struct.new(
"", 224,
stack_start: [0, CType::Pointer.new { self.VALUE }],
stack_end: [64, CType::Pointer.new { self.VALUE }],
stack_maxsize: [128, CType::Immediate.new(-5)],
regs: [192, self.jmp_buf],
)],
)
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(
"rb_iseq_constant_body", 336,
@ -415,6 +452,20 @@ module RubyVM::MJIT
def C.rb_scope_visibility_t = CType::Stub.new(:rb_scope_visibility_t)
def C.rb_vm_tag = CType::Stub.new(:rb_vm_tag)
def C.rb_atomic_t = CType::Stub.new(:rb_atomic_t)
def C.rb_fiber_t = CType::Stub.new(:rb_fiber_t)
def C.rb_id_table = CType::Stub.new(:rb_id_table)
def C.rb_ensure_list_t = CType::Stub.new(:rb_ensure_list_t)
def C.rb_trace_arg_struct = CType::Stub.new(:rb_trace_arg_struct)
def C.jmp_buf = CType::Stub.new(:jmp_buf)
def C.rb_iseq_type = CType::Stub.new(:rb_iseq_type)
def C.rb_iseq_param_keyword = CType::Stub.new(:rb_iseq_param_keyword)
@ -427,8 +478,6 @@ module RubyVM::MJIT
def C.iseq_bits_t = CType::Stub.new(:iseq_bits_t)
def C.rb_id_table = CType::Stub.new(:rb_id_table)
def C.rb_code_location_t = CType::Stub.new(:rb_code_location_t)
def C.iseq_compile_data = CType::Stub.new(:iseq_compile_data)

View File

@ -566,6 +566,8 @@ generator = BindingGenerator.new(
rb_callinfo
rb_cref_t
rb_control_frame_t
rb_execution_context_t
rb_execution_context_struct
rb_iseq_constant_body
rb_iseq_location_t
rb_iseq_struct