Google Grupper har inte längre stöd för nya Usenet-inlägg eller -prenumerationer. Historiskt innehåll förblir synligt.
Dismiss

call opcodes cleanup

0 visningar
Hoppa till det första olästa meddelandet

Leopold Toetsch

oläst,
21 juli 2005 03:52:072005-07-21
till 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
sequence:

interpinfo Px, .INTERPINFO_CURRENT_SUB
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,
leo

0 nya meddelanden