summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-08-10 21:20:24 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-08-10 21:25:38 +1000
commit131402fd5fe8c064ef5cfffbe568507cbdf37990 (patch)
treeec3470addaf68356d7b5b8d6418de77ec753375a /src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
parent498a2ce7397b909c0bebf36affeb1ee5a1c03d6a (diff)
downloadscala-131402fd5fe8c064ef5cfffbe568507cbdf37990.tar.gz
scala-131402fd5fe8c064ef5cfffbe568507cbdf37990.tar.bz2
scala-131402fd5fe8c064ef5cfffbe568507cbdf37990.zip
Cleanups after code review
- Remove unused references to "addTargetMethods" - Require that `targetMethodMap` is provided
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
index d85d85003d..e25b55e7ab 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
@@ -76,7 +76,7 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
* host a static field in the enclosing class. This allows us to add this method to interfaces
* that define lambdas in default methods.
*/
- def addLambdaDeserialize(classNode: ClassNode, implMethods: List[Handle]): Unit = {
+ def addLambdaDeserialize(classNode: ClassNode, implMethods: Iterable[Handle]): Unit = {
val cw = classNode
// Make sure to reference the ClassBTypes of all types that are used in the code generated
@@ -87,13 +87,12 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
val nilLookupDesc = MethodBType(Nil, jliMethodHandlesLookupRef).descriptor
val serlamObjDesc = MethodBType(jliSerializedLambdaRef :: Nil, ObjectRef).descriptor
- val addTargetMethodsObjDesc = MethodBType(ObjectRef :: Nil, UNIT).descriptor
{
val mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "$deserializeLambda$", serlamObjDesc, null, null)
mv.visitCode()
mv.visitVarInsn(ALOAD, 0)
- mv.visitInvokeDynamicInsn("lambdaDeserialize", serlamObjDesc, lambdaDeserializeBootstrapHandle, implMethods: _*)
+ mv.visitInvokeDynamicInsn("lambdaDeserialize", serlamObjDesc, lambdaDeserializeBootstrapHandle, implMethods.toArray: _*)
mv.visitInsn(ARETURN)
mv.visitEnd()
}
@@ -102,8 +101,8 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
/**
* Clone the instructions in `methodNode` into a new [[InsnList]], mapping labels according to
* the `labelMap`. Returns the new instruction list and a map from old to new instructions, and
- * a boolean indicating if the instruction list contains an instantiation of a serializable SAM
- * type.
+ * a list of lambda implementation methods references by invokedynamic[LambdaMetafactory] for a
+ * serializable SAM types.
*/
def cloneInstructions(methodNode: MethodNode, labelMap: Map[LabelNode, LabelNode], keepLineNumbers: Boolean): (InsnList, Map[AbstractInsnNode, AbstractInsnNode], List[Handle]) = {
val javaLabelMap = labelMap.asJava