Dotty Documentation

0.11.0-bin-SNAPSHOT

object ShortcutImplicits
extends Object

[-] Constructors

[-] Members

[+] val name : String
[+] final val specializeMonoTargets : true

If this option is true, we don't specialize symbols that are known to be only targets of monomorphic calls. The reason for this option is that benchmarks show that on the JVM for monomorphic dispatch scenarios inlining and escape analysis can often remove all calling overhead, so we might as well not duplicate the code. We need more experience to decide on the best setting of this option.

[+] private def directInfo ( info: Type ) ( implicit ctx: Context ) : Type
[+] def isImplicitShortcut ( sym: Symbol ) ( implicit ctx: Context ) : Boolean
[+] def needsImplicitShortcut ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

Should sym get a ..$direct companion? This is the case if sym is a method with a non-nullary implicit function type as final result type. However if specializeMonoTargets is false, we exclude symbols that are known to be only targets of monomorphic calls because they are effectively final and don't override anything.

[+] private def newShortcutMethod ( sym: Symbol ) ( implicit ctx: Context ) : Symbol

A new m$direct method to accompany the given method m

[+] def shortcutMethod ( sym: Symbol , phase: DenotTransformer ) ( implicit ctx: Context ) : Symbol