Enigma icon indicating copy to clipboard operation
Enigma copied to clipboard

double wide parameter mapping

Open Player3324 opened this issue 7 years ago • 1 comments

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

Player3324 avatar Dec 11 '18 23:12 Player3324

@gegy1000 I think you might find this handy if you want to take on that refactor

asiekierka avatar Dec 15 '18 21:12 asiekierka