APIdia Launch Partner
Top Description Fields Methods
jdk.internal.classfile.components

public sealed Interface CodeLocalsShifter

extends CodeTransform
permits CodeLocalsShifterImpl
Known Direct Implementers
jdk.internal.classfile.impl.CodeLocalsShifterImpl
Imports
java.lang.classfile.AccessFlags, .CodeTransform, .TypeKind, java.lang.constant.MethodTypeDesc, java.lang.reflect.AccessFlag, jdk.internal.classfile.impl.CodeLocalsShifterImpl

CodeLocalsShifter is a CodeTransform shifting locals to newly allocated positions to avoid conflicts during code injection. Locals pointing to the receiver or to method arguments slots are never shifted. All locals pointing beyond the method arguments are re-indexed in order of appearance.

Field Summary

Inherited from java.lang.classfile.CodeTransform:
ACCEPT_ALL

Method Summary

Modifier and TypeMethod and Description
public static CodeLocalsShifter

Returns:

new instance of CodeLocalsShifter
of
(AccessFlags
flags of the method to construct CodeLocalsShifter for
methodFlags
,
MethodTypeDesc
descriptor of the method to construct CodeLocalsShifter for
methodDescriptor
)

Creates a new instance of CodeLocalsShifter with fixed local slots calculated from provided method information.

Inherited from java.lang.classfile.CodeTransform:
andThenendHandlerofStateful

Method Detail

ofback to summary
public static CodeLocalsShifter of(AccessFlags methodFlags, MethodTypeDesc methodDescriptor)

Creates a new instance of CodeLocalsShifter with fixed local slots calculated from provided method information.

Parameters
methodFlags:AccessFlags

flags of the method to construct CodeLocalsShifter for

methodDescriptor:MethodTypeDesc

descriptor of the method to construct CodeLocalsShifter for

Returns:CodeLocalsShifter

new instance of CodeLocalsShifter