Delete newarraykwsplat

The pushtoarraykwsplat instruction was designed to replace newarraykwsplat,
and we now meet the condition for deletion mentioned in
77c1233f79.
This commit is contained in:
Alan Wu 2024-08-13 16:56:35 -04:00 committed by GitHub
parent b80b839926
commit 525008cd78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
Notes: git 2024-08-13 20:56:55 +00:00
Merged: https://github.com/ruby/ruby/pull/11371

Merged-By: XrXr
3 changed files with 187 additions and 212 deletions

View file

@ -452,26 +452,6 @@ newarray
val = rb_ec_ary_new_from_values(ec, num, STACK_ADDR_FROM_TOP(num));
}
/* put new array initialized with num values on the stack. There
should be at least one element on the stack, and the top element
should be a hash. If the top element is empty, it is not
included in the array.
*/
DEFINE_INSN
newarraykwsplat
(rb_num_t num)
(...)
(VALUE val)
// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
{
if (RHASH_EMPTY_P(*STACK_ADDR_FROM_TOP(1))) {
val = rb_ary_new4(num-1, STACK_ADDR_FROM_TOP(num));
}
else {
val = rb_ary_new4(num, STACK_ADDR_FROM_TOP(num));
}
}
/* push hash onto array unless the hash is empty (as empty keyword
splats should be ignored).
*/