Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 6322d1b

Browse files
committed
Avoid inefficient specialied lambdas w. delambdafy jvm-1.8, GenASM
A previous change disabled -Ydelambdafy:method for specialized lambdas, as `DelambdafyTransformer` made no attempt to emit the requisite machinery to avoid boxing. This was loosened to allow them under `-target:jvm-1.8`, in the knowledge that `indylambda` would do the right thing. However, this wasn't quite right: indylambda is only supported in `GenBCode`, so we should consider that setting as well.
1 parent 2f1b525 commit 6322d1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/scala/tools/nsc/transform/UnCurry.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ abstract class UnCurry extends InfoTransform
237237

238238
def canUseDelamdafyMethod = (
239239
(inConstructorFlag == 0) // Avoiding synthesizing code prone to SI-6666, SI-8363 by using old-style lambda translation
240-
&& (!isSpecialized || (settings.target.value == "jvm-1.8")) // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
240+
&& (!isSpecialized || (settings.isBCodeActive && settings.target.value == "jvm-1.8")) // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
241241
)
242242
if (inlineFunctionExpansion || !canUseDelamdafyMethod) {
243243
val parents = addSerializable(abstractFunctionForFunctionType(fun.tpe))

0 commit comments

Comments
 (0)