Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[] Partial IA code generated evaluation

Hi Axel

On 23/12/2011 20:23, Axel Uhl wrote:
It would be very difficult to change the partial evaluation required by the IA to partially evaluate compiled expressions. It would require a capability to inject variable values into the evaluation context, and it depends on a specific exception to be thrown when a VariableExp is evaluated without the respective variable being in the context. This kind of support would probably require some careful and tricky preparation for the compilation.
The code generator currently does Static Single Assignment with almost no evaluation context as such. Everything is on the stack, sometimes as final variables to support visibility to nested iterator bodies.

A a = ... ;
B b = ... ;
C c = ... ;

Presumably for partial evaluation this needs to be changed to

if (cache.a == null) cache.a = ... ;
if (cache.b == null) cache.b = ... ;
if (cache.c == null) cache.c = ... ;

with cache an instance of an auto-generated class passed into the evaluation routine.

class Cache {
  A a = null;
  B b = null;
  C c = null;

potentially with nested caches for nested iterations.

If necessary variable reads can be differently coded.



Back to the top