logo       

Re: Q: newsub opcodes: msg#00629

lang.perl.perl6.internals

Subject: Re: Q: newsub opcodes

Dan Sugalski <dan@xxxxxxxxx> wrote:
>>
>> get_sub Px, foo # find the PMC with label "foo" in constants

> Yeah, but I think I've a better approach. Instead of doing this,
> let's just get PMC constants implemented.

Well, they are implemented, at least partly. Sub PMCs are in the
constant table. The funny C<get_sub> "opcode" is actually a ...

> set_p_pc op.

... with the small difference, that at compile time, the integer
argument is a label (offset).

What about the other part: closures - should they be created via "new"
always?

> While we're at it we should see about adding in an integer constant
> table that can be fixed up on load (to take care of those pesky "what
> number did my PMC class map to" problems more quickly than the hash
> lookup) but we can put that off a bit.

You are thinking of a 2-stage lookup?

I1 = dynamic_type I0 # lookup runtime type mapping
$P0 = new I1

A normal IntList Array can do that too.

leo



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise