Next: Termination Detection
Up: Implementation of Customized Language
Previous: Syntax
Latency Hiding
Here, we show how the latency hiding mechanism described in Section
3.2 is implemented at the meta-level. The
implementation consists of two parts: invoking methods to prefetch the
arguments before their usage in an expression, and substitution of
results of the prefetch where needed.
Let us review the annotation syntax that requests prefetch method
invocations, which is proposed in Section 3.2:
19#19
To perform method invocations in ea, we define two evaluator
classes prefetch-eval and prefetch-anno-eval, and a method
for each--definitions are shown in Figure 10.
Figure 10:
Meta-level program for latency hiding (1)
| 20#20 |
Expressions except for the prefetch method invocations in the annotation are
evaluated as usual. This is implicitly achieved by the delegation
mechanism.
The latter part is for using prefetched values; i.e., do touch
operations instead of method invocation. This is achieved by defining
a method do-method-call of the class prefetch-eval (Figure
11). For each base-level method invocation,
this user-defined do-method-call checks if the invocation is
already performed in an annotation. If so, it touches a corresponding
reply box, instead of actual invocation.
Figure 11:
Meta-level program for latency hiding (2)
| 21#21 |
Next: Termination Detection
Up: Implementation of Customized Language
Previous: Syntax
Matt Hurlbut
1998-07-14