develooper Front page | perl.perl5.porters | Postings from January 2003

interesting? but ugly! use of optimizer.pm

From:
Jim Cromie
Date:
January 25, 2003 16:32
Subject:
interesting? but ugly! use of optimizer.pm
Message ID:
3E332C5F.8090504@divsol.com
folks,

in attached progs, Im altering the optree that calls certain functions,
and replaces the subroutine name with one thats munged to make it unique.

When the program is run, the munged subs dont exist, and are handled by 
AUTOLOAD,
which then can create a sub thats customized for each unique invocation.



a2.pl works,   a3 does not; it exposes problems either in my code or in 
the concept,
Id like to understand which.

Notes:  (diffs between a2.pl and a3 )

perl -MO=Concise a3     shows much less data than with a2.pl,
I think this is due the do {} block in a2.pl, vs a subroutine call in 
a3.  Am I correct ?


I recognize only 1 opcode chain ( with a few variations ), but am unable 
(as yet) to ascertain
what other op-chains might invoke a sub.  I could use some Hints as to 
how to create such
opcode patterns, and out to see them with B::Concise.

Code is rough (butt-ugly?), but after reading Nicholas Clark's posting, 
I figured its somewhat relevant.

 http://archive.develooper.com/perl5-porters@perl.org/msg90802.html





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About