mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
b80b839926
commit
525008cd78
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
20
insns.def
20
insns.def
|
@ -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).
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue