Re: Deoptimizations

2001-09-03 Thread Dan Sugalski
At 01:57 PM 9/2/2001 -0400, Ken Fox wrote: >"Bryan C. Warnock" wrote: > > I think the only way your going to be able to detect dynamic redefinitions > > is dynamically. :-) > >Not really. Does the program include string eval? That throws out >optimizations like folding and dead code elimination t

Re: Deoptimizations

2001-09-02 Thread Ken Fox
"Bryan C. Warnock" wrote: > No. We're optimizing on what we know at the time. Um, it looked like you were generating a graph with all possible optimizations inserted. At what point do you commit to an optimization? If you only commit at run-time, you need to do a *lot* of state management. It se

Re: Deoptimizations

2001-09-02 Thread Bryan C . Warnock
On Sunday 02 September 2001 12:21 pm, Ken Fox wrote: > The idea of inserting "optimization ops" seems silly too. It would > be faster to just replace the definition of the sub whenever the > sub changes. Perl 6 subs are just as fast as ops. Except not every optimization is 'sub' oriented. Optimi

Re: Deoptimizations

2001-09-02 Thread Ken Fox
Wizard wrote: > Johan Vromans wrote: > > 'use constant FOO => "foo"' could add some magic to never let FOO > > being redefined (not a bad coice for a constant). > > I like this idea best (for now). Perhaps 'constant sub foo' or 'sub > foo:constant'? I wouldn't consider this an optimization. Perl

Re: Deoptimizations

2001-09-02 Thread Simon Cozens
On Sat, Sep 01, 2001 at 03:29:23PM -0400, Bryan C. Warnock wrote: > 30 -> store > > plus a bunch of null ops. Not strictly true. Constant folding is done by running the interpreter on a tiny portion of the opcode tree and splicing the result in. No null ops there. > sub foo { > no op

RE: Deoptimizations

2001-09-02 Thread Wizard
> > 'use constant FOO => "foo"' could add some magic to never let FOO > being redefined (not a bad coice for a constant). > > -- Johan I like this idea best (for now). Perhaps 'constant sub foo' or 'sub foo:constant'? By doing it that way, it is apparent to both Perl and the developer that this i

Re: Deoptimizations

2001-09-02 Thread Johan Vromans
"Brent Dax" <[EMAIL PROTECTED]> writes: > sub FOO {"foo"} > print FOO; > > evaluating to: > > /-no--"foo"-\ > opt: FOO redefined? -< >---print > \-yes-call FOO--/ 'use constant FOO => "foo

RE: Deoptimizations

2001-09-01 Thread Brent Dax
# -Original Message- # From: Bryan C. Warnock [mailto:[EMAIL PROTECTED]] # Sent: Saturday, September 01, 2001 3:01 PM # To: Brent Dax; [EMAIL PROTECTED] # Subject: Re: Deoptimizations # # # On Saturday 01 September 2001 05:07 pm, Brent Dax wrote: # > Of course, the hard part is detect

Re: Deoptimizations

2001-09-01 Thread Bryan C . Warnock
On Saturday 01 September 2001 05:07 pm, Brent Dax wrote: > Of course, the hard part is detecting when the optimization is invalid. > While there are simple situations: > > sub FOO {"foo"} > > print FOO; > > evaluating to: > > /-no--"foo"-\ > op

RE: Deoptimizations

2001-09-01 Thread Brent Dax
# -Original Message- # From: Bryan C. Warnock [mailto:[EMAIL PROTECTED]] # Sent: Saturday, September 01, 2001 12:29 PM # To: [EMAIL PROTECTED] # Subject: Deoptimizations # # # Random musings from a discussion I had yesterday. (And check # me on my # assumptions, please.) # # One of the mo