Avoid marking too deep portions of stack in mark_stack.