ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-core
tcl-core
Re: [TCLCORE] Tcl through X rays
by Alexandre Ferrieux other posts by this author
May 28 2007 3:01PM messages near this date
Re: [TCLCORE] Tcl through X rays | Re: [TCLCORE] Tcl through X rays
On 5/28/07, Donal K. Fellows <donal.k.fellows@[...].uk>  wrote:

> 
>  Initially, you only get to determine what "leaf" procedures are up to,
>  but with the leaves figured out, you'll be able to go further up the
>  call tree and optimize things further (a procedure is non-tricky if it
>  does not call anything tricky).


Yes, that sounds like a reasonable first step towards aggressive bytecode
optimizations.

Now, in cases unreachable by this transitive closure strategy, we may still
have a card to play.
When we "optimize away" variable as a stack position, we also leave a hint
of this operation (at compile time) in the scope's var-hashtable (it could
be implemented as a read and write trace, but purely at C level)
Whenever unknowing code from a callee upvar's this variable, the rw trace
steps in and maps to the proper location.
The idea, as you suggest, is that most of the code will not be hampered by
this mechanism (no trace, and no perf hit except at compile time), and the
rest will "deserve" it (in the sense that access-by-name is a noble task
that justifies a higher cost). Moreover, most obvious cases of upvar access
(incr, lappend) can be inlined to do the obvious thing, directly on the
stack.
I know this is very preliminary, feel free to destroy this dream...

-Alex
Thread:
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Mo DeJong
Alexandre Ferrieux
Mo DeJong
Jeff Hobbs
Andreas Leitgeb
Donal K. Fellows
Alexandre Ferrieux
Larry McVoy
Donal K. Fellows
Donal K. Fellows
Alexandre Ferrieux
Miguel Sofer
Rna020
Donal K. Fellows
Donal K. Fellows
Gerald W. Lester
Donal K. Fellows

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved