[Vm-dev] Why is the method context size fixed to two magical numbers?

Max Leske maxleske at gmail.com
Thu Jul 7 11:02:04 UTC 2016


Hi,

I’ve been looking at the code that creates new method contexts (in the image and in the VM) and I can’t figure out why it would be beneficial to fix the size of the context to (currently) 16 (22) or 56 (62) bytes. Clément says in one of his blog entries that this if for performance reasons but I don’t see where the performance gain is (the Bluebook doesn’t mention this either). At allocation time the VM simply takes the number of bytes to allocate from the “large context flag”. Maybe the performance gain comes from the idea that the size does not have to be calculated? But then I ask: why not simply store the frame size instead of this weird flag?

Cheers,
Max


More information about the Vm-dev mailing list