| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Fix decision about whether to use a trait or class as the parent
|
| | |
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Fix ANF transform for corner case in late transforms
|
|/
|
|
|
| |
Unfortunately I wasn't able to extract a test case, but the patch
has been tested to fix a problem on a real world code base.
|
|\
| |
| | |
Improve generated code and flexibility
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a state does nothing but unconditionally transition to the
next state, remove it and rewrite predecessors to directly jump
to the successor state (or to the first non-dead successor.)
While we're doing this, compact the remaining state IDs to be
contiguous, which will allow use of a tableswitch in bytecode.
Sample bytecode demonstrating a tableswitch:
https://gist.github.com/retronym/6880c35b501fc1c91bed7f30c0f2c045
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
support Scala 2.13.0-M2
|
|/
|
|
|
|
|
|
| |
and also move from 2.12.2 -> 2.12.3, just because
and sbt 0.13.15 -> 0.13.16, also just because
and scala-sbt-module 1.0.8 -> 1.0.12, because guess why
|
|\
| |
| | |
Reduce logging overhead and minor cleanups
|
|/ |
|
| |
|
|\
| |
| | |
Use scala-module-plugin, update tag-based publishing
|
|/
|
|
|
|
|
| |
The build didn't use the `scala-module-plugin` before but duplicated
most of its settings - maybe I missed the reason why this is the case?
Also update tag-based publishing to the latest version.
|
|\
| |
| | |
Typo
|
|/ |
|
|\
| |
| | |
In tests use tmp dir working on all operating systems
|
|/
|
|
| |
After this change tests pass also on Windows.
|
|\
| |
| | |
Bump to new snapshot version
|
|/ |
|
|\
| |
| | |
Bump to Scala 2.12.0
|
|/ |
|
|\
| |
| | |
Bump Scala version to 2.12.0-RC2
|
|/ |
|
| |
|
|\
| |
| | |
Rework build logic to determine which JDK use for release build
|
| | |
|
|\ \
| | |
| | | |
Add dependency information for including in project.
|
| | |
| | |
| | |
| | | |
Added dependency information for Maven and SBT so that it is easier for the developers who are new to the library.
|
|\ \ \
| | |/
| |/| |
Compatibility with Scala 2.12.0-RC1
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- method local lazy vals are now encoded as a single ValDef
rather than a ValDef + DefDef pair. We need to treat ValDef-s
with the LAZY flag in the same way as we used to treat the
DefDef.
- Rename one of the symbols `ANF,anf` in the same scope to avoid
generating anonymous class names that differ only in case. The
compiler warned about this one.
- When patching the LabelDefs to have a `Unit` result type, propagate
this other LabelDefs conclude with a jump to that label. Not sure
why, but without this we now hit an error in the backend about the
nonsensical attempt to emit a coercion from void to int.
- Use crossScalaVersions in the build and update the Scala versions
tested in CI.
|
|\ \ \
| | | |
| | | | |
Rework extension point for checking for already-completed futures
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The current extension point assumes that if a future is in the
completed state, a subsequent call to get the already completed
value will succeed. While this assumption holds for
scala.concurrent.Future, it might not hold for a future system
that has semantics like a weak reference.
This commit uses a single call `getCompleted` to query the state
and get the already completed value. This returns null if the
value is not available.
|
|\ \ \
| |/ /
|/| | |
Fix dead link to Akka's Dataflow Concurrency
|
|/ /
| |
| | |
And mention it's been removed in favour of this library.
|
|\ \
| | |
| | | |
Late expansion fixes
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Detect cross-state symbol references where the RefTree is nested
in a LabelDef. Failure to do so led to ill-scoped local variable
references which sometimes manifest as VerifyErrors.
- Emit a default case in the Match intended to be a tableswitch.
We have to do this ourselves if we expand after pattern matcher
- Cleanup generated code to avoid redundant blocks
- Avoid unnecessary `matchRes` temporary variable for unit-typed
pattern matches
- Fix the trace level logging in the ANF transform to restore
indented output.
- Emit `{ state = nextState; ... }` rather than
`try { ... } finally { state = nextState }` in state handlers.
This simplifies generated code and has the same meaning, as the
code in the state machine isn't reentrant and can't observe the
"early" transition of the state.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Avoids mixing in all the specialized apply variants.
We could go further and create an base class for all state machines,
but that would require scala-async to be on the runtime classpath,
which currently isn't a requirement. For now, I'm keeping it this
way.
|
|/ / |
|
|\ \
| |/
|/| |
Avoid spurious "illegal await" error in IDE with nesting
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The presentation compiler runs with `-Ymacro-expand:discard`, which
retains the macro expandee in the typechecked trees, rather than
substituting in the expansion. This mode was motivated as a means
to keep IDE functionality working (e.g. completion, navigation,
refactoring) inside macro applications.
However, if one has nested async macro applications, as reported in
the IDE ticket:
https://www.assembla.com/spaces/scala-ide/tickets/1002561
... the expansion of the outer async application was reporting
await calls enclosed by the inner async application.
This change tweaks the traversers used for this analysis to
stop whenever it sees an async.
|
|\
| |
| | |
Enable a compiler plugin to use the async transform after patmat
|
| |
| |
| |
| |
| |
| |
| |
| | |
- More internal docs
- Be more frugal with the `NoAwait` attachment, for some AST node
types this is implied.
- Just use `x`, rather than what was effectively
`x.reverseMap(identity).reverse`
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the async transformation is performed during the typer
phase, like all other macros.
We have to levy a few artificial restrictions on whern an async
boundary may be: for instance we don't support await within a
pattern guard. A more natural home for the transform would be
after patterns have been translated.
The test case in this commit shows how to use the async transform
from a custom compiler phase after patmat.
The remainder of the commit updates the implementation to handle
the new tree shapes.
For states that correspond to a label definition, we use `-symbol.id`
as the state ID. This made it easier to emit the forward jumps to when
processing the label application before we had seen the label
definition.
I've also made the transformation more efficient in the way it checks
whether a given tree encloses an `await` call: we traverse the input
tree at the start of the macro, and decorate it with tree attachments
containig the answer to this question. Even after the ANF and state
machine transforms introduce new layers of synthetic trees, the
`containsAwait` code need only traverse shallowly through those
trees to find a child that has the cached answer from the original
traversal.
I had to special case the ANF transform for expressions that always
lead to a label jump: we avoids trying to push an assignment to a result
variable into `if (cond) jump1() else jump2()`, in trees of the form:
```
% cat sandbox/jump.scala
class Test {
def test = {
(null: Any) match {
case _: String => ""
case _ => ""
}
}
}
% qscalac -Xprint:patmat -Xprint-types sandbox/jump.scala
def test: String = {
case <synthetic> val x1: Any = (null{Null(null)}: Any){Any};
case5(){
if (x1.isInstanceOf{[T0]=> Boolean}[String]{Boolean})
matchEnd4{(x: String)String}(""{String("")}){String}
else
case6{()String}(){String}{String}
}{String};
case6(){
matchEnd4{(x: String)String}(""{String("")}){String}
}{String};
matchEnd4(x: String){
x{String}
}{String}
}{String}
```
|
|\
| |
| | |
Typo
|