Skip to content

Commit

Permalink
RJIT: Workaround USE_RVARGC=0 CI
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Mar 19, 2023
1 parent 32e0c97 commit c4e2718
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/ruby_vm/rjit/insn_compiler.rb
Expand Up @@ -2734,7 +2734,8 @@ def jit_rb_int_aref(jit, ctx, asm, argc, _known_recv_class)
# @param asm [RubyVM::RJIT::Assembler]
def jit_rb_str_empty_p(jit, ctx, asm, argc, known_recv_class)
# Assume same offset to len embedded or not so we can use one code path to read the length
assert_equal(C.RString.offsetof(:as, :heap, :len), C.RString.offsetof(:as, :embed, :len))
#assert_equal(C.RString.offsetof(:as, :heap, :len), C.RString.offsetof(:as, :embed, :len))
# `C.RString.offsetof(:as, :embed, :len)` doesn't work because of USE_RVARGC=0 CI

recv_opnd = ctx.stack_pop(1)
out_opnd = ctx.stack_push
Expand Down
5 changes: 0 additions & 5 deletions rjit_c.rb
Expand Up @@ -768,11 +768,6 @@ def C.RString
shared: self.VALUE,
), Primitive.cexpr!("OFFSETOF(((struct RString *)NULL)->as.heap, aux)")],
),
embed: CType::Struct.new(
"", Primitive.cexpr!("SIZEOF(((struct RString *)NULL)->as.embed)"),
len: [CType::Immediate.parse("long"), Primitive.cexpr!("OFFSETOF(((struct RString *)NULL)->as.embed, len)")],
ary: [CType::Pointer.new { CType::Immediate.parse("char") }, Primitive.cexpr!("OFFSETOF(((struct RString *)NULL)->as.embed, ary)")],
),
), Primitive.cexpr!("OFFSETOF((*((struct RString *)NULL)), as)")],
)
end
Expand Down
1 change: 1 addition & 0 deletions tool/rjit/bindgen.rb
Expand Up @@ -606,6 +606,7 @@ def push_target(target)
],
skip_fields: {
'rb_execution_context_struct.machine': %w[regs], # differs between macOS and Linux
'RString.as': %w[embed], # doesn't compile on USE_RVARGC=0 CI
rb_execution_context_struct: %w[method_missing_reason], # non-leading bit fields not supported
rb_iseq_constant_body: %w[yjit_payload], # conditionally defined
rb_thread_struct: %w[status locking_native_thread to_kill abort_on_exception report_on_exception pending_interrupt_queue_checked],
Expand Down

0 comments on commit c4e2718

Please sign in to comment.