| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
This augments the on-complete handler for an async state with await as follows:
if (tr.isFailure)
result$async.complete(tr.asInstanceOf[Try[T]])
else {
<resultName> = tr.get.asInstanceOf[<resultType>]
<nextState>
<mkResumeApply>
}
|
|
|
|
| |
We can then use this as a replacement for `Future { expr }`.
|
|
|
|
|
|
| |
We need not, and should not, rename definitions
beyond the scope of the async transform, e.g.
in nested classes of function bodies.
|
|
|
|
|
|
|
|
|
|
|
|
| |
To avoid suprises in tree retyping, the instance of this
class is immediately upcase to
StateMachine[Promise[T], ExecContext].
Allow nested non-case classes. These pop up when
we use nested async calls.
Only look for duplicate names in the subtrees
traversed by AsyncTraverser.
|
|
|
|
|
|
| |
Adapt the compiler's standard ResetAttrs to keep
This() nodes don't refer to a symbol defined in the
current async block.
|
|
|
|
|
|
|
|
| |
There is a fly in the ointment: any This() trees in the provided
code are getting rebound to this class. Sounds like more
resetAttrs fun ahead.
The object also serves as the Future {} thunk.
|
|
|
|
|
|
|
| |
Any vals referred to in the body of these
must also be lifted.
Fixes #36
|
|
|
|
|
|
| |
The type-checking performed in ANF transform is
precarious, and needed to use the original condition/
scrutinee in a throwaway tree to get things to work.
|
|
|
|
|
|
|
| |
These gives us something to lift to vars to be accessed
from multiple states of the state machine.
Fixes #35
|
| |
|
| |
|
|
|
|
| |
This refactoring removes a group of factory methods.
|
| |
|
| |
|
| |
|
|
|
|
| |
Brings uniformity to the result generation of AsyncStateBuilder.
|
|
|
|
| |
Rather than three separate parameters.
|
|
|
|
|
| |
No more extension from concrete classes; no more
dummy values for nextState.
|
|
|
|
|
|
| |
- Moving some private methods out of the top-billing at the
head of the file
- Replace three nullable fields with one Option.
|
| |
|
|
|
|
| |
Goal is to make ExprBuilder less cluttered.
|
| |
|
| |
|
| |
|
|
|
|
| |
- show the AST on one line.
|
| |
|
|
|
|
|
| |
Seeing as we know in advance the full set of lifted vars,
we don't need to thread this information through ExprBuilder.
|
|
|
|
|
|
|
| |
-preserve LabelDef symbols to allow use of Symbol,
rather than Names as map keys.
-a label jump overwrites the nextState of an AsyncState.
This is cleaner than inserting a return { state = 12; resume() }.
|
|
|
|
|
|
| |
Test nested loops.
Control ANF tracing with another system property.
|
|
|
|
| |
Closes #21
|
| |
|
| |
|
| |
|
|
|
|
| |
Lookup the ValDef symbol from Assign#rhs.symbol.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Prepend {(); ... } before starting the ANF transform.
Add tracing to the anf/inline transform.
Also enables and addresses SIP-18 warnings.
|
| |
|
|
|
|
|
|
|
|
|
| |
Not quite sure how to test this yet;
the original trees coming from toolbox
don't seem to come with position to start
with.
But this is a start.
|
|
|
|
| |
We seem to be symful now.
|
|
|
|
|
|
|
|
| |
- transform the provided tree using reflect.internal.Symbols#Symbol.name_=
and treeCopy.{Ident, Select}.
- not sure if this is possible within the public Symbol API.
- move checking for unsupported nested module/class to AsyncAnalysis.
- make block merging selective (only do so if there are nested await calls.)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- corrects detection of await calls in the ANF transform.
- Split AsyncAnalyzer into two parts. Unsupported await
detection must happen prior to the async transform to
prevent the ANF lifting out by-name arguments to
vals and hence changing the semantics.
|
|
|
|
|
| |
- Move now-working duplicate definition tests from `neg` to `run`.
- Renames and small code beautification around the var lifting analysis
|
| |
|