Dave Mitchell wrote:
> So how does that all work then? What does the parrot assembler for
> 
>       foo($x+1, $x+2, ...., $x+65)

The arg list will be on the stack. Parrot just allocates new PMCs and
pushes the PMC on the stack.

I assume it will look something like

  new_pmc pmc_register[0]
  add pmc_register[0], $x, 1
  push pmc_register[0]

  new_pmc pmc_register[0]
  add pmc_register[0], $x, 2
  push pmc_register[0]

  ...

  call foo, 65

It would be nice if we knew the lifetime of those temps so that
we could optimize the allocation. In Perl 5, closures don't capture
@_ -- I hope Perl 6 won't capture them either. So the only thing
we need to worry about is code taking a reference to @_. That
should be something the compiler can catch.

Hmm. It didn't occur to me that raw values might go on the call
stack. Is the call stack going to store PMCs only? That would
simplify things a lot.

- Ken

Reply via email to