From c4e2718763e1ab2d00f43b0797b4852b5ccf28c8 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 18 Mar 2023 23:42:58 -0700 Subject: [PATCH] RJIT: Workaround USE_RVARGC=0 CI --- lib/ruby_vm/rjit/insn_compiler.rb | 3 ++- rjit_c.rb | 5 ----- tool/rjit/bindgen.rb | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ruby_vm/rjit/insn_compiler.rb b/lib/ruby_vm/rjit/insn_compiler.rb index bbfc8c3d0a..f860eb1c71 100644 --- a/lib/ruby_vm/rjit/insn_compiler.rb +++ b/lib/ruby_vm/rjit/insn_compiler.rb @@ -2734,7 +2734,8 @@ module RubyVM::RJIT # @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 diff --git a/rjit_c.rb b/rjit_c.rb index ea68fcf4fb..60c3635381 100644 --- a/rjit_c.rb +++ b/rjit_c.rb @@ -768,11 +768,6 @@ module RubyVM::RJIT # :nodoc: all 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 diff --git a/tool/rjit/bindgen.rb b/tool/rjit/bindgen.rb index b68123b38a..6764f98594 100755 --- a/tool/rjit/bindgen.rb +++ b/tool/rjit/bindgen.rb @@ -606,6 +606,7 @@ generator = BindingGenerator.new( ], 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],