At 02:44 PM 9/6/2001 -0400, Ken Fox wrote:
>Could you compile the following for us with the assumption that
>g() does not change its' caller?

Maybe later. Pressed for time at the moment, sorry.

>What if g() *appears* to be safe when perl compiles the loop, but
>later on somebody replaces its' definition with the scope changing
>one? Does perl go back and re-compile the loop?

Maybe. We might also do any number of other things, including refetching 
every time.

On the other hand, if we put the address of the lexical's PMC into a 
register, it doesn't matter if someone messes with it, since they'll be 
messing with the same PMC, and thus every time we fetch its value we'll Do 
The Right Thing.

>The compiler could watch for uses of %MY, but I bet that most
>modules will eventually use %MY to export symbols. Can the
>compiler tell the difference between run-time and compile-time
>usage of %MY?

Sure. We scan the syntax tree after we're done with compilation, and if 
there aren't any MY accesses, we're OK. Mostly. do, require and string eval 
are still issues.

> > Now, granted, it might be such that a single "uses string eval" or "uses
> > MY" in the program shuts down optimization the same way that $& kills RE
> > performance in perl 5, but we are in the position of tracking that.
>
>To quote Timone: "And you're okay with that?"

Yes. "I shut off the optimizer and my code ran slow!" "Well, don't do that."

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to