JVM IR: Optimize type checks to null checks if possible
This commit is contained in:
committed by
Georgy Bronnikov
parent
07737f8fc6
commit
951b2fa770
Vendored
+5
-2
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
abstract class A8 : MutableCollection<Any> {
|
||||
override fun contains(o: Any): Boolean {
|
||||
throw UnsupportedOperationException()
|
||||
@@ -8,5 +7,9 @@ abstract class A8 : MutableCollection<Any> {
|
||||
// 1 bridge
|
||||
// 1 public final bridge size
|
||||
// 0 INSTANCEOF
|
||||
/* Only 1 IFNULL should be within contains method */
|
||||
|
||||
/* Only 1 null check should be within the contains method */
|
||||
// JVM_TEMPLATES:
|
||||
// 1 IFNULL
|
||||
// JVM_IR_TEMPLATES:
|
||||
// 1 IFNONNULL
|
||||
|
||||
Vendored
+5
-2
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
abstract class A<T : Any> : MutableCollection<T> {
|
||||
override fun contains(o: T): Boolean {
|
||||
throw UnsupportedOperationException()
|
||||
@@ -8,5 +7,9 @@ abstract class A<T : Any> : MutableCollection<T> {
|
||||
// 1 bridge
|
||||
// 1 public final bridge size
|
||||
// 0 INSTANCEOF
|
||||
/* Only 1 IFNULL should be within contains method (because T is not nullable) */
|
||||
|
||||
/* Only 1 null check should be within the contains method (because T is not nullable) */
|
||||
// JVM_TEMPLATES:
|
||||
// 1 IFNULL
|
||||
// JVM_IR_TEMPLATES:
|
||||
// 1 IFNONNULL
|
||||
|
||||
Reference in New Issue
Block a user