xpiler: added reference definition handling