Deprecate .HLL_map

Andrew Whitworth wknight8111 at gmail.com
Sat Jan 24 20:10:17 UTC 2009


Following my investigations into TT#216, and some discussions I've had
with NotFound, I suggest we deprecate the .HLL_map directive. Some
points:

1) .HLL_map fails for classes generated at runtime. See
compilers/imcc/imcc.y:953 for the current behavior of it. IMCC looks
up the type number at compile time, but the class doesn't exist yet
until runtime. It works fine for PMC types that are known at compile
time, but it doesn't work and is not easily extendible for classes
created at runtime. Fixing it so that it does work for runtime classes
would require some significant changes under the hood and could lead
to an across-the-board performance reduction (at least using the few
methods I've brainstormed so far).
2) The Interpreter PMC has a method "hll_map" that can be used to
accomplish the same thing at runtime. This works for C-based PMCs and
PIR-based classes equally and transparently (to the end user).
3) There is a little bit of additional overhead, calling the getinterp
opcode and then calling the method on the opcode. However, I suspect
that most programs will use a very limited number of these operations
so it shouldn't be too much of a performance penalty.
4) If we were interested in increasing the speed of the operation
anyway, we could create an hllmap opcode to handle it. I don't think
this is necessary now, but it's an interesting optimization
possibility for later.

I'd like to add .HLL_map to the list of deprecated things, probably
for the 0.9.1 release if possible. Comments?

--Andrew Whitworth


More information about the parrot-dev mailing list