fix #3651, codegen was missing some gc roots when boxing objects