A cache subsystem may comprise a multi-way set associative cache and a
data memory that holds a contiguous block of memory defined by an address
stored in a register. Local variables (e.g., Java local variables) may be
stored in the data memory. The data memory preferably is adapted to store
two groups of local variables. A first group comprises local variables
associated with finished methods and a second group comprises local
variables associated with unfinished methods. Further, local variables
are saved to, or fetched from, external memory upon a context change
based on a threshold value differentiating the first and second groups.
The first value may comprise a threshold address or an allocation bit
associated with each of a plurality of lines forming the data memory.