DocsNavigationUser login |
Task Calling ConditionsRecall that a callsite in a Sequoia task doesn't refer to the specific instance that is being called; rather, it just refers to the "base" task name, and the programmer will specify which instance is to be called by each callsite when instantiating the task, during the process of mapping the program to a target machine. The Sequoia mapping interface actually allows the programmer to specify a list of possible instances which may be called from a given callsite, with calling conditions on each instance (not to be confused with the array size preconditions described in the section on statically bounding array sizes). The semantics of providing a list of instances as possible targets are that at runtime, the calling conditions of each target instance will be evaluated, starting from the head of the list, until one of the instances has its calling conditions evaluate to true; this is the instance which will be called. Calling conditions may be on the size of an array in the calling task, for example, "call instance InstX at this callsite if array A has fewer than 1024 elements". In addition, other types calling conditions may be defined in the mapping interface for a specific target. Note that the compiler will still perform its downward propagation of constants pass through callsites which have a list of possible targets with calling conditions, by evaluating the calling conditions statically where possible. |