[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Allowing inlining of "rarely-mutated" top-level variables
From: |
Mark H Weaver |
Subject: |
Allowing inlining of "rarely-mutated" top-level variables |
Date: |
Wed, 21 Sep 2011 14:51:50 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Hello all,
Peval's potential (and that of the optimizer in general) will be
significantly reduced if it cannot inline top-level variable references.
It seems to me that there's a way to enjoy the benefits of both
optimization and dynamism at the same time.
I propose that we allow code to declare that a given top-level variable
is "rarely-mutated". Semantically, this would give Guile permission to
use a representation of the variable for which mutations are very
expensive, in the hope that references can be made much cheaper.
Rarely-mutated variables would be treated as constants by the optimizer.
However, associated with each rarely-mutated variable would be a list of
compiled code segments that have inlined its value.
Then when a rarely-mutated variable is set!, the associated list of
compiled code segments would be immediately invalidated. Obviously,
this would require an implementation of on-stack replacement.
What do you think?
Mark
- Allowing inlining of "rarely-mutated" top-level variables,
Mark H Weaver <=