Fix #580: the IR optimization pass for object mode would generate incorr...

...ect code with DUP_TOP* opcodes.