Dan Sugalski wrote: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.
Yeah. I meant property anyway, dammit. Even I'm getting confused.
I might ve really wrong here, I refrained from diggin too deeply into that Python mess, you should have something to work on ;)
Heh. I just need a place to snag the method's constants and variables from, and I don't want to bother with lexical pads right now. I might change my mind tonight.
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
Yeah, I've got that in the sub preamble now. -- Dan
--------------------------------------it's like this------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk