Stack cache memory for block-structured programs