Re: PMC flags

[email protected] (Leopold Toetsch) Wed, 04 May 2005 21:27:32 +0200
Newsgroups perl.perl6.internals,perl.ponie.dev
Message-ID <[email protected]>
Nicholas Clark wrote:

[ CCs cleared by some ]

> ... However there's a lot of source outside pp*.c and
> the SV/AV/HV/CV/GV manipulation code.

A lot of that are helper functions for pp code, but anyway yes, the code 
exists and is an API.

> Which is the stuff we're trying to keep working unchanged.

If its not much called it doesn't matter, but see below.

> Speed-wise, I think the problem I *think* I was trying to address here was
> that there's a lot of XS and core code that assumes that SV flag checking is
> a fast operation

Yes XS is the big problem here. The huge difference between perl5 and 
parrot/perl6 is the handling of (scalar) types. In perl5 everything is 
flags based with cascades of switch statements. In parrot there is 
either a vtable or a MMD sub. For scalar types we basically don't need 
any flag bits in parrot.

I've (with not much success) already presented a plan to get both worlds 
together:

* PMCs become variable sized
* upgrading is similar to perl5

A perl5 IV PMC could therefore inherit vtable, MMD and layout from a 
core Integer PMC and have an additional flag word. Interoperbility would 
work at the opcode level.

leo