Enigma
Enigma copied to clipboard
double wide parameter mapping
Long or Double parameters take 2 local variable indices, x for long/double and x+1 for top. Enigma doesn't handle them correctly, usually only exporting the 1st occurrence as x+1.
For consistency across various fabric related utilities+formats, future proofing for the anticipated double wide slot removal in OpenJDK's Valhalla project and simplicity local variables should be identified in the mappings as follows:
- one index per single or double wide arg
- start at 0, incrementing by 1, no gaps
- in declaration order
ARG x is the same as org.objectweb.asm.Type.getArgumentTypes(desc)[x].
For reference the local variables get recorded as:
- one index per single or double wide variable
- start at 0, incrementing by 1, no gaps
- ignoring "this" and args without incrementing
- same order as in the local variable table stable-sorted by pc/bytecode start offset
@gegy1000 I think you might find this handy if you want to take on that refactor