[ I think this still needs some clarification ]

Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> Dan Sugalski <[EMAIL PROTECTED]> wrote:
>> At 10:42 PM +0100 12/17/03, Leopold Toetsch wrote:
>>>While playing with calling threaded subs, I came along a thing which
>>>I think might be suboptimal:
>>>pdd03 states that the method PMC should go into P2. This doesn't
>>>really play with Perl5 <-> Perl6 interoperbility IMHO. Perl5 methods
>>>are plain subs, where the first param is the object.

>> PDD 03 states that the *object* goes in P2.

> Yep, typo - sorry.

>> This works out just fine
>> with perl 5 style method calls, where the argument list doesn't
>> distinguish the object other than by position. What happens is that
>> when a perl 5 sub is called, @_ is a combination of P2 if it's
>> non-NULL, and the remaining PMC registers. It's slightly more work
>> for the perl 5 code generator to handle the check, but other than
>> that it shouldn't be a problem.

> That seems to indicate, that we have to expose the whole parameter
> passing to HLLs and that Perl5 (and probably other languages) can't use
> the builtin PIR shortcuts (or we have to provide both schemes depending
> on some pragma directive).

> Additionally to the test:

>   isnull P2, no_object        # must be set to NULL on non-method calls

> we would need 2 code paths: For leaf subs[1], one can use registers as
> is, one would need rearanging the param regs.

> And as outlined by Juergen it doesn't fit very well for calling NCI PMC
> class methods: We would need another signature letter to denote the
> object.

> That's of course all doable but is adding assymmetry to method calls,
> which I don't like much.

> [1] these just use P5..Pn as passed in.

> leo

leo

Reply via email to