- adjustorStub->frame_size = sz * 4 + 12 /* ebp save + extra args */;
- adjustorStub->frame_size = (adjustorStub->frame_size + 15) & ~15; // align to 16 bytes
- adjustorStub->frame_size -= 12; // we push the extra args separately
+
+ // The adjustor puts the following things on the stack:
+ // 1.) %ebp link
+ // 2.) padding and (a copy of) the arguments
+ // 3.) a dummy argument
+ // 4.) hptr
+ // 5.) return address (for returning to the adjustor)
+ // All these have to add up to a multiple of 16.
+
+ // first, include everything in frame_size
+ adjustorStub->frame_size = sz * 4 + 16;
+ // align to 16 bytes
+ adjustorStub->frame_size = (adjustorStub->frame_size + 15) & ~15;
+ // only count 2.) and 3.) as part of frame_size
+ adjustorStub->frame_size -= 12;