INSTANCEOF support

This commit is contained in:
Michael Bogdanov
2016-09-23 14:42:40 +03:00
committed by Dmitry Petrov
parent 869f60a053
commit bf822daa3b
@@ -350,6 +350,12 @@ class ExpressionCodegen(
generateAsCast(mv, expression.typeOperand, boxType(expression.typeOperand.asmType), expression.operator == IrTypeOperator.SAFE_CAST)
}
IrTypeOperator.INSTANCEOF -> {
gen(expression.argument, OBJECT_TYPE, data)
val type = boxType(expression.typeOperand.asmType)
generateIsCheck(mv, expression.typeOperand, type)
}
else -> super.visitTypeOperator(expression, data)
}
return expression.onStack