[cvs-nhc98] patch applied (yhc): Moved to switching based on NEED_HEAPS rather than on single instructions