diff options
-rw-r--r-- | yjit/src/codegen.rs | 62 |
1 files changed, 46 insertions, 16 deletions
@@ -1637,18 +1637,6 @@ fn gen_expandarray( let array_opnd = asm.stack_opnd(0); - // If the array operand is nil, just push on nils - if asm.ctx.get_opnd_type(array_opnd.into()) == Type::Nil { - asm.stack_pop(1); // pop after using the type info - // special case for a, b = nil pattern - // push N nils onto the stack - for _ in 0..num { - let push_opnd = asm.stack_push(Type::Nil); - asm.mov(push_opnd, Qnil.into()); - } - return Some(KeepCompiling); - } - // Defer compilation so we can specialize on a runtime `self` if !jit.at_current_insn() { defer_compilation(jit, asm, ocb); @@ -1657,10 +1645,52 @@ fn gen_expandarray( let comptime_recv = jit.peek_at_stack(&asm.ctx, 0); - // If the comptime receiver is not an array, bail - if comptime_recv.class_of() != unsafe { rb_cArray } { - gen_counter_incr(asm, Counter::expandarray_comptime_not_array); - return None; } // Get the compile-time array length |