src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
equal
deleted
inserted
replaced
156 public final Set<String> toBeInvestigated = new TreeSet<>(); |
156 public final Set<String> toBeInvestigated = new TreeSet<>(); |
157 |
157 |
158 private static Collection<String> add(Collection<String> c, String... elements) { |
158 private static Collection<String> add(Collection<String> c, String... elements) { |
159 String[] sorted = elements.clone(); |
159 String[] sorted = elements.clone(); |
160 Arrays.sort(sorted); |
160 Arrays.sort(sorted); |
161 for (int i = 0; i < elements.length; i++) { |
161 if (!Arrays.equals(elements, sorted)) { |
162 if (!elements[i].equals(sorted[i])) { |
162 int width = 2 + Arrays.asList(elements).stream().map(String::length).reduce(0, Integer::max); |
163 // Let's keep the list sorted for easier visual inspection |
163 Formatter fmt = new Formatter(); |
164 fail("Element %d is out of order, \"%s\"", i, elements[i]); |
164 fmt.format("%-" + width + "s | sorted%n", "original"); |
165 } |
165 fmt.format("%s%n", new String(new char[width * 2 + 2]).replace('\0', '=')); |
|
166 for (int i = 0; i < elements.length; i++) { |
|
167 fmt.format("%-" + width + "s | %s%n", elements[i], sorted[i]); |
|
168 } |
|
169 fail("Elements not sorted alphabetically:%n%s", fmt); |
166 } |
170 } |
167 c.addAll(Arrays.asList(elements)); |
171 c.addAll(Arrays.asList(elements)); |
168 return c; |
172 return c; |
169 } |
173 } |
170 |
174 |
515 String aesDecryptName = HotSpotGraphBuilderPlugins.lookupIntrinsicName(config, "com/sun/crypto/provider/AESCrypt", "implDecryptBlock", "decryptBlock"); |
519 String aesDecryptName = HotSpotGraphBuilderPlugins.lookupIntrinsicName(config, "com/sun/crypto/provider/AESCrypt", "implDecryptBlock", "decryptBlock"); |
516 |
520 |
517 // AES intrinsics |
521 // AES intrinsics |
518 if (!config.useAESIntrinsics) { |
522 if (!config.useAESIntrinsics) { |
519 add(ignore, |
523 add(ignore, |
|
524 "com/sun/crypto/provider/AESCrypt." + aesDecryptName + "([BI[BI)V", |
520 "com/sun/crypto/provider/AESCrypt." + aesEncryptName + "([BI[BI)V", |
525 "com/sun/crypto/provider/AESCrypt." + aesEncryptName + "([BI[BI)V", |
521 "com/sun/crypto/provider/AESCrypt." + aesDecryptName + "([BI[BI)V", |
|
522 "com/sun/crypto/provider/CipherBlockChaining." + cbcDecryptName + "([BII[BI)I", |
526 "com/sun/crypto/provider/CipherBlockChaining." + cbcDecryptName + "([BII[BI)I", |
523 "com/sun/crypto/provider/CipherBlockChaining." + cbcEncryptName + "([BII[BI)I"); |
527 "com/sun/crypto/provider/CipherBlockChaining." + cbcEncryptName + "([BII[BI)I"); |
524 } |
528 } |
525 |
529 |
526 // BigInteger intrinsics |
530 // BigInteger intrinsics |