diff options
author | Miguel Garcia <miguelalfredo.garcia@epfl.ch> | 2013-04-27 20:37:52 +0200 |
---|---|---|
committer | Miguel Garcia <miguelalfredo.garcia@epfl.ch> | 2013-04-27 20:37:52 +0200 |
commit | 265fc6b230b8b48e50004a3cc568ca5711747616 (patch) | |
tree | f21b467bae032dbcfad41e0484d7f3c76482ab99 /test | |
parent | 0c5e2e8f577165ac622a93e0b407f272130f0f37 (diff) | |
download | scala-265fc6b230b8b48e50004a3cc568ca5711747616.tar.gz scala-265fc6b230b8b48e50004a3cc568ca5711747616.tar.bz2 scala-265fc6b230b8b48e50004a3cc568ca5711747616.zip |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t6028.check | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check index 2ec639fce2..57fd58f7d3 100644 --- a/test/files/run/t6028.check +++ b/test/files/run/t6028.check @@ -15,11 +15,11 @@ package <empty> { } }; def bar(barParam: Int): Object = { - @volatile var MethodLocalObject$module: runtime.VolatileObjectRef = new runtime.VolatileObjectRef(null); + @volatile var MethodLocalObject$module: runtime.VolatileObjectRef = scala.runtime.VolatileObjectRef.zero(); T.this.MethodLocalObject$1(barParam, MethodLocalObject$module) }; def tryy(tryyParam: Int): Function0 = { - var tryyLocal: runtime.IntRef = new runtime.IntRef(0); + var tryyLocal: runtime.IntRef = scala.runtime.IntRef.create(0); { (new anonymous class $anonfun$tryy$1(T.this, tryyParam, tryyLocal): Function0) } |