File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,12 @@ The second component of the transformation is implementing the `produce` mechani
255
255
ability to resume computation from where we produced. Roughly speaking, the `IRCode` must be
256
256
modified to ensure that whenever a `produce` call in encountered, the `MistyClosure` returns
257
257
the argument to `produce`, and that subsequent calls resume computation immediately after
258
- the `produce` statement. Observe that this is also facilitated by the ref mechanism
258
+ the `produce` statement. This resumption is achieved by setting the value of a counter
259
+ prior to returning following a `produce` statement -- a sequence of comparisons against this
260
+ counter, and `goto-if-not` statement are inserted at the top of the IR. These are used to
261
+ jump to the point in the code from which computation should resume. These are set up such
262
+ that, when the `TapedTask` is first run, computation start froms the first statement.
263
+ Observe that this is also facilitated by the ref mechanism
259
264
discussed above, as it ensures that the state persists between calls to a `MistyClosure`.
260
265
261
266
The above gives the broad outline of how `TapedTask`s are implemented. We refer interested
You can’t perform that action at this time.
0 commit comments