Switch-interpreter: Reduce amount of copy-pasted code.
am: ee12e3abd3

Change-Id: I271166667700dab3fa385f47cc0394a855fb7011