public class Target.Extension
extends java.lang.Object
Stack and locals extensions are generally localised to a particular injection. This means they don't necessarily need to accumulate, it's generally sufficient to expand the method's original stack or locals size by the extension amount, with the largest extension determining the final stack size of the method.
Before this mechanism, injectors generally needed to keep track of their extension sizes via arbitrary integers, then apply them in one go. However some injector logic made the flow of these integers hard to track and lead to insidious bugs when values which should be combined were instead applied sequentially. The minor performance trade-off of using extensions to track these operations is covered by the increase in robustness.
| Modifier and Type | Method and Description |
|---|---|
Target.Extension |
add()
Add 1 to this extension
|
Target.Extension |
add(int size)
Add the specified size to this extension
|
Target.Extension |
add(org.objectweb.asm.Type[] types)
Add the size of the supplied type array to this extension.
|
void |
apply()
Apply this extension to the target.
|
int |
get()
Get the current size of this extension
|
Target.Extension |
set(int size)
Set the size of this extension
|
public Target.Extension add()
public Target.Extension add(int size)
size - size to addpublic Target.Extension add(org.objectweb.asm.Type[] types)
types - Types to addpublic Target.Extension set(int size)
size - Size to setpublic int get()
public void apply()