java.lang.Object
org.glavo.classfile.impl.CodeStackTrackerImpl
- All Implemented Interfaces:
ClassFileTransform<CodeTransform,,CodeElement, CodeBuilder> CodeTransform,CodeStackTracker
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glavo.classfile.ClassFileTransform
ClassFileTransform.ResolvedTransform<E extends ClassFileElement> -
Field Summary
Fields inherited from interface org.glavo.classfile.CodeTransform
ACCEPT_ALL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(CodeBuilder cb, CodeElement el) Transform an element by taking the appropriate actions on the builder.Returns tracked max stack size.stack()Returns Collection of TypeKind representing current stack.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glavo.classfile.ClassFileTransform
atEnd, atStartMethods inherited from interface org.glavo.classfile.CodeTransform
andThen, resolve
-
Constructor Details
-
CodeStackTrackerImpl
-
-
Method Details
-
stack
Description copied from interface:CodeStackTrackerReturns Collection of TypeKind representing current stack. Returns an empty Optional when the Stack content is unknown (right afterxRETURN, ATHROW, GOTO, GOTO_W, LOOKUPSWITCH, TABLESWITCHinstructions).Temporary unknown stack content can be recovered by binding of a Label used as target of a branch instruction from existing code with known stack (forward branch target), or by binding of a Label defining an exception handler (exception handler code start).
- Specified by:
stackin interfaceCodeStackTracker- Returns:
- actual stack content, or an empty Optional if unknown
-
maxStackSize
Description copied from interface:CodeStackTrackerReturns tracked max stack size. Returns an empty Optional when max stack size tracking has been lost.Max stack size tracking is permanently lost when a stack instruction appears and the actual stack content is unknown.
- Specified by:
maxStackSizein interfaceCodeStackTracker- Returns:
- tracked max stack size, or an empty Optional if tracking has been lost
-
accept
Description copied from interface:ClassFileTransformTransform an element by taking the appropriate actions on the builder. Used when transforming a classfile entity (class, method, field, method body.) If no transformation is desired, the element can be presented toClassFileBuilder.with(ClassFileElement). If the element is to be dropped, no action is required.- Specified by:
acceptin interfaceClassFileTransform<CodeTransform,CodeElement, CodeBuilder> - Parameters:
cb- the builder for the new entityel- the element
-