JVM IR: Implement the new inline class ABI

This commit is contained in:
Steven Schäfer
2020-05-20 19:12:11 +02:00
committed by Dmitry Petrov
parent e60a32e8d3
commit dc0ef996b7
192 changed files with 95 additions and 376 deletions
@@ -70,17 +70,17 @@ public class GenerateRangesCodegenTestData {
private static final Map<String, String> ELEMENT_TYPE_KNOWN_SUBSTRINGS = new HashMap<>();
private static final Map<String, String> MIN_MAX_CONSTANTS = new LinkedHashMap<>();
private static final List<String> FIR_PASSING_UNSIGNED_LITERAL_TESTS = Collections.emptyList();
private static final List<String> FIR_FAILING_UNSIGNED_LITERAL_TESTS =
Arrays.asList("inexactDownToMinValue", "inexactToMaxValue", "maxValueMinusTwoToMaxValue", "maxValueToMaxValue",
"maxValueToMinValue", "overflowZeroDownToMaxValue", "overflowZeroToMinValue", "progressionDownToMinValue",
"progressionMaxValueMinusTwoToMaxValue", "progressionMaxValueToMaxValue", "progressionMaxValueToMinValue",
"progressionMinValueToMinValue");
private static final List<String> FIR_PASSING_UNSIGNED_EXPRESSION_TESTS = Collections.emptyList();
private static final List<String> FIR_FAILING_UNSIGNED_EXPRESSION_TESTS = FIR_FAILING_UNSIGNED_LITERAL_TESTS;
private static final List<String> JVM_IR_PASSING_UNSIGNED_LITERAL_TESTS =
Arrays.asList(
"simpleRange",
"overflowZeroToMinValue", "overflowZeroDownToMaxValue", "overflowZeroDownToMinValue",
"maxValueToMaxValue", "maxValueToMinValue",
"progressionMaxValueToMaxValue", "maxValueMinusTwoToMaxValue", "progressionMaxValueToMinValue"
);
private static final List<String> JVM_IR_FAILING_UNSIGNED_LITERAL_TESTS = Collections.emptyList();
private static final List<String> JVM_IR_FAILING_UNSIGNED_EXPRESSION_TESTS = Collections.emptyList();
static {
for (String integerType : INTEGER_PRIMITIVES) {
@@ -244,11 +244,11 @@ public class GenerateRangesCodegenTestData {
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, false, false);
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, false, false);
writeToFile(new File(UNSIGNED_AS_LITERAL_DIR, fileName), unsignedAsLiteralBody.toString(), true,
!FIR_PASSING_UNSIGNED_LITERAL_TESTS.contains(testFunName),
!JVM_IR_PASSING_UNSIGNED_LITERAL_TESTS.contains(testFunName));
FIR_FAILING_UNSIGNED_LITERAL_TESTS.contains(testFunName),
JVM_IR_FAILING_UNSIGNED_LITERAL_TESTS.contains(testFunName));
writeToFile(new File(UNSIGNED_AS_EXPRESSION_DIR, fileName), unsignedAsExpressionBody.toString(), true,
!FIR_PASSING_UNSIGNED_EXPRESSION_TESTS.contains(testFunName),
true);
FIR_FAILING_UNSIGNED_EXPRESSION_TESTS.contains(testFunName),
JVM_IR_FAILING_UNSIGNED_EXPRESSION_TESTS.contains(testFunName));
}
}
}
@@ -27,18 +27,7 @@ object GenerateSteppedRangesCodegenTestData {
"zeroToMaxValueStepMaxValue.kt"
)
private val JVM_IR_FAILING_FOR_UNSIGNED_SUBDIRS =
setOf(
"expression/downTo",
"expression/downTo/reversed",
"expression/downTo/nestedStep",
"expression/rangeTo",
"expression/rangeTo/nestedStep",
"expression/rangeTo/reversed",
"expression/until",
"expression/until/nestedStep",
"expression/until/reversed"
)
private val JVM_IR_FAILING_FOR_UNSIGNED_FILENAMES = setOf<String>()
private enum class Type(val type: String, val isLong: Boolean = false, val isUnsigned: Boolean = false) {
INT("Int"),
@@ -242,9 +231,8 @@ object GenerateSteppedRangesCodegenTestData {
extraCode,
File(UNSIGNED_TEST_DATA_DIR, fullSubdirPath),
asLiteral,
shouldIgnoreForFIR = fileName in FIR_FAILING_FOR_UNSIGNED_FILENAMES ||
fullSubdirPath in JVM_IR_FAILING_FOR_UNSIGNED_SUBDIRS,
shouldIgnoreForJvmIR = fullSubdirPath in JVM_IR_FAILING_FOR_UNSIGNED_SUBDIRS
shouldIgnoreForFIR = fileName in FIR_FAILING_FOR_UNSIGNED_FILENAMES,
shouldIgnoreForJvmIR = fileName in JVM_IR_FAILING_FOR_UNSIGNED_FILENAMES,
)
}
if (signedTests.isNotEmpty()) {