Please sign in to comment.
SI-6863 root cause fixed using factory of scala.runtime.*Ref
This commit does away with an error-prone division of labor between UnCurry and LambdaLift, a division of labor by which UnCurry had to anticipate under which circumstances LambdaLift creates a scala.runtime.*Ref whose initial value is given by a an expression including a Try in non-statement position. That sounds complicated, and it is. The solution so far (fixing SI-6863) is replaced by a simpler approach, at the cost of forward binary comptability with pre-2.11 releases, this time fixing the root cause of SI-6863. From now on, a s.r.*Ref is instantiated via invocation of a static factory method in the s.r.*Ref class in question. Unlike the code that was emitted so far (which involved NEW refclass, DUP, expr, INVOKESPECIAL refclass.<init>) the "expr" doesn't appear on the operand stack on top of the *Ref value being initialized. In other words, the *Ref initialization is in statement position provided "expr" is.
- Loading branch information...
Showing with 85 additions and 49 deletions.
- +27 −47 src/compiler/scala/tools/nsc/transform/LambdaLift.scala
- +3 −0 src/library/scala/runtime/BooleanRef.java
- +3 −0 src/library/scala/runtime/ByteRef.java
- +3 −0 src/library/scala/runtime/CharRef.java
- +3 −0 src/library/scala/runtime/DoubleRef.java
- +3 −0 src/library/scala/runtime/FloatRef.java
- +3 −0 src/library/scala/runtime/IntRef.java
- +3 −0 src/library/scala/runtime/LongRef.java
- +3 −0 src/library/scala/runtime/ObjectRef.java
- +3 −0 src/library/scala/runtime/ShortRef.java
- +3 −0 src/library/scala/runtime/VolatileBooleanRef.java
- +3 −0 src/library/scala/runtime/VolatileByteRef.java
- +3 −0 src/library/scala/runtime/VolatileCharRef.java
- +3 −0 src/library/scala/runtime/VolatileDoubleRef.java
- +3 −0 src/library/scala/runtime/VolatileFloatRef.java
- +3 −0 src/library/scala/runtime/VolatileIntRef.java
- +3 −0 src/library/scala/runtime/VolatileLongRef.java
- +3 −0 src/library/scala/runtime/VolatileObjectRef.java
- +3 −0 src/library/scala/runtime/VolatileShortRef.java
- +2 −0 src/reflect/scala/reflect/internal/StdNames.scala
- +2 −2 test/files/run/t6028.check