Simn / genjvm

13 stars 1 forks source link

Improve StackMapTable #5

Closed Simn closed 5 years ago

Simn commented 5 years ago

Currently, all stack maps are generated as StackFull because the documentation went a bit over my head. We should

  1. read the documentation until we understand it and
  2. figure out the diff between the last and current stack frame and use one of the other options.
Simn commented 5 years ago

Damn, the JVM spec sure expects some accurate reading. For append_frame, it calculates the number of additional variables by doing frame_type - 251, so you get a natural 252 = 1, 253 = 2, 254 = 3 mapping. However, for chop_frame it's the reverse, 251 - frame_type. So that means 248 = 3, 249 = 2, 250 = 1.