From 6e2cadb8bd42e0f4a6c777b11ff71f92cda368e8 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 16 Sep 2013 12:55:10 +0200 Subject: SI-7847 Static forwarders for case apply/unapply These were excluded in f901816b3f because at the time they were compiler fiction and translated to calls to the case class constructor or accessors. But since they are now bona-fide methods (albeit still occasionally bypassed as an optimization), we can expose them conveniently to our Java brethren. The cut-and-pastiness of GenBCode starts to hinder maintenance. Here's a report of further duplication that we have to fix up post haste: https://gist.github.com/retronym/6334389 --- src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala | 6 +----- src/compiler/scala/tools/nsc/backend/jvm/GenJVMASM.scala | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala index 182209dfe6..eff7d3211e 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala @@ -866,11 +866,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { // a plain class lacking companion module, for details see `isCandidateForForwarders`). // ----------------------------------------------------------------------------------------- - val ExcludedForwarderFlags = { - import symtab.Flags._ - // Should include DEFERRED but this breaks findMember. - ( CASE | SPECIALIZED | LIFTED | PROTECTED | STATIC | EXPANDEDNAME | BridgeAndPrivateFlags | MACRO ) - } + val ExcludedForwarderFlags = genASM.ExcludedForwarderFlags /* Adds a @remote annotation, actual use unknown. * diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVMASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVMASM.scala index 2c3bf26958..01c4ff5a52 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVMASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVMASM.scala @@ -18,10 +18,10 @@ trait GenJVMASM { import icodes._ import definitions._ - protected val ExcludedForwarderFlags = { + val ExcludedForwarderFlags = { import Flags._ // Should include DEFERRED but this breaks findMember. - ( CASE | SPECIALIZED | LIFTED | PROTECTED | STATIC | EXPANDEDNAME | BridgeAndPrivateFlags | MACRO ) + ( SPECIALIZED | LIFTED | PROTECTED | STATIC | EXPANDEDNAME | BridgeAndPrivateFlags | MACRO ) } protected def isJavaEntryPoint(icls: IClass) = { -- cgit v1.2.3