BackendUtils

dotty.tools.backend.jvm.BackendUtils
See theBackendUtils companion object
class BackendUtils(val ppa: PostProcessorFrontendAccess, val ts: CoreBTypes)(using x$3: Context)

This component hosts tools and utilities used in the backend that require access to a CoreBTypes instance.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def addInnerClasses(jclass: ClassVisitor, declaredInnerClasses: Iterable[ClassBType], refedInnerClasses: Iterable[ClassBType]): Unit
def addLambdaDeserialize(classNode: ClassNode, implMethodsArray: Array[Handle]): Unit

Visit the class node and collect all referenced nested classes.

Visit the class node and collect all referenced nested classes.

Attributes

def getScalaBox(primitiveType: Type): MethodInsnNode
def getScalaUnbox(primitiveType: Type): MethodInsnNode

The methods used as lambda bodies for IndyLambda instructions within hostClass. Note that the methods are not necessarily defined within the hostClass (when an IndyLambda is inlined into a different class).

The methods used as lambda bodies for IndyLambda instructions within hostClass. Note that the methods are not necessarily defined within the hostClass (when an IndyLambda is inlined into a different class).

Attributes

The methods used as lambda bodies for IndyLambda instructions within method of hostClass.

The methods used as lambda bodies for IndyLambda instructions within method of hostClass.

Attributes

def looksLikeForwarderOrFactoryOrTrivial(method: MethodNode, owner: InternalName, allowPrivateCalls: Boolean): Int

Identify forwarders, aliases, anonfun$adapted methods, bridges, trivial methods (x + y), etc Returns -1 : no match 1 : trivial (no method calls), but not field getters 2 : factory 3 : forwarder with boxing adaptation 4 : generic forwarder / alias

Identify forwarders, aliases, anonfun$adapted methods, bridges, trivial methods (x + y), etc Returns -1 : no match 1 : trivial (no method calls), but not field getters 2 : factory 3 : forwarder with boxing adaptation 4 : generic forwarder / alias

TODO: should delay some checks to canInline (during inlining) problem is: here we don't have access to the callee / accessed field, so we can't check accessibility

  • INVOKESPECIAL is not the only way to call private methods, INVOKESTATIC is also possible
  • the body of the callee can change between here (we're in inliner heuristics) and the point when we actually inline it (code may have been inlined into the callee)
  • methods accessing a public field could be inlined. on the other hand, methods accessing a private static field should not be inlined.

Attributes