From 265fc6b230b8b48e50004a3cc568ca5711747616 Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Sat, 27 Apr 2013 20:37:52 +0200 Subject: 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.) 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. --- test/files/run/t6028.check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/files/run/t6028.check') 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 { } }; 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) } -- cgit v1.2.3