Package io.micronaut.sourcegen.bytecode.core
@NullMarked
package io.micronaut.sourcegen.bytecode.core
Backend-neutral bytecode metadata utilities.
-
ClassDescriptionResolves
Targetmetadata for annotations represented by the Sourcegen model.Resolves generic bridges from Sourcegen model, reflection, and annotation-processing types.A finished bridge method.The erased method shape used by a bridge.A bridge a class declares for a method it inherits.A visibility bridge: a public method a public class inherits from a superclass that is not public, which javac declares again in the class, delegating to the superclass's, so that reflection can invoke it through the class.The body of a constructor as both bytecode writers write it: the constructor call first, then the initializers of the instance fields, then the rest of the statements.Whether the field initializers run after a delegation tothis(...).The conversions both bytecode writers emit, planned once as thestepseach writer only emits: a checkcast, an unboxing with the source's wrapper, a primitive conversion and a boxing -Conversions.plan(TypeDef, TypeDef, ObjectDef, MethodDef, Conversions.Checkcasts).A boxing of a primitive: thevalueOfof its wrapper.Acheckcastof a reference.Which checkcasts of a conversion are left out as redundant.A conversion of a primitive to another:i2l,l2ifollowed byi2b, and so on.A step of a conversion, which a writer emits as its instructions.An unboxing: a checkcast of the reference to the owner, which the method is invoked on, returning the primitive the owner holds, and a conversion of that primitive to the target, where it is another.The return type a class file declares for an invoked method, where the call names another: aT get()of aGetter<String>invoked for aStringis written, as javac writes it, with the descriptor of its declaration,()Ljava/lang/Object;, and a checkcast of the result.The variables of the enclosing class in scope of the inner class a writer writes - a member class that is not static - of the generated class the outer type names:Supplier<T>of an inner class of anOuter<T>names theTofOuter.Model-level enum member synthesis shared by bytecode backends.An invocation as both bytecode writers emit it, planned once: the instruction and what it names - the owner, the descriptor with the return type the method declares, whether the owner is an interface - what happens to the receiver, the parameters the arguments are converted to, and the conversion of the result to the type the call requests.An invocation instruction.What happens to the receiver of an invocation once it is written.The conversion of what a declaration returns to the type the call requests.Maps Java model modifiers to JVMS access flags without depending on a bytecode library.The method references a metafactory cannot link to their method directly, which are written as a lambda calling it.The referential comparisons (==and!=) of two primitives, which both bytecode writers compare as javac compares them: the values, promoted to a common type (JLS 5.6, binary numeric promotion) - alongcompared with afloatis compared as afloat, and acharwith abyteas anint.Two primitive operands compared as their values: each one is written, then converted to the common type.JVM generic-signature operations shared by bytecode writers.The switches both bytecode writers write as a switch on anint, as javac writes them: a selector of typeint,char,shortorbyteis widened to anint, and one of their wrappers is unboxed first, which throwsNullPointerExceptionfornull.JVM descriptor operations shared by bytecode writers.The type a call's receiver is written as.