src/virtual-machines/source-1-with-mark-region-gc.js
// Finds first hole and sets bump head and bump tail
Finds first hole and sets bump head and bump tail
Finds first hole and sets bump head and bump tail
function ALLOCATE_BUMP_HEAD_AND_TAIL() {
  SCAN = A + HEAP[A + FIRST_CHILD_SLOT];
  while (SCAN <= A + HEAP[A + LAST_CHILD_SLOT]) {
    if (HEAP[SCAN + LINE_LIMIT_SLOT] === HEAP[SCAN + LINE_ADDRESS_SLOT]) {
      BUMP_HEAD = HEAP[SCAN + LINE_ADDRESS_SLOT];
      ALLOCATE_BUMP_TAIL();
      break;
    } else {
      SCAN = SCAN + LINE_BK_SIZE;
    }
  }
}
function ALLOCATE_BUMP_HEAD_AND_TAIL ( ) { SCAN = A + HEAP [ A + FIRST_CHILD_SLOT ] ; while ( SCAN <= A + HEAP [ A + LAST_CHILD_SLOT ] ) { if ( HEAP [ SCAN + LINE_LIMIT_SLOT ] === HEAP [ SCAN + LINE_ADDRESS_SLOT ] ) { BUMP_HEAD = HEAP [ SCAN + LINE_ADDRESS_SLOT ] ; ALLOCATE_BUMP_TAIL ( ) ; break ; } else { SCAN = SCAN + LINE_BK_SIZE ; } } }
Finds first hole and sets bump head and bump tail
Finds first hole and sets bump head and bump tail
// finds a hole (one or more free lines) and allocate new bump head and tail // if line is free/empty // set bump head to start of line