fn pop_args_to_args(&mut self, arg_num: usize) -> Args2 {
        let arg_start = self.stack.sp - arg_num;
        let mut p = arg_start;
        while p < self.stack.sp {
            let prev_sp = self.stack.sp;
            let val = p[0];
            match val.as_splat() {
                Some(inner) => match inner.as_rvalue() {
                    None => {
                        p[0] = inner;
                        p += 1;
                    }
                    Some(obj) => match obj.kind() {
                        ObjKind::ARRAY => {
                            let a = &**obj.array();
                            let ary_len = a.len();
                            if ary_len == 0 {
                                self.stack.remove(p);
                            } else {
                                self.stack.grow(ary_len - 1);
                                RubyStack::stack_copy_within(p, 1..(prev_sp - p) as usize, ary_len);
                                p[0..ary_len].copy_from_slice(&a[..]);
                                p += ary_len;
                            }
                        }
                        // TODO: should use `to_a` method.
                        ObjKind::RANGE => {
                            let r = &*obj.range();
                            let start = r.start.coerce_to_fixnum("Expect Integer.").unwrap();
                            let end = r.end.coerce_to_fixnum("Expect Integer.").unwrap()
                                + if r.exclude { 0 } else { 1 };
                            if end >= start {
                                let ary_len = (end - start) as usize;
                                self.stack.grow(ary_len - 1);
                                RubyStack::stack_copy_within(p, 1..(prev_sp - p) as usize, ary_len);
                                for (idx, val) in (start..end).enumerate() {
                                    p[idx as isize] = Value::integer(val);
                                }
                                p += ary_len;
                            } else {
                                self.stack.remove(p);
                            };
                        }
                        _ => {
                            p[0] = inner;
                            p += 1;
                        }
                    },
                },
                None => p += 1,
            };
        }
        let len = (self.stack.sp - arg_start) as usize;
        Args2::new(len)
    }
Pop values and store them in new `Args`. `args_num` specifies the number of values to be popped.
If there is some Array or Range with splat operator, break up the value and store each of them.
ruruby/src/vm/executor.rs