The Ultimate Stack Frame

  • Local Variable Array
  • Operand Stack
  • Frame Data (It will be discussed in a separate blog)
  • It is a zero-based array (index starts from 0)
  • The array is first occupied by method parameters followed by local variables (ordered fashion).
  • If a method is an instance method, the first slot in a local variable array is occupied by “this” reference.
  • Each slot is of 32 bits.
  • Values of int, float, and references occupy a slot whereas long and double occupies two slots.
  • In the case of byte, short, boolean and char, values are expanded to occupy a full-length slot (32 bits).
Local Variable Array
  • This stack is used as a workspace area.
  • Since it is a stack, it can either perform push operation or pop operation.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store