Merge "Revert "Revert "Optimize code generation of check-cast and instance-of."""