Sam Ruby <[EMAIL PROTECTED]> wrote:

> Yes, I meant the ability to do things like '$P0 = new "Py_int"'.

> Could this be JITed?  The mapping between string class name and assigned
> PMC type is constant throughout the life of the VM...

Not really or not easily. Fastest is to have type enum numbers. Which
needs reserved ranges for not yet loaded extensions.

> What provoked me to suggest that was a statement made in IRC yesterday
> that TCL is doing a find_type in every subroutine that does a new.  And
> the knowledge that every local variable in Python and PHP is likely to
> be a PMC.

Well, if only one set of PMC types is used and you control program
initialization, it's not too hard, to probe Parrot for the next PMC type
number. Then the compiler can emit the "load_bytecode" ops on top and
use type numbers.

That doesn't work, if the library loading isn't always using the same
sequence, of course.

> My concern is that if there isn't a convenient way to look up and cache
> these types, the "considerable runtime overhead" will still be incurred,
> but in ways that aren't readily ameanable to optimization by the runtime.

Yes.

> - Sam Ruby

leo

Reply via email to