AccessWideningVisitor

internal class AccessWideningVisitor(mv: MethodVisitor, val declaredHere: (String, String, String) -> Boolean) : MethodVisitor

Constructors

Link copied to clipboard
constructor(mv: MethodVisitor, declaredHere: (String, String, String) -> Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
protected val api: Int
Link copied to clipboard
Link copied to clipboard
open val delegate: MethodVisitor?
Link copied to clipboard
protected var mv: MethodVisitor?

Functions

Link copied to clipboard
open fun visitAnnotableParameterCount(parameterCount: Int, visible: Boolean)
Link copied to clipboard
open fun visitAnnotation(descriptor: String?, visible: Boolean): AnnotationVisitor?
Link copied to clipboard
open fun visitAnnotationDefault(): AnnotationVisitor?
Link copied to clipboard
open fun visitAttribute(attribute: Attribute?)
Link copied to clipboard
open fun visitCode()
Link copied to clipboard
open fun visitEnd()
Link copied to clipboard
open override fun visitFieldInsn(opcode: Int, owner: String, name: String, descriptor: String)
Link copied to clipboard
open fun visitFrame(type: Int, numLocal: Int, local: Array<out Any?>?, numStack: Int, stack: Array<out Any?>?)
Link copied to clipboard
open fun visitIincInsn(varIndex: Int, increment: Int)
Link copied to clipboard
open fun visitInsn(opcode: Int)
Link copied to clipboard
open fun visitInsnAnnotation(typeRef: Int, typePath: TypePath?, descriptor: String?, visible: Boolean): AnnotationVisitor?
Link copied to clipboard
open fun visitIntInsn(opcode: Int, operand: Int)
Link copied to clipboard
open override fun visitInvokeDynamicInsn(name: String, descriptor: String, bsm: Handle, vararg bsmArgs: Any?)

Lambdas (LambdaMetafactory call sites the Kotlin compiler emits). Two things here name a type we erased and must move with it: the captured-argument descriptor, and the impl-method handle — which points at the snippet's OWN synthetic method, whose signature widenAccessClass's visitMethod already erased. instantiatedMethodType describes that handle, so it moves too (INSTANTIATED_TYPE).

Link copied to clipboard
open fun visitJumpInsn(opcode: Int, label: Label?)
Link copied to clipboard
open fun visitLabel(label: Label?)
Link copied to clipboard
open fun visitLdcInsn(value: Any?)
Link copied to clipboard
open fun visitLineNumber(line: Int, start: Label?)
Link copied to clipboard
open fun visitLocalVariable(name: String?, descriptor: String?, signature: String?, start: Label?, end: Label?, index: Int)
Link copied to clipboard
open fun visitLocalVariableAnnotation(typeRef: Int, typePath: TypePath?, start: Array<out Label?>?, end: Array<out Label?>?, index: IntArray?, descriptor: String?, visible: Boolean): AnnotationVisitor?
Link copied to clipboard
open fun visitLookupSwitchInsn(dflt: Label?, keys: IntArray?, labels: Array<out Label?>?)
Link copied to clipboard
open fun visitMaxs(maxStack: Int, maxLocals: Int)
Link copied to clipboard
open override fun visitMethodInsn(opcode: Int, owner: String, name: String, descriptor: String, isInterface: Boolean)
open fun visitMethodInsn(opcode: Int, owner: String?, name: String?, descriptor: String?)
Link copied to clipboard
open fun visitMultiANewArrayInsn(descriptor: String?, numDimensions: Int)
Link copied to clipboard
open fun visitParameter(name: String?, access: Int)
Link copied to clipboard
open fun visitParameterAnnotation(parameter: Int, descriptor: String?, visible: Boolean): AnnotationVisitor?
Link copied to clipboard
open fun visitTableSwitchInsn(min: Int, max: Int, dflt: Label?, vararg labels: Label?)
Link copied to clipboard
open fun visitTryCatchAnnotation(typeRef: Int, typePath: TypePath?, descriptor: String?, visible: Boolean): AnnotationVisitor?
Link copied to clipboard
open fun visitTryCatchBlock(start: Label?, end: Label?, handler: Label?, type: String?)
Link copied to clipboard
open fun visitTypeAnnotation(typeRef: Int, typePath: TypePath?, descriptor: String?, visible: Boolean): AnnotationVisitor?
Link copied to clipboard
open override fun visitTypeInsn(opcode: Int, type: String)

A CHECKCAST to an inaccessible class is itself access-checked, so a cast the Kotlin compiler emitted around a value we just erased would re-introduce the failure the erasure avoids. Widen it to Object — the value already is of that type at runtime; the cast existed only to satisfy the verifier.

Link copied to clipboard
open fun visitVarInsn(opcode: Int, varIndex: Int)