JVM_IR add bytecode shape check to all relevant for-loop tests

This commit is contained in:
Dmitry Petrov
2021-09-06 16:42:48 +03:00
committed by TeamCityServer
parent d9e4dec810
commit 860c80d210
105 changed files with 780 additions and 78 deletions
@@ -29,4 +29,11 @@ fun box(): String {
// 1 NEW java/lang/IllegalArgumentException
// 1 ATHROW
// 0 IF
// 0 ARETURN
// 0 ARETURN
// JVM_IR_TEMPLATES
// 0 ILOAD
// 0 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -18,20 +18,6 @@ fun box(): String {
// For "step" progressions in JVM IR, when the step is constant and == 1, and "step" is called on a literal progression which we already
// know to have a step whose absolute value is 1, we can essentially ignore the "step" call.
//
// Expected lowered form of loop:
//
// // Standard form of loop over progression
// var inductionVar = 1
// val last = 4
// if (inductionVar <= last) {
// // Loop is not empty
// do {
// val i = inductionVar
// inductionVar += 1
// // Loop body
// } while (inductionVar <= last)
// }
// 0 iterator
// 0 getStart
@@ -43,4 +29,11 @@ fun box(): String {
// 0 NEW java/lang/IllegalArgumentException
// 0 ATHROW
// 1 IF_ICMPLE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 2 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -18,20 +18,7 @@ fun box(): String {
// For "step" progressions in JVM IR, when the step is constant and == 1, and "step" is called on a literal progression which we already
// know to have a step whose absolute value is 1, we can essentially ignore the "step" call.
//
// Expected lowered form of loop:
//
// // Standard form of loop over progression
// var inductionVar = 1
// val last = 4
// if (inductionVar <= last) {
// // Loop is not empty
// do {
// val i = inductionVar
// inductionVar += 1
// // Loop body
// } while (inductionVar <= last)
// }
// 0 iterator
// 0 getStart
@@ -43,4 +30,11 @@ fun box(): String {
// 0 NEW java/lang/IllegalArgumentException
// 0 ATHROW
// 1 IF_ICMPLE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 2 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -19,20 +19,6 @@ fun box(): String {
// For "step" progressions in JVM IR, a call to getProgressionLastElement() is made to compute the "last" value.
// If the step is non-constant, there is a check that it is > 0, and if not, an IllegalArgumentException is thrown. However, when the
// step is constant and > 0, this check does not need to be added.
//
// Expected lowered form of loop:
//
// // Standard form of loop over progression
// val last = 1
// var inductionVar = getProgressionLastElement(1, 8, 2)
// if (last <= inductionVar) {
// // Loop is not empty
// do {
// val i = inductionVar
// inductionVar += -2
// // Loop body
// } while (last <= inductionVar)
// }
// 0 reversed
// 0 iterator
@@ -46,4 +32,11 @@ fun box(): String {
// 0 ATHROW
// 1 IF_ICMPGT
// 1 IF_ICMPLE
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC