Backport Better implementations of unbox helpers.

Use primitive operators that convey more meaning to the VM
as the expected result type.

(cherry picked from commit a8f76d706cf27ef7c153b889702b4db2a15a7a66)