call opcodes cleanup

Skip to first unread message

Leopold Toetsch

Jul 21, 2005, 3:52:07 AM7/21/05
to Perl 6 Internals
There are still some leftovers of the old calling scheme, which I'd like
to get rid of (1,2) or change slightly (3):

1) bare invoke

This opcode assumes P0 = Sub, P1 = Continuation

2) bare invokecc

This opcode assumes P0 = Sub

3) invoke Px

This opcode assumes P1 = Continuation, but it has a double usage: call a
coroutine (not the first time) and yield from a coroutine with this code

invoke Px

Instead I'd like to have distinct opcodes, that carry the effects on
operands clearly in their signature. The replacement for above would be:

1) invoke PSub, PCont # call sub with given continuation
2) invokecc PSub # call sub, create continuation - exists
3a) invoke PCoro # call sub, leave continuation as is
3b) yield # yield results from a coroutine

3a) exists too, but it currently picks up a continuation in P1.

Rational: the register allocator has to track the usage of all symbols.
For all the implicit register usage, extra code is needed that tracks
register usage. See trunk imcc/cfg.c for details.

Comments welcome,

Reply all
Reply to author
0 new messages