Figured I'd drop this note as I'm poking at this over lunch.
There's a number of opcodes that access attributes of the code object. What I'm going to do is take advantage of the fact that we stick the sub/method being called into P0, and hang attributes off of that. I think this'll do what we need it to do, though I'll need to have the generated code snag out P0 at the beginning so we have it for the rest of the sub.
Setting that up'll be a different issue, but I'll deal with that later.
The attributes of P0 (the function) are static, AFAIK, and for the benchmark - a compiler issue. Methods look very like the same. They are constructed once ("MAKE_FUNCTION") and that's it. This seems to setup keyword parameter list and similar and not muc more.
I might ve really wrong here, I refrained from diggin too deeply into that Python mess, you should have something to work on ;)
So properties are ok for runtime, if we need it.
An opcode to access the function/method (P0) is done rather quickly. Or if you need it in a sub, just emit this code as function entry.
.param pmc foo ... # and nore .param .local pmc sub_self sub_self = P0
leo