org.eclipse.ocl.examples.codegen.cse
Class LocalPlace

java.lang.Object
  extended by org.eclipse.ocl.examples.codegen.cse.AbstractPlace
      extended by org.eclipse.ocl.examples.codegen.cse.LocalPlace
Direct Known Subclasses:
ControlPlace, StackPlace

public abstract class LocalPlace
extends AbstractPlace

A LocalPlace describes a forest of CG trees that cannot be resolved as global constants.


Field Summary
protected  GlobalPlace globalPlace
           
 
Constructor Summary
protected LocalPlace(GlobalPlace globalPlace)
           
 
Method Summary
 void addControlPlace(ControlPlace controlPlace)
           
static AbstractPlace createLocalPlace(java.util.Map<CGElement,AbstractPlace> element2place, CGValuedElement cgElement)
           
 GlobalPlace getGlobalPlace()
          Return the GlobalPlace.
protected static GlobalPlace getGlobalPlace(java.util.Map<CGElement,AbstractPlace> element2place)
           
protected static LocalPlace getLocalPlace(AbstractPlace abstractPlace, CGElement cgElement)
           
protected static LocalPlace getLocalPlace(java.util.Map<CGElement,AbstractPlace> element2place, CGElement cgElement)
           
abstract  StackPlace getStackPlace()
          Return the stack place hosting this place.
 void printHierarchy(java.lang.Appendable appendable, java.lang.String indentation)
           
 void prune()
          Eliminate CSE candidates that are not shared and do not need to be CSEs.
 void pullUp()
          Pull up all redundant child analyses that are visible in a parent to the parent.
 void pushUp()
          Push shareable analyses up the place tree.
 void rewrite()
          Rewrite the expression trees to exploit the CSEs.
 
Methods inherited from class org.eclipse.ocl.examples.codegen.cse.AbstractPlace
getControlPlace, getParentPlace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globalPlace

@NonNull
protected final GlobalPlace globalPlace
Constructor Detail

LocalPlace

protected LocalPlace(@NonNull
                     GlobalPlace globalPlace)
Method Detail

createLocalPlace

@NonNull
public static AbstractPlace createLocalPlace(@NonNull
                                                     java.util.Map<CGElement,AbstractPlace> element2place,
                                                     @NonNull
                                                     CGValuedElement cgElement)

getGlobalPlace

@NonNull
protected static GlobalPlace getGlobalPlace(@NonNull
                                                    java.util.Map<CGElement,AbstractPlace> element2place)

getLocalPlace

@NonNull
protected static LocalPlace getLocalPlace(@NonNull
                                                  java.util.Map<CGElement,AbstractPlace> element2place,
                                                  @Nullable
                                                  CGElement cgElement)

getLocalPlace

@NonNull
protected static LocalPlace getLocalPlace(@Nullable
                                                  AbstractPlace abstractPlace,
                                                  @NonNull
                                                  CGElement cgElement)

addControlPlace

public void addControlPlace(@NonNull
                            ControlPlace controlPlace)

getGlobalPlace

@NonNull
public GlobalPlace getGlobalPlace()
Description copied from class: AbstractPlace
Return the GlobalPlace.

Specified by:
getGlobalPlace in class AbstractPlace

getStackPlace

@NonNull
public abstract StackPlace getStackPlace()
Description copied from class: AbstractPlace
Return the stack place hosting this place. Returns for the GlobalPlace..

Specified by:
getStackPlace in class AbstractPlace

printHierarchy

public void printHierarchy(@NonNull
                           java.lang.Appendable appendable,
                           @NonNull
                           java.lang.String indentation)
Specified by:
printHierarchy in class AbstractPlace

prune

public void prune()
Eliminate CSE candidates that are not shared and do not need to be CSEs. For the retained CSEs select the shallowest candidate as the actaul CSE.


pullUp

public void pullUp()
Pull up all redundant child analyses that are visible in a parent to the parent.


pushUp

public void pushUp()
Push shareable analyses up the place tree. e.g. something on both then and else arms of an if can be pushed up.


rewrite

public void rewrite()
Rewrite the expression trees to exploit the CSEs.