Skip to main content

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

Another challenge in porting the IA to Pivot will be the semantics of OperationCallExp in the presence of redefinitions in subclasses. In OCL Ecore the somewhat bizarre, yet easy to handle for IA, semantics are that calling an OCL-defined operation from Java through the Ecore APIs will behave polymorphically, while evaluating an OperationCallExp will evaluate the expression in the statically-bound referredOperation.

For porting to IA, the traceback for an OperationCallExp would need to compute and join all traceback paths of all possible redefinitions.

How about redefinition of derived properties in subclasses? Is this possible with Pivot?

-- Axel

On 12/23/2011 10:25 PM, Ed Willink wrote:
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.


_______________________________________________ mailing list

Back to the top