/** * Records a cache hit on a cold block. */ private void coldHit(Set<HashEntry<K, V>> evicted) { // See section 3.3 case 2: // "Upon accessing an HIR resident block X: // This is a hit in the cache." // "We move it to the top of stack S." boolean inStack = inStack(); moveToStackTop(); // "There are two cases for block X:" if ( inStack ) { // "(1) If X is in the stack S, we change its status to LIR." hot(); // "This block is also removed from list Q." removeFromQueue(); // "The LIR block in the bottom of S is moved to the end of list Q // with its status changed to HIR." owner.stackBottom().migrateToQueue(); // "A stack pruning is then conducted." owner.pruneStack( evicted ); } else { // "(2) If X is not in stack S, we leave its status in HIR and move // it to the end of list Q." moveToQueueEnd(); } }
/** * Records a cache hit on a hot block. */ private void hotHit(Set<HashEntry<K, V>> evicted) { // See section 3.3 case 1: // "Upon accessing an LIR block X: // This access is guaranteed to be a hit in the cache." // "We move it to the top of stack S." boolean onBottom = ( owner.stackBottom() == this ); moveToStackTop(); // "If the LIR block is originally located in the bottom of the stack, // we conduct a stack pruning." if ( onBottom ) { owner.pruneStack( evicted ); } }
/** * Records a miss when the hot entry set is not full. */ private void warmupMiss() { // See section 3.3: // "When LIR block set is not full, all the referenced blocks are // given an LIR status until its size reaches L_lirs." hot(); moveToStackTop(); }
/** * Records a cache hit on a cold block. */ private void coldHit(Set<HashEntry<K, V>> evicted) { // See section 3.3 case 2: // "Upon accessing an HIR resident block X: // This is a hit in the cache." // "We move it to the top of stack S." boolean inStack = inStack(); moveToStackTop(); // "There are two cases for block X:" if ( inStack ) { // "(1) If X is in the stack S, we change its status to LIR." hot(); // "This block is also removed from list Q." removeFromQueue(); // "The LIR block in the bottom of S is moved to the end of list Q // with its status changed to HIR." owner.stackBottom().migrateToQueue(); // "A stack pruning is then conducted." owner.pruneStack( evicted ); } else { // "(2) If X is not in stack S, we leave its status in HIR and move // it to the end of list Q." moveToQueueEnd(); } }
/** * Records a cache hit on a hot block. */ private void hotHit(Set<HashEntry<K, V>> evicted) { // See section 3.3 case 1: // "Upon accessing an LIR block X: // This access is guaranteed to be a hit in the cache." // "We move it to the top of stack S." boolean onBottom = ( owner.stackBottom() == this ); moveToStackTop(); // "If the LIR block is originally located in the bottom of the stack, // we conduct a stack pruning." if ( onBottom ) { owner.pruneStack( evicted ); } }
/** * Records a miss when the hot entry set is not full. */ private void warmupMiss() { // See section 3.3: // "When LIR block set is not full, all the referenced blocks are // given an LIR status until its size reaches L_lirs." hot(); moveToStackTop(); }