Interface CodeLocalsShifter
- All Superinterfaces:
ClassFileTransformPREVIEW<CodeTransformPREVIEW,
,CodeElementPREVIEW, CodeBuilderPREVIEW> CodeTransformPREVIEW
CodeLocalsShifter
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
CodeLocalsShifter
PREVIEW is a CodeTransform
PREVIEW 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.- Since:
- 22
-
Nested Class Summary
Nested classes/interfaces declared in interface java.lang.classfile.ClassFileTransformPREVIEW
ClassFileTransform.ResolvedTransformPREVIEW<E extends ClassFileElementPREVIEW>
-
Field Summary
Fields declared in interface java.lang.classfile.CodeTransformPREVIEW
ACCEPT_ALL
-
Method Summary
Modifier and TypeMethodDescriptionstatic CodeLocalsShifterPREVIEW
of
(AccessFlagsPREVIEW methodFlags, MethodTypeDesc methodDescriptor) Creates a new instance ofCodeLocalsShifter
PREVIEW with fixed local slots calculated from provided method information.Methods declared in interface java.lang.classfile.ClassFileTransformPREVIEW
accept, atEnd, atStart
Methods declared in interface java.lang.classfile.CodeTransformPREVIEW
andThen, resolve
-
Method Details
-
of
Creates a new instance ofCodeLocalsShifter
PREVIEW with fixed local slots calculated from provided method information.- Parameters:
methodFlags
- flags of the method to constructCodeLocalsShifter
PREVIEW formethodDescriptor
- descriptor of the method to constructCodeLocalsShifter
PREVIEW for- Returns:
- new instance of
CodeLocalsShifter
PREVIEW
-
CodeLocalsShifter
when preview features are enabled.