Grupos de Google ya no admite publicaciones ni suscripciones nuevas de Usenet. El contenido anterior sigue visible.

Subroutine calls

8 vistas
Ir al primer mensaje no leído

Leopold Toetsch

no leída,
2 abr 2004, 10:25:14 a.m.2/4/2004
para P6I
The PIR subroutine call syntax

_f()

expands (besides other instructions) to something like:

newsub P0, .Sub, _f
invokecc

I've now hacked together this sequence:
1) a new opcode (in dynoplibs/myops.ops for quick testing)

op pmc_const(out PMC, inlabelconst INT) {
$1 = PCONST($2)->u.key;
goto NEXT();
}

2) The call:
loadlib P10, "myops_ops"
pmc_const P0, 3
...
invokecc

(The constant number #3 is known to imcc when generating the const table
entry - actuall it would ne more like pmc_const P0, _f)

So *if* all is as static as in this code, and the Sub PMC isn't abused
by different callers (e.g. by attaching properties or such), then this
scheme would safe the C<newsub> operation, i.e. the construction of a
new PMC.

Comments welcome,
leo

0 mensajes nuevos