Reduce duplication between compileMacro and compileCaller.