Use iterator instead of recursion in codegen_place
#91278
+67
−76
Merged