Switch-interpreter: Reduce copy-pasted code in array handling. am: 1332c26c69
am: 2a97fd3e00

Change-Id: Iecd69eb7ea1537ab9db99b6a629fc911121ead75