From f7ebca2763bd25564370977e1e6f16ad22159326 Mon Sep 17 00:00:00 2001 From: Bob Vandette Date: Wed, 31 Oct 2018 16:27:01 -0400 Subject: [PATCH 001/128] 8213204: ReservedStackTest and ReservedStackTestCompiler tests fail on windows Reviewed-by: fparain, dcubed, jwilhelm --- .../ReservedStack/ReservedStackTest.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java b/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java index e595fb80729..d5a9e6f0601 100644 --- a/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java +++ b/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java @@ -232,6 +232,19 @@ public class ReservedStackTest { } } + private static boolean isAlwaysSupportedPlatform() { + return Platform.isAix() || + (Platform.isLinux() && + (Platform.isPPC() || Platform.isS390x() || Platform.isX64() || + Platform.isX86() || Platform.isAArch64())) || + Platform.isOSX() || + Platform.isSolaris(); + } + + private static boolean isNeverSupportedPlatform() { + return !isAlwaysSupportedPlatform(); + } + private static boolean isSupportedPlatform; private static void initIsSupportedPlatform() throws Exception { @@ -256,11 +269,19 @@ public class ReservedStackTest { // Do a sanity check. Some platforms we know are always supported. Make sure // we didn't determine that one of those platforms is not supported. - if (!isSupportedPlatform) { + if (!isSupportedPlatform && isAlwaysSupportedPlatform()) { String msg = "This platform should be supported: " + Platform.getOsArch(); System.err.println("FAILED: " + msg); throw new RuntimeException(msg); } + + // And some platforms we know are never supported. Make sure + // we didn't determine that one of those platforms is supported. + if (isSupportedPlatform && isNeverSupportedPlatform()) { + String msg = "This platform should not be supported: " + Platform.getOsArch(); + System.err.println("FAILED: " + msg); + throw new RuntimeException(msg); + } } public static void main(String[] args) throws Exception { From b627cee53232100bfeae71f54b6af758b7037d18 Mon Sep 17 00:00:00 2001 From: Rajan Halade Date: Wed, 31 Oct 2018 13:58:15 -0700 Subject: [PATCH 002/128] 8207059: Update test certificates in QuoVadisCA.java test Reviewed-by: mullan, mbaesken --- .../certification/QuoVadisCA.java | 750 +++++++++--------- 1 file changed, 374 insertions(+), 376 deletions(-) diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java index 82b851b27b7..94a317b2a4a 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,29 +21,20 @@ * questions. */ - /* +/* * @test - * @bug 8189131 + * @bug 8189131 8207059 * @summary Interoperability tests with QuoVadis Root CA1, CA2, and CA3 CAs * @build ValidatePathWithParams * @run main/othervm -Djava.security.debug=certpath QuoVadisCA OCSP * @run main/othervm -Djava.security.debug=certpath QuoVadisCA CRL */ - /* +/* * Obtain TLS test artifacts for QuoVadis CAs from: * - * Valid TLS Certificates: - * CA1: https://qvica1g3-v.quovadisglobal.com - * CA2: https://qvsslicag3-v.quovadisglobal.com - * CA2 EV: https://evsslicag3-v.quovadisglobal.com - * CA3: https://qvica3g3-v.quovadisglobal.com + * https://www.quovadisglobal.com/QVRepository/TestCertificates.aspx * - * Revoked TLS Certificates: - * CA1: https://qvica1g3-r.quovadisglobal.com - * CA2: https://qvsslicag3-r.quovadisglobal.com - * CA2 EV: https://evsslicag3-r.quovadisglobal.com - * CA3: https://qvica3g3-r.quovadisglobal.com */ public class QuoVadisCA { @@ -51,423 +42,430 @@ public class QuoVadisCA { ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = true; - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { pathValidator.enableCRLCheck(); - ocspEnabled = false; } else { // OCSP check by default pathValidator.enableOCSPCheck(); } - new RootCA1().runTest(pathValidator, ocspEnabled); - new RootCA2().runTest(pathValidator, ocspEnabled); - new RootCA3().runTest(pathValidator, ocspEnabled); + new RootCA1G3().runTest(pathValidator); + new RootCA2G3().runTest(pathValidator); + new RootCA3G3().runTest(pathValidator); } } -class RootCA1 { +class RootCA1G3 { - // Owner: CN=QuoVadis Issuing CA 1 G3, O=QuoVadis Limited, C=BM - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIGFTCCA/2gAwIBAgIUPybG62jqpxKYOV5MlXAGPJYDy9MwDQYJKoZIhvcNAQEL\n" - + "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" - + "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjExMDYxNjA5NTJaFw0y\n" - + "MjExMDYxNjA5NTJaMEsxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n" - + "aW1pdGVkMSEwHwYDVQQDExhRdW9WYWRpcyBJc3N1aW5nIENBIDEgRzMwggIiMA0G\n" - + "CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2Ud42yCfjYm4WlQ+nhTpZ9aPp0r8a\n" - + "yz+kKpPxc8ZWvEi7HDPhr7f5nWnEruHE0HbH8WyFGE+sICF788VpZLbFhL4wbIWV\n" - + "tHIrYan7+yL2yoNbHUBgeWxa48P96WxrW34K/OyQkJoSvY4iNk4BGI0wOYD9wsl9\n" - + "6wIaQFNu25Wsv0CcDSsyNjw8O8Ib6dmS6iib+KnZlKJnYqSTrzbnzf/2CU+Wb9V0\n" - + "yExk7shcfDpqxo9yyyEBPP1GUEb5SSr9qXYP2d4UsrRIgzKpD5feqdjk6ZGA4xeM\n" - + "JHo6GLjddNvVvopaKaLrDzlOXgqgbMIPQu+xkzpKW3IJOylxN55oVuH25MwbS9IL\n" - + "kDMv//kdiTUl1wXERZiUmcBdpWt9D9liyVxe5+HeI5VlhDuHsxDoPFmoOGTa6brX\n" - + "PXlNc0xji+grBQjIRNs43T5+GyYzCyjzG3dSb0BTYGLnfUAEQ1+MCC3K33DKL/me\n" - + "iUrWNclh85BQQigJr5HNLym3+J6Jf0OCnq4VmD1OFrhZrui02Xmz/hOECK2Mciga\n" - + "DxRgXBKjLebV0RW3j6libuPiKbxSinfqNqf2Q9eCfKrzgWQkuCHZvkt0Cqgzjbm1\n" - + "n5xu9zXR8YG5/680Nyb3tywUb6FhA8l1L/KLoK79RGjKgPotCog6Ykvy/667jlyo\n" - + "ZII0YUf6S3uyeQIDAQABo4HzMIHwMBIGA1UdEwEB/wQIMAYBAf8CAQEwEQYDVR0g\n" - + "BAowCDAGBgRVHSAAMDoGCCsGAQUFBwEBBC4wLDAqBggrBgEFBQcwAYYeaHR0cDov\n" - + "L29jc3AucXVvdmFkaXNnbG9iYWwuY29tMA4GA1UdDwEB/wQEAwIBBjAfBgNVHSME\n" - + "GDAWgBSjl9bzXqIQ4atFnzwXZDzuAXCczDA7BgNVHR8ENDAyMDCgLqAshipodHRw\n" - + "Oi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdnJjYTFnMy5jcmwwHQYDVR0OBBYE\n" - + "FF0EGBL7w+p4fbRXCaH+bf6Cn2TNMA0GCSqGSIb3DQEBCwUAA4ICAQAF6qNCo3LP\n" - + "Qk8jthU1aiuo5WW9jQC+PqWeyVe4JjHK+5PRM+BtoErOItfZyPqoIBMedC/Ya9L1\n" - + "Sv0gncvifjtTD3jIBz0FVCbIMJLRp63b4qtmAGuB00XTXgCFcYoiIq5kyNedJnLe\n" - + "IxMqb0xx8IAqvP9kfEVNdGfvYraSswiGXADftZ3yM24zIc3Ysewi3JeTbzDhEGfb\n" - + "yv9eBplkfKfcoKyOds4sLcxj1QpUxcXgjX1mKTbfOSD5ac/Cjrz6Kqnl2+PNrc5N\n" - + "kXBVKhcCAjpqX5OyI86IUg9XY8i7Lz+tXzAQhllh+rPyTyAmieGf2iV9wrl//OZB\n" - + "l2nXwbgfA7QwQ2VdsmGJfW3a7Zc13GCNx0M2RUGJKLMJOavY72d41wAYPQ46AXls\n" - + "Ic7RJi6EWmwLi6lvw4kKFfWZ0c6vIJur1hLUUmLOt0UBZ226eIREVpmFbDGOLzfl\n" - + "gU0xKhqmU0aIOORzBGDfOrnctvaXORNNhCZ78zS96Egzu2w2OC47Zry7k+EOatzA\n" - + "5zrdJJM3UP7aMSNPvEygbcFUw2I04vpxUuPYTwCtogqNMHqFbCjLM9YxhzsGMdh/\n" - + "9aD1krboaSXUjrS9cOr5P2A9kFHCMsXBaDoaijQXNeyhu+oCeYsdv4S3djFwDW3+\n" - + "iPLo51aqZGsTZ1S22vYdkp+QFByLtArVMQ==\n" - + "-----END CERTIFICATE-----"; + // Owner: CN=QuoVadis QVRCA1G3 SSL ICA, O=QuoVadis Limited, C=BM + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGszCCBJugAwIBAgIUdJ4w/GwP08WekbUIXvYTsQrO+a8wDQYJKoZIhvcNAQEL\n" + + "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + + "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xNzA0MTkxNTAzMzZaFw0y\n" + + "NzA0MTkxNTAzMzZaMEwxCzAJBgNVBAYTAkJNMRkwFwYDVQQKDBBRdW9WYWRpcyBM\n" + + "aW1pdGVkMSIwIAYDVQQDDBlRdW9WYWRpcyBRVlJDQTFHMyBTU0wgSUNBMIICIjAN\n" + + "BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqVn6XxE+YKKifggi6EPcx7mOOrhA\n" + + "HVxHFsFV/OR/dtQlx2oOTAGPpa8o3ZPVubtNH5QiiMBBiPDW1KqBaU+rmgUeGCj0\n" + + "hWKbdNGRQ5h3rV+4Vhs45BYxQcUzGTZ+oobao8gNo1LuhPIhOQComGOjZtUP0+qQ\n" + + "nXsWJn5004TvCzu7mmt3aTlMeyjSbpoXa3ojwU2BvUzJwcLg0BD49kNXZsM0JLbY\n" + + "QgfEfluWFkb5QzjnE45sBni4LJNfSodhNB+mL/VmETO+0m/A1H6in1rG1n4Ao2G6\n" + + "KYgtk9rXWfF3g7JqwuZUULfI0467h14oG1PzqVcLgZ1B+wrdyiBJJSpRmhf00xSB\n" + + "WM/p93s2xkyQZ2Uh0b0tP90S6spwwpL8PSW3J8x46LaZDEVON/Gm9H891ZgwHLaf\n" + + "3idGX93XHFafve8CrJFMhK2AZElwYaz2H6iJuPftyhR3oQIgLst8l+/2LoqDRyaI\n" + + "6c+tVnk8LcvUgDEPuA70aNthQQ6PWA7iuI2Oies6GEPm7gKVNxIrg6rp2T9RghLm\n" + + "vLnf6Gyn1ONLI7Ib3EyzjE8CJIAtor5KZcs8xm8iPNsDQza+1ugx8D8Zsla64vVw\n" + + "w2W2qNH4orutsAQKRImtbDkEnMb3nGDe0ZPohVyw3Fy+b9g6MX7wQzFjIx3UkzZG\n" + + "QQqGdIh940Qq3wUCAwEAAaOCAY8wggGLMBIGA1UdEwEB/wQIMAYBAf8CAQAwSQYD\n" + + "VR0gBEIwQDA+BgRVHSAAMDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cucXVvdmFk\n" + + "aXNnbG9iYWwuY29tL3JlcG9zaXRvcnkwdAYIKwYBBQUHAQEEaDBmMCoGCCsGAQUF\n" + + "BzABhh5odHRwOi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wOAYIKwYBBQUHMAKG\n" + + "LGh0dHA6Ly90cnVzdC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2ExZzMuY3J0MA4G\n" + + "A1UdDwEB/wQEAwIBBjAnBgNVHSUEIDAeBggrBgEFBQcDAQYIKwYBBQUHAwIGCCsG\n" + + "AQUFBwMJMB8GA1UdIwQYMBaAFKOX1vNeohDhq0WfPBdkPO4BcJzMMDsGA1UdHwQ0\n" + + "MDIwMKAuoCyGKmh0dHA6Ly9jcmwucXVvdmFkaXNnbG9iYWwuY29tL3F2cmNhMWcz\n" + + "LmNybDAdBgNVHQ4EFgQUIAYNQkuk2dMocCdjvExpRiGBHTwwDQYJKoZIhvcNAQEL\n" + + "BQADggIBAEu/Bea66BZPfGNE4Np+PCRrTag/U7EBK/Yhjmf3mHtFMZzZ94QLH1km\n" + + "4iJ5dPKTR/+1iYYNHfO7fY2Lj/Tg/E+q2SEfA0n6Y/lYHAlbmnaYGGdtfTOjaQgL\n" + + "0Bf0TmLPyc/gf9uKHe230vIaN4QcodBnCmCJOAk/lvIl7b7gRNPN/HuJNQlBohNx\n" + + "ih9VAtLXJ6xO6Xfs5o8ZkZkHb2nG/M1yxySEyU3mqQ5PTgy8kg59szWr2ufT8PvL\n" + + "JuyGNQmT/PHcLp2zaCC0+5Ra65umjhG8IW2haXu8g8aRAgr9ZRPrcgg2npLBA0Qf\n" + + "MTEJPPptGx2GQgE+lMdn5Gff82d3Y35pDmxNTA7hy+4CnWKfmoey7ll8kwGxC+W1\n" + + "OUVgzfdXcpsm+HP2z4E/zw6uB0cAFgMJbxgnm6ZW9+R2yEbD6EOpqR8HqCvhVkkv\n" + + "CdQBNkk432pKD3+L7o6vkwONFOFWVpbXHIxDf9ys8Jr4B8qYWDUnR6jz/HG9aWPV\n" + + "k4vBYYWuahANZCfCKH2B9SqCdK6DjwKihYmallClwsUQnSwW8H7xqmLtAHX0ek7z\n" + + "1Ipj/BNS6c52cPxeAoFbUcVt6+M8xURIJ5qrobTYVaJ8AtfW+3Ml2oqT/EiItXOk\n" + + "W1319hZuAGD5qaG3dg9aLYUqpD948xJVhYVxwIIwvL4G9ZEVyYmE\n" + + "-----END CERTIFICATE-----"; - // Owner: CN=qvica1g3-v.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, + // Owner: CN=qvsslrca1g3-ssl-v.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, // ST=Pembroke, C=BM - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" - + "MIIF9DCCA9ygAwIBAgIUGug3BoLw4/auIdDQ0mHS6QnPHB8wDQYJKoZIhvcNAQEL\n" - + "BQAwSzELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxITAf\n" - + "BgNVBAMTGFF1b1ZhZGlzIElzc3VpbmcgQ0EgMSBHMzAeFw0xNDExMTQxNDA1MDda\n" - + "Fw0xNzExMTQxNDA0NTFaMHYxCzAJBgNVBAYTAkJNMREwDwYDVQQIEwhQZW1icm9r\n" - + "ZTERMA8GA1UEBxMISGFtaWx0b24xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQx\n" - + "JjAkBgNVBAMTHXF2aWNhMWczLXYucXVvdmFkaXNnbG9iYWwuY29tMIIBIjANBgkq\n" - + "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwHoNPHE0C/tEwI5jeYvKJdo5SXSccB/c\n" - + "nCHJVs/4i9F8oRmPqNiFMD99UVylk4nn8iqi8MoxrFAhqtmplPslgRDLwyLMmnGO\n" - + "1cNoPKGMKxQq9EerBgSk4wqeSsSH+7qnZhCamIlvEm0PUaEH8rcjXokTs0fyjadF\n" - + "UmVwcmSZdmnNjseOMgm+G6C8tEPHRQl/Oezy6DzS9PQVLUFCBSyOaAgDnr4EvwGE\n" - + "u2fd3m+ys80XXGq4eLy1MmuC7U+bIQuupuydk/S7kVh7Rl+5nT1eTv0LEOj5gYFc\n" - + "C5SBnhiLibuRTOr+LsC9HpvN4vnoCaOogWxDQj/f1KRn45PNJncsbwIDAQABo4IB\n" - + "ozCCAZ8wdAYIKwYBBQUHAQEEaDBmMCoGCCsGAQUFBzABhh5odHRwOi8vb2NzcC5x\n" - + "dW92YWRpc2dsb2JhbC5jb20wOAYIKwYBBQUHMAKGLGh0dHA6Ly90cnVzdC5xdW92\n" - + "YWRpc2dsb2JhbC5jb20vcXZpY2ExZzMuY3J0MCgGA1UdEQQhMB+CHXF2aWNhMWcz\n" - + "LXYucXVvdmFkaXNnbG9iYWwuY29tMFEGA1UdIARKMEgwRgYMKwYBBAG+WAACZAEB\n" - + "MDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3Jl\n" - + "cG9zaXRvcnkwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggr\n" - + "BgEFBQcDAjAfBgNVHSMEGDAWgBRdBBgS+8PqeH20Vwmh/m3+gp9kzTA7BgNVHR8E\n" - + "NDAyMDCgLqAshipodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmljYTFn\n" - + "My5jcmwwHQYDVR0OBBYEFJO98+S7NZMTz2JRogpUwLuxjTa0MA0GCSqGSIb3DQEB\n" - + "CwUAA4ICAQCq1O/BnzpQjbTbmEob/bWH/p92ZYRV0Lr01CdYkRXl4XKL2ZLusel6\n" - + "126AIvAK51o65wiGVaLGs49AKXOjcaAnTfwoFembqFRlBiGFSOdglTIsZUGdmhtP\n" - + "x1meetkOY8bY79viGkVCufAVq0hAF+AYh4nYM+/n7IijIcM5uhzIDb2Vw8+wKPTB\n" - + "7k2K/e1GGwbqrIAkjrZ6kpRg632RkbR18anaDVOgXuKzmZMRbIAii/N+lo7u3DhC\n" - + "5mJEIjP4cQXd569AfKQzvBO+syGDAJyX5PbTrd59IXZ+EjiisIq/DNQi6QalWMfS\n" - + "BnK97nUzH/BjAofMaUufbB8dxg+RT0QC/Yl1lmlA3CYmr6YWn06DiAuWL14ZFFwh\n" - + "2HQ7juU9oQ1I/HTfhVBoTzuKGCW1ZNXA64IdKlBsYp8NO9xKjBWIxwU/+S/IgoQP\n" - + "aTNkY4Mc353bdLi9082JwaiQ9B5eH0V9pZ17OSRU44o2TeDDT85sjF+krqCnnolR\n" - + "3lk7iqYDRHsvgqJqtkhhX/boF3wJAnKqaZ6j97PVqV75kwAak7XaH7C50RsPQGk2\n" - + "j5OFa6ioobW7tN5PfWAZPMZn98yX2Wh8Z95aGhdsHSJHsrlcUiWa+X2D1kF/dOKd\n" - + "R8rPqdPIPjUglrXS4yP+cJHx6fCJxW7me1R60lpuL6JNvHp54u7GGA==\n" - + "-----END CERTIFICATE-----"; + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGJzCCBA+gAwIBAgIUGCzNOZhcLiPYbOjRFAp5n04dPNowDQYJKoZIhvcNAQEL\n" + + "BQAwTDELMAkGA1UEBhMCQk0xGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxIjAg\n" + + "BgNVBAMMGVF1b1ZhZGlzIFFWUkNBMUczIFNTTCBJQ0EwHhcNMTcwNTAyMTcwMDA4\n" + + "WhcNMjAwNTAyMTcxMDAwWjB9MQswCQYDVQQGEwJCTTERMA8GA1UECAwIUGVtYnJv\n" + + "a2UxETAPBgNVBAcMCEhhbWlsdG9uMRkwFwYDVQQKDBBRdW9WYWRpcyBMaW1pdGVk\n" + + "MS0wKwYDVQQDDCRxdnNzbHJjYTFnMy1zc2wtdi5xdW92YWRpc2dsb2JhbC5jb20w\n" + + "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCLgSX0nduUm87/qmfTdofL\n" + + "5P/Xtrly8Z9GaiLPLu1syNqT/Sri4ngYQGXXwF8h6gnHgEb6gDI2p3Q3gb75NthO\n" + + "WfWMD6FqafV47pUeNml6JvNbsYAPc8qGxMPtgQ8HhQuU+Trykx3onq/Se5HRYlve\n" + + "7MMJixiYQKYwwThHh9G1uGYPMQJT2TQfueIAu0MT6Ljc2YB6noXpzTzU63dvmC1Q\n" + + "8TMmFoJYL276lQ3p3vRKEW1nVmjeVoqvK/3Vpg440KbQL5D7Gj/pQPL4d7ljyS/I\n" + + "UN3q7QPS7BojsvF90u0YpvYEuBXsxdFnqivj5owSuSENG4nqcZUO8/nY+4b+NbJd\n" + + "AgMBAAGjggHOMIIByjB6BggrBgEFBQcBAQRuMGwwPgYIKwYBBQUHMAKGMmh0dHA6\n" + + "Ly90cnVzdC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2ExZzNzc2xpY2EuY3J0MCoG\n" + + "CCsGAQUFBzABhh5odHRwOi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wHQYDVR0O\n" + + "BBYEFIDk6mMLdh49CFbFiUDnjZhWatYzMB8GA1UdIwQYMBaAFCAGDUJLpNnTKHAn\n" + + "Y7xMaUYhgR08MGkGA1UdIARiMGAwRgYMKwYBBAG+WAABZAEBMDYwNAYIKwYBBQUH\n" + + "AgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3JlcG9zaXRvcnkwCAYG\n" + + "Z4EMAQICMAwGCisGAQQBvlgBhFgwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny\n" + + "bC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2ExZzNzc2xpY2EuY3JsMA4GA1UdDwEB\n" + + "/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwLwYDVR0RBCgw\n" + + "JoIkcXZzc2xyY2ExZzMtc3NsLXYucXVvdmFkaXNnbG9iYWwuY29tMA0GCSqGSIb3\n" + + "DQEBCwUAA4ICAQB2XiV2msE7M8Qp0YIcihD86T8U91PJH7Pb3F/3+8fyX08/oKDo\n" + + "s80sE50tiI5lw+tSFQZuvpOFefejEh1uAwu1slZOlvICHOAJNG1EXPa8pEmDU2i5\n" + + "nd5r7rM757/+cgsPLvwegVuIL4vIYhnoKzPiXpkl8FkNrhRjqeUIAXf2sLjbbbng\n" + + "oYRCypkSovpijPf7Cid19wKh/ipp8DxCNnGMit55mnx7eFNAWpb9cFljd+WaABCA\n" + + "IcvcZhZrLKYrbUErdQzzu0sa3IlEC5QBgz+IvT62RHT+vWRiv0LYhkHVLsDQUHpJ\n" + + "uTa1xi0qvBVGIP1jxIQv5W3hGPLYt7B/8A8v+xOn4m1VWfGIa4V3RGpbBMw19DH+\n" + + "JvLjg8coDWKhqZ150V31Ve8wczSjT+KZHFRWTb4TZt8GSXa56kJV5xadPW8A3EKV\n" + + "kulcspO1njb73ImrwTPIOLnDAsMDrAO41FEob87bdZacpg+kHjiAP9BzpgSSX1x5\n" + + "b/qy2uRtsf3ZlOb1J6fCqb8lRwSU7uGUStUx4tVMpjR5LQfNVroiDEthN5BE6sye\n" + + "zVRq8vyGvG40jSMBZF1KyW4GW6JlgM1THr1egNFhNkHBs7pSTHJp1Ea+QJjB1uVe\n" + + "A8kBL0iUlI5PPOqe5KdEXcFy3L+gRh34gyckC4vrLzfNLjKHQvdRHYnQBA==\n" + + "-----END CERTIFICATE-----"; - // Owner: CN=qvica1g3-r.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, + // Owner: CN=qvsslrca1g3-ssl-r.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, // ST=Pembroke, C=BM - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" - + "MIIF9DCCA9ygAwIBAgIUBAG4l0ZPYhEdLJSMWYCr7LHngvswDQYJKoZIhvcNAQEL\n" - + "BQAwSzELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxITAf\n" - + "BgNVBAMTGFF1b1ZhZGlzIElzc3VpbmcgQ0EgMSBHMzAeFw0xMjExMTQxMzQ4MDda\n" - + "Fw0xNDExMTQxMzQ4MDdaMHYxCzAJBgNVBAYTAkJNMREwDwYDVQQIEwhQZW1icm9r\n" - + "ZTERMA8GA1UEBxMISGFtaWx0b24xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQx\n" - + "JjAkBgNVBAMTHXF2aWNhMWczLXIucXVvdmFkaXNnbG9iYWwuY29tMIIBIjANBgkq\n" - + "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlof1qJLTiqI7bf0IU7zOxy0HqjIn0pW\n" - + "lNIEVAjQRR1jnfpsMapicIGZfnnNaYpwdsIjGPwpvWXGA+30ezJNGfWMjhb/tiis\n" - + "qjrHdwXAob5MyXOXP5ZS8K34GwKeL45oJZZG0cf2FSta9/CSsRC9wnDUp/kA+VkH\n" - + "n5vlg7VpUExYO0CBXe4C4ehnvCZHjW5nqpVpm993f9i8E0W3vHPxjGuyuqVEEfma\n" - + "WfOV78+HF4hxALnr+73mp0i6Do2oa/v85mZzyKeBm2YHhwdQ6CC7UZtABlHyWuz9\n" - + "h/ocTGbX92rbUaW6icu9bKQkQ9jsomnQkU5b8CWseo2O0NXBevvCowIDAQABo4IB\n" - + "ozCCAZ8wdAYIKwYBBQUHAQEEaDBmMCoGCCsGAQUFBzABhh5odHRwOi8vb2NzcC5x\n" - + "dW92YWRpc2dsb2JhbC5jb20wOAYIKwYBBQUHMAKGLGh0dHA6Ly90cnVzdC5xdW92\n" - + "YWRpc2dsb2JhbC5jb20vcXZpY2ExZzMuY3J0MCgGA1UdEQQhMB+CHXF2aWNhMWcz\n" - + "LXIucXVvdmFkaXNnbG9iYWwuY29tMFEGA1UdIARKMEgwRgYMKwYBBAG+WAACZAEB\n" - + "MDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3Jl\n" - + "cG9zaXRvcnkwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggr\n" - + "BgEFBQcDAjAfBgNVHSMEGDAWgBRdBBgS+8PqeH20Vwmh/m3+gp9kzTA7BgNVHR8E\n" - + "NDAyMDCgLqAshipodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmljYTFn\n" - + "My5jcmwwHQYDVR0OBBYEFNrefqnat67/DMlw0Z/xdQ478leyMA0GCSqGSIb3DQEB\n" - + "CwUAA4ICAQBG1TxJNbWzG4ShZefK4wEdScBzxSB7StYO3mmIP2D3LTlEk+zWjDVP\n" - + "ERPL41Si92asMHvMai7GcFT82XyHxsQGZIPcgIm+rC2NiSPDx2Vd6lkMaO8J9mrU\n" - + "3Z4Ks3G5HmszQ/gXRT3DCoNng+k+JqdZjrvMcsGTH+AzRdoinwOi+QnpphAcZRhS\n" - + "Io8C7w9osUPYFdDaE3Io+oYr2mWJg4n+FGsjxunQgIhLiiNaVF8zHxER7gW0YsCW\n" - + "vw1jX0dmfQZSdo2ybVeHuznUxtUWRHJ/nv6v2B2anUsVEbPyrpQ3i9+BzWaYolPU\n" - + "ZYxfMHBQ7HvncRP6rgrHF4x+iOnIxWsErYdEj5nQJkptYbVl41VzO6xMP7WvXFPa\n" - + "dqxwihqILRmAZrI9p/6k/HqV9xMPKprUhnWDGQ/bYnPKyXoTx6uwamaonX4DpW83\n" - + "b3CJTvBHwKh5eJQoBykAkakPdrmbOhe4/XWnDqQVUgJNmEvkg33AexviJo4mW3HG\n" - + "K2MdM60GRIC3Lcnd+Q8SnSCCxp+YtuE/C3Fu8VI/8vz9MC159GGtDzyC7OeKPCpU\n" - + "7H1X0X/OhBkiv7anK/oIhtSw+4DrM2eaVjdWkEa+di2jvI/2us8TXxO1LL+eeSxT\n" - + "E+LbdNO0jSp8azw2Aw4zL+Q41Fzt7OlH7mTkw1mxLF3aWsUNUz/p4w==\n" - + "-----END CERTIFICATE-----"; + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGJzCCBA+gAwIBAgIUGeTgdhQ6UoMWie3kBh4IGxDH4AQwDQYJKoZIhvcNAQEL\n" + + "BQAwTDELMAkGA1UEBhMCQk0xGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxIjAg\n" + + "BgNVBAMMGVF1b1ZhZGlzIFFWUkNBMUczIFNTTCBJQ0EwHhcNMTcwNTAyMTY1OTQ4\n" + + "WhcNMjAwNTAyMTcwOTAwWjB9MQswCQYDVQQGEwJCTTERMA8GA1UECAwIUGVtYnJv\n" + + "a2UxETAPBgNVBAcMCEhhbWlsdG9uMRkwFwYDVQQKDBBRdW9WYWRpcyBMaW1pdGVk\n" + + "MS0wKwYDVQQDDCRxdnNzbHJjYTFnMy1zc2wtci5xdW92YWRpc2dsb2JhbC5jb20w\n" + + "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDR/0pcsSc4mmqVkzCO5h1m\n" + + "BlZ0uxmakNTNnWqeOXmMgl2KBni6MzIdxBkPmII5TI3nc+DXrWrtBCJKRtww3mbF\n" + + "ZoBhrscODv3OjfVqsVfhUPjqLwUEE9X/8IlxFpcsKRH1mC7weLg56kfnHuK2WHPQ\n" + + "dbnVgzzjk8mSi8HL3szIiojGC0ZwilrV/LCXBqETC3aMe8PtGnMW96TcvqQEdYFa\n" + + "4MEXuYnUwXB0WoKAJkHw/MMc0RytrICtlpaMQ7ZnloW8LvoQ1wIM7nWwCr+dieh6\n" + + "lZCWRN/Au+h6qdyDUDUPQFoGpp7AfE2OJmeCY30gp4GdAKtGpTG++gfJrtkc8FnZ\n" + + "AgMBAAGjggHOMIIByjB6BggrBgEFBQcBAQRuMGwwPgYIKwYBBQUHMAKGMmh0dHA6\n" + + "Ly90cnVzdC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2ExZzNzc2xpY2EuY3J0MCoG\n" + + "CCsGAQUFBzABhh5odHRwOi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wHQYDVR0O\n" + + "BBYEFGffDkPGAcip01jKnnvEt1jpKNRnMB8GA1UdIwQYMBaAFCAGDUJLpNnTKHAn\n" + + "Y7xMaUYhgR08MGkGA1UdIARiMGAwRgYMKwYBBAG+WAABZAEBMDYwNAYIKwYBBQUH\n" + + "AgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3JlcG9zaXRvcnkwCAYG\n" + + "Z4EMAQICMAwGCisGAQQBvlgBhFgwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny\n" + + "bC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2ExZzNzc2xpY2EuY3JsMA4GA1UdDwEB\n" + + "/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwLwYDVR0RBCgw\n" + + "JoIkcXZzc2xyY2ExZzMtc3NsLXIucXVvdmFkaXNnbG9iYWwuY29tMA0GCSqGSIb3\n" + + "DQEBCwUAA4ICAQBI/zlzisJLwBNaVZkQDMh1gYY8uRUad6Jn7yBFQbJ796VVlD1A\n" + + "yxJD+y9cpwzXvwKau8jIMi96OXo6xtsTDxKY9PzW8DkrlrxqdzLI7s5M30tGu8Sk\n" + + "WitIWPC3FU0oZqa9jBPkfujllR5FNuYikMOFIi2+/3haEK/6kviLpe5WyK4yJ3a9\n" + + "7dLq0If4vhNbKsuW1ROnq5CpPy+iIuZy3CWtq8WJSHDyZzhzrW48QHmTkoAU5lAb\n" + + "3KLMBo/gtUTjABVauADeVZVN6GgLflSIdz1P/aMJQ88q/88w+6KYJlBtg3mWSRHc\n" + + "Vh+BkIiKmfTG+N9SJ5jv7VKt8PjcKgqCzOHUslLHgUDFhJ5gdYIixD24ikRHYriH\n" + + "UCO3ltEppIUm/xgins75F6V9YBxHA1Ks/S5MfMnI6N+fFurIwIsas5w6gTPNwbBC\n" + + "z6G1fu6schk73uvfK4W6PiuMTURsQ1M746K2BlV+FIclTk8jYHe+EyLFgIsgVigo\n" + + "JJs0DsIp0RoGvw+bxxyA9CHeFFi+MlAVEj2+qJnwrD3ZqNFFw87/HDIWW+Ue8ERs\n" + + "HfPDZvEQZ1BHGzD/H04F0+HwwfItxvgiQVC2L/yjmh7St311OLiK8RM3Ur0X15bZ\n" + + "3g4c1gsHx9Gmlk3l8YIOk0yxvLaF03YsNbrfykXHuJM9Phy8Ya3nTpsqtw==\n" + + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - if (ocspEnabled) { - // Revoked certificates are expired in Nov 2014 - // and backdated revocation check is only possible with OCSP - pathValidator.setValidationDate("Jan 01, 2014"); - } - pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Thu Jan 03 23:47:34 PST 2013", System.out); - - // reset validation date back to current date - pathValidator.resetValidationDate(); + "Tue May 02 10:15:37 PDT 2017", System.out); } } -class RootCA2 { +class RootCA2G3 { - // Owner: CN=QuoVadis Global SSL ICA G3, O=QuoVadis Limited, C=BM - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIGFzCCA/+gAwIBAgIUftbnnMmtgcTIGT75XUQodw40ExcwDQYJKoZIhvcNAQEL\n" - + "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" - + "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjExMDYxNDUwMThaFw0y\n" - + "MjExMDYxNDUwMThaME0xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n" - + "aW1pdGVkMSMwIQYDVQQDExpRdW9WYWRpcyBHbG9iYWwgU1NMIElDQSBHMzCCAiIw\n" - + "DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANf8Od17be6c6lTGJDhEXpmkTs4y\n" - + "Q39Rr5VJyBeWCg06nSS71s6xF3sZvKcV0MbXlXCYM2ZX7cNTbJ81gs7uDsKFp+vK\n" - + "EymiKyEiI2SImOtECNnSg+RVR4np/xz/UlC0yFUisH75cZsJ8T1pkGMfiEouR0EM\n" - + "7O0uFgoboRfUP582TTWy0F7ynSA6YfGKnKj0OFwZJmGHVkLs1VevWjhj3R1fsPan\n" - + "H05P5moePFnpQdj1FofoSxUHZ0c7VB+sUimboHm/uHNY1LOsk77qiSuVC5/yrdg3\n" - + "2EEfP/mxJYT4r/5UiD7VahySzeZHzZ2OibQm2AfgfMN3l57lCM3/WPQBhMAPS1jz\n" - + "kE+7MjajM2f0aZctimW4Hasrj8AQnfAdHqZehbhtXaAlffNEzCdpNK584oCTVR7N\n" - + "UR9iZFx83ruTqpo+GcLP/iSYqhM4g7fy45sNhU+IS+ca03zbxTl3TTlkofXunI5B\n" - + "xxE30eGSQpDZ5+iUJcEOAuVKrlYocFbB3KF45hwcbzPWQ1DcO2jFAapOtQzeS+MZ\n" - + "yZzT2YseJ8hQHKu8YrXZWwKaNfyl8kFkHUBDICowNEoZvBwRCQp8sgqL6YRZy0uD\n" - + "JGxmnC2e0BVKSjcIvmq/CRWH7yiTk9eWm73xrsg9iIyD/kwJEnLyIk8tR5V8p/hc\n" - + "1H2AjDrZH12PsZ45AgMBAAGjgfMwgfAwEgYDVR0TAQH/BAgwBgEB/wIBATARBgNV\n" - + "HSAECjAIMAYGBFUdIAAwOgYIKwYBBQUHAQEELjAsMCoGCCsGAQUFBzABhh5odHRw\n" - + "Oi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wDgYDVR0PAQH/BAQDAgEGMB8GA1Ud\n" - + "IwQYMBaAFO3nb3Zav2DsSVvGpXe7chZxm8Q9MDsGA1UdHwQ0MDIwMKAuoCyGKmh0\n" - + "dHA6Ly9jcmwucXVvdmFkaXNnbG9iYWwuY29tL3F2cmNhMmczLmNybDAdBgNVHQ4E\n" - + "FgQUsxKJtalLNbwVAPCA6dh4h/ETfHYwDQYJKoZIhvcNAQELBQADggIBAFGm1Fqp\n" - + "RMiKr7a6h707M+km36PVXZnX1NZocCn36MrfRvphotbOCDm+GmRkar9ZMGhc8c/A\n" - + "Vn7JSCjwF9jNOFIOUyNLq0w4luk+Pt2YFDbgF8IDdx53xIo8Gv05e9xpTvQYaIto\n" - + "qeHbQjGXfSGc91olfX6JUwZlxxbhdJH+rxTFAg0jcbqToJoScWTfXSr1QRcNbSTs\n" - + "Y4CPG6oULsnhVvrzgldGSK+DxFi2OKcDsOKkV7W4IGg8Do2L/M588AfBnV8ERzpl\n" - + "qgMBBQxC2+0N6RdFHbmZt0HQE/NIg1s0xcjGx1XW3YTOfje31rmAXKHOehm4Bu48\n" - + "gr8gePq5cdQ2W9tA0Dnytb9wzH2SyPPIXRI7yNxaX9H8wYeDeeiKSSmQtfh1v5cV\n" - + "7RXvm8F6hLJkkco/HOW3dAUwZFcKsUH+1eUJKLN18eDGwB8yGawjHvOKqcfg5Lf/\n" - + "TvC7hgcx7pDYaCCaqHaekgUwXbB2Enzqr1fdwoU1c01W5YuQAtAx5wk1bf34Yq/J\n" - + "ph7wNXGvo88N0/EfP9AdVGmJzy7VuRXeVAOyjKAIeADMlwpjBRhcbs9m3dkqvoMb\n" - + "SXKJxv/hFmNgEOvOlaFsXX1dbKg1v+C1AzKAFdiuAIa62JzASiEhigqNSdqdTsOh\n" - + "8W8hdONuKKpe9zKedhBFAvuxhDgKmnySglYc\n" - + "-----END CERTIFICATE-----"; + // Owner: CN=QuoVadis EV SSL ICA G3, O=QuoVadis Limited, C=BM + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGuDCCBKCgAwIBAgIUUk/B8W400XArhKE/sEK7zHw8kDIwDQYJKoZIhvcNAQEL\n" + + "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + + "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xNjExMzAxNjIxMDFaFw0y\n" + + "NjExMzAxNjIxMDFaMEkxCzAJBgNVBAYTAkJNMRkwFwYDVQQKDBBRdW9WYWRpcyBM\n" + + "aW1pdGVkMR8wHQYDVQQDDBZRdW9WYWRpcyBFViBTU0wgSUNBIEczMIICIjANBgkq\n" + + "hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAonyczmwRSnw5BhWIrfcD19EbE7bYu5dF\n" + + "tD8o/5NtQCW+XdoLX+X9uNTuvnPw9Hv2RdhYrJgeLgF2wZ52XMGknRdB8tQYrknA\n" + + "l/j0N5f8DD82xP2eBkCpIB0UED4zNVwwWcdWvBUgNEdNobz9vQKb7B5LlbXm9kaO\n" + + "uxYgcv8WsNMivSP3mkJShEOh4RZ3ZdBM/vtJyuvUyEPjyiSzfN94tZHx/H194S4D\n" + + "VAPgE7ny3ISzN+Aa3kjyLebP/sPzI1AY0DWx8Yg4STG1j0PJeuTb6Ago2kmx4Kqn\n" + + "4q4kSPL8CgITYHiKaJx6Dt8Q90ieJ7ywG4Mb/YADOIlmoXZ6kXhzGAxyWXFgolLb\n" + + "4UToIh6U66v3Iyq+gXyCeMXGT4nUgs3+PduzOei9668jeKQaoU5d7LjJUL+ZH2+Y\n" + + "1bPmMAypHFLZryziOzC5kRo4TamgAf3LHHr2C7yIUuo+avlv3cic3NUodcfMi7Ax\n" + + "OQFLb32CtDoDeVb5v3x88R0tIEJTizk6M1B/0pGtZiFfXtrNVfHmEYvY2rOLbgWK\n" + + "M831ykqZSYHUpiqgnaNJb4Qs8WcxqUw1xki64WwiPclUSn5XgGMIwxSDGjUIJHKR\n" + + "rzgQ9lneHOHVb8pXHNFkdBDHTb1KNmDOyLsg3q0LJP6P3nzT/aWDAj3glpJvGQ5d\n" + + "kjAbjx+NFk8CAwEAAaOCAZcwggGTMBIGA1UdEwEB/wQIMAYBAf8CAQAwUQYDVR0g\n" + + "BEowSDBGBgwrBgEEAb5YAAJkAQIwNjA0BggrBgEFBQcCARYoaHR0cDovL3d3dy5x\n" + + "dW92YWRpc2dsb2JhbC5jb20vcmVwb3NpdG9yeTB0BggrBgEFBQcBAQRoMGYwKgYI\n" + + "KwYBBQUHMAGGHmh0dHA6Ly9vY3NwLnF1b3ZhZGlzZ2xvYmFsLmNvbTA4BggrBgEF\n" + + "BQcwAoYsaHR0cDovL3RydXN0LnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdnJjYTJnMy5j\n" + + "cnQwDgYDVR0PAQH/BAQDAgEGMCcGA1UdJQQgMB4GCCsGAQUFBwMBBggrBgEFBQcD\n" + + "AgYIKwYBBQUHAwkwHwYDVR0jBBgwFoAU7edvdlq/YOxJW8ald7tyFnGbxD0wOwYD\n" + + "VR0fBDQwMjAwoC6gLIYqaHR0cDovL2NybC5xdW92YWRpc2dsb2JhbC5jb20vcXZy\n" + + "Y2EyZzMuY3JsMB0GA1UdDgQWBBTlhFTQkEmfOLryyeEqCMVOn6BIPzANBgkqhkiG\n" + + "9w0BAQsFAAOCAgEAY/EHWbpNwCgGVQ1B7cIn530n6Rnht8ryN6E4Sis2GG09801s\n" + + "eCVMoGUB1uBCWm7uqQqydjTbjLhuub7hTjSJ1J30SOK1CZbk+c1VP9DcjY46hycy\n" + + "tUKQ2WbgkaY+l/tZNDKu0djc2hA5apljQCmiIzckbcHr6yRnFK7ZPjSPCAUKm20D\n" + + "vORQ7hsIaomsIlqXm5BPssMcxjI48Ezgv/s8ynASI8S5P2vOnBo08sJBM/a0Kbuw\n" + + "351SubTzjxG+o1SHe6lAzvIQMuSwxUca8YkiB19w5YZt+Ss2JXNc6F2jZwpr0hto\n" + + "IXe+N9/x0CohYRRa+IivRGgdDQc3w2P+pffNQP/qdPuUYyMkYWiuHH/YvwXyuDxv\n" + + "yGQfvKmHr1uq/qiqbK1bDSUoEq4Su8yX8YoF9TuxYraIpp9iErO5rarDO6GTNVHh\n" + + "1OXAJ/ePhOWzqo3flLTlAdTcs3Mq97kKW8XWCnu/cjJJglf2zVfLAlv95p56B9If\n" + + "0pXbN74qDkYEC8TdLOwryhcv8yyimh90/AvW9LpB7swkWnUUYNTep/XMX/RLpHLn\n" + + "JOVtnRpn3coVfSR/0rz0XKVXeZGnKztGdIMQhWMTxvZ1UpmRAH2Ab2QnVo1fkPVy\n" + + "qNSJces5Y/VKpIvLBk5Jj55fvK8ME/9ASa+LtLrIms8iYHl75cupuYZZlg8=\n" + + "-----END CERTIFICATE-----"; - // Owner: CN=qvsslicag3-v.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, - // ST=Pembroke, C=BM - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" - + "MIIF+DCCA+CgAwIBAgIUE3XHqPhbZc2CY3aRtVHRlQwm3tcwDQYJKoZIhvcNAQEL\n" - + "BQAwTTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxIzAh\n" - + "BgNVBAMTGlF1b1ZhZGlzIEdsb2JhbCBTU0wgSUNBIEczMB4XDTE0MTExNDE0MDUz\n" - + "MVoXDTE3MTExNDE0MDUxM1oweDELMAkGA1UEBhMCQk0xETAPBgNVBAgTCFBlbWJy\n" - + "b2tlMREwDwYDVQQHEwhIYW1pbHRvbjEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRl\n" - + "ZDEoMCYGA1UEAxMfcXZzc2xpY2FnMy12LnF1b3ZhZGlzZ2xvYmFsLmNvbTCCASIw\n" - + "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK621GAU2/hywjuxi2Q9rCMncWIY\n" - + "FbDngS69N6+qe9NUktfs/Rlh+jKUDHyf27G79xYGmDGZ0NTYI7tUyOvRanaq8ngd\n" - + "NkZI4DS/Au2vpwuXucrtm3V/XRcsWHAsyevVzfiqfZzu+vU7/2KT/k7sByRzED4x\n" - + "B4tMGaodvzIAzhFAmnmVXSUw7zvU07G/6/mfwYy9gwegJwVby/ZPWXefzHbLGDUz\n" - + "xtO/6Ow9e5T2hedpo3IgfKptkzy0kA501DNaTMulW1gJwB+1duJ9OxZOAVgGCANX\n" - + "IzWvgbONLEdkYGK+K8EAuMaa57WlG0wBZ9Y62iuvgw4XRd90/PS2RAFf/DsCAwEA\n" - + "AaOCAaMwggGfMHMGCCsGAQUFBwEBBGcwZTAqBggrBgEFBQcwAYYeaHR0cDovL29j\n" - + "c3AucXVvdmFkaXNnbG9iYWwuY29tMDcGCCsGAQUFBzAChitodHRwOi8vdHJ1c3Qu\n" - + "cXVvdmFkaXNnbG9iYWwuY29tL3F2c3NsZzMuY3J0MCoGA1UdEQQjMCGCH3F2c3Ns\n" - + "aWNhZzMtdi5xdW92YWRpc2dsb2JhbC5jb20wUQYDVR0gBEowSDBGBgwrBgEEAb5Y\n" - + "AAJkAQEwNjA0BggrBgEFBQcCARYoaHR0cDovL3d3dy5xdW92YWRpc2dsb2JhbC5j\n" - + "b20vcmVwb3NpdG9yeTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUH\n" - + "AwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFLMSibWpSzW8FQDwgOnYeIfxE3x2MDoG\n" - + "A1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwucXVvdmFkaXNnbG9iYWwuY29tL3F2\n" - + "c3NsZzMuY3JsMB0GA1UdDgQWBBSSYP84MQGz6cU/fyXfebv/8zn93TANBgkqhkiG\n" - + "9w0BAQsFAAOCAgEAbqX71QIeoOJ36Aoiwg+oEwdDSRzXkR05kZU2y9qOCArrkgSj\n" - + "ycdIRQFjHYNAWJrPP17PErk6+6NDWiwxLXbeHaY7pFIDCsgcCTWpixVlpVPKKxAE\n" - + "uaomHo5K2AWWkJYNNPSLF411CmyN4eJjYQVrkCfJwFSUrQml8pFDedNDNuTaDsZo\n" - + "klvUDYWM18gFrAbNF4Wi+dvj3qPOpTVyrTk2oBXtVUesNu4JF/O6li10YJ+kdox+\n" - + "DUeq4Gk4B8zoWRTKa9Pp/RALI8TeNcfjBKbPtuXyfly1Cm8AXoQA5sus2SMMPQXE\n" - + "S1+IsdnnKb60pT1EOX571SIBKV16xpRpbC3mDU6IG/+Sjm0TJxwSGbBO5bX69+bq\n" - + "F8Im1QAKqVSYCtoypvieG3iGqHmj4SAaSqdmDDzmOPEtgX63ZmYVs+ey6tN+VThi\n" - + "eaLRs+pHeBLMhh7Npt85c+xqRlIFBp0e84EzST0oE7pjuZcFFWstFXD2Pt1JQfXo\n" - + "9szkw6EMhYbrgNqsh8lxkg8cZKHnP8KGLefyHajp3EIfC2MX7nUOeNmNoCxdsfBW\n" - + "lmzRbv7H7eeAmQYHmxUaRnDMGR6QVX8/NrF1w0hqLkIpDj+29Mvv/Gp2azJrvqrL\n" - + "w2bJ2mPD8rzBDmEFY317RWc8VBd8ZUxO/dYPWqsXNwBTdPMRQpYcN55po3g=\n" - + "-----END CERTIFICATE-----"; + // Owner: CN=qvsslrca2g3-ev-v.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, + // ST=Pembroke, C=BM, SERIALNUMBER=28474, OID.2.5.4.15=Private Organization, + // OID.1.3.6.1.4.1.311.60.2.1.3=BM + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIH4DCCBcigAwIBAgIUUZsNAKy8C5AlCfpCZWUQY2R6VawwDQYJKoZIhvcNAQEL\n" + + "BQAwSTELMAkGA1UEBhMCQk0xGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxHzAd\n" + + "BgNVBAMMFlF1b1ZhZGlzIEVWIFNTTCBJQ0EgRzMwHhcNMTcwNDE4MTg1NjEyWhcN\n" + + "MTkwNDE4MTkwNjAwWjCBwDETMBEGCysGAQQBgjc8AgEDEwJCTTEdMBsGA1UEDwwU\n" + + "UHJpdmF0ZSBPcmdhbml6YXRpb24xDjAMBgNVBAUTBTI4NDc0MQswCQYDVQQGEwJC\n" + + "TTERMA8GA1UECAwIUGVtYnJva2UxETAPBgNVBAcMCEhhbWlsdG9uMRkwFwYDVQQK\n" + + "DBBRdW9WYWRpcyBMaW1pdGVkMSwwKgYDVQQDDCNxdnNzbHJjYTJnMy1ldi12LnF1\n" + + "b3ZhZGlzZ2xvYmFsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n" + + "ALo9QJVNVNVfG//nZiOPX/j2O8GTVlSAfIMliEj78G0xmPZiQD3n/70KcYlsI7No\n" + + "ilytC8e/m4Mic9PpYfmhAwiUSmb3ba8qjekUgmBFXuQqj3fH6Na+8f5WC9cYpwlc\n" + + "Ew3NuL2WBs86mjM/3GIa61IXrGpRxN6UQJwSxhqlb1QqEGtuwBiy9FJQd0xekCTC\n" + + "GBe2zFT1WhyVSMWlxwkcy1p2LeUmlvnV6FHQYcM9te8UPhgY53O6+u0tnnnsED37\n" + + "UOU3MLev8T++WL7VPOrjgjXydMC9ndXKRttQFIeJ1r+W7rdMLCWkrTzvJ6GtBZZr\n" + + "8jjHNabWPkBslML7oGwvUHMCAwEAAaOCA0YwggNCMHgGCCsGAQUFBwEBBGwwajA5\n" + + "BggrBgEFBQcwAoYtaHR0cDovL3RydXN0LnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmV2\n" + + "c3NsZzMuY3J0MC0GCCsGAQUFBzABhiFodHRwOi8vZXYub2NzcC5xdW92YWRpc2ds\n" + + "b2JhbC5jb20wHQYDVR0OBBYEFLVK7rSs4x+DZrwYaWl2mjhhAtV/MAwGA1UdEwEB\n" + + "/wQCMAAwHwYDVR0jBBgwFoAU5YRU0JBJnzi68snhKgjFTp+gSD8wWgYDVR0gBFMw\n" + + "UTBGBgwrBgEEAb5YAAJkAQIwNjA0BggrBgEFBQcCARYoaHR0cDovL3d3dy5xdW92\n" + + "YWRpc2dsb2JhbC5jb20vcmVwb3NpdG9yeTAHBgVngQwBATA8BgNVHR8ENTAzMDGg\n" + + "L6AthitodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmV2c3NsZzMuY3Js\n" + + "MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEw\n" + + "LgYDVR0RBCcwJYIjcXZzc2xyY2EyZzMtZXYtdi5xdW92YWRpc2dsb2JhbC5jb20w\n" + + "ggF9BgorBgEEAdZ5AgQCBIIBbQSCAWkBZwB2ALvZ37wfinG1k5Qjl6qSe0c4V5UK\n" + + "q1LoGpCWZDaOHtGFAAABW4J1OtsAAAQDAEcwRQIhANABKS1i5uxEm/HMivDJFyNJ\n" + + "gOKRrApqmx3KV0/pWMzqAiAui21HV9lVJ1OT6dEA9mlZAH4NmzklmY9WI978GMYG\n" + + "mgB2AFYUBpov18Ls0/XhvUSyPsdGdrm8mRFcwO+UmFXWidDdAAABW4J1Os0AAAQD\n" + + "AEcwRQIgTWLHrhex17UyIlr0HC9LXNUv0kyOudo7MpxoWFy1xGICIQCHFSoQGwvv\n" + + "zzpQ3JmHSLHy0AQQfWlbV9rFv37F4A7AaAB1AKS5CZC0GFgUh7sTosxncAo8NZgE\n" + + "+RvfuON3zQ7IDdwQAAABW4J1OvYAAAQDAEYwRAIgWLm8u/bcMZt5oXAPIqP9/Qqj\n" + + "Q61VYX+II6RFK+EJCnwCIBrXxQgngqO7X/aaeWnEjfQeSu7WCK9Md3tcqXsn+gMd\n" + + "MA0GCSqGSIb3DQEBCwUAA4ICAQAu0Y29voXdwt/68hwbdj8L50yecl2Z0OkOA31v\n" + + "UhAHgRVhQ+WiAgoeGEgjdntQ5pL7Wtr314gHpG6iR849Zr56WOliA6pfBYDk3qkH\n" + + "UiRgqQBUEV8oRzgp0E+Ebev+p9leM4RPYmUNsP3K4Z/BY24HNOtNKMC3clqKO35K\n" + + "D7B9ObYUb0+IjreKgUyQB7wMgFi7393gXDraVDhDoLrcktAkvkv3Mbt+A3IO5VrO\n" + + "4mQwjrLHzj8nFCmsP4RbCIKFO2QZE8sJYwplKUWOk1ngjpOvObPYpMt5M1kiRvau\n" + + "agkQ+WvnvuMEgAgafHtI4uu0ZNDW1ib0H+xq5X/x2w1RjEElbXCKMbnf3Pdvh9FG\n" + + "mLpkVITXIKzT0Jm+oIs+Vk4ktNEe8hQIzcqimmtlVl2hgMWkmIfRio1+41EY4Din\n" + + "QXBVsbRqftamzSpLbW54ryGJB8dSiGe4P53DOcNKiyie7une95ouZY/1DfQIlVG/\n" + + "9XexhqdGMKp6qUjgd9hOfHrD+mZHeBdIIONOHOhy6ESIUgpSzaAAM7QXZFqlzLzY\n" + + "okRp6cJKDfUmXrk80MopQMhRHJwdxfeZ/A/xAkrWlVPshG+qltSGIZWrNjhQIwk3\n" + + "49zFQCuDS+FrkubRueV+MB8Abp+V1nv5PNbhwfPzGSqwn9XX3vUnsp9uLv+3WlrL\n" + + "Kl1DeA==\n" + + "-----END CERTIFICATE-----"; - // Owner: CN=qvsslicag3-r.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, - // ST=Pembroke, C=BM - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" - + "MIIF+DCCA+CgAwIBAgIUMJWFWsVjz9o3zQoG9bZ/IsdRWDkwDQYJKoZIhvcNAQEL\n" - + "BQAwTTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxIzAh\n" - + "BgNVBAMTGlF1b1ZhZGlzIEdsb2JhbCBTU0wgSUNBIEczMB4XDTEyMTExNDEzMTI1\n" - + "NFoXDTE0MTExNDEzMTI1NFoweDELMAkGA1UEBhMCQk0xETAPBgNVBAgTCFBlbWJy\n" - + "b2tlMREwDwYDVQQHEwhIYW1pbHRvbjEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRl\n" - + "ZDEoMCYGA1UEAxMfcXZzc2xpY2FnMy1yLnF1b3ZhZGlzZ2xvYmFsLmNvbTCCASIw\n" - + "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALlwpCyabhrQYeRzEn0O7S505Fv4\n" - + "ScJlJRHskcyZHBt0vt2tsDJNh2xJKJpnXzW14oGh+xrccEGeUw77qeFgfy+LTIHD\n" - + "YDkYVHVhfs4NJD5wdyWL9Fn3A7pMFpapPBPJdsAAwByfzYFjRJsPHMSlGcroyGNm\n" - + "+LquU5r965afaRkWQzZy+lY+OHO19Jis8EfUusYj2fQ3SXB8tBwFylDTnbCoM1HZ\n" - + "BlbksbtLjFYKtyaNeQuoA7NnB3Q9XEONNK9KZ0S87KIqEKjIWK7ThO6lvhMQy2Zk\n" - + "k+UVXVLpop7+Nkz3Fn08pE4OMfLjn1KVnk5l40WGabinfE6hz4vk0XREaKcCAwEA\n" - + "AaOCAaMwggGfMHMGCCsGAQUFBwEBBGcwZTAqBggrBgEFBQcwAYYeaHR0cDovL29j\n" - + "c3AucXVvdmFkaXNnbG9iYWwuY29tMDcGCCsGAQUFBzAChitodHRwOi8vdHJ1c3Qu\n" - + "cXVvdmFkaXNnbG9iYWwuY29tL3F2c3NsZzMuY3J0MCoGA1UdEQQjMCGCH3F2c3Ns\n" - + "aWNhZzMtci5xdW92YWRpc2dsb2JhbC5jb20wUQYDVR0gBEowSDBGBgwrBgEEAb5Y\n" - + "AAJkAQEwNjA0BggrBgEFBQcCARYoaHR0cDovL3d3dy5xdW92YWRpc2dsb2JhbC5j\n" - + "b20vcmVwb3NpdG9yeTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUH\n" - + "AwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFLMSibWpSzW8FQDwgOnYeIfxE3x2MDoG\n" - + "A1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwucXVvdmFkaXNnbG9iYWwuY29tL3F2\n" - + "c3NsZzMuY3JsMB0GA1UdDgQWBBSS2t3Itp/XsAppEeGyH+Ew8vEQ0zANBgkqhkiG\n" - + "9w0BAQsFAAOCAgEAo8MJ2ek95Cs3chn1ecEMdGkUANnCBmgdvQjFt6XVLzYWs37n\n" - + "j6Ac/nGj+Tzb30nTVdE2laRuTeLuGfYmd1AdBLHuRhWYG6A6jnlzqhmDRL3fvRYk\n" - + "wjeWQn6Kx/lOoWC1xOa2EJYOWDr/rUY2PKo9rSVdGKmU6NFI/+FOFLaUD8tU77Qq\n" - + "p9rfOYJwekckA2I2891lTRbnJfQhPD8mQjttd+nS46RwZxxAI5Pr6Jcr+BG3ARP5\n" - + "oM/ifTCLXCc4L/0nozUDSweU17TCuFXWGEpIXbOVmE3kpmHaVe1FRQ0PUr2XHCbJ\n" - + "H1vumQcJmOaUxiB4EzP+M+HnKg6rwhWlfgQEAnCcKkMF5ei1NAaHCwhRMC7ijJFA\n" - + "Wt7s0/PpP2tChU7uXctMk2d36Dpibyn6Rc5a/QJX444ZRFEGrSe4nO/MXt3iEcat\n" - + "fgYHOWoBunLIm7x/fd611xvyhifjqKVCPpqodpwFrXOlCQhXehhRvJSPDXWgDJeR\n" - + "cDLLIcit4Sn1uyebQcZafaxgYPWpaYHFd7dzkO+kTVqOVAm7LukC5QQ9qFY1z7a5\n" - + "IDUAFtEYg/c4XxX+pReOxydnnHeYZBrfRTTxOfMrg6dxsb1QcOeElXHgXRpHyiMh\n" - + "XYsZWE2WHT7of4wMfNzCUrVSN0tCGDRW0MI48RM4BYbRnz3YNKafjnszeXI=\n" - + "-----END CERTIFICATE-----"; + // Owner: CN=qvsslrca2g3-ev-r.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, + // ST=Pembroke, C=BM, SERIALNUMBER=28474, OID.2.5.4.15=Private Organization, + // OID.1.3.6.1.4.1.311.60.2.1.3=BM + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIH4TCCBcmgAwIBAgIUZTuy16qm4LnioIRmiaQZuThb38gwDQYJKoZIhvcNAQEL\n" + + "BQAwSTELMAkGA1UEBhMCQk0xGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxHzAd\n" + + "BgNVBAMMFlF1b1ZhZGlzIEVWIFNTTCBJQ0EgRzMwHhcNMTcwNDE4MTg1NjQ0WhcN\n" + + "MTkwNDE4MTkwNjAwWjCBwDETMBEGCysGAQQBgjc8AgEDEwJCTTEdMBsGA1UEDwwU\n" + + "UHJpdmF0ZSBPcmdhbml6YXRpb24xDjAMBgNVBAUTBTI4NDc0MQswCQYDVQQGEwJC\n" + + "TTERMA8GA1UECAwIUGVtYnJva2UxETAPBgNVBAcMCEhhbWlsdG9uMRkwFwYDVQQK\n" + + "DBBRdW9WYWRpcyBMaW1pdGVkMSwwKgYDVQQDDCNxdnNzbHJjYTJnMy1ldi1yLnF1\n" + + "b3ZhZGlzZ2xvYmFsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n" + + "ALXMNTuogjC2wpziEXbKztdgzBflORLxoAo5Y8HNAZVo8MgJJucshZ5S6cmRjreY\n" + + "fOlwo85Vu9s39EMRR+I0AZLbxw2PZxNSHUxTCzWlmJ4yValRPRZjz2LXJ+mjpkc3\n" + + "hsVHtCawvPqh2uNwM2qUD6zKfRGdKC27NeICjYe7RtfhLRdrZ8MNtVWMrrFt3Dzd\n" + + "SRJXFcLkN4rPzRFCxldU2yH6V4cZwnVz4XxV/nbljVtGyMJWGVzU0Bhy1fedAJ9x\n" + + "KGJbM6wackOlpUm0XMQdFxHF2tW4Sus6Mcf+2N8FgXk4PnwXarIc/Sj5Tx+Bvf5y\n" + + "TwBOGS02Hzs07ILV3w4dp00CAwEAAaOCA0cwggNDMHgGCCsGAQUFBwEBBGwwajA5\n" + + "BggrBgEFBQcwAoYtaHR0cDovL3RydXN0LnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmV2\n" + + "c3NsZzMuY3J0MC0GCCsGAQUFBzABhiFodHRwOi8vZXYub2NzcC5xdW92YWRpc2ds\n" + + "b2JhbC5jb20wHQYDVR0OBBYEFALFAuUwkAiTXc+DIW861Mu1o/7RMAwGA1UdEwEB\n" + + "/wQCMAAwHwYDVR0jBBgwFoAU5YRU0JBJnzi68snhKgjFTp+gSD8wWgYDVR0gBFMw\n" + + "UTBGBgwrBgEEAb5YAAJkAQIwNjA0BggrBgEFBQcCARYoaHR0cDovL3d3dy5xdW92\n" + + "YWRpc2dsb2JhbC5jb20vcmVwb3NpdG9yeTAHBgVngQwBATA8BgNVHR8ENTAzMDGg\n" + + "L6AthitodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmV2c3NsZzMuY3Js\n" + + "MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEw\n" + + "LgYDVR0RBCcwJYIjcXZzc2xyY2EyZzMtZXYtci5xdW92YWRpc2dsb2JhbC5jb20w\n" + + "ggF+BgorBgEEAdZ5AgQCBIIBbgSCAWoBaAB2AFYUBpov18Ls0/XhvUSyPsdGdrm8\n" + + "mRFcwO+UmFXWidDdAAABW4J1uUEAAAQDAEcwRQIhAK2LD7cJrN7YYjyBqFDoZva+\n" + + "fae1CiuYyxpREVes1c8OAiBLVt/dGKnvwY2CW2TN3/WyRM7al2sLnM+XwNUGZDrJ\n" + + "pgB2ALvZ37wfinG1k5Qjl6qSe0c4V5UKq1LoGpCWZDaOHtGFAAABW4J1uVQAAAQD\n" + + "AEcwRQIhAIA9IjxIT69JGX+sl1okMiGsXfCOPq5crSX+m04Q7LcgAiBJWUsLDtm9\n" + + "5TKsGZvlJRKOn1CcA94sApQ4v+1D+uz+JQB2AKS5CZC0GFgUh7sTosxncAo8NZgE\n" + + "+RvfuON3zQ7IDdwQAAABW4J1uWwAAAQDAEcwRQIhAIWbEqGnZSIwrI5eWCIzfMRY\n" + + "A+onO3IjQrVAE6ZuGu2bAiAlyoRSfH4s8+lVL225AYD45OkJJfG41T6k+wVLM5Hg\n" + + "ezANBgkqhkiG9w0BAQsFAAOCAgEAPwvRI5GmzR72cDoh+7VPj7PihQDG4HBYq5Ta\n" + + "bF7NK2v9DoaU99vv01K3WBNIydjQX4j+IK8MoGp9dXV+LDUTsebnsY+nr3O4R0pK\n" + + "I2TAazN7zcy3SYc/MtaW7JI+/ckjHaJw+AT+qUz+l20p9shBFlg4QvH2cx2OOCat\n" + + "/CRnG2Nqc5nN1xVcS3aVDrGl36XIcjV+ab+3zicm3OhWqn/hlfBBWimuhix68i/L\n" + + "k+qUyN6A8Bz7NwsouzG7keS17VZbLFkOuczq9KxJLHtlI1OYFNzrLEx6aXeM5VoH\n" + + "mlwETxagSL6fjRvcCaM6As9WVRS08p/RldUrEw+O6r3ob7FaOywwIzSMFV1GbVFG\n" + + "eIrSMuSVwbQRa5Duakoe5vz1vOddrZPm3kqpvyT7j51nuedrjc8YgisuyMbxkf5s\n" + + "8tesqxdltXjFNwpwveYlgHAi3sZvO2dm6bEZcioxLEWEpwmYXrkBJWLhcILdfY99\n" + + "SWFAmwGtmCqh8Sxla77o+gaZkNKf3zBn/34Q91Z96qKgqjXDAGefsZiy4tQeEUJc\n" + + "2qIqjb2rWi5Vo7hn2eolNXzp6ZdanicpecpqwpmW9/v6YRxKLGTsdVz82TGWPnpt\n" + + "q3rCll0NIAfcjekFmRzmBWF1jOn4fCcF/WOxKW1T4JcMIcNoa5iI9M1WcVKQvJKA\n" + + "Zd5LLu4=\n" + + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - if (ocspEnabled) { - // Revoked certificates are expired in Nov 2014 - // and backdated revocation check is only possible with OCSP - pathValidator.setValidationDate("Jan 01, 2014"); - } - pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Fri Jan 04 03:49:46 PST 2013", System.out); - - // reset validation date back to current date - pathValidator.resetValidationDate(); + "Tue Apr 18 12:23:14 PDT 2017", System.out); } } -class RootCA3 { +class RootCA3G3 { - // wner: CN=QuoVadis Issuing CA 3 G3, O=QuoVadis Limited, C=BM - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIGFTCCA/2gAwIBAgIUHZxbikClihb+1PM2ck0SDEZ8/dIwDQYJKoZIhvcNAQEL\n" - + "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" - + "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xMjExMDYxODM5MDVaFw0y\n" - + "MjExMDYxODM5MDVaMEsxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n" - + "aW1pdGVkMSEwHwYDVQQDExhRdW9WYWRpcyBJc3N1aW5nIENBIDMgRzMwggIiMA0G\n" - + "CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCs6x3rpBdA1tTXgPYNjL1MKHuoDyb9\n" - + "d4mxxk41t5Cvo3BnS0/cBlRIl91oqu3Iv9goVCMStla+GW9iRdX/53jYM1rXePDa\n" - + "OnE/MJNLcVjmABZmEUtpzxUYLftwGEg1w/Wgi6z68vqZn7vbHJtFV8inlMIsdBVY\n" - + "o3VmU9h+pGZU8JrF8x8U3voX4vm56OBCAM/1osUGXsVL2AY3z2Gjyb1Hv6fqHma7\n" - + "PWrWV1hYS/EAnRUPO8iQqJwrbT/j7Mlo3khULV+T02M+oqs1ckIihl38n1eGvYcp\n" - + "z40cceA2Ej5aglyF9i+ypA4XnxKF3f+6vvEYRPCMQB8Hiwuyy6naj6lPoLZ+nolT\n" - + "t++xSkZ5imAoTXewA9JxyGCdiO9G4sZFIy4jjW7HBmKx6pZy3wWf48eawXPIpjop\n" - + "EC+Kayf3foeyq40CAOjysVkblhUBawvVjAqKJ5aoKD4Ghnv02jdVvI4W7ME/fYYb\n" - + "gm+XD7KJv4gHks+SIV93eXiUhYHvofJ3AG/1kp1p4tvIKCUtm2LCihmp53n9uLGA\n" - + "NvizEnkuQmwlXtqOquKDluwSpHVFPxePMdRICUOnoZBdHv6f3LQCOU7AczRJYh8+\n" - + "WYSKQy675/Itucgd+ABfY1H07F4FisCP75j8YknBdv4nfQsb0RcTg2P89dJNwAhL\n" - + "rpk452WD4LuvsQIDAQABo4HzMIHwMBIGA1UdEwEB/wQIMAYBAf8CAQEwEQYDVR0g\n" - + "BAowCDAGBgRVHSAAMDoGCCsGAQUFBwEBBC4wLDAqBggrBgEFBQcwAYYeaHR0cDov\n" - + "L29jc3AucXVvdmFkaXNnbG9iYWwuY29tMA4GA1UdDwEB/wQEAwIBBjAfBgNVHSME\n" - + "GDAWgBTGF9C8qOoCQ/IbBpldK5Agudec5DA7BgNVHR8ENDAyMDCgLqAshipodHRw\n" - + "Oi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdnJjYTNnMy5jcmwwHQYDVR0OBBYE\n" - + "FBPyQfSNOURHBZ37q8ZaNQwelu9eMA0GCSqGSIb3DQEBCwUAA4ICAQAsbJU89ZB9\n" - + "1XVlOLmw8MaoWwOgI3DwM/g30YyIV1SERtDMKDOUnLVGTORTGv7Y8X789nGkMbKq\n" - + "OEEa9Hty4jwyTnt2OISpCAb4GwBtH+FxNcLkJwZU2qtpTX8zDndofE/JLGo0rte5\n" - + "bKchF2JTg+oby/Wpu2IO0CMd1phou3LLi8sWQGcY/f5vk+MUDnskH6NRXte4m8HW\n" - + "FtYb7nOgLzY5FOJDtQuUFFioNoQzUHuj3SpUjIBxXf4VRFXz+FKIQ4jqzD/SnHG6\n" - + "/7g/28x66LNpYjvaQ0T45EqxqPDCztfJO67GsNLXeSKq+BteqXcnKI77ZkqmwnWl\n" - + "cYt5qek0GBYRYVOM8dUIvDryWHZIEqbeI0DAu06dyPuvIJNQ6WweqxJ+hH++BqGh\n" - + "P4bViNNuP/Lqarb1RP7JiJW3wlyIUDD34JLzkusBgU++ptdYg1o0VnEB8KWDG8Of\n" - + "cABL+TMoUldUp9DFFgFJIfnPX5XjXyG9mw2wwiUvClo93qFvC8+rhEGeZFd29rKi\n" - + "dmmCc8FaCfBV9XdHHx/0ORTQp3HxnRDDiz+MN7p1Y4SXbHE3XXyQAUVTISGpPe3X\n" - + "TUhmoARNmBBPALDm3EAvEBikTUMBFGR63wtu0pjA2cF5nvOyY8mBSsNk0R6+ZJSl\n" - + "Cok3lH5oBM2H+KBk+sNZIBQ8BHcgbwlghg==\n" - + "-----END CERTIFICATE-----"; + // Owner: CN=QuoVadis QVRCA3G3 SSL ICA, O=QuoVadis Limited, C=BM + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGszCCBJugAwIBAgIURUME8OY/YBHyokbgxoTKpPcoiHYwDQYJKoZIhvcNAQEL\n" + + "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + + "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xNzA0MTkxNDQ4NDBaFw0y\n" + + "NzA0MTkxNDQ4NDBaMEwxCzAJBgNVBAYTAkJNMRkwFwYDVQQKDBBRdW9WYWRpcyBM\n" + + "aW1pdGVkMSIwIAYDVQQDDBlRdW9WYWRpcyBRVlJDQTNHMyBTU0wgSUNBMIICIjAN\n" + + "BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAt8UIgFvcneWgv29aR2/UV810uW9N\n" + + "VpvdEgQDPHao5+i3IwCH1GrV8KeC25vfJAuW2TJ5gHeN5fmWAtWU8NDaNwGxJq/w\n" + + "jlOe/UW0KSosuuOBltLY9fl+7lDYqBjEwmCGvZMQOzpsbm8QUYTuZmtw96sT5beZ\n" + + "Kwqub/NBDE59IZ+b82obreNFFOgwcHv9E00bfRW7kizNfaC8AiwgV9WfIFgvtb4+\n" + + "YflcgGbdWnmNvwL8aZGWpGYjw/H/0kpwfMgrVF3Q7h8Y0yTg/jj8ZdXLdaE/PQzx\n" + + "8RUU4xJGxply/RrNUEvm9xeXZG3ssLW56WDEhRLkORX/zF4/mVyO2DpGJs06IUSP\n" + + "VWe+JuJGT1UxWqIsDIIHqJNa2BYl6O/XOjE2oGxiCb9w0/kQ8tKWWynFx4XOtrjA\n" + + "pGktsjw66tqE08XWOuoKwAXH2Llwz+VGSMzrCDH98VHtAu/XpEjuW3iP+I7EHksm\n" + + "W2eLdQdvTJ5DBdLsspIG4HC9Ke+c/gCEJHvOURPXoY7j9JPcQLc+5O7kBqiIjEBU\n" + + "NpPX37x7z3msac/IiG/SOYl+kiBESV44QFIOl8sHYmj9HGNlkQz4B/inuGwifIux\n" + + "rfdvm6nrpC7jhd/5Ptk4PO1kcAtgwcB99BnRCw47Xl7hrERTpoRISReNG0JMK7Op\n" + + "wVFqyi7bV1U/l4MCAwEAAaOCAY8wggGLMBIGA1UdEwEB/wQIMAYBAf8CAQAwSQYD\n" + + "VR0gBEIwQDA+BgRVHSAAMDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cucXVvdmFk\n" + + "aXNnbG9iYWwuY29tL3JlcG9zaXRvcnkwdAYIKwYBBQUHAQEEaDBmMCoGCCsGAQUF\n" + + "BzABhh5odHRwOi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wOAYIKwYBBQUHMAKG\n" + + "LGh0dHA6Ly90cnVzdC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2EzZzMuY3J0MA4G\n" + + "A1UdDwEB/wQEAwIBBjAnBgNVHSUEIDAeBggrBgEFBQcDAQYIKwYBBQUHAwIGCCsG\n" + + "AQUFBwMJMB8GA1UdIwQYMBaAFMYX0Lyo6gJD8hsGmV0rkCC515zkMDsGA1UdHwQ0\n" + + "MDIwMKAuoCyGKmh0dHA6Ly9jcmwucXVvdmFkaXNnbG9iYWwuY29tL3F2cmNhM2cz\n" + + "LmNybDAdBgNVHQ4EFgQUTknx5HQLmDQSOuWxVX3EknK1r6QwDQYJKoZIhvcNAQEL\n" + + "BQADggIBAHfmIJkd+URmnVm0X1/43QXu08RTzUr1zjf4ZBVtzUFoEkfZm+zKlhb7\n" + + "QeYJ5lprX1tdRfHLI+JC7oyI5+7/0q1j2FN2g0oKYN63dIgtppoCNpBu58f69YxL\n" + + "Y3GPSCfgs+ld+HegNSTjQVzelr16aFo9sj1fzUwY4Xj+xEYDjYxFmNGSXY37+DdN\n" + + "3WPm1iahBNNCZGfXq5T4qr6+R6RWwxsaBdQfZh3efGB1WG4DVSQBoiCKjS7Eg+Mf\n" + + "LT+KEZgawLUVrt/sT5lNfw23XA1gxIOcNRBHjsTWbtTBHJeb8hYvXB38UGK4GfIo\n" + + "NxtvRyXgG/U8+OuCQPS2SpJ1VH+yZ4Tn3G4k2+WillxfpqCVgHDVuT8wigw1xUNb\n" + + "0Ft9F3OWftWCVILaYEcyuJrnL3jjcZXc/zG01wIGDFvlPshRifVs/69Xq9UQmMfB\n" + + "GUh6MteDIsN9NdiArcumSC1dNoA/9eESp1pb186lDx9KxRQ/3NJRDMOIsMYN8Lyu\n" + + "cDNzsnymtQyIm3YG7VmZi/6k99n9vT8Ff9PvQ49cdfPl8GIONMdYmhTtLtuC00AU\n" + + "550HVLnpFW8d1NX3+XKxQ5FG04nsTxUD2FtT+trEQouktPq9iFqZN+PLPi8UdrBW\n" + + "AGUDCnO/TNo7IPW6arQrFpYbRLStiOJw7204Mjuqco/1KcqnEiIC\n" + + "-----END CERTIFICATE-----"; - // Owner: CN=qvica3g3-v.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, + // Owner: CN=qvsslrca3g3-ssl-v.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, // ST=Pembroke, C=BM - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" - + "MIIF9DCCA9ygAwIBAgIUTkK7g7zoijtiLY/YV9ASX+pEsx0wDQYJKoZIhvcNAQEL\n" - + "BQAwSzELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxITAf\n" - + "BgNVBAMTGFF1b1ZhZGlzIElzc3VpbmcgQ0EgMyBHMzAeFw0xNDExMTQxNDA1NTJa\n" - + "Fw0xNzExMTQxNDA1MzhaMHYxCzAJBgNVBAYTAkJNMREwDwYDVQQIEwhQZW1icm9r\n" - + "ZTERMA8GA1UEBxMISGFtaWx0b24xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQx\n" - + "JjAkBgNVBAMTHXF2aWNhM2czLXYucXVvdmFkaXNnbG9iYWwuY29tMIIBIjANBgkq\n" - + "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAosZjGbZtvAM45zdlTtT+uL12F5nebQrE\n" - + "F9Fb8z1uhRJKgXAfjlfsMIjv7Xc7F80Li39yO0CmWHTMJS41auktW8IGVEkVV2og\n" - + "EL7SKLjtgDJ1I3HAX02hfuOW0b/jkfPEcqTeZVE5Xew/HTAuTJMTqCEHM5hFieWL\n" - + "tADPm7kANu5q6HaFXndKN/k1ozZXQn9YNTpDvvH6oD0Kqn/Peezi+C+6asTMSCk0\n" - + "Xoi2TBHNi9dl2tfb6hu+T5VFwFsC9dGqYt07V8TbvKRAVV0MC8DnXnS89quFVmPS\n" - + "I3ZSKeU4dlp8FzmTrd5nk3y9GL8GTkCsSN3RZbeAbLCpzcG5weS3GQIDAQABo4IB\n" - + "ozCCAZ8wdAYIKwYBBQUHAQEEaDBmMCoGCCsGAQUFBzABhh5odHRwOi8vb2NzcC5x\n" - + "dW92YWRpc2dsb2JhbC5jb20wOAYIKwYBBQUHMAKGLGh0dHA6Ly90cnVzdC5xdW92\n" - + "YWRpc2dsb2JhbC5jb20vcXZpY2EzZzMuY3J0MCgGA1UdEQQhMB+CHXF2aWNhM2cz\n" - + "LXYucXVvdmFkaXNnbG9iYWwuY29tMFEGA1UdIARKMEgwRgYMKwYBBAG+WAACZAEB\n" - + "MDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3Jl\n" - + "cG9zaXRvcnkwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggr\n" - + "BgEFBQcDAjAfBgNVHSMEGDAWgBQT8kH0jTlERwWd+6vGWjUMHpbvXjA7BgNVHR8E\n" - + "NDAyMDCgLqAshipodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmljYTNn\n" - + "My5jcmwwHQYDVR0OBBYEFINCE86z3wESNeL4rz3eiaYA5LIWMA0GCSqGSIb3DQEB\n" - + "CwUAA4ICAQBPe+Y5xDGZLYaVNOxxiyqFZrntGJGGQW1w4GtEfkH9oD8WGs5kBhMM\n" - + "/XPGqw2FzzrvA5GfSdh+EMuXUfJY933AxwPcNfwGHzYGAHIDFsW17y5ZdKfBMN4Y\n" - + "82e13iSfHQrbI0P6l8IIExfCw4HC8PxuEalg6H9fj9/1Q7mzdpwT3uG/HP6Dr2z+\n" - + "PGYFMaH77MsOjfANT8UIdo5SAyXiJI5Y0cyKjuXhR6eJEKwNfri27UaV5cJJuV7I\n" - + "fRcjb0h0Grr6gpKFb7JnhDZVGR3fDHTzuybuCqZk9TYKQ2sn1YfBFDqDpWODpykt\n" - + "vyFO7eugpvSUgdTKRMPCtyppYgo2RwIsMmLrU4wPzdnPi8oo+cM0f5zXrmrkOLY0\n" - + "PZo+K8QT/SrNT+9yZnHupLy01aYGJ4RJ047Wthr7a9S6i6DxbQ+ps4Ajh0X1bvOK\n" - + "KCEKq5aoivYQMLn8pjudiMjbnKU4mgpmZK15D6lLmAprW3L6F8AEBJsK1BunPWhJ\n" - + "nkQUyBnFgq2epmDfZ4f6SztNoLfDbatYNRb2KJfW1lks7UHDjuZ4PM20KkmmFJEE\n" - + "LKR76WJzKi/+aks/csdFD7+/TMXrkY+JWlT4mCoHR1ol0m3DiqApKvRFZkMARfJq\n" - + "npjt2cXyzDnguyQuLrHhdkKW+/LYeNckmVX+cPIxShLbuVhqMgdnWg==\n" - + "-----END CERTIFICATE-----"; + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGJzCCBA+gAwIBAgIUatc95M2rfpt/opXnck37WXW2RpAwDQYJKoZIhvcNAQEL\n" + + "BQAwTDELMAkGA1UEBhMCQk0xGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxIjAg\n" + + "BgNVBAMMGVF1b1ZhZGlzIFFWUkNBM0czIFNTTCBJQ0EwHhcNMTcwNTAyMTY1OTAy\n" + + "WhcNMjAwNTAyMTcwOTAwWjB9MQswCQYDVQQGEwJCTTERMA8GA1UECAwIUGVtYnJv\n" + + "a2UxETAPBgNVBAcMCEhhbWlsdG9uMRkwFwYDVQQKDBBRdW9WYWRpcyBMaW1pdGVk\n" + + "MS0wKwYDVQQDDCRxdnNzbHJjYTNnMy1zc2wtdi5xdW92YWRpc2dsb2JhbC5jb20w\n" + + "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+S725uLLelMIYHWuh6fbT\n" + + "lGdi7wf1BlsfQY/ZnLvsFbT1KHodE407RXP0NB6AeEBOlO8xQxaZ5b38aF+HROJw\n" + + "TcvUAgQHmNE+ER0JCMi42jSFC2dc93PhdcUEeesxIfu1iIKXxFmlbJtJxG3l27yJ\n" + + "L4ufum9iQYeZeoGXAr54x6JMY29kl5t9QM018d9sA9bHY+0iVJevM3xgxVe7xApw\n" + + "MSKoZH/OmkX8FaEW9b7TqrWfWcAdD8fkXK8lHCDqmUzSiDGJP16YeQA/4dmFO2vr\n" + + "ItXY8rTPjXoaolebHxf5WG5Qosxv0mPyklUb+SVSJagv66zl/H2Uk0bLyFFmuNAd\n" + + "AgMBAAGjggHOMIIByjB6BggrBgEFBQcBAQRuMGwwPgYIKwYBBQUHMAKGMmh0dHA6\n" + + "Ly90cnVzdC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2EzZzNzc2xpY2EuY3J0MCoG\n" + + "CCsGAQUFBzABhh5odHRwOi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wHQYDVR0O\n" + + "BBYEFFhZXE0P1SMuntLc7JYoHTcD8JKfMB8GA1UdIwQYMBaAFE5J8eR0C5g0Ejrl\n" + + "sVV9xJJyta+kMGkGA1UdIARiMGAwRgYMKwYBBAG+WAADZAEBMDYwNAYIKwYBBQUH\n" + + "AgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3JlcG9zaXRvcnkwCAYG\n" + + "Z4EMAQICMAwGCisGAQQBvlgBhFgwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny\n" + + "bC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2EzZzNzc2xpY2EuY3JsMA4GA1UdDwEB\n" + + "/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwLwYDVR0RBCgw\n" + + "JoIkcXZzc2xyY2EzZzMtc3NsLXYucXVvdmFkaXNnbG9iYWwuY29tMA0GCSqGSIb3\n" + + "DQEBCwUAA4ICAQB6QV56jPZzFbFNnKq4xRglTkZSLDMnyrmquWJr4xUWkWIqhQqC\n" + + "s+wAchy39Uuu+Nv99N1AxJhorpdbyIOd7B2NAnUXPeOa1Rm34mh2a/df0gTVrrWJ\n" + + "YSUd3Tv7tcGrMXa7kNaP0N3lTITC0F0fu0rLyCH5I28t4zkCXadcWTqHUKIDNS1h\n" + + "fwx1Y6Dq4fBhKQGpqBq4ThEpBgJdj5aGCNiYfKO/MTDrLxD1BpIjV88O+54cdtYp\n" + + "3K+UDN2lP03PNH4Z/0jF4K43DHpwDM0r6qP4yLqFf3K1NlzGkYgNlMrKUPSlu+M8\n" + + "F6R45TWkcHndk3SUxbtGsxhiLG4xJKY7Zm/0vSxNqia+UJ5wL5s+IoiXhj22RrPe\n" + + "kcx7u3MxB+KWSrtQd8y624J6tqbE7R+aaAX95KTQZoawjypX99P8Kir/NynFHYri\n" + + "RAX9qFU8nYQEAe47oxl0bIr7URiQrlz+FJ/bzJZQwROWY723JPXgv7wUMifCYvJz\n" + + "4pLkuc4KE+LIEqk5LUuoYGEhKhKVu8YnmDifPPrBBADNvAnnGfDZF9FRvIcD6h8H\n" + + "icZBXJHOgu70Rh8Zc77x+v29tKlAJVtswLlV0mVClDUk7U36XL+mAvYntnG9kH5x\n" + + "qQ2Fl7AkUewOd4tLeiN4fl+S+ceW9sOZPSWx5aLui9p2mmxuyxhC5egCzg==\n" + + "-----END CERTIFICATE-----"; - // Owner: CN=qvica3g3-r.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, + // Owner: CN=qvsslrca3g3-ssl-r.quovadisglobal.com, O=QuoVadis Limited, L=Hamilton, // ST=Pembroke, C=BM - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" - + "MIIF9DCCA9ygAwIBAgIUSTXTLsMPxg4n9YY6GASBcJsgcaEwDQYJKoZIhvcNAQEL\n" - + "BQAwSzELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxITAf\n" - + "BgNVBAMTGFF1b1ZhZGlzIElzc3VpbmcgQ0EgMyBHMzAeFw0xMjExMTQxMzQ4MTda\n" - + "Fw0xNDExMTQxMzQ4MTdaMHYxCzAJBgNVBAYTAkJNMREwDwYDVQQIEwhQZW1icm9r\n" - + "ZTERMA8GA1UEBxMISGFtaWx0b24xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQx\n" - + "JjAkBgNVBAMTHXF2aWNhM2czLXIucXVvdmFkaXNnbG9iYWwuY29tMIIBIjANBgkq\n" - + "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtaZUVAvasDtoFhZqL2fH+rI/IKeY0zj7\n" - + "hGuYpLlT32JZX8cmkWUywZt6VxA8A5o82Ay0xT9vHy4MPnmmZExEvmkaECBmOh6+\n" - + "WzWydYGKeeheUERJ1hLj2T7MKz/CCFY6NxD9XzvYOyhDpCUQKCOx4LMn0nMFrXrS\n" - + "6IVirDUmH26dpl3IfsdVXyn6N3wLSNf+UX7in/PXsfD/A6RVtqYsfx4fxFJIPIhv\n" - + "XG/cDOVIyfq6Oo1hthzGm8cnOSjvK/UfQV5iVBK68rqoGG+r9uBG9BfZtd7o0wrf\n" - + "SSJkJAPJVpWTLvnD8RYpJIBz01vNgEOCEgF54bvjhBOjx15mrH7roQIDAQABo4IB\n" - + "ozCCAZ8wdAYIKwYBBQUHAQEEaDBmMCoGCCsGAQUFBzABhh5odHRwOi8vb2NzcC5x\n" - + "dW92YWRpc2dsb2JhbC5jb20wOAYIKwYBBQUHMAKGLGh0dHA6Ly90cnVzdC5xdW92\n" - + "YWRpc2dsb2JhbC5jb20vcXZpY2EzZzMuY3J0MCgGA1UdEQQhMB+CHXF2aWNhM2cz\n" - + "LXIucXVvdmFkaXNnbG9iYWwuY29tMFEGA1UdIARKMEgwRgYMKwYBBAG+WAACZAEB\n" - + "MDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3Jl\n" - + "cG9zaXRvcnkwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggr\n" - + "BgEFBQcDAjAfBgNVHSMEGDAWgBQT8kH0jTlERwWd+6vGWjUMHpbvXjA7BgNVHR8E\n" - + "NDAyMDCgLqAshipodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdmljYTNn\n" - + "My5jcmwwHQYDVR0OBBYEFLnaKDrPemoRtOZaUReSV5rWp3OoMA0GCSqGSIb3DQEB\n" - + "CwUAA4ICAQA+B+R1TDmE4jC6itHBMPgqRoETJxtTdKyp6/egk5My4MATXRCSrStA\n" - + "gp1c86hljmlN2gq05HKlAz9cC4W80pypJGfEbhYIi9B4Jxdo6zJNJqcFz3zj/otx\n" - + "hvZ2nOO5qqEupAP8aHju0LhUlkcFQlbqaA+IiuQUh0VFQxk8LwkKEA8oIib7wLie\n" - + "P1zBMXeRyDM5CnFWQmIFKXR4+9f51Dfv40Gy2RKQT7I8oXuADhrG9iXFJPXz4yYK\n" - + "LazlDjnn0wv4vB9BmlcVdM2HPYqIPdvWBtPxT9vpNYHnB9Dq/zGqKJNUh8I4jB9k\n" - + "8iQYJgoj62mQW2o1fObkVwrGgglAyzUzUzJfJyy9OEECjLY5o/9TJAKBAnewJ5B9\n" - + "PagYo+klH937s2MOLqzl/uvbjXUBBvql1UU/lb8tSK9xCaXMEDhgiVricr13k32y\n" - + "XmUcA/im96CI5cF5i4xHMnqprzPehFB/Mmi6g2tpiE0bmLkYj7MMJcmtUowa3FqA\n" - + "QHtqKrK8wOfHep6qPx6VMD6Ypaf6yq66/kkSg05i6VO7V371UTibHeVLTr7LPRQJ\n" - + "Emp8k/6qCXOtf5OdXwHBIDqvszf8ry85Rl3q813TntF0pPRvqLEYadC4Bwq7Snf+\n" - + "PR0MPNhuwZBCmxZcyZqhVG2PyvvEmhPxhEdbO5DWUFwUP17WHNlgeQ==\n" - + "-----END CERTIFICATE-----"; + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGJzCCBA+gAwIBAgIUTgJvLquqZ+Padg/W5Y0bTu9jimswDQYJKoZIhvcNAQEL\n" + + "BQAwTDELMAkGA1UEBhMCQk0xGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxIjAg\n" + + "BgNVBAMMGVF1b1ZhZGlzIFFWUkNBM0czIFNTTCBJQ0EwHhcNMTcwNTAyMTY1ODQy\n" + + "WhcNMjAwNTAyMTcwODAwWjB9MQswCQYDVQQGEwJCTTERMA8GA1UECAwIUGVtYnJv\n" + + "a2UxETAPBgNVBAcMCEhhbWlsdG9uMRkwFwYDVQQKDBBRdW9WYWRpcyBMaW1pdGVk\n" + + "MS0wKwYDVQQDDCRxdnNzbHJjYTNnMy1zc2wtci5xdW92YWRpc2dsb2JhbC5jb20w\n" + + "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCOdbnnY8GsO002xJ6Snu2W\n" + + "snpPmW9ZJ4cEKzdBA4fYKP2V/8ibbOZVH5gI4tSSW+mcMrepS9Jw49sZaKOOGf/7\n" + + "YsjFOp4DQ0+w/7FOj4WrKWBhymDGKI8SsDqoCkxjCYkAc7cutm5Ge67Yto2mvkzW\n" + + "vThV7o9pJ4z2kMg+Q527908zvP1eqT2g+72X1L3o3RSdGM5V35R+lGiBDum8ojZm\n" + + "+QGCGuc6zROgumfYrh11iTNhXJw6KVAS9KJ5GSHzmua/Cu1dwC2SPxp/hRRHlvPp\n" + + "07EjY2oGhfe6Hvsu9YuoQCm95H4HPTmTDUCKURRIGcC8jdrjXBowEuH15vUocSIJ\n" + + "AgMBAAGjggHOMIIByjB6BggrBgEFBQcBAQRuMGwwPgYIKwYBBQUHMAKGMmh0dHA6\n" + + "Ly90cnVzdC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2EzZzNzc2xpY2EuY3J0MCoG\n" + + "CCsGAQUFBzABhh5odHRwOi8vb2NzcC5xdW92YWRpc2dsb2JhbC5jb20wHQYDVR0O\n" + + "BBYEFLzYzgqJRXrnLc5OYHF/koTdbIzeMB8GA1UdIwQYMBaAFE5J8eR0C5g0Ejrl\n" + + "sVV9xJJyta+kMGkGA1UdIARiMGAwRgYMKwYBBAG+WAADZAEBMDYwNAYIKwYBBQUH\n" + + "AgEWKGh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL3JlcG9zaXRvcnkwCAYG\n" + + "Z4EMAQICMAwGCisGAQQBvlgBhFgwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny\n" + + "bC5xdW92YWRpc2dsb2JhbC5jb20vcXZyY2EzZzNzc2xpY2EuY3JsMA4GA1UdDwEB\n" + + "/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwLwYDVR0RBCgw\n" + + "JoIkcXZzc2xyY2EzZzMtc3NsLXIucXVvdmFkaXNnbG9iYWwuY29tMA0GCSqGSIb3\n" + + "DQEBCwUAA4ICAQAge+6VZgaEFxN38q0MYKs/QbdGowLd5n2CfQfpdOTRnpOtKQw6\n" + + "Bc/o1O8O/y0XUl1Be7TCgfXKWgw+rKX+ZrI6wCm7MxYlWXV2guWU/AeEl2uv14s/\n" + + "KnKhzZHfb0eQyItfk23flubc7pbh99LaVqozsLCTL78lOB7N7ZQwsNCrEghHWMxl\n" + + "w1/IX/h9XOJoBzu4ulebJoQ3hdIYJY7+lkw64uH1FNrCu7P/jjU9ZlPaobZOUy64\n" + + "sYIt4GsZbMFaUiamNzBUvULw+ZkZq0hTK0cuyA85MXd+3rm5z2AMemC/29XTUYRU\n" + + "L9LkxMF71w8BJzgpVx3s0a6dfi6XtgacP407IhMc3EW1McsSWdT6jL0zidbjXisU\n" + + "vfvuzA50b3HwYz8PsRN0Zfi2R1BubaZQ9fQW2fe1EWgq80CqOdO7eNZeaBxbW/qB\n" + + "smGA1wiHIVEtyHbwZslcKNy8VPKurfKClwZQxf17/oK6QrhOgxiKJGYBUDTa7Ln7\n" + + "Qslp/y3G721NOXzborchs8XB+BYEETtWWkKoWFDiV7vkfyn3x2cYNiv5JCWDszhZ\n" + + "RyVrW26YOQ3MqBAiYqgbU2jMdqeRRfMIFqUvvXwoTvYXuN4Yc2ZAOmCBPpUxo66V\n" + + "zHDu+QK/2/pI1SMLvU3KG526gUtDd67t8JUHqxyo3NsXUCD8tUYpaJy/vg==\n" + + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - if (ocspEnabled) { - // Revoked certificates are expired in Nov 2014 - // and backdated revocation check is only possible with OCSP - pathValidator.setValidationDate("Jan 01, 2014"); - } - pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Thu Jan 03 23:47:02 PST 2013", System.out); - - // reset validation date back to current date - pathValidator.resetValidationDate(); + "Tue May 02 10:15:53 PDT 2017", System.out); } } From fc19077b52ba9917e87ff76cfef70b4371078c32 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Wed, 31 Oct 2018 14:00:51 -0700 Subject: [PATCH 003/128] 8213000: Obsolete the IgnoreUnverifiableClassesDuringDump vm option Remove code referencing the IgnoreUnverifiableClassesDuringDump Reviewed-by: dholmes, jiangli --- src/hotspot/share/memory/metaspaceShared.cpp | 9 ++------ src/hotspot/share/runtime/arguments.cpp | 2 +- src/hotspot/share/runtime/globals.hpp | 4 ---- .../CommandLine/VMDeprecatedOptions.java | 1 - .../jtreg/runtime/appcds/VerifierTest.java | 22 +++++++++---------- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/hotspot/share/memory/metaspaceShared.cpp b/src/hotspot/share/memory/metaspaceShared.cpp index 712b5e80004..52dc24e573e 100644 --- a/src/hotspot/share/memory/metaspaceShared.cpp +++ b/src/hotspot/share/memory/metaspaceShared.cpp @@ -1645,13 +1645,8 @@ void MetaspaceShared::link_and_cleanup_shared_classes(TRAPS) { ClassLoaderDataGraph::unlocked_loaded_classes_do(&check_closure); } while (check_closure.made_progress()); - if (IgnoreUnverifiableClassesDuringDump) { - // IgnoreUnverifiableClassesDuringDump is enabled by default. - // Unverifiable classes will not be included in the CDS archive. - SystemDictionary::remove_classes_in_error_state(); - } else { - vm_exit_during_cds_dumping("Please remove the unverifiable classes from your class list and try again"); - } + // Unverifiable classes will not be included in the CDS archive. + SystemDictionary::remove_classes_in_error_state(); } } diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 0909ce0725d..655aad0bbdb 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -533,7 +533,6 @@ static SpecialFlag const special_jvm_flags[] = { { "MinRAMFraction", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() }, { "InitialRAMFraction", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() }, { "UseMembar", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() }, - { "IgnoreUnverifiableClassesDuringDump", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() }, { "CompilerThreadHintNoPreempt", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, { "VMThreadHintNoPreempt", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, @@ -555,6 +554,7 @@ static SpecialFlag const special_jvm_flags[] = { { "SharedMiscDataSize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() }, { "SharedMiscCodeSize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() }, { "AssumeMP", JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::jdk(13) }, + { "IgnoreUnverifiableClassesDuringDump", JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::jdk(13) }, { "UnlinkSymbolsALot", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, { "AllowNonVirtualCalls", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, { "PrintSafepointStatistics", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 0c185a63073..3b0281385a5 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -2433,10 +2433,6 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G); "Average number of symbols per bucket in shared table") \ range(2, 246) \ \ - diagnostic(bool, IgnoreUnverifiableClassesDuringDump, true, \ - "Do not quit -Xshare:dump even if we encounter unverifiable " \ - "classes. Just exclude them from the shared dictionary.") \ - \ diagnostic(bool, PrintMethodHandleStubs, false, \ "Print generated stub code for method handles") \ \ diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index f20a3a3e3e3..9584c5259f1 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -103,6 +103,5 @@ public class VMDeprecatedOptions { public static void main(String[] args) throws Throwable { testDeprecated(DEPRECATED_OPTIONS); // Make sure that each deprecated option is mentioned in the output. - testDeprecatedDiagnostic("IgnoreUnverifiableClassesDuringDump", "false"); } } diff --git a/test/hotspot/jtreg/runtime/appcds/VerifierTest.java b/test/hotspot/jtreg/runtime/appcds/VerifierTest.java index a915e42efc6..2898be97373 100644 --- a/test/hotspot/jtreg/runtime/appcds/VerifierTest.java +++ b/test/hotspot/jtreg/runtime/appcds/VerifierTest.java @@ -102,17 +102,17 @@ public class VerifierTest implements Opcodes { } static void testset_0(String jar, String[] noAppClasses, String[] appClasses) throws Exception { - // Dumping should fail if the IgnoreUnverifiableClassesDuringDump - // option is not enabled. - OutputAnalyzer output = TestCommon.dump(jar, appClasses, - CDS_LOGGING, - "-XX:+UnlockDiagnosticVMOptions", - "-XX:-IgnoreUnverifiableClassesDuringDump"); - output.shouldContain("Please remove the unverifiable classes"); - output.shouldHaveExitValue(1); - - // By default, bad classes should be ignored during dumping. - TestCommon.testDump(jar, appClasses); + // Unverifiable classes won't be included in the CDS archive. + // Dumping should not fail. + OutputAnalyzer output = TestCommon.dump(jar, appClasses); + output.shouldHaveExitValue(0); + if (output.getStdout().contains("Loading clases to share")) { + // last entry in appClasses[] is a verifiable class + for (int i = 0; i < (appClasses.length - 1); i++) { + output.shouldContain("Verification failed for " + appClasses[i]); + output.shouldContain("Removed error class: " + appClasses[i]); + } + } } static void checkRuntimeOutput(OutputAnalyzer output, String expected) throws Exception { From cadfdfd81204824cb95f61d3fecf777478c0dfdb Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 1 Nov 2018 02:12:13 +0100 Subject: [PATCH 004/128] Added tag jdk-12+18 for changeset e38473506688 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 64dc8b9c149..bf1b5bb1ec4 100644 --- a/.hgtags +++ b/.hgtags @@ -520,3 +520,4 @@ f0f5d23449d31f1b3580c8a73313918cafeaefd7 jdk-12+11 f8626bcc169813a4b2a15880386b952719d1d6d1 jdk-12+15 199658d1ef860cdc17055b4fd3e94b057f292fe9 jdk-12+16 eefa65e142af305923d2adcd596fab9c639723a1 jdk-12+17 +e38473506688e0995e701fc7f77d5a91b438ef93 jdk-12+18 From 0c061174b66f0cd976d0be92613a0e00ba688c55 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 31 Oct 2018 19:56:51 -0700 Subject: [PATCH 005/128] 8177711: Convert TestVirtualSpaceNode_test to GTest Reviewed-by: jwilhelm --- src/hotspot/share/memory/metaspace.cpp | 159 ------------ .../share/memory/metaspace/chunkManager.hpp | 4 +- .../gtest/memory/test_virtualSpaceNode.cpp | 244 ++++++++++++++++++ 3 files changed, 246 insertions(+), 161 deletions(-) create mode 100644 test/hotspot/gtest/memory/test_virtualSpaceNode.cpp diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index 95cdadfeb66..66af882a68d 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -1627,165 +1627,6 @@ void TestMetaspaceUtils_test() { TestMetaspaceUtilsTest::test(); } -class TestVirtualSpaceNodeTest { - static void chunk_up(size_t words_left, size_t& num_medium_chunks, - size_t& num_small_chunks, - size_t& num_specialized_chunks) { - num_medium_chunks = words_left / MediumChunk; - words_left = words_left % MediumChunk; - - num_small_chunks = words_left / SmallChunk; - words_left = words_left % SmallChunk; - // how many specialized chunks can we get? - num_specialized_chunks = words_left / SpecializedChunk; - assert(words_left % SpecializedChunk == 0, "should be nothing left"); - } - - public: - static void test() { - MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag); - const size_t vsn_test_size_words = MediumChunk * 4; - const size_t vsn_test_size_bytes = vsn_test_size_words * BytesPerWord; - - // The chunk sizes must be multiples of eachother, or this will fail - STATIC_ASSERT(MediumChunk % SmallChunk == 0); - STATIC_ASSERT(SmallChunk % SpecializedChunk == 0); - - { // No committed memory in VSN - ChunkManager cm(false); - VirtualSpaceNode vsn(false, vsn_test_size_bytes); - vsn.initialize(); - vsn.retire(&cm); - assert(cm.sum_free_chunks_count() == 0, "did not commit any memory in the VSN"); - } - - { // All of VSN is committed, half is used by chunks - ChunkManager cm(false); - VirtualSpaceNode vsn(false, vsn_test_size_bytes); - vsn.initialize(); - vsn.expand_by(vsn_test_size_words, vsn_test_size_words); - vsn.get_chunk_vs(MediumChunk); - vsn.get_chunk_vs(MediumChunk); - vsn.retire(&cm); - assert(cm.sum_free_chunks_count() == 2, "should have been memory left for 2 medium chunks"); - assert(cm.sum_free_chunks() == 2*MediumChunk, "sizes should add up"); - } - - const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord; - // This doesn't work for systems with vm_page_size >= 16K. - if (page_chunks < MediumChunk) { - // 4 pages of VSN is committed, some is used by chunks - ChunkManager cm(false); - VirtualSpaceNode vsn(false, vsn_test_size_bytes); - - vsn.initialize(); - vsn.expand_by(page_chunks, page_chunks); - vsn.get_chunk_vs(SmallChunk); - vsn.get_chunk_vs(SpecializedChunk); - vsn.retire(&cm); - - // committed - used = words left to retire - const size_t words_left = page_chunks - SmallChunk - SpecializedChunk; - - size_t num_medium_chunks, num_small_chunks, num_spec_chunks; - chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks); - - assert(num_medium_chunks == 0, "should not get any medium chunks"); - assert(cm.sum_free_chunks_count() == (num_small_chunks + num_spec_chunks), "should be space for 3 chunks"); - assert(cm.sum_free_chunks() == words_left, "sizes should add up"); - } - - { // Half of VSN is committed, a humongous chunk is used - ChunkManager cm(false); - VirtualSpaceNode vsn(false, vsn_test_size_bytes); - vsn.initialize(); - vsn.expand_by(MediumChunk * 2, MediumChunk * 2); - vsn.get_chunk_vs(MediumChunk + SpecializedChunk); // Humongous chunks will be aligned up to MediumChunk + SpecializedChunk - vsn.retire(&cm); - - const size_t words_left = MediumChunk * 2 - (MediumChunk + SpecializedChunk); - size_t num_medium_chunks, num_small_chunks, num_spec_chunks; - chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks); - - assert(num_medium_chunks == 0, "should not get any medium chunks"); - assert(cm.sum_free_chunks_count() == (num_small_chunks + num_spec_chunks), "should be space for 3 chunks"); - assert(cm.sum_free_chunks() == words_left, "sizes should add up"); - } - - } - -#define assert_is_available_positive(word_size) \ - assert(vsn.is_available(word_size), \ - #word_size ": " PTR_FORMAT " bytes were not available in " \ - "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ - (uintptr_t)(word_size * BytesPerWord), p2i(vsn.bottom()), p2i(vsn.end())); - -#define assert_is_available_negative(word_size) \ - assert(!vsn.is_available(word_size), \ - #word_size ": " PTR_FORMAT " bytes should not be available in " \ - "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ - (uintptr_t)(word_size * BytesPerWord), p2i(vsn.bottom()), p2i(vsn.end())); - - static void test_is_available_positive() { - // Reserve some memory. - VirtualSpaceNode vsn(false, os::vm_allocation_granularity()); - assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); - - // Commit some memory. - size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; - bool expanded = vsn.expand_by(commit_word_size, commit_word_size); - assert(expanded, "Failed to commit"); - - // Check that is_available accepts the committed size. - assert_is_available_positive(commit_word_size); - - // Check that is_available accepts half the committed size. - size_t expand_word_size = commit_word_size / 2; - assert_is_available_positive(expand_word_size); - } - - static void test_is_available_negative() { - // Reserve some memory. - VirtualSpaceNode vsn(false, os::vm_allocation_granularity()); - assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); - - // Commit some memory. - size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; - bool expanded = vsn.expand_by(commit_word_size, commit_word_size); - assert(expanded, "Failed to commit"); - - // Check that is_available doesn't accept a too large size. - size_t two_times_commit_word_size = commit_word_size * 2; - assert_is_available_negative(two_times_commit_word_size); - } - - static void test_is_available_overflow() { - // Reserve some memory. - VirtualSpaceNode vsn(false, os::vm_allocation_granularity()); - assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); - - // Commit some memory. - size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; - bool expanded = vsn.expand_by(commit_word_size, commit_word_size); - assert(expanded, "Failed to commit"); - - // Calculate a size that will overflow the virtual space size. - void* virtual_space_max = (void*)(uintptr_t)-1; - size_t bottom_to_max = pointer_delta(virtual_space_max, vsn.bottom(), 1); - size_t overflow_size = bottom_to_max + BytesPerWord; - size_t overflow_word_size = overflow_size / BytesPerWord; - - // Check that is_available can handle the overflow. - assert_is_available_negative(overflow_word_size); - } - - static void test_is_available() { - TestVirtualSpaceNodeTest::test_is_available_positive(); - TestVirtualSpaceNodeTest::test_is_available_negative(); - TestVirtualSpaceNodeTest::test_is_available_overflow(); - } -}; - #endif // !PRODUCT struct chunkmanager_statistics_t { diff --git a/src/hotspot/share/memory/metaspace/chunkManager.hpp b/src/hotspot/share/memory/metaspace/chunkManager.hpp index 3715d4608b9..f5792fcac1a 100644 --- a/src/hotspot/share/memory/metaspace/chunkManager.hpp +++ b/src/hotspot/share/memory/metaspace/chunkManager.hpp @@ -33,7 +33,7 @@ #include "memory/metaspaceChunkFreeListSummary.hpp" #include "utilities/globalDefinitions.hpp" -class TestVirtualSpaceNodeTest; +class ChunkManagerTest; namespace metaspace { @@ -42,7 +42,7 @@ typedef BinaryTreeDictionary > ChunkTreeDictionar // Manages the global free lists of chunks. class ChunkManager : public CHeapObj { - friend class ::TestVirtualSpaceNodeTest; + friend class ::ChunkManagerTest; // Free list of chunks of different sizes. // SpecializedChunk diff --git a/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp b/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp new file mode 100644 index 00000000000..9772af22068 --- /dev/null +++ b/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "memory/metaspace/virtualSpaceList.hpp" +#include "memory/metaspace/chunkManager.hpp" +#include "runtime/mutexLocker.hpp" +#include "utilities/formatBuffer.hpp" +#include "unittest.hpp" + +using namespace metaspace; + +namespace { + static void chunk_up(size_t words_left, size_t& num_medium_chunks, + size_t& num_small_chunks, + size_t& num_specialized_chunks) { + num_medium_chunks = words_left / MediumChunk; + words_left = words_left % MediumChunk; + + num_small_chunks = words_left / SmallChunk; + words_left = words_left % SmallChunk; + // how many specialized chunks can we get? + num_specialized_chunks = words_left / SpecializedChunk; + ASSERT_EQ(0UL, words_left % SpecializedChunk) << "should be nothing left" + << ", words_left = " << words_left + << ", SpecializedChunk = " << SpecializedChunk; + } + static const size_t vsn_test_size_words = MediumChunk * 4; + static const size_t vsn_test_size_bytes = vsn_test_size_words * BytesPerWord; + class MetachunkRemover { + Metachunk* const _m; + ChunkManager* const _c; + public: + MetachunkRemover(Metachunk* m, ChunkManager* c) : _m(m), _c(c) { } + ~MetachunkRemover() { _c->remove_chunk(_m); } + }; +} + +class ChunkManagerTest { + public: + static size_t sum_free_chunks(ChunkManager* cm) { + return cm->sum_free_chunks(); + } + static size_t sum_free_chunks_count(ChunkManager* cm) { + return cm->sum_free_chunks_count(); + } + static ChunkList* free_chunks(ChunkManager* cm, ChunkIndex i) { + return cm->free_chunks(i); + } +}; + +// removes all the chunks added to the ChunkManager since creation of ChunkManagerRestorer +class ChunkManagerRestorer { + ChunkManager* const _cm; + Metachunk* _chunks[NumberOfFreeLists]; + public: + ChunkManagerRestorer(ChunkManager* cm) : _cm(cm) { + for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) { + ChunkList* l = ChunkManagerTest::free_chunks(_cm, i); + _chunks[i] = l->tail(); + } + } + ~ChunkManagerRestorer() { + for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) { + ChunkList* l = ChunkManagerTest::free_chunks(_cm, i); + Metachunk* t = l->tail(); + while (t != _chunks[i]) { + _cm->remove_chunk(t); + t = l->tail(); + } + } + } +}; + +TEST_VM(VirtualSpaceNodeTest, sanity) { + // The chunk sizes must be multiples of eachother, or this will fail + STATIC_ASSERT(MediumChunk % SmallChunk == 0); + STATIC_ASSERT(SmallChunk % SpecializedChunk == 0); + + // just in case STATIC_ASSERT doesn't work + EXPECT_EQ(0, MediumChunk % SmallChunk); + EXPECT_EQ(0, SmallChunk % SpecializedChunk); +} + +TEST_VM(VirtualSpaceNodeTest, four_pages_vsn_is_committed_some_is_used_by_chunks) { + const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord; + if (page_chunks >= MediumChunk) { + SUCCEED() << "SKIP: This doesn't work for systems with vm_page_size >= 16K"; + return; + } + MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag); + ChunkManager cm(false); + VirtualSpaceNode vsn(false, vsn_test_size_bytes); + ChunkManagerRestorer c(Metaspace::get_chunk_manager(false)); + + vsn.initialize(); + EXPECT_TRUE(vsn.expand_by(page_chunks, page_chunks)); + vsn.get_chunk_vs(SmallChunk); + vsn.get_chunk_vs(SpecializedChunk); + vsn.retire(&cm); + + // committed - used = words left to retire + const size_t words_left = page_chunks - SmallChunk - SpecializedChunk; + + size_t num_medium_chunks, num_small_chunks, num_spec_chunks; + chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks); + + EXPECT_EQ(0UL, num_medium_chunks) << "should not get any medium chunks"; + // DISABLED: checks started to fail after 8198423 + // EXPECT_EQ((num_small_chunks + num_spec_chunks), ChunkManagerTest::sum_free_chunks_count(&cm)) << "should be space for 3 chunks"; + // EXPECT_EQ(words_left, ChunkManagerTest::sum_free_chunks(&cm)) << "sizes should add up"; +} + +TEST_VM(VirtualSpaceNodeTest, half_vsn_is_committed_humongous_chunk_is_used) { + MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag); + ChunkManager cm(false); + VirtualSpaceNode vsn(false, vsn_test_size_bytes); + ChunkManagerRestorer c(Metaspace::get_chunk_manager(false)); + + vsn.initialize(); + EXPECT_TRUE(vsn.expand_by(MediumChunk * 2, MediumChunk * 2)); + // Humongous chunks will be aligned up to MediumChunk + SpecializedChunk + vsn.get_chunk_vs(MediumChunk + SpecializedChunk); + vsn.retire(&cm); + + const size_t words_left = MediumChunk * 2 - (MediumChunk + SpecializedChunk); + size_t num_medium_chunks, num_small_chunks, num_spec_chunks; + ASSERT_NO_FATAL_FAILURE(chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks)); + + EXPECT_EQ(0UL, num_medium_chunks) << "should not get any medium chunks"; + // DISABLED: checks started to fail after 8198423 + // EXPECT_EQ((num_small_chunks + num_spec_chunks), ChunkManagerTest::sum_free_chunks_count(&cm)) << "should be space for 3 chunks"; + // EXPECT_EQ(words_left, ChunkManagerTest::sum_free_chunks(&cm)) << "sizes should add up"; +} + +TEST_VM(VirtualSpaceNodeTest, all_vsn_is_committed_half_is_used_by_chunks) { + MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag); + + ChunkManager cm(false); + VirtualSpaceNode vsn(false, vsn_test_size_bytes); + ChunkManagerRestorer c(Metaspace::get_chunk_manager(false)); + + vsn.initialize(); + EXPECT_TRUE(vsn.expand_by(vsn_test_size_words, vsn_test_size_words)); + vsn.get_chunk_vs(MediumChunk); + vsn.get_chunk_vs(MediumChunk); + vsn.retire(&cm); + // DISABLED: checks started to fail after 8198423 + // EXPECT_EQ(2UL, ChunkManagerTest::sum_free_chunks_count(&cm)) << "should have been memory left for 2 chunks"; + // EXPECT_EQ(2UL * MediumChunk, ChunkManagerTest::sum_free_chunks(&cm)) << "sizes should add up"; +} + +TEST_VM(VirtualSpaceNodeTest, no_committed_memory) { + MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag); + + ChunkManager cm(false); + VirtualSpaceNode vsn(false, vsn_test_size_bytes); + ChunkManagerRestorer c(Metaspace::get_chunk_manager(false)); + + vsn.initialize(); + vsn.retire(&cm); + ASSERT_EQ(0UL, ChunkManagerTest::sum_free_chunks_count(&cm)) << "did not commit any memory in the VSN"; +} + +TEST_VM(VirtualSpaceNodeTest, is_available_positive) { + // Reserve some memory. + VirtualSpaceNode vsn(false, os::vm_allocation_granularity()); + ASSERT_TRUE(vsn.initialize()) << "Failed to setup VirtualSpaceNode"; + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + ASSERT_TRUE(vsn.expand_by(commit_word_size, commit_word_size)) + << "Failed to commit, commit_word_size = " << commit_word_size; + + SCOPED_TRACE(err_msg("VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(vsn.bottom()), p2i(vsn.end())).buffer()); + + // Check that is_available accepts the committed size. + EXPECT_TRUE(vsn.is_available(commit_word_size)) << " commit_word_size = " << commit_word_size; + + // Check that is_available accepts half the committed size. + size_t expand_word_size = commit_word_size / 2; + EXPECT_TRUE(vsn.is_available(expand_word_size)) << " expand_word_size = " << expand_word_size; +} + +TEST_VM(VirtualSpaceNodeTest, is_available_negative) { + // Reserve some memory. + VirtualSpaceNode vsn(false, os::vm_allocation_granularity()); + ASSERT_TRUE(vsn.initialize()) << "Failed to setup VirtualSpaceNode"; + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + ASSERT_TRUE(vsn.expand_by(commit_word_size, commit_word_size)) + << "Failed to commit, commit_word_size = " << commit_word_size; + + SCOPED_TRACE(err_msg("VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(vsn.bottom()), p2i(vsn.end())).buffer()); + + // Check that is_available doesn't accept a too large size. + size_t two_times_commit_word_size = commit_word_size * 2; + EXPECT_FALSE(vsn.is_available(two_times_commit_word_size)) << " two_times_commit_word_size = " << two_times_commit_word_size; +} + +TEST_VM(VirtualSpaceNodeTest, is_available_overflow) { + // Reserve some memory. + VirtualSpaceNode vsn(false, os::vm_allocation_granularity()); + ASSERT_TRUE(vsn.initialize()) << "Failed to setup VirtualSpaceNode"; + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + ASSERT_TRUE(vsn.expand_by(commit_word_size, commit_word_size)) + << "Failed to commit, commit_word_size = " << commit_word_size; + + SCOPED_TRACE(err_msg("VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(vsn.bottom()), p2i(vsn.end())).buffer()); + + // Calculate a size that will overflow the virtual space size. + void* virtual_space_max = (void*)(uintptr_t)-1; + size_t bottom_to_max = pointer_delta(virtual_space_max, vsn.bottom(), 1); + size_t overflow_size = bottom_to_max + BytesPerWord; + size_t overflow_word_size = overflow_size / BytesPerWord; + + EXPECT_FALSE(vsn.is_available(overflow_word_size)) << " overflow_word_size = " << overflow_word_size; +} From f853aebd9bd3ba10dc61902be48c1386155ec6d7 Mon Sep 17 00:00:00 2001 From: David M Lloyd Date: Thu, 18 Oct 2018 15:56:37 -0500 Subject: [PATCH 006/128] 8212828: (process) Provide a way for Runtime.exec to use posix_spawn on linux Reviewed-by: alanb, rriggs --- make/launcher/Launcher-java.base.gmk | 2 +- src/java.base/unix/classes/java/lang/ProcessImpl.java | 4 ++-- src/java.base/unix/native/libjava/ProcessImpl_md.c | 8 +------- test/jdk/java/lang/ProcessBuilder/Basic.java | 7 +++++++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/make/launcher/Launcher-java.base.gmk b/make/launcher/Launcher-java.base.gmk index 44263adc5a1..960a92f6ea5 100644 --- a/make/launcher/Launcher-java.base.gmk +++ b/make/launcher/Launcher-java.base.gmk @@ -84,7 +84,7 @@ endif ################################################################################ -ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix), ) +ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix linux), ) $(eval $(call SetupJdkExecutable, BUILD_JSPAWNHELPER, \ NAME := jspawnhelper, \ SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \ diff --git a/src/java.base/unix/classes/java/lang/ProcessImpl.java b/src/java.base/unix/classes/java/lang/ProcessImpl.java index 368a4f7380b..adb76ff3ec8 100644 --- a/src/java.base/unix/classes/java/lang/ProcessImpl.java +++ b/src/java.base/unix/classes/java/lang/ProcessImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ final class ProcessImpl extends Process { private static enum Platform { - LINUX(LaunchMechanism.VFORK, LaunchMechanism.FORK), + LINUX(LaunchMechanism.VFORK, LaunchMechanism.POSIX_SPAWN, LaunchMechanism.FORK), BSD(LaunchMechanism.POSIX_SPAWN, LaunchMechanism.FORK), diff --git a/src/java.base/unix/native/libjava/ProcessImpl_md.c b/src/java.base/unix/native/libjava/ProcessImpl_md.c index 533584fdb7a..c9812e2e221 100644 --- a/src/java.base/unix/native/libjava/ProcessImpl_md.c +++ b/src/java.base/unix/native/libjava/ProcessImpl_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,9 +44,7 @@ #include #include -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) #include -#endif #include "childproc.h" @@ -390,7 +388,6 @@ forkChild(ChildStuff *c) { return resultPid; } -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) static pid_t spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) { pid_t resultPid; @@ -473,7 +470,6 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) * via the statement below */ return resultPid; } -#endif /* * Start a child process running function childProcess. @@ -489,10 +485,8 @@ startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) #endif case MODE_FORK: return forkChild(c); -#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) case MODE_POSIX_SPAWN: return spawnChild(env, process, c, helperpath); -#endif default: return -1; } diff --git a/test/jdk/java/lang/ProcessBuilder/Basic.java b/test/jdk/java/lang/ProcessBuilder/Basic.java index b402b24629a..1a835bb7fa9 100644 --- a/test/jdk/java/lang/ProcessBuilder/Basic.java +++ b/test/jdk/java/lang/ProcessBuilder/Basic.java @@ -36,6 +36,13 @@ * @author Martin Buchholz */ +/* + * @test + * @modules java.base/java.lang:open + * @requires (os.family == "linux") + * @run main/othervm/timeout=300 -Djdk.lang.Process.launchMechanism=posix_spawn Basic + */ + import java.lang.ProcessBuilder.Redirect; import java.lang.ProcessHandle; import static java.lang.ProcessBuilder.Redirect.*; From 426873751c710061d0f9bc713a0de47373e51418 Mon Sep 17 00:00:00 2001 From: Gary Adams Date: Tue, 23 Oct 2018 11:51:03 -0400 Subject: [PATCH 007/128] 8206330: Revisit com/sun/jdi/RedefineCrossEvent.java Reviewed-by: cjplummer, sspitsyn, amenkov --- test/jdk/ProblemList.txt | 8 -------- test/jdk/com/sun/jdi/RedefineCrossEvent.java | 5 +---- test/jdk/com/sun/jdi/TestScaffold.java | 4 +++- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index bd9fe665b62..c2c13bfdbb8 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -874,14 +874,6 @@ javax/rmi/ssl/SSLSocketParametersTest.sh 8162906 generic- ############################################################################ -########################################################################### -# -# Java EE Module Removal -# -com/sun/jdi/RedefineCrossEvent.java 8194308 generic-all Java EE Module Removal - -############################################################################ - # jdk_jfr jdk/jfr/event/io/TestInstrumentation.java 8202142 generic-all diff --git a/test/jdk/com/sun/jdi/RedefineCrossEvent.java b/test/jdk/com/sun/jdi/RedefineCrossEvent.java index c61dd3cb92f..f1dded0b42e 100644 --- a/test/jdk/com/sun/jdi/RedefineCrossEvent.java +++ b/test/jdk/com/sun/jdi/RedefineCrossEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,6 @@ * @summary Test class redefinition at each event cross tested with other tests * @author Robert Field * - * @modules java.corba - * jdk.jdi - * * @run build TestScaffold VMConnection TargetAdapter TargetListener * @run compile -g AccessSpecifierTest.java * @run compile -g AfterThreadDeathTest.java diff --git a/test/jdk/com/sun/jdi/TestScaffold.java b/test/jdk/com/sun/jdi/TestScaffold.java index 2561c5b5ba6..fc7749cd7cb 100644 --- a/test/jdk/com/sun/jdi/TestScaffold.java +++ b/test/jdk/com/sun/jdi/TestScaffold.java @@ -542,7 +542,9 @@ abstract public class TestScaffold extends TargetAdapter { redefine(mainStartClass); } } else { - redefine(rt); + if (!name.startsWith("jdk.")) { + redefine(rt); + } } } } From ad6611f3ce45666b579cefa0111c6181931fbd02 Mon Sep 17 00:00:00 2001 From: Gary Adams Date: Tue, 23 Oct 2018 14:23:46 -0400 Subject: [PATCH 008/128] 8211013: [TESTBUG] nsk/jdb/kill/kill002 wait for message and prompt Reviewed-by: cjplummer, dtitov, jcbeyler --- .../share/classes/com/sun/tools/example/debug/tty/TTY.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java index dc860b979a8..bfa05a2b388 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java @@ -506,6 +506,7 @@ public class TTY implements EventNotifier { showPrompt = false; evaluator.commandNext(); } else if (cmd.equals("kill")) { + showPrompt = false; // asynchronous command evaluator.commandKill(t); } else if (cmd.equals("interrupt")) { evaluator.commandInterrupt(t); From 3d2f28b5409021a13ed402a97c5a8217ad11a515 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 1 Nov 2018 11:23:12 +0100 Subject: [PATCH 009/128] 8212934: [JVMCI] do not propagate resolution error in HotSpotResolvedJavaFieldImpl.getType Reviewed-by: kvn --- .../hotspot/HotSpotResolvedJavaFieldImpl.java | 2 +- .../runtime/test/TestResolvedJavaField.java | 107 ++++++++++++++++-- 2 files changed, 101 insertions(+), 8 deletions(-) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index 2e9a899926b..aed1df11bb4 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -125,7 +125,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField { if (currentType instanceof UnresolvedJavaType) { // Don't allow unresolved types to hang around forever UnresolvedJavaType unresolvedType = (UnresolvedJavaType) currentType; - ResolvedJavaType resolved = unresolvedType.resolve(holder); + ResolvedJavaType resolved = holder.lookupType(unresolvedType, false); if (resolved != null) { type = resolved; } diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java index 195d0deec0e..21d46fd39f3 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -33,10 +33,15 @@ package jdk.vm.ci.runtime.test; -import jdk.vm.ci.meta.ResolvedJavaField; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import org.junit.Test; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -45,10 +50,13 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.junit.Assert; +import org.junit.Test; + +import jdk.vm.ci.meta.ResolvedJavaField; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.runtime.test.TestResolvedJavaField.TestClassLoader; /** * Tests for {@link ResolvedJavaField}. @@ -134,4 +142,89 @@ public class TestResolvedJavaField extends FieldUniverse { } } } + static class TestClassLoader extends ClassLoader { + + @Override + protected Class findClass(final String name) { + if (!name.equals(TypeWithUnresolvedFieldType.class.getName())) { + try { + return super.findClass(name); + } catch (ClassNotFoundException e) { + throw new AssertionError("unexpected: " + e); + } + } + // copy classfile to byte array + byte[] classData = null; + try { + String simpleName = TypeWithUnresolvedFieldType.class.getSimpleName(); + InputStream is = TypeWithUnresolvedFieldType.class.getResourceAsStream(simpleName + ".class"); + assert is != null; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + byte[] buf = new byte[1024]; + int size; + while ((size = is.read(buf, 0, buf.length)) != -1) { + baos.write(buf, 0, size); + } + baos.flush(); + classData = baos.toByteArray(); + } catch (IOException e) { + Assert.fail("can't access class: " + name); + } + + // replace all occurrences of "PrintStream" in classfile + int index = -1; + + while ((index = indexOf(classData, index + 1, "PrintStream")) != -1) { + replace(classData, index, "XXXXXXXXXXX"); + } + + Class c = defineClass(null, classData, 0, classData.length); + return c; + } + + private static int indexOf(byte[] b, int index, String find) { + for (int i = index; i < b.length; i++) { + boolean match = true; + for (int j = i; j < i + find.length(); j++) { + if (b[j] != (byte) find.charAt(j - i)) { + match = false; + break; + } + } + if (match) { + return i; + } + } + return -1; + } + + private static void replace(byte[] b, int index, String replace) { + for (int i = index; i < index + replace.length(); i++) { + b[i] = (byte) replace.charAt(i - index); + } + } + } + + /** + * Tests that calling {@link ResolvedJavaField#getType()} does not cause a linkage error if the + * type of the field is not resolvable. + */ + @Test + public void testGetType() { + Class c = new TestClassLoader().findClass(TypeWithUnresolvedFieldType.class.getName()); + ResolvedJavaType type = metaAccess.lookupJavaType(c); + for (ResolvedJavaField field : type.getInstanceFields(false)) { + assertTrue(field.getName().equals("fieldWithUnresolvableType")); + field.getType(); + field.toString(); + } + } +} + +class TypeWithUnresolvedFieldType { + /** + * {@link TestClassLoader} will rewrite the type of this field to "Ljava/io/XXXXXXXXXXX;". + */ + PrintStream fieldWithUnresolvableType; } From b77f937f7e570adc7df8d45db17b06062fc38139 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 1 Nov 2018 11:28:02 +0100 Subject: [PATCH 010/128] 8213237: Remove test-compile-commands from jib-profiles.js Reviewed-by: lancea --- make/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index c35ac75d3e3..8d4f6eba4d8 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -485,7 +485,7 @@ var getJibProfilesProfiles = function (input, common, data) { .forEach(function (name) { var maketestName = name + "-testmake"; profiles[maketestName] = concatObjects(profiles[name], testmakeBase); - profiles[maketestName].default_make_targets = [ "test-make", "test-compile-commands" ]; + profiles[maketestName].default_make_targets = [ "test-make" ]; }); // Profiles for building the zero jvm variant. These are used for verification. From 2fe0a0f20bb15df32817ce6ac27615f48ecfdf2b Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 1 Nov 2018 14:15:35 +0100 Subject: [PATCH 011/128] 8213014: Crash in CompileBroker::make_thread due to OOM Added missing null checks and checks for pending exception. Reviewed-by: kvn, dholmes, mdoerr --- src/hotspot/share/compiler/compileBroker.cpp | 28 +++++++++++--------- src/hotspot/share/compiler/compileBroker.hpp | 3 +-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index 1a4829411bc..fea4df41929 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -740,12 +740,11 @@ Handle CompileBroker::create_thread_oop(const char* name, TRAPS) { } -JavaThread* CompileBroker::make_thread(jobject thread_handle, CompileQueue* queue, - AbstractCompiler* comp, bool compiler_thread, TRAPS) { +JavaThread* CompileBroker::make_thread(jobject thread_handle, CompileQueue* queue, AbstractCompiler* comp, TRAPS) { JavaThread* thread = NULL; { MutexLocker mu(Threads_lock, THREAD); - if (compiler_thread) { + if (comp != NULL) { if (!InjectCompilerCreationFailure || comp->num_compiler_threads() == 0) { CompilerCounters* counters = new CompilerCounters(); thread = new CompilerThread(queue, counters); @@ -794,7 +793,7 @@ JavaThread* CompileBroker::make_thread(jobject thread_handle, CompileQueue* queu java_lang_Thread::set_daemon(JNIHandles::resolve_non_null(thread_handle)); thread->set_threadObj(JNIHandles::resolve_non_null(thread_handle)); - if (compiler_thread) { + if (comp != NULL) { thread->as_CompilerThread()->set_compiler(comp); } Threads::add(thread); @@ -804,7 +803,7 @@ JavaThread* CompileBroker::make_thread(jobject thread_handle, CompileQueue* queu // First release lock before aborting VM. if (thread == NULL || thread->osthread() == NULL) { - if (UseDynamicNumberOfCompilerThreads && comp->num_compiler_threads() > 0) { + if (UseDynamicNumberOfCompilerThreads && comp != NULL && comp->num_compiler_threads() > 0) { if (thread != NULL) { thread->smr_delete(); } @@ -844,12 +843,13 @@ void CompileBroker::init_compiler_sweeper_threads() { for (int i = 0; i < _c2_count; i++) { // Create a name for our thread. sprintf(name_buffer, "%s CompilerThread%d", _compilers[1]->name(), i); - jobject thread_handle = JNIHandles::make_global(create_thread_oop(name_buffer, THREAD)); + Handle thread_oop = create_thread_oop(name_buffer, CHECK); + jobject thread_handle = JNIHandles::make_global(thread_oop); _compiler2_objects[i] = thread_handle; _compiler2_logs[i] = NULL; if (!UseDynamicNumberOfCompilerThreads || i == 0) { - JavaThread *ct = make_thread(thread_handle, _c2_compile_queue, _compilers[1], /* compiler_thread */ true, CHECK); + JavaThread *ct = make_thread(thread_handle, _c2_compile_queue, _compilers[1], CHECK); assert(ct != NULL, "should have been handled for initial thread"); _compilers[1]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { @@ -863,12 +863,13 @@ void CompileBroker::init_compiler_sweeper_threads() { for (int i = 0; i < _c1_count; i++) { // Create a name for our thread. sprintf(name_buffer, "C1 CompilerThread%d", i); - jobject thread_handle = JNIHandles::make_global(create_thread_oop(name_buffer, THREAD)); + Handle thread_oop = create_thread_oop(name_buffer, CHECK); + jobject thread_handle = JNIHandles::make_global(thread_oop); _compiler1_objects[i] = thread_handle; _compiler1_logs[i] = NULL; if (!UseDynamicNumberOfCompilerThreads || i == 0) { - JavaThread *ct = make_thread(thread_handle, _c1_compile_queue, _compilers[0], /* compiler_thread */ true, CHECK); + JavaThread *ct = make_thread(thread_handle, _c1_compile_queue, _compilers[0], CHECK); assert(ct != NULL, "should have been handled for initial thread"); _compilers[0]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { @@ -885,8 +886,9 @@ void CompileBroker::init_compiler_sweeper_threads() { if (MethodFlushing) { // Initialize the sweeper thread - jobject thread_handle = JNIHandles::make_local(THREAD, create_thread_oop("Sweeper thread", THREAD)()); - make_thread(thread_handle, NULL, NULL, /* compiler_thread */ false, CHECK); + Handle thread_oop = create_thread_oop("Sweeper thread", CHECK); + jobject thread_handle = JNIHandles::make_local(THREAD, thread_oop()); + make_thread(thread_handle, NULL, NULL, CHECK); } } @@ -909,7 +911,7 @@ void CompileBroker::possibly_add_compiler_threads() { (int)(available_cc_np / (128*K))); for (int i = old_c2_count; i < new_c2_count; i++) { - JavaThread *ct = make_thread(compiler2_object(i), _c2_compile_queue, _compilers[1], true, CHECK); + JavaThread *ct = make_thread(compiler2_object(i), _c2_compile_queue, _compilers[1], CHECK); if (ct == NULL) break; _compilers[1]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { @@ -929,7 +931,7 @@ void CompileBroker::possibly_add_compiler_threads() { (int)(available_cc_p / (128*K))); for (int i = old_c1_count; i < new_c1_count; i++) { - JavaThread *ct = make_thread(compiler1_object(i), _c1_compile_queue, _compilers[0], true, CHECK); + JavaThread *ct = make_thread(compiler1_object(i), _c1_compile_queue, _compilers[0], CHECK); if (ct == NULL) break; _compilers[0]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { diff --git a/src/hotspot/share/compiler/compileBroker.hpp b/src/hotspot/share/compiler/compileBroker.hpp index 87589025725..ec72fd41a12 100644 --- a/src/hotspot/share/compiler/compileBroker.hpp +++ b/src/hotspot/share/compiler/compileBroker.hpp @@ -230,8 +230,7 @@ class CompileBroker: AllStatic { static volatile int _print_compilation_warning; static Handle create_thread_oop(const char* name, TRAPS); - static JavaThread* make_thread(jobject thread_oop, CompileQueue* queue, - AbstractCompiler* comp, bool compiler_thread, TRAPS); + static JavaThread* make_thread(jobject thread_oop, CompileQueue* queue, AbstractCompiler* comp, TRAPS); static void init_compiler_sweeper_threads(); static void possibly_add_compiler_threads(); static bool compilation_is_complete (const methodHandle& method, int osr_bci, int comp_level); From 58a340bcb10bc8425cde7869b88260e1e5600d78 Mon Sep 17 00:00:00 2001 From: Nico Williams Date: Thu, 1 Nov 2018 22:41:32 +0800 Subject: [PATCH 012/128] 8212217: JGSS: Don't dispose() of creds too eagerly Reviewed-by: mullan, weijun --- .../jgss/wrapper/NativeGSSContext.java | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java index d2d5367f1b8..fa8e268b753 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,12 +63,14 @@ class NativeGSSContext implements GSSContextSpi { private GSSNameElement srcName; private GSSNameElement targetName; private GSSCredElement cred; + private GSSCredElement disposeCred; private boolean isInitiator; private boolean isEstablished; private Oid actualMech; // Assigned during context establishment private ChannelBinding cb; private GSSCredElement delegatedCred; + private GSSCredElement disposeDelegatedCred; private int flags; private int lifetime = GSSCredential.DEFAULT_LIFETIME; private final GSSLibStub cStub; @@ -192,6 +194,7 @@ class NativeGSSContext implements GSSContextSpi { } cStub = stub; cred = myCred; + disposeCred = null; targetName = peer; isInitiator = true; lifetime = time; @@ -199,8 +202,9 @@ class NativeGSSContext implements GSSContextSpi { if (GSSUtil.isKerberosMech(cStub.getMech())) { doServicePermCheck(); if (cred == null) { - cred = new GSSCredElement(null, lifetime, - GSSCredential.INITIATE_ONLY, cStub); + disposeCred = cred = + new GSSCredElement(null, lifetime, + GSSCredential.INITIATE_ONLY, cStub); } srcName = cred.getName(); } @@ -211,6 +215,7 @@ class NativeGSSContext implements GSSContextSpi { throws GSSException { cStub = stub; cred = myCred; + disposeCred = null; if (cred != null) targetName = cred.getName(); @@ -297,9 +302,9 @@ class NativeGSSContext implements GSSContextSpi { (cStub.getContextName(pContext, true), cStub); } if (cred == null) { - cred = new GSSCredElement(srcName, lifetime, - GSSCredential.INITIATE_ONLY, - cStub); + disposeCred = cred = + new GSSCredElement(srcName, lifetime, + GSSCredential.INITIATE_ONLY, cStub); } } } @@ -315,6 +320,7 @@ class NativeGSSContext implements GSSContextSpi { inToken.length); long pCred = (cred == null? 0 : cred.pCred); outToken = cStub.acceptContext(pCred, cb, inToken, this); + disposeDelegatedCred = delegatedCred; SunNativeProvider.debug("acceptSecContext=> outToken len=" + (outToken == null? 0 : outToken.length)); @@ -323,9 +329,12 @@ class NativeGSSContext implements GSSContextSpi { (cStub.getContextName(pContext, false), cStub); // Replace the current default acceptor cred now that // the context acceptor name is available - if (cred != null) cred.dispose(); - cred = new GSSCredElement(targetName, lifetime, - GSSCredential.ACCEPT_ONLY, cStub); + if (disposeCred != null) { + disposeCred.dispose(); + } + disposeCred = cred = + new GSSCredElement(targetName, lifetime, + GSSCredential.ACCEPT_ONLY, cStub); } // Only inspect token when the permission check has not @@ -346,9 +355,15 @@ class NativeGSSContext implements GSSContextSpi { } public void dispose() throws GSSException { + if (disposeCred != null) { + disposeCred.dispose(); + } + if (disposeDelegatedCred != null) { + disposeDelegatedCred.dispose(); + } + disposeDelegatedCred = disposeCred = cred = null; srcName = null; targetName = null; - cred = null; delegatedCred = null; if (pContext != 0) { pContext = cStub.deleteContext(pContext); @@ -612,6 +627,7 @@ class NativeGSSContext implements GSSContextSpi { } } public GSSCredentialSpi getDelegCred() throws GSSException { + disposeDelegatedCred = null; return delegatedCred; } public boolean isInitiator() { From cb73851579f2e1d57a5d52cc5bd1e1cb2808dfcc Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 1 Nov 2018 09:34:59 -0700 Subject: [PATCH 013/128] 8213210: Change ServerSocket(SocketImpl impl) constructor to protected access Reviewed-by: alanb, chegar --- .../share/classes/java/net/ServerSocket.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index 92a8b8ca8fd..a6c463f37ad 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -76,10 +76,15 @@ class ServerSocket implements java.io.Closeable { private boolean oldImpl = false; /** - * Package-private constructor to create a ServerSocket associated with - * the given SocketImpl. + * Creates a server socket with a user-specified {@code SocketImpl}. + * + * @param impl an instance of a SocketImpl to use on the ServerSocket. + * + * @throws NullPointerException if impl is {@code null}. + * + * @since 12 */ - ServerSocket(SocketImpl impl) { + protected ServerSocket(SocketImpl impl) { this.impl = impl; impl.setServerSocket(this); } From 2c4392d433ce29c670c2112824f9093c92a1f4fb Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 1 Nov 2018 09:41:04 -0700 Subject: [PATCH 014/128] 8212871: Broken links give 401-Unauthorized Reviewed-by: lancea --- .../share/classes/org/w3c/dom/xpath/XPathEvaluator.java | 2 +- .../share/classes/org/w3c/dom/xpath/XPathException.java | 9 ++++++++- .../share/classes/org/w3c/dom/xpath/XPathExpression.java | 2 +- .../share/classes/org/w3c/dom/xpath/XPathNSResolver.java | 2 +- .../share/classes/org/w3c/dom/xpath/XPathNamespace.java | 2 +- .../share/classes/org/w3c/dom/xpath/XPathResult.java | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathEvaluator.java b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathEvaluator.java index da6bec56b3f..734a3c55feb 100644 --- a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathEvaluator.java +++ b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathEvaluator.java @@ -61,7 +61,7 @@ import org.w3c.dom.DOMException; * from other sources that could provide specific support for specialized * extension functions or variables as would be defined by other * specifications. - *

See also the Document Object Model (DOM) Level 3 XPath Specification. + *

See also the Document Object Model (DOM) Level 3 XPath Specification. */ public interface XPathEvaluator { /** diff --git a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathException.java b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathException.java index 2a13869df45..2941f9eed03 100644 --- a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathException.java +++ b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathException.java @@ -44,7 +44,14 @@ package org.w3c.dom.xpath; /** * A new exception has been created for exceptions specific to these XPath * interfaces. - *

See also the Document Object Model (DOM) Level 3 XPath Specification. + * + * See also + * Document Object Model (DOM) Level 3 XPath Specification, Version 1.0, + * W3C Working Group Note 26 February 2004 + * Note that this class came from Document Object Model (DOM) Level 3 XPath + * Specification, Working Draft 20 August 2002 where the values of + * {@link #INVALID_EXPRESSION_ERR} and {@link #TYPE_ERR} + * are 1 and 2 respectively (instead of 51 and 52 as in the 2004 version). */ public class XPathException extends RuntimeException { private static final long serialVersionUID = 3471034171575979943L; diff --git a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathExpression.java b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathExpression.java index 17ec4120559..9c846d01aaa 100644 --- a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathExpression.java +++ b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathExpression.java @@ -48,7 +48,7 @@ import org.w3c.dom.DOMException; /** * The XPathExpression interface represents a parsed and resolved * XPath expression. - *

See also the Document Object Model (DOM) Level 3 XPath Specification. + *

See also the Document Object Model (DOM) Level 3 XPath Specification. */ public interface XPathExpression { /** diff --git a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNSResolver.java b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNSResolver.java index 68eb1f39d32..a44d9bea785 100644 --- a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNSResolver.java +++ b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNSResolver.java @@ -48,7 +48,7 @@ package org.w3c.dom.xpath; * namespaceURI strings. XPathEvaluator can * construct an implementation of XPathNSResolver from a node, * or the interface may be implemented by any application. - *

See also the Document Object Model (DOM) Level 3 XPath Specification. + *

See also the Document Object Model (DOM) Level 3 XPath Specification. */ public interface XPathNSResolver { /** diff --git a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNamespace.java b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNamespace.java index cdfea884d55..a6932ec017f 100644 --- a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNamespace.java +++ b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathNamespace.java @@ -74,7 +74,7 @@ import org.w3c.dom.Node; * future versions of the XPath specification, the definition of a namespace * node may be changed incomatibly, in which case incompatible changes to * field values may be required to implement versions beyond XPath 1.0. - *

See also the Document Object Model (DOM) Level 3 XPath Specification. + *

See also the Document Object Model (DOM) Level 3 XPath Specification. */ public interface XPathNamespace extends Node { // XPathNodeType diff --git a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathResult.java b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathResult.java index d042011e74c..ca8b341f7b7 100644 --- a/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathResult.java +++ b/src/jdk.xml.dom/share/classes/org/w3c/dom/xpath/XPathResult.java @@ -51,7 +51,7 @@ import org.w3c.dom.DOMException; * node. Since evaluation of an XPath expression can result in various * result types, this object makes it possible to discover and manipulate * the type and value of the result. - *

See also the Document Object Model (DOM) Level 3 XPath Specification. + *

See also the Document Object Model (DOM) Level 3 XPath Specification. */ public interface XPathResult { // XPathResultType From 3eef9c79978a841d7b49baa1c74541695e4dfc91 Mon Sep 17 00:00:00 2001 From: Ramanand Patil Date: Thu, 1 Nov 2018 12:43:21 -0400 Subject: [PATCH 015/128] 8213085: (tz) Upgrade time-zone data to tzdata2018g Reviewed-by: martin, naoto --- make/data/tzdata/VERSION | 2 +- make/data/tzdata/africa | 121 +++---- make/data/tzdata/antarctica | 2 + make/data/tzdata/asia | 314 +++++++++++++++--- make/data/tzdata/australasia | 13 +- make/data/tzdata/backward | 4 +- make/data/tzdata/etcetera | 4 +- make/data/tzdata/europe | 77 ++++- make/data/tzdata/factory | 6 +- make/data/tzdata/leapseconds | 31 +- make/data/tzdata/northamerica | 21 +- make/data/tzdata/pacificnew | 2 + make/data/tzdata/southamerica | 36 +- make/data/tzdata/systemv | 2 + make/data/tzdata/zone.tab | 14 +- .../sun/util/resources/TimeZoneNames.java | 6 +- .../util/resources/ext/TimeZoneNames_de.java | 6 +- .../util/resources/ext/TimeZoneNames_es.java | 6 +- .../util/resources/ext/TimeZoneNames_fr.java | 6 +- .../util/resources/ext/TimeZoneNames_it.java | 6 +- .../util/resources/ext/TimeZoneNames_ja.java | 6 +- .../util/resources/ext/TimeZoneNames_ko.java | 6 +- .../resources/ext/TimeZoneNames_pt_BR.java | 6 +- .../util/resources/ext/TimeZoneNames_sv.java | 6 +- .../resources/ext/TimeZoneNames_zh_CN.java | 6 +- .../resources/ext/TimeZoneNames_zh_TW.java | 6 +- test/jdk/sun/util/calendar/zi/tzdata/VERSION | 2 +- test/jdk/sun/util/calendar/zi/tzdata/africa | 121 +++---- .../sun/util/calendar/zi/tzdata/antarctica | 2 + test/jdk/sun/util/calendar/zi/tzdata/asia | 314 +++++++++++++++--- .../sun/util/calendar/zi/tzdata/australasia | 13 +- test/jdk/sun/util/calendar/zi/tzdata/backward | 4 +- test/jdk/sun/util/calendar/zi/tzdata/etcetera | 4 +- test/jdk/sun/util/calendar/zi/tzdata/europe | 77 ++++- test/jdk/sun/util/calendar/zi/tzdata/factory | 6 +- .../sun/util/calendar/zi/tzdata/leapseconds | 31 +- .../sun/util/calendar/zi/tzdata/northamerica | 21 +- .../sun/util/calendar/zi/tzdata/pacificnew | 2 + .../sun/util/calendar/zi/tzdata/southamerica | 36 +- test/jdk/sun/util/calendar/zi/tzdata/systemv | 2 + test/jdk/sun/util/calendar/zi/tzdata/zone.tab | 14 +- 41 files changed, 1007 insertions(+), 357 deletions(-) diff --git a/make/data/tzdata/VERSION b/make/data/tzdata/VERSION index 22002be51d6..e3fa9222bcf 100644 --- a/make/data/tzdata/VERSION +++ b/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2018e +tzdata2018g diff --git a/make/data/tzdata/africa b/make/data/tzdata/africa index 1c305f8b8e7..e2ffac25ec1 100644 --- a/make/data/tzdata/africa +++ b/make/data/tzdata/africa @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Africa and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -29,7 +31,7 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-04-09): +# From Paul Eggert (2018-05-27): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -74,13 +76,15 @@ # I vaguely recall 'WAT' also being used for -01 in the past but # cannot now come up with solid citations. # -# I invented the following abbreviations; corrections are welcome! -# +02 WAST West Africa Summer Time (no longer used) -# +03 CAST Central Africa Summer Time (no longer used) -# +03 SAST South Africa Summer Time (no longer used) +# I invented the following abbreviations in the 1990s: +# +02 WAST West Africa Summer Time +# +03 CAST Central Africa Summer Time +# +03 SAST South Africa Summer Time # +03 EAT East Africa Time -# 'EAT' also seems to have caught on; the others are rare but are paired -# with better-attested non-DST abbreviations. +# 'EAT' seems to have caught on and is in current timestamps, and though +# the other abbreviations are rarer and are only in past timestamps, +# they are paired with better-attested non-DST abbreviations. +# Corrections are welcome. # Algeria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -385,6 +389,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # Eritrea # Ethiopia # See Africa/Nairobi. +# +# Unfortunately tzdb records only Western clock time in use in Ethiopia, +# as the tzdb format is not up to properly recording a common Ethiopian +# timekeeping practice that is based on solar time. See: +# Mortada D. If you have a meeting in Ethiopia, you'd better double +# check the time. PRI's The World. 2015-01-30 15:15 -05. +# https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time # Gabon # See Africa/Lagos. @@ -856,94 +867,61 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # agrees # with the patch. -# From Paul Eggert (2015-06-08): -# For now, guess that later spring and fall transitions will use 2015's rules, -# and guess that Morocco will switch to standard time at 03:00 the last -# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after -# Ramadan. To implement this, transition dates for 2016 through 2037 were -# determined by running the following program under GNU Emacs 24.3, with the -# results integrated by hand into the table below. -# (let ((islamic-year 1437)) -# (require 'cal-islam) -# (while (< islamic-year 1460) -# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) -# (sunday 0)) -# (while (/= sunday (mod (setq a (1- a)) 7))) -# (while (/= sunday (mod b 7)) -# (setq b (1+ b))) -# (setq a (calendar-gregorian-from-absolute a)) -# (setq b (calendar-gregorian-from-absolute b)) -# (insert -# (format -# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n" -# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) -# (setq islamic-year (+ 1 islamic-year)))) +# From Mohamed Essedik Najd (2018-10-26): +# Today, a Moroccan government council approved the perpetual addition +# of 60 minutes to the regular Moroccan timezone. +# From Brian Inglis (2018-10-26): +# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S - -Rule Morocco 1939 only - Sep 12 0:00 1:00 S +Rule Morocco 1939 only - Sep 12 0:00 1:00 - Rule Morocco 1939 only - Nov 19 0:00 0 - -Rule Morocco 1940 only - Feb 25 0:00 1:00 S +Rule Morocco 1940 only - Feb 25 0:00 1:00 - Rule Morocco 1945 only - Nov 18 0:00 0 - -Rule Morocco 1950 only - Jun 11 0:00 1:00 S +Rule Morocco 1950 only - Jun 11 0:00 1:00 - Rule Morocco 1950 only - Oct 29 0:00 0 - -Rule Morocco 1967 only - Jun 3 12:00 1:00 S +Rule Morocco 1967 only - Jun 3 12:00 1:00 - Rule Morocco 1967 only - Oct 1 0:00 0 - -Rule Morocco 1974 only - Jun 24 0:00 1:00 S +Rule Morocco 1974 only - Jun 24 0:00 1:00 - Rule Morocco 1974 only - Sep 1 0:00 0 - -Rule Morocco 1976 1977 - May 1 0:00 1:00 S +Rule Morocco 1976 1977 - May 1 0:00 1:00 - Rule Morocco 1976 only - Aug 1 0:00 0 - Rule Morocco 1977 only - Sep 28 0:00 0 - -Rule Morocco 1978 only - Jun 1 0:00 1:00 S +Rule Morocco 1978 only - Jun 1 0:00 1:00 - Rule Morocco 1978 only - Aug 4 0:00 0 - -Rule Morocco 2008 only - Jun 1 0:00 1:00 S +Rule Morocco 2008 only - Jun 1 0:00 1:00 - Rule Morocco 2008 only - Sep 1 0:00 0 - -Rule Morocco 2009 only - Jun 1 0:00 1:00 S +Rule Morocco 2009 only - Jun 1 0:00 1:00 - Rule Morocco 2009 only - Aug 21 0:00 0 - -Rule Morocco 2010 only - May 2 0:00 1:00 S +Rule Morocco 2010 only - May 2 0:00 1:00 - Rule Morocco 2010 only - Aug 8 0:00 0 - -Rule Morocco 2011 only - Apr 3 0:00 1:00 S +Rule Morocco 2011 only - Apr 3 0:00 1:00 - Rule Morocco 2011 only - Jul 31 0:00 0 - -Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 - Rule Morocco 2012 only - Jul 20 3:00 0 - -Rule Morocco 2012 only - Aug 20 2:00 1:00 S +Rule Morocco 2012 only - Aug 20 2:00 1:00 - Rule Morocco 2012 only - Sep 30 3:00 0 - Rule Morocco 2013 only - Jul 7 3:00 0 - -Rule Morocco 2013 only - Aug 10 2:00 1:00 S -Rule Morocco 2013 max - Oct lastSun 3:00 0 - -Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S +Rule Morocco 2013 only - Aug 10 2:00 1:00 - +Rule Morocco 2013 2018 - Oct lastSun 3:00 0 - +Rule Morocco 2014 2018 - Mar lastSun 2:00 1:00 - Rule Morocco 2014 only - Jun 28 3:00 0 - -Rule Morocco 2014 only - Aug 2 2:00 1:00 S +Rule Morocco 2014 only - Aug 2 2:00 1:00 - Rule Morocco 2015 only - Jun 14 3:00 0 - -Rule Morocco 2015 only - Jul 19 2:00 1:00 S +Rule Morocco 2015 only - Jul 19 2:00 1:00 - Rule Morocco 2016 only - Jun 5 3:00 0 - -Rule Morocco 2016 only - Jul 10 2:00 1:00 S +Rule Morocco 2016 only - Jul 10 2:00 1:00 - Rule Morocco 2017 only - May 21 3:00 0 - -Rule Morocco 2017 only - Jul 2 2:00 1:00 S +Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - -Rule Morocco 2018 only - Jun 17 2:00 1:00 S -Rule Morocco 2019 only - May 5 3:00 0 - -Rule Morocco 2019 only - Jun 9 2:00 1:00 S -Rule Morocco 2020 only - Apr 19 3:00 0 - -Rule Morocco 2020 only - May 24 2:00 1:00 S -Rule Morocco 2021 only - Apr 11 3:00 0 - -Rule Morocco 2021 only - May 16 2:00 1:00 S -Rule Morocco 2022 only - May 8 2:00 1:00 S -Rule Morocco 2023 only - Apr 23 2:00 1:00 S -Rule Morocco 2024 only - Apr 14 2:00 1:00 S -Rule Morocco 2025 only - Apr 6 2:00 1:00 S -Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S -Rule Morocco 2036 only - Oct 19 3:00 0 - -Rule Morocco 2037 only - Oct 4 3:00 0 - +Rule Morocco 2018 only - Jun 17 2:00 1:00 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 - 0:00 Morocco WE%sT 1984 Mar 16 - 1:00 - CET 1986 - 0:00 Morocco WE%sT + 0:00 Morocco +00/+01 1984 Mar 16 + 1:00 - +01 1986 + 0:00 Morocco +00/+01 2018 Oct 27 + 1:00 - +01 # Western Sahara # @@ -958,7 +936,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco WE%sT + 0:00 Morocco +00/+01 2018 Oct 27 + 1:00 - +01 # Mozambique # diff --git a/make/data/tzdata/antarctica b/make/data/tzdata/antarctica index 74ce2dcef51..d98afed9b85 100644 --- a/make/data/tzdata/antarctica +++ b/make/data/tzdata/antarctica @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Antarctica and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. diff --git a/make/data/tzdata/asia b/make/data/tzdata/asia index 877f53d0994..57255f2b6b8 100644 --- a/make/data/tzdata/asia +++ b/make/data/tzdata/asia @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Asia and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -29,7 +31,7 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-01-13): +# From Paul Eggert (2018-06-19): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -58,7 +60,8 @@ # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # -# The following alphabetic abbreviations appear in these tables: +# The following alphabetic abbreviations appear in these tables +# (corrections are welcome): # std dst # LMT Local Mean Time # 2:00 EET EEST Eastern European Time @@ -67,11 +70,13 @@ # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 PST PDT* Philippine Standard Time # 8:30 KST KDT Korea when at +0830 # 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea when at +09 # 9:30 ACST Australian Central Standard Time +# *I invented the abbreviation PDT; see "Philippines" below. # Otherwise, these tables typically use numeric abbreviations like +03 # and +0330 for integer hour and minute UT offsets. Although earlier # editions invented alphabetic time zone abbreviations for every @@ -304,6 +309,29 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon # China +# From Paul Eggert (2018-10-02): +# The following comes from Table 1 of: +# Li Yu. Research on the daylight saving movement in 1940s Shanghai. +# Nanjing Journal of Social Sciences. 2014;(2):144-50. +# http://oversea.cnki.net/kns55/detail.aspx?dbname=CJFD2014&filename=NJSH201402020 +# The table lists dates only; I am guessing 00:00 and 24:00 transition times. +# Also, the table lists the planned end of DST in 1949, but the corresponding +# zone line cuts this off on May 28, when the Communists took power. +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Shang 1940 only - Jun 1 0:00 1:00 D +Rule Shang 1940 only - Oct 12 24:00 0 S +Rule Shang 1941 only - Mar 15 0:00 1:00 D +Rule Shang 1941 only - Nov 1 24:00 0 S +Rule Shang 1942 only - Jan 31 0:00 1:00 D +Rule Shang 1945 only - Sep 1 24:00 0 S +Rule Shang 1946 only - May 15 0:00 1:00 D +Rule Shang 1946 only - Sep 30 24:00 0 S +Rule Shang 1947 only - Apr 15 0:00 1:00 D +Rule Shang 1947 only - Oct 31 24:00 0 S +Rule Shang 1948 1949 - May 1 0:00 1:00 D +Rule Shang 1948 1949 - Sep 30 24:00 0 S #plan + # From Guy Harris: # People's Republic of China. Yes, they really have only one time zone. @@ -330,18 +358,33 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon # time - sort of", Los Angeles Times, 1986-05-05 ... [says] that China began # observing daylight saving time in 1986. -# From Paul Eggert (2014-06-30): -# Shanks & Pottenger have China switching to a single time zone in 1980, but -# this doesn't seem to be correct. They also write that China observed summer -# DST from 1986 through 1991, which seems to match the above commentary, so -# go with them for DST rules as follows: +# From P Chan (2018-05-07): +# The start and end time of DST in China [from 1986 on] should be 2:00 +# (i.e. 2:00 to 3:00 at the start and 2:00 to 1:00 at the end).... +# Government notices about summer time: +# +# 1986-04-12 http://www.zj.gov.cn/attach/zfgb/198608.pdf p.21-22 +# (To establish summer time from 1986. On 4 May, set the clocks ahead one hour +# at 2 am. On 14 September, set the clocks backward one hour at 2 am.) +# +# 1987-02-15 http://www.gov.cn/gongbao/shuju/1987/gwyb198703.pdf p.114 +# (Summer time in 1987 to start from 12 April until 13 September) +# +# 1987-09-09 http://www.gov.cn/gongbao/shuju/1987/gwyb198721.pdf p.709 +# (From 1988, summer time to start from 2 am of the first Sunday of mid-April +# until 2 am of the first Sunday of mid-September) +# +# 1992-03-03 http://www.gov.cn/gongbao/shuju/1992/gwyb199205.pdf p.152 +# (To suspend summer time from 1992) +# +# The first page of People's Daily on 12 April 1988 stating that summer time +# to begin on 17 April. +# http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Shang 1940 only - Jun 3 0:00 1:00 D -Rule Shang 1940 1941 - Oct 1 0:00 0 S -Rule Shang 1941 only - Mar 16 0:00 1:00 D -Rule PRC 1986 only - May 4 0:00 1:00 D -Rule PRC 1986 1991 - Sep Sun>=11 0:00 0 S -Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D +Rule PRC 1986 only - May 4 2:00 1:00 D +Rule PRC 1986 1991 - Sep Sun>=11 2:00 0 S +Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D # From Anthony Fok (2001-12-20): # BTW, I did some research on-line and found some info regarding these five @@ -363,10 +406,11 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D # Alois Treindl kindly sent me translations of the following two sources: # # (1) -# Guo Qingsheng (National Time-Service Center, CAS, Xi'an 710600, China) +# Guo Qing-sheng (National Time-Service Center, CAS, Xi'an 710600, China) # Beijing Time at the Beginning of the PRC # China Historical Materials of Science and Technology -# (Zhongguo ke ji shi liao, 中国科技史料), Vol. 24, No. 1 (2003) +# (Zhongguo ke ji shi liao, 中国科技史料). 2003;24(1):5-9. +# http://oversea.cnki.net/kcms/detail/detail.aspx?filename=ZGKS200301000&dbname=CJFD2003 # It gives evidence that at the beginning of the PRC, Beijing time was # officially apparent solar time! However, Guo also says that the # evidence is dubious, as the relevant institute of astronomy had not @@ -543,7 +587,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] # Beijing time, used throughout China; represented by Shanghai. Zone Asia/Shanghai 8:05:43 - LMT 1901 - 8:00 Shang C%sT 1949 + 8:00 Shang C%sT 1949 May 28 8:00 PRC C%sT # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi # / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.) @@ -772,24 +816,140 @@ Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 Taiwan C%sT # Macau (Macao, Aomen) +# +# From P Chan (2018-05-10): +# * LegisMac +# http://legismac.safp.gov.mo/legismac/descqry/Descqry.jsf?lang=pt +# A database for searching titles of legal documents of Macau in +# Chinese and Portuguese. The term "HORÁRIO DE VERÃO" can be used for +# searching decrees about summer time. +# * Archives of Macao +# http://www.archives.gov.mo/en/bo/ +# It contains images of old official gazettes. +# * The Macao Meteorological and Geophysical Bureau have a page listing the +# summer time history. But it is not complete and has some mistakes. +# http://www.smg.gov.mo/smg/geophysics/e_t_Summer%20Time.htm +# Macau adopted GMT+8 on 30 Oct 1904 to follow Hong Kong. Clocks were +# advanced by 25 minutes and 50 seconds. Which means the LMT used was +# +7:34:10. As stated in the "Portaria No. 204" dated 21 October 1904 +# and published in the Official Gazette on 29 October 1904. +# http://igallery.icm.gov.mo/Images/Archives/BO/MO_AH_PUB_BO_1904_10/MO_AH_PUB_BO_1904_10_00025_Grey.JPG +# +# Therefore the 1911 decree of Portugal did not change time in Macau. +# +# From LegisMac, here is a list of decrees that changed the time ... +# [Decree Gazette-no. date; titles omitted in this quotation] +# DIL 732 BOCM 51 1941.12.20 +# DIL 764 BOCM 9S 1942.04.30 +# DIL 781 BOCM 21 1942.10.10 +# PT 3434 BOCM 8S 1943.04.17 +# PT 3504 BOCM 20 1943.09.25 +# PT 3843 BOCM 39 1945.09.29 +# PT 3961 BOCM 17 1946.04.27 +# PT 4026 BOCM 39 1946.09.28 +# PT 4153 BOCM 16 1947.04.10 +# PT 4271 BOCM 48 1947.11.29 +# PT 4374 BOCM 18 1948.05.01 +# PT 4465 BOCM 44 1948.10.30 +# PT 4590 BOCM 14 1949.04.02 +# PT 4666 BOCM 44 1949.10.29 +# PT 4771 BOCM 12 1950.03.25 +# PT 4838 BOCM 43 1950.10.28 +# PT 4946 BOCM 12 1951.03.24 +# PT 5025 BO 43 1951.10.27 +# PT 5149 BO 14 1952.04.05 +# PT 5251 BO 43 1952.10.25 +# PT 5366 BO 13 1953.03.28 +# PT 5444 BO 44 1953.10.31 +# PT 5540 BO 12 1954.03.20 +# PT 5589 BO 44 1954.10.30 +# PT 5676 BO 12 1955.03.19 +# PT 5739 BO 45 1955.11.05 +# PT 5823 BO 11 1956.03.17 +# PT 5891 BO 44 1956.11.03 +# PT 5981 BO 12 1957.03.23 +# PT 6064 BO 43 1957.10.26 +# PT 6172 BO 12 1958.03.22 +# PT 6243 BO 43 1958.10.25 +# PT 6341 BO 12 1959.03.21 +# PT 6411 BO 43 1959.10.24 +# PT 6514 BO 11 1960.03.12 +# PT 6584 BO 44 1960.10.29 +# PT 6721 BO 10 1961.03.11 +# PT 6815 BO 43 1961.10.28 +# PT 6947 BO 10 1962.03.10 +# PT 7080 BO 43 1962.10.27 +# PT 7218 BO 12 1963.03.23 +# PT 7340 BO 43 1963.10.26 +# PT 7491 BO 11 1964.03.14 +# PT 7664 BO 43 1964.10.24 +# PT 7846 BO 15 1965.04.10 +# PT 7979 BO 42 1965.10.16 +# PT 8146 BO 15 1966.04.09 +# PT 8252 BO 41 1966.10.08 +# PT 8429 BO 15 1967.04.15 +# PT 8540 BO 41 1967.10.14 +# PT 8735 BO 15 1968.04.13 +# PT 8860 BO 41 1968.10.12 +# PT 9035 BO 16 1969.04.19 +# PT 9156 BO 42 1969.10.18 +# PT 9328 BO 15 1970.04.11 +# PT 9418 BO 41 1970.10.10 +# PT 9587 BO 14 1971.04.03 +# PT 9702 BO 41 1971.10.09 +# PT 38-A/72 BO 14 1972.04.01 +# PT 126-A/72 BO 41 1972.10.07 +# PT 61/73 BO 14 1973.04.07 +# PT 182/73 BO 40 1973.10.06 +# PT 282/73 BO 51 1973.12.22 +# PT 177/74 BO 41 1974.10.12 +# PT 51/75 BO 15 1975.04.12 +# PT 173/75 BO 41 1975.10.11 +# PT 67/76/M BO 14 1976.04.03 +# PT 169/76/M BO 41 1976.10.09 +# PT 78/79/M BO 19 1979.05.12 +# PT 166/79/M BO 42 1979.10.20 +# Note that DIL 732 does not belong to "HORÁRIO DE VERÃO" according to +# LegisMac.... Note that between 1942 and 1945, the time switched +# between GMT+9 and GMT+10. Also in 1965 and 1965 the DST ended at 2:30am. + +# From Paul Eggert (2018-05-10): +# The 1904 decree says that Macau changed from the meridian of +# Fortaleza do Monte, presumably the basis for the 7:34:10 for LMT. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Macau 1961 1962 - Mar Sun>=16 3:30 1:00 D -Rule Macau 1961 1964 - Nov Sun>=1 3:30 0 S -Rule Macau 1963 only - Mar Sun>=16 0:00 1:00 D -Rule Macau 1964 only - Mar Sun>=16 3:30 1:00 D -Rule Macau 1965 only - Mar Sun>=16 0:00 1:00 D -Rule Macau 1965 only - Oct 31 0:00 0 S -Rule Macau 1966 1971 - Apr Sun>=16 3:30 1:00 D -Rule Macau 1966 1971 - Oct Sun>=16 3:30 0 S -Rule Macau 1972 1974 - Apr Sun>=15 0:00 1:00 D -Rule Macau 1972 1973 - Oct Sun>=15 0:00 0 S -Rule Macau 1974 1977 - Oct Sun>=15 3:30 0 S -Rule Macau 1975 1977 - Apr Sun>=15 3:30 1:00 D -Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 D -Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 S -# See Europe/Lisbon for info about the 1912 transition. +Rule Macau 1942 1943 - Apr 30 23:00 1:00 - +Rule Macau 1942 only - Nov 17 23:00 0 - +Rule Macau 1943 only - Sep 30 23:00 0 S +Rule Macau 1946 only - Apr 30 23:00s 1:00 D +Rule Macau 1946 only - Sep 30 23:00s 0 S +Rule Macau 1947 only - Apr 19 23:00s 1:00 D +Rule Macau 1947 only - Nov 30 23:00s 0 S +Rule Macau 1948 only - May 2 23:00s 1:00 D +Rule Macau 1948 only - Oct 31 23:00s 0 S +Rule Macau 1949 1950 - Apr Sat>=1 23:00s 1:00 D +Rule Macau 1949 1950 - Oct lastSat 23:00s 0 S +Rule Macau 1951 only - Mar 31 23:00s 1:00 D +Rule Macau 1951 only - Oct 28 23:00s 0 S +Rule Macau 1952 1953 - Apr Sat>=1 23:00s 1:00 D +Rule Macau 1952 only - Nov 1 23:00s 0 S +Rule Macau 1953 1954 - Oct lastSat 23:00s 0 S +Rule Macau 1954 1956 - Mar Sat>=17 23:00s 1:00 D +Rule Macau 1955 only - Nov 5 23:00s 0 S +Rule Macau 1956 1964 - Nov Sun>=1 03:30 0 S +Rule Macau 1957 1964 - Mar Sun>=18 03:30 1:00 D +Rule Macau 1965 1973 - Apr Sun>=16 03:30 1:00 D +Rule Macau 1965 1966 - Oct Sun>=16 02:30 0 S +Rule Macau 1967 1976 - Oct Sun>=16 03:30 0 S +Rule Macau 1973 only - Dec 30 03:30 1:00 D +Rule Macau 1975 1976 - Apr Sun>=16 03:30 1:00 D +Rule Macau 1979 only - May 13 03:30 1:00 D +Rule Macau 1979 only - Oct Sun>=16 03:30 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1911 Dec 31 16:00u +Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30 + 8:00 - CST 1941 Dec 21 23:00 + 9:00 Macau +09/+10 1945 Sep 30 24:00 8:00 Macau C%sT @@ -1494,9 +1654,29 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # http://www.shugiin.go.jp/internet/itdb_housei.nsf/html/houritsu/00719500331039.htm # ... In summary, it is written as follows. From 24:00 on the first Saturday # in May, until 0:00 on the day after the second Saturday in September. + +# From Phake Nick (2018-09-27): +# [T]he webpage authored by National Astronomical Observatory of Japan +# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EF.html +# ... mentioned that using Showa 23 (year 1948) as example, 13pm of September +# 11 in summer time will equal to 0am of September 12 in standard time. +# It cited a document issued by the Liaison Office which briefly existed +# during the postwar period of Japan, where the detail on implementation +# of the summer time is described in the document. +# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EFB2C6BBFEB9EFA4CEBCC2BBDCA4CBA4C4A4A4A4C6.pdf +# The text in the document do instruct a fall back to occur at +# September 11, 13pm in summer time, while ordinary citizens can +# change the clock before they sleep. +# +# From Paul Eggert (2018-09-27): +# This instruction is equivalent to "Sat>=8 25:00", so use that. zic treats +# it like "Sun>=9 01:00", which is not quite the same but is the best we can +# do in any POSIX or C platform. The "25:00" assumes zic from 2007 or later, +# which should be safe now. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Japan 1948 only - May Sat>=1 24:00 1:00 D -Rule Japan 1948 1951 - Sep Sun>=9 0:00 0 S +Rule Japan 1948 1951 - Sep Sun>=9 1:00 0 S Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D @@ -1878,7 +2058,7 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 5:00 - +05 # Mangghystaū (KZ-MAN) # Aqtau was not founded until 1963, but it represents an inhabited region, -# so include time stamps before 1963. +# so include timestamps before 1963. Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Oct 1 @@ -2018,6 +2198,10 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # Assembly, as published in Rodong Sinmun. # From Tim Parenti (2018-04-29): # It appears to be the front page story at the top in the right-most column. +# +# From Paul Eggert (2018-05-04): +# The BBC reported that the transition was from 23:30 to 24:00 today. +# https://www.bbc.com/news/world-asia-44010705 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -2030,7 +2214,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 8:30 - KST 1912 Jan 1 9:00 - JST 1945 Aug 24 9:00 - KST 2015 Aug 15 00:00 - 8:30 - KST 2018 May 5 + 8:30 - KST 2018 May 4 23:30 9:00 - KST ############################################################################### @@ -2780,19 +2964,35 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # Philippine Star 2014-08-05 # http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time +# From Paul Goyette (2018-06-15): +# In the Philippines, there is a national law, Republic Act No. 10535 +# which declares the official time here as "Philippine Standard Time". +# The act [1] even specifies use of PST as the abbreviation, although +# the FAQ provided by PAGASA [2] uses the "acronym PhST to distinguish +# it from the Pacific Standard Time (PST)." +# [1] http://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/ +# [2] https://www1.pagasa.dost.gov.ph/index.php/astronomy/philippine-standard-time#republic-act-10535 +# +# From Paul Eggert (2018-06-19): +# I surveyed recent news reports, and my impression is that "PST" is +# more popular among reliable English-language news sources. This is +# not just a measure of Google hit counts: it's also the sizes and +# influence of the sources. There is no current abbreviation for DST, +# so use "PDT", the usual American style. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 - -Rule Phil 1937 only - Feb 1 0:00 0 - -Rule Phil 1954 only - Apr 12 0:00 1:00 - -Rule Phil 1954 only - Jul 1 0:00 0 - -Rule Phil 1978 only - Mar 22 0:00 1:00 - -Rule Phil 1978 only - Sep 21 0:00 0 - +Rule Phil 1936 only - Nov 1 0:00 1:00 D +Rule Phil 1937 only - Feb 1 0:00 0 S +Rule Phil 1954 only - Apr 12 0:00 1:00 D +Rule Phil 1954 only - Jul 1 0:00 0 S +Rule Phil 1978 only - Mar 22 0:00 1:00 D +Rule Phil 1978 only - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 8:04:00 - LMT 1899 May 11 - 8:00 Phil +08/+09 1942 May - 9:00 - +09 1944 Nov - 8:00 Phil +08/+09 + 8:00 Phil P%sT 1942 May + 9:00 - JST 1944 Nov + 8:00 Phil P%sT # Qatar # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -2803,15 +3003,34 @@ Link Asia/Qatar Asia/Bahrain # Saudi Arabia # -# From Paul Eggert (2014-07-15): +# From Paul Eggert (2018-08-29): # Time in Saudi Arabia and other countries in the Arabian peninsula was not -# standardized until relatively recently; we don't know when, and possibly it +# standardized until 1968 or so; we don't know exactly when, and possibly it # has never been made official. Richard P Hunt, in "Islam city yielding to # modern times", New York Times (1961-04-09), p 20, wrote that only airlines # observed standard time, and that people in Jeddah mostly observed quasi-solar # time, doing so by setting their watches at sunrise to 6 o'clock (or to 12 # o'clock for "Arab" time). # +# Timekeeping differed depending on who you were and which part of Saudi +# Arabia you were in. In 1969, Elias Antar wrote that although a common +# practice had been to set one's watch to 12:00 (i.e., midnight) at sunset - +# which meant that the time on one side of a mountain could differ greatly from +# the time on the other side - many foreigners set their watches to 6pm +# instead, while airlines instead used UTC +03 (except in Dhahran, where they +# used UTC +04), Aramco used UTC +03 with DST, and the Trans-Arabian Pipe Line +# Company used Aramco time in eastern Saudi Arabia and airline time in western. +# (The American Military Aid Advisory Group used plain UTC.) Antar writes, +# "A man named Higgins, so the story goes, used to run a local power +# station. One day, the whole thing became too much for Higgins and he +# assembled his staff and laid down the law. 'I've had enough of this,' he +# shrieked. 'It is now 12 o'clock Higgins Time, and from now on this station is +# going to run on Higgins Time.' And so, until last year, it did." See: +# Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. +# http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm +# newspapers.com says a similar story about Higgins was published in the Port +# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics # Board (OCLC 42299995) reported that the "... Arabian Government, inaugurated @@ -2821,7 +3040,8 @@ Link Asia/Qatar Asia/Bahrain # # Shanks & Pottenger also state that until 1968-05-01 Saudi Arabia had two # time zones; the other zone, at UT +04, was in the far eastern part of -# the country. Ignore this, as it's before our 1970 cutoff. +# the country. Presumably this is documenting airline time. Ignore this, +# as it's before our 1970 cutoff. # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 diff --git a/make/data/tzdata/australasia b/make/data/tzdata/australasia index 2c60fd32e5c..82e88c51e91 100644 --- a/make/data/tzdata/australasia +++ b/make/data/tzdata/australasia @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Australasia and environs, and for much of the Pacific + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -384,8 +386,15 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing # Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27), # [Legal Notice No. 41] of an order of the previous day by J Usamate. + +# From Raymond Kumar (2018-07-13): +# http://www.fijitimes.com/government-approves-2018-daylight-saving/ +# ... The daylight saving period will end at 3am on Sunday January 13, 2019. +# +# From Paul Eggert (2018-07-15): # For now, guess DST from 02:00 the first Sunday in November to 03:00 -# the first Sunday on or after January 14. Although ad hoc, it matches +# the first Sunday on or after January 13. January transitions reportedly +# depend on when school terms start. Although the guess is ad hoc, it matches # transitions since late 2014 and seems more likely to match future # practice than guessing no DST. @@ -399,7 +408,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 - -Rule Fiji 2015 max - Jan Sun>=14 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=13 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 diff --git a/make/data/tzdata/backward b/make/data/tzdata/backward index fca4ed18816..f30f30e511b 100644 --- a/make/data/tzdata/backward +++ b/make/data/tzdata/backward @@ -21,10 +21,12 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb links for backward compatibility + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This file provides links between current names for time zones +# This file provides links between current names for timezones # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME diff --git a/make/data/tzdata/etcetera b/make/data/tzdata/etcetera index ec31f1b3b4e..db5937879e0 100644 --- a/make/data/tzdata/etcetera +++ b/make/data/tzdata/etcetera @@ -21,12 +21,14 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for ships at sea and other miscellany + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # These entries are mostly present for historical reasons, so that # people in areas not otherwise covered by the tz files could "zic -l" -# to a time zone that was right for their area. These days, the +# to a timezone that was right for their area. These days, the # tz files cover almost all the inhabited world, and the only practical # need now for the entries that are not on UTC are for ships at sea # that cannot use POSIX TZ settings. diff --git a/make/data/tzdata/europe b/make/data/tzdata/europe index 99109ecd0fc..e434b7e9fc4 100644 --- a/make/data/tzdata/europe +++ b/make/data/tzdata/europe @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Europe and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -540,7 +542,7 @@ Link Europe/London Europe/Isle_of_Man # # To work around this problem, the build procedure can translate the # following data into two forms, one with negative SAVE values and the -# other form with a traditional approximation for Irish time stamps +# other form with a traditional approximation for Irish timestamps # after 1971-10-31 02:00 UTC; although this approximation has tm_isdst # flags that are reversed, its UTC offsets are correct and this often # suffices. This source file currently uses only nonnegative SAVE @@ -2450,6 +2452,33 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # administratively part of Sakhalin oblast', they appear to have # remained on UTC+11 along with Magadan. +# From Marat Nigametzianov (2018-07-16): +# this is link to order from 1956 about timezone in USSR +# http://astro.uni-altai.ru/~orion/blog/2011/11/novyie-granitsyi-chasovyih-poyasov-v-sssr/ +# +# From Paul Eggert (2018-07-16): +# Perhaps someone could translate the above-mentioned link and use it +# to correct our data for the ex-Soviet Union. It cites the following: +# «Поясное время и новые границы часовых поясов» / сост. П.Н. Долгов, +# отв. ред. Г.Д. Бурдун - М: Комитет стандартов, мер и измерительных +# приборов при Совете Министров СССР, Междуведомственная комиссия +# единой службы времени, 1956 г. +# This book looks like it would be a helpful resource for the Soviet +# Union through 1956. Although a copy was in the Scientific Library +# of Tomsk State University, I have not been able to track down a copy nearby. +# +# From Stepan Golosunov (2018-07-21): +# http://astro.uni-altai.ru/~orion/blog/2015/05/center-reforma-ischisleniya-vremeni-br-na-territorii-sssr-v-1957-godu-center/ +# says that the 1956 decision to change time belts' borders was not +# implemented as planned in 1956 and the change happened in 1957. +# There is also the problem that actual time zones were different from +# the official time belts (and from many time belts' maps) as there were +# numerous exceptions to application of time belt rules. For example, +# https://ru.wikipedia.org/wiki/Московское_время#Перемещение_границы_применения_московского_времени_на_восток +# says that by 1962 there were many regions in the 3rd time belt that +# were on Moscow time, referring to a 1962 map. By 1989 number of such +# exceptions grew considerably. + # From Tim Parenti (2014-07-06): # The comments detailing the coverage of each Russian zone are meant to assist # with maintenance only and represent our best guesses as to which regions @@ -2460,9 +2489,6 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # future stability. ISO 3166-2:RU codes are also listed for first-level # divisions where available. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] - - # From Tim Parenti (2014-07-03): # Europe/Kaliningrad covers... # 39 RU-KGD Kaliningrad Oblast @@ -2730,6 +2756,15 @@ Zone Europe/Astrakhan 3:12:12 - LMT 1924 May # 34 RU-VGG Volgograd Oblast # The 1988 transition is from USSR act No. 5 (1988-01-04). +# From Alexander Fetisov (2018-09-20): +# Volgograd region in southern Russia (Europe/Volgograd) change +# timezone from UTC+3 to UTC+4 from 28oct2018. +# http://sozd.parliament.gov.ru/bill/452878-7 +# +# From Stepan Golosunov (2018-10-11): +# The law has been published today on +# http://publication.pravo.gov.ru/Document/View/0001201810110037 + Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 3:00 - +03 1930 Jun 21 4:00 - +04 1961 Nov 11 @@ -2738,7 +2773,8 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 4:00 - +04 1992 Mar 29 2:00s 3:00 Russia +03/+04 2011 Mar 27 2:00s 4:00 - +04 2014 Oct 26 2:00s - 3:00 - +03 + 3:00 - +03 2018 Oct 28 2:00s + 4:00 - +04 # From Paul Eggert (2016-11-11): # Europe/Saratov covers: @@ -3427,7 +3463,8 @@ Rule Spain 1978 only - Oct 1 2:00s 0 - #Rule NatSpain 1937 only - May 22 23:00 1:00 S #Rule NatSpain 1937 1938 - Oct Sat>=1 24:00s 0 - #Rule NatSpain 1938 only - Mar 26 23:00 1:00 S -# The following rules are copied from Morocco from 1967 through 1978. +# The following rules are copied from Morocco from 1967 through 1978, +# except with "S" letters. Rule SpainAfrica 1967 only - Jun 3 12:00 1:00 S Rule SpainAfrica 1967 only - Oct 1 0:00 0 - Rule SpainAfrica 1974 only - Jun 24 0:00 1:00 S @@ -3447,6 +3484,7 @@ Zone Africa/Ceuta -0:21:16 - LMT 1900 Dec 31 23:38:44 0:00 1:00 WEST 1918 Oct 7 23:00 0:00 - WET 1924 0:00 Spain WE%sT 1929 + 0:00 - WET 1967 # Help zishrink.awk. 0:00 SpainAfrica WE%sT 1984 Mar 16 1:00 - CET 1986 1:00 EU CE%sT @@ -3632,7 +3670,7 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. # http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001 # http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006 # From Paul Eggert (2016-09-25): -# Prefer the above sources to Shanks & Pottenger for time stamps after 1985. +# Prefer the above sources to Shanks & Pottenger for timestamps after 1985. # From Steffen Thorsen (2007-03-09): # Starting 2007 though, it seems that they are adopting EU's 1:00 UTC @@ -3842,10 +3880,29 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. # * Ukrainian Government's Resolution of 20.03.1992, No. 139. # http://www.uazakon.com/documents/date_8u/pg_grcasa.htm +# From Paul Eggert (2018-10-03): +# As is usual in tzdb, Ukrainian zones use the most common English spellings. +# For example, tzdb uses Europe/Kiev, as "Kiev" is the most common spelling in +# English for Ukraine's capital, even though it is certainly wrong as a +# transliteration of the Ukrainian "Київ". This is similar to tzdb's use of +# Europe/Prague, which is certainly wrong as a transliteration of the Czech +# "Praha". ("Kiev" came from old Slavic via Russian to English, and "Prague" +# came from old Slavic via French to English, so the two cases have something +# in common.) Admittedly English-language spelling of Ukrainian names is +# controversial, and some day "Kyiv" may become substantially more popular in +# English; in the meantime, stick with the traditional English "Kiev" as that +# means less disruption for our users. +# +# Anyway, none of the common English-language spellings (Kiev, Kyiv, Kieff, +# Kijeff, Kijev, Kiyef, Kiyeff) do justice to the common pronunciation in +# Ukrainian, namely [ˈkɪjiu̯] (IPA). This pronunciation has nothing like an +# English "v" or "f", and instead trails off with what an English-speaker +# would call a demure "oo" sound, and it would would be better anglicized as +# "Kuiyu". Here's a sound file, if you would like to do as the Kuiyuvians do: +# https://commons.wikimedia.org/wiki/File:Uk-Київ.ogg + # Zone NAME GMTOFF RULES FORMAT [UNTIL] -# Most of Ukraine since 1970 has been like Kiev. -# "Kyiv" is the transliteration of the Ukrainian name, but -# "Kiev" is more common in English. +# This represents most of Ukraine. See above for the spelling of "Kiev". Zone Europe/Kiev 2:02:04 - LMT 1880 2:02:04 - KMT 1924 May 2 # Kiev Mean Time 2:00 - EET 1930 Jun 21 diff --git a/make/data/tzdata/factory b/make/data/tzdata/factory index 7d7969329db..6ef6bca0b8c 100644 --- a/make/data/tzdata/factory +++ b/make/data/tzdata/factory @@ -21,11 +21,13 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for noncommittal factory settings + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# For distributors who don't want to put time zone specification in -# their installation procedures. Users that run 'date' will get the +# For distributors who don't want to specify a timezone in their +# installation procedures. Users who run 'date' will get the # time zone abbreviation "-00", indicating that the actual time zone # is unknown. diff --git a/make/data/tzdata/leapseconds b/make/data/tzdata/leapseconds index cc5d9288987..8b539e6ef4b 100644 --- a/make/data/tzdata/leapseconds +++ b/make/data/tzdata/leapseconds @@ -26,21 +26,25 @@ # This file is in the public domain. # This file is generated automatically from the data in the public-domain -# leap-seconds.list file, which is copied from: -# ftp://ftp.nist.gov/pub/time/leap-seconds.list +# leap-seconds.list file, which can be copied from +# +# or +# or . # For more about leap-seconds.list, please see # The NTP Timescale and Leap Seconds -# https://www.eecis.udel.edu/~mills/leap.html +# . # The International Earth Rotation and Reference Systems Service # periodically uses leap seconds to keep UTC to within 0.9 s of UT1 -# (which measures the true angular orientation of the earth in space); see -# Levine J. Coordinated Universal Time and the leap second. +# (which measures the true angular orientation of the earth in space) +# and publishes leap second data in a copyrighted file +# . +# See: Levine J. Coordinated Universal Time and the leap second. # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995 -# http://ieeexplore.ieee.org/document/7909995/ +# . # There were no leap seconds before 1972, because the official mechanism # accounting for the discrepancy between atomic time and the earth's rotation -# did not exist until the early 1970s. +# did not exist. # The correction (+ or -) is made at the given time, so lines # will typically look like: @@ -48,10 +52,7 @@ # or # Leap YEAR MON DAY 23:59:59 - R/S -# If the leapsecond is Rolling (R) the given time is local time. -# If the leapsecond is Stationary (S) the given time is UTC. - -# Leap YEAR MONTH DAY HH:MM:SS CORR R/S +# If the leap second is Rolling (R) the given time is local time (unused here). Leap 1972 Jun 30 23:59:60 + S Leap 1972 Dec 31 23:59:60 + S Leap 1973 Dec 31 23:59:60 + S @@ -80,5 +81,9 @@ Leap 2012 Jun 30 23:59:60 + S Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S -# Updated through IERS Bulletin C55 -# File expires on: 28 December 2018 +# POSIX timestamps for the data in this file: +#updated 1467936000 +#expires 1561680000 + +# Updated through IERS Bulletin C56 +# File expires on: 28 June 2019 diff --git a/make/data/tzdata/northamerica b/make/data/tzdata/northamerica index bcfb662154f..297a10a3849 100644 --- a/make/data/tzdata/northamerica +++ b/make/data/tzdata/northamerica @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for North and Central America and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -71,7 +73,7 @@ # # Most of the US soon followed suit. See: # Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56. -# http://dx.doi.org/10.2307/3105430 +# https://dx.doi.org/10.2307/3105430 # From Paul Eggert (2005-04-16): # That 1883 transition occurred at 12:00 new time, not at 12:00 old time. @@ -460,6 +462,19 @@ Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53 # western South Dakota, far western Texas (El Paso County, Hudspeth County, # and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming # +# From Paul Eggert (2018-10-25): +# On 1921-03-04 federal law placed all of Texas into the central time zone. +# However, El Paso ignored the law for decades and continued to observe +# mountain time, on the grounds that that's what they had always done +# and they weren't about to let the federal government tell them what to do. +# Eventually the federal government gave in and changed the law on +# 1970-04-10 to match what El Paso was actually doing. Although +# that's slightly after our 1970 cutoff, there is no need to create a +# separate zone for El Paso since they were ignoring the law anyway. See: +# Long T. El Pasoans were time rebels, fought to stay in Mountain zone. +# El Paso Times. 2018-10-24 06:40 -06. +# https://www.elpasotimes.com/story/news/local/el-paso/2018/10/24/el-pasoans-were-time-rebels-fought-stay-mountain-zone/1744509002/ +# # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Denver 1920 1921 - Mar lastSun 2:00 1:00 D Rule Denver 1920 only - Oct lastSun 2:00 0 S @@ -729,9 +744,7 @@ Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35 Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 -10:30 - HST 1933 Apr 30 2:00 -10:30 1:00 HDT 1933 May 21 12:00 - -10:30 - HST 1942 Feb 9 2:00 - -10:30 1:00 HDT 1945 Sep 30 2:00 - -10:30 - HST 1947 Jun 8 2:00 + -10:30 US H%sT 1947 Jun 8 2:00 -10:00 - HST # Now we turn to US areas that have diverged from the consensus since 1970. diff --git a/make/data/tzdata/pacificnew b/make/data/tzdata/pacificnew index 9b9257a45fe..020b599bf00 100644 --- a/make/data/tzdata/pacificnew +++ b/make/data/tzdata/pacificnew @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for proposed US election time (this file is obsolete) + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. diff --git a/make/data/tzdata/southamerica b/make/data/tzdata/southamerica index 65d3c9fcef2..3f016479a75 100644 --- a/make/data/tzdata/southamerica +++ b/make/data/tzdata/southamerica @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for South America and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -415,7 +417,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 - # standard time, so let's do that here too. This does not change UTC # offsets, only tm_isdst and the time zone abbreviations. One minor # plus is that this silences a zic complaint that there's no POSIX TZ -# setting for time stamps past 2038. +# setting for timestamps past 2038. # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -948,6 +950,14 @@ Rule Brazil 2016 2022 - Feb Sun>=15 0:00 0 - # ... https://www.timeanddate.com/news/time/brazil-delays-dst-2018.html # From Steffen Thorsen (2017-12-20): # http://www.planalto.gov.br/ccivil_03/_ato2015-2018/2017/decreto/D9242.htm +# +# From Fábio Gomes (2018-10-04): +# The Brazilian president just announced a new change on this year DST. +# It was scheduled to start on November 4th and it was changed to November 18th. +# From Rodrigo Brüning Wessler (2018-10-15): +# The Brazilian government just announced that the change in DST was +# canceled.... Maybe the president Michel Temer also woke up one hour +# earlier today. :) Rule Brazil 2018 max - Nov Sun>=1 0:00 1:00 - Rule Brazil 2023 only - Feb Sun>=22 0:00 0 - Rule Brazil 2024 2025 - Feb Sun>=15 0:00 0 - @@ -1254,6 +1264,24 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # they will switch from -03 to -04 one hour after Santiago does that day. # For now, assume that they will not revert. +# From Juan Correa (2018-08-13): +# As of moments ago, the Ministry of Energy in Chile has announced the new +# schema for DST. ... Announcement in video (in Spanish): +# https://twitter.com/MinEnergia/status/1029000399129374720 +# From Yonathan Dossow (2018-08-13): +# The video says "first Saturday of September", we all know it means Sunday at +# midnight. +# From Tim Parenti (2018-08-13): +# Translating the captions on the video at 0:44-0:55, "We want to announce as +# Government that from 2019, Winter Time will be increased to 5 months, between +# the first Saturday of April and the first Saturday of September." +# At 2:08-2:20, "The Magallanes region will maintain its current time, as +# decided by the citizens during 2017, but our Government will promote a +# regional dialogue table to gather their opinion on this matter." +# https://twitter.com/MinEnergia/status/1029009354001973248 +# "We will keep the new time policy unchanged for at least the next 4 years." +# So we extend the new rules on Saturdays at 24:00 mainland time indefinitely. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Chile 1927 1931 - Sep 1 0:00 1:00 - Rule Chile 1928 1932 - Apr 1 0:00 0 - @@ -1287,8 +1315,10 @@ Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 - Rule Chile 2012 2014 - Apr Sun>=23 3:00u 0 - Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 - -Rule Chile 2016 max - May Sun>=9 3:00u 0 - -Rule Chile 2016 max - Aug Sun>=9 4:00u 1:00 - +Rule Chile 2016 2018 - May Sun>=9 3:00u 0 - +Rule Chile 2016 2018 - Aug Sun>=9 4:00u 1:00 - +Rule Chile 2019 max - Apr Sun>=2 3:00u 0 - +Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 - # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] diff --git a/make/data/tzdata/systemv b/make/data/tzdata/systemv index c7b9a888e88..63a48e8c3e0 100644 --- a/make/data/tzdata/systemv +++ b/make/data/tzdata/systemv @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for System V rules (this file is obsolete) + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. diff --git a/make/data/tzdata/zone.tab b/make/data/tzdata/zone.tab index 873737e06b8..2a985868d28 100644 --- a/make/data/tzdata/zone.tab +++ b/make/data/tzdata/zone.tab @@ -21,12 +21,12 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -# tz zone descriptions (deprecated version) +# tzdb timezone descriptions (deprecated version) # # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # -# From Paul Eggert (2014-07-31): +# From Paul Eggert (2018-06-27): # This file is intended as a backward-compatibility aid for older programs. # New programs should use zone1970.tab. This file is like zone1970.tab (see # zone1970.tab's comments), but with the following additional restrictions: @@ -35,13 +35,13 @@ # 2. The first data column contains exactly one country code. # # Because of (2), each row stands for an area that is the intersection -# of a region identified by a country code and of a zone where civil +# of a region identified by a country code and of a timezone where civil # clocks have agreed since 1970; this is a narrower definition than # that of zone1970.tab. # -# This table is intended as an aid for users, to help them select time -# zone data entries appropriate for their practical needs. It is not -# intended to take or endorse any position on legal or territorial claims. +# This table is intended as an aid for users, to help them select timezones +# appropriate for their practical needs. It is not intended to take or +# endorse any position on legal or territorial claims. # #country- #code coordinates TZ comments @@ -291,7 +291,7 @@ MM +1647+09610 Asia/Yangon MN +4755+10653 Asia/Ulaanbaatar Mongolia (most areas) MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar -MO +2214+11335 Asia/Macau +MO +221150+1133230 Asia/Macau MP +1512+14545 Pacific/Saipan MQ +1436-06105 America/Martinique MR +1806-01557 Africa/Nouakchott diff --git a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java index d3bc0cb1d5b..4ecee24297a 100644 --- a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java +++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java @@ -674,9 +674,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { "Magadan Summer Time", "MAGST", "Magadan Time", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Philippines Time", "PHT", - "Philippines Summer Time", "PHST", - "Philippines Time", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java index e73e37d363e..ea3b39c357d 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Magadanische Sommerzeit", "MAGST", "Magadanische Zeit", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Philippinische Zeit", "PHT", - "Philippinische Sommerzeit", "PHST", - "Philippinische Zeit", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java index 2f9b16c91c6..222a6c472e4 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { "Hora de verano de Magad\u00e1n", "MAGST", "Hora de Magad\u00E1n", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Hora de Filipinas", "PHT", - "Hora de verano de Filipinas", "PHST", - "Hora de Filipinas", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java index f9a59c73513..81f328e5e99 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { "Heure d'\u00e9t\u00e9 de Magadan", "MAGST", "Heure de Magadan", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Heure des Philippines", "PHT", - "Heure d'\u00e9t\u00e9 des Philippines", "PHST", - "Heure des Philippines", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java index ca223137aa9..af93a43ae50 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { "Ora estiva di Magadan", "MAGST", "Ora di Magadan", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Ora delle Filippine", "PHT", - "Ora estiva delle Filippine", "PHST", - "Ora delle Filippine", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java index 591c3b2b57d..65928b247d4 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { "\u30de\u30ac\u30c0\u30f3\u590f\u6642\u9593", "MAGST", "\u30DE\u30AC\u30C0\u30F3\u6642\u9593", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"\u30d5\u30a3\u30ea\u30d4\u30f3\u6642\u9593", "PHT", - "\u30d5\u30a3\u30ea\u30d4\u30f3\u590f\u6642\u9593", "PHST", - "\u30D5\u30A3\u30EA\u30D4\u30F3\u6642\u9593", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java index 3ace60dccf0..0d75d57fcd0 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { "\ub9c8\uac00\ub2e8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MAGST", "\uB9C8\uAC00\uB2E8 \uD45C\uC900\uC2DC", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"\ud544\ub9ac\ud540 \uc2dc\uac04", "PHT", - "\ud544\ub9ac\ud540 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PHST", - "\uD544\uB9AC\uD540 \uD45C\uC900\uC2DC", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java index 11ec3f9cf03..b6401a59725 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { "Fuso hor\u00e1rio de ver\u00e3o de Magadan", "MAGST", "Hor\u00E1rio de Magadan", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Fuso hor\u00e1rio das Filipinas", "PHT", - "Fuso hor\u00e1rio de ver\u00e3o das Filipinas", "PHST", - "Hor\u00E1rio das Filipinas", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java index cd93be37c1b..cc9ce084eac 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Magadan, sommartid", "MAGST", "Magadan-tid", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"Filippinerna, normaltid", "PHT", - "Filippinerna, sommartid", "PHST", - "Filippinsk tid", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java index 36f5db8f067..33f58ab420e 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { "Magadan \u590f\u4ee4\u65f6", "MAGST", "Magadan \u65F6\u95F4", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"\u83f2\u5f8b\u5bbe\u65f6\u95f4", "PHT", - "\u83f2\u5f8b\u5bbe\u590f\u4ee4\u65f6", "PHST", - "\u83F2\u5F8B\u5BBE\u65F6\u95F4", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java index adf456d3c48..8c93c553675 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java @@ -667,9 +667,9 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { "Magadan \u590f\u4ee4\u6642\u9593", "MAGST", "\u99AC\u52A0\u4E39\u6642\u9593", "MAGT"}}, {"Asia/Makassar", CIT}, - {"Asia/Manila", new String[] {"\u83f2\u5f8b\u8cd3\u6642\u9593", "PHT", - "\u83f2\u5f8b\u8cd3\u590f\u4ee4\u6642\u9593", "PHST", - "\u83F2\u5F8B\u8CD3\u6642\u9593", "PHT"}}, + {"Asia/Manila", new String[] {"Philippines Standard Time", "PST", + "Philippines Daylight Time", "PDT", + "Philippines Time", "PT"}}, {"Asia/Muscat", GST}, {"Asia/Nicosia", EET}, {"Asia/Novokuznetsk", KRAT}, diff --git a/test/jdk/sun/util/calendar/zi/tzdata/VERSION b/test/jdk/sun/util/calendar/zi/tzdata/VERSION index 22002be51d6..e3fa9222bcf 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/VERSION +++ b/test/jdk/sun/util/calendar/zi/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2018e +tzdata2018g diff --git a/test/jdk/sun/util/calendar/zi/tzdata/africa b/test/jdk/sun/util/calendar/zi/tzdata/africa index 1c305f8b8e7..e2ffac25ec1 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/africa +++ b/test/jdk/sun/util/calendar/zi/tzdata/africa @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Africa and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -29,7 +31,7 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-04-09): +# From Paul Eggert (2018-05-27): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -74,13 +76,15 @@ # I vaguely recall 'WAT' also being used for -01 in the past but # cannot now come up with solid citations. # -# I invented the following abbreviations; corrections are welcome! -# +02 WAST West Africa Summer Time (no longer used) -# +03 CAST Central Africa Summer Time (no longer used) -# +03 SAST South Africa Summer Time (no longer used) +# I invented the following abbreviations in the 1990s: +# +02 WAST West Africa Summer Time +# +03 CAST Central Africa Summer Time +# +03 SAST South Africa Summer Time # +03 EAT East Africa Time -# 'EAT' also seems to have caught on; the others are rare but are paired -# with better-attested non-DST abbreviations. +# 'EAT' seems to have caught on and is in current timestamps, and though +# the other abbreviations are rarer and are only in past timestamps, +# they are paired with better-attested non-DST abbreviations. +# Corrections are welcome. # Algeria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -385,6 +389,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # Eritrea # Ethiopia # See Africa/Nairobi. +# +# Unfortunately tzdb records only Western clock time in use in Ethiopia, +# as the tzdb format is not up to properly recording a common Ethiopian +# timekeeping practice that is based on solar time. See: +# Mortada D. If you have a meeting in Ethiopia, you'd better double +# check the time. PRI's The World. 2015-01-30 15:15 -05. +# https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time # Gabon # See Africa/Lagos. @@ -856,94 +867,61 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # agrees # with the patch. -# From Paul Eggert (2015-06-08): -# For now, guess that later spring and fall transitions will use 2015's rules, -# and guess that Morocco will switch to standard time at 03:00 the last -# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after -# Ramadan. To implement this, transition dates for 2016 through 2037 were -# determined by running the following program under GNU Emacs 24.3, with the -# results integrated by hand into the table below. -# (let ((islamic-year 1437)) -# (require 'cal-islam) -# (while (< islamic-year 1460) -# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) -# (sunday 0)) -# (while (/= sunday (mod (setq a (1- a)) 7))) -# (while (/= sunday (mod b 7)) -# (setq b (1+ b))) -# (setq a (calendar-gregorian-from-absolute a)) -# (setq b (calendar-gregorian-from-absolute b)) -# (insert -# (format -# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n" -# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) -# (setq islamic-year (+ 1 islamic-year)))) +# From Mohamed Essedik Najd (2018-10-26): +# Today, a Moroccan government council approved the perpetual addition +# of 60 minutes to the regular Moroccan timezone. +# From Brian Inglis (2018-10-26): +# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S - -Rule Morocco 1939 only - Sep 12 0:00 1:00 S +Rule Morocco 1939 only - Sep 12 0:00 1:00 - Rule Morocco 1939 only - Nov 19 0:00 0 - -Rule Morocco 1940 only - Feb 25 0:00 1:00 S +Rule Morocco 1940 only - Feb 25 0:00 1:00 - Rule Morocco 1945 only - Nov 18 0:00 0 - -Rule Morocco 1950 only - Jun 11 0:00 1:00 S +Rule Morocco 1950 only - Jun 11 0:00 1:00 - Rule Morocco 1950 only - Oct 29 0:00 0 - -Rule Morocco 1967 only - Jun 3 12:00 1:00 S +Rule Morocco 1967 only - Jun 3 12:00 1:00 - Rule Morocco 1967 only - Oct 1 0:00 0 - -Rule Morocco 1974 only - Jun 24 0:00 1:00 S +Rule Morocco 1974 only - Jun 24 0:00 1:00 - Rule Morocco 1974 only - Sep 1 0:00 0 - -Rule Morocco 1976 1977 - May 1 0:00 1:00 S +Rule Morocco 1976 1977 - May 1 0:00 1:00 - Rule Morocco 1976 only - Aug 1 0:00 0 - Rule Morocco 1977 only - Sep 28 0:00 0 - -Rule Morocco 1978 only - Jun 1 0:00 1:00 S +Rule Morocco 1978 only - Jun 1 0:00 1:00 - Rule Morocco 1978 only - Aug 4 0:00 0 - -Rule Morocco 2008 only - Jun 1 0:00 1:00 S +Rule Morocco 2008 only - Jun 1 0:00 1:00 - Rule Morocco 2008 only - Sep 1 0:00 0 - -Rule Morocco 2009 only - Jun 1 0:00 1:00 S +Rule Morocco 2009 only - Jun 1 0:00 1:00 - Rule Morocco 2009 only - Aug 21 0:00 0 - -Rule Morocco 2010 only - May 2 0:00 1:00 S +Rule Morocco 2010 only - May 2 0:00 1:00 - Rule Morocco 2010 only - Aug 8 0:00 0 - -Rule Morocco 2011 only - Apr 3 0:00 1:00 S +Rule Morocco 2011 only - Apr 3 0:00 1:00 - Rule Morocco 2011 only - Jul 31 0:00 0 - -Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 - Rule Morocco 2012 only - Jul 20 3:00 0 - -Rule Morocco 2012 only - Aug 20 2:00 1:00 S +Rule Morocco 2012 only - Aug 20 2:00 1:00 - Rule Morocco 2012 only - Sep 30 3:00 0 - Rule Morocco 2013 only - Jul 7 3:00 0 - -Rule Morocco 2013 only - Aug 10 2:00 1:00 S -Rule Morocco 2013 max - Oct lastSun 3:00 0 - -Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S +Rule Morocco 2013 only - Aug 10 2:00 1:00 - +Rule Morocco 2013 2018 - Oct lastSun 3:00 0 - +Rule Morocco 2014 2018 - Mar lastSun 2:00 1:00 - Rule Morocco 2014 only - Jun 28 3:00 0 - -Rule Morocco 2014 only - Aug 2 2:00 1:00 S +Rule Morocco 2014 only - Aug 2 2:00 1:00 - Rule Morocco 2015 only - Jun 14 3:00 0 - -Rule Morocco 2015 only - Jul 19 2:00 1:00 S +Rule Morocco 2015 only - Jul 19 2:00 1:00 - Rule Morocco 2016 only - Jun 5 3:00 0 - -Rule Morocco 2016 only - Jul 10 2:00 1:00 S +Rule Morocco 2016 only - Jul 10 2:00 1:00 - Rule Morocco 2017 only - May 21 3:00 0 - -Rule Morocco 2017 only - Jul 2 2:00 1:00 S +Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - -Rule Morocco 2018 only - Jun 17 2:00 1:00 S -Rule Morocco 2019 only - May 5 3:00 0 - -Rule Morocco 2019 only - Jun 9 2:00 1:00 S -Rule Morocco 2020 only - Apr 19 3:00 0 - -Rule Morocco 2020 only - May 24 2:00 1:00 S -Rule Morocco 2021 only - Apr 11 3:00 0 - -Rule Morocco 2021 only - May 16 2:00 1:00 S -Rule Morocco 2022 only - May 8 2:00 1:00 S -Rule Morocco 2023 only - Apr 23 2:00 1:00 S -Rule Morocco 2024 only - Apr 14 2:00 1:00 S -Rule Morocco 2025 only - Apr 6 2:00 1:00 S -Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S -Rule Morocco 2036 only - Oct 19 3:00 0 - -Rule Morocco 2037 only - Oct 4 3:00 0 - +Rule Morocco 2018 only - Jun 17 2:00 1:00 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 - 0:00 Morocco WE%sT 1984 Mar 16 - 1:00 - CET 1986 - 0:00 Morocco WE%sT + 0:00 Morocco +00/+01 1984 Mar 16 + 1:00 - +01 1986 + 0:00 Morocco +00/+01 2018 Oct 27 + 1:00 - +01 # Western Sahara # @@ -958,7 +936,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco WE%sT + 0:00 Morocco +00/+01 2018 Oct 27 + 1:00 - +01 # Mozambique # diff --git a/test/jdk/sun/util/calendar/zi/tzdata/antarctica b/test/jdk/sun/util/calendar/zi/tzdata/antarctica index 74ce2dcef51..d98afed9b85 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/antarctica +++ b/test/jdk/sun/util/calendar/zi/tzdata/antarctica @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Antarctica and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/asia b/test/jdk/sun/util/calendar/zi/tzdata/asia index 877f53d0994..57255f2b6b8 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/asia +++ b/test/jdk/sun/util/calendar/zi/tzdata/asia @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Asia and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -29,7 +31,7 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-01-13): +# From Paul Eggert (2018-06-19): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -58,7 +60,8 @@ # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # -# The following alphabetic abbreviations appear in these tables: +# The following alphabetic abbreviations appear in these tables +# (corrections are welcome): # std dst # LMT Local Mean Time # 2:00 EET EEST Eastern European Time @@ -67,11 +70,13 @@ # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 PST PDT* Philippine Standard Time # 8:30 KST KDT Korea when at +0830 # 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea when at +09 # 9:30 ACST Australian Central Standard Time +# *I invented the abbreviation PDT; see "Philippines" below. # Otherwise, these tables typically use numeric abbreviations like +03 # and +0330 for integer hour and minute UT offsets. Although earlier # editions invented alphabetic time zone abbreviations for every @@ -304,6 +309,29 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon # China +# From Paul Eggert (2018-10-02): +# The following comes from Table 1 of: +# Li Yu. Research on the daylight saving movement in 1940s Shanghai. +# Nanjing Journal of Social Sciences. 2014;(2):144-50. +# http://oversea.cnki.net/kns55/detail.aspx?dbname=CJFD2014&filename=NJSH201402020 +# The table lists dates only; I am guessing 00:00 and 24:00 transition times. +# Also, the table lists the planned end of DST in 1949, but the corresponding +# zone line cuts this off on May 28, when the Communists took power. +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Shang 1940 only - Jun 1 0:00 1:00 D +Rule Shang 1940 only - Oct 12 24:00 0 S +Rule Shang 1941 only - Mar 15 0:00 1:00 D +Rule Shang 1941 only - Nov 1 24:00 0 S +Rule Shang 1942 only - Jan 31 0:00 1:00 D +Rule Shang 1945 only - Sep 1 24:00 0 S +Rule Shang 1946 only - May 15 0:00 1:00 D +Rule Shang 1946 only - Sep 30 24:00 0 S +Rule Shang 1947 only - Apr 15 0:00 1:00 D +Rule Shang 1947 only - Oct 31 24:00 0 S +Rule Shang 1948 1949 - May 1 0:00 1:00 D +Rule Shang 1948 1949 - Sep 30 24:00 0 S #plan + # From Guy Harris: # People's Republic of China. Yes, they really have only one time zone. @@ -330,18 +358,33 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon # time - sort of", Los Angeles Times, 1986-05-05 ... [says] that China began # observing daylight saving time in 1986. -# From Paul Eggert (2014-06-30): -# Shanks & Pottenger have China switching to a single time zone in 1980, but -# this doesn't seem to be correct. They also write that China observed summer -# DST from 1986 through 1991, which seems to match the above commentary, so -# go with them for DST rules as follows: +# From P Chan (2018-05-07): +# The start and end time of DST in China [from 1986 on] should be 2:00 +# (i.e. 2:00 to 3:00 at the start and 2:00 to 1:00 at the end).... +# Government notices about summer time: +# +# 1986-04-12 http://www.zj.gov.cn/attach/zfgb/198608.pdf p.21-22 +# (To establish summer time from 1986. On 4 May, set the clocks ahead one hour +# at 2 am. On 14 September, set the clocks backward one hour at 2 am.) +# +# 1987-02-15 http://www.gov.cn/gongbao/shuju/1987/gwyb198703.pdf p.114 +# (Summer time in 1987 to start from 12 April until 13 September) +# +# 1987-09-09 http://www.gov.cn/gongbao/shuju/1987/gwyb198721.pdf p.709 +# (From 1988, summer time to start from 2 am of the first Sunday of mid-April +# until 2 am of the first Sunday of mid-September) +# +# 1992-03-03 http://www.gov.cn/gongbao/shuju/1992/gwyb199205.pdf p.152 +# (To suspend summer time from 1992) +# +# The first page of People's Daily on 12 April 1988 stating that summer time +# to begin on 17 April. +# http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Shang 1940 only - Jun 3 0:00 1:00 D -Rule Shang 1940 1941 - Oct 1 0:00 0 S -Rule Shang 1941 only - Mar 16 0:00 1:00 D -Rule PRC 1986 only - May 4 0:00 1:00 D -Rule PRC 1986 1991 - Sep Sun>=11 0:00 0 S -Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D +Rule PRC 1986 only - May 4 2:00 1:00 D +Rule PRC 1986 1991 - Sep Sun>=11 2:00 0 S +Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D # From Anthony Fok (2001-12-20): # BTW, I did some research on-line and found some info regarding these five @@ -363,10 +406,11 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D # Alois Treindl kindly sent me translations of the following two sources: # # (1) -# Guo Qingsheng (National Time-Service Center, CAS, Xi'an 710600, China) +# Guo Qing-sheng (National Time-Service Center, CAS, Xi'an 710600, China) # Beijing Time at the Beginning of the PRC # China Historical Materials of Science and Technology -# (Zhongguo ke ji shi liao, 中国科技史料), Vol. 24, No. 1 (2003) +# (Zhongguo ke ji shi liao, 中国科技史料). 2003;24(1):5-9. +# http://oversea.cnki.net/kcms/detail/detail.aspx?filename=ZGKS200301000&dbname=CJFD2003 # It gives evidence that at the beginning of the PRC, Beijing time was # officially apparent solar time! However, Guo also says that the # evidence is dubious, as the relevant institute of astronomy had not @@ -543,7 +587,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] # Beijing time, used throughout China; represented by Shanghai. Zone Asia/Shanghai 8:05:43 - LMT 1901 - 8:00 Shang C%sT 1949 + 8:00 Shang C%sT 1949 May 28 8:00 PRC C%sT # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi # / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.) @@ -772,24 +816,140 @@ Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 Taiwan C%sT # Macau (Macao, Aomen) +# +# From P Chan (2018-05-10): +# * LegisMac +# http://legismac.safp.gov.mo/legismac/descqry/Descqry.jsf?lang=pt +# A database for searching titles of legal documents of Macau in +# Chinese and Portuguese. The term "HORÁRIO DE VERÃO" can be used for +# searching decrees about summer time. +# * Archives of Macao +# http://www.archives.gov.mo/en/bo/ +# It contains images of old official gazettes. +# * The Macao Meteorological and Geophysical Bureau have a page listing the +# summer time history. But it is not complete and has some mistakes. +# http://www.smg.gov.mo/smg/geophysics/e_t_Summer%20Time.htm +# Macau adopted GMT+8 on 30 Oct 1904 to follow Hong Kong. Clocks were +# advanced by 25 minutes and 50 seconds. Which means the LMT used was +# +7:34:10. As stated in the "Portaria No. 204" dated 21 October 1904 +# and published in the Official Gazette on 29 October 1904. +# http://igallery.icm.gov.mo/Images/Archives/BO/MO_AH_PUB_BO_1904_10/MO_AH_PUB_BO_1904_10_00025_Grey.JPG +# +# Therefore the 1911 decree of Portugal did not change time in Macau. +# +# From LegisMac, here is a list of decrees that changed the time ... +# [Decree Gazette-no. date; titles omitted in this quotation] +# DIL 732 BOCM 51 1941.12.20 +# DIL 764 BOCM 9S 1942.04.30 +# DIL 781 BOCM 21 1942.10.10 +# PT 3434 BOCM 8S 1943.04.17 +# PT 3504 BOCM 20 1943.09.25 +# PT 3843 BOCM 39 1945.09.29 +# PT 3961 BOCM 17 1946.04.27 +# PT 4026 BOCM 39 1946.09.28 +# PT 4153 BOCM 16 1947.04.10 +# PT 4271 BOCM 48 1947.11.29 +# PT 4374 BOCM 18 1948.05.01 +# PT 4465 BOCM 44 1948.10.30 +# PT 4590 BOCM 14 1949.04.02 +# PT 4666 BOCM 44 1949.10.29 +# PT 4771 BOCM 12 1950.03.25 +# PT 4838 BOCM 43 1950.10.28 +# PT 4946 BOCM 12 1951.03.24 +# PT 5025 BO 43 1951.10.27 +# PT 5149 BO 14 1952.04.05 +# PT 5251 BO 43 1952.10.25 +# PT 5366 BO 13 1953.03.28 +# PT 5444 BO 44 1953.10.31 +# PT 5540 BO 12 1954.03.20 +# PT 5589 BO 44 1954.10.30 +# PT 5676 BO 12 1955.03.19 +# PT 5739 BO 45 1955.11.05 +# PT 5823 BO 11 1956.03.17 +# PT 5891 BO 44 1956.11.03 +# PT 5981 BO 12 1957.03.23 +# PT 6064 BO 43 1957.10.26 +# PT 6172 BO 12 1958.03.22 +# PT 6243 BO 43 1958.10.25 +# PT 6341 BO 12 1959.03.21 +# PT 6411 BO 43 1959.10.24 +# PT 6514 BO 11 1960.03.12 +# PT 6584 BO 44 1960.10.29 +# PT 6721 BO 10 1961.03.11 +# PT 6815 BO 43 1961.10.28 +# PT 6947 BO 10 1962.03.10 +# PT 7080 BO 43 1962.10.27 +# PT 7218 BO 12 1963.03.23 +# PT 7340 BO 43 1963.10.26 +# PT 7491 BO 11 1964.03.14 +# PT 7664 BO 43 1964.10.24 +# PT 7846 BO 15 1965.04.10 +# PT 7979 BO 42 1965.10.16 +# PT 8146 BO 15 1966.04.09 +# PT 8252 BO 41 1966.10.08 +# PT 8429 BO 15 1967.04.15 +# PT 8540 BO 41 1967.10.14 +# PT 8735 BO 15 1968.04.13 +# PT 8860 BO 41 1968.10.12 +# PT 9035 BO 16 1969.04.19 +# PT 9156 BO 42 1969.10.18 +# PT 9328 BO 15 1970.04.11 +# PT 9418 BO 41 1970.10.10 +# PT 9587 BO 14 1971.04.03 +# PT 9702 BO 41 1971.10.09 +# PT 38-A/72 BO 14 1972.04.01 +# PT 126-A/72 BO 41 1972.10.07 +# PT 61/73 BO 14 1973.04.07 +# PT 182/73 BO 40 1973.10.06 +# PT 282/73 BO 51 1973.12.22 +# PT 177/74 BO 41 1974.10.12 +# PT 51/75 BO 15 1975.04.12 +# PT 173/75 BO 41 1975.10.11 +# PT 67/76/M BO 14 1976.04.03 +# PT 169/76/M BO 41 1976.10.09 +# PT 78/79/M BO 19 1979.05.12 +# PT 166/79/M BO 42 1979.10.20 +# Note that DIL 732 does not belong to "HORÁRIO DE VERÃO" according to +# LegisMac.... Note that between 1942 and 1945, the time switched +# between GMT+9 and GMT+10. Also in 1965 and 1965 the DST ended at 2:30am. + +# From Paul Eggert (2018-05-10): +# The 1904 decree says that Macau changed from the meridian of +# Fortaleza do Monte, presumably the basis for the 7:34:10 for LMT. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Macau 1961 1962 - Mar Sun>=16 3:30 1:00 D -Rule Macau 1961 1964 - Nov Sun>=1 3:30 0 S -Rule Macau 1963 only - Mar Sun>=16 0:00 1:00 D -Rule Macau 1964 only - Mar Sun>=16 3:30 1:00 D -Rule Macau 1965 only - Mar Sun>=16 0:00 1:00 D -Rule Macau 1965 only - Oct 31 0:00 0 S -Rule Macau 1966 1971 - Apr Sun>=16 3:30 1:00 D -Rule Macau 1966 1971 - Oct Sun>=16 3:30 0 S -Rule Macau 1972 1974 - Apr Sun>=15 0:00 1:00 D -Rule Macau 1972 1973 - Oct Sun>=15 0:00 0 S -Rule Macau 1974 1977 - Oct Sun>=15 3:30 0 S -Rule Macau 1975 1977 - Apr Sun>=15 3:30 1:00 D -Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 D -Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 S -# See Europe/Lisbon for info about the 1912 transition. +Rule Macau 1942 1943 - Apr 30 23:00 1:00 - +Rule Macau 1942 only - Nov 17 23:00 0 - +Rule Macau 1943 only - Sep 30 23:00 0 S +Rule Macau 1946 only - Apr 30 23:00s 1:00 D +Rule Macau 1946 only - Sep 30 23:00s 0 S +Rule Macau 1947 only - Apr 19 23:00s 1:00 D +Rule Macau 1947 only - Nov 30 23:00s 0 S +Rule Macau 1948 only - May 2 23:00s 1:00 D +Rule Macau 1948 only - Oct 31 23:00s 0 S +Rule Macau 1949 1950 - Apr Sat>=1 23:00s 1:00 D +Rule Macau 1949 1950 - Oct lastSat 23:00s 0 S +Rule Macau 1951 only - Mar 31 23:00s 1:00 D +Rule Macau 1951 only - Oct 28 23:00s 0 S +Rule Macau 1952 1953 - Apr Sat>=1 23:00s 1:00 D +Rule Macau 1952 only - Nov 1 23:00s 0 S +Rule Macau 1953 1954 - Oct lastSat 23:00s 0 S +Rule Macau 1954 1956 - Mar Sat>=17 23:00s 1:00 D +Rule Macau 1955 only - Nov 5 23:00s 0 S +Rule Macau 1956 1964 - Nov Sun>=1 03:30 0 S +Rule Macau 1957 1964 - Mar Sun>=18 03:30 1:00 D +Rule Macau 1965 1973 - Apr Sun>=16 03:30 1:00 D +Rule Macau 1965 1966 - Oct Sun>=16 02:30 0 S +Rule Macau 1967 1976 - Oct Sun>=16 03:30 0 S +Rule Macau 1973 only - Dec 30 03:30 1:00 D +Rule Macau 1975 1976 - Apr Sun>=16 03:30 1:00 D +Rule Macau 1979 only - May 13 03:30 1:00 D +Rule Macau 1979 only - Oct Sun>=16 03:30 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1911 Dec 31 16:00u +Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30 + 8:00 - CST 1941 Dec 21 23:00 + 9:00 Macau +09/+10 1945 Sep 30 24:00 8:00 Macau C%sT @@ -1494,9 +1654,29 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # http://www.shugiin.go.jp/internet/itdb_housei.nsf/html/houritsu/00719500331039.htm # ... In summary, it is written as follows. From 24:00 on the first Saturday # in May, until 0:00 on the day after the second Saturday in September. + +# From Phake Nick (2018-09-27): +# [T]he webpage authored by National Astronomical Observatory of Japan +# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EF.html +# ... mentioned that using Showa 23 (year 1948) as example, 13pm of September +# 11 in summer time will equal to 0am of September 12 in standard time. +# It cited a document issued by the Liaison Office which briefly existed +# during the postwar period of Japan, where the detail on implementation +# of the summer time is described in the document. +# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EFB2C6BBFEB9EFA4CEBCC2BBDCA4CBA4C4A4A4A4C6.pdf +# The text in the document do instruct a fall back to occur at +# September 11, 13pm in summer time, while ordinary citizens can +# change the clock before they sleep. +# +# From Paul Eggert (2018-09-27): +# This instruction is equivalent to "Sat>=8 25:00", so use that. zic treats +# it like "Sun>=9 01:00", which is not quite the same but is the best we can +# do in any POSIX or C platform. The "25:00" assumes zic from 2007 or later, +# which should be safe now. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Japan 1948 only - May Sat>=1 24:00 1:00 D -Rule Japan 1948 1951 - Sep Sun>=9 0:00 0 S +Rule Japan 1948 1951 - Sep Sun>=9 1:00 0 S Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D @@ -1878,7 +2058,7 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 5:00 - +05 # Mangghystaū (KZ-MAN) # Aqtau was not founded until 1963, but it represents an inhabited region, -# so include time stamps before 1963. +# so include timestamps before 1963. Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Oct 1 @@ -2018,6 +2198,10 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # Assembly, as published in Rodong Sinmun. # From Tim Parenti (2018-04-29): # It appears to be the front page story at the top in the right-most column. +# +# From Paul Eggert (2018-05-04): +# The BBC reported that the transition was from 23:30 to 24:00 today. +# https://www.bbc.com/news/world-asia-44010705 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -2030,7 +2214,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 8:30 - KST 1912 Jan 1 9:00 - JST 1945 Aug 24 9:00 - KST 2015 Aug 15 00:00 - 8:30 - KST 2018 May 5 + 8:30 - KST 2018 May 4 23:30 9:00 - KST ############################################################################### @@ -2780,19 +2964,35 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # Philippine Star 2014-08-05 # http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time +# From Paul Goyette (2018-06-15): +# In the Philippines, there is a national law, Republic Act No. 10535 +# which declares the official time here as "Philippine Standard Time". +# The act [1] even specifies use of PST as the abbreviation, although +# the FAQ provided by PAGASA [2] uses the "acronym PhST to distinguish +# it from the Pacific Standard Time (PST)." +# [1] http://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/ +# [2] https://www1.pagasa.dost.gov.ph/index.php/astronomy/philippine-standard-time#republic-act-10535 +# +# From Paul Eggert (2018-06-19): +# I surveyed recent news reports, and my impression is that "PST" is +# more popular among reliable English-language news sources. This is +# not just a measure of Google hit counts: it's also the sizes and +# influence of the sources. There is no current abbreviation for DST, +# so use "PDT", the usual American style. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 - -Rule Phil 1937 only - Feb 1 0:00 0 - -Rule Phil 1954 only - Apr 12 0:00 1:00 - -Rule Phil 1954 only - Jul 1 0:00 0 - -Rule Phil 1978 only - Mar 22 0:00 1:00 - -Rule Phil 1978 only - Sep 21 0:00 0 - +Rule Phil 1936 only - Nov 1 0:00 1:00 D +Rule Phil 1937 only - Feb 1 0:00 0 S +Rule Phil 1954 only - Apr 12 0:00 1:00 D +Rule Phil 1954 only - Jul 1 0:00 0 S +Rule Phil 1978 only - Mar 22 0:00 1:00 D +Rule Phil 1978 only - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 8:04:00 - LMT 1899 May 11 - 8:00 Phil +08/+09 1942 May - 9:00 - +09 1944 Nov - 8:00 Phil +08/+09 + 8:00 Phil P%sT 1942 May + 9:00 - JST 1944 Nov + 8:00 Phil P%sT # Qatar # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -2803,15 +3003,34 @@ Link Asia/Qatar Asia/Bahrain # Saudi Arabia # -# From Paul Eggert (2014-07-15): +# From Paul Eggert (2018-08-29): # Time in Saudi Arabia and other countries in the Arabian peninsula was not -# standardized until relatively recently; we don't know when, and possibly it +# standardized until 1968 or so; we don't know exactly when, and possibly it # has never been made official. Richard P Hunt, in "Islam city yielding to # modern times", New York Times (1961-04-09), p 20, wrote that only airlines # observed standard time, and that people in Jeddah mostly observed quasi-solar # time, doing so by setting their watches at sunrise to 6 o'clock (or to 12 # o'clock for "Arab" time). # +# Timekeeping differed depending on who you were and which part of Saudi +# Arabia you were in. In 1969, Elias Antar wrote that although a common +# practice had been to set one's watch to 12:00 (i.e., midnight) at sunset - +# which meant that the time on one side of a mountain could differ greatly from +# the time on the other side - many foreigners set their watches to 6pm +# instead, while airlines instead used UTC +03 (except in Dhahran, where they +# used UTC +04), Aramco used UTC +03 with DST, and the Trans-Arabian Pipe Line +# Company used Aramco time in eastern Saudi Arabia and airline time in western. +# (The American Military Aid Advisory Group used plain UTC.) Antar writes, +# "A man named Higgins, so the story goes, used to run a local power +# station. One day, the whole thing became too much for Higgins and he +# assembled his staff and laid down the law. 'I've had enough of this,' he +# shrieked. 'It is now 12 o'clock Higgins Time, and from now on this station is +# going to run on Higgins Time.' And so, until last year, it did." See: +# Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. +# http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm +# newspapers.com says a similar story about Higgins was published in the Port +# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics # Board (OCLC 42299995) reported that the "... Arabian Government, inaugurated @@ -2821,7 +3040,8 @@ Link Asia/Qatar Asia/Bahrain # # Shanks & Pottenger also state that until 1968-05-01 Saudi Arabia had two # time zones; the other zone, at UT +04, was in the far eastern part of -# the country. Ignore this, as it's before our 1970 cutoff. +# the country. Presumably this is documenting airline time. Ignore this, +# as it's before our 1970 cutoff. # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/australasia b/test/jdk/sun/util/calendar/zi/tzdata/australasia index 2c60fd32e5c..82e88c51e91 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/australasia +++ b/test/jdk/sun/util/calendar/zi/tzdata/australasia @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Australasia and environs, and for much of the Pacific + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -384,8 +386,15 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing # Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27), # [Legal Notice No. 41] of an order of the previous day by J Usamate. + +# From Raymond Kumar (2018-07-13): +# http://www.fijitimes.com/government-approves-2018-daylight-saving/ +# ... The daylight saving period will end at 3am on Sunday January 13, 2019. +# +# From Paul Eggert (2018-07-15): # For now, guess DST from 02:00 the first Sunday in November to 03:00 -# the first Sunday on or after January 14. Although ad hoc, it matches +# the first Sunday on or after January 13. January transitions reportedly +# depend on when school terms start. Although the guess is ad hoc, it matches # transitions since late 2014 and seems more likely to match future # practice than guessing no DST. @@ -399,7 +408,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 - -Rule Fiji 2015 max - Jan Sun>=14 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=13 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/backward b/test/jdk/sun/util/calendar/zi/tzdata/backward index fca4ed18816..f30f30e511b 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/backward +++ b/test/jdk/sun/util/calendar/zi/tzdata/backward @@ -21,10 +21,12 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb links for backward compatibility + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This file provides links between current names for time zones +# This file provides links between current names for timezones # and their old names. Many names changed in late 1993. # Link TARGET LINK-NAME diff --git a/test/jdk/sun/util/calendar/zi/tzdata/etcetera b/test/jdk/sun/util/calendar/zi/tzdata/etcetera index ec31f1b3b4e..db5937879e0 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/etcetera +++ b/test/jdk/sun/util/calendar/zi/tzdata/etcetera @@ -21,12 +21,14 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for ships at sea and other miscellany + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # These entries are mostly present for historical reasons, so that # people in areas not otherwise covered by the tz files could "zic -l" -# to a time zone that was right for their area. These days, the +# to a timezone that was right for their area. These days, the # tz files cover almost all the inhabited world, and the only practical # need now for the entries that are not on UTC are for ships at sea # that cannot use POSIX TZ settings. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/europe b/test/jdk/sun/util/calendar/zi/tzdata/europe index 99109ecd0fc..e434b7e9fc4 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/europe +++ b/test/jdk/sun/util/calendar/zi/tzdata/europe @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for Europe and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -540,7 +542,7 @@ Link Europe/London Europe/Isle_of_Man # # To work around this problem, the build procedure can translate the # following data into two forms, one with negative SAVE values and the -# other form with a traditional approximation for Irish time stamps +# other form with a traditional approximation for Irish timestamps # after 1971-10-31 02:00 UTC; although this approximation has tm_isdst # flags that are reversed, its UTC offsets are correct and this often # suffices. This source file currently uses only nonnegative SAVE @@ -2450,6 +2452,33 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # administratively part of Sakhalin oblast', they appear to have # remained on UTC+11 along with Magadan. +# From Marat Nigametzianov (2018-07-16): +# this is link to order from 1956 about timezone in USSR +# http://astro.uni-altai.ru/~orion/blog/2011/11/novyie-granitsyi-chasovyih-poyasov-v-sssr/ +# +# From Paul Eggert (2018-07-16): +# Perhaps someone could translate the above-mentioned link and use it +# to correct our data for the ex-Soviet Union. It cites the following: +# «Поясное время и новые границы часовых поясов» / сост. П.Н. Долгов, +# отв. ред. Г.Д. Бурдун - М: Комитет стандартов, мер и измерительных +# приборов при Совете Министров СССР, Междуведомственная комиссия +# единой службы времени, 1956 г. +# This book looks like it would be a helpful resource for the Soviet +# Union through 1956. Although a copy was in the Scientific Library +# of Tomsk State University, I have not been able to track down a copy nearby. +# +# From Stepan Golosunov (2018-07-21): +# http://astro.uni-altai.ru/~orion/blog/2015/05/center-reforma-ischisleniya-vremeni-br-na-territorii-sssr-v-1957-godu-center/ +# says that the 1956 decision to change time belts' borders was not +# implemented as planned in 1956 and the change happened in 1957. +# There is also the problem that actual time zones were different from +# the official time belts (and from many time belts' maps) as there were +# numerous exceptions to application of time belt rules. For example, +# https://ru.wikipedia.org/wiki/Московское_время#Перемещение_границы_применения_московского_времени_на_восток +# says that by 1962 there were many regions in the 3rd time belt that +# were on Moscow time, referring to a 1962 map. By 1989 number of such +# exceptions grew considerably. + # From Tim Parenti (2014-07-06): # The comments detailing the coverage of each Russian zone are meant to assist # with maintenance only and represent our best guesses as to which regions @@ -2460,9 +2489,6 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # future stability. ISO 3166-2:RU codes are also listed for first-level # divisions where available. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] - - # From Tim Parenti (2014-07-03): # Europe/Kaliningrad covers... # 39 RU-KGD Kaliningrad Oblast @@ -2730,6 +2756,15 @@ Zone Europe/Astrakhan 3:12:12 - LMT 1924 May # 34 RU-VGG Volgograd Oblast # The 1988 transition is from USSR act No. 5 (1988-01-04). +# From Alexander Fetisov (2018-09-20): +# Volgograd region in southern Russia (Europe/Volgograd) change +# timezone from UTC+3 to UTC+4 from 28oct2018. +# http://sozd.parliament.gov.ru/bill/452878-7 +# +# From Stepan Golosunov (2018-10-11): +# The law has been published today on +# http://publication.pravo.gov.ru/Document/View/0001201810110037 + Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 3:00 - +03 1930 Jun 21 4:00 - +04 1961 Nov 11 @@ -2738,7 +2773,8 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 4:00 - +04 1992 Mar 29 2:00s 3:00 Russia +03/+04 2011 Mar 27 2:00s 4:00 - +04 2014 Oct 26 2:00s - 3:00 - +03 + 3:00 - +03 2018 Oct 28 2:00s + 4:00 - +04 # From Paul Eggert (2016-11-11): # Europe/Saratov covers: @@ -3427,7 +3463,8 @@ Rule Spain 1978 only - Oct 1 2:00s 0 - #Rule NatSpain 1937 only - May 22 23:00 1:00 S #Rule NatSpain 1937 1938 - Oct Sat>=1 24:00s 0 - #Rule NatSpain 1938 only - Mar 26 23:00 1:00 S -# The following rules are copied from Morocco from 1967 through 1978. +# The following rules are copied from Morocco from 1967 through 1978, +# except with "S" letters. Rule SpainAfrica 1967 only - Jun 3 12:00 1:00 S Rule SpainAfrica 1967 only - Oct 1 0:00 0 - Rule SpainAfrica 1974 only - Jun 24 0:00 1:00 S @@ -3447,6 +3484,7 @@ Zone Africa/Ceuta -0:21:16 - LMT 1900 Dec 31 23:38:44 0:00 1:00 WEST 1918 Oct 7 23:00 0:00 - WET 1924 0:00 Spain WE%sT 1929 + 0:00 - WET 1967 # Help zishrink.awk. 0:00 SpainAfrica WE%sT 1984 Mar 16 1:00 - CET 1986 1:00 EU CE%sT @@ -3632,7 +3670,7 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. # http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001 # http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006 # From Paul Eggert (2016-09-25): -# Prefer the above sources to Shanks & Pottenger for time stamps after 1985. +# Prefer the above sources to Shanks & Pottenger for timestamps after 1985. # From Steffen Thorsen (2007-03-09): # Starting 2007 though, it seems that they are adopting EU's 1:00 UTC @@ -3842,10 +3880,29 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. # * Ukrainian Government's Resolution of 20.03.1992, No. 139. # http://www.uazakon.com/documents/date_8u/pg_grcasa.htm +# From Paul Eggert (2018-10-03): +# As is usual in tzdb, Ukrainian zones use the most common English spellings. +# For example, tzdb uses Europe/Kiev, as "Kiev" is the most common spelling in +# English for Ukraine's capital, even though it is certainly wrong as a +# transliteration of the Ukrainian "Київ". This is similar to tzdb's use of +# Europe/Prague, which is certainly wrong as a transliteration of the Czech +# "Praha". ("Kiev" came from old Slavic via Russian to English, and "Prague" +# came from old Slavic via French to English, so the two cases have something +# in common.) Admittedly English-language spelling of Ukrainian names is +# controversial, and some day "Kyiv" may become substantially more popular in +# English; in the meantime, stick with the traditional English "Kiev" as that +# means less disruption for our users. +# +# Anyway, none of the common English-language spellings (Kiev, Kyiv, Kieff, +# Kijeff, Kijev, Kiyef, Kiyeff) do justice to the common pronunciation in +# Ukrainian, namely [ˈkɪjiu̯] (IPA). This pronunciation has nothing like an +# English "v" or "f", and instead trails off with what an English-speaker +# would call a demure "oo" sound, and it would would be better anglicized as +# "Kuiyu". Here's a sound file, if you would like to do as the Kuiyuvians do: +# https://commons.wikimedia.org/wiki/File:Uk-Київ.ogg + # Zone NAME GMTOFF RULES FORMAT [UNTIL] -# Most of Ukraine since 1970 has been like Kiev. -# "Kyiv" is the transliteration of the Ukrainian name, but -# "Kiev" is more common in English. +# This represents most of Ukraine. See above for the spelling of "Kiev". Zone Europe/Kiev 2:02:04 - LMT 1880 2:02:04 - KMT 1924 May 2 # Kiev Mean Time 2:00 - EET 1930 Jun 21 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/factory b/test/jdk/sun/util/calendar/zi/tzdata/factory index 7d7969329db..6ef6bca0b8c 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/factory +++ b/test/jdk/sun/util/calendar/zi/tzdata/factory @@ -21,11 +21,13 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for noncommittal factory settings + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# For distributors who don't want to put time zone specification in -# their installation procedures. Users that run 'date' will get the +# For distributors who don't want to specify a timezone in their +# installation procedures. Users who run 'date' will get the # time zone abbreviation "-00", indicating that the actual time zone # is unknown. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/leapseconds b/test/jdk/sun/util/calendar/zi/tzdata/leapseconds index cc5d9288987..8b539e6ef4b 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/leapseconds +++ b/test/jdk/sun/util/calendar/zi/tzdata/leapseconds @@ -26,21 +26,25 @@ # This file is in the public domain. # This file is generated automatically from the data in the public-domain -# leap-seconds.list file, which is copied from: -# ftp://ftp.nist.gov/pub/time/leap-seconds.list +# leap-seconds.list file, which can be copied from +# +# or +# or . # For more about leap-seconds.list, please see # The NTP Timescale and Leap Seconds -# https://www.eecis.udel.edu/~mills/leap.html +# . # The International Earth Rotation and Reference Systems Service # periodically uses leap seconds to keep UTC to within 0.9 s of UT1 -# (which measures the true angular orientation of the earth in space); see -# Levine J. Coordinated Universal Time and the leap second. +# (which measures the true angular orientation of the earth in space) +# and publishes leap second data in a copyrighted file +# . +# See: Levine J. Coordinated Universal Time and the leap second. # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995 -# http://ieeexplore.ieee.org/document/7909995/ +# . # There were no leap seconds before 1972, because the official mechanism # accounting for the discrepancy between atomic time and the earth's rotation -# did not exist until the early 1970s. +# did not exist. # The correction (+ or -) is made at the given time, so lines # will typically look like: @@ -48,10 +52,7 @@ # or # Leap YEAR MON DAY 23:59:59 - R/S -# If the leapsecond is Rolling (R) the given time is local time. -# If the leapsecond is Stationary (S) the given time is UTC. - -# Leap YEAR MONTH DAY HH:MM:SS CORR R/S +# If the leap second is Rolling (R) the given time is local time (unused here). Leap 1972 Jun 30 23:59:60 + S Leap 1972 Dec 31 23:59:60 + S Leap 1973 Dec 31 23:59:60 + S @@ -80,5 +81,9 @@ Leap 2012 Jun 30 23:59:60 + S Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S -# Updated through IERS Bulletin C55 -# File expires on: 28 December 2018 +# POSIX timestamps for the data in this file: +#updated 1467936000 +#expires 1561680000 + +# Updated through IERS Bulletin C56 +# File expires on: 28 June 2019 diff --git a/test/jdk/sun/util/calendar/zi/tzdata/northamerica b/test/jdk/sun/util/calendar/zi/tzdata/northamerica index bcfb662154f..297a10a3849 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/northamerica +++ b/test/jdk/sun/util/calendar/zi/tzdata/northamerica @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for North and Central America and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -71,7 +73,7 @@ # # Most of the US soon followed suit. See: # Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56. -# http://dx.doi.org/10.2307/3105430 +# https://dx.doi.org/10.2307/3105430 # From Paul Eggert (2005-04-16): # That 1883 transition occurred at 12:00 new time, not at 12:00 old time. @@ -460,6 +462,19 @@ Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53 # western South Dakota, far western Texas (El Paso County, Hudspeth County, # and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming # +# From Paul Eggert (2018-10-25): +# On 1921-03-04 federal law placed all of Texas into the central time zone. +# However, El Paso ignored the law for decades and continued to observe +# mountain time, on the grounds that that's what they had always done +# and they weren't about to let the federal government tell them what to do. +# Eventually the federal government gave in and changed the law on +# 1970-04-10 to match what El Paso was actually doing. Although +# that's slightly after our 1970 cutoff, there is no need to create a +# separate zone for El Paso since they were ignoring the law anyway. See: +# Long T. El Pasoans were time rebels, fought to stay in Mountain zone. +# El Paso Times. 2018-10-24 06:40 -06. +# https://www.elpasotimes.com/story/news/local/el-paso/2018/10/24/el-pasoans-were-time-rebels-fought-stay-mountain-zone/1744509002/ +# # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Denver 1920 1921 - Mar lastSun 2:00 1:00 D Rule Denver 1920 only - Oct lastSun 2:00 0 S @@ -729,9 +744,7 @@ Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35 Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 -10:30 - HST 1933 Apr 30 2:00 -10:30 1:00 HDT 1933 May 21 12:00 - -10:30 - HST 1942 Feb 9 2:00 - -10:30 1:00 HDT 1945 Sep 30 2:00 - -10:30 - HST 1947 Jun 8 2:00 + -10:30 US H%sT 1947 Jun 8 2:00 -10:00 - HST # Now we turn to US areas that have diverged from the consensus since 1970. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/pacificnew b/test/jdk/sun/util/calendar/zi/tzdata/pacificnew index 9b9257a45fe..020b599bf00 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/pacificnew +++ b/test/jdk/sun/util/calendar/zi/tzdata/pacificnew @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for proposed US election time (this file is obsolete) + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/southamerica b/test/jdk/sun/util/calendar/zi/tzdata/southamerica index 65d3c9fcef2..3f016479a75 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/southamerica +++ b/test/jdk/sun/util/calendar/zi/tzdata/southamerica @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for South America and environs + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -415,7 +417,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 - # standard time, so let's do that here too. This does not change UTC # offsets, only tm_isdst and the time zone abbreviations. One minor # plus is that this silences a zic complaint that there's no POSIX TZ -# setting for time stamps past 2038. +# setting for timestamps past 2038. # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -948,6 +950,14 @@ Rule Brazil 2016 2022 - Feb Sun>=15 0:00 0 - # ... https://www.timeanddate.com/news/time/brazil-delays-dst-2018.html # From Steffen Thorsen (2017-12-20): # http://www.planalto.gov.br/ccivil_03/_ato2015-2018/2017/decreto/D9242.htm +# +# From Fábio Gomes (2018-10-04): +# The Brazilian president just announced a new change on this year DST. +# It was scheduled to start on November 4th and it was changed to November 18th. +# From Rodrigo Brüning Wessler (2018-10-15): +# The Brazilian government just announced that the change in DST was +# canceled.... Maybe the president Michel Temer also woke up one hour +# earlier today. :) Rule Brazil 2018 max - Nov Sun>=1 0:00 1:00 - Rule Brazil 2023 only - Feb Sun>=22 0:00 0 - Rule Brazil 2024 2025 - Feb Sun>=15 0:00 0 - @@ -1254,6 +1264,24 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # they will switch from -03 to -04 one hour after Santiago does that day. # For now, assume that they will not revert. +# From Juan Correa (2018-08-13): +# As of moments ago, the Ministry of Energy in Chile has announced the new +# schema for DST. ... Announcement in video (in Spanish): +# https://twitter.com/MinEnergia/status/1029000399129374720 +# From Yonathan Dossow (2018-08-13): +# The video says "first Saturday of September", we all know it means Sunday at +# midnight. +# From Tim Parenti (2018-08-13): +# Translating the captions on the video at 0:44-0:55, "We want to announce as +# Government that from 2019, Winter Time will be increased to 5 months, between +# the first Saturday of April and the first Saturday of September." +# At 2:08-2:20, "The Magallanes region will maintain its current time, as +# decided by the citizens during 2017, but our Government will promote a +# regional dialogue table to gather their opinion on this matter." +# https://twitter.com/MinEnergia/status/1029009354001973248 +# "We will keep the new time policy unchanged for at least the next 4 years." +# So we extend the new rules on Saturdays at 24:00 mainland time indefinitely. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Chile 1927 1931 - Sep 1 0:00 1:00 - Rule Chile 1928 1932 - Apr 1 0:00 0 - @@ -1287,8 +1315,10 @@ Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 - Rule Chile 2012 2014 - Apr Sun>=23 3:00u 0 - Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 - -Rule Chile 2016 max - May Sun>=9 3:00u 0 - -Rule Chile 2016 max - Aug Sun>=9 4:00u 1:00 - +Rule Chile 2016 2018 - May Sun>=9 3:00u 0 - +Rule Chile 2016 2018 - Aug Sun>=9 4:00u 1:00 - +Rule Chile 2019 max - Apr Sun>=2 3:00u 0 - +Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 - # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] diff --git a/test/jdk/sun/util/calendar/zi/tzdata/systemv b/test/jdk/sun/util/calendar/zi/tzdata/systemv index c7b9a888e88..63a48e8c3e0 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/systemv +++ b/test/jdk/sun/util/calendar/zi/tzdata/systemv @@ -21,6 +21,8 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# tzdb data for System V rules (this file is obsolete) + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. diff --git a/test/jdk/sun/util/calendar/zi/tzdata/zone.tab b/test/jdk/sun/util/calendar/zi/tzdata/zone.tab index 873737e06b8..2a985868d28 100644 --- a/test/jdk/sun/util/calendar/zi/tzdata/zone.tab +++ b/test/jdk/sun/util/calendar/zi/tzdata/zone.tab @@ -21,12 +21,12 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -# tz zone descriptions (deprecated version) +# tzdb timezone descriptions (deprecated version) # # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # -# From Paul Eggert (2014-07-31): +# From Paul Eggert (2018-06-27): # This file is intended as a backward-compatibility aid for older programs. # New programs should use zone1970.tab. This file is like zone1970.tab (see # zone1970.tab's comments), but with the following additional restrictions: @@ -35,13 +35,13 @@ # 2. The first data column contains exactly one country code. # # Because of (2), each row stands for an area that is the intersection -# of a region identified by a country code and of a zone where civil +# of a region identified by a country code and of a timezone where civil # clocks have agreed since 1970; this is a narrower definition than # that of zone1970.tab. # -# This table is intended as an aid for users, to help them select time -# zone data entries appropriate for their practical needs. It is not -# intended to take or endorse any position on legal or territorial claims. +# This table is intended as an aid for users, to help them select timezones +# appropriate for their practical needs. It is not intended to take or +# endorse any position on legal or territorial claims. # #country- #code coordinates TZ comments @@ -291,7 +291,7 @@ MM +1647+09610 Asia/Yangon MN +4755+10653 Asia/Ulaanbaatar Mongolia (most areas) MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar -MO +2214+11335 Asia/Macau +MO +221150+1133230 Asia/Macau MP +1512+14545 Pacific/Saipan MQ +1436-06105 America/Martinique MR +1806-01557 Africa/Nouakchott From 9a043c50f90374bbac1629e329e2140029102535 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Thu, 1 Nov 2018 17:56:01 +0100 Subject: [PATCH 016/128] 8209495: NMethodSweeper::sweep_code_cache cause severe delays Reviewed-by: thartmann, eosterlund --- src/hotspot/share/runtime/sweeper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/sweeper.cpp b/src/hotspot/share/runtime/sweeper.cpp index 9dde10fd823..a2e59ce224b 100644 --- a/src/hotspot/share/runtime/sweeper.cpp +++ b/src/hotspot/share/runtime/sweeper.cpp @@ -387,13 +387,13 @@ void NMethodSweeper::force_sweep() { * Handle a safepoint request */ void NMethodSweeper::handle_safepoint_request() { - if (SafepointSynchronize::is_synchronizing()) { + JavaThread* thread = JavaThread::current(); + if (SafepointMechanism::poll(thread)) { if (PrintMethodFlushing && Verbose) { tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count()); } MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - JavaThread* thread = JavaThread::current(); ThreadBlockInVM tbivm(thread); thread->java_suspend_self(); } From 30745fe1a88106921d526a31a9cbd52a92bf4986 Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Thu, 1 Nov 2018 16:53:54 -0400 Subject: [PATCH 017/128] 8212669: Add note to Cipher javadoc about using full transformation and not relying on defaults Reviewed-by: xuelei --- .../share/classes/javax/crypto/Cipher.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/java.base/share/classes/javax/crypto/Cipher.java b/src/java.base/share/classes/javax/crypto/Cipher.java index d9b5f102432..e2978229caf 100644 --- a/src/java.base/share/classes/javax/crypto/Cipher.java +++ b/src/java.base/share/classes/javax/crypto/Cipher.java @@ -492,6 +492,12 @@ public class Cipher { *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * + * @apiNote + * It is recommended to use a transformation that fully specifies the + * algorithm, mode, and padding. By not doing so, the provider will + * use a default for the mode and padding which may not meet the security + * requirements of your application. + * * @implNote * The JDK Reference Implementation additionally uses the * {@code jdk.security.provider.preferred} @@ -499,6 +505,9 @@ public class Cipher { * the preferred provider order for the specified algorithm. This * may be different than the order of providers returned by * {@link Security#getProviders() Security.getProviders()}. + * See also the Cipher Transformations section of the {@extLink + * security_guide_jdk_providers JDK Providers} document for information + * on the transformation defaults used by JDK providers. * * @param transformation the name of the transformation, e.g., * AES/CBC/PKCS5Padding. @@ -578,6 +587,17 @@ public class Cipher { *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * + * @apiNote + * It is recommended to use a transformation that fully specifies the + * algorithm, mode, and padding. By not doing so, the provider will + * use a default for the mode and padding which may not meet the security + * requirements of your application. + * + * @implNote + * See the Cipher Transformations section of the {@extLink + * security_guide_jdk_providers JDK Providers} document for information + * on the transformation defaults used by JDK providers. + * * @param transformation the name of the transformation, * e.g., AES/CBC/PKCS5Padding. * See the Cipher section in the AES/CBC/PKCS5Padding. * See the Cipher section in the Date: Thu, 1 Nov 2018 14:07:59 -0700 Subject: [PATCH 018/128] 8213046: Define Japanese new Era character Reviewed-by: lancea, rriggs --- src/java.base/share/classes/java/lang/Character.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java index 0ed379442f6..ab8f6939c27 100644 --- a/src/java.base/share/classes/java/lang/Character.java +++ b/src/java.base/share/classes/java/lang/Character.java @@ -55,6 +55,14 @@ import jdk.internal.HotSpotIntrinsicCandidate; *

+ *

+ * The code point, U+32FF, is reserved by the Unicode Consortium + * to represent the Japanese square character for the new era that begins + * May 2019. Relevant methods in the Character class return the same + * properties as for the existing Japanese era characters (e.g., U+337E for + * "Meizi"). For the details of the code point, refer to + * + * http://blog.unicode.org/2018/09/new-japanese-era.html. * *

Unicode Character Representations

* From 73fa99ae866defd67cae7604fca012825c82283e Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 1 Nov 2018 14:32:55 -0700 Subject: [PATCH 019/128] 8213263: fix legal headers in test/langtools Reviewed-by: darcy --- .../modules/acme.mdle/module-info.java | 4 +-- .../modules/acme.mdle/p/Foo.java | 4 +-- .../acme.mdle/p/doc-files/inpackage.html | 4 +-- .../p/doc-files/sub-dir/SubReadme.html | 4 +-- .../sub-dir/sub-dir-1/SubSubReadme.html | 4 +-- .../modules/acme.mdle/p/package.html | 4 +-- .../modules/acme2.mdle/module-info.java | 4 +-- .../modules/acme2.mdle/p2/Foo.java | 4 +-- .../acme2.mdle/p2/doc-files/inpackage.html | 4 +-- .../p2/doc-files/sub-dir/SubReadme.html | 4 +-- .../sub-dir/sub-dir-1/SubSubReadme.html | 4 +-- .../modules/acme2.mdle/p2/package.html | 4 +-- .../testCopyFiles/modules/overview.html | 4 +-- .../doclet/testCopyFiles/packages/p1/Foo.java | 4 +-- .../packages/p1/doc-files/inpackage.html | 4 +-- .../p1/doc-files/sub-dir/SubReadme.html | 4 +-- .../doclet/testCopyFiles/packages/p2/Foo.java | 4 +-- .../packages/p2/doc-files/case1.html | 4 +-- .../packages/p2/doc-files/case2.html | 4 +-- .../packages/p2/doc-files/case3.html | 4 +-- .../packages/p2/doc-files/case4.html | 4 +-- .../doclet/testCopyFiles/unnamed/Foo.java | 4 +-- .../unnamed/doc-files/doc-file/SubReadme.html | 4 +-- .../unnamed/doc-files/inpackage.html | 4 +-- .../TestGrandParentTypes.java | 4 +-- .../doclet/testHeadTag/TestHeadTag.java | 4 +-- .../TestHtmlLankmarkRegions.java | 4 +-- .../javadoc/doclet/testHtmlTag/pkg3/A.java | 4 +-- .../doclet/testHtmlTag/pkg3/package.html | 4 +-- .../testIndexTaglet/TestIndexTaglet.java | 4 +-- .../ConcealedClassInModuleA.java | 4 +-- .../testModules/moduleA/module-info.java | 4 +-- .../testpkgmdlA/TestClassInModuleA.java | 4 +-- .../testModules/moduleB/module-info.java | 4 +-- .../testpkg2mdlB/TestInterface2InModuleB.java | 4 +-- .../testpkg2mdlB/TestInterfaceInModuleB.java | 4 +-- .../testpkg3mdlB/TestClassLinkOption.java | 4 +-- .../testpkgmdlB/TestClass2InModuleB.java | 4 +-- .../testpkgmdlB/TestClassInModuleB.java | 4 +-- .../testModules/moduleC/module-info.java | 4 +-- .../testpkgmdlC/TestClassInModuleC.java | 4 +-- .../moduleNoExport/module-info.java | 4 +-- .../TestClassInModuleNoExport.java | 4 +-- .../testModules/moduleT/module-info.java | 4 +-- .../testModules/moduletags/module-info.java | 4 +-- .../testpkgmdltags/TestClassInModuleTags.java | 4 +-- .../test.moduleFullName/module-info.java | 4 +-- .../TestClassInTestModuleFullName.java | 4 +-- .../testpkgnomodule/TestClassNoModule.java | 4 +-- .../TestClassNoModulePkg1.java | 4 +-- .../testOverriddenMethods/pkg5/TestEnum.java | 4 +-- .../doclet/testOverview/msrc/module-info.java | 4 +-- .../pkg/package-info.java | 4 +-- .../doclet/testSummaryTag/TestSummaryTag.java | 4 +-- .../javadoc/doclet/testValueTag/pkg3/RT.java | 4 +-- .../jdk/javadoc/tool/TestScriptInComment.java | 4 +-- .../tools/javac/8133247/T8133247.java | 4 +-- test/langtools/tools/javac/8133247/p/A.java | 4 +-- test/langtools/tools/javac/8133247/p/B.java | 4 +-- test/langtools/tools/javac/8133247/p/I.java | 4 +-- .../tools/javac/8169345/T8169345b.java | 4 +-- .../tools/javac/8169345/T8169345c.java | 4 +-- .../javac/DefiniteAssignment/T8204610.java | 4 +-- .../javac/annotations/8145489/foo/Anno.java | 4 +-- .../javac/annotations/8145489/foo/Status.java | 4 +-- .../annotations/8145489/foo/package-info.java | 4 +-- .../classreader/8171132/BadConstantValue.java | 4 +-- .../diags/examples/FutureVarNotAllowed.java | 4 +-- .../diags/examples/IllegalRefToVarType.java | 4 +-- .../diags/examples/IllegalSignature.java | 4 +-- .../diags/examples/LocalCantInferNull.java | 4 +-- .../diags/examples/LocalCantInferVoid.java | 4 +-- .../examples/LocalLambdaMissingTarget.java | 4 +-- .../diags/examples/LocalMissingInit.java | 4 +-- .../examples/LocalMrefMissingTarget.java | 4 +-- .../diags/examples/LocalRedundantType.java | 4 +-- .../javac/diags/examples/LocalSelfRef.java | 4 +-- .../examples/PreviewFeatureDisabled.java | 4 +-- .../PreviewFeatureDisabledPlural.java | 4 +-- .../diags/examples/PreviewFeatureUse.java | 4 +-- .../javac/diags/examples/PreviewFilename.java | 4 +-- .../examples/PreviewFilenameAdditional.java | 4 +-- .../examples/PreviewPlural/PreviewPlural.java | 4 +-- .../PreviewPlural/PreviewPluralBar.java | 4 +-- .../diags/examples/StatExprExpected.java | 4 +-- .../javac/diags/examples/VarNotAllowed.java | 4 +-- .../diags/examples/VarNotAllowedArray.java | 4 +-- .../diags/examples/VarNotAllowedCompound.java | 4 +-- .../examples/VarNotAllowedExplicitLambda.java | 4 +-- .../diags/examples/VarNotAllowedHere.java | 4 +-- .../examples/WrongNumberTypeArgsFragment.java | 4 +-- .../tools/javac/doctree/SummaryTest.java | 4 +-- .../generics/diamond/7002837/T7002837.java | 4 +-- .../javac/generics/diamond/neg/T8078473.java | 4 +-- .../generics/diamond/neg/T8078473_2.java | 4 +-- .../generics/inference/8067767/T8067767.java | 4 +-- .../generics/inference/8077306/T8077306.java | 4 +-- .../generics/inference/8141613/T8141613.java | 4 +-- .../generics/inference/8147493/T8147493a.java | 4 +-- .../generics/inference/8147493/T8147493b.java | 4 +-- .../generics/inference/8152832/T8152832.java | 4 +-- .../generics/inference/8156954/T8156954.java | 4 +-- .../generics/inference/8157149/T8157149b.java | 4 +-- .../generics/inference/8157149/T8157149c.java | 4 +-- .../generics/inference/8158355/T8158355.java | 4 +-- .../generics/inference/8159680/T8159680.java | 4 +-- .../generics/inference/8164399/T8164399.java | 4 +-- .../generics/inference/8168134/T8168134.java | 4 +-- .../generics/inference/8174249/T8174249a.java | 4 +-- .../generics/inference/8174249/T8174249b.java | 4 +-- .../inference/8176534/TestUncheckedCalls.java | 4 +-- .../generics/inference/8177097/T8177097a.java | 4 +-- .../generics/inference/8177097/T8177097b.java | 4 +-- .../generics/inference/8178150/T8178150.java | 4 +-- .../generics/inference/8178427/T8178427.java | 4 +-- .../tools/javac/lambda/8063054/T8063054a.java | 4 +-- .../tools/javac/lambda/8063054/T8063054b.java | 4 +-- .../tools/javac/lambda/8134329/T8134329.java | 4 +-- .../tools/javac/lambda/8142876/T8142876.java | 4 +-- .../tools/javac/lambda/8148128/T8148128.java | 4 +-- .../tools/javac/lambda/8188144/T8188144.java | 4 +-- .../tools/javac/lambda/8210495/T8210495.java | 4 +-- .../tools/javac/lambda/T8195598.java | 4 +-- .../lambda/speculative/8147546/T8147546a.java | 4 +-- .../lambda/speculative/8147546/T8147546b.java | 4 +-- .../lambda/speculative/8154180/T8154180a.java | 4 +-- .../javac/lambda/speculative/InferStrict.java | 4 +-- .../javac/lambda/speculative/InferWeak.java | 4 +-- .../speculative/NestedLambdaGenerics.java | 4 +-- .../speculative/NestedLambdaNoGenerics.java | 4 +-- .../javac/lambda/speculative/T8046685.java | 4 +-- .../javac/lambda/speculative/T8055984.java | 4 +-- .../javac/lambda/speculative/T8077247.java | 4 +-- .../javac/lambda/speculative/T8078093.java | 4 +-- test/langtools/tools/javac/lvti/T8191893.java | 4 +-- test/langtools/tools/javac/lvti/T8191959.java | 4 +-- test/langtools/tools/javac/lvti/T8200199.java | 25 ------------------- test/langtools/tools/javac/lvti/T8200199.out | 6 ++--- .../tools/javac/lvti/TestBadArray.java | 4 +-- .../badTypeReference/BadTypeReference.java | 25 ------------------- .../badTypeReference/BadTypeReference.out | 4 +-- .../badTypeReference/pkg/nested/var/A.java | 4 +-- .../javac/lvti/badTypeReference/pkg/var.java | 4 +-- .../javac/lvti/harness/InferredType.java | 4 +-- .../harness/LocalVariableInferenceTester.java | 4 +-- .../javac/lvti/harness/NonDenotableTest.java | 4 +-- .../javac/lvti/harness/PrimitiveTypeTest.java | 4 +-- .../javac/lvti/harness/ReferenceTypeTest.java | 4 +-- .../tools/javac/lvti/harness/UpperBounds.java | 4 +-- .../javac/modules/T8168854/pack1/Outer.java | 4 +-- .../javac/modules/T8168854/pack1/Outer1.java | 4 +-- .../tools/javac/overload/T8176265.java | 4 +-- .../javac/preview/PreviewOptionTest.java | 4 +-- .../javac/preview/classReaderTest/Bar.java | 4 +-- .../ExpressionSwitchInExpressionSwitch.java | 4 +-- .../tools/javadoc/lib/ToyDoclet.java | 4 +-- .../InvisibleParameterAnnotationsTest.java | 4 +-- .../tools/lib/builder/AbstractBuilder.java | 4 +-- .../tools/lib/builder/ClassBuilder.java | 4 +-- test/langtools/tools/lib/toolbox/Assert.java | 4 +-- test/langtools/tools/sjavac/HiddenFiles.java | 4 +-- .../tools/sjavac/OverlappingSrcDst.java | 4 +-- 162 files changed, 163 insertions(+), 529 deletions(-) diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/module-info.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/module-info.java index 3b24d984582..b3622bdfb09 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/Foo.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/Foo.java index e12c8d27504..204b866a733 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/Foo.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/Foo.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/inpackage.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/inpackage.html index 190b90beb8c..bc92f003116 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/inpackage.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/inpackage.html @@ -4,9 +4,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as -published by the Free Software Foundation. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the LICENSE file that accompanied this code. +published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/SubReadme.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/SubReadme.html index 513680ac8b8..0da2414403c 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/SubReadme.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/SubReadme.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/sub-dir-1/SubSubReadme.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/sub-dir-1/SubSubReadme.html index 7f9e05df2e9..a1e9fca68b9 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/sub-dir-1/SubSubReadme.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/doc-files/sub-dir/sub-dir-1/SubSubReadme.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/package.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/package.html index 4d26a79c738..b4dcb45909d 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/package.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme.mdle/p/package.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/module-info.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/module-info.java index 16a9fc13086..9690e2c1a30 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/Foo.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/Foo.java index 5ef9edd4457..edcaf9cd70f 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/Foo.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/Foo.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/inpackage.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/inpackage.html index 4f1ef790300..66cb814e33c 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/inpackage.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/inpackage.html @@ -4,9 +4,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as -published by the Free Software Foundation. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the LICENSE file that accompanied this code. +published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/SubReadme.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/SubReadme.html index d94e57112bc..a7529698ab2 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/SubReadme.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/SubReadme.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/sub-dir-1/SubSubReadme.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/sub-dir-1/SubSubReadme.html index 7f9e05df2e9..a1e9fca68b9 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/sub-dir-1/SubSubReadme.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/doc-files/sub-dir/sub-dir-1/SubSubReadme.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/package.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/package.html index 4e77e3800f6..9e9a0658fc0 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/package.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/acme2.mdle/p2/package.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/overview.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/overview.html index 7a90f6b2c06..2f0ab9b2864 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/overview.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/modules/overview.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/Foo.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/Foo.java index 8e1960b5788..2a7b295de88 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/Foo.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/Foo.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/inpackage.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/inpackage.html index 4879d78d5a4..37af6ad278e 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/inpackage.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/inpackage.html @@ -4,9 +4,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as -published by the Free Software Foundation. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the LICENSE file that accompanied this code. +published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/sub-dir/SubReadme.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/sub-dir/SubReadme.html index c8177412e9b..9663a971ec0 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/sub-dir/SubReadme.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p1/doc-files/sub-dir/SubReadme.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/Foo.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/Foo.java index 306747b4f78..67d5dfb3fe5 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/Foo.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/Foo.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case1.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case1.html index e3b3088a8b8..71d40ba294d 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case1.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case1.html @@ -7,9 +7,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case2.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case2.html index 2ec914ac5ef..683f51a6eac 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case2.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case2.html @@ -7,9 +7,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case3.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case3.html index 866be8fd518..e39dd589756 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case3.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case3.html @@ -7,9 +7,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case4.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case4.html index daf9fa03e4c..f20bbc7397b 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case4.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/packages/p2/doc-files/case4.html @@ -7,9 +7,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/Foo.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/Foo.java index 48210d11a77..0a692b4145c 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/Foo.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/Foo.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/doc-file/SubReadme.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/doc-file/SubReadme.html index 3a3f1839090..af1116069d4 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/doc-file/SubReadme.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/doc-file/SubReadme.html @@ -5,9 +5,7 @@ ~ ~ This code is free software; you can redistribute it and/or modify it ~ under the terms of the GNU General Public License version 2 only, as - ~ published by the Free Software Foundation. Oracle designates this - ~ particular file as subject to the "Classpath" exception as provided - ~ by Oracle in the LICENSE file that accompanied this code. + ~ published by the Free Software Foundation. ~ ~ This code is distributed in the hope that it will be useful, but WITHOUT ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/inpackage.html b/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/inpackage.html index dc2f816aec0..a7dc9b95a2e 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/inpackage.html +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/unnamed/doc-files/inpackage.html @@ -4,9 +4,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as -published by the Free Software Foundation. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the LICENSE file that accompanied this code. +published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java b/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java index c679dbb7925..5a9a3ac51dd 100644 --- a/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java +++ b/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java b/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java index 380de5587e4..046c3592f5f 100644 --- a/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java +++ b/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java index 92c4c196cc7..111b8626ce2 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/A.java b/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/A.java index f6b9e0ce4f6..3bbabcd6d92 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/A.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/A.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/package.html b/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/package.html index 3cfa860ad70..b9d35c3a0a8 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/package.html +++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/pkg3/package.html @@ -8,9 +8,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as -published by the Free Software Foundation. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the LICENSE file that accompanied this code. +published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java b/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java index 6aa3b7861e9..73577851754 100644 --- a/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java +++ b/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleA/concealedpkgmdlA/ConcealedClassInModuleA.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleA/concealedpkgmdlA/ConcealedClassInModuleA.java index 48ba07ea667..d8b2f447eea 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleA/concealedpkgmdlA/ConcealedClassInModuleA.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleA/concealedpkgmdlA/ConcealedClassInModuleA.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleA/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleA/module-info.java index 9dad71bfaa4..23aeea1dbd1 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleA/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleA/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleA/testpkgmdlA/TestClassInModuleA.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleA/testpkgmdlA/TestClassInModuleA.java index 33e8f19e56c..bcedb1af624 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleA/testpkgmdlA/TestClassInModuleA.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleA/testpkgmdlA/TestClassInModuleA.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/module-info.java index 68c42f70a16..f22ca9b8d36 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterface2InModuleB.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterface2InModuleB.java index df9ac6e1106..8ef550d5b0a 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterface2InModuleB.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterface2InModuleB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterfaceInModuleB.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterfaceInModuleB.java index 174c8c1f6ad..0ec90537a19 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterfaceInModuleB.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterfaceInModuleB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg3mdlB/TestClassLinkOption.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg3mdlB/TestClassLinkOption.java index 425b9173922..9cf79551d46 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg3mdlB/TestClassLinkOption.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkg3mdlB/TestClassLinkOption.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClass2InModuleB.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClass2InModuleB.java index 81b613aef3a..462dc426982 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClass2InModuleB.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClass2InModuleB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClassInModuleB.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClassInModuleB.java index ed440f3a88c..3faa01bc579 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClassInModuleB.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClassInModuleB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleC/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleC/module-info.java index 2551792d689..37f979f8d24 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleC/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleC/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleC/testpkgmdlC/TestClassInModuleC.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleC/testpkgmdlC/TestClassInModuleC.java index 956b13d7ecd..c3d9db46ad3 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleC/testpkgmdlC/TestClassInModuleC.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleC/testpkgmdlC/TestClassInModuleC.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/module-info.java index cf29f0dafe1..4f039d01680 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/testpkgmdlNoExport/TestClassInModuleNoExport.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/testpkgmdlNoExport/TestClassInModuleNoExport.java index b4b69a8a4e5..bbcfcfc9a84 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/testpkgmdlNoExport/TestClassInModuleNoExport.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleNoExport/testpkgmdlNoExport/TestClassInModuleNoExport.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduleT/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/moduleT/module-info.java index 653c11b2c0a..6af624428dd 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduleT/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduleT/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduletags/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/moduletags/module-info.java index 8c9df22713e..37ab07c9d9a 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduletags/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduletags/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/moduletags/testpkgmdltags/TestClassInModuleTags.java b/test/langtools/jdk/javadoc/doclet/testModules/moduletags/testpkgmdltags/TestClassInModuleTags.java index 4ac2bc81393..512453bccb0 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/moduletags/testpkgmdltags/TestClassInModuleTags.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/moduletags/testpkgmdltags/TestClassInModuleTags.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java b/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java index c162ca085fe..0db22cefe29 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.java b/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.java index 947033a42b7..7bc8c32c114 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule/TestClassNoModule.java b/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule/TestClassNoModule.java index 018413ec8a0..d9c00ae6ea7 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule/TestClassNoModule.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule/TestClassNoModule.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule1/TestClassNoModulePkg1.java b/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule1/TestClassNoModulePkg1.java index 127437fda6b..33a487265ec 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule1/TestClassNoModulePkg1.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/testpkgnomodule1/TestClassNoModulePkg1.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg5/TestEnum.java b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg5/TestEnum.java index 0c2cd870995..ba79ee13908 100644 --- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg5/TestEnum.java +++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg5/TestEnum.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testOverview/msrc/module-info.java b/test/langtools/jdk/javadoc/doclet/testOverview/msrc/module-info.java index c5d6328c3da..c86287ad6b3 100644 --- a/test/langtools/jdk/javadoc/doclet/testOverview/msrc/module-info.java +++ b/test/langtools/jdk/javadoc/doclet/testOverview/msrc/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testPackageDescription/pkg/package-info.java b/test/langtools/jdk/javadoc/doclet/testPackageDescription/pkg/package-info.java index b37ee3797fa..1fcb90cf867 100644 --- a/test/langtools/jdk/javadoc/doclet/testPackageDescription/pkg/package-info.java +++ b/test/langtools/jdk/javadoc/doclet/testPackageDescription/pkg/package-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java index 51a82e9a4fe..9d37a85ad8f 100644 --- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/doclet/testValueTag/pkg3/RT.java b/test/langtools/jdk/javadoc/doclet/testValueTag/pkg3/RT.java index f6917390aa1..bcdeafc5578 100644 --- a/test/langtools/jdk/javadoc/doclet/testValueTag/pkg3/RT.java +++ b/test/langtools/jdk/javadoc/doclet/testValueTag/pkg3/RT.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/jdk/javadoc/tool/TestScriptInComment.java b/test/langtools/jdk/javadoc/tool/TestScriptInComment.java index 2b404fc8a2b..8ab3c2daddf 100644 --- a/test/langtools/jdk/javadoc/tool/TestScriptInComment.java +++ b/test/langtools/jdk/javadoc/tool/TestScriptInComment.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/8133247/T8133247.java b/test/langtools/tools/javac/8133247/T8133247.java index 5eb8258ad18..c463cf15772 100644 --- a/test/langtools/tools/javac/8133247/T8133247.java +++ b/test/langtools/tools/javac/8133247/T8133247.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/8133247/p/A.java b/test/langtools/tools/javac/8133247/p/A.java index f0d40e61afd..6a725854edc 100644 --- a/test/langtools/tools/javac/8133247/p/A.java +++ b/test/langtools/tools/javac/8133247/p/A.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/8133247/p/B.java b/test/langtools/tools/javac/8133247/p/B.java index a9f330866fb..3382ebcb08c 100644 --- a/test/langtools/tools/javac/8133247/p/B.java +++ b/test/langtools/tools/javac/8133247/p/B.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/8133247/p/I.java b/test/langtools/tools/javac/8133247/p/I.java index 02df4338f7f..788203311bb 100644 --- a/test/langtools/tools/javac/8133247/p/I.java +++ b/test/langtools/tools/javac/8133247/p/I.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/8169345/T8169345b.java b/test/langtools/tools/javac/8169345/T8169345b.java index 898df5ed585..74045880775 100644 --- a/test/langtools/tools/javac/8169345/T8169345b.java +++ b/test/langtools/tools/javac/8169345/T8169345b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/8169345/T8169345c.java b/test/langtools/tools/javac/8169345/T8169345c.java index 1c6bbddac5c..c3fee2c4a3c 100644 --- a/test/langtools/tools/javac/8169345/T8169345c.java +++ b/test/langtools/tools/javac/8169345/T8169345c.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/DefiniteAssignment/T8204610.java b/test/langtools/tools/javac/DefiniteAssignment/T8204610.java index 2827b37038d..006daa03dc6 100644 --- a/test/langtools/tools/javac/DefiniteAssignment/T8204610.java +++ b/test/langtools/tools/javac/DefiniteAssignment/T8204610.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/annotations/8145489/foo/Anno.java b/test/langtools/tools/javac/annotations/8145489/foo/Anno.java index e4d46603bd8..b05206595dd 100644 --- a/test/langtools/tools/javac/annotations/8145489/foo/Anno.java +++ b/test/langtools/tools/javac/annotations/8145489/foo/Anno.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/annotations/8145489/foo/Status.java b/test/langtools/tools/javac/annotations/8145489/foo/Status.java index 07501cf01af..27f6930f132 100644 --- a/test/langtools/tools/javac/annotations/8145489/foo/Status.java +++ b/test/langtools/tools/javac/annotations/8145489/foo/Status.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/annotations/8145489/foo/package-info.java b/test/langtools/tools/javac/annotations/8145489/foo/package-info.java index caa32ada784..9176c800638 100644 --- a/test/langtools/tools/javac/annotations/8145489/foo/package-info.java +++ b/test/langtools/tools/javac/annotations/8145489/foo/package-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/classreader/8171132/BadConstantValue.java b/test/langtools/tools/javac/classreader/8171132/BadConstantValue.java index 19d167db707..7b624c1b3c1 100644 --- a/test/langtools/tools/javac/classreader/8171132/BadConstantValue.java +++ b/test/langtools/tools/javac/classreader/8171132/BadConstantValue.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/FutureVarNotAllowed.java b/test/langtools/tools/javac/diags/examples/FutureVarNotAllowed.java index 6de448951a1..0ea7002380f 100644 --- a/test/langtools/tools/javac/diags/examples/FutureVarNotAllowed.java +++ b/test/langtools/tools/javac/diags/examples/FutureVarNotAllowed.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/IllegalRefToVarType.java b/test/langtools/tools/javac/diags/examples/IllegalRefToVarType.java index 6de5c58db67..69aa9beb96b 100644 --- a/test/langtools/tools/javac/diags/examples/IllegalRefToVarType.java +++ b/test/langtools/tools/javac/diags/examples/IllegalRefToVarType.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/IllegalSignature.java b/test/langtools/tools/javac/diags/examples/IllegalSignature.java index ca983b9fbbe..a9b64b41afa 100644 --- a/test/langtools/tools/javac/diags/examples/IllegalSignature.java +++ b/test/langtools/tools/javac/diags/examples/IllegalSignature.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalCantInferNull.java b/test/langtools/tools/javac/diags/examples/LocalCantInferNull.java index 69e41fb245a..f04bdbbbe3d 100644 --- a/test/langtools/tools/javac/diags/examples/LocalCantInferNull.java +++ b/test/langtools/tools/javac/diags/examples/LocalCantInferNull.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalCantInferVoid.java b/test/langtools/tools/javac/diags/examples/LocalCantInferVoid.java index b1c390f55b5..d26cb71873b 100644 --- a/test/langtools/tools/javac/diags/examples/LocalCantInferVoid.java +++ b/test/langtools/tools/javac/diags/examples/LocalCantInferVoid.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalLambdaMissingTarget.java b/test/langtools/tools/javac/diags/examples/LocalLambdaMissingTarget.java index 49c58653c06..7a0719c4831 100644 --- a/test/langtools/tools/javac/diags/examples/LocalLambdaMissingTarget.java +++ b/test/langtools/tools/javac/diags/examples/LocalLambdaMissingTarget.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalMissingInit.java b/test/langtools/tools/javac/diags/examples/LocalMissingInit.java index eb0ced4c23e..1c03fc0056c 100644 --- a/test/langtools/tools/javac/diags/examples/LocalMissingInit.java +++ b/test/langtools/tools/javac/diags/examples/LocalMissingInit.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalMrefMissingTarget.java b/test/langtools/tools/javac/diags/examples/LocalMrefMissingTarget.java index f05b490c5cc..6982676bdcb 100644 --- a/test/langtools/tools/javac/diags/examples/LocalMrefMissingTarget.java +++ b/test/langtools/tools/javac/diags/examples/LocalMrefMissingTarget.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalRedundantType.java b/test/langtools/tools/javac/diags/examples/LocalRedundantType.java index 6e7d4e524e2..498bc07e884 100644 --- a/test/langtools/tools/javac/diags/examples/LocalRedundantType.java +++ b/test/langtools/tools/javac/diags/examples/LocalRedundantType.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/LocalSelfRef.java b/test/langtools/tools/javac/diags/examples/LocalSelfRef.java index bcbf8cb75bf..567afd2931b 100644 --- a/test/langtools/tools/javac/diags/examples/LocalSelfRef.java +++ b/test/langtools/tools/javac/diags/examples/LocalSelfRef.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabled.java b/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabled.java index 3aaeccc09a9..0fbcbd00109 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabled.java +++ b/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabled.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabledPlural.java b/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabledPlural.java index 734dab010fe..66ee89ecea9 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabledPlural.java +++ b/test/langtools/tools/javac/diags/examples/PreviewFeatureDisabledPlural.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java b/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java index 95604879686..c1d669d4c81 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java +++ b/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewFilename.java b/test/langtools/tools/javac/diags/examples/PreviewFilename.java index 10b8ecbdb2b..cb112127942 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewFilename.java +++ b/test/langtools/tools/javac/diags/examples/PreviewFilename.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java b/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java index 39efd723ce8..98b9bce94cb 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java +++ b/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java b/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java index 722ee364b81..43d46cf4b5a 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java +++ b/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPluralBar.java b/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPluralBar.java index 9e1f2e7acf9..d37468bbf4e 100644 --- a/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPluralBar.java +++ b/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPluralBar.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/StatExprExpected.java b/test/langtools/tools/javac/diags/examples/StatExprExpected.java index b0091820610..c388989ee33 100644 --- a/test/langtools/tools/javac/diags/examples/StatExprExpected.java +++ b/test/langtools/tools/javac/diags/examples/StatExprExpected.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/VarNotAllowed.java b/test/langtools/tools/javac/diags/examples/VarNotAllowed.java index eb5afc8dbd4..41d23e834b0 100644 --- a/test/langtools/tools/javac/diags/examples/VarNotAllowed.java +++ b/test/langtools/tools/javac/diags/examples/VarNotAllowed.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/VarNotAllowedArray.java b/test/langtools/tools/javac/diags/examples/VarNotAllowedArray.java index 036f9a23224..cf6e6d48666 100644 --- a/test/langtools/tools/javac/diags/examples/VarNotAllowedArray.java +++ b/test/langtools/tools/javac/diags/examples/VarNotAllowedArray.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/VarNotAllowedCompound.java b/test/langtools/tools/javac/diags/examples/VarNotAllowedCompound.java index 78edae64ee4..3a04c395dde 100644 --- a/test/langtools/tools/javac/diags/examples/VarNotAllowedCompound.java +++ b/test/langtools/tools/javac/diags/examples/VarNotAllowedCompound.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/VarNotAllowedExplicitLambda.java b/test/langtools/tools/javac/diags/examples/VarNotAllowedExplicitLambda.java index 362d9a3b8c7..ff17e617b36 100644 --- a/test/langtools/tools/javac/diags/examples/VarNotAllowedExplicitLambda.java +++ b/test/langtools/tools/javac/diags/examples/VarNotAllowedExplicitLambda.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/VarNotAllowedHere.java b/test/langtools/tools/javac/diags/examples/VarNotAllowedHere.java index 03aa3174400..e1514478110 100644 --- a/test/langtools/tools/javac/diags/examples/VarNotAllowedHere.java +++ b/test/langtools/tools/javac/diags/examples/VarNotAllowedHere.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/diags/examples/WrongNumberTypeArgsFragment.java b/test/langtools/tools/javac/diags/examples/WrongNumberTypeArgsFragment.java index f8a08d86445..c1777bba20f 100644 --- a/test/langtools/tools/javac/diags/examples/WrongNumberTypeArgsFragment.java +++ b/test/langtools/tools/javac/diags/examples/WrongNumberTypeArgsFragment.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/doctree/SummaryTest.java b/test/langtools/tools/javac/doctree/SummaryTest.java index 3973c27a338..11231bae122 100644 --- a/test/langtools/tools/javac/doctree/SummaryTest.java +++ b/test/langtools/tools/javac/doctree/SummaryTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/diamond/7002837/T7002837.java b/test/langtools/tools/javac/generics/diamond/7002837/T7002837.java index 153fcf1d101..948cf260949 100644 --- a/test/langtools/tools/javac/generics/diamond/7002837/T7002837.java +++ b/test/langtools/tools/javac/generics/diamond/7002837/T7002837.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/diamond/neg/T8078473.java b/test/langtools/tools/javac/generics/diamond/neg/T8078473.java index bd659893a7b..1ed46f1fd79 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/T8078473.java +++ b/test/langtools/tools/javac/generics/diamond/neg/T8078473.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/diamond/neg/T8078473_2.java b/test/langtools/tools/javac/generics/diamond/neg/T8078473_2.java index 6a8b99ca3dd..c90e1bff20a 100644 --- a/test/langtools/tools/javac/generics/diamond/neg/T8078473_2.java +++ b/test/langtools/tools/javac/generics/diamond/neg/T8078473_2.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8067767/T8067767.java b/test/langtools/tools/javac/generics/inference/8067767/T8067767.java index 4aa9376d16f..a07ea72054d 100644 --- a/test/langtools/tools/javac/generics/inference/8067767/T8067767.java +++ b/test/langtools/tools/javac/generics/inference/8067767/T8067767.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8077306/T8077306.java b/test/langtools/tools/javac/generics/inference/8077306/T8077306.java index 035bfda0ff9..d23da263647 100644 --- a/test/langtools/tools/javac/generics/inference/8077306/T8077306.java +++ b/test/langtools/tools/javac/generics/inference/8077306/T8077306.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8141613/T8141613.java b/test/langtools/tools/javac/generics/inference/8141613/T8141613.java index 44c6710ca2c..58dbd544370 100644 --- a/test/langtools/tools/javac/generics/inference/8141613/T8141613.java +++ b/test/langtools/tools/javac/generics/inference/8141613/T8141613.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8147493/T8147493a.java b/test/langtools/tools/javac/generics/inference/8147493/T8147493a.java index 5fe2e101418..6463dca5677 100644 --- a/test/langtools/tools/javac/generics/inference/8147493/T8147493a.java +++ b/test/langtools/tools/javac/generics/inference/8147493/T8147493a.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8147493/T8147493b.java b/test/langtools/tools/javac/generics/inference/8147493/T8147493b.java index 1e6291b8ce8..015e56b2283 100644 --- a/test/langtools/tools/javac/generics/inference/8147493/T8147493b.java +++ b/test/langtools/tools/javac/generics/inference/8147493/T8147493b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8152832/T8152832.java b/test/langtools/tools/javac/generics/inference/8152832/T8152832.java index c3908162cf6..ac35aa076c1 100644 --- a/test/langtools/tools/javac/generics/inference/8152832/T8152832.java +++ b/test/langtools/tools/javac/generics/inference/8152832/T8152832.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8156954/T8156954.java b/test/langtools/tools/javac/generics/inference/8156954/T8156954.java index 0baab4239ab..2e5d22cda48 100644 --- a/test/langtools/tools/javac/generics/inference/8156954/T8156954.java +++ b/test/langtools/tools/javac/generics/inference/8156954/T8156954.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8157149/T8157149b.java b/test/langtools/tools/javac/generics/inference/8157149/T8157149b.java index adacefd5fb4..1ca1933f571 100644 --- a/test/langtools/tools/javac/generics/inference/8157149/T8157149b.java +++ b/test/langtools/tools/javac/generics/inference/8157149/T8157149b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8157149/T8157149c.java b/test/langtools/tools/javac/generics/inference/8157149/T8157149c.java index 41fc4207a29..b09d6224060 100644 --- a/test/langtools/tools/javac/generics/inference/8157149/T8157149c.java +++ b/test/langtools/tools/javac/generics/inference/8157149/T8157149c.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8158355/T8158355.java b/test/langtools/tools/javac/generics/inference/8158355/T8158355.java index 08c7ae280a3..7dd5f223233 100644 --- a/test/langtools/tools/javac/generics/inference/8158355/T8158355.java +++ b/test/langtools/tools/javac/generics/inference/8158355/T8158355.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8159680/T8159680.java b/test/langtools/tools/javac/generics/inference/8159680/T8159680.java index 0f8ac189528..65a862006ea 100644 --- a/test/langtools/tools/javac/generics/inference/8159680/T8159680.java +++ b/test/langtools/tools/javac/generics/inference/8159680/T8159680.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8164399/T8164399.java b/test/langtools/tools/javac/generics/inference/8164399/T8164399.java index a069edc2516..52558f4c5e5 100644 --- a/test/langtools/tools/javac/generics/inference/8164399/T8164399.java +++ b/test/langtools/tools/javac/generics/inference/8164399/T8164399.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8168134/T8168134.java b/test/langtools/tools/javac/generics/inference/8168134/T8168134.java index a1e4a5735ce..18e150751ac 100644 --- a/test/langtools/tools/javac/generics/inference/8168134/T8168134.java +++ b/test/langtools/tools/javac/generics/inference/8168134/T8168134.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8174249/T8174249a.java b/test/langtools/tools/javac/generics/inference/8174249/T8174249a.java index 80ebfa48d75..014d9e7e128 100644 --- a/test/langtools/tools/javac/generics/inference/8174249/T8174249a.java +++ b/test/langtools/tools/javac/generics/inference/8174249/T8174249a.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8174249/T8174249b.java b/test/langtools/tools/javac/generics/inference/8174249/T8174249b.java index a7f175fc0d8..e4bd64f8f9f 100644 --- a/test/langtools/tools/javac/generics/inference/8174249/T8174249b.java +++ b/test/langtools/tools/javac/generics/inference/8174249/T8174249b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8176534/TestUncheckedCalls.java b/test/langtools/tools/javac/generics/inference/8176534/TestUncheckedCalls.java index 233bf293ef6..07672ac6a95 100644 --- a/test/langtools/tools/javac/generics/inference/8176534/TestUncheckedCalls.java +++ b/test/langtools/tools/javac/generics/inference/8176534/TestUncheckedCalls.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8177097/T8177097a.java b/test/langtools/tools/javac/generics/inference/8177097/T8177097a.java index 98bbd451be2..fc762f51622 100644 --- a/test/langtools/tools/javac/generics/inference/8177097/T8177097a.java +++ b/test/langtools/tools/javac/generics/inference/8177097/T8177097a.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8177097/T8177097b.java b/test/langtools/tools/javac/generics/inference/8177097/T8177097b.java index a7d2b5ccfd6..87f2927e5a7 100644 --- a/test/langtools/tools/javac/generics/inference/8177097/T8177097b.java +++ b/test/langtools/tools/javac/generics/inference/8177097/T8177097b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8178150/T8178150.java b/test/langtools/tools/javac/generics/inference/8178150/T8178150.java index 134d68c6b81..4e7f3c3b5b4 100644 --- a/test/langtools/tools/javac/generics/inference/8178150/T8178150.java +++ b/test/langtools/tools/javac/generics/inference/8178150/T8178150.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/generics/inference/8178427/T8178427.java b/test/langtools/tools/javac/generics/inference/8178427/T8178427.java index 21c97dbb08d..7229781cd1d 100644 --- a/test/langtools/tools/javac/generics/inference/8178427/T8178427.java +++ b/test/langtools/tools/javac/generics/inference/8178427/T8178427.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8063054/T8063054a.java b/test/langtools/tools/javac/lambda/8063054/T8063054a.java index 1e36015e4b6..ea3b2e4ea5c 100644 --- a/test/langtools/tools/javac/lambda/8063054/T8063054a.java +++ b/test/langtools/tools/javac/lambda/8063054/T8063054a.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8063054/T8063054b.java b/test/langtools/tools/javac/lambda/8063054/T8063054b.java index 454e9faeaef..e58185fcd19 100644 --- a/test/langtools/tools/javac/lambda/8063054/T8063054b.java +++ b/test/langtools/tools/javac/lambda/8063054/T8063054b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8134329/T8134329.java b/test/langtools/tools/javac/lambda/8134329/T8134329.java index eccf9ae65c6..661131a7faf 100644 --- a/test/langtools/tools/javac/lambda/8134329/T8134329.java +++ b/test/langtools/tools/javac/lambda/8134329/T8134329.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8142876/T8142876.java b/test/langtools/tools/javac/lambda/8142876/T8142876.java index e5c99c12795..6eebdaef106 100644 --- a/test/langtools/tools/javac/lambda/8142876/T8142876.java +++ b/test/langtools/tools/javac/lambda/8142876/T8142876.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8148128/T8148128.java b/test/langtools/tools/javac/lambda/8148128/T8148128.java index 8ef33c304a1..295f8ebaf7d 100644 --- a/test/langtools/tools/javac/lambda/8148128/T8148128.java +++ b/test/langtools/tools/javac/lambda/8148128/T8148128.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8188144/T8188144.java b/test/langtools/tools/javac/lambda/8188144/T8188144.java index 4e9aa1fc9e3..fc1411f990a 100644 --- a/test/langtools/tools/javac/lambda/8188144/T8188144.java +++ b/test/langtools/tools/javac/lambda/8188144/T8188144.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/8210495/T8210495.java b/test/langtools/tools/javac/lambda/8210495/T8210495.java index 73626f3199a..508501cdfec 100644 --- a/test/langtools/tools/javac/lambda/8210495/T8210495.java +++ b/test/langtools/tools/javac/lambda/8210495/T8210495.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/T8195598.java b/test/langtools/tools/javac/lambda/T8195598.java index f40a3290181..102e45c283d 100644 --- a/test/langtools/tools/javac/lambda/T8195598.java +++ b/test/langtools/tools/javac/lambda/T8195598.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/8147546/T8147546a.java b/test/langtools/tools/javac/lambda/speculative/8147546/T8147546a.java index 0608089b735..32416da4671 100644 --- a/test/langtools/tools/javac/lambda/speculative/8147546/T8147546a.java +++ b/test/langtools/tools/javac/lambda/speculative/8147546/T8147546a.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/8147546/T8147546b.java b/test/langtools/tools/javac/lambda/speculative/8147546/T8147546b.java index ce366738c7c..8c546b3eb23 100644 --- a/test/langtools/tools/javac/lambda/speculative/8147546/T8147546b.java +++ b/test/langtools/tools/javac/lambda/speculative/8147546/T8147546b.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/8154180/T8154180a.java b/test/langtools/tools/javac/lambda/speculative/8154180/T8154180a.java index eebebd75712..c0027b2a63a 100644 --- a/test/langtools/tools/javac/lambda/speculative/8154180/T8154180a.java +++ b/test/langtools/tools/javac/lambda/speculative/8154180/T8154180a.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/InferStrict.java b/test/langtools/tools/javac/lambda/speculative/InferStrict.java index cdf71ccc62d..16b6748f523 100644 --- a/test/langtools/tools/javac/lambda/speculative/InferStrict.java +++ b/test/langtools/tools/javac/lambda/speculative/InferStrict.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/InferWeak.java b/test/langtools/tools/javac/lambda/speculative/InferWeak.java index c75b5d60bdf..59638078be8 100644 --- a/test/langtools/tools/javac/lambda/speculative/InferWeak.java +++ b/test/langtools/tools/javac/lambda/speculative/InferWeak.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/NestedLambdaGenerics.java b/test/langtools/tools/javac/lambda/speculative/NestedLambdaGenerics.java index ea7d71a50a9..7357e4e3702 100644 --- a/test/langtools/tools/javac/lambda/speculative/NestedLambdaGenerics.java +++ b/test/langtools/tools/javac/lambda/speculative/NestedLambdaGenerics.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/NestedLambdaNoGenerics.java b/test/langtools/tools/javac/lambda/speculative/NestedLambdaNoGenerics.java index 634674892fa..8b5094620d7 100644 --- a/test/langtools/tools/javac/lambda/speculative/NestedLambdaNoGenerics.java +++ b/test/langtools/tools/javac/lambda/speculative/NestedLambdaNoGenerics.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/T8046685.java b/test/langtools/tools/javac/lambda/speculative/T8046685.java index ba5a97168aa..685588072a7 100644 --- a/test/langtools/tools/javac/lambda/speculative/T8046685.java +++ b/test/langtools/tools/javac/lambda/speculative/T8046685.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/T8055984.java b/test/langtools/tools/javac/lambda/speculative/T8055984.java index 5a063b692ae..5d0b35334a6 100644 --- a/test/langtools/tools/javac/lambda/speculative/T8055984.java +++ b/test/langtools/tools/javac/lambda/speculative/T8055984.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/T8077247.java b/test/langtools/tools/javac/lambda/speculative/T8077247.java index 1ce3eb3892f..eb5ccbe1f25 100644 --- a/test/langtools/tools/javac/lambda/speculative/T8077247.java +++ b/test/langtools/tools/javac/lambda/speculative/T8077247.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lambda/speculative/T8078093.java b/test/langtools/tools/javac/lambda/speculative/T8078093.java index c059235003f..cabf43a33c7 100644 --- a/test/langtools/tools/javac/lambda/speculative/T8078093.java +++ b/test/langtools/tools/javac/lambda/speculative/T8078093.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/T8191893.java b/test/langtools/tools/javac/lvti/T8191893.java index c36f7068730..df3d708b44f 100644 --- a/test/langtools/tools/javac/lvti/T8191893.java +++ b/test/langtools/tools/javac/lvti/T8191893.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/T8191959.java b/test/langtools/tools/javac/lvti/T8191959.java index 3cf6815de4e..5a1977641a3 100644 --- a/test/langtools/tools/javac/lvti/T8191959.java +++ b/test/langtools/tools/javac/lvti/T8191959.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/T8200199.java b/test/langtools/tools/javac/lvti/T8200199.java index 259ef81fa15..a9107921669 100644 --- a/test/langtools/tools/javac/lvti/T8200199.java +++ b/test/langtools/tools/javac/lvti/T8200199.java @@ -1,28 +1,3 @@ -/* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - /* * @test /nodynamiccopyright/ * @bug 8200199 diff --git a/test/langtools/tools/javac/lvti/T8200199.out b/test/langtools/tools/javac/lvti/T8200199.out index 48b000b5cf6..f8f6b555627 100644 --- a/test/langtools/tools/javac/lvti/T8200199.out +++ b/test/langtools/tools/javac/lvti/T8200199.out @@ -1,6 +1,6 @@ -T8200199.java:46:13: compiler.warn.local.redundant.type -T8200199.java:47:18: compiler.warn.local.redundant.type -T8200199.java:48:23: compiler.warn.local.redundant.type +T8200199.java:21:13: compiler.warn.local.redundant.type +T8200199.java:22:18: compiler.warn.local.redundant.type +T8200199.java:23:23: compiler.warn.local.redundant.type - compiler.err.warnings.and.werror 1 error 3 warnings diff --git a/test/langtools/tools/javac/lvti/TestBadArray.java b/test/langtools/tools/javac/lvti/TestBadArray.java index 0957c5055df..e5968c8c951 100644 --- a/test/langtools/tools/javac/lvti/TestBadArray.java +++ b/test/langtools/tools/javac/lvti/TestBadArray.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.java b/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.java index 8bfe7c37725..231d36e9a3a 100644 --- a/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.java +++ b/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.java @@ -1,28 +1,3 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - /* * @test /nodynamiccopyright/ * @bug 8177466 diff --git a/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.out b/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.out index 220fc9cd2d1..70bad11c4b0 100644 --- a/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.out +++ b/test/langtools/tools/javac/lvti/badTypeReference/BadTypeReference.out @@ -1,3 +1,3 @@ -BadTypeReference.java:39:9: compiler.err.illegal.ref.to.var.type -BadTypeReference.java:40:21: compiler.err.illegal.ref.to.var.type +BadTypeReference.java:14:9: compiler.err.illegal.ref.to.var.type +BadTypeReference.java:15:21: compiler.err.illegal.ref.to.var.type 2 errors diff --git a/test/langtools/tools/javac/lvti/badTypeReference/pkg/nested/var/A.java b/test/langtools/tools/javac/lvti/badTypeReference/pkg/nested/var/A.java index 320e0dc859c..0760bb32537 100644 --- a/test/langtools/tools/javac/lvti/badTypeReference/pkg/nested/var/A.java +++ b/test/langtools/tools/javac/lvti/badTypeReference/pkg/nested/var/A.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/badTypeReference/pkg/var.java b/test/langtools/tools/javac/lvti/badTypeReference/pkg/var.java index 39910388528..7b0c3989c9e 100644 --- a/test/langtools/tools/javac/lvti/badTypeReference/pkg/var.java +++ b/test/langtools/tools/javac/lvti/badTypeReference/pkg/var.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/harness/InferredType.java b/test/langtools/tools/javac/lvti/harness/InferredType.java index 2492aa68a41..d6caf91da10 100644 --- a/test/langtools/tools/javac/lvti/harness/InferredType.java +++ b/test/langtools/tools/javac/lvti/harness/InferredType.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java b/test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java index 4d7455cba1f..98194cd4a13 100644 --- a/test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java +++ b/test/langtools/tools/javac/lvti/harness/LocalVariableInferenceTester.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/harness/NonDenotableTest.java b/test/langtools/tools/javac/lvti/harness/NonDenotableTest.java index a05a00ffa83..4e922fd80bf 100644 --- a/test/langtools/tools/javac/lvti/harness/NonDenotableTest.java +++ b/test/langtools/tools/javac/lvti/harness/NonDenotableTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/harness/PrimitiveTypeTest.java b/test/langtools/tools/javac/lvti/harness/PrimitiveTypeTest.java index 6f5a1c345f7..6876d66e5cc 100644 --- a/test/langtools/tools/javac/lvti/harness/PrimitiveTypeTest.java +++ b/test/langtools/tools/javac/lvti/harness/PrimitiveTypeTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/harness/ReferenceTypeTest.java b/test/langtools/tools/javac/lvti/harness/ReferenceTypeTest.java index 26e434d5585..913894d249e 100644 --- a/test/langtools/tools/javac/lvti/harness/ReferenceTypeTest.java +++ b/test/langtools/tools/javac/lvti/harness/ReferenceTypeTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/lvti/harness/UpperBounds.java b/test/langtools/tools/javac/lvti/harness/UpperBounds.java index 83ca6992b17..41ac8fd5201 100644 --- a/test/langtools/tools/javac/lvti/harness/UpperBounds.java +++ b/test/langtools/tools/javac/lvti/harness/UpperBounds.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/modules/T8168854/pack1/Outer.java b/test/langtools/tools/javac/modules/T8168854/pack1/Outer.java index 1f3ab6af5fd..de8263b7980 100644 --- a/test/langtools/tools/javac/modules/T8168854/pack1/Outer.java +++ b/test/langtools/tools/javac/modules/T8168854/pack1/Outer.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/modules/T8168854/pack1/Outer1.java b/test/langtools/tools/javac/modules/T8168854/pack1/Outer1.java index 6b9a5074da1..e9942725161 100644 --- a/test/langtools/tools/javac/modules/T8168854/pack1/Outer1.java +++ b/test/langtools/tools/javac/modules/T8168854/pack1/Outer1.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/overload/T8176265.java b/test/langtools/tools/javac/overload/T8176265.java index ecd014744eb..e76233c599c 100644 --- a/test/langtools/tools/javac/overload/T8176265.java +++ b/test/langtools/tools/javac/overload/T8176265.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/preview/PreviewOptionTest.java b/test/langtools/tools/javac/preview/PreviewOptionTest.java index fe880738ad5..d8ffa0534cb 100644 --- a/test/langtools/tools/javac/preview/PreviewOptionTest.java +++ b/test/langtools/tools/javac/preview/PreviewOptionTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/preview/classReaderTest/Bar.java b/test/langtools/tools/javac/preview/classReaderTest/Bar.java index 65a0687a4e7..3db6f5d7ecf 100644 --- a/test/langtools/tools/javac/preview/classReaderTest/Bar.java +++ b/test/langtools/tools/javac/preview/classReaderTest/Bar.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java index eabe5dfabe2..a4602c17658 100644 --- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java +++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javadoc/lib/ToyDoclet.java b/test/langtools/tools/javadoc/lib/ToyDoclet.java index 1b7c7a17fc8..66457cfac7f 100644 --- a/test/langtools/tools/javadoc/lib/ToyDoclet.java +++ b/test/langtools/tools/javadoc/lib/ToyDoclet.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/javap/typeAnnotations/InvisibleParameterAnnotationsTest.java b/test/langtools/tools/javap/typeAnnotations/InvisibleParameterAnnotationsTest.java index d46881bd9d3..284144cca53 100644 --- a/test/langtools/tools/javap/typeAnnotations/InvisibleParameterAnnotationsTest.java +++ b/test/langtools/tools/javap/typeAnnotations/InvisibleParameterAnnotationsTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/lib/builder/AbstractBuilder.java b/test/langtools/tools/lib/builder/AbstractBuilder.java index a2e72a7cad8..e528fe60792 100644 --- a/test/langtools/tools/lib/builder/AbstractBuilder.java +++ b/test/langtools/tools/lib/builder/AbstractBuilder.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/lib/builder/ClassBuilder.java b/test/langtools/tools/lib/builder/ClassBuilder.java index 51acdd53d5b..9832441a623 100644 --- a/test/langtools/tools/lib/builder/ClassBuilder.java +++ b/test/langtools/tools/lib/builder/ClassBuilder.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/lib/toolbox/Assert.java b/test/langtools/tools/lib/toolbox/Assert.java index b89cd002f02..b04615888e3 100644 --- a/test/langtools/tools/lib/toolbox/Assert.java +++ b/test/langtools/tools/lib/toolbox/Assert.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/sjavac/HiddenFiles.java b/test/langtools/tools/sjavac/HiddenFiles.java index 9af04ce8879..47fe3f007b8 100644 --- a/test/langtools/tools/sjavac/HiddenFiles.java +++ b/test/langtools/tools/sjavac/HiddenFiles.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/langtools/tools/sjavac/OverlappingSrcDst.java b/test/langtools/tools/sjavac/OverlappingSrcDst.java index bf8c676acff..a1f7b7a2e36 100644 --- a/test/langtools/tools/sjavac/OverlappingSrcDst.java +++ b/test/langtools/tools/sjavac/OverlappingSrcDst.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From be00a3f7eef52e92f9e24fd2057cec4e082bd5a8 Mon Sep 17 00:00:00 2001 From: Ichiroh Takiguchi Date: Thu, 1 Nov 2018 17:48:10 -0400 Subject: [PATCH 020/128] 8211382: ISO2022JP and GB18030 NIO converter issues Reviewed-by: sherman, rriggs --- .../sun/nio/cs/ext/GB18030.java.template | 2 +- .../classes/sun/nio/cs/ext/ISO2022_JP.java | 4 +- test/jdk/sun/nio/cs/TestGB18030.java | 82 +++++++++++++++++++ test/jdk/sun/nio/cs/TestISO2022JP.java | 16 +++- 4 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 test/jdk/sun/nio/cs/TestGB18030.java diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template b/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template index 687b100fc27..436d9e79742 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template @@ -12519,7 +12519,7 @@ public class GB18030 dst.put(getChar(offset)); else if (offset >= 0x830D && offset <= 0x93A8) dst.put((char)(offset + 0x6557)); - else if (offset >= 0x93A9 && offset <= 0x99F9) + else if (offset >= 0x93A9 && offset <= 0x99FB) dst.put(getChar(offset)); // Supplemental UCS planes handled via surrogates else if (offset >= 0x2E248 && offset < 0x12E248) { diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java b/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java index 1125ffb7914..d5729117881 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java @@ -312,7 +312,7 @@ public class ISO2022_JP break; case JISX0201_1976_KANA: case SHIFTOUT: - if (b1 > 0x60) { + if (b1 > 0x5f) { return CoderResult.malformedForLength(inputSize); } da[dp++] = (char)(b1 + 0xff40); @@ -433,7 +433,7 @@ public class ISO2022_JP break; case JISX0201_1976_KANA: case SHIFTOUT: - if (b1 > 0x60) { + if (b1 > 0x5f) { return CoderResult.malformedForLength(inputSize); } dst.put((char)(b1 + 0xff40)); diff --git a/test/jdk/sun/nio/cs/TestGB18030.java b/test/jdk/sun/nio/cs/TestGB18030.java new file mode 100644 index 00000000000..d7183967058 --- /dev/null +++ b/test/jdk/sun/nio/cs/TestGB18030.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8211382 + * @summary Check GB18030 + * @modules jdk.charsets + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + +public class TestGB18030 { + public static void gb18030_1(boolean useDirect) throws Exception { + for(char ch : new char[]{'\uFFFE', '\uFFFF'}) { + char[] ca = new char[]{ch}; + Charset cs = Charset.forName("GB18030"); + CharsetEncoder ce = cs.newEncoder(); + CharsetDecoder cd = cs.newDecoder(); + CharBuffer cb = CharBuffer.wrap(ca); + ByteBuffer bb; + if (useDirect) { + bb = ByteBuffer.allocateDirect( + (int)Math.ceil(ce.maxBytesPerChar())); + } else { + bb = ByteBuffer.allocate( + (int)Math.ceil(ce.maxBytesPerChar())); + } + CoderResult cr = ce.encode(cb, bb, true); + if (!cr.isUnderflow()) { + throw new RuntimeException( + String.format("Encoder Error: \\u%04X: direct=%b: %s", + (int)ch, + useDirect, + cr.toString())); + } + bb.position(0); + cb = CharBuffer.allocate((int)Math.ceil( + cd.maxCharsPerByte()*bb.limit())); + cr = cd.decode(bb, cb, true); + if (!cr.isUnderflow()) { + throw new RuntimeException( + String.format("Decoder Error: \\u%04X: direct=%b: %s", + (int)ch, + useDirect, + cr.toString())); + } + if (ca[0] != cb.get(0)) { + throw new RuntimeException( + String.format("direct=%b: \\u%04X <> \\u%04X", + useDirect, + (int)ca[0], + (int)cb.get(0))); + } + } + } + public static void main(String args[]) throws Exception { + gb18030_1(false); + gb18030_1(true); + } +} diff --git a/test/jdk/sun/nio/cs/TestISO2022JP.java b/test/jdk/sun/nio/cs/TestISO2022JP.java index 79ceb7fca8b..5155de4f29f 100644 --- a/test/jdk/sun/nio/cs/TestISO2022JP.java +++ b/test/jdk/sun/nio/cs/TestISO2022JP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* @test - * @bug 4626545 4879522 4913711 4119445 8042125 + * @bug 4626545 4879522 4913711 4119445 8042125 8211382 * @summary Check full coverage encode/decode for ISO-2022-JP * @modules jdk.charsets */ @@ -647,5 +647,17 @@ public class TestISO2022JP { if (!new String(encoded, "x-windows-iso2022jp").equals(expectedStr)) { throw new Exception("MSISO2022JP Decoder error"); } + // Test for 11 iso2022jp decoder + encoded = new byte[] { + (byte)0x1B, (byte)0x28, (byte)0x49, (byte)0x60, + (byte)0x1B, (byte)0x28, (byte)0x42, + }; + String unexpectedStr = "\uffa0"; + expectedStr = "\ufffd"; + if (new String(encoded, "ISO2022JP").equals(unexpectedStr)) { + throw new Exception("ISO2022JP Decoder error: \\uFFA0"); + } else if (!new String(encoded, "ISO2022JP").equals(expectedStr)) { + throw new Exception("ISO2022JP Decoder error: \\uFFFD"); + } } } From 72bfdd96f1499ab25081676e9725734a85fd6aa1 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 1 Nov 2018 15:11:08 -0700 Subject: [PATCH 021/128] 8213265: fix missing newlines at end of files Reviewed-by: darcy --- .../langtools/jdk/javadoc/doclet/testSummaryTag/p2/package.html | 2 +- test/langtools/tools/javac/doctree/dcapi/overview0.html | 2 +- test/langtools/tools/javac/doctree/dcapi/overview1.html | 2 +- test/langtools/tools/javac/doctree/dcapi/overview2.html | 2 +- test/langtools/tools/javac/doctree/dcapi/overview3.html | 2 +- test/langtools/tools/javac/doctree/dcapi/overview5.html | 2 +- test/langtools/tools/javac/doctree/dcapi/package.html | 2 +- test/langtools/tools/javac/doctree/dcapi/pkg/package.html | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/langtools/jdk/javadoc/doclet/testSummaryTag/p2/package.html b/test/langtools/jdk/javadoc/doclet/testSummaryTag/p2/package.html index f0dda3f9002..24e20e4027f 100644 --- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/p2/package.html +++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/p2/package.html @@ -2,4 +2,4 @@ foo {@summary bar} baz. - \ No newline at end of file + diff --git a/test/langtools/tools/javac/doctree/dcapi/overview0.html b/test/langtools/tools/javac/doctree/dcapi/overview0.html index 8484422cc1f..0b4a26a8272 100644 --- a/test/langtools/tools/javac/doctree/dcapi/overview0.html +++ b/test/langtools/tools/javac/doctree/dcapi/overview0.html @@ -5,4 +5,4 @@ A simple well formed html document
overview0.html
. - \ No newline at end of file + diff --git a/test/langtools/tools/javac/doctree/dcapi/overview1.html b/test/langtools/tools/javac/doctree/dcapi/overview1.html index 3012e5b3767..071049e65b7 100644 --- a/test/langtools/tools/javac/doctree/dcapi/overview1.html +++ b/test/langtools/tools/javac/doctree/dcapi/overview1.html @@ -5,4 +5,4 @@ Html document
overview1.html
. Missing HTML. - \ No newline at end of file + diff --git a/test/langtools/tools/javac/doctree/dcapi/overview2.html b/test/langtools/tools/javac/doctree/dcapi/overview2.html index 432bb7d25bc..fe4c1092518 100644 --- a/test/langtools/tools/javac/doctree/dcapi/overview2.html +++ b/test/langtools/tools/javac/doctree/dcapi/overview2.html @@ -5,4 +5,4 @@ Html document
overview2.html
. Missing HEAD. - \ No newline at end of file + diff --git a/test/langtools/tools/javac/doctree/dcapi/overview3.html b/test/langtools/tools/javac/doctree/dcapi/overview3.html index fed93a832f8..097668049bd 100644 --- a/test/langtools/tools/javac/doctree/dcapi/overview3.html +++ b/test/langtools/tools/javac/doctree/dcapi/overview3.html @@ -5,4 +5,4 @@ Html document
overview3.html
. Missing enclosing HEAD. - \ No newline at end of file + diff --git a/test/langtools/tools/javac/doctree/dcapi/overview5.html b/test/langtools/tools/javac/doctree/dcapi/overview5.html index af7d365a440..22c0999956d 100644 --- a/test/langtools/tools/javac/doctree/dcapi/overview5.html +++ b/test/langtools/tools/javac/doctree/dcapi/overview5.html @@ -5,4 +5,4 @@ Html document
overview5.html
. Missing enclosing HTML - \ No newline at end of file + diff --git a/test/langtools/tools/javac/doctree/dcapi/package.html b/test/langtools/tools/javac/doctree/dcapi/package.html index 82201fd92dc..37f3bc23695 100644 --- a/test/langtools/tools/javac/doctree/dcapi/package.html +++ b/test/langtools/tools/javac/doctree/dcapi/package.html @@ -8,4 +8,4 @@ A simple well formed html document
package.html
.
 
-
\ No newline at end of file
+
diff --git a/test/langtools/tools/javac/doctree/dcapi/pkg/package.html b/test/langtools/tools/javac/doctree/dcapi/pkg/package.html
index bd8212d7109..5a8d9af3be8 100644
--- a/test/langtools/tools/javac/doctree/dcapi/pkg/package.html
+++ b/test/langtools/tools/javac/doctree/dcapi/pkg/package.html
@@ -6,4 +6,4 @@
 A simple well formed html document 
package.html
. In package pkg. - \ No newline at end of file + From 7a350b94744e45c0a3398a137594a67a1373364d Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 1 Nov 2018 20:37:45 -0700 Subject: [PATCH 022/128] 6304578: (reflect) toGenericString fails to print bounds of type variables on generic methods Reviewed-by: vromero, plevart, briangoetz, mcimadamore --- .../share/classes/java/lang/Class.java | 35 +++++++++----- .../java/lang/reflect/Constructor.java | 3 +- .../classes/java/lang/reflect/Executable.java | 46 ++++++++++--------- .../classes/java/lang/reflect/Method.java | 5 +- .../java/lang/Class/GenericStringTest.java | 24 ++++++---- .../Constructor/GenericStringTest.java | 12 +++-- .../reflect/Method/GenericStringTest.java | 12 ++++- 7 files changed, 88 insertions(+), 49 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java index f5704174485..692da5b744e 100644 --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -59,6 +59,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.StringJoiner; +import java.util.stream.Stream; +import java.util.stream.Collectors; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.loader.BootLoader; @@ -200,7 +202,8 @@ public final class Class implements java.io.Serializable, * and {@code class}, {@code enum}, {@code interface}, or * @{@code interface}, as appropriate), followed * by the type's name, followed by an angle-bracketed - * comma-separated list of the type's type parameters, if any. + * comma-separated list of the type's type parameters, if any, + * including informative bounds on the type parameters, if any. * * A space is used to separate modifiers from one another and to * separate any modifiers from the kind of type. The modifiers @@ -262,11 +265,8 @@ public final class Class implements java.io.Serializable, TypeVariable[] typeparms = component.getTypeParameters(); if (typeparms.length > 0) { - StringJoiner sj = new StringJoiner(",", "<", ">"); - for(TypeVariable typeparm: typeparms) { - sj.add(typeparm.getTypeName()); - } - sb.append(sj.toString()); + sb.append(Stream.of(typeparms).map(Class::typeVarBounds). + collect(Collectors.joining(",", "<", ">"))); } for (int i = 0; i < arrayDepth; i++) @@ -276,6 +276,17 @@ public final class Class implements java.io.Serializable, } } + static String typeVarBounds(TypeVariable typeVar) { + Type[] bounds = typeVar.getBounds(); + if (bounds.length == 1 && bounds[0].equals(Object.class)) { + return typeVar.getName(); + } else { + return typeVar.getName() + " extends " + + Stream.of(bounds).map(Type::getTypeName). + collect(Collectors.joining(" & ")); + } + } + /** * Returns the {@code Class} object associated with the class or * interface with the given string name. Invoking this method is @@ -3399,14 +3410,14 @@ public final class Class implements java.io.Serializable, * Helper method to get the method name from arguments. */ private String methodToString(String name, Class[] argTypes) { - StringJoiner sj = new StringJoiner(", ", getName() + "." + name + "(", ")"); + StringBuilder sb = new StringBuilder(); + sb.append(getName() + "." + name + "("); if (argTypes != null) { - for (int i = 0; i < argTypes.length; i++) { - Class c = argTypes[i]; - sj.add((c == null) ? "null" : c.getName()); - } + Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}). + collect(Collectors.joining(",")); } - return sj.toString(); + sb.append(")"); + return sb.toString(); } /** use serialVersionUID from JDK 1.1 for interoperability */ diff --git a/src/java.base/share/classes/java/lang/reflect/Constructor.java b/src/java.base/share/classes/java/lang/reflect/Constructor.java index 49184d0dc4c..034fcba6755 100644 --- a/src/java.base/share/classes/java/lang/reflect/Constructor.java +++ b/src/java.base/share/classes/java/lang/reflect/Constructor.java @@ -382,7 +382,8 @@ public final class Constructor extends Executable { * including type parameters. The string is formatted as the * constructor access modifiers, if any, followed by an * angle-bracketed comma separated list of the constructor's type - * parameters, if any, followed by the fully-qualified name of the + * parameters, if any, including informative bounds of the + * type parameters, if any, followed by the fully-qualified name of the * declaring class, followed by a parenthesized, comma-separated * list of the constructor's generic formal parameter types. * diff --git a/src/java.base/share/classes/java/lang/reflect/Executable.java b/src/java.base/share/classes/java/lang/reflect/Executable.java index 8196a3a299d..b89961993e6 100644 --- a/src/java.base/share/classes/java/lang/reflect/Executable.java +++ b/src/java.base/share/classes/java/lang/reflect/Executable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,9 +26,12 @@ package java.lang.reflect; import java.lang.annotation.*; +import java.util.Arrays; import java.util.Map; import java.util.Objects; import java.util.StringJoiner; +import java.util.stream.Stream; +import java.util.stream.Collectors; import jdk.internal.misc.SharedSecrets; import sun.reflect.annotation.AnnotationParser; @@ -109,19 +112,15 @@ public abstract class Executable extends AccessibleObject printModifiersIfNonzero(sb, modifierMask, isDefault); specificToStringHeader(sb); sb.append('('); - StringJoiner sj = new StringJoiner(","); - for (Class parameterType : parameterTypes) { - sj.add(parameterType.getTypeName()); - } - sb.append(sj.toString()); + + sb.append(Stream.of(parameterTypes).map(Type::getTypeName). + collect(Collectors.joining(","))); + sb.append(')'); if (exceptionTypes.length > 0) { - StringJoiner joiner = new StringJoiner(",", " throws ", ""); - for (Class exceptionType : exceptionTypes) { - joiner.add(exceptionType.getTypeName()); - } - sb.append(joiner.toString()); + sb.append(Stream.of(exceptionTypes).map(Type::getTypeName). + collect(Collectors.joining(",", " throws ", ""))); } return sb.toString(); } catch (Exception e) { @@ -135,6 +134,17 @@ public abstract class Executable extends AccessibleObject */ abstract void specificToStringHeader(StringBuilder sb); + static String typeVarBounds(TypeVariable typeVar) { + Type[] bounds = typeVar.getBounds(); + if (bounds.length == 1 && bounds[0].equals(Object.class)) { + return typeVar.getName(); + } else { + return typeVar.getName() + " extends " + + Stream.of(bounds).map(Type::getTypeName). + collect(Collectors.joining(" & ")); + } + } + String sharedToGenericString(int modifierMask, boolean isDefault) { try { StringBuilder sb = new StringBuilder(); @@ -143,11 +153,8 @@ public abstract class Executable extends AccessibleObject TypeVariable[] typeparms = getTypeParameters(); if (typeparms.length > 0) { - StringJoiner sj = new StringJoiner(",", "<", "> "); - for(TypeVariable typeparm: typeparms) { - sj.add(typeparm.getTypeName()); - } - sb.append(sj.toString()); + sb.append(Stream.of(typeparms).map(Executable::typeVarBounds). + collect(Collectors.joining(",", "<", "> "))); } specificToGenericStringHeader(sb); @@ -166,11 +173,8 @@ public abstract class Executable extends AccessibleObject Type[] exceptionTypes = getGenericExceptionTypes(); if (exceptionTypes.length > 0) { - StringJoiner joiner = new StringJoiner(",", " throws ", ""); - for (Type exceptionType : exceptionTypes) { - joiner.add(exceptionType.getTypeName()); - } - sb.append(joiner.toString()); + sb.append(Stream.of(exceptionTypes).map(Type::getTypeName). + collect(Collectors.joining(",", " throws ", ""))); } return sb.toString(); } catch (Exception e) { diff --git a/src/java.base/share/classes/java/lang/reflect/Method.java b/src/java.base/share/classes/java/lang/reflect/Method.java index ec35fe09643..7bcc4641b1f 100644 --- a/src/java.base/share/classes/java/lang/reflect/Method.java +++ b/src/java.base/share/classes/java/lang/reflect/Method.java @@ -436,10 +436,11 @@ public final class Method extends Executable { } /** - * Returns a string describing this {@code Method}, including - * type parameters. The string is formatted as the method access + * Returns a string describing this {@code Method}, including type + * parameters. The string is formatted as the method access * modifiers, if any, followed by an angle-bracketed * comma-separated list of the method's type parameters, if any, + * including informative bounds of the type parameters, if any, * followed by the method's generic return type, followed by a * space, followed by the class declaring the method, followed by * a period, followed by the method name, followed by a diff --git a/test/jdk/java/lang/Class/GenericStringTest.java b/test/jdk/java/lang/Class/GenericStringTest.java index bb002591c32..f117a44b446 100644 --- a/test/jdk/java/lang/Class/GenericStringTest.java +++ b/test/jdk/java/lang/Class/GenericStringTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6298888 6992705 8161500 + * @bug 6298888 6992705 8161500 6304578 * @summary Check Class.toGenericString() * @author Joseph D. Darcy */ @@ -43,12 +43,20 @@ public class GenericStringTest { String[][] nested = {{""}}; int[][] intArray = {{1}}; - failures += checkToGenericString(int.class, "int"); - failures += checkToGenericString(void.class, "void"); - failures += checkToGenericString(args.getClass(), "java.lang.String[]"); - failures += checkToGenericString(nested.getClass(), "java.lang.String[][]"); - failures += checkToGenericString(intArray.getClass(), "int[][]"); - failures += checkToGenericString(java.util.Map.class, "public abstract interface java.util.Map"); + Map, String> testCases = + Map.of(int.class, "int", + void.class, "void", + args.getClass(), "java.lang.String[]", + nested.getClass(), "java.lang.String[][]", + intArray.getClass(), "int[][]", + java.lang.Enum.class, "public abstract class java.lang.Enum>", + java.util.Map.class, "public abstract interface java.util.Map", + java.util.EnumMap.class, "public class java.util.EnumMap,V>", + java.util.EventListenerProxy.class, "public abstract class java.util.EventListenerProxy"); + + for (Map.Entry, String> testCase : testCases.entrySet()) { + failures += checkToGenericString(testCase.getKey(), testCase.getValue()); + } Field f = GenericStringTest.class.getDeclaredField("mixed"); // The expected value includes "" rather than @@ -74,7 +82,7 @@ public class GenericStringTest { private static int checkToGenericString(Class clazz, String expected) { String genericString = clazz.toGenericString(); if (!genericString.equals(expected)) { - System.err.printf("Unexpected Class.toGenericString output; expected '%s', got '%s'.%n", + System.err.printf("Unexpected Class.toGenericString output; expected %n\t'%s',%n got %n\t'%s'.%n", expected, genericString); return 1; diff --git a/test/jdk/java/lang/reflect/Constructor/GenericStringTest.java b/test/jdk/java/lang/reflect/Constructor/GenericStringTest.java index 8edef1c2883..56a781fce18 100644 --- a/test/jdk/java/lang/reflect/Constructor/GenericStringTest.java +++ b/test/jdk/java/lang/reflect/Constructor/GenericStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 5033583 6316717 6470106 8161500 8162539 + * @bug 5033583 6316717 6470106 8161500 8162539 6304578 * @summary Check toGenericString() and toString() methods * @author Joseph D. Darcy */ @@ -87,7 +87,13 @@ class TestClass1 { protected TestClass1(S s, T t) throws Exception{} @ExpectedGenericString( - " TestClass1() throws E") + "protected TestClass1(V)") + @ExpectedString( + "protected TestClass1(java.lang.Number)") + protected TestClass1(V v){} + + @ExpectedGenericString( + " TestClass1() throws E") @ExpectedString( "TestClass1() throws java.lang.Exception") TestClass1() throws E {} diff --git a/test/jdk/java/lang/reflect/Method/GenericStringTest.java b/test/jdk/java/lang/reflect/Method/GenericStringTest.java index d98d6c2bc6e..a75a4e67f94 100644 --- a/test/jdk/java/lang/reflect/Method/GenericStringTest.java +++ b/test/jdk/java/lang/reflect/Method/GenericStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 5033583 6316717 6470106 8004979 8161500 8162539 + * @bug 5033583 6316717 6470106 8004979 8161500 8162539 6304578 * @summary Check toGenericString() and toString() methods * @author Joseph D. Darcy */ @@ -103,6 +103,10 @@ class TestClass1 { @ExpectedGenericString( "protected S TestClass1.method4(S,T) throws java.lang.Exception") protected S method4(S s, T t) throws Exception {return null;} + + @ExpectedGenericString( + "public static T TestClass1.max(java.util.Collection,java.util.Comparator)") + public static T max(Collection coll, Comparator comp) {return null;} } class TestClass2 { @@ -139,6 +143,10 @@ class TestClass2 { @ExpectedGenericString( "public java.util.Map TestClass2.method8()") public Map method8() {return null;} + + @ExpectedGenericString( + "public java.util.Set TestClass2.method9(V)") + public Set method9(V v) {return null;} } class Roebling implements Comparable { From a429adfa2d9981354deaeca7a19ce9a631b987e9 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Fri, 2 Nov 2018 00:26:25 -0700 Subject: [PATCH 023/128] 8213203: [JVMCI] adopt formatting changes from jvmci 8 Reviewed-by: kvn --- .../share/jvmci/jvmciCodeInstaller.cpp | 10 +++- .../share/jvmci/jvmciCodeInstaller.hpp | 4 ++ src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 8 +++ .../src/jdk/vm/ci/aarch64/package-info.java | 27 +++++++++ .../src/jdk/vm/ci/amd64/package-info.java | 27 +++++++++ .../src/jdk/vm/ci/code/BytecodePosition.java | 8 ++- .../src/jdk/vm/ci/code/site/package-info.java | 27 +++++++++ .../jdk/vm/ci/code/stack/package-info.java | 26 +++++++++ .../src/jdk/vm/ci/common/package-info.java | 27 +++++++++ .../AArch64HotSpotJVMCIBackendFactory.java | 10 ++-- .../aarch64/AArch64HotSpotRegisterConfig.java | 3 +- .../vm/ci/hotspot/aarch64/package-info.java | 27 +++++++++ .../AMD64HotSpotJVMCIBackendFactory.java | 10 ++-- .../hotspot/amd64/AMD64HotSpotVMConfig.java | 5 +- .../jdk/vm/ci/hotspot/amd64/package-info.java | 27 +++++++++ .../SPARCHotSpotJVMCIBackendFactory.java | 6 +- .../jdk/vm/ci/hotspot/sparc/package-info.java | 27 +++++++++ .../src/jdk/vm/ci/hotspot/CompilerToVM.java | 17 +++--- .../src/jdk/vm/ci/hotspot/EventProvider.java | 4 +- .../ci/hotspot/HotSpotCodeCacheProvider.java | 8 +-- .../vm/ci/hotspot/HotSpotConstantPool.java | 4 +- .../ci/hotspot/HotSpotConstantPoolObject.java | 4 +- .../HotSpotConstantReflectionProvider.java | 2 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 48 ++-------------- .../jdk/vm/ci/hotspot/HotSpotMethodData.java | 5 +- .../ci/hotspot/HotSpotMethodDataAccessor.java | 6 +- .../vm/ci/hotspot/HotSpotObjectConstant.java | 3 + .../vm/ci/hotspot/HotSpotProfilingInfo.java | 4 +- .../hotspot/HotSpotResolvedJavaFieldImpl.java | 4 +- .../ci/hotspot/HotSpotResolvedJavaMethod.java | 3 +- .../HotSpotResolvedJavaMethodImpl.java | 38 ++++++------- .../ci/hotspot/HotSpotResolvedObjectType.java | 11 +++- .../hotspot/HotSpotResolvedPrimitiveType.java | 2 +- .../vm/ci/hotspot/HotSpotSpeculationLog.java | 2 +- .../vm/ci/hotspot/HotSpotVMConfigAccess.java | 12 ++-- .../vm/ci/hotspot/HotSpotVMConfigStore.java | 56 ++++++++++++++++++- .../src/jdk/vm/ci/hotspot/package-info.java | 27 +++++++++ .../src/jdk/vm/ci/meta/Assumptions.java | 2 +- .../src/jdk/vm/ci/meta/ConstantPool.java | 4 +- .../jdk/vm/ci/meta/LocalVariableTable.java | 4 +- .../src/jdk/vm/ci/meta/ModifiersProvider.java | 4 +- .../src/jdk/vm/ci/runtime/package-info.java | 27 +++++++++ .../src/jdk/vm/ci/services/package-info.java | 27 +++++++++ .../src/jdk/vm/ci/sparc/package-info.java | 27 +++++++++ 44 files changed, 506 insertions(+), 128 deletions(-) create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/package-info.java create mode 100644 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/package-info.java diff --git a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp index b5dbea5a718..1eaa416a65a 100644 --- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp +++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp @@ -209,6 +209,7 @@ OopMap* CodeInstaller::create_oop_map(Handle debug_info, TRAPS) { return map; } +#if INCLUDE_AOT AOTOopRecorder::AOTOopRecorder(Arena* arena, bool deduplicate) : OopRecorder(arena, deduplicate) { _meta_refs = new GrowableArray(); } @@ -268,6 +269,7 @@ void AOTOopRecorder::record_meta_ref(jobject o, int index) { assert(index == _meta_refs->length(), "must be last"); _meta_refs->append(o); } +#endif // INCLUDE_AOT void* CodeInstaller::record_metadata_reference(CodeSection* section, address dest, Handle constant, TRAPS) { /* @@ -555,6 +557,7 @@ void CodeInstaller::initialize_dependencies(oop compiled_code, OopRecorder* reco } } +#if INCLUDE_AOT RelocBuffer::~RelocBuffer() { if (_buffer != NULL) { FREE_C_HEAP_ARRAY(char, _buffer); @@ -593,9 +596,7 @@ JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle // Get instructions and constants CodeSections early because we need it. _instructions = buffer.insts(); _constants = buffer.consts(); -#if INCLUDE_AOT buffer.set_immutable_PIC(_immutable_pic_compilation); -#endif initialize_fields(target(), JNIHandles::resolve(compiled_code_obj), CHECK_OK); JVMCIEnv::CodeInstallResult result = initialize_buffer(buffer, false, CHECK_OK); @@ -618,6 +619,7 @@ JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle reloc_buffer->set_size(size); return JVMCIEnv::ok; } +#endif // INCLUDE_AOT // constructor used to create a method JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS) { @@ -769,6 +771,7 @@ int CodeInstaller::estimate_stubs_size(TRAPS) { } } } +#if INCLUDE_AOT if (UseAOT && site->is_a(site_Call::klass())) { oop target = site_Call::target(site); InstanceKlass* target_klass = InstanceKlass::cast(target->klass()); @@ -777,6 +780,7 @@ int CodeInstaller::estimate_stubs_size(TRAPS) { aot_call_stubs++; } } +#endif } } int size = static_call_stubs * CompiledStaticCall::to_interp_stub_size(); @@ -1278,10 +1282,12 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle si if (!_immutable_pic_compilation) { pd_patch_MetaspaceConstant(pc_offset, constant, CHECK); } +#if INCLUDE_AOT } else if (constant->is_a(HotSpotSentinelConstant::klass())) { if (!_immutable_pic_compilation) { JVMCI_ERROR("sentinel constant not supported for normal compiles: %s", constant->klass()->signature_name()); } +#endif } else { JVMCI_ERROR("unknown constant type in data patch: %s", constant->klass()->signature_name()); } diff --git a/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp b/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp index 0c21a08ac95..c37c8c7ce22 100644 --- a/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp +++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp @@ -28,6 +28,7 @@ #include "jvmci/jvmciEnv.hpp" #include "code/nativeInst.hpp" +#if INCLUDE_AOT class RelocBuffer : public StackObj { enum { stack_size = 1024 }; public: @@ -106,6 +107,7 @@ private: AOTOopRecorder* _oop_recorder; ExceptionHandlerTable* _exception_table; }; +#endif // INCLUDE_AOT /* * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod. @@ -202,7 +204,9 @@ public: CodeInstaller(bool immutable_pic_compilation) : _arena(mtCompiler), _immutable_pic_compilation(immutable_pic_compilation) {} +#if INCLUDE_AOT JVMCIEnv::CodeInstallResult gather_metadata(Handle target, Handle compiled_code, CodeMetadata& metadata, TRAPS); +#endif JVMCIEnv::CodeInstallResult install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS); static address runtime_call_target_address(oop runtime_call); diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 670b351dd13..4ca8e1ed444 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -714,6 +714,7 @@ C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject C2V_END C2V_VMENTRY(jint, getMetadata, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject metadata)) +#if INCLUDE_AOT ResourceMark rm; HandleMark hm; @@ -783,6 +784,9 @@ C2V_VMENTRY(jint, getMetadata, (JNIEnv *jniEnv, jobject, jobject target, jobject HotSpotMetaData::set_exceptionBytes(metadata_handle, exceptionArrayOop()); return result; +#else + THROW_MSG_0(vmSymbols::java_lang_InternalError(), "unimplemented"); +#endif C2V_END C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject)) @@ -1426,12 +1430,16 @@ C2V_VMENTRY(int, methodDataProfileDataSize, (JNIEnv*, jobject, jlong metaspace_m C2V_END C2V_VMENTRY(jlong, getFingerprint, (JNIEnv*, jobject, jlong metaspace_klass)) +#if INCLUDE_AOT Klass *k = CompilerToVM::asKlass(metaspace_klass); if (k->is_instance_klass()) { return InstanceKlass::cast(k)->get_stored_fingerprint(); } else { return 0; } +#else + THROW_MSG_0(vmSymbols::java_lang_InternalError(), "unimplemented"); +#endif C2V_END C2V_VMENTRY(jobject, getHostClass, (JNIEnv*, jobject, jobject jvmci_type)) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/package-info.java new file mode 100644 index 00000000000..3761c01d42f --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The AArch64 platform independent portions of the JVMCI API. + */ +package jdk.vm.ci.aarch64; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/package-info.java new file mode 100644 index 00000000000..ae4263dc381 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The AMD64 platform independent portions of the JVMCI API. + */ +package jdk.vm.ci.amd64; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java index 1b35f7eb378..a8d4be40d1f 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java @@ -43,13 +43,19 @@ public class BytecodePosition { * * @param caller the parent position * @param method the method - * @param bci a BCI within the method + * @param bci a BCI such that {@code method.codeSize() == 0 || bci < method.getCodeSize()}. That + * is, if code size is 0 then allow any value, otherwise the bci must be less than + * the code size. */ public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci) { assert method != null; this.caller = caller; this.method = method; this.bci = bci; + int codeSize = method.getCodeSize(); + if (codeSize != 0 && bci >= codeSize) { + throw new IllegalArgumentException(String.format("bci %d is out of range for %s %d bytes", bci, method.format("%H.%n(%p)"), codeSize)); + } } /** diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/package-info.java new file mode 100644 index 00000000000..b661834eb2e --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/** + * Package that defines the information associated with various {@link jdk.vm.ci.code.site.Site + * sites} in generated code. + */ +package jdk.vm.ci.code.site; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/package-info.java new file mode 100644 index 00000000000..ed1dbac18a3 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/package-info.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/** + * Package that defines the interface for runtime stack introspection. + */ +package jdk.vm.ci.code.stack; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/package-info.java new file mode 100644 index 00000000000..6e62672ccac --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Common utility classes used by the JVMCI API. + */ +package jdk.vm.ci.common; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java index f9eb5fa39ff..12189dd26a1 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @@ -43,7 +43,7 @@ import jdk.vm.ci.runtime.JVMCIBackend; public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - protected EnumSet computeFeatures(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) { + private static EnumSet computeFeatures(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) { // Configure the feature set using the HotSpot flag settings. EnumSet features = EnumSet.noneOf(AArch64.CPUFeature.class); @@ -87,7 +87,7 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac return features; } - protected EnumSet computeFlags(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) { + private static EnumSet computeFlags(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) { EnumSet flags = EnumSet.noneOf(AArch64.Flag.class); if (config.useBarriersForVolatile) { @@ -115,7 +115,7 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac return flags; } - protected TargetDescription createTarget(AArch64HotSpotVMConfig config) { + private static TargetDescription createTarget(AArch64HotSpotVMConfig config) { final int stackFrameAlignment = 16; final int implicitNullCheckLimit = 4096; final boolean inlineObjects = true; @@ -127,12 +127,12 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac return new HotSpotConstantReflectionProvider(runtime); } - protected RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) { + private static RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) { return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops); } protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + return new HotSpotCodeCacheProvider(runtime, target, regConfig); } protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntime runtime) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java index 5a9cadc9128..6895a58fd3c 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @@ -126,8 +126,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { public static final Register threadRegister = r28; public static final Register fp = r29; - private static final RegisterArray reservedRegisters - = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp); + private static final RegisterArray reservedRegisters = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp); private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) { RegisterArray allRegisters = arch.getAvailableValueRegisters(); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/package-info.java new file mode 100644 index 00000000000..fe75a538ad5 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The AArch64 HotSpot specific portions of the JVMCI API. + */ +package jdk.vm.ci.hotspot.aarch64; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java index 1d533641583..139a24c65f6 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java @@ -43,7 +43,7 @@ import jdk.vm.ci.runtime.JVMCIBackend; public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - protected EnumSet computeFeatures(AMD64HotSpotVMConfig config) { + private static EnumSet computeFeatures(AMD64HotSpotVMConfig config) { // Configure the feature set using the HotSpot flag settings. EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) { @@ -130,7 +130,7 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto return features; } - protected EnumSet computeFlags(AMD64HotSpotVMConfig config) { + private static EnumSet computeFlags(AMD64HotSpotVMConfig config) { EnumSet flags = EnumSet.noneOf(AMD64.Flag.class); if (config.useCountLeadingZerosInstruction) { flags.add(AMD64.Flag.UseCountLeadingZerosInstruction); @@ -141,7 +141,7 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto return flags; } - protected TargetDescription createTarget(AMD64HotSpotVMConfig config) { + private static TargetDescription createTarget(AMD64HotSpotVMConfig config) { final int stackFrameAlignment = 16; final int implicitNullCheckLimit = 4096; final boolean inlineObjects = true; @@ -153,12 +153,12 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto return new HotSpotConstantReflectionProvider(runtime); } - protected RegisterConfig createRegisterConfig(AMD64HotSpotVMConfig config, TargetDescription target) { + private static RegisterConfig createRegisterConfig(AMD64HotSpotVMConfig config, TargetDescription target) { return new AMD64HotSpotRegisterConfig(target, config.useCompressedOops, config.windowsOs); } protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + return new HotSpotCodeCacheProvider(runtime, target, regConfig); } protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntime runtime) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java index 2881990384f..87ce3b9b13b 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,9 @@ package jdk.vm.ci.hotspot.amd64; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; +/** + * Used to access AMD64 specific native configuration details. + */ class AMD64HotSpotVMConfig extends HotSpotVMConfigAccess { AMD64HotSpotVMConfig(HotSpotVMConfigStore config) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/package-info.java new file mode 100644 index 00000000000..7aa650817f4 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The AMD64 HotSpot specific portions of the JVMCI API. + */ +package jdk.vm.ci.hotspot.amd64; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java index 095f5e3808d..37f8f4b5f8a 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @@ -43,7 +43,7 @@ import jdk.vm.ci.sparc.SPARC.CPUFeature; public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - protected TargetDescription createTarget(SPARCHotSpotVMConfig config) { + private static TargetDescription createTarget(SPARCHotSpotVMConfig config) { final int stackFrameAlignment = 16; final int implicitNullCheckLimit = 4096; final boolean inlineObjects = false; @@ -52,10 +52,10 @@ public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto } protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + return new HotSpotCodeCacheProvider(runtime, target, regConfig); } - protected EnumSet computeFeatures(SPARCHotSpotVMConfig config) { + private static EnumSet computeFeatures(SPARCHotSpotVMConfig config) { EnumSet features = EnumSet.noneOf(CPUFeature.class); if ((config.vmVersionFeatures & 1L << config.sparc_ADI) != 0) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/package-info.java new file mode 100644 index 00000000000..df41bddc164 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The SPARC HotSpot specific portions of the JVMCI API. + */ +package jdk.vm.ci.hotspot.sparc; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index 6f101641e1a..8eeae624863 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -261,9 +261,9 @@ final class CompilerToVM { /** * If {@code cpi} denotes an entry representing a resolved dynamic adapter (see - * {@code resolveInvokeDynamicInPool} and {@code resolveInvokeHandleInPool}), return the opcode - * of the instruction for which the resolution was performed ({@code invokedynamic} or - * {@code invokevirtual}}, or {@code -1} otherwise. + * {@link #resolveInvokeDynamicInPool} and {@link #resolveInvokeHandleInPool}), return the + * opcode of the instruction for which the resolution was performed ({@code invokedynamic} or + * {@code invokevirtual}), or {@code -1} otherwise. */ native int isResolvedInvokeHandleInPool(HotSpotConstantPool constantPool, int cpi); @@ -543,12 +543,11 @@ final class CompilerToVM { native boolean shouldDebugNonSafepoints(); /** - * Writes {@code length} bytes from {@code bytes} starting at offset {@code offset} to the - * HotSpot's log stream. + * Writes {@code length} bytes from {@code bytes} starting at offset {@code offset} to HotSpot's + * log stream. * - * @exception NullPointerException if {@code bytes == null} - * @exception IndexOutOfBoundsException if copying would cause access of data outside array - * bounds + * @throws NullPointerException if {@code bytes == null} + * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds */ native void writeDebugOutput(byte[] bytes, int offset, int length); @@ -620,7 +619,7 @@ final class CompilerToVM { native int methodDataProfileDataSize(long metaspaceMethodData, int position); /** - * Gets the fingerprint for a given Klass* + * Gets the fingerprint for a given Klass*. * * @param metaspaceKlass * @return the value of the fingerprint (zero for arrays and synthetic classes). diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java index 2aa77349734..6b4d0af067d 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java @@ -91,7 +91,7 @@ public interface EventProvider { * * @return a compilation event */ - public abstract CompilationEvent newCompilationEvent(); + CompilationEvent newCompilationEvent(); /** * A compilation event. @@ -117,7 +117,7 @@ public interface EventProvider { * * @return a compiler failure event */ - public abstract CompilerFailureEvent newCompilerFailureEvent(); + CompilerFailureEvent newCompilerFailureEvent(); /** * A compiler failure event. diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index e6a5a9e5165..bfd5b5299bc 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -42,13 +42,13 @@ import jdk.vm.ci.meta.SpeculationLog; public class HotSpotCodeCacheProvider implements CodeCacheProvider { protected final HotSpotJVMCIRuntime runtime; - protected final HotSpotVMConfig config; + private final HotSpotVMConfig config; protected final TargetDescription target; protected final RegisterConfig regConfig; - public HotSpotCodeCacheProvider(HotSpotJVMCIRuntime runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) { + public HotSpotCodeCacheProvider(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { this.runtime = runtime; - this.config = config; + this.config = runtime.getConfig(); this.target = target; this.regConfig = regConfig; } @@ -91,7 +91,7 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { @Override public int getMinimumOutgoingSize() { - return runtime.getConfig().runtimeCallStackSize; + return config.runtimeCallStackSize; } private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java index 6cd2c27ee25..6655b6ac4ea 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -646,7 +646,7 @@ public final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapper } } - /* + /** * Converts a raw index from the bytecodes to a constant pool index (not a cache index). * * @param rawIndex index from the bytecode @@ -760,6 +760,8 @@ public final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapper /** * Determines if {@code type} contains signature polymorphic methods. */ + @SuppressFBWarnings(value = "LI_LAZY_INIT_STATIC", justification = "signaturePolymorphicHolders is a cache, not a singleton that must be constructed exactly once" + + "and compiler re-ordering is not an issue due to the VM call") static boolean isSignaturePolymorphicHolder(final ResolvedJavaType type) { String name = type.getName(); if (signaturePolymorphicHolders == null) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPoolObject.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPoolObject.java index 096c6c106a0..9aa73a6991c 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPoolObject.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPoolObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ public final class HotSpotConstantPoolObject extends HotSpotObjectConstantImpl { if (o instanceof HotSpotConstantPoolObject) { if (super.equals(o)) { HotSpotConstantPoolObject other = (HotSpotConstantPoolObject) o; - return type == other.type && cpi == other.cpi; + return type.equals(other.type) && cpi == other.cpi; } } return false; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index 32c84cedb17..980adfe5c99 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -42,7 +42,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv protected final HotSpotJVMCIRuntime runtime; protected final HotSpotMethodHandleAccessProvider methodHandleAccess; - protected final HotSpotMemoryAccessProviderImpl memoryAccess; + private final HotSpotMemoryAccessProviderImpl memoryAccess; public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntime runtime) { this.runtime = runtime; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 0ec0fe909c2..b18feb657ed 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -36,7 +36,6 @@ import java.util.Map; import java.util.Objects; import java.util.ServiceLoader; import java.util.Set; -import java.util.TreeMap; import java.util.function.Predicate; import jdk.internal.misc.VM; @@ -240,16 +239,16 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime { return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind; } - protected final CompilerToVM compilerToVm; + final CompilerToVM compilerToVm; protected final HotSpotVMConfigStore configStore; - protected final HotSpotVMConfig config; + private final HotSpotVMConfig config; private final JVMCIBackend hostBackend; private final JVMCICompilerFactory compilerFactory; private final HotSpotJVMCICompilerFactory hsCompilerFactory; private volatile JVMCICompiler compiler; - protected final HotSpotJVMCIMetaAccessContext metaAccessContext; + final HotSpotJVMCIMetaAccessContext metaAccessContext; /** * Stores the result of {@link HotSpotJVMCICompilerFactory#getCompilationLevelAdjustment} so @@ -324,7 +323,7 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime { } if (Option.PrintConfig.getBoolean()) { - printConfig(configStore, compilerToVm); + configStore.printConfig(); } } @@ -343,11 +342,11 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime { return configStore; } - public HotSpotVMConfig getConfig() { + HotSpotVMConfig getConfig() { return config; } - public CompilerToVM getCompilerToVM() { + CompilerToVM getCompilerToVM() { return compilerToVm; } @@ -578,41 +577,6 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime { } } - @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!") - private static void printConfigLine(CompilerToVM vm, String format, Object... args) { - String line = String.format(format, args); - byte[] lineBytes = line.getBytes(); - vm.writeDebugOutput(lineBytes, 0, lineBytes.length); - vm.flushDebugOutput(); - } - - private static void printConfig(HotSpotVMConfigStore store, CompilerToVM vm) { - TreeMap fields = new TreeMap<>(store.getFields()); - for (VMField field : fields.values()) { - if (!field.isStatic()) { - printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset); - } else { - String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value); - printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address); - } - } - TreeMap flags = new TreeMap<>(store.getFlags()); - for (VMFlag flag : flags.values()) { - printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value); - } - TreeMap addresses = new TreeMap<>(store.getAddresses()); - for (Map.Entry e : addresses.entrySet()) { - printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); - } - TreeMap constants = new TreeMap<>(store.getConstants()); - for (Map.Entry e : constants.entrySet()) { - printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); - } - for (VMIntrinsicMethod e : store.getIntrinsics()) { - printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor); - } - } - /** * Gets an output stream that writes to HotSpot's {@code tty} stream. */ diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java index 04d899dafd9..c736e680bc8 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java @@ -579,8 +579,9 @@ final class HotSpotMethodData { totalCount += getMethodsNotRecordedExecutionCount(data, position); - // Fixup the case of C1's inability to optimize profiling of a statically bindable call site. - // If it's a monomorphic call site, attribute all the counts to the first type (if any is recorded). + // Fixup the case of C1's inability to optimize profiling of a statically bindable call + // site. If it's a monomorphic call site, attribute all the counts to the first type (if + // any is recorded). if (entries == 1) { counts[0] = totalCount; } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java index dfcb0d3aa17..5cd0b47b270 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java @@ -82,8 +82,8 @@ abstract class HotSpotMethodDataAccessor { } TriState getExceptionSeen(HotSpotMethodData data, int position) { - final int EXCEPTIONS_MASK = 1 << config.bitDataExceptionSeenFlag; - return TriState.get((getFlags(data, position) & EXCEPTIONS_MASK) != 0); + final int exceptionsMask = 1 << config.bitDataExceptionSeenFlag; + return TriState.get((getFlags(data, position) & exceptionsMask) != 0); } /** @@ -148,4 +148,4 @@ abstract class HotSpotMethodDataAccessor { abstract StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos); -} \ No newline at end of file +} diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java index f7d6795d0b3..227fcb731a9 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java @@ -91,4 +91,7 @@ public interface HotSpotObjectConstant extends JavaConstant, HotSpotConstant, VM * {@code null} */ Object asObject(ResolvedJavaType type); + + @Override + String toValueString(); } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java index 20c877041ee..f506f17b7da 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java @@ -28,7 +28,7 @@ import jdk.vm.ci.meta.JavaTypeProfile; import jdk.vm.ci.meta.ProfilingInfo; import jdk.vm.ci.meta.TriState; -public final class HotSpotProfilingInfo implements ProfilingInfo { +final class HotSpotProfilingInfo implements ProfilingInfo { private final HotSpotMethodData methodData; private final HotSpotResolvedJavaMethod method; @@ -42,7 +42,7 @@ public final class HotSpotProfilingInfo implements ProfilingInfo { private boolean includeNormal; private boolean includeOSR; - public HotSpotProfilingInfo(HotSpotMethodData methodData, HotSpotResolvedJavaMethod method, boolean includeNormal, boolean includeOSR) { + HotSpotProfilingInfo(HotSpotMethodData methodData, HotSpotResolvedJavaMethod method, boolean includeNormal, boolean includeOSR) { this.methodData = methodData; this.method = method; this.includeNormal = includeNormal; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index aed1df11bb4..7bf82a3e1d3 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,6 @@ import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; import java.lang.annotation.Annotation; import java.lang.reflect.Field; -import jdk.internal.vm.annotation.Stable; - import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaType; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java index 673eadb4e47..01fba5744ca 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java @@ -58,7 +58,8 @@ public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod { boolean hasReservedStackAccess(); /** - * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM. + * Sets flags on {@code method} indicating that it should never be inlined or compiled by the + * VM. */ void setNotInlinableOrCompilable(); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index d4739f7dcbe..002bcef5bc1 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,24 @@ */ package jdk.vm.ci.hotspot; +import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; +import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE; +import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC; +import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS; +import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers; +import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; +import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Executable; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; @@ -40,24 +58,6 @@ import jdk.vm.ci.meta.Signature; import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.meta.TriState; -import java.lang.annotation.Annotation; -import java.lang.reflect.Executable; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; -import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE; -import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC; -import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS; -import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers; -import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; -import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; - /** * Implementation of {@link JavaMethod} for resolved HotSpot methods. */ diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java index f62e441fa1d..cad7ad8878b 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,8 +102,6 @@ public interface HotSpotResolvedObjectType extends ResolvedJavaType { int layoutHelper(); - long getFingerprint(); - @Override HotSpotResolvedObjectType getEnclosingType(); @@ -127,4 +125,11 @@ public interface HotSpotResolvedObjectType extends ResolvedJavaType { return isUnsafeAnonymous(); } + /** + * Gets the fingerprint for this type. + * + * @return the value of the fingerprint ({@code 0} for arrays and synthetic classes or if the VM + * does not support fingerprints) + */ + long getFingerprint(); } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java index 04c8139bdbc..c40819483ae 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java @@ -66,7 +66,7 @@ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType } @Override - public HotSpotResolvedObjectTypeImpl getArrayClass() { + public HotSpotResolvedObjectType getArrayClass() { if (kind == JavaKind.Void) { return null; } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java index 0880a1f0e91..63cf386ecd5 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java @@ -24,8 +24,8 @@ package jdk.vm.ci.hotspot; import java.util.HashMap; import java.util.HashSet; -import java.util.Set; import java.util.Map; +import java.util.Set; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.SpeculationLog; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java index 33a07bcb9a9..b6e9df4374f 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java @@ -50,7 +50,8 @@ public class HotSpotVMConfigAccess { if (notPresent != null) { return notPresent; } - throw new JVMCIError("expected VM symbol not found: " + name); + store.printConfig(); + throw new JVMCIError("expected VM symbol not found in " + store + ": " + name); } return entry; } @@ -81,7 +82,8 @@ public class HotSpotVMConfigAccess { if (notPresent != null) { return notPresent; } - throw new JVMCIError("expected VM constant not found: " + name); + store.printConfig(); + throw new JVMCIError("expected VM constant not found in " + store + ": " + name); } return type.cast(convertValue(name, type, c, null)); } @@ -241,7 +243,8 @@ public class HotSpotVMConfigAccess { if (!required) { return null; } - throw new JVMCIError("expected VM field not found: " + name); + store.printConfig(); + throw new JVMCIError("expected VM field not found in " + store + ": " + name); } // Make sure the native type is still the type we expect. @@ -285,7 +288,8 @@ public class HotSpotVMConfigAccess { if (notPresent != null) { return notPresent; } - throw new JVMCIError("expected VM flag not found: " + name); + store.printConfig(); + throw new JVMCIError("expected VM flag not found in " + store + ": " + name); } else { cppType = null; } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java index c388bbfa7c4..f8505ceb5cc 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,8 +29,10 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TreeMap; import jdk.vm.ci.common.InitTimer; +import jdk.vm.ci.common.JVMCIError; /** * Access to VM configuration data. @@ -108,7 +110,9 @@ public final class HotSpotVMConfigStore { try (InitTimer t = timer("CompilerToVm readConfiguration")) { data = compilerToVm.readConfiguration(); } - assert data.length == 5 : data.length; + if (data.length != 5) { + throw new JVMCIError("Expected data.length to be 5, not %d", data.length); + } // @formatter:off VMField[] vmFieldsInfo = (VMField[]) data[0]; @@ -145,4 +149,52 @@ public final class HotSpotVMConfigStore { } } } + + @Override + public String toString() { + return String.format("%s[%d fields, %d constants, %d addresses, %d flags, %d intrinsics]", + getClass().getSimpleName(), + vmFields.size(), + vmConstants.size(), + vmAddresses.size(), + vmFlags.size(), + vmIntrinsics.size()); + } + + void printConfig() { + CompilerToVM vm = compilerToVm; + TreeMap fields = new TreeMap<>(getFields()); + for (VMField field : fields.values()) { + if (!field.isStatic()) { + printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset); + } else { + String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value); + printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address); + } + } + TreeMap flags = new TreeMap<>(getFlags()); + for (VMFlag flag : flags.values()) { + printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value); + } + TreeMap addresses = new TreeMap<>(getAddresses()); + for (Map.Entry e : addresses.entrySet()) { + printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); + } + TreeMap constants = new TreeMap<>(getConstants()); + for (Map.Entry e : constants.entrySet()) { + printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); + } + for (VMIntrinsicMethod e : getIntrinsics()) { + printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor); + } + } + + @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!") + private static void printConfigLine(CompilerToVM vm, String format, Object... args) { + String line = String.format(format, args); + byte[] lineBytes = line.getBytes(); + vm.writeDebugOutput(lineBytes, 0, lineBytes.length); + vm.flushDebugOutput(); + } + } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/package-info.java new file mode 100644 index 00000000000..03a74a0dad2 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * HotSpot specific portions of the JVMCI API. + */ +package jdk.vm.ci.hotspot; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java index 3d967816e9d..56a4254710a 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java @@ -98,7 +98,7 @@ public final class Assumptions implements Iterable { } /** - * An assumption that a given class has no subclasses implementing {@code Object#finalize()}). + * An assumption that a given class has no subclasses implementing {@link Object#finalize()}). */ public static final class NoFinalizableSubclass extends Assumption { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java index 1df1c1faee4..8daf546e578 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java @@ -49,8 +49,8 @@ public interface ConstantPool { /** * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks * specific to the bytecode it denotes are performed if the field is already resolved. Checks - * for some bytecodes require the method that contains the bytecode to be specified. Should - * any of these checks fail, an unresolved field reference is returned. + * for some bytecodes require the method that contains the bytecode to be specified. Should any + * of these checks fail, an unresolved field reference is returned. * * @param cpi the constant pool index * @param opcode the opcode of the instruction for which the lookup is being performed or diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java index 63f135e5aa2..628eae9dce8 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java @@ -47,7 +47,7 @@ public class LocalVariableTable { /** * Gets a description of a local variable that occupies the bytecode frame slot indexed by - * {@code slot} and is live at the bytecode index {@code bci} + * {@code slot} and is live at the bytecode index {@code bci}. * * @return a description of the requested local variable or null if no such variable matches * {@code slot} and {@code bci} @@ -74,7 +74,7 @@ public class LocalVariableTable { } /** - * Gets a description of all the local variables live at the bytecode index {@code bci} + * Gets a description of all the local variables live at the bytecode index {@code bci}. */ public Local[] getLocalsAt(int bci) { List result = new ArrayList<>(); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java index c6cf9f0cec2..637cb65111c 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java @@ -22,12 +22,12 @@ */ package jdk.vm.ci.meta; +import java.lang.reflect.Modifier; + import static java.lang.reflect.Modifier.PRIVATE; import static java.lang.reflect.Modifier.PROTECTED; import static java.lang.reflect.Modifier.PUBLIC; -import java.lang.reflect.Modifier; - /** * A Java element (i.e., a class, interface, field or method) that is described by a set of Java * language {@linkplain #getModifiers() modifiers}. diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/package-info.java new file mode 100644 index 00000000000..62b56030537 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The core runtime interface of the JVMCI API. + */ +package jdk.vm.ci.runtime; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/package-info.java new file mode 100644 index 00000000000..69729a2519f --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The service related portions of the JVMCI API. + */ +package jdk.vm.ci.services; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/package-info.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/package-info.java new file mode 100644 index 00000000000..76329e52726 --- /dev/null +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * The SPARC platform independent portions of the JVMCI API. + */ +package jdk.vm.ci.sparc; From ca91f514d87064f7ef7e543b694b4caae4ec1543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Lid=C3=A9n?= Date: Fri, 2 Nov 2018 07:46:00 +0100 Subject: [PATCH 024/128] 8212921: ZGC: Move verification to after resurrection unblocked Reviewed-by: eosterlund --- src/hotspot/share/gc/z/zAddress.hpp | 1 + src/hotspot/share/gc/z/zAddress.inline.hpp | 4 ++ src/hotspot/share/gc/z/zDriver.cpp | 29 ++++++++++-- src/hotspot/share/gc/z/zHeap.cpp | 7 +-- src/hotspot/share/gc/z/zOop.hpp | 2 +- src/hotspot/share/gc/z/zOop.inline.hpp | 4 +- src/hotspot/share/gc/z/zOopClosures.cpp | 55 +++++++--------------- src/hotspot/share/gc/z/zOopClosures.hpp | 18 +++---- 8 files changed, 56 insertions(+), 64 deletions(-) diff --git a/src/hotspot/share/gc/z/zAddress.hpp b/src/hotspot/share/gc/z/zAddress.hpp index b2131eeb1df..753537bc6d6 100644 --- a/src/hotspot/share/gc/z/zAddress.hpp +++ b/src/hotspot/share/gc/z/zAddress.hpp @@ -37,6 +37,7 @@ public: static bool is_weak_good_or_null(uintptr_t value); static bool is_marked(uintptr_t value); static bool is_finalizable(uintptr_t value); + static bool is_finalizable_good(uintptr_t value); static bool is_remapped(uintptr_t value); static uintptr_t address(uintptr_t value); diff --git a/src/hotspot/share/gc/z/zAddress.inline.hpp b/src/hotspot/share/gc/z/zAddress.inline.hpp index ab227447b37..261b6738c53 100644 --- a/src/hotspot/share/gc/z/zAddress.inline.hpp +++ b/src/hotspot/share/gc/z/zAddress.inline.hpp @@ -74,6 +74,10 @@ inline bool ZAddress::is_finalizable(uintptr_t value) { return value & ZAddressMetadataFinalizable; } +inline bool ZAddress::is_finalizable_good(uintptr_t value) { + return is_finalizable(value) && is_good(value ^ ZAddressMetadataFinalizable); +} + inline bool ZAddress::is_remapped(uintptr_t value) { return value & ZAddressMetadataRemapped; } diff --git a/src/hotspot/share/gc/z/zDriver.cpp b/src/hotspot/share/gc/z/zDriver.cpp index 11ad024e5db..5b7c752c332 100644 --- a/src/hotspot/share/gc/z/zDriver.cpp +++ b/src/hotspot/share/gc/z/zDriver.cpp @@ -33,6 +33,7 @@ #include "gc/z/zServiceability.hpp" #include "gc/z/zStat.hpp" #include "logging/log.hpp" +#include "memory/universe.hpp" #include "runtime/vm_operations.hpp" #include "runtime/vmThread.hpp" @@ -44,6 +45,7 @@ static const ZStatPhasePause ZPhasePauseMarkEnd("Pause Mark End"); static const ZStatPhaseConcurrent ZPhaseConcurrentProcessNonStrongReferences("Concurrent Process Non-Strong References"); static const ZStatPhaseConcurrent ZPhaseConcurrentResetRelocationSet("Concurrent Reset Relocation Set"); static const ZStatPhaseConcurrent ZPhaseConcurrentDestroyDetachedPages("Concurrent Destroy Detached Pages"); +static const ZStatPhasePause ZPhasePauseVerify("Pause Verify"); static const ZStatPhaseConcurrent ZPhaseConcurrentSelectRelocationSet("Concurrent Select Relocation Set"); static const ZStatPhaseConcurrent ZPhaseConcurrentPrepareRelocationSet("Concurrent Prepare Relocation Set"); static const ZStatPhasePause ZPhasePauseRelocateStart("Pause Relocate Start"); @@ -210,6 +212,19 @@ public: } }; +class ZVerifyClosure : public ZOperationClosure { +public: + virtual const char* name() const { + return "ZVerify"; + } + + virtual bool do_operation() { + ZStatTimer timer(ZPhasePauseVerify); + Universe::verify(); + return true; + } +}; + class ZRelocateStartClosure : public ZOperationClosure { public: virtual const char* name() const { @@ -367,25 +382,31 @@ void ZDriver::run_gc_cycle(GCCause::Cause cause) { ZHeap::heap()->destroy_detached_pages(); } - // Phase 7: Concurrent Select Relocation Set + // Phase 7: Pause Verify + if (VerifyBeforeGC || VerifyDuringGC || VerifyAfterGC) { + ZVerifyClosure cl; + vm_operation(&cl); + } + + // Phase 8: Concurrent Select Relocation Set { ZStatTimer timer(ZPhaseConcurrentSelectRelocationSet); ZHeap::heap()->select_relocation_set(); } - // Phase 8: Concurrent Prepare Relocation Set + // Phase 9: Concurrent Prepare Relocation Set { ZStatTimer timer(ZPhaseConcurrentPrepareRelocationSet); ZHeap::heap()->prepare_relocation_set(); } - // Phase 9: Pause Relocate Start + // Phase 10: Pause Relocate Start { ZRelocateStartClosure cl; vm_operation(&cl); } - // Phase 10: Concurrent Relocate + // Phase 11: Concurrent Relocate { ZStatTimer timer(ZPhaseConcurrentRelocated); ZHeap::heap()->relocate(); diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp index fdd747e5c24..d6f69fa847a 100644 --- a/src/hotspot/share/gc/z/zHeap.cpp +++ b/src/hotspot/share/gc/z/zHeap.cpp @@ -366,11 +366,6 @@ bool ZHeap::mark_end() { // Process weak roots _weak_roots_processor.process_weak_roots(); - // Verification - if (VerifyBeforeGC || VerifyDuringGC || VerifyAfterGC) { - Universe::verify(); - } - return true; } @@ -570,7 +565,7 @@ public: _weak_roots() {} virtual void work() { - ZVerifyRootOopClosure cl; + ZVerifyOopClosure cl; _strong_roots.oops_do(&cl); _weak_roots.oops_do(&cl); } diff --git a/src/hotspot/share/gc/z/zOop.hpp b/src/hotspot/share/gc/z/zOop.hpp index 3ee8c1b2f59..43fb9d550b6 100644 --- a/src/hotspot/share/gc/z/zOop.hpp +++ b/src/hotspot/share/gc/z/zOop.hpp @@ -33,7 +33,7 @@ public: static uintptr_t to_address(oop o); static bool is_good(oop o); - static bool is_good_or_null(oop o); + static bool is_finalizable_good(oop o); static oop good(oop); }; diff --git a/src/hotspot/share/gc/z/zOop.inline.hpp b/src/hotspot/share/gc/z/zOop.inline.hpp index 74895601547..27592736288 100644 --- a/src/hotspot/share/gc/z/zOop.inline.hpp +++ b/src/hotspot/share/gc/z/zOop.inline.hpp @@ -40,8 +40,8 @@ inline bool ZOop::is_good(oop o) { return ZAddress::is_good(to_address(o)); } -inline bool ZOop::is_good_or_null(oop o) { - return ZAddress::is_good_or_null(to_address(o)); +inline bool ZOop::is_finalizable_good(oop o) { + return ZAddress::is_finalizable_good(to_address(o)); } inline oop ZOop::good(oop o) { diff --git a/src/hotspot/share/gc/z/zOopClosures.cpp b/src/hotspot/share/gc/z/zOopClosures.cpp index c8e1586ae2c..481215339c1 100644 --- a/src/hotspot/share/gc/z/zOopClosures.cpp +++ b/src/hotspot/share/gc/z/zOopClosures.cpp @@ -28,54 +28,31 @@ #include "memory/iterator.inline.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" +#include "runtime/safepoint.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" -static void z_verify_loaded_object(const oop* p, const oop obj) { - guarantee(ZOop::is_good_or_null(obj), - "Bad oop " PTR_FORMAT " found at " PTR_FORMAT ", expected " PTR_FORMAT, - p2i(obj), p2i(p), p2i(ZOop::good(obj))); - guarantee(oopDesc::is_oop_or_null(obj), - "Bad object " PTR_FORMAT " found at " PTR_FORMAT, - p2i(obj), p2i(p)); -} - -OopIterateClosure::ReferenceIterationMode ZVerifyHeapOopClosure::reference_iteration_mode() { - // Don't visit the j.l.Reference.referents for this verification closure, - // since they are cleaned concurrently after ZHeap::mark_end(), and can - // therefore not be verified at this point. - return DO_FIELDS_EXCEPT_REFERENT; -} - -void ZVerifyHeapOopClosure::do_oop(oop* p) { - guarantee(ZHeap::heap()->is_in((uintptr_t)p), "oop* " PTR_FORMAT " not in heap", p2i(p)); - - const oop obj = RawAccess<>::oop_load(p); - z_verify_loaded_object(p, obj); -} - -void ZVerifyHeapOopClosure::do_oop(narrowOop* p) { - ShouldNotReachHere(); -} - -ZVerifyRootOopClosure::ZVerifyRootOopClosure() { - // This closure should only be used from ZHeap::mark_end(), - // when all roots should have been fixed by the fixup_partial_loads(). +void ZVerifyOopClosure::do_oop(oop* p) { + guarantee(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); guarantee(ZGlobalPhase == ZPhaseMarkCompleted, "Invalid phase"); + guarantee(!ZResurrection::is_blocked(), "Invalid phase"); + + const oop o = RawAccess<>::oop_load(p); + if (o != NULL) { + guarantee(ZOop::is_good(o) || ZOop::is_finalizable_good(o), + "Bad oop " PTR_FORMAT " found at " PTR_FORMAT ", expected " PTR_FORMAT, + p2i(o), p2i(p), p2i(ZOop::good(o))); + guarantee(oopDesc::is_oop(ZOop::good(o)), + "Bad object " PTR_FORMAT " found at " PTR_FORMAT, + p2i(o), p2i(p)); + } } -void ZVerifyRootOopClosure::do_oop(oop* p) { - guarantee(!ZHeap::heap()->is_in((uintptr_t)p), "oop* " PTR_FORMAT " in heap", p2i(p)); - - const oop obj = RawAccess<>::oop_load(p); - z_verify_loaded_object(p, obj); -} - -void ZVerifyRootOopClosure::do_oop(narrowOop* p) { +void ZVerifyOopClosure::do_oop(narrowOop* p) { ShouldNotReachHere(); } void ZVerifyObjectClosure::do_object(oop o) { - ZVerifyHeapOopClosure cl; + ZVerifyOopClosure cl; o->oop_iterate(&cl); } diff --git a/src/hotspot/share/gc/z/zOopClosures.hpp b/src/hotspot/share/gc/z/zOopClosures.hpp index 91f4404f753..6fd283c0e1f 100644 --- a/src/hotspot/share/gc/z/zOopClosures.hpp +++ b/src/hotspot/share/gc/z/zOopClosures.hpp @@ -71,29 +71,23 @@ public: virtual void do_oop(narrowOop* p); }; -class ZVerifyHeapOopClosure : public BasicOopIterateClosure { +class ZVerifyOopClosure : public ZRootsIteratorClosure, public BasicOopIterateClosure { public: - virtual ReferenceIterationMode reference_iteration_mode(); - virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); + virtual ReferenceIterationMode reference_iteration_mode() { + return DO_FIELDS; + } + #ifdef ASSERT - // Verification handled by the closure itself. + // Verification handled by the closure itself virtual bool should_verify_oops() { return false; } #endif }; -class ZVerifyRootOopClosure : public ZRootsIteratorClosure { -public: - ZVerifyRootOopClosure(); - - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p); -}; - class ZVerifyObjectClosure : public ObjectClosure { public: virtual void do_object(oop o); From 54d4acf73fc86fd697b27feac1009bd9d129ccb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Lid=C3=A9n?= Date: Fri, 2 Nov 2018 07:58:22 +0100 Subject: [PATCH 025/128] 8212184: Incorrect oop ref strength used for referents in FinalReference Reviewed-by: eosterlund, kbarrett --- src/hotspot/share/classfile/javaClasses.hpp | 1 + src/hotspot/share/classfile/javaClasses.inline.hpp | 3 +++ src/hotspot/share/gc/shared/accessBarrierSupport.cpp | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp index 4cf2834a63d..bae23364f3a 100644 --- a/src/hotspot/share/classfile/javaClasses.hpp +++ b/src/hotspot/share/classfile/javaClasses.hpp @@ -912,6 +912,7 @@ class java_lang_ref_Reference: AllStatic { static inline oop queue(oop ref); static inline void set_queue(oop ref, oop value); static bool is_referent_field(oop obj, ptrdiff_t offset); + static inline bool is_final(oop ref); static inline bool is_phantom(oop ref); }; diff --git a/src/hotspot/share/classfile/javaClasses.inline.hpp b/src/hotspot/share/classfile/javaClasses.inline.hpp index c48aedb21f0..ad54fbf2e79 100644 --- a/src/hotspot/share/classfile/javaClasses.inline.hpp +++ b/src/hotspot/share/classfile/javaClasses.inline.hpp @@ -127,6 +127,9 @@ void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) { HeapWord* java_lang_ref_Reference::discovered_addr_raw(oop ref) { return ref->obj_field_addr_raw(discovered_offset); } +bool java_lang_ref_Reference::is_final(oop ref) { + return InstanceKlass::cast(ref->klass())->reference_type() == REF_FINAL; +} bool java_lang_ref_Reference::is_phantom(oop ref) { return InstanceKlass::cast(ref->klass())->reference_type() == REF_PHANTOM; } diff --git a/src/hotspot/share/gc/shared/accessBarrierSupport.cpp b/src/hotspot/share/gc/shared/accessBarrierSupport.cpp index 7a892135ae5..93e88f82dba 100644 --- a/src/hotspot/share/gc/shared/accessBarrierSupport.cpp +++ b/src/hotspot/share/gc/shared/accessBarrierSupport.cpp @@ -28,8 +28,16 @@ #include "oops/access.hpp" DecoratorSet AccessBarrierSupport::resolve_unknown_oop_ref_strength(DecoratorSet decorators, oop base, ptrdiff_t offset) { + // Note that the referent in a FinalReference is technically not strong. + // However, it always behaves like one in practice. The two cases are: + // 1) A mutator calls Reference.get(). However, a mutator can only ever + // see inactive FinalReferences, whose referents really are strong. + // 2) A GC heap walking operation. In this case the GC can see active + // FinalReferences, but the GC always wants to follow the referent + // as if it was strong. DecoratorSet ds = decorators & ~ON_UNKNOWN_OOP_REF; - if (!java_lang_ref_Reference::is_referent_field(base, offset)) { + if (!java_lang_ref_Reference::is_referent_field(base, offset) || + java_lang_ref_Reference::is_final(base)) { ds |= ON_STRONG_OOP_REF; } else if (java_lang_ref_Reference::is_phantom(base)) { ds |= ON_PHANTOM_OOP_REF; From 97d3dc7902d539ca0860657009ebbf6c5c058d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Thu, 1 Nov 2018 14:57:26 +0100 Subject: [PATCH 026/128] 8212681: Refactor IC locking to use a fine grained CompiledICLocker Reviewed-by: coleenp, rehn, kvn --- .../cpu/aarch64/compiledIC_aarch64.cpp | 2 +- .../cpu/aarch64/compiledIC_aot_aarch64.cpp | 2 +- .../cpu/aarch64/nativeInst_aarch64.cpp | 4 +- src/hotspot/cpu/arm/compiledIC_arm.cpp | 2 +- src/hotspot/cpu/ppc/compiledIC_ppc.cpp | 4 +- src/hotspot/cpu/ppc/nativeInst_ppc.cpp | 4 +- src/hotspot/cpu/s390/compiledIC_s390.cpp | 2 +- src/hotspot/cpu/sparc/compiledIC_sparc.cpp | 2 +- src/hotspot/cpu/sparc/nativeInst_sparc.cpp | 6 +- src/hotspot/cpu/x86/compiledIC_aot_x86_64.cpp | 4 +- src/hotspot/cpu/x86/compiledIC_x86.cpp | 2 +- src/hotspot/cpu/x86/nativeInst_x86.cpp | 5 +- src/hotspot/share/code/codeBehaviours.cpp | 46 ++++++++++++ src/hotspot/share/code/codeBehaviours.hpp | 50 +++++++++++++ src/hotspot/share/code/compiledIC.cpp | 73 ++++++++++++------- src/hotspot/share/code/compiledIC.hpp | 16 +++- src/hotspot/share/code/compiledMethod.cpp | 4 +- src/hotspot/share/code/icBuffer.cpp | 7 +- src/hotspot/share/code/nmethod.cpp | 11 +-- src/hotspot/share/memory/universe.cpp | 9 ++- src/hotspot/share/runtime/mutexLocker.hpp | 34 --------- src/hotspot/share/runtime/sharedRuntime.cpp | 13 ++-- src/hotspot/share/runtime/sweeper.cpp | 12 +-- 23 files changed, 211 insertions(+), 103 deletions(-) create mode 100644 src/hotspot/share/code/codeBehaviours.cpp create mode 100644 src/hotspot/share/code/codeBehaviours.hpp diff --git a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp index ad701c74265..ca3cc39a0be 100644 --- a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp @@ -179,10 +179,10 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad } void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); method_holder->set_data(0); diff --git a/src/hotspot/cpu/aarch64/compiledIC_aot_aarch64.cpp b/src/hotspot/cpu/aarch64/compiledIC_aot_aarch64.cpp index 67ad82e249d..3000a2b6174 100644 --- a/src/hotspot/cpu/aarch64/compiledIC_aot_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/compiledIC_aot_aarch64.cpp @@ -69,10 +69,10 @@ void CompiledPltStaticCall::set_to_interpreted(const methodHandle& callee, addre #ifdef NEVER_CALLED void CompiledPltStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeLoadGot* method_loader = nativeLoadGot_at(stub); NativeGotJump* jump = nativeGotJump_at(method_loader->next_instruction_address()); diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp index 4e99ddaf76f..668795050ea 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "code/compiledIC.hpp" #include "memory/resourceArea.hpp" #include "nativeInst_aarch64.hpp" #include "oops/oop.inline.hpp" @@ -178,7 +179,8 @@ address NativeCall::destination() const { // during code generation, where no patching lock is needed. void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) { assert(!assert_lock || - (Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()), + (Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) || + CompiledICLocker::is_safe(addr_at(0)), "concurrent code patching"); ResourceMark rm; diff --git a/src/hotspot/cpu/arm/compiledIC_arm.cpp b/src/hotspot/cpu/arm/compiledIC_arm.cpp index 1bfdefdcc11..b6404de25d9 100644 --- a/src/hotspot/cpu/arm/compiledIC_arm.cpp +++ b/src/hotspot/cpu/arm/compiledIC_arm.cpp @@ -137,10 +137,10 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad } void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); diff --git a/src/hotspot/cpu/ppc/compiledIC_ppc.cpp b/src/hotspot/cpu/ppc/compiledIC_ppc.cpp index 3841049c0a1..1aead0bcf63 100644 --- a/src/hotspot/cpu/ppc/compiledIC_ppc.cpp +++ b/src/hotspot/cpu/ppc/compiledIC_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -197,10 +197,10 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad } void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub); NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp index 67289e91238..626167281e0 100644 --- a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp +++ b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "code/compiledIC.hpp" #include "memory/resourceArea.hpp" #include "nativeInst_ppc.hpp" #include "oops/compressedOops.inline.hpp" @@ -94,7 +95,8 @@ address NativeCall::destination() const { // during code generation, where no patching lock is needed. void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) { assert(!assert_lock || - (Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()), + (Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) || + CompiledICLocker::is_safe(addr_at(0)), "concurrent code patching"); ResourceMark rm; diff --git a/src/hotspot/cpu/s390/compiledIC_s390.cpp b/src/hotspot/cpu/s390/compiledIC_s390.cpp index 65d1095a284..b48526b52e9 100644 --- a/src/hotspot/cpu/s390/compiledIC_s390.cpp +++ b/src/hotspot/cpu/s390/compiledIC_s390.cpp @@ -127,10 +127,10 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad } void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub()); NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); diff --git a/src/hotspot/cpu/sparc/compiledIC_sparc.cpp b/src/hotspot/cpu/sparc/compiledIC_sparc.cpp index ba14b5a5361..7a654cfbad3 100644 --- a/src/hotspot/cpu/sparc/compiledIC_sparc.cpp +++ b/src/hotspot/cpu/sparc/compiledIC_sparc.cpp @@ -124,10 +124,10 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad } void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); diff --git a/src/hotspot/cpu/sparc/nativeInst_sparc.cpp b/src/hotspot/cpu/sparc/nativeInst_sparc.cpp index f3a486d1178..2149efce7e3 100644 --- a/src/hotspot/cpu/sparc/nativeInst_sparc.cpp +++ b/src/hotspot/cpu/sparc/nativeInst_sparc.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" #include "code/codeCache.hpp" +#include "code/compiledIC.hpp" #include "memory/resourceArea.hpp" #include "nativeInst_sparc.hpp" #include "oops/oop.inline.hpp" @@ -189,8 +190,9 @@ void NativeCall::replace_mt_safe(address instr_addr, address code_buffer) { // // Used in the runtime linkage of calls; see class CompiledIC. void NativeCall::set_destination_mt_safe(address dest) { - assert(Patching_lock->is_locked() || - SafepointSynchronize::is_at_safepoint(), "concurrent code patching"); + assert((Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) || + CompiledICLocker::is_safe(addr_at(0)), + "concurrent code patching"); // set_destination uses set_long_at which does the ICache::invalidate set_destination(dest); } diff --git a/src/hotspot/cpu/x86/compiledIC_aot_x86_64.cpp b/src/hotspot/cpu/x86/compiledIC_aot_x86_64.cpp index d884ef2a87c..bf98dd3dea0 100644 --- a/src/hotspot/cpu/x86/compiledIC_aot_x86_64.cpp +++ b/src/hotspot/cpu/x86/compiledIC_aot_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,10 +88,10 @@ void CompiledPltStaticCall::set_to_interpreted(const methodHandle& callee, addre #ifdef NEVER_CALLED void CompiledPltStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); + assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); // Creation also verifies the object. NativeLoadGot* method_loader = nativeLoadGot_at(stub); NativeGotJump* jump = nativeGotJump_at(method_loader->next_instruction_address()); diff --git a/src/hotspot/cpu/x86/compiledIC_x86.cpp b/src/hotspot/cpu/x86/compiledIC_x86.cpp index 5d4619d9068..343723ddc53 100644 --- a/src/hotspot/cpu/x86/compiledIC_x86.cpp +++ b/src/hotspot/cpu/x86/compiledIC_x86.cpp @@ -177,7 +177,7 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad } void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); + assert(CompiledICLocker::is_safe(static_stub->addr()), "mt unsafe call"); // Reset stub. address stub = static_stub->addr(); assert(stub != NULL, "stub not found"); diff --git a/src/hotspot/cpu/x86/nativeInst_x86.cpp b/src/hotspot/cpu/x86/nativeInst_x86.cpp index f48221b67ff..7105805480c 100644 --- a/src/hotspot/cpu/x86/nativeInst_x86.cpp +++ b/src/hotspot/cpu/x86/nativeInst_x86.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "code/compiledIC.hpp" #include "memory/resourceArea.hpp" #include "nativeInst_x86.hpp" #include "oops/oop.inline.hpp" @@ -257,8 +258,8 @@ void NativeCall::set_destination_mt_safe(address dest) { debug_only(verify()); // Make sure patching code is locked. No two threads can patch at the same // time but one may be executing this code. - assert(Patching_lock->is_locked() || - SafepointSynchronize::is_at_safepoint(), "concurrent code patching"); + assert(Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint() || + CompiledICLocker::is_safe(instruction_address()), "concurrent code patching"); // Both C1 and C2 should now be generating code which aligns the patched address // to be within a single cache line. bool is_aligned = ((uintptr_t)displacement_address() + 0) / cache_line_size == diff --git a/src/hotspot/share/code/codeBehaviours.cpp b/src/hotspot/share/code/codeBehaviours.cpp new file mode 100644 index 00000000000..91ac83630c2 --- /dev/null +++ b/src/hotspot/share/code/codeBehaviours.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "code/codeBehaviours.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/safepoint.hpp" + +CompiledICProtectionBehaviour* CompiledICProtectionBehaviour::_current = NULL; + +bool DefaultICProtectionBehaviour::lock(CompiledMethod* method) { + if (CompiledIC_lock->owned_by_self()) { + return false; + } + CompiledIC_lock->lock(); + return true; +} + +void DefaultICProtectionBehaviour::unlock(CompiledMethod* method) { + CompiledIC_lock->unlock(); +} + +bool DefaultICProtectionBehaviour::is_safe(CompiledMethod* method) { + return SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->owned_by_self(); +} diff --git a/src/hotspot/share/code/codeBehaviours.hpp b/src/hotspot/share/code/codeBehaviours.hpp new file mode 100644 index 00000000000..f026957aa97 --- /dev/null +++ b/src/hotspot/share/code/codeBehaviours.hpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_CODE_CODEBEHAVIOURS_HPP +#define SHARE_CODE_CODEBEHAVIOURS_HPP + +#include "memory/allocation.hpp" + +class CompiledMethod; + +class CompiledICProtectionBehaviour { + static CompiledICProtectionBehaviour* _current; + +public: + virtual bool lock(CompiledMethod* method) = 0; + virtual void unlock(CompiledMethod* method) = 0; + virtual bool is_safe(CompiledMethod* method) = 0; + + static CompiledICProtectionBehaviour* current() { return _current; } + static void set_current(CompiledICProtectionBehaviour* current) { _current = current; } +}; + +class DefaultICProtectionBehaviour: public CompiledICProtectionBehaviour, public CHeapObj { + virtual bool lock(CompiledMethod* method); + virtual void unlock(CompiledMethod* method); + virtual bool is_safe(CompiledMethod* method); +}; + +#endif // SHARE_CODE_CODEBEHAVIOURS_HPP diff --git a/src/hotspot/share/code/compiledIC.cpp b/src/hotspot/share/code/compiledIC.cpp index b0c4ff24b7d..c5f15b39b82 100644 --- a/src/hotspot/share/code/compiledIC.cpp +++ b/src/hotspot/share/code/compiledIC.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" +#include "code/codeBehaviours.hpp" #include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/icBuffer.hpp" @@ -47,12 +48,35 @@ // Every time a compiled IC is changed or its type is being accessed, // either the CompiledIC_lock must be set or we must be at a safe point. +CompiledICLocker::CompiledICLocker(CompiledMethod* method) + : _method(method), + _behaviour(CompiledICProtectionBehaviour::current()), + _locked(_behaviour->lock(_method)){ +} + +CompiledICLocker::~CompiledICLocker() { + if (_locked) { + _behaviour->unlock(_method); + } +} + +bool CompiledICLocker::is_safe(CompiledMethod* method) { + return CompiledICProtectionBehaviour::current()->is_safe(method); +} + +bool CompiledICLocker::is_safe(address code) { + CodeBlob* cb = CodeCache::find_blob_unsafe(code); + assert(cb != NULL && cb->is_compiled(), "must be compiled"); + CompiledMethod* cm = cb->as_compiled_method(); + return CompiledICProtectionBehaviour::current()->is_safe(cm); +} + //----------------------------------------------------------------------------- // Low-level access to an inline cache. Private, since they might not be // MT-safe to use. void* CompiledIC::cached_value() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); assert (!is_optimized(), "an optimized virtual call does not have a cached metadata"); if (!is_in_transition_state()) { @@ -69,7 +93,7 @@ void* CompiledIC::cached_value() const { void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub, void* cache, bool is_icholder) { assert(entry_point != NULL, "must set legal entry point"); - assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); assert (!is_optimized() || cache == NULL, "an optimized virtual call does not have a cached metadata"); assert (cache == NULL || cache != (Metadata*)badOopVal, "invalid metadata"); @@ -101,11 +125,9 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub } { - MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag); -#ifdef ASSERT CodeBlob* cb = CodeCache::find_blob_unsafe(_call->instruction_address()); + MutexLockerEx pl(CompiledICLocker::is_safe(cb->as_compiled_method()) ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag); assert(cb != NULL && cb->is_compiled(), "must be compiled"); -#endif _call->set_destination_mt_safe(entry_point); } @@ -130,23 +152,23 @@ void CompiledIC::set_ic_destination(ICStub* stub) { address CompiledIC::ic_destination() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); - if (!is_in_transition_state()) { - return _call->destination(); - } else { - return InlineCacheBuffer::ic_destination_for((CompiledIC *)this); - } + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); + if (!is_in_transition_state()) { + return _call->destination(); + } else { + return InlineCacheBuffer::ic_destination_for((CompiledIC *)this); + } } bool CompiledIC::is_in_transition_state() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); return InlineCacheBuffer::contains(_call->destination());; } bool CompiledIC::is_icholder_call() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); return !_is_optimized && is_icholder_entry(ic_destination()); } @@ -216,7 +238,7 @@ CompiledIC::CompiledIC(RelocIterator* iter) } bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) { - assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); assert(!is_optimized(), "cannot set an optimized virtual call to megamorphic"); assert(is_call_to_compiled() || is_call_to_interpreted(), "going directly to megamorphic?"); @@ -270,7 +292,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod // true if destination is megamorphic stub bool CompiledIC::is_megamorphic() const { - assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); assert(!is_optimized(), "an optimized call cannot be megamorphic"); // Cannot rely on cached_value. It is either an interface or a method. @@ -278,7 +300,7 @@ bool CompiledIC::is_megamorphic() const { } bool CompiledIC::is_call_to_compiled() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); // Use unsafe, since an inline cache might point to a zombie method. However, the zombie // method is guaranteed to still exist, since we only remove methods after all inline caches @@ -304,7 +326,7 @@ bool CompiledIC::is_call_to_compiled() const { bool CompiledIC::is_call_to_interpreted() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); // Call to interpreter if destination is either calling to a stub (if it // is optimized), or calling to an I2C blob bool is_call_to_interpreted = false; @@ -329,7 +351,7 @@ bool CompiledIC::is_call_to_interpreted() const { } void CompiledIC::set_to_clean(bool in_use) { - assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call"); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); if (TraceInlineCacheClearing || TraceICs) { tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address())); print(); @@ -339,7 +361,7 @@ void CompiledIC::set_to_clean(bool in_use) { // A zombie transition will always be safe, since the metadata has already been set to NULL, so // we only need to patch the destination - bool safe_transition = _call->is_safe_for_patching() || !in_use || is_optimized() || SafepointSynchronize::is_at_safepoint(); + bool safe_transition = _call->is_safe_for_patching() || !in_use || is_optimized() || CompiledICLocker::is_safe(_method); if (safe_transition) { // Kill any leftover stub we might have too @@ -363,7 +385,7 @@ void CompiledIC::set_to_clean(bool in_use) { } bool CompiledIC::is_clean() const { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); bool is_clean = false; address dest = ic_destination(); is_clean = dest == _call->get_resolve_call_stub(is_optimized()); @@ -372,7 +394,7 @@ bool CompiledIC::is_clean() const { } void CompiledIC::set_to_monomorphic(CompiledICInfo& info) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); + assert(CompiledICLocker::is_safe(_method), "mt unsafe call"); // Updating a cache to the wrong entry can cause bugs that are very hard // to track down - if cache entry gets invalid - we just clean it. In // this way it is always the same code path that is responsible for @@ -555,14 +577,9 @@ void CompiledIC::cleanup_call_site(virtual_call_Relocation* call_site, const Com void CompiledStaticCall::set_to_clean(bool in_use) { // in_use is unused but needed to match template function in CompiledMethod - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); + assert(CompiledICLocker::is_safe(instruction_address()), "mt unsafe call"); // Reset call site MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag); -#ifdef ASSERT - CodeBlob* cb = CodeCache::find_blob_unsafe(instruction_address()); - assert(cb != NULL && cb->is_compiled(), "must be compiled"); -#endif - set_destination_mt_safe(resolve_call_stub()); // Do not reset stub here: It is too expensive to call find_stub. @@ -606,7 +623,7 @@ void CompiledStaticCall::set_to_compiled(address entry) { } void CompiledStaticCall::set(const StaticCallInfo& info) { - assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); + assert(CompiledICLocker::is_safe(instruction_address()), "mt unsafe call"); MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); // Updating a cache to the wrong entry can cause bugs that are very hard // to track down - if cache entry gets invalid - we just clean it. In diff --git a/src/hotspot/share/code/compiledIC.hpp b/src/hotspot/share/code/compiledIC.hpp index 745f65c15a5..3d5da1de751 100644 --- a/src/hotspot/share/code/compiledIC.hpp +++ b/src/hotspot/share/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,8 +59,22 @@ // transition is made to a stub. // class CompiledIC; +class CompiledICProtectionBehaviour; +class CompiledMethod; class ICStub; +class CompiledICLocker: public StackObj { + CompiledMethod* _method; + CompiledICProtectionBehaviour* _behaviour; + bool _locked; + +public: + CompiledICLocker(CompiledMethod* method); + ~CompiledICLocker(); + static bool is_safe(CompiledMethod* method); + static bool is_safe(address code); +}; + class CompiledICInfo : public StackObj { private: address _entry; // entry point for call diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index dbc384e19bb..eb8e16d0794 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -324,7 +324,7 @@ void CompiledMethod::clear_inline_caches() { // Clear ICStubs of all compiled ICs void CompiledMethod::clear_ic_stubs() { - assert_locked_or_safepoint(CompiledIC_lock); + assert(CompiledICLocker::is_safe(this), "mt unsafe call"); ResourceMark rm; RelocIterator iter(this); while(iter.next()) { @@ -546,7 +546,7 @@ bool CompiledMethod::unload_nmethod_caches(bool parallel, bool unloading_occurre // Called to clean up after class unloading for live nmethods and from the sweeper // for all methods. bool CompiledMethod::cleanup_inline_caches_impl(bool parallel, bool unloading_occurred, bool clean_all) { - assert_locked_or_safepoint(CompiledIC_lock); + assert(CompiledICLocker::is_safe(this), "mt unsafe call"); bool postponed = false; ResourceMark rm; diff --git a/src/hotspot/share/code/icBuffer.cpp b/src/hotspot/share/code/icBuffer.cpp index 1cc58fd6920..a26ec161017 100644 --- a/src/hotspot/share/code/icBuffer.cpp +++ b/src/hotspot/share/code/icBuffer.cpp @@ -170,8 +170,9 @@ void InlineCacheBuffer_init() { void InlineCacheBuffer::create_transition_stub(CompiledIC *ic, void* cached_value, address entry) { + MutexLockerEx ml(CompiledIC_lock->owned_by_self() ? NULL : CompiledIC_lock); assert(!SafepointSynchronize::is_at_safepoint(), "should not be called during a safepoint"); - assert (CompiledIC_lock->is_locked(), ""); + assert(CompiledICLocker::is_safe(ic->instruction_address()), "mt unsafe call"); if (TraceICBuffer) { tty->print_cr(" create transition stub for " INTPTR_FORMAT " destination " INTPTR_FORMAT " cached value " INTPTR_FORMAT, p2i(ic->instruction_address()), p2i(entry), p2i(cached_value)); @@ -224,7 +225,9 @@ void InlineCacheBuffer::release_pending_icholders() { // not safe to free them until them since they might be visible to // another thread. void InlineCacheBuffer::queue_for_release(CompiledICHolder* icholder) { - MutexLockerEx mex(InlineCacheBuffer_lock); + MutexLockerEx mex1((CompiledIC_lock->owned_by_self() || + SafepointSynchronize::is_at_safepoint()) ? NULL : CompiledIC_lock); + MutexLockerEx mex2(InlineCacheBuffer_lock); icholder->set_next(_pending_released); _pending_released = icholder; _pending_count++; diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 59597907f6b..c3ead515aac 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -953,7 +953,7 @@ void nmethod::fix_oop_relocations(address begin, address end, bool initialize_im void nmethod::verify_clean_inline_caches() { - assert_locked_or_safepoint(CompiledIC_lock); + assert(CompiledICLocker::is_safe(this), "mt unsafe call"); ResourceMark rm; RelocIterator iter(this, oops_reloc_begin()); @@ -2115,14 +2115,11 @@ void nmethod::verify() { void nmethod::verify_interrupt_point(address call_site) { // Verify IC only when nmethod installation is finished. if (!is_not_installed()) { - Thread *cur = Thread::current(); - if (CompiledIC_lock->owner() == cur || - ((cur->is_VM_thread() || cur->is_ConcurrentGC_thread()) && - SafepointSynchronize::is_at_safepoint())) { + if (CompiledICLocker::is_safe(this)) { CompiledIC_at(this, call_site); CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); } else { - MutexLocker ml_verify (CompiledIC_lock); + CompiledICLocker ml_verify(this); CompiledIC_at(this, call_site); } } @@ -2819,7 +2816,7 @@ void nmethod::print_calls(outputStream* st) { switch (iter.type()) { case relocInfo::virtual_call_type: case relocInfo::opt_virtual_call_type: { - VerifyMutexLocker mc(CompiledIC_lock); + CompiledICLocker ml_verify(this); CompiledIC_at(&iter)->print(); break; } diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index b62f6281a25..86160996eff 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -30,6 +30,7 @@ #include "classfile/stringTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeBehaviours.hpp" #include "code/codeCache.hpp" #include "code/dependencies.hpp" #include "gc/shared/collectedHeap.inline.hpp" @@ -60,9 +61,9 @@ #include "prims/resolvedMethodTable.hpp" #include "runtime/arguments.hpp" #include "runtime/atomic.hpp" +#include "runtime/deoptimization.hpp" #include "runtime/flags/flagSetting.hpp" #include "runtime/flags/jvmFlagConstraintList.hpp" -#include "runtime/deoptimization.hpp" #include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/java.hpp" @@ -640,6 +641,10 @@ void* Universe::non_oop_word() { return (void*)_non_oop_bits; } +static void initialize_global_behaviours() { + CompiledICProtectionBehaviour::set_current(new DefaultICProtectionBehaviour()); +} + jint universe_init() { assert(!Universe::_fully_initialized, "called after initialize_vtables"); guarantee(1 << LogHeapWordSize == sizeof(HeapWord), @@ -652,6 +657,8 @@ jint universe_init() { JavaClasses::compute_hard_coded_offsets(); + initialize_global_behaviours(); + jint status = Universe::initialize_heap(); if (status != JNI_OK) { return status; diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp index abfd401b01f..b8ca90430e2 100644 --- a/src/hotspot/share/runtime/mutexLocker.hpp +++ b/src/hotspot/share/runtime/mutexLocker.hpp @@ -346,38 +346,4 @@ class MutexUnlockerEx: StackObj { } }; -#ifndef PRODUCT -// -// A special MutexLocker that allows: -// - reentrant locking -// - locking out of order -// -// Only to be used for verify code, where we can relax out dead-lock -// detection code a bit (unsafe, but probably ok). This code is NEVER to -// be included in a product version. -// -class VerifyMutexLocker: StackObj { - private: - Monitor * _mutex; - bool _reentrant; - public: - VerifyMutexLocker(Monitor * mutex) { - _mutex = mutex; - _reentrant = mutex->owned_by_self(); - if (!_reentrant) { - // We temp. disable strict safepoint checking, while we require the lock - FlagSetting fs(StrictSafepointChecks, false); - _mutex->lock(); - } - } - - ~VerifyMutexLocker() { - if (!_reentrant) { - _mutex->unlock(); - } - } -}; - -#endif - #endif // SHARE_VM_RUNTIME_MUTEXLOCKER_HPP diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 33abe956dd1..1b67d85c4c8 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -1351,7 +1351,7 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, // grab lock, check for deoptimization and potentially patch caller { - MutexLocker ml_patch(CompiledIC_lock); + CompiledICLocker ml(caller_nm); // Lock blocks for safepoint during which both nmethods can change state. @@ -1382,7 +1382,7 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, } } - } // unlock CompiledIC_lock + } // unlock CompiledICLocker return callee_method; } @@ -1585,11 +1585,13 @@ methodHandle SharedRuntime::handle_ic_miss_helper(JavaThread *thread, TRAPS) { JvmtiDynamicCodeEventCollector event_collector; // Update inline cache to megamorphic. Skip update if we are called from interpreted. - { MutexLocker ml_patch (CompiledIC_lock); + { RegisterMap reg_map(thread, false); frame caller_frame = thread->last_frame().sender(®_map); CodeBlob* cb = caller_frame.cb(); CompiledMethod* caller_nm = cb->as_compiled_method_or_null(); + CompiledICLocker ml(caller_nm); + if (cb->is_compiled()) { CompiledIC* inline_cache = CompiledIC_before(((CompiledMethod*)cb), caller_frame.pc()); bool should_be_mono = false; @@ -1647,7 +1649,7 @@ methodHandle SharedRuntime::handle_ic_miss_helper(JavaThread *thread, TRAPS) { } else { fatal("Unimplemented"); } - } // Release CompiledIC_lock + } // Release CompiledICLocker return callee_method; } @@ -1731,8 +1733,7 @@ methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, TRAPS) { // to a wrong method). It should not be performance critical, since the // resolve is only done once. - bool is_nmethod = caller_nm->is_nmethod(); - MutexLocker ml(CompiledIC_lock); + CompiledICLocker ml(caller_nm); if (is_static_call) { CompiledStaticCall* ssc = caller_nm->compiledStaticCall_at(call_addr); ssc->set_to_clean(); diff --git a/src/hotspot/share/runtime/sweeper.cpp b/src/hotspot/share/runtime/sweeper.cpp index a2e59ce224b..f2523341af0 100644 --- a/src/hotspot/share/runtime/sweeper.cpp +++ b/src/hotspot/share/runtime/sweeper.cpp @@ -673,8 +673,8 @@ void NMethodSweeper::release_compiled_method(CompiledMethod* nm) { // Clean up any CompiledICHolders { ResourceMark rm; - MutexLocker ml_patch(CompiledIC_lock); RelocIterator iter(nm); + CompiledICLocker ml(nm); while (iter.next()) { if (iter.type() == relocInfo::virtual_call_type) { CompiledIC::cleanup_call_site(iter.virtual_call_reloc(), nm); @@ -701,7 +701,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil // But still remember to clean-up inline caches for alive nmethods if (cm->is_alive()) { // Clean inline caches that point to zombie/non-entrant/unloaded nmethods - MutexLocker cl(CompiledIC_lock); + CompiledICLocker ml(cm); cm->cleanup_inline_caches(); SWEEP(cm); } @@ -723,7 +723,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil // Clear ICStubs to prevent back patching stubs of zombie or flushed // nmethods during the next safepoint (see ICStub::finalize). { - MutexLocker cl(CompiledIC_lock); + CompiledICLocker ml(cm); cm->clear_ic_stubs(); } // Code cache state change is tracked in make_zombie() @@ -747,7 +747,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil } } else { // Still alive, clean up its inline caches - MutexLocker cl(CompiledIC_lock); + CompiledICLocker ml(cm); cm->cleanup_inline_caches(); SWEEP(cm); } @@ -757,7 +757,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil { // Clean ICs of unloaded nmethods as well because they may reference other // unloaded nmethods that may be flushed earlier in the sweeper cycle. - MutexLocker cl(CompiledIC_lock); + CompiledICLocker ml(cm); cm->cleanup_inline_caches(); } if (cm->is_osr_method()) { @@ -778,7 +778,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil possibly_flush((nmethod*)cm); } // Clean inline caches that point to zombie/non-entrant/unloaded nmethods - MutexLocker cl(CompiledIC_lock); + CompiledICLocker ml(cm); cm->cleanup_inline_caches(); SWEEP(cm); } From 25f14cd7571d70f986d918f93cc29157dd009bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Fri, 2 Nov 2018 08:33:59 +0100 Subject: [PATCH 027/128] 8209189: Make CompiledMethod::do_unloading more concurrent Reviewed-by: kvn, coleenp --- src/hotspot/share/aot/aotCodeHeap.cpp | 2 +- src/hotspot/share/aot/aotCompiledMethod.cpp | 6 +- src/hotspot/share/aot/aotCompiledMethod.hpp | 7 +- src/hotspot/share/code/codeCache.cpp | 37 +--- src/hotspot/share/code/codeCache.hpp | 24 +- src/hotspot/share/code/compiledMethod.cpp | 208 +++++++----------- src/hotspot/share/code/compiledMethod.hpp | 54 ++--- src/hotspot/share/code/nmethod.cpp | 133 +++-------- src/hotspot/share/code/nmethod.hpp | 20 +- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 1 + src/hotspot/share/gc/shared/gcBehaviours.cpp | 72 ++++++ src/hotspot/share/gc/shared/gcBehaviours.hpp | 53 +++++ .../share/gc/shared/parallelCleaning.cpp | 100 +-------- .../share/gc/shared/parallelCleaning.hpp | 31 +-- src/hotspot/share/runtime/sweeper.cpp | 8 +- 15 files changed, 309 insertions(+), 447 deletions(-) create mode 100644 src/hotspot/share/gc/shared/gcBehaviours.cpp create mode 100644 src/hotspot/share/gc/shared/gcBehaviours.hpp diff --git a/src/hotspot/share/aot/aotCodeHeap.cpp b/src/hotspot/share/aot/aotCodeHeap.cpp index e493f37d790..7f0540562fa 100644 --- a/src/hotspot/share/aot/aotCodeHeap.cpp +++ b/src/hotspot/share/aot/aotCodeHeap.cpp @@ -926,7 +926,7 @@ void AOTCodeHeap::cleanup_inline_caches() { continue; // Skip uninitialized entries. } AOTCompiledMethod* aot = _code_to_aot[index]._aot; - aot->cleanup_inline_caches(); + aot->cleanup_inline_caches(false); } } diff --git a/src/hotspot/share/aot/aotCompiledMethod.cpp b/src/hotspot/share/aot/aotCompiledMethod.cpp index 528ffd9bf27..46705a1e0e0 100644 --- a/src/hotspot/share/aot/aotCompiledMethod.cpp +++ b/src/hotspot/share/aot/aotCompiledMethod.cpp @@ -75,10 +75,6 @@ address* AOTCompiledMethod::orig_pc_addr(const frame* fr) { return (address*) ((address)fr->unextended_sp() + _meta->orig_pc_offset()); } -bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive) { - return false; -} - oop AOTCompiledMethod::oop_at(int index) const { if (index == 0) { // 0 is reserved return NULL; @@ -352,7 +348,7 @@ void AOTCompiledMethod::log_identity(xmlStream* log) const { log->print(" aot='%2d'", _heap->dso_id()); } -void AOTCompiledMethod::log_state_change(oop cause) const { +void AOTCompiledMethod::log_state_change() const { if (LogCompilation) { ResourceMark m; if (xtty != NULL) { diff --git a/src/hotspot/share/aot/aotCompiledMethod.hpp b/src/hotspot/share/aot/aotCompiledMethod.hpp index 47049afe2a6..838496f4c46 100644 --- a/src/hotspot/share/aot/aotCompiledMethod.hpp +++ b/src/hotspot/share/aot/aotCompiledMethod.hpp @@ -193,7 +193,7 @@ private: virtual int comp_level() const { return CompLevel_aot; } virtual address verified_entry_point() const { return _code + _meta->verified_entry_offset(); } virtual void log_identity(xmlStream* stream) const; - virtual void log_state_change(oop cause = NULL) const; + virtual void log_state_change() const; virtual bool make_entrant() NOT_TIERED({ ShouldNotReachHere(); return false; }); virtual bool make_not_entrant() { return make_not_entrant_helper(not_entrant); } virtual bool make_not_used() { return make_not_entrant_helper(not_used); } @@ -277,11 +277,6 @@ protected: CompiledStaticCall* compiledStaticCall_before(address addr) const; private: bool is_aot_runtime_stub() const { return _method == NULL; } - -protected: - virtual bool do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive); - virtual bool do_unloading_jvmci() { return false; } - }; class PltNativeCallWrapper: public NativeCallWrapper { diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index c853d2e5b47..4f070efaa53 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -144,7 +144,6 @@ class CodeBlob_sizes { address CodeCache::_low_bound = 0; address CodeCache::_high_bound = 0; int CodeCache::_number_of_nmethods_with_dependencies = 0; -bool CodeCache::_needs_cache_clean = false; nmethod* CodeCache::_scavenge_root_nmethods = NULL; // Initialize arrays of CodeHeap subsets @@ -683,17 +682,11 @@ int CodeCache::alignment_offset() { // Mark nmethods for unloading if they contain otherwise unreachable oops. void CodeCache::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred) { assert_locked_or_safepoint(CodeCache_lock); + UnloadingScope scope(is_alive); CompiledMethodIterator iter; while(iter.next_alive()) { - iter.method()->do_unloading(is_alive); + iter.method()->do_unloading(unloading_occurred); } - - // Now that all the unloaded nmethods are known, cleanup caches - // before CLDG is purged. - // This is another code cache walk but it is moved from gc_epilogue. - // G1 does a parallel walk of the nmethods so cleans them up - // as it goes and doesn't call this. - do_unloading_nmethod_caches(unloading_occurred); } void CodeCache::blobs_do(CodeBlobClosure* f) { @@ -908,28 +901,14 @@ void CodeCache::gc_epilogue() { prune_scavenge_root_nmethods(); } +uint8_t CodeCache::_unloading_cycle = 1; -void CodeCache::do_unloading_nmethod_caches(bool class_unloading_occurred) { - assert_locked_or_safepoint(CodeCache_lock); - // Even if classes are not unloaded, there may have been some nmethods that are - // unloaded because oops in them are no longer reachable. - NOT_DEBUG(if (needs_cache_clean() || class_unloading_occurred)) { - CompiledMethodIterator iter; - while(iter.next_alive()) { - CompiledMethod* cm = iter.method(); - assert(!cm->is_unloaded(), "Tautology"); - DEBUG_ONLY(if (needs_cache_clean() || class_unloading_occurred)) { - // Clean up both unloaded klasses from nmethods and unloaded nmethods - // from inline caches. - cm->unload_nmethod_caches(/*parallel*/false, class_unloading_occurred); - } - DEBUG_ONLY(cm->verify()); - DEBUG_ONLY(cm->verify_oop_relocations()); - } +void CodeCache::increment_unloading_cycle() { + if (_unloading_cycle == 1) { + _unloading_cycle = 2; + } else { + _unloading_cycle = 1; } - - set_needs_cache_clean(false); - verify_icholder_relocations(); } void CodeCache::verify_oops() { diff --git a/src/hotspot/share/code/codeCache.hpp b/src/hotspot/share/code/codeCache.hpp index fcf6cb404c0..e43d98aa6be 100644 --- a/src/hotspot/share/code/codeCache.hpp +++ b/src/hotspot/share/code/codeCache.hpp @@ -27,6 +27,7 @@ #include "code/codeBlob.hpp" #include "code/nmethod.hpp" +#include "gc/shared/gcBehaviours.hpp" #include "memory/allocation.hpp" #include "memory/heap.hpp" #include "oops/instanceKlass.hpp" @@ -90,8 +91,8 @@ class CodeCache : AllStatic { static address _low_bound; // Lower bound of CodeHeap addresses static address _high_bound; // Upper bound of CodeHeap addresses static int _number_of_nmethods_with_dependencies; // Total number of nmethods with dependencies - static bool _needs_cache_clean; // True if inline caches of the nmethods needs to be flushed static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link() + static uint8_t _unloading_cycle; // Global state for recognizing old nmethods that need to be unloaded static void mark_scavenge_root_nmethods() PRODUCT_RETURN; static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN; @@ -172,7 +173,24 @@ class CodeCache : AllStatic { // to) any unmarked codeBlobs in the cache. Sets "marked_for_unloading" // to "true" iff some code got unloaded. // "unloading_occurred" controls whether metadata should be cleaned because of class unloading. + class UnloadingScope: StackObj { + ClosureIsUnloadingBehaviour _is_unloading_behaviour; + + public: + UnloadingScope(BoolObjectClosure* is_alive) + : _is_unloading_behaviour(is_alive) + { + IsUnloadingBehaviour::set_current(&_is_unloading_behaviour); + increment_unloading_cycle(); + } + + ~UnloadingScope() { + IsUnloadingBehaviour::set_current(NULL); + } + }; static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred); + static uint16_t unloading_cycle() { return _unloading_cycle; } + static void increment_unloading_cycle(); static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN; // Apply f to every live code blob in scavengable nmethods. Prune nmethods @@ -222,12 +240,8 @@ class CodeCache : AllStatic { static double reverse_free_ratio(int code_blob_type); - static bool needs_cache_clean() { return _needs_cache_clean; } - static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; } - static void clear_inline_caches(); // clear all inline caches static void cleanup_inline_caches(); // clean unloaded/zombie nmethods from inline caches - static void do_unloading_nmethod_caches(bool class_unloading_occurred); // clean all nmethod caches for unloading, including inline caches // Returns true if an own CodeHeap for the given CodeBlobType is available static bool heap_available(int code_blob_type); diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index eb8e16d0794..206a6c677c9 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -27,6 +27,8 @@ #include "code/compiledMethod.inline.hpp" #include "code/scopeDesc.hpp" #include "code/codeCache.hpp" +#include "gc/shared/barrierSet.hpp" +#include "gc/shared/gcBehaviours.hpp" #include "interpreter/bytecode.inline.hpp" #include "logging/log.hpp" #include "logging/logTag.hpp" @@ -37,16 +39,29 @@ #include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" -CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments) +CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, const CodeBlobLayout& layout, + int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, + bool caller_must_gc_arguments) : CodeBlob(name, type, layout, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments), - _mark_for_deoptimization_status(not_marked), _method(method) { + _mark_for_deoptimization_status(not_marked), + _is_unloading_state(0), + _method(method) +{ init_defaults(); + clear_unloading_state(); } -CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, int size, int header_size, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) - : CodeBlob(name, type, CodeBlobLayout((address) this, size, header_size, cb), cb, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments), - _mark_for_deoptimization_status(not_marked), _method(method) { +CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, int size, + int header_size, CodeBuffer* cb, int frame_complete_offset, int frame_size, + OopMapSet* oop_maps, bool caller_must_gc_arguments) + : CodeBlob(name, type, CodeBlobLayout((address) this, size, header_size, cb), cb, + frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments), + _mark_for_deoptimization_status(not_marked), + _is_unloading_state(0), + _method(method) +{ init_defaults(); + clear_unloading_state(); } void CompiledMethod::init_defaults() { @@ -54,7 +69,6 @@ void CompiledMethod::init_defaults() { _has_method_handle_invokes = 0; _lazy_critical_native = 0; _has_wide_vectors = 0; - _unloading_clock = 0; } bool CompiledMethod::is_method_handle_return(address return_pc) { @@ -385,26 +399,6 @@ void CompiledMethod::clean_ic_if_metadata_is_dead(CompiledIC *ic) { ic->set_to_clean(); } -unsigned char CompiledMethod::_global_unloading_clock = 0; - -void CompiledMethod::increase_unloading_clock() { - _global_unloading_clock++; - if (_global_unloading_clock == 0) { - // _nmethods are allocated with _unloading_clock == 0, - // so 0 is never used as a clock value. - _global_unloading_clock = 1; - } -} - -void CompiledMethod::set_unloading_clock(unsigned char unloading_clock) { - OrderAccess::release_store(&_unloading_clock, unloading_clock); -} - -unsigned char CompiledMethod::unloading_clock() { - return OrderAccess::load_acquire(&_unloading_clock); -} - - // static_stub_Relocations may have dangling references to // nmethods so trim them out here. Otherwise it looks like // compiled code is maintaining a link to dead metadata. @@ -438,84 +432,30 @@ void CompiledMethod::clean_ic_stubs() { #endif } -// This is called at the end of the strong tracing/marking phase of a -// GC to unload an nmethod if it contains otherwise unreachable -// oops. - -void CompiledMethod::do_unloading(BoolObjectClosure* is_alive) { - // Make sure the oop's ready to receive visitors - assert(!is_zombie() && !is_unloaded(), - "should not call follow on zombie or unloaded nmethod"); - - address low_boundary = oops_reloc_begin(); - - if (do_unloading_oops(low_boundary, is_alive)) { - return; - } - -#if INCLUDE_JVMCI - if (do_unloading_jvmci()) { - return; - } -#endif - - // Cleanup exception cache and inline caches happens - // after all the unloaded methods are found. -} - // Clean references to unloaded nmethods at addr from this one, which is not unloaded. template -static bool clean_if_nmethod_is_unloaded(CompiledICorStaticCall *ic, address addr, CompiledMethod* from, - bool parallel, bool clean_all) { +static void clean_if_nmethod_is_unloaded(CompiledICorStaticCall *ic, address addr, CompiledMethod* from, + bool clean_all) { // Ok, to lookup references to zombies here CodeBlob *cb = CodeCache::find_blob_unsafe(addr); CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL; if (nm != NULL) { - if (parallel && nm->unloading_clock() != CompiledMethod::global_unloading_clock()) { - // The nmethod has not been processed yet. - return true; - } - // Clean inline caches pointing to both zombie and not_entrant methods - if (clean_all || !nm->is_in_use() || (nm->method()->code() != nm)) { + if (clean_all || !nm->is_in_use() || nm->is_unloading() || (nm->method()->code() != nm)) { ic->set_to_clean(from->is_alive()); assert(ic->is_clean(), "nmethod " PTR_FORMAT "not clean %s", p2i(from), from->method()->name_and_sig_as_C_string()); } } - - return false; } -static bool clean_if_nmethod_is_unloaded(CompiledIC *ic, CompiledMethod* from, - bool parallel, bool clean_all = false) { - return clean_if_nmethod_is_unloaded(ic, ic->ic_destination(), from, parallel, clean_all); +static void clean_if_nmethod_is_unloaded(CompiledIC *ic, CompiledMethod* from, + bool clean_all) { + clean_if_nmethod_is_unloaded(ic, ic->ic_destination(), from, clean_all); } -static bool clean_if_nmethod_is_unloaded(CompiledStaticCall *csc, CompiledMethod* from, - bool parallel, bool clean_all = false) { - return clean_if_nmethod_is_unloaded(csc, csc->destination(), from, parallel, clean_all); -} - -bool CompiledMethod::do_unloading_parallel(BoolObjectClosure* is_alive, bool unloading_occurred) { - ResourceMark rm; - - // Make sure the oop's ready to receive visitors - assert(!is_zombie() && !is_unloaded(), - "should not call follow on zombie or unloaded nmethod"); - - address low_boundary = oops_reloc_begin(); - - if (do_unloading_oops(low_boundary, is_alive)) { - return false; - } - -#if INCLUDE_JVMCI - if (do_unloading_jvmci()) { - return false; - } -#endif - - return unload_nmethod_caches(/*parallel*/true, unloading_occurred); +static void clean_if_nmethod_is_unloaded(CompiledStaticCall *csc, CompiledMethod* from, + bool clean_all) { + clean_if_nmethod_is_unloaded(csc, csc->destination(), from, clean_all); } // Cleans caches in nmethods that point to either classes that are unloaded @@ -525,29 +465,70 @@ bool CompiledMethod::do_unloading_parallel(BoolObjectClosure* is_alive, bool unl // nmethods are unloaded. Return postponed=true in the parallel case for // inline caches found that point to nmethods that are not yet visited during // the do_unloading walk. -bool CompiledMethod::unload_nmethod_caches(bool parallel, bool unloading_occurred) { +void CompiledMethod::unload_nmethod_caches(bool unloading_occurred) { + ResourceMark rm; // Exception cache only needs to be called if unloading occurred if (unloading_occurred) { clean_exception_cache(); } - bool postponed = cleanup_inline_caches_impl(parallel, unloading_occurred, /*clean_all*/false); + cleanup_inline_caches_impl(unloading_occurred, false); // All static stubs need to be cleaned. clean_ic_stubs(); // Check that the metadata embedded in the nmethod is alive DEBUG_ONLY(metadata_do(check_class)); +} - return postponed; +// The IsUnloadingStruct represents a tuple comprising a result of +// IsUnloadingBehaviour::is_unloading() for a given unloading cycle. +struct IsUnloadingStruct { + unsigned int _is_unloading:1; + unsigned int _unloading_cycle:2; +}; + +// The IsUnloadingUnion allows treating the tuple of the IsUnloadingStruct +// like a uint8_t, making it possible to read and write the tuple atomically. +union IsUnloadingUnion { + IsUnloadingStruct _inflated; + uint8_t _value; +}; + +bool CompiledMethod::is_unloading() { + IsUnloadingUnion state; + state._value = RawAccess::load(&_is_unloading_state); + if (state._inflated._is_unloading == 1) { + return true; + } + if (state._inflated._unloading_cycle == CodeCache::unloading_cycle()) { + return state._inflated._is_unloading == 1; + } + + // The IsUnloadingBehaviour is responsible for checking if there are any dead + // oops in the CompiledMethod, by calling oops_do on it. + bool result = IsUnloadingBehaviour::current()->is_unloading(this); + + state._inflated._unloading_cycle = CodeCache::unloading_cycle(); + state._inflated._is_unloading = result ? 1 : 0; + + RawAccess::store(&_is_unloading_state, state._value); + + return result; +} + +void CompiledMethod::clear_unloading_state() { + IsUnloadingUnion state; + state._inflated._unloading_cycle = CodeCache::unloading_cycle(); + state._inflated._is_unloading = 0; + RawAccess::store(&_is_unloading_state, state._value); } // Called to clean up after class unloading for live nmethods and from the sweeper // for all methods. -bool CompiledMethod::cleanup_inline_caches_impl(bool parallel, bool unloading_occurred, bool clean_all) { +void CompiledMethod::cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all) { assert(CompiledICLocker::is_safe(this), "mt unsafe call"); - bool postponed = false; ResourceMark rm; // Find all calls in an nmethod and clear the ones that point to non-entrant, @@ -564,19 +545,18 @@ bool CompiledMethod::cleanup_inline_caches_impl(bool parallel, bool unloading_oc clean_ic_if_metadata_is_dead(CompiledIC_at(&iter)); } - postponed |= clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), this, parallel, clean_all); + clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), this, clean_all); break; case relocInfo::opt_virtual_call_type: - postponed |= clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), this, parallel, clean_all); + clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), this, clean_all); break; case relocInfo::static_call_type: - postponed |= clean_if_nmethod_is_unloaded(compiledStaticCall_at(iter.reloc()), this, parallel, clean_all); + clean_if_nmethod_is_unloaded(compiledStaticCall_at(iter.reloc()), this, clean_all); break; case relocInfo::oop_type: - // handled by do_unloading_oops already break; case relocInfo::metadata_type: @@ -586,38 +566,6 @@ bool CompiledMethod::cleanup_inline_caches_impl(bool parallel, bool unloading_oc break; } } - - return postponed; -} - -void CompiledMethod::do_unloading_parallel_postponed() { - ResourceMark rm; - - // Make sure the oop's ready to receive visitors - assert(!is_zombie(), - "should not call follow on zombie nmethod"); - - RelocIterator iter(this, oops_reloc_begin()); - while(iter.next()) { - - switch (iter.type()) { - - case relocInfo::virtual_call_type: - clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), this, true); - break; - - case relocInfo::opt_virtual_call_type: - clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), this, true); - break; - - case relocInfo::static_call_type: - clean_if_nmethod_is_unloaded(compiledStaticCall_at(iter.reloc()), this, true); - break; - - default: - break; - } - } } // Iterating over all nmethods, e.g. with the help of CodeCache::nmethods_do(fun) was found diff --git a/src/hotspot/share/code/compiledMethod.hpp b/src/hotspot/share/code/compiledMethod.hpp index 36e017d0972..d21066c2f67 100644 --- a/src/hotspot/share/code/compiledMethod.hpp +++ b/src/hotspot/share/code/compiledMethod.hpp @@ -147,6 +147,9 @@ protected: bool _is_far_code; // Code is far from CodeCache. // Have to use far call instructions to call it from code in CodeCache. + + volatile uint8_t _is_unloading_state; // Local state used to keep track of whether unloading is happening or not + // set during construction unsigned int _has_unsafe_access:1; // May fault due to unsafe access. unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes? @@ -202,7 +205,7 @@ public: virtual address verified_entry_point() const = 0; virtual void log_identity(xmlStream* log) const = 0; - virtual void log_state_change(oop cause = NULL) const = 0; + virtual void log_state_change() const = 0; virtual bool make_not_used() = 0; virtual bool make_not_entrant() = 0; virtual bool make_entrant() = 0; @@ -333,17 +336,13 @@ public: static address get_deopt_original_pc(const frame* fr); - // GC unloading support - // Cleans unloaded klasses and unloaded nmethods in inline caches - bool unload_nmethod_caches(bool parallel, bool class_unloading_occurred); - // Inline cache support for class unloading and nmethod unloading private: - bool cleanup_inline_caches_impl(bool parallel, bool unloading_occurred, bool clean_all); + void cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all); public: - bool cleanup_inline_caches(bool clean_all = false) { + void cleanup_inline_caches(bool clean_all) { // Serial version used by sweeper and whitebox test - return cleanup_inline_caches_impl(false, false, clean_all); + cleanup_inline_caches_impl(false, clean_all); } virtual void clear_inline_caches(); @@ -373,53 +372,32 @@ public: virtual void metadata_do(void f(Metadata*)) = 0; // GC support - - void set_unloading_next(CompiledMethod* next) { _unloading_next = next; } - CompiledMethod* unloading_next() { return _unloading_next; } - protected: address oops_reloc_begin() const; + private: void static clean_ic_if_metadata_is_dead(CompiledIC *ic); void clean_ic_stubs(); public: - virtual void do_unloading(BoolObjectClosure* is_alive); - // The parallel versions are used by G1. - virtual bool do_unloading_parallel(BoolObjectClosure* is_alive, bool unloading_occurred); - virtual void do_unloading_parallel_postponed(); + // GC unloading support + // Cleans unloaded klasses and unloaded nmethods in inline caches - static unsigned char global_unloading_clock() { return _global_unloading_clock; } - static void increase_unloading_clock(); + bool is_unloading(); - void set_unloading_clock(unsigned char unloading_clock); - unsigned char unloading_clock(); - -protected: - virtual bool do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive) = 0; -#if INCLUDE_JVMCI - virtual bool do_unloading_jvmci() = 0; -#endif + void unload_nmethod_caches(bool class_unloading_occurred); + void clear_unloading_state(); + virtual void do_unloading(bool unloading_occurred) { } private: - // GC support to help figure out if an nmethod has been - // cleaned/unloaded by the current GC. - static unsigned char _global_unloading_clock; - - volatile unsigned char _unloading_clock; // Incremented after GC unloaded/cleaned the nmethod - PcDesc* find_pc_desc(address pc, bool approximate) { return _pc_desc_container.find_pc_desc(pc, approximate, PcDescSearch(code_begin(), scopes_pcs_begin(), scopes_pcs_end())); } protected: - union { - // Used by G1 to chain nmethods. - CompiledMethod* _unloading_next; - // Used by non-G1 GCs to chain nmethods. - nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods - }; + // Used by some GCs to chain nmethods. + nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods }; #endif //SHARE_VM_CODE_COMPILEDMETHOD_HPP diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index c3ead515aac..e8ed3a659c5 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -413,7 +413,6 @@ void nmethod::init_defaults() { _oops_do_mark_link = NULL; _jmethod_id = NULL; _osr_link = NULL; - _unloading_next = NULL; _scavenge_root_link = NULL; _scavenge_root_state = 0; #if INCLUDE_RTM_OPT @@ -599,6 +598,7 @@ nmethod::nmethod( code_buffer->copy_code_and_locs_to(this); code_buffer->copy_values_to(this); + if (ScavengeRootsInCode) { Universe::heap()->register_nmethod(this); } @@ -757,6 +757,7 @@ nmethod::nmethod( code_buffer->copy_values_to(this); debug_info->copy_to(this); dependencies->copy_to(this); + clear_unloading_state(); if (ScavengeRootsInCode) { Universe::heap()->register_nmethod(this); } @@ -1025,8 +1026,7 @@ void nmethod::inc_decompile_count() { mdo->inc_decompile_count(); } -void nmethod::make_unloaded(oop cause) { - +void nmethod::make_unloaded() { post_compiled_method_unload(); // This nmethod is being unloaded, make sure that dependencies @@ -1042,11 +1042,8 @@ void nmethod::make_unloaded(oop cause) { LogStream ls(lt); ls.print("making nmethod " INTPTR_FORMAT " unloadable, Method*(" INTPTR_FORMAT - "), cause(" INTPTR_FORMAT ") ", - p2i(this), p2i(_method), p2i(cause)); - if (cause != NULL) { - cause->print_value_on(&ls); - } + ") ", + p2i(this), p2i(_method)); ls.cr(); } // Unlink the osr method, so we do not look this up again @@ -1079,12 +1076,6 @@ void nmethod::make_unloaded(oop cause) { // Make the class unloaded - i.e., change state and notify sweeper assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); - if (is_in_use()) { - // Transitioning directly from live to unloaded -- so - // we need to force a cache clean-up; remember this - // for later on. - CodeCache::set_needs_cache_clean(true); - } // Unregister must be done before the state change Universe::heap()->unregister_nmethod(this); @@ -1092,7 +1083,7 @@ void nmethod::make_unloaded(oop cause) { _state = unloaded; // Log the unloading. - log_state_change(cause); + log_state_change(); #if INCLUDE_JVMCI // The method can only be unloaded after the pointer to the installed code @@ -1116,7 +1107,7 @@ void nmethod::invalidate_osr_method() { } } -void nmethod::log_state_change(oop cause) const { +void nmethod::log_state_change() const { if (LogCompilation) { if (xtty != NULL) { ttyLocker ttyl; // keep the following output all in one block @@ -1129,9 +1120,6 @@ void nmethod::log_state_change(oop cause) const { (_state == zombie ? " zombie='1'" : "")); } log_identity(xtty); - if (cause != NULL) { - xtty->print(" cause='%s'", cause->klass()->external_name()); - } xtty->stamp(); xtty->end_elem(); } @@ -1380,21 +1368,6 @@ void nmethod::flush_dependencies(bool delete_immediately) { } } - -// If this oop is not live, the nmethod can be unloaded. -bool nmethod::can_unload(BoolObjectClosure* is_alive, oop* root) { - assert(root != NULL, "just checking"); - oop obj = *root; - if (obj == NULL || is_alive->do_object_b(obj)) { - return false; - } - - // An nmethod might be unloaded simply because one of its constant oops has gone dead. - // No actual classes need to be unloaded in order for this to occur. - make_unloaded(obj); - return true; -} - // ------------------------------------------------------------------ // post_compiled_method_load_event // new method for install_code() path @@ -1468,70 +1441,6 @@ void nmethod::post_compiled_method_unload() { set_unload_reported(); } -bool nmethod::unload_if_dead_at(RelocIterator* iter_at_oop, BoolObjectClosure *is_alive) { - assert(iter_at_oop->type() == relocInfo::oop_type, "Wrong relocation type"); - - oop_Relocation* r = iter_at_oop->oop_reloc(); - // Traverse those oops directly embedded in the code. - // Other oops (oop_index>0) are seen as part of scopes_oops. - assert(1 == (r->oop_is_immediate()) + - (r->oop_addr() >= oops_begin() && r->oop_addr() < oops_end()), - "oop must be found in exactly one place"); - if (r->oop_is_immediate() && r->oop_value() != NULL) { - // Unload this nmethod if the oop is dead. - if (can_unload(is_alive, r->oop_addr())) { - return true;; - } - } - - return false; -} - -bool nmethod::do_unloading_scopes(BoolObjectClosure* is_alive) { - // Scopes - for (oop* p = oops_begin(); p < oops_end(); p++) { - if (*p == Universe::non_oop_word()) continue; // skip non-oops - if (can_unload(is_alive, p)) { - return true; - } - } - return false; -} - -bool nmethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive) { - // Compiled code - - // Prevent extra code cache walk for platforms that don't have immediate oops. - if (relocInfo::mustIterateImmediateOopsInCode()) { - RelocIterator iter(this, low_boundary); - while (iter.next()) { - if (iter.type() == relocInfo::oop_type) { - if (unload_if_dead_at(&iter, is_alive)) { - return true; - } - } - } - } - - return do_unloading_scopes(is_alive); -} - -#if INCLUDE_JVMCI -bool nmethod::do_unloading_jvmci() { - if (_jvmci_installed_code != NULL) { - if (JNIHandles::is_global_weak_cleared(_jvmci_installed_code)) { - if (_jvmci_installed_code_triggers_invalidation) { - // The reference to the installed code has been dropped so invalidate - // this nmethod and allow the sweeper to reclaim it. - make_not_entrant(); - } - clear_jvmci_installed_code(); - } - } - return false; -} -#endif - // Iterate over metadata calling this function. Used by RedefineClasses void nmethod::metadata_do(void f(Metadata*)) { { @@ -1579,6 +1488,34 @@ void nmethod::metadata_do(void f(Metadata*)) { if (_method != NULL) f(_method); } + +// This is called at the end of the strong tracing/marking phase of a +// GC to unload an nmethod if it contains otherwise unreachable +// oops. + +void nmethod::do_unloading(bool unloading_occurred) { + // Make sure the oop's ready to receive visitors + assert(!is_zombie() && !is_unloaded(), + "should not call follow on zombie or unloaded nmethod"); + + if (is_unloading()) { + make_unloaded(); + } else { +#if INCLUDE_JVMCI + if (_jvmci_installed_code != NULL) { + if (JNIHandles::is_global_weak_cleared(_jvmci_installed_code)) { + if (_jvmci_installed_code_triggers_invalidation) { + make_not_entrant(); + } + clear_jvmci_installed_code(); + } + } +#endif + + unload_nmethod_caches(unloading_occurred); + } +} + void nmethod::oops_do(OopClosure* f, bool allow_zombie) { // make sure the oops ready to receive visitors assert(allow_zombie || !is_zombie(), "should not call follow on zombie nmethod"); diff --git a/src/hotspot/share/code/nmethod.hpp b/src/hotspot/share/code/nmethod.hpp index 664a10ecb14..053b70b4576 100644 --- a/src/hotspot/share/code/nmethod.hpp +++ b/src/hotspot/share/code/nmethod.hpp @@ -323,6 +323,8 @@ class nmethod : public CompiledMethod { bool is_zombie() const { return _state == zombie; } bool is_unloaded() const { return _state == unloaded; } + virtual void do_unloading(bool unloading_occurred); + #if INCLUDE_RTM_OPT // rtm state accessing and manipulating RTMState rtm_state() const { return _rtm_state; } @@ -349,7 +351,7 @@ class nmethod : public CompiledMethod { return _state; } - void make_unloaded(oop cause); + void make_unloaded(); bool has_dependencies() { return dependencies_size() != 0; } void flush_dependencies(bool delete_immediately); @@ -483,20 +485,6 @@ public: public: #endif - protected: - virtual bool do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive); -#if INCLUDE_JVMCI - // See comment for _jvmci_installed_code_triggers_invalidation field. - // Returns whether this nmethod was unloaded. - virtual bool do_unloading_jvmci(); -#endif - - private: - bool do_unloading_scopes(BoolObjectClosure* is_alive); - // Unload a nmethod if the *root object is dead. - bool can_unload(BoolObjectClosure* is_alive, oop* root); - bool unload_if_dead_at(RelocIterator *iter_at_oop, BoolObjectClosure* is_alive); - public: void oops_do(OopClosure* f) { oops_do(f, false); } void oops_do(OopClosure* f, bool allow_zombie); @@ -555,7 +543,7 @@ public: // Logging void log_identity(xmlStream* log) const; void log_new_nmethod() const; - void log_state_change(oop cause = NULL) const; + void log_state_change() const; // Prints block-level comments, including nmethod specific block labels: virtual void print_block_comment(outputStream* stream, address block_begin) const { diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 4b10e3e2fd6..40ce3d1f230 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -62,6 +62,7 @@ #include "gc/g1/heapRegionSet.inline.hpp" #include "gc/g1/vm_operations_g1.hpp" #include "gc/shared/adaptiveSizePolicy.hpp" +#include "gc/shared/gcBehaviours.hpp" #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcId.hpp" #include "gc/shared/gcLocker.hpp" diff --git a/src/hotspot/share/gc/shared/gcBehaviours.cpp b/src/hotspot/share/gc/shared/gcBehaviours.cpp new file mode 100644 index 00000000000..4c82317a124 --- /dev/null +++ b/src/hotspot/share/gc/shared/gcBehaviours.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "code/compiledMethod.hpp" +#include "code/nmethod.hpp" +#include "gc/shared/gcBehaviours.hpp" + +IsUnloadingBehaviour* IsUnloadingBehaviour::_current = NULL; + +class IsCompiledMethodUnloadingOopClosure: public OopClosure { + BoolObjectClosure *_cl; + bool _is_unloading; + +public: + IsCompiledMethodUnloadingOopClosure(BoolObjectClosure* cl) + : _cl(cl), + _is_unloading(false) + { } + + virtual void do_oop(oop* p) { + if (_is_unloading) { + return; + } + oop obj = *p; + if (obj == NULL) { + return; + } + if (!_cl->do_object_b(obj)) { + _is_unloading = true; + } + } + + virtual void do_oop(narrowOop* p) { + ShouldNotReachHere(); + } + + bool is_unloading() const { + return _is_unloading; + } +}; + +bool ClosureIsUnloadingBehaviour::is_unloading(CompiledMethod* cm) const { + if (cm->is_nmethod()) { + IsCompiledMethodUnloadingOopClosure cl(_cl); + static_cast(cm)->oops_do(&cl); + return cl.is_unloading(); + } else { + return false; + } +} diff --git a/src/hotspot/share/gc/shared/gcBehaviours.hpp b/src/hotspot/share/gc/shared/gcBehaviours.hpp new file mode 100644 index 00000000000..82bc7f6ce0a --- /dev/null +++ b/src/hotspot/share/gc/shared/gcBehaviours.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_GC_SHARED_BEHAVIOURS_HPP +#define SHARE_GC_SHARED_BEHAVIOURS_HPP + +#include "memory/iterator.hpp" +#include "oops/oopsHierarchy.hpp" + +// This is the behaviour for checking if a CompiledMethod is unloading +// or has unloaded due to having phantomly dead oops in it after a GC. +class IsUnloadingBehaviour { + static IsUnloadingBehaviour* _current; + +public: + virtual bool is_unloading(CompiledMethod* cm) const = 0; + static IsUnloadingBehaviour* current() { return _current; } + static void set_current(IsUnloadingBehaviour* current) { _current = current; } +}; + +class ClosureIsUnloadingBehaviour: public IsUnloadingBehaviour { + BoolObjectClosure *const _cl; + +public: + ClosureIsUnloadingBehaviour(BoolObjectClosure* is_alive) + : _cl(is_alive) + { } + + virtual bool is_unloading(CompiledMethod* cm) const; +}; + +#endif // SHARE_GC_SHARED_BEHAVIOURS_HPP diff --git a/src/hotspot/share/gc/shared/parallelCleaning.cpp b/src/hotspot/share/gc/shared/parallelCleaning.cpp index c7a6bd2564c..2cd1c932dd2 100644 --- a/src/hotspot/share/gc/shared/parallelCleaning.cpp +++ b/src/hotspot/share/gc/shared/parallelCleaning.cpp @@ -27,6 +27,7 @@ #include "classfile/stringTable.hpp" #include "code/codeCache.hpp" #include "gc/shared/parallelCleaning.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "logging/log.hpp" @@ -67,14 +68,11 @@ void StringCleaningTask::work(uint worker_id) { } CodeCacheUnloadingTask::CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) : - _is_alive(is_alive), + _unloading_scope(is_alive), _unloading_occurred(unloading_occurred), _num_workers(num_workers), _first_nmethod(NULL), - _claimed_nmethod(NULL), - _postponed_list(NULL), - _num_entered_barrier(0) { - CompiledMethod::increase_unloading_clock(); + _claimed_nmethod(NULL) { // Get first alive nmethod CompiledMethodIterator iter = CompiledMethodIterator(); if(iter.next_alive()) { @@ -86,7 +84,6 @@ CodeCacheUnloadingTask::CodeCacheUnloadingTask(uint num_workers, BoolObjectClosu CodeCacheUnloadingTask::~CodeCacheUnloadingTask() { CodeCache::verify_clean_inline_caches(); - CodeCache::set_needs_cache_clean(false); guarantee(CodeCache::scavenge_root_nmethods() == NULL, "Must be"); CodeCache::verify_icholder_relocations(); @@ -94,31 +91,6 @@ CodeCacheUnloadingTask::~CodeCacheUnloadingTask() { Monitor* CodeCacheUnloadingTask::_lock = new Monitor(Mutex::leaf, "Code Cache Unload lock", false, Monitor::_safepoint_check_never); -void CodeCacheUnloadingTask::add_to_postponed_list(CompiledMethod* nm) { - CompiledMethod* old; - do { - old = _postponed_list; - nm->set_unloading_next(old); - } while (Atomic::cmpxchg(nm, &_postponed_list, old) != old); -} - -void CodeCacheUnloadingTask::clean_nmethod(CompiledMethod* nm) { - bool postponed = nm->do_unloading_parallel(_is_alive, _unloading_occurred); - - if (postponed) { - // This nmethod referred to an nmethod that has not been cleaned/unloaded yet. - add_to_postponed_list(nm); - } - - // Mark that this nmethod has been cleaned/unloaded. - // After this call, it will be safe to ask if this nmethod was unloaded or not. - nm->set_unloading_clock(CompiledMethod::global_unloading_clock()); -} - -void CodeCacheUnloadingTask::clean_nmethod_postponed(CompiledMethod* nm) { - nm->do_unloading_parallel_postponed(); -} - void CodeCacheUnloadingTask::claim_nmethods(CompiledMethod** claimed_nmethods, int *num_claimed_nmethods) { CompiledMethod* first; CompiledMethodIterator last; @@ -143,44 +115,10 @@ void CodeCacheUnloadingTask::claim_nmethods(CompiledMethod** claimed_nmethods, i } while (Atomic::cmpxchg(last.method(), &_claimed_nmethod, first) != first); } -CompiledMethod* CodeCacheUnloadingTask::claim_postponed_nmethod() { - CompiledMethod* claim; - CompiledMethod* next; - - do { - claim = _postponed_list; - if (claim == NULL) { - return NULL; - } - - next = claim->unloading_next(); - - } while (Atomic::cmpxchg(next, &_postponed_list, claim) != claim); - - return claim; -} - -void CodeCacheUnloadingTask::barrier_mark(uint worker_id) { - MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag); - _num_entered_barrier++; - if (_num_entered_barrier == _num_workers) { - ml.notify_all(); - } -} - -void CodeCacheUnloadingTask::barrier_wait(uint worker_id) { - if (_num_entered_barrier < _num_workers) { - MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag); - while (_num_entered_barrier < _num_workers) { - ml.wait(Mutex::_no_safepoint_check_flag, 0, false); - } - } -} - -void CodeCacheUnloadingTask::work_first_pass(uint worker_id) { +void CodeCacheUnloadingTask::work(uint worker_id) { // The first nmethods is claimed by the first worker. if (worker_id == 0 && _first_nmethod != NULL) { - clean_nmethod(_first_nmethod); + _first_nmethod->do_unloading(_unloading_occurred); _first_nmethod = NULL; } @@ -195,19 +133,11 @@ void CodeCacheUnloadingTask::work_first_pass(uint worker_id) { } for (int i = 0; i < num_claimed_nmethods; i++) { - clean_nmethod(claimed_nmethods[i]); + claimed_nmethods[i]->do_unloading(_unloading_occurred); } } } -void CodeCacheUnloadingTask::work_second_pass(uint worker_id) { - CompiledMethod* nm; - // Take care of postponed nmethods. - while ((nm = claim_postponed_nmethod()) != NULL) { - clean_nmethod_postponed(nm); - } -} - KlassCleaningTask::KlassCleaningTask() : _clean_klass_tree_claimed(0), _klass_iterator() { @@ -257,21 +187,11 @@ ParallelCleaningTask::ParallelCleaningTask(BoolObjectClosure* is_alive, // The parallel work done by all worker threads. void ParallelCleaningTask::work(uint worker_id) { - // Do first pass of code cache cleaning. - _code_cache_task.work_first_pass(worker_id); + // Do first pass of code cache cleaning. + _code_cache_task.work(worker_id); - // Let the threads mark that the first pass is done. - _code_cache_task.barrier_mark(worker_id); - - // Clean the Strings and Symbols. - _string_task.work(worker_id); - - // Wait for all workers to finish the first code cache cleaning pass. - _code_cache_task.barrier_wait(worker_id); - - // Do the second code cache cleaning work, which realize on - // the liveness information gathered during the first pass. - _code_cache_task.work_second_pass(worker_id); + // Clean the Strings and Symbols. + _string_task.work(worker_id); // Clean all klasses that were not unloaded. // The weak metadata in klass doesn't need to be diff --git a/src/hotspot/share/gc/shared/parallelCleaning.hpp b/src/hotspot/share/gc/shared/parallelCleaning.hpp index da32db862ca..4293e6e8248 100644 --- a/src/hotspot/share/gc/shared/parallelCleaning.hpp +++ b/src/hotspot/share/gc/shared/parallelCleaning.hpp @@ -56,46 +56,27 @@ public: }; class CodeCacheUnloadingTask { -private: static Monitor* _lock; - BoolObjectClosure* const _is_alive; - const bool _unloading_occurred; - const uint _num_workers; + CodeCache::UnloadingScope _unloading_scope; + const bool _unloading_occurred; + const uint _num_workers; // Variables used to claim nmethods. CompiledMethod* _first_nmethod; CompiledMethod* volatile _claimed_nmethod; - // The list of nmethods that need to be processed by the second pass. - CompiledMethod* volatile _postponed_list; - volatile uint _num_entered_barrier; - public: CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred); ~CodeCacheUnloadingTask(); private: - void add_to_postponed_list(CompiledMethod* nm); - void clean_nmethod(CompiledMethod* nm); - void clean_nmethod_postponed(CompiledMethod* nm); - static const int MaxClaimNmethods = 16; - void claim_nmethods(CompiledMethod** claimed_nmethods, int *num_claimed_nmethods); - CompiledMethod* claim_postponed_nmethod(); + public: - // Mark that we're done with the first pass of nmethod cleaning. - void barrier_mark(uint worker_id); - - // See if we have to wait for the other workers to - // finish their first-pass nmethod cleaning work. - void barrier_wait(uint worker_id); - - // Cleaning and unloading of nmethods. Some work has to be postponed - // to the second pass, when we know which nmethods survive. - void work_first_pass(uint worker_id); - void work_second_pass(uint worker_id); + // Cleaning and unloading of nmethods. + void work(uint worker_id); }; diff --git a/src/hotspot/share/runtime/sweeper.cpp b/src/hotspot/share/runtime/sweeper.cpp index f2523341af0..46a756cd0f3 100644 --- a/src/hotspot/share/runtime/sweeper.cpp +++ b/src/hotspot/share/runtime/sweeper.cpp @@ -702,7 +702,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil if (cm->is_alive()) { // Clean inline caches that point to zombie/non-entrant/unloaded nmethods CompiledICLocker ml(cm); - cm->cleanup_inline_caches(); + cm->cleanup_inline_caches(false); SWEEP(cm); } return result; @@ -748,7 +748,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil } else { // Still alive, clean up its inline caches CompiledICLocker ml(cm); - cm->cleanup_inline_caches(); + cm->cleanup_inline_caches(false); SWEEP(cm); } } else if (cm->is_unloaded()) { @@ -758,7 +758,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil // Clean ICs of unloaded nmethods as well because they may reference other // unloaded nmethods that may be flushed earlier in the sweeper cycle. CompiledICLocker ml(cm); - cm->cleanup_inline_caches(); + cm->cleanup_inline_caches(false); } if (cm->is_osr_method()) { SWEEP(cm); @@ -779,7 +779,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil } // Clean inline caches that point to zombie/non-entrant/unloaded nmethods CompiledICLocker ml(cm); - cm->cleanup_inline_caches(); + cm->cleanup_inline_caches(false); SWEEP(cm); } return result; From 6e5e462e2abb5c6e5a49c34206951cf241634a25 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Fri, 2 Nov 2018 14:13:05 +0100 Subject: [PATCH 028/128] 8213236: A partial removed/deleted JavaThread cannot transition Reviewed-by: dholmes, dcubed, eosterlund --- src/hotspot/share/runtime/thread.cpp | 2 +- src/hotspot/share/runtime/vmThread.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 42960cd0c7f..2583742a079 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -4286,7 +4286,7 @@ bool Threads::destroy_vm() { // queue until after the vm thread is dead. After this point, // we'll never emerge out of the safepoint before the VM exits. - MutexLocker ml(Heap_lock); + MutexLockerEx ml(Heap_lock, Mutex::_no_safepoint_check_flag); VMThread::wait_for_vm_thread_exit(); assert(SafepointSynchronize::is_at_safepoint(), "VM thread should exit at Safepoint"); diff --git a/src/hotspot/share/runtime/vmThread.cpp b/src/hotspot/share/runtime/vmThread.cpp index 7d509460da7..37f2e5809b6 100644 --- a/src/hotspot/share/runtime/vmThread.cpp +++ b/src/hotspot/share/runtime/vmThread.cpp @@ -319,7 +319,9 @@ void VMThread::run() { // Notify the VMThread that the last non-daemon JavaThread has terminated, // and wait until operation is performed. void VMThread::wait_for_vm_thread_exit() { - { MutexLocker mu(VMOperationQueue_lock); + assert(Thread::current()->is_Java_thread(), "Should be a JavaThread"); + assert(((JavaThread*)Thread::current())->is_terminated(), "Should be terminated"); + { MutexLockerEx mu(VMOperationQueue_lock, Mutex::_no_safepoint_check_flag); _should_terminate = true; VMOperationQueue_lock->notify(); } From 84d6099da9437f1167ea28ea1cf4d36aa9fab937 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Fri, 2 Nov 2018 16:11:29 +0000 Subject: [PATCH 029/128] 8213296: Fix legal headers in test/jdk/java/net Reviewed-by: alanb, dfuchs --- .../SetAuthenticator/HTTPSetAuthenticatorTest.java | 4 +--- .../java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java | 4 +--- .../HttpURLConnection/SetAuthenticator/HTTPTestClient.java | 4 +--- .../HttpURLConnection/SetAuthenticator/HTTPTestServer.java | 4 +--- .../java/net/Inet6Address/serialize/Inet6AddressSerTest.java | 4 +--- .../NetworkInterfaceEmptyGetInetAddressesTest.java | 4 +--- .../jdk/java/net/URLConnection/ContentHandlers/plain.template | 4 +--- test/jdk/java/net/httpclient/DigestEchoServer.java | 4 +--- test/jdk/java/net/httpclient/ProxyAuthTest.java | 4 +--- test/jdk/java/net/httpclient/http2/server/Queue.java | 4 +--- 10 files changed, 10 insertions(+), 30 deletions(-) diff --git a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java index c916b13db43..9de7f5b531f 100644 --- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java +++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java index 9a6cd93dd00..b6d4f46b589 100644 --- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java +++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestClient.java b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestClient.java index 3da0a7ae2d9..4d1f5c52a78 100644 --- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestClient.java +++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestClient.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java index 1e1a77e30c1..528dd11ffbc 100644 --- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java +++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java b/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java index e96ba935fc7..16df725bfa7 100644 --- a/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java +++ b/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java b/test/jdk/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java index 5eb3bdf51ab..2b0e4de1ac0 100644 --- a/test/jdk/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java +++ b/test/jdk/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/URLConnection/ContentHandlers/plain.template b/test/jdk/java/net/URLConnection/ContentHandlers/plain.template index 775b6d43dbc..0340dccb201 100644 --- a/test/jdk/java/net/URLConnection/ContentHandlers/plain.template +++ b/test/jdk/java/net/URLConnection/ContentHandlers/plain.template @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/httpclient/DigestEchoServer.java b/test/jdk/java/net/httpclient/DigestEchoServer.java index 95fefa887ec..21b90aa5065 100644 --- a/test/jdk/java/net/httpclient/DigestEchoServer.java +++ b/test/jdk/java/net/httpclient/DigestEchoServer.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/httpclient/ProxyAuthTest.java b/test/jdk/java/net/httpclient/ProxyAuthTest.java index fb16ba2e2c1..1b26166f329 100644 --- a/test/jdk/java/net/httpclient/ProxyAuthTest.java +++ b/test/jdk/java/net/httpclient/ProxyAuthTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/net/httpclient/http2/server/Queue.java b/test/jdk/java/net/httpclient/http2/server/Queue.java index b663643f08a..66b931b4b7c 100644 --- a/test/jdk/java/net/httpclient/http2/server/Queue.java +++ b/test/jdk/java/net/httpclient/http2/server/Queue.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From d17f8229f7d8e1cccdfca2e8c1c16bfae7d64e86 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 2 Nov 2018 12:49:42 -0400 Subject: [PATCH 030/128] 8213308: ProblemList runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java Reviewed-by: ccheung, darcy --- test/hotspot/jtreg/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 7f11e087980..aa14843195f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -83,6 +83,7 @@ gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all runtime/appcds/javaldr/GCSharedStringsDuringDump.java 8208778 macosx-x64 runtime/appcds/javaldr/GCDuringDump.java 8208778 macosx-x64 +runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 8213299 generic-all runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64 runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all From e21d8fef64ccc9db2c5693d5e011a8e7ddf3806b Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 2 Nov 2018 09:56:47 -0700 Subject: [PATCH 031/128] 8213305: Fix legal headers in test/java/math Reviewed-by: darcy --- test/jdk/java/math/BigInteger/PrimeTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jdk/java/math/BigInteger/PrimeTest.java b/test/jdk/java/math/BigInteger/PrimeTest.java index 74b777239ca..0024d791700 100644 --- a/test/jdk/java/math/BigInteger/PrimeTest.java +++ b/test/jdk/java/math/BigInteger/PrimeTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From 36ca4f5893a7f646205a558124fee2dd50a5abd5 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 2 Nov 2018 09:58:55 -0700 Subject: [PATCH 032/128] 8213306: Fix legal headers in test/java/nio Reviewed-by: chegar --- test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java b/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java index aa986c1d976..8e5bee51b71 100644 --- a/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java +++ b/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From f8c4729c1b026d446273cefbc7896d8749ba2d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 2 Nov 2018 18:35:30 +0100 Subject: [PATCH 033/128] 8210405: Javadoc search doesn't always consider full input upon Enter Reviewed-by: jjg --- .../javadoc/internal/doclets/formats/html/resources/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js index 06b2aa84318..522d4c49ec2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js @@ -149,7 +149,7 @@ $.widget("custom.catcomplete", $.ui.autocomplete, { $(function() { $("#search").catcomplete({ minLength: 1, - delay: 100, + delay: 300, source: function(request, response) { var result = new Array(); var presult = new Array(); From d6f958719db9dc0f5ab1f3884117356db18cbc19 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 2 Nov 2018 12:33:28 -0700 Subject: [PATCH 034/128] 8213321: Fix legal headers in test/jaxp Reviewed-by: darcy, jjg, lancea --- .../unittest/stream/XMLStreamWriterTest/SurrogatesTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java b/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java index e0dc44bf9bc..4af0c3df23a 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java +++ b/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From 49a3af9513b3a631b1d0f0668a554ed1efc7342b Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Fri, 2 Nov 2018 14:00:29 -0700 Subject: [PATCH 035/128] 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing Reviewed-by: kvn, erikj, ihse --- make/RunTests.gmk | 117 +++++++++++++++++- make/RunTestsPrebuilt.gmk | 38 +++++- make/RunTestsPrebuiltSpec.gmk | 4 + make/conf/jib-profiles.js | 17 +-- .../compiler/aot/scripts/java.base-list.txt | 17 +-- .../scripts/jdk.internal.vm.compiler-list.txt | 19 ++- 6 files changed, 170 insertions(+), 42 deletions(-) diff --git a/make/RunTests.gmk b/make/RunTests.gmk index 7b661be775f..c5237da2c13 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -45,7 +45,7 @@ ifneq ($(TEST_VM_OPTS), ) endif $(eval $(call ParseKeywordVariable, TEST_OPTS, \ - SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR, \ + SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR AOT_MODULES, \ STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \ )) @@ -107,6 +107,90 @@ endif GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher)) GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS))) +################################################################################ +# Optionally create AOT libraries for specified modules before running tests. +# Note, this could not be done during JDK build time. +################################################################################ + +# Note, this could not be done during JDK build time. + +# Parameter 1 is the name of the rule. +# +# Remaining parameters are named arguments. +# MODULE The module to generate a library for +# BIN Output directory in which to put the library +# VM_OPTIONS List of JVM arguments to use when creating library +# OPTIONS_VAR Name of variable to put AOT java options in +# PREREQS_VAR Name of variable to put all AOT prerequisite rule targets in +# for test rules to depend on +# +SetupAotModule = $(NamedParamsMacroTemplate) +define SetupAotModuleBody + $1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE)) + $1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt) + + ifeq ($(OPENJDK_TARGET_OS), windows) + $1_LD := $$(addsuffix $$(EXE_SUFFIX), $$(filter-out $$(FIXPATH), $$(LD))) + else + $1_LD := $$(LD) + endif + + $1_JAOTC_OPTS := \ + -J-Xmx4g --info \ + $$(addprefix -J, $$($1_VM_OPTIONS)) \ + $$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \ + --linker-path $$($1_LD) \ + # + + ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), ) + $1_JAOTC_OPTS += --compile-with-assertions + endif + + $$($1_AOT_LIB): $$(JDK_IMAGE_DIR)/release \ + $$(call DependOnVariable, $1_JAOTC_OPTS) \ + $$(call DependOnVariable, JDK_IMAGE_DIR) + $$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@)) + $$(call MakeTargetDir) + $$(call ExecuteWithLog, $$@, \ + $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \ + $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \ + ) + $$(call ExecuteWithLog, $$@.check, \ + $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \ + $$($1_VM_OPTIONS) -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary=$$@ -version \ + > $$@.verify-aot \ + ) + + $1_AOT_OPTIONS += -XX:AOTLibrary=$$($1_AOT_LIB) + $1_AOT_TARGETS += $$($1_AOT_LIB) +endef + +# Parameter 1 is the name of the rule. +# +# Remaining parameters are named arguments. +# MODULES The modules to generate a library for +# VM_OPTIONS List of JVM arguments to use when creating libraries +# +# After calling this, the following variables are defined +# $1_AOT_OPTIONS List of all java options needed to use the AOT libraries +# $1_AOT_TARGETS List of all targets that the test rule will need to depend on +# +SetupAot = $(NamedParamsMacroTemplate) +define SetupAotBody + $$(info Running with AOTd libraries for $$($1_MODULES)) + # Put aot libraries in a separate directory so they are not deleted between + # test runs and may be reused between make invocations. + $$(foreach m, $$($1_MODULES), \ + $$(eval $$(call SetupAotModule, $1_$$m, \ + MODULE := $$m, \ + BIN := $$(TEST_SUPPORT_DIR)/aot/$1, \ + VM_OPTIONS := $$($1_VM_OPTIONS), \ + )) \ + $$(eval $1_AOT_OPTIONS += $$($1_$$m_AOT_OPTIONS)) \ + $$(eval $1_AOT_TARGETS += $$($1_$$m_AOT_TARGETS)) \ + ) +endef + ################################################################################ # Setup global test running parameters ################################################################################ @@ -146,12 +230,15 @@ $(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG)) $(eval $(call SetTestOpt,VM_OPTIONS,GTEST)) $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST)) +$(eval $(call SetTestOpt,AOT_MODULES,JTREG)) +$(eval $(call SetTestOpt,AOT_MODULES,GTEST)) + $(eval $(call SetTestOpt,JOBS,JTREG)) $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG)) $(eval $(call ParseKeywordVariable, JTREG, \ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \ - EXTRA_PROBLEM_LISTS KEYWORDS, \ + EXTRA_PROBLEM_LISTS KEYWORDS AOT_MODULES, \ STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \ )) @@ -161,7 +248,7 @@ ifneq ($(JTREG), ) endif $(eval $(call ParseKeywordVariable, GTEST, \ - SINGLE_KEYWORDS := REPEAT, \ + SINGLE_KEYWORDS := REPEAT AOT_MODULES, \ STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \ )) @@ -407,7 +494,14 @@ define SetupRunGtestTestBody $1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT) endif - run-test-$1: $(TEST_PREREQS) + ifneq ($$(GTEST_AOT_MODULES), ) + $$(eval $$(call SetupAot, $1, \ + MODULES := $$(GTEST_AOT_MODULES), \ + VM_OPTIONS := $$(GTEST_VM_OPTIONS) $$(GTEST_JAVA_OPTIONS), \ + )) + endif + + run-test-$1: $$($1_AOT_TARGETS) $$(call LogWarn) $$(call LogWarn, Running test '$$($1_TEST)') $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) @@ -416,7 +510,7 @@ define SetupRunGtestTestBody -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \ --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \ $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \ - $$($1_GTEST_JAVA_OPTIONS) \ + $$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \ > >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \ && $$(ECHO) $$$$? > $$($1_EXITCODE) \ || $$(ECHO) $$$$? > $$($1_EXITCODE) \ @@ -600,10 +694,21 @@ define SetupRunJtregTestBody endif endif + ifneq ($$(JTREG_AOT_MODULES), ) + $$(eval $$(call SetupAot, $1, \ + MODULES := $$(JTREG_AOT_MODULES), \ + VM_OPTIONS := $$(JTREG_VM_OPTIONS) $$(JTREG_JAVA_OPTIONS), \ + )) + endif + + ifneq ($$($1_AOT_OPTIONS), ) + $1_JTREG_BASIC_OPTIONS += -vmoptions:"$$($1_AOT_OPTIONS)" + endif + clean-workdir-$1: $$(RM) -r $$($1_TEST_SUPPORT_DIR) - run-test-$1: clean-workdir-$1 $(TEST_PREREQS) + run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS) $$(call LogWarn) $$(call LogWarn, Running test '$$($1_TEST)') $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) diff --git a/make/RunTestsPrebuilt.gmk b/make/RunTestsPrebuilt.gmk index ff9e8be1dc7..689e85b858f 100644 --- a/make/RunTestsPrebuilt.gmk +++ b/make/RunTestsPrebuilt.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -95,12 +95,12 @@ endef # $1: The output file name # $2..$N: The lines to output to the file define CreateNewSpec - $(if $(strip $(26)), \ + $(if $(strip $(30)), \ $(error Internal makefile error: \ Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \ ) \ $(shell $(RM) $1) \ - $(foreach i, $(call sequence, 2, 25), \ + $(foreach i, $(call sequence, 2, 29), \ $(if $(strip $($i)), \ $(call AppendFile, $(strip $($i)), $1) \ ) \ @@ -235,6 +235,34 @@ ifeq ($(NUM_CORES), ) NUM_CORES := 1 endif +# Setup LD for AOT support +ifneq ($(DEVKIT_HOME), ) + ifeq ($(OPENJDK_TARGET_OS), windows) + LD := $(DEVKIT_HOME)/VC/bin/x64/link + LIBRARY_PREFIX := + SHARED_LIBRARY_SUFFIX := .dll + EXE_SUFFIX := .exe + else ifeq ($(OPENJDK_TARGET_OS), linux) + LD := $(DEVKIT_HOME)/bin/ld + LIBRARY_PREFIX := lib + SHARED_LIBRARY_SUFFIX := .so + EXE_SUFFIX := + else ifeq ($(OPENJDK_TARGET_OS), macosx) + LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + LIBRARY_PREFIX := lib + SHARED_LIBRARY_SUFFIX := .dylib + EXE_SUFFIX := + else ifeq ($(OPENJDK_TARGET_OS), solaris) + # Prefer system linker for AOT on Solaris. + LD := ld + LIBRARY_PREFIX := lib + SHARED_LIBRARY_SUFFIX := .so + EXE_SUFFIX := + endif +else + LD := ld +endif + ################################################################################ # Generate the ephemeral spec file ################################################################################ @@ -270,6 +298,10 @@ $(call CreateNewSpec, $(NEW_SPEC), \ OPENJDK_TARGET_CPU_BITS := $(OPENJDK_TARGET_CPU_BITS), \ OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \ NUM_CORES := $(NUM_CORES), \ + LD := $(LD), \ + LIBRARY_PREFIX := $(LIBRARY_PREFIX), \ + SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \ + EXE_SUFFIX := $(EXE_SUFFIX), \ include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \ $(CUSTOM_NEW_SPEC_LINE), \ ) diff --git a/make/RunTestsPrebuiltSpec.gmk b/make/RunTestsPrebuiltSpec.gmk index 8564a1f7ddd..6d07505b3b1 100644 --- a/make/RunTestsPrebuiltSpec.gmk +++ b/make/RunTestsPrebuiltSpec.gmk @@ -186,3 +186,7 @@ endif ifeq ($(OPENJDK_BUILD_OS), windows) CYGPATH := cygpath endif + +################################################################################ +# Simple macros from spec.gmk.in +SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 8d4f6eba4d8..3fc6a234860 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -709,7 +709,8 @@ var getJibProfilesProfiles = function (input, common, data) { "run-test-prebuilt": { target_os: input.build_os, target_cpu: input.build_cpu, - dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk", + dependencies: [ + "jtreg", "gnumake", "boot_jdk", "devkit", "jib", testedProfile + ".jdk", testedProfile + ".test" ], src: "src.conf", @@ -743,7 +744,6 @@ var getJibProfilesProfiles = function (input, common, data) { // This gives us a guaranteed working version of lldb for the jtreg failure handler. if (input.build_os == "macosx") { macosxRunTestExtra = { - dependencies: [ "devkit" ], environment_path: input.get("devkit", "install_path") + "/Xcode.app/Contents/Developer/usr/bin" }; @@ -836,7 +836,10 @@ var getJibProfilesDependencies = function (input, common) { organization: common.organization, ext: "tar.gz", module: "devkit-" + devkit_platform, - revision: devkit_platform_revisions[devkit_platform] + revision: devkit_platform_revisions[devkit_platform], + environment: { + "DEVKIT_HOME": input.get("devkit", "home_path"), + } }, build_devkit: { @@ -937,14 +940,6 @@ var getJibProfilesDependencies = function (input, common) { }, }; - // Need to add a value for the Visual Studio tools variable to make - // jaot be able to pick up the Visual Studio linker in testing. - if (input.target_os == "windows") { - dependencies.devkit.environment = { - VS120COMNTOOLS: input.get("devkit", "install_path") + "/Common7/Tools" - }; - } - return dependencies; }; diff --git a/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt b/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt index 5e9607fb8ec..94485e9b680 100644 --- a/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt +++ b/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -18,18 +18,3 @@ # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. - -# jaotc: java.lang.StackOverflowError -exclude sun.util.resources.LocaleNames.getContents()[[Ljava/lang/Object; -exclude sun.util.resources.TimeZoneNames.getContents()[[Ljava/lang/Object; -exclude sun.util.resources.cldr.LocaleNames.getContents()[[Ljava/lang/Object; -exclude sun.util.resources..*.LocaleNames_.*.getContents\(\)\[\[Ljava/lang/Object; -exclude sun.util.resources..*.LocaleNames_.*_.*.getContents\(\)\[\[Ljava/lang/Object; -exclude sun.util.resources..*.TimeZoneNames_.*.getContents\(\)\[\[Ljava/lang/Object; -exclude sun.util.resources..*.TimeZoneNames_.*_.*.getContents\(\)\[\[Ljava/lang/Object; -# java.lang.Error: Trampoline must not be defined by the bootstrap classloader -exclude sun.reflect.misc.Trampoline.()V -exclude sun.reflect.misc.Trampoline.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; -# assert(referenceMask != -1) failed: must not be a derived reference type -exclude com.sun.crypto.provider.AESWrapCipher.engineUnwrap([BLjava/lang/String;I)Ljava/security/Key; -exclude sun.security.ssl.* diff --git a/test/hotspot/jtreg/compiler/aot/scripts/jdk.internal.vm.compiler-list.txt b/test/hotspot/jtreg/compiler/aot/scripts/jdk.internal.vm.compiler-list.txt index 1ffcffde4df..d9ca1653cc7 100644 --- a/test/hotspot/jtreg/compiler/aot/scripts/jdk.internal.vm.compiler-list.txt +++ b/test/hotspot/jtreg/compiler/aot/scripts/jdk.internal.vm.compiler-list.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -19,20 +19,27 @@ # or visit www.oracle.com if you need additional information or have any # questions. +# exclude org.graalvm.compiler.hotspot.replacements.arraycopy.ArrayCopyCallNode.* exclude org.graalvm.compiler.hotspot.replacements.AESCryptSubstitutions.* exclude org.graalvm.compiler.hotspot.replacements.CipherBlockChainingSubstitutions.crypt(Ljava/lang/Object;[BII[BILjava/lang/Object;ZZ)V +exclude org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayAllocationSize(III)I +exclude org.graalvm.compiler.hotspot.replacements.PluginFactory_HotSpotReplacementsUtil\$config.execute(.*).* +exclude org.graalvm.compiler.hotspot.replacements.PluginFactory_HotSpotReplacementsUtil\$getWordKind.execute(.*).* +exclude org.graalvm.compiler.hotspot.replacements.PluginFactory_HotSpotReplacementsUtil\$getConfig.execute(.*). +# exclude org.graalvm.compiler.hotspot.stubs.StubUtil.printf(.*).* exclude org.graalvm.compiler.hotspot.stubs.StubUtil.decipher(J)V exclude org.graalvm.compiler.hotspot.stubs.StubUtil.fatal(.*).* # +exclude org.graalvm.compiler.nodes.java.NewArrayNode.newUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object; +exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object; +exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newUninitializedArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object; +exclude org.graalvm.compiler.nodes.PiNode.piCastNonNull(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; +# exclude org.graalvm.compiler.replacements.nodes.ArrayEqualsNode.equals(.*).* exclude org.graalvm.compiler.replacements.Log.print.* exclude org.graalvm.compiler.replacements.ReplacementsUtil.* exclude org.graalvm.compiler.replacements.SnippetCounter.* exclude org.graalvm.compiler.replacements.SnippetCounterNode.* -# -exclude org.graalvm.compiler.nodes.java.NewArrayNode.newUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object; -exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newUninitializedArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object; -exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object; -exclude org.graalvm.compiler.nodes.PiNode.piCastNonNull(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; +exclude org.graalvm.compiler.replacements.SnippetIntegerHistogram.inc(J)V From 5f7a59f69c4120353bb8be388b2865ca95382eca Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Fri, 2 Nov 2018 17:51:21 -0400 Subject: [PATCH 036/128] 6735527: Bitmap - speed up searches New parameterized bitmap search routine, using ctz. Reviewed-by: tschatzl, shade --- src/hotspot/share/utilities/bitMap.hpp | 11 + src/hotspot/share/utilities/bitMap.inline.hpp | 205 ++++++------------ 2 files changed, 80 insertions(+), 136 deletions(-) diff --git a/src/hotspot/share/utilities/bitMap.hpp b/src/hotspot/share/utilities/bitMap.hpp index 5be25e88a94..b80bf0ce03a 100644 --- a/src/hotspot/share/utilities/bitMap.hpp +++ b/src/hotspot/share/utilities/bitMap.hpp @@ -61,6 +61,17 @@ class BitMap { bm_word_t* _map; // First word in bitmap idx_t _size; // Size of bitmap (in bits) + // Helper for get_next_{zero,one}_bit variants. + // - flip designates whether searching for 1s or 0s. Must be one of + // find_{zeros,ones}_flip. + // - aligned_right is true if r_index is a priori on a bm_word_t boundary. + template + inline idx_t get_next_bit_impl(idx_t l_index, idx_t r_index) const; + + // Values for get_next_bit_impl flip parameter. + static const bm_word_t find_ones_flip = 0; + static const bm_word_t find_zeros_flip = ~(bm_word_t)0; + protected: // Return the position of bit within the word that contains it (e.g., if // bitmap words are 32 bits, return a number 0 <= n <= 31). diff --git a/src/hotspot/share/utilities/bitMap.inline.hpp b/src/hotspot/share/utilities/bitMap.inline.hpp index eb75cc3bdc8..21cfac6b7dc 100644 --- a/src/hotspot/share/utilities/bitMap.inline.hpp +++ b/src/hotspot/share/utilities/bitMap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "runtime/atomic.hpp" #include "utilities/bitMap.hpp" +#include "utilities/count_trailing_zeros.hpp" inline void BitMap::set_bit(idx_t bit) { verify_index(bit); @@ -141,152 +142,84 @@ inline void BitMap::par_clear_range(idx_t beg, idx_t end, RangeSizeHint hint) { } } +template +inline BitMap::idx_t BitMap::get_next_bit_impl(idx_t l_index, idx_t r_index) const { + STATIC_ASSERT(flip == find_ones_flip || flip == find_zeros_flip); + verify_range(l_index, r_index); + assert(!aligned_right || is_word_aligned(r_index), "r_index not aligned"); + + // The first word often contains an interesting bit, either due to + // density or because of features of the calling algorithm. So it's + // important to examine that first word with a minimum of fuss, + // minimizing setup time for later words that will be wasted if the + // first word is indeed interesting. + + // The benefit from aligned_right being true is relatively small. + // It saves a couple instructions in the setup for the word search + // loop. It also eliminates the range check on the final result. + // However, callers often have a comparison with r_index, and + // inlining often allows the two comparisons to be combined; it is + // important when !aligned_right that return paths either return + // r_index or a value dominated by a comparison with r_index. + // aligned_right is still helpful when the caller doesn't have a + // range check because features of the calling algorithm guarantee + // an interesting bit will be present. + + if (l_index < r_index) { + // Get the word containing l_index, and shift out low bits. + idx_t index = word_index(l_index); + bm_word_t cword = (map(index) ^ flip) >> bit_in_word(l_index); + if ((cword & 1) != 0) { + // The first bit is similarly often interesting. When it matters + // (density or features of the calling algorithm make it likely + // the first bit is set), going straight to the next clause compares + // poorly with doing this check first; count_trailing_zeros can be + // relatively expensive, plus there is the additional range check. + // But when the first bit isn't set, the cost of having tested for + // it is relatively small compared to the rest of the search. + return l_index; + } else if (cword != 0) { + // Flipped and shifted first word is non-zero. + idx_t result = l_index + count_trailing_zeros(cword); + if (aligned_right || (result < r_index)) return result; + // Result is beyond range bound; return r_index. + } else { + // Flipped and shifted first word is zero. Word search through + // aligned up r_index for a non-zero flipped word. + idx_t limit = aligned_right + ? word_index(r_index) + : (word_index(r_index - 1) + 1); // Align up, knowing r_index > 0. + while (++index < limit) { + cword = map(index) ^ flip; + if (cword != 0) { + idx_t result = bit_index(index) + count_trailing_zeros(cword); + if (aligned_right || (result < r_index)) return result; + // Result is beyond range bound; return r_index. + assert((index + 1) == limit, "invariant"); + break; + } + } + // No bits in range; return r_index. + } + } + return r_index; +} + inline BitMap::idx_t BitMap::get_next_one_offset(idx_t l_offset, idx_t r_offset) const { - assert(l_offset <= size(), "BitMap index out of bounds"); - assert(r_offset <= size(), "BitMap index out of bounds"); - assert(l_offset <= r_offset, "l_offset > r_offset ?"); - - if (l_offset == r_offset) { - return l_offset; - } - idx_t index = word_index(l_offset); - idx_t r_index = word_index(r_offset-1) + 1; - idx_t res_offset = l_offset; - - // check bits including and to the _left_ of offset's position - idx_t pos = bit_in_word(res_offset); - bm_word_t res = map(index) >> pos; - if (res != 0) { - // find the position of the 1-bit - for (; !(res & 1); res_offset++) { - res = res >> 1; - } - -#ifdef ASSERT - // In the following assert, if r_offset is not bitamp word aligned, - // checking that res_offset is strictly less than r_offset is too - // strong and will trip the assert. - // - // Consider the case where l_offset is bit 15 and r_offset is bit 17 - // of the same map word, and where bits [15:16:17:18] == [00:00:00:01]. - // All the bits in the range [l_offset:r_offset) are 0. - // The loop that calculates res_offset, above, would yield the offset - // of bit 18 because it's in the same map word as l_offset and there - // is a set bit in that map word above l_offset (i.e. res != NoBits). - // - // In this case, however, we can assert is that res_offset is strictly - // less than size() since we know that there is at least one set bit - // at an offset above, but in the same map word as, r_offset. - // Otherwise, if r_offset is word aligned then it will not be in the - // same map word as l_offset (unless it equals l_offset). So either - // there won't be a set bit between l_offset and the end of it's map - // word (i.e. res == NoBits), or res_offset will be less than r_offset. - - idx_t limit = is_word_aligned(r_offset) ? r_offset : size(); - assert(res_offset >= l_offset && res_offset < limit, "just checking"); -#endif // ASSERT - return MIN2(res_offset, r_offset); - } - // skip over all word length 0-bit runs - for (index++; index < r_index; index++) { - res = map(index); - if (res != 0) { - // found a 1, return the offset - for (res_offset = bit_index(index); !(res & 1); res_offset++) { - res = res >> 1; - } - assert(res & 1, "tautology; see loop condition"); - assert(res_offset >= l_offset, "just checking"); - return MIN2(res_offset, r_offset); - } - } - return r_offset; + return get_next_bit_impl(l_offset, r_offset); } inline BitMap::idx_t BitMap::get_next_zero_offset(idx_t l_offset, idx_t r_offset) const { - assert(l_offset <= size(), "BitMap index out of bounds"); - assert(r_offset <= size(), "BitMap index out of bounds"); - assert(l_offset <= r_offset, "l_offset > r_offset ?"); - - if (l_offset == r_offset) { - return l_offset; - } - idx_t index = word_index(l_offset); - idx_t r_index = word_index(r_offset-1) + 1; - idx_t res_offset = l_offset; - - // check bits including and to the _left_ of offset's position - idx_t pos = bit_in_word(res_offset); - bm_word_t res = ~map(index) >> pos; // flip bits and shift for l_offset - - if (res != 0) { - // find the position of the 1-bit - for (; !(res & 1); res_offset++) { - res = res >> 1; - } - assert(res_offset >= l_offset, "just checking"); - return MIN2(res_offset, r_offset); - } - // skip over all word length 1-bit runs - for (index++; index < r_index; index++) { - res = map(index); - if (res != ~(bm_word_t)0) { - // found a 0, return the offset - for (res_offset = index << LogBitsPerWord; res & 1; - res_offset++) { - res = res >> 1; - } - assert(!(res & 1), "tautology; see loop condition"); - assert(res_offset >= l_offset, "just checking"); - return MIN2(res_offset, r_offset); - } - } - return r_offset; + return get_next_bit_impl(l_offset, r_offset); } inline BitMap::idx_t -BitMap::get_next_one_offset_aligned_right(idx_t l_offset, idx_t r_offset) const -{ - verify_range(l_offset, r_offset); - assert(bit_in_word(r_offset) == 0, "r_offset not word-aligned"); - - if (l_offset == r_offset) { - return l_offset; - } - idx_t index = word_index(l_offset); - idx_t r_index = word_index(r_offset); - idx_t res_offset = l_offset; - - // check bits including and to the _left_ of offset's position - bm_word_t res = map(index) >> bit_in_word(res_offset); - if (res != 0) { - // find the position of the 1-bit - for (; !(res & 1); res_offset++) { - res = res >> 1; - } - assert(res_offset >= l_offset && - res_offset < r_offset, "just checking"); - return res_offset; - } - // skip over all word length 0-bit runs - for (index++; index < r_index; index++) { - res = map(index); - if (res != 0) { - // found a 1, return the offset - for (res_offset = bit_index(index); !(res & 1); res_offset++) { - res = res >> 1; - } - assert(res & 1, "tautology; see loop condition"); - assert(res_offset >= l_offset && res_offset < r_offset, "just checking"); - return res_offset; - } - } - return r_offset; +BitMap::get_next_one_offset_aligned_right(idx_t l_offset, idx_t r_offset) const { + return get_next_bit_impl(l_offset, r_offset); } - // Returns a bit mask for a range of bits [beg, end) within a single word. Each // bit in the mask is 0 if the bit is in the range, 1 if not in the range. The // returned mask can be used directly to clear the range, or inverted to set the From de6f5b33edb81d7b1b312d5894bb0e0e04eef5ce Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 2 Nov 2018 16:26:11 -0700 Subject: [PATCH 037/128] 8177708: Convert TestReserveMemorySpecial_test to Gtest Reviewed-by: gziemski, vlivanov --- .../share/utilities/internalVMTests.cpp | 1 - test/hotspot/gtest/runtime/test_os_linux.cpp | 243 ++++++++++++++++++ .../hotspot/gtest/runtime/test_os_windows.cpp | 87 +++++++ 3 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/gtest/runtime/test_os_linux.cpp create mode 100644 test/hotspot/gtest/runtime/test_os_windows.cpp diff --git a/src/hotspot/share/utilities/internalVMTests.cpp b/src/hotspot/share/utilities/internalVMTests.cpp index 854e94ada55..7b02f80ee7f 100644 --- a/src/hotspot/share/utilities/internalVMTests.cpp +++ b/src/hotspot/share/utilities/internalVMTests.cpp @@ -42,7 +42,6 @@ void InternalVMTests::run_test(const char* name, void (*test)()) { void InternalVMTests::run() { tty->print_cr("Running internal VM tests"); - run_unit_test(TestReserveMemorySpecial_test); tty->print_cr("All internal VM tests passed"); } diff --git a/test/hotspot/gtest/runtime/test_os_linux.cpp b/test/hotspot/gtest/runtime/test_os_linux.cpp new file mode 100644 index 00000000000..42f4c3201b6 --- /dev/null +++ b/test/hotspot/gtest/runtime/test_os_linux.cpp @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" + +#ifdef LINUX + +#include + +#include "runtime/os.hpp" +#include "unittest.hpp" + +namespace { + static void small_page_write(void* addr, size_t size) { + size_t page_size = os::vm_page_size(); + + char* end = (char*)addr + size; + for (char* p = (char*)addr; p < end; p += page_size) { + *p = 1; + } + } + + class HugeTlbfsMemory : private ::os::Linux { + char* const _ptr; + const size_t _size; + public: + static char* reserve_memory_special_huge_tlbfs_only(size_t bytes, char* req_addr, bool exec) { + return os::Linux::reserve_memory_special_huge_tlbfs_only(bytes, req_addr, exec); + } + static char* reserve_memory_special_huge_tlbfs_mixed(size_t bytes, size_t alignment, char* req_addr, bool exec) { + return os::Linux::reserve_memory_special_huge_tlbfs_mixed(bytes, alignment, req_addr, exec); + } + HugeTlbfsMemory(char* const ptr, size_t size) : _ptr(ptr), _size(size) { } + ~HugeTlbfsMemory() { + if (_ptr != NULL) { + os::Linux::release_memory_special_huge_tlbfs(_ptr, _size); + } + } + }; + + class ShmMemory : private ::os::Linux { + char* const _ptr; + const size_t _size; + public: + static char* reserve_memory_special_shm(size_t bytes, size_t alignment, char* req_addr, bool exec) { + return os::Linux::reserve_memory_special_shm(bytes, alignment, req_addr, exec); + } + ShmMemory(char* const ptr, size_t size) : _ptr(ptr), _size(size) { } + ~ShmMemory() { + os::Linux::release_memory_special_shm(_ptr, _size); + } + }; + + // have to use these functions, as gtest's _PRED macros don't like is_aligned + // nor (is_aligned) + static bool is_size_aligned(size_t size, size_t alignment) { + return is_aligned(size, alignment); + } + static bool is_ptr_aligned(char* ptr, size_t alignment) { + return is_aligned(ptr, alignment); + } + + static void test_reserve_memory_special_shm(size_t size, size_t alignment) { + ASSERT_TRUE(UseSHM) << "must be used only when UseSHM is true"; + char* addr = ShmMemory::reserve_memory_special_shm(size, alignment, NULL, false); + if (addr != NULL) { + ShmMemory mr(addr, size); + EXPECT_PRED2(is_ptr_aligned, addr, alignment); + EXPECT_PRED2(is_ptr_aligned, addr, os::large_page_size()); + + small_page_write(addr, size); + } + } +} + +TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_only) { + if (!UseHugeTLBFS) { + return; + } + size_t lp = os::large_page_size(); + + for (size_t size = lp; size <= lp * 10; size += lp) { + char* addr = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_only(size, NULL, false); + + if (addr != NULL) { + HugeTlbfsMemory mr(addr, size); + small_page_write(addr, size); + } + } +} + +TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_mixed_without_addr) { + if (!UseHugeTLBFS) { + return; + } + size_t lp = os::large_page_size(); + size_t ag = os::vm_allocation_granularity(); + + // sizes to test + const size_t sizes[] = { + lp, lp + ag, lp + lp / 2, lp * 2, + lp * 2 + ag, lp * 2 - ag, lp * 2 + lp / 2, + lp * 10, lp * 10 + lp / 2 + }; + const int num_sizes = sizeof(sizes) / sizeof(size_t); + for (int i = 0; i < num_sizes; i++) { + const size_t size = sizes[i]; + for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) { + char* p = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_mixed(size, alignment, NULL, false); + if (p != NULL) { + HugeTlbfsMemory mr(p, size); + EXPECT_PRED2(is_ptr_aligned, p, alignment) << " size = " << size; + small_page_write(p, size); + } + } + } +} + +TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_mixed_with_good_req_addr) { + if (!UseHugeTLBFS) { + return; + } + size_t lp = os::large_page_size(); + size_t ag = os::vm_allocation_granularity(); + + // sizes to test + const size_t sizes[] = { + lp, lp + ag, lp + lp / 2, lp * 2, + lp * 2 + ag, lp * 2 - ag, lp * 2 + lp / 2, + lp * 10, lp * 10 + lp / 2 + }; + const int num_sizes = sizeof(sizes) / sizeof(size_t); + + // Pre-allocate an area as large as the largest allocation + // and aligned to the largest alignment we will be testing. + const size_t mapping_size = sizes[num_sizes - 1] * 2; + char* const mapping = (char*) ::mmap(NULL, mapping_size, + PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, + -1, 0); + ASSERT_TRUE(mapping != NULL) << " mmap failed, mapping_size = " << mapping_size; + // Unmap the mapping, it will serve as a value for a "good" req_addr + ::munmap(mapping, mapping_size); + + for (int i = 0; i < num_sizes; i++) { + const size_t size = sizes[i]; + for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) { + char* const req_addr = align_up(mapping, alignment); + char* p = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false); + if (p != NULL) { + HugeTlbfsMemory mr(p, size); + ASSERT_EQ(req_addr, p) << " size = " << size << ", alignment = " << alignment; + small_page_write(p, size); + } + } + } +} + + +TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_mixed_with_bad_req_addr) { + if (!UseHugeTLBFS) { + return; + } + size_t lp = os::large_page_size(); + size_t ag = os::vm_allocation_granularity(); + + // sizes to test + const size_t sizes[] = { + lp, lp + ag, lp + lp / 2, lp * 2, + lp * 2 + ag, lp * 2 - ag, lp * 2 + lp / 2, + lp * 10, lp * 10 + lp / 2 + }; + const int num_sizes = sizeof(sizes) / sizeof(size_t); + + // Pre-allocate an area as large as the largest allocation + // and aligned to the largest alignment we will be testing. + const size_t mapping_size = sizes[num_sizes - 1] * 2; + char* const mapping = (char*) ::mmap(NULL, mapping_size, + PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, + -1, 0); + ASSERT_TRUE(mapping != NULL) << " mmap failed, mapping_size = " << mapping_size; + // Leave the mapping intact, it will server as "bad" req_addr + + class MappingHolder { + char* const _mapping; + size_t _size; + public: + MappingHolder(char* mapping, size_t size) : _mapping(mapping), _size(size) { } + ~MappingHolder() { + ::munmap(_mapping, _size); + } + } holder(mapping, mapping_size); + + for (int i = 0; i < num_sizes; i++) { + const size_t size = sizes[i]; + for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) { + char* const req_addr = align_up(mapping, alignment); + char* p = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false); + HugeTlbfsMemory mr(p, size); + // as the area around req_addr contains already existing mappings, the API should always + // return NULL (as per contract, it cannot return another address) + EXPECT_TRUE(p == NULL) << " size = " << size + << ", alignment = " << alignment + << ", req_addr = " << req_addr + << ", p = " << p; + } + } +} + +TEST_VM(os_linux, reserve_memory_special_shm) { + if (!UseSHM) { + return; + } + size_t lp = os::large_page_size(); + size_t ag = os::vm_allocation_granularity(); + + for (size_t size = ag; size < lp * 3; size += ag) { + for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) { + EXPECT_NO_FATAL_FAILURE(test_reserve_memory_special_shm(size, alignment)); + } + } +} + +#endif diff --git a/test/hotspot/gtest/runtime/test_os_windows.cpp b/test/hotspot/gtest/runtime/test_os_windows.cpp new file mode 100644 index 00000000000..4a3344275bf --- /dev/null +++ b/test/hotspot/gtest/runtime/test_os_windows.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" + +#ifdef _WINDOWS + +#include "runtime/os.hpp" +#include "runtime/flags/flagSetting.hpp" +#include "unittest.hpp" + +namespace { + class MemoryReleaser { + char* const _ptr; + const size_t _size; + public: + MemoryReleaser(char* ptr, size_t size) : _ptr(ptr), _size(size) { } + ~MemoryReleaser() { + os::release_memory_special(_ptr, _size); + } + }; +} + +// test tries to allocate memory in a single contiguous memory block at a particular address. +// The test first tries to find a good approximate address to allocate at by using the same +// method to allocate some memory at any address. The test then tries to allocate memory in +// the vicinity (not directly after it to avoid possible by-chance use of that location) +// This is of course only some dodgy assumption, there is no guarantee that the vicinity of +// the previously allocated memory is available for allocation. The only actual failure +// that is reported is when the test tries to allocate at a particular location but gets a +// different valid one. A NULL return value at this point is not considered an error but may +// be legitimate. +TEST_VM(os_windows, reserve_memory_special) { + if (!UseLargePages) { + return; + } + + // set globals to make sure we hit the correct code path + FLAG_GUARD(UseLargePagesIndividualAllocation); + FLAG_GUARD(UseNUMAInterleaving); + FLAG_SET_CMDLINE(bool, UseLargePagesIndividualAllocation, false); + FLAG_SET_CMDLINE(bool, UseNUMAInterleaving, false); + + const size_t large_allocation_size = os::large_page_size() * 4; + char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false); + if (result != NULL) { + // failed to allocate memory, skipping the test + return; + } + MemoryReleaser mr(result, large_allocation_size); + + // allocate another page within the recently allocated memory area which seems to be a good location. At least + // we managed to get it once. + const size_t expected_allocation_size = os::large_page_size(); + char* expected_location = result + os::large_page_size(); + char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false); + if (actual_location != NULL) { + // failed to allocate memory, skipping the test + return; + } + MemoryReleaser mr2(actual_location, expected_allocation_size); + + EXPECT_EQ(expected_location, actual_location) + << "Failed to allocate memory at requested location " << expected_location << " of size " << expected_allocation_size; +} + +#endif From 35871a8ca1ee462891bb851cac4bdc59b9197288 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 2 Nov 2018 16:27:55 -0700 Subject: [PATCH 038/128] 8213058: remove ExecuteInternalVMTests and VerboseInternalVMTests flags Reviewed-by: erikj, dholmes, ihse --- doc/testing.html | 3 +- doc/testing.md | 6 +-- make/RunTests.gmk | 8 +--- make/common/FindTests.gmk | 2 +- src/hotspot/os/linux/os_linux.cpp | 28 ----------- src/hotspot/os/windows/os_windows.cpp | 12 ----- src/hotspot/share/gc/shared/gc_globals.hpp | 6 --- src/hotspot/share/memory/virtualspace.cpp | 21 -------- src/hotspot/share/prims/jni.cpp | 4 -- .../share/utilities/internalVMTests.cpp | 48 ------------------- .../share/utilities/internalVMTests.hpp | 40 ---------------- test/hotspot/jtreg/Makefile | 3 -- test/hotspot/jtreg/TEST.groups | 1 - .../runtime/CommandLine/VMOptionWarning.java | 4 +- .../jtreg/sanity/ExecuteInternalVMTests.java | 39 --------------- 15 files changed, 7 insertions(+), 218 deletions(-) delete mode 100644 src/hotspot/share/utilities/internalVMTests.cpp delete mode 100644 src/hotspot/share/utilities/internalVMTests.hpp delete mode 100644 test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java diff --git a/doc/testing.html b/doc/testing.html index f66ef9b11e9..81d8972258f 100644 --- a/doc/testing.html +++ b/doc/testing.html @@ -62,9 +62,8 @@ $ make exploded-test TEST=tier2

If you want, you can single out an individual test or a group of tests, for instance gtest:LogDecorations or gtest:LogDecorations.level_test_vm. This can be particularly useful if you want to run a shaky test repeatedly.

For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding /<variant> to the test descriptor, e.g. gtest:Log/client. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then gtest:all will be equivalent to gtest:all/server.

Special tests

-

A handful of odd tests that are not covered by any other testing framework are accessible using the special: test descriptor. Currently, this includes hotspot-internal, failure-handler and make.

+

A handful of odd tests that are not covered by any other testing framework are accessible using the special: test descriptor. Currently, this includes failure-handler and make.

    -
  • Hotspot legacy internal testing (run using -XX:+ExecuteInternalVMTests) is run using special:hotspot-internal or just hotspot-internal as test descriptor, and will only work on a debug JVM.

  • Failure handler testing is run using special:failure-handler or just failure-handler as test descriptor.

  • Tests for the build system, including both makefiles and related functionality, is run using special:make or just make as test descriptor. This is equivalent to special:make:all.

    A specific make test can be run by supplying it as argument, e.g. special:make:idea. As a special syntax, this can also be expressed as make-idea, which allows for command lines as make test-make-idea.

  • diff --git a/doc/testing.md b/doc/testing.md index fc7752274a5..1b813c993ce 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -108,11 +108,7 @@ present, then `gtest:all` will be equivalent to `gtest:all/server`. A handful of odd tests that are not covered by any other testing framework are accessible using the `special:` test descriptor. Currently, this includes -`hotspot-internal`, `failure-handler` and `make`. - - * Hotspot legacy internal testing (run using `-XX:+ExecuteInternalVMTests`) - is run using `special:hotspot-internal` or just `hotspot-internal` as test - descriptor, and will only work on a debug JVM. +`failure-handler` and `make`. * Failure handler testing is run using `special:failure-handler` or just `failure-handler` as test descriptor. diff --git a/make/RunTests.gmk b/make/RunTests.gmk index c5237da2c13..bc6b283dd13 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -405,7 +405,7 @@ define ParseSpecialTestSelection special:make:all \ ) ) \ - $(if $(filter hotspot-internal failure-handler, $1), \ + $(if $(filter failure-handler, $1), \ special:$(strip $1) \ ) endef @@ -779,11 +779,7 @@ define SetupRunSpecialTestBody $1_TEST_ARGS := endif - ifeq ($$($1_TEST_NAME), hotspot-internal) - $1_TEST_COMMAND_LINE := \ - $$(JDK_IMAGE_DIR)/bin/java -XX:+ExecuteInternalVMTests \ - -XX:+ShowMessageBoxOnError -version - else ifeq ($$($1_TEST_NAME), failure-handler) + ifeq ($$($1_TEST_NAME), failure-handler) ifeq ($(BUILD_FAILURE_HANDLER), true) $1_TEST_COMMAND_LINE := \ ($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f \ diff --git a/make/common/FindTests.gmk b/make/common/FindTests.gmk index e84152579c9..7c27c82b0a6 100644 --- a/make/common/FindTests.gmk +++ b/make/common/FindTests.gmk @@ -79,7 +79,7 @@ MAKE_TEST_TARGETS := $(shell $(MAKE) -s --no-print-directory $(MAKE_ARGS) \ ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS)) # Add special tests -ALL_NAMED_TESTS += hotspot-internal failure-handler make +ALL_NAMED_TESTS += failure-handler make ################################################################################ diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index e5accf390c4..07cce9eeb20 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -5956,14 +5956,6 @@ int os::compare_file_modified_times(const char* file1, const char* file2) { #ifndef PRODUCT -#define test_log(...) \ - do { \ - if (VerboseInternalVMTests) { \ - tty->print_cr(__VA_ARGS__); \ - tty->flush(); \ - } \ - } while (false) - class TestReserveMemorySpecial : AllStatic { public: static void small_page_write(void* addr, size_t size) { @@ -5980,8 +5972,6 @@ class TestReserveMemorySpecial : AllStatic { return; } - test_log("test_reserve_memory_special_huge_tlbfs_only(" SIZE_FORMAT ")", size); - char* addr = os::Linux::reserve_memory_special_huge_tlbfs_only(size, NULL, false); if (addr != NULL) { @@ -6040,15 +6030,10 @@ class TestReserveMemorySpecial : AllStatic { ::munmap(mapping1, mapping_size); // Case 1 - test_log("%s, req_addr NULL:", __FUNCTION__); - test_log("size align result"); - for (int i = 0; i < num_sizes; i++) { const size_t size = sizes[i]; for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) { char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, NULL, false); - test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " -> " PTR_FORMAT " %s", - size, alignment, p2i(p), (p != NULL ? "" : "(failed)")); if (p != NULL) { assert(is_aligned(p, alignment), "must be"); small_page_write(p, size); @@ -6058,17 +6043,11 @@ class TestReserveMemorySpecial : AllStatic { } // Case 2 - test_log("%s, req_addr non-NULL:", __FUNCTION__); - test_log("size align req_addr result"); - for (int i = 0; i < num_sizes; i++) { const size_t size = sizes[i]; for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) { char* const req_addr = align_up(mapping1, alignment); char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false); - test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " -> " PTR_FORMAT " %s", - size, alignment, p2i(req_addr), p2i(p), - ((p != NULL ? (p == req_addr ? "(exact match)" : "") : "(failed)"))); if (p != NULL) { assert(p == req_addr, "must be"); small_page_write(p, size); @@ -6078,16 +6057,11 @@ class TestReserveMemorySpecial : AllStatic { } // Case 3 - test_log("%s, req_addr non-NULL with preexisting mapping:", __FUNCTION__); - test_log("size align req_addr result"); - for (int i = 0; i < num_sizes; i++) { const size_t size = sizes[i]; for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) { char* const req_addr = align_up(mapping2, alignment); char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false); - test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " -> " PTR_FORMAT " %s", - size, alignment, p2i(req_addr), p2i(p), ((p != NULL ? "" : "(failed)"))); // as the area around req_addr contains already existing mappings, the API should always // return NULL (as per contract, it cannot return another address) assert(p == NULL, "must be"); @@ -6112,8 +6086,6 @@ class TestReserveMemorySpecial : AllStatic { return; } - test_log("test_reserve_memory_special_shm(" SIZE_FORMAT ", " SIZE_FORMAT ")", size, alignment); - char* addr = os::Linux::reserve_memory_special_shm(size, alignment, NULL, false); if (addr != NULL) { diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 1ec26f92814..0b3b9d9aadc 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -5557,12 +5557,8 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name, // that is reported is when the test tries to allocate at a particular location but gets a // different valid one. A NULL return value at this point is not considered an error but may // be legitimate. -// If -XX:+VerboseInternalVMTests is enabled, print some explanatory messages. void TestReserveMemorySpecial_test() { if (!UseLargePages) { - if (VerboseInternalVMTests) { - tty->print("Skipping test because large pages are disabled"); - } return; } // save current value of globals @@ -5576,10 +5572,6 @@ void TestReserveMemorySpecial_test() { const size_t large_allocation_size = os::large_page_size() * 4; char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false); if (result == NULL) { - if (VerboseInternalVMTests) { - tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.", - large_allocation_size); - } } else { os::release_memory_special(result, large_allocation_size); @@ -5589,10 +5581,6 @@ void TestReserveMemorySpecial_test() { char* expected_location = result + os::large_page_size(); char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false); if (actual_location == NULL) { - if (VerboseInternalVMTests) { - tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.", - expected_location, large_allocation_size); - } } else { // release memory os::release_memory_special(actual_location, expected_allocation_size); diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp index 33ce1daddfa..03be725eb6c 100644 --- a/src/hotspot/share/gc/shared/gc_globals.hpp +++ b/src/hotspot/share/gc/shared/gc_globals.hpp @@ -372,12 +372,6 @@ develop(uintx, MetadataAllocationFailALotInterval, 1000, \ "Metadata allocation failure a lot interval") \ \ - notproduct(bool, ExecuteInternalVMTests, false, \ - "Enable execution of internal VM tests") \ - \ - notproduct(bool, VerboseInternalVMTests, false, \ - "Turn on logging for internal VM tests.") \ - \ product(bool, ExecutingUnitTests, false, \ "Whether the JVM is running unit tests or not") \ \ diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index d1921863b9a..80936695899 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -1059,14 +1059,6 @@ void VirtualSpace::print() { #ifndef PRODUCT -#define test_log(...) \ - do {\ - if (VerboseInternalVMTests) { \ - tty->print_cr(__VA_ARGS__); \ - tty->flush(); \ - }\ - } while (false) - class TestReservedSpace : AllStatic { public: static void small_page_write(void* addr, size_t size) { @@ -1087,8 +1079,6 @@ class TestReservedSpace : AllStatic { } static void test_reserved_space1(size_t size, size_t alignment) { - test_log("test_reserved_space1(%p)", (void*) (uintptr_t) size); - assert(is_aligned(size, alignment), "Incorrect input parameters"); ReservedSpace rs(size, // size @@ -1096,8 +1086,6 @@ class TestReservedSpace : AllStatic { UseLargePages, // large (char *)NULL); // requested_address - test_log(" rs.special() == %d", rs.special()); - assert(rs.base() != NULL, "Must be"); assert(rs.size() == size, "Must be"); @@ -1112,14 +1100,10 @@ class TestReservedSpace : AllStatic { } static void test_reserved_space2(size_t size) { - test_log("test_reserved_space2(%p)", (void*)(uintptr_t)size); - assert(is_aligned(size, os::vm_allocation_granularity()), "Must be at least AG aligned"); ReservedSpace rs(size); - test_log(" rs.special() == %d", rs.special()); - assert(rs.base() != NULL, "Must be"); assert(rs.size() == size, "Must be"); @@ -1131,9 +1115,6 @@ class TestReservedSpace : AllStatic { } static void test_reserved_space3(size_t size, size_t alignment, bool maybe_large) { - test_log("test_reserved_space3(%p, %p, %d)", - (void*)(uintptr_t)size, (void*)(uintptr_t)alignment, maybe_large); - if (size < alignment) { // Tests might set -XX:LargePageSizeInBytes= and cause unexpected input arguments for this test. assert((size_t)os::vm_page_size() == os::large_page_size(), "Test needs further refinement"); @@ -1147,8 +1128,6 @@ class TestReservedSpace : AllStatic { ReservedSpace rs(size, alignment, large, false); - test_log(" rs.special() == %d", rs.special()); - assert(rs.base() != NULL, "Must be"); assert(rs.size() == size, "Must be"); diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp index 7bd3cc710eb..970d3d4e21b 100644 --- a/src/hotspot/share/prims/jni.cpp +++ b/src/hotspot/share/prims/jni.cpp @@ -86,7 +86,6 @@ #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/histogram.hpp" -#include "utilities/internalVMTests.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" #if INCLUDE_JVMCI @@ -3977,9 +3976,6 @@ static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) { // Some platforms (like Win*) need a wrapper around these test // functions in order to properly handle error conditions. VMError::test_error_handler(); - if (ExecuteInternalVMTests) { - InternalVMTests::run(); - } #endif // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving. diff --git a/src/hotspot/share/utilities/internalVMTests.cpp b/src/hotspot/share/utilities/internalVMTests.cpp deleted file mode 100644 index 7b02f80ee7f..00000000000 --- a/src/hotspot/share/utilities/internalVMTests.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" - -#ifndef PRODUCT -#include - -#include "utilities/internalVMTests.hpp" -#include "utilities/macros.hpp" -#include "utilities/ostream.hpp" - -#define run_unit_test(unit_test_function_call) \ - void unit_test_function_call(); \ - run_test(#unit_test_function_call, unit_test_function_call); - -void InternalVMTests::run_test(const char* name, void (*test)()) { - tty->print_cr("Running test: %s", name); - test(); -} - -void InternalVMTests::run() { - tty->print_cr("Running internal VM tests"); - tty->print_cr("All internal VM tests passed"); -} - -#endif diff --git a/src/hotspot/share/utilities/internalVMTests.hpp b/src/hotspot/share/utilities/internalVMTests.hpp deleted file mode 100644 index f12a1685802..00000000000 --- a/src/hotspot/share/utilities/internalVMTests.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP -#define SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP - -#ifndef PRODUCT - -#include "memory/allocation.hpp" - -class InternalVMTests : public AllStatic { - static void run_test(const char* name, void (*test)()); - public: - static void run(); -}; - -#endif - -#endif // SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP diff --git a/test/hotspot/jtreg/Makefile b/test/hotspot/jtreg/Makefile index a512ddfb843..5628fc90da5 100644 --- a/test/hotspot/jtreg/Makefile +++ b/test/hotspot/jtreg/Makefile @@ -49,9 +49,6 @@ hotspot_%: $(ECHO) "Running tests: $@" $(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests; -hotspot_internal: - $(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version - ################################################################ # Set up the directory in which the jvm directories live (client/, server/, etc.) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 4510821f262..60cce5aa5f2 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -180,7 +180,6 @@ tier1_gc_1 = \ -gc/g1/ihop/TestIHOPErgo.java tier1_gc_2 = \ - sanity/ExecuteInternalVMTests.java \ gc/ \ -gc/epsilon/ \ -gc/g1/ \ diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java index 8cb2a422598..a9223d71473 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java @@ -53,8 +53,8 @@ public class VMOptionWarning { output = new OutputAnalyzer(pb.start()); output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM."); - pb = ProcessTools.createJavaProcessBuilder("-XX:+ExecuteInternalVMTests", "-version"); + pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version"); output = new OutputAnalyzer(pb.start()); - output.shouldContain("Error: VM option 'ExecuteInternalVMTests' is notproduct and is available only in debug version of VM."); + output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM."); } } diff --git a/test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java b/test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java deleted file mode 100644 index a672b9cdc4f..00000000000 --- a/test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* @test ExecuteInternalVMTests - * @bug 8004691 - * @summary Add a jtreg test that exercises the ExecuteInternalVMTests flag - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ExecuteInternalVMTests ExecuteInternalVMTests - */ -public class ExecuteInternalVMTests { - public static void main(String[] args) throws Exception { - // The tests that are run are the HotSpot internal tests which are - // executed only when the flag -XX:+ExecuteInternalVMTests is used. - - // The flag -XX:+ExecuteInternalVMTests can only be used for - // non-product builds of HotSpot. Therefore, the flag - // -XX:+IgnoreUnrecognizedVMOptions is also used, which means that this - // test will do nothing on a product build. - } -} From 4b813da8c8896aacb8263bafb4cee8152d3e75eb Mon Sep 17 00:00:00 2001 From: Jiangli Zhou Date: Fri, 2 Nov 2018 19:30:31 -0400 Subject: [PATCH 039/128] 8209564: runtime/appcds/CDSandJFR.java timeout on tier6 on sparc Set timeout 500 in CDSandJFR.java Reviewed-by: dcubed --- test/hotspot/jtreg/runtime/appcds/CDSandJFR.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java b/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java index ba870fbbaf8..53fec7ae3e4 100644 --- a/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java +++ b/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java @@ -30,7 +30,7 @@ * @modules jdk.jfr * @build Hello GetFlightRecorder * @run driver ClassFileInstaller -jar CDSandJFR.jar Hello GetFlightRecorder GetFlightRecorder$TestEvent GetFlightRecorder$SimpleEvent - * @run driver CDSandJFR + * @run driver/timeout=500 CDSandJFR */ import jdk.test.lib.BuildHelper; From 24d201cb540c56400a17b4fe0c265bf7324f2660 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 2 Nov 2018 18:49:10 -0700 Subject: [PATCH 040/128] 8213256: Clarify runtime vs compile time annotations for RoundEnvironment.getElementsAnnotatedWith(Class) Reviewed-by: jjg, jlahoda --- .../processing/RoundEnvironment.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java b/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java index 9f7fb7f6f6b..b8c53c2df1d 100644 --- a/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java +++ b/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java @@ -143,11 +143,26 @@ public interface RoundEnvironment { * simply because a {@code module-info} file for that module was * created. * + *

    Note: An implementation of this method typically performs + * an internal conversion from the runtime reflective + * representation of an annotation type as a {@code Class} object + * to a different representation used for annotation + * processing. The set of annotation types present in the runtime + * context may differ from the set of annotation types present in + * the context of annotation processing in a particular + * environmental configuration. If an runtime annotation type is + * not present in the annotation processing context, the situation + * is not treated as an error and no elements are found for that + * annotation type. + * * @param a annotation type being requested * @return the elements annotated with the given annotation type, * or an empty set if there are none * @throws IllegalArgumentException if the argument does not * represent an annotation type + * + * @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class) + * @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class) */ Set getElementsAnnotatedWith(Class a); @@ -155,6 +170,18 @@ public interface RoundEnvironment { * Returns the elements annotated with one or more of the given * annotation types. * + *

    Note: An implementation of this method typically performs + * an internal conversion from the runtime reflective + * representation of an annotation type as a {@code Class} object + * to a different representation used for annotation + * processing. The set of annotation types present in the runtime + * context may differ from the set of annotation types present in + * the context of annotation processing in a particular + * environmental configuration. If an runtime annotation type is + * not present in the annotation processing context, the situation + * is not treated as an error and no elements are found for that + * annotation type. + * * @apiNote This method may be useful when processing repeating * annotations by looking for an annotation type and its * containing annotation type at the same time. @@ -172,6 +199,10 @@ public interface RoundEnvironment { * @throws IllegalArgumentException if the any elements of the * argument set do not represent an annotation type * @jls 9.6.3 Repeatable Annotation Types + * + * @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class) + * @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class) + * * @since 9 */ default Set getElementsAnnotatedWithAny(Set> annotations){ From bf800514ff1bdb9e76e2206f05f0f83631d8d9c0 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 2 Nov 2018 23:44:45 -0700 Subject: [PATCH 041/128] 8213337: windows-x64-slowdebug build is broken by 8177708 Reviewed-by: dholmes --- test/hotspot/gtest/runtime/test_os_windows.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/gtest/runtime/test_os_windows.cpp b/test/hotspot/gtest/runtime/test_os_windows.cpp index 4a3344275bf..1c529a77610 100644 --- a/test/hotspot/gtest/runtime/test_os_windows.cpp +++ b/test/hotspot/gtest/runtime/test_os_windows.cpp @@ -27,6 +27,7 @@ #include "runtime/os.hpp" #include "runtime/flags/flagSetting.hpp" +#include "runtime/globals_extension.hpp" #include "unittest.hpp" namespace { From 51f2d9801b7da3ae7a9b65f32575a096b66d886b Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 29 Oct 2018 14:01:46 -0700 Subject: [PATCH 042/128] 8211336: [TESTBUG] appcds tests with incorrect usage of -XX:+UseStringDeduplication Reviewed-by: dholmes, ccheung, mseledtsov --- .../appcds/sharedStrings/ExerciseGC.java | 9 ++-- .../sharedStrings/IncompatibleOptions.java | 50 ++++++++++++++++--- .../IncompatibleOptions_noCompactStrings.java | 40 --------------- .../IncompatibleOptions_stringDedup.java | 40 --------------- .../sharedStrings/InternSharedString.java | 10 ++-- .../sharedStrings/InvalidFileFormat.java | 10 ++-- .../appcds/sharedStrings/LargePages.java | 11 ++-- .../sharedStrings/LockSharedStrings.java | 10 ++-- .../sharedStrings/SharedStringsBasic.java | 21 +++++--- .../sharedStrings/SharedStringsBasicPlus.java | 10 ++-- .../sharedStrings/SharedStringsStress.java | 14 ++++-- .../sharedStrings/SharedStringsUtils.java | 49 +++++++++++++++++- .../sharedStrings/SharedStringsWbTest.java | 10 ++-- .../appcds/sharedStrings/SysDictCrash.java | 17 ++++--- 14 files changed, 161 insertions(+), 140 deletions(-) delete mode 100644 test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java delete mode 100644 test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java index c4ac14a5e4b..f3508bcc394 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java @@ -27,17 +27,16 @@ * @summary Exercise GC with shared strings * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build HelloStringGC sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ExerciseGC - * @run main/othervm -XX:+UseStringDeduplication ExerciseGC - * @run main/othervm -XX:-CompactStrings ExerciseGC */ public class ExerciseGC { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, ExerciseGC::test); + } + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJarAndWhiteBox("HelloStringGC"); SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("HelloStringGC"), diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java index fa8473ccc5e..00acbe2ba45 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java @@ -22,6 +22,11 @@ * */ +// NOTE: the test takes a long time for each VM option combination, so we split +// it into 3 @test parts, so that they can be executed in parallel. If you make a +// change, please ensure all @test blocks are in sync. + + /* * @test * @summary Test options that are incompatible with use of shared strings @@ -36,9 +41,35 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission * @build HelloString - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions 0 */ + +/* + * @test + * @requires vm.cds.archived.java.heap + * @requires (vm.gc=="null") + * @library /test/lib /test/hotspot/jtreg/runtime/appcds + * @modules jdk.jartool/sun.tools.jar + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @build HelloString + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions 1 + */ + +/* + * @test + * @requires vm.cds.archived.java.heap + * @requires (vm.gc=="null") + * @library /test/lib /test/hotspot/jtreg/runtime/appcds + * @modules jdk.jartool/sun.tools.jar + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @build HelloString + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions 2 + */ + + import jdk.test.lib.Asserts; import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; @@ -59,10 +90,17 @@ public class IncompatibleOptions { "The shared archive file's CompactStrings setting .* does not equal the current CompactStrings setting"; static String appJar; - static String[] globalVmOptions; + static String[] vmOptionsPrefix = {}; public static void main(String[] args) throws Exception { - globalVmOptions = args; // specified by "@run main" in IncompatibleOptions_*.java + String[] noargs = {}; + SharedStringsUtils.run(Integer.parseInt(args[0]), 3, noargs, IncompatibleOptions::test); + // Add a new @test block if you get an assert ----^ about this number. See + // SharedStringsUtils.java for details. + } + + public static void test(String[] args_ignored) throws Exception { + vmOptionsPrefix = SharedStringsUtils.getChildVMOptionsPrefix(); appJar = JarBuilder.build("IncompatibleOptions", "HelloString"); // Uncompressed OOPs @@ -118,7 +156,7 @@ public class IncompatibleOptions { System.out.println("Testcase: " + testCaseNr); OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list("Hello"), - TestCommon.concat(globalVmOptions, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseCompressedOops", collectorOption, "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"), @@ -145,12 +183,12 @@ public class IncompatibleOptions { // main class param, and fails with "Could not find or load main class" if (!extraOption.isEmpty()) { output = TestCommon.exec(appJar, - TestCommon.concat(globalVmOptions, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseCompressedOops", collectorOption, "-Xlog:cds", extraOption, "HelloString")); } else { output = TestCommon.exec(appJar, - TestCommon.concat(globalVmOptions, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseCompressedOops", collectorOption, "-Xlog:cds", "HelloString")); } diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java deleted file mode 100644 index 67963957cfd..00000000000 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * @test - * @summary Test options that are incompatible with use of shared strings - * Also test mismatch in oops encoding between dump time and run time - * @requires vm.cds.archived.java.heap - * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set - * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed - * vm options. - * @requires (vm.gc=="null") - * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules jdk.jartool/sun.tools.jar - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission - * @build HelloString - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions -XX:-CompactStrings - */ diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java deleted file mode 100644 index 5ab3ff6433c..00000000000 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * @test - * @summary Test options that are incompatible with use of shared strings - * Also test mismatch in oops encoding between dump time and run time - * @requires vm.cds.archived.java.heap - * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set - * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed - * vm options. - * @requires (vm.gc=="null") - * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules jdk.jartool/sun.tools.jar - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission - * @build HelloString - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions -XX:+UseStringDeduplication - */ diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java index 43cb3f30184..d825013b13b 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java @@ -27,19 +27,19 @@ * @summary Test shared strings together with string intern operation * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @compile InternStringTest.java * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver InternSharedString - * @run main/othervm -XX:+UseStringDeduplication InternSharedString - * @run main/othervm -XX:-CompactStrings InternSharedString */ public class InternSharedString { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, InternSharedString::test); + } + + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJarAndWhiteBox("InternStringTest"); SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("InternStringTest"), diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java index 17e5050a036..659bae0cb00 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java @@ -27,13 +27,9 @@ * @summary Check most common errors in file format * @requires vm.cds.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build HelloString * @run driver InvalidFileFormat - * @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat - * @run main/othervm -XX:-CompactStrings InvalidFileFormat */ import java.io.File; @@ -46,6 +42,10 @@ import jdk.test.lib.process.OutputAnalyzer; // the previledge person in the server environment. public class InvalidFileFormat { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, InvalidFileFormat::test); + } + + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJar("HelloString"); test("NonExistentFile.txt", "Unable to get hashtable dump file size"); diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java index f862b18aac5..f4704be8879 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java @@ -27,17 +27,18 @@ * @summary Basic shared string test with large pages * @requires vm.cds.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build HelloString * @run driver LargePages - * @run main/othervm -XX:+UseStringDeduplication LargePages - * @run main/othervm -XX:-CompactStrings LargePages */ public class LargePages { static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables"; + public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, LargePages::test); + } + + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJar("HelloString"); SharedStringsUtils.dump(TestCommon.list("HelloString"), diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java index 5de2d0f3a81..12ea54e113e 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java @@ -27,19 +27,19 @@ * @summary Test locking on shared strings * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @compile LockStringTest.java LockStringValueTest.java * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver LockSharedStrings - * @run main/othervm -XX:+UseStringDeduplication LockSharedStrings - * @run main/othervm -XX:-CompactStrings LockSharedStrings */ public class LockSharedStrings { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, LockSharedStrings::test); + } + + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJarAndWhiteBox("LockStringTest", "LockStringValueTest"); SharedStringsUtils.dumpWithWhiteBox( diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java index 834e6180d52..a54765362c9 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java @@ -27,44 +27,49 @@ * @summary Basic test for shared strings * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build HelloString * @run driver SharedStringsBasic - * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasic - * @run main/othervm -XX:-CompactStrings SharedStringsBasic */ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -// This test does not use SharedStringsUtils intentionally: +// This test does not use SharedStringsUtils.dumpXXX() +// and SharedStringsUtils.runWithXXX() intentionally: // - in order to demonstrate the basic use of the functionality // - to provide sanity check and catch potential problems in the utils public class SharedStringsBasic { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, SharedStringsBasic::test); + } + + public static void test(String[] args) throws Exception { + String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix(); + String appJar = JarBuilder.build("SharedStringsBasic", "HelloString"); String sharedArchiveConfigFile = TestCommon.getSourceFile("SharedStringsBasic.txt").toString(); ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-cp", appJar, "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile, "-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-Xshare:dump", - "-Xlog:cds,cds+hashtables"); + "-Xlog:cds,cds+hashtables")); TestCommon.executeAndLog(dumpPb, "dump") .shouldContain("Shared string table stats") .shouldHaveExitValue(0); ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-cp", appJar, "-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-Xshare:auto", "-showversion", - "HelloString"); + "HelloString")); TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java index 88a2b2c5e56..979a4a47bef 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java @@ -27,18 +27,18 @@ * @summary Basic plus test for shared strings * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build HelloStringPlus sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver SharedStringsBasicPlus - * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasicPlus - * @run main/othervm -XX:-CompactStrings SharedStringsBasicPlus */ public class SharedStringsBasicPlus { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, SharedStringsBasicPlus::test); + } + + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJarAndWhiteBox("HelloStringPlus"); SharedStringsUtils.dumpWithWhiteBox( TestCommon.list("HelloStringPlus"), diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java index dd9e4167758..f22be7e679a 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java @@ -30,8 +30,6 @@ * @modules jdk.jartool/sun.tools.jar * @build HelloString * @run driver SharedStringsStress - * @run main/othervm -XX:+UseStringDeduplication SharedStringsStress - * @run main/othervm -XX:-CompactStrings SharedStringsStress */ import java.io.File; import java.io.FileOutputStream; @@ -42,6 +40,12 @@ import jdk.test.lib.process.ProcessTools; public class SharedStringsStress { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, SharedStringsStress::test); + } + + public static void test(String[] args) throws Exception { + String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix(); + String appJar = JarBuilder.build("SharedStringsStress", "HelloString"); String sharedArchiveConfigFile = System.getProperty("user.dir") + File.separator + "SharedStringsStress_gen.txt"; @@ -58,9 +62,11 @@ public class SharedStringsStress { } OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"), - "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile); + TestCommon.concat(vmOptionsPrefix, + "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile)); TestCommon.checkDump(dumpOutput); - OutputAnalyzer execOutput = TestCommon.exec(appJar, "HelloString"); + OutputAnalyzer execOutput = TestCommon.exec(appJar, + TestCommon.concat(vmOptionsPrefix, "HelloString")); TestCommon.checkExec(execOutput); } } diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java index 5121ae5924e..5d987cd743e 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ import jdk.test.lib.cds.CDSOptions; import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Asserts; // A helper/utility class for testing shared strings public class SharedStringsUtils { @@ -31,6 +32,49 @@ public class SharedStringsUtils { public static final String TEST_JAR_NAME_FULL = "test.jar"; public static final String WHITEBOX_JAR_NAME = "whitebox"; + public static interface Test { + public void dotest(String args[]) throws Exception ; + } + + private static String[][] vmOptionCombos = { + {}, + {"-XX:+UseStringDeduplication"}, + {"-XX:-CompactStrings"} + }; + + private static String childVMOptionsPrefix[] = {}; + + // SharedStringsUtils.run() is for running the main test body multiple times, each with a different + // set of extra VM options that are passed to the child processes. + // + // See ./ExerciseGC.java for an example. + public static void run(String args[], Test t) throws Exception { + int numSetOfChildVMOptions = vmOptionCombos.length; + for (int i=0; i< numSetOfChildVMOptions; i++) { + run(i, numSetOfChildVMOptions, args, t); + } + } + + public static void run(int i, int numSetOfChildVMOptions, String args[], Test t) throws Exception { + // When you add a new set of options to vmOptionCombos, we make sure all + // callers of this method (i.e., IncompatibleOptions.java) knows about it and will + // add new @test blocks accordingly. + Asserts.assertEQ(numSetOfChildVMOptions, vmOptionCombos.length); + String opts[] = vmOptionCombos[i]; + + System.out.print("Running with extra VM option prefix for child processes [" + opts.length + "] ="); + for (String o : opts) { + System.out.print(" " + o); + } + System.out.println(); + childVMOptionsPrefix = opts; + t.dotest(args); + } + + public static String[] getChildVMOptionsPrefix() { + return childVMOptionsPrefix; + } + public static String getWbParam() { return "-Xbootclasspath/a:" + TestCommon.getTestJar(WHITEBOX_JAR_NAME + ".jar"); } @@ -55,6 +99,7 @@ public class SharedStringsUtils { TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC", "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile(sharedDataFile)); + args = TestCommon.concat(childVMOptionsPrefix, args); return TestCommon.dump(appJar, appClasses, args); } @@ -80,6 +125,7 @@ public class SharedStringsUtils { String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = TestCommon.concat(extraOptions, "-cp", appJar, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className); + args = TestCommon.concat(childVMOptionsPrefix, args); OutputAnalyzer output = TestCommon.execAuto(args); checkExecAuto(output); @@ -98,6 +144,7 @@ public class SharedStringsUtils { String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className); + args = TestCommon.concat(childVMOptionsPrefix, args); OutputAnalyzer output = TestCommon.exec(appJar, args); checkExec(output, extraMatches); diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java index 305dda0e6f7..de4c811ad2a 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java @@ -27,14 +27,10 @@ * @summary White box test for shared strings * @requires vm.cds.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build sun.hotspot.WhiteBox SharedStringsWb * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver SharedStringsWbTest - * @run main/othervm -XX:+UseStringDeduplication SharedStringsWbTest - * @run main/othervm -XX:-CompactStrings SharedStringsWbTest */ import java.io.*; @@ -42,6 +38,10 @@ import sun.hotspot.WhiteBox; public class SharedStringsWbTest { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, SharedStringsWbTest::test); + } + + public static void test(String[] args) throws Exception { SharedStringsUtils.buildJarAndWhiteBox("SharedStringsWb"); SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("SharedStringsWb"), diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java index 3e726e1217b..c99086f3727 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java @@ -27,12 +27,9 @@ * @summary Regression test for JDK-8098821 * @bug 8098821 * @requires vm.cds.archived.java.heap + * @modules jdk.jartool/sun.tools.jar * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules java.base/jdk.internal.misc - * @modules java.management * @run driver SysDictCrash - * @run main/othervm -XX:+UseStringDeduplication SysDictCrash - * @run main/othervm -XX:-CompactStrings SysDictCrash */ import jdk.test.lib.process.OutputAnalyzer; @@ -40,22 +37,30 @@ import jdk.test.lib.process.ProcessTools; public class SysDictCrash { public static void main(String[] args) throws Exception { + SharedStringsUtils.run(args, SysDictCrash::test); + } + + public static void test(String[] args) throws Exception { + String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix(); + // SharedBaseAddress=0 puts the archive at a very high address on solaris, // which provokes the crash. ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-cp", ".", "-XX:SharedBaseAddress=0", "-XX:SharedArchiveFile=./SysDictCrash.jsa", "-Xshare:dump", - "-showversion", "-Xlog:cds,cds+hashtables"); + "-showversion", "-Xlog:cds,cds+hashtables")); TestCommon.checkDump(TestCommon.executeAndLog(dumpPb, "dump")); ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-XX:SharedArchiveFile=./SysDictCrash.jsa", "-Xshare:on", - "-version"); + "-version")); TestCommon.checkExec(TestCommon.executeAndLog(runPb, "exec")); } From e3a2417b6337d597787b0e1fd9e29e563312171a Mon Sep 17 00:00:00 2001 From: Jean Christophe Beyler Date: Sat, 3 Nov 2018 12:37:55 -0700 Subject: [PATCH 043/128] 8213246: Fix typo in vmTestbase failuire to failure Fix failuire typo in two spots Reviewed-by: mikael, dcubed, iignatyev --- test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp | 2 +- test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp index fce50a478b5..13a3db8b459 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp @@ -163,7 +163,7 @@ void nsk_lvcomplain(const char file[], int line, } else if (strlen(msg_buf2) != 0) { msg_buf2[strlen(msg_buf2)-1] = '\n'; // Make sure we have a newline char at the end. } - (void) nsk_printf("The following fake exception stacktrace is for failuire analysis. \n"); + (void) nsk_printf("The following fake exception stacktrace is for failure analysis. \n"); (void) nsk_printf("nsk.share.Fake_Exception_for_RULE_Creation: "); if (file != NULL) { (void) nsk_printf("(%s:%d) ", file_basename(file), line); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java index f9da23e3577..84c41014d32 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java @@ -34,7 +34,7 @@ * COMMENTS * Kestrel for Solaris_JDK_1.3-b10 crashes while trying to execute * this test with Client HS VM. - * See lots of bugs concerning similar failuires: + * See lots of bugs concerning similar failures: * Evaluated: * 4217960 [native stack overflow bug] reflection test causes crash * Accepted: From 80ad2c7e711fa8add4c636fc3ee2347bd94f8739 Mon Sep 17 00:00:00 2001 From: Jiangli Zhou Date: Sat, 3 Nov 2018 15:40:19 -0400 Subject: [PATCH 044/128] 8212995: Placing the Integer.IntegerCache and cached Integer objects in the closed archive heap region Support shareable archive object subgraphs in closed archive heap regions. Reviewed-by: iklam, ccheung --- src/hotspot/share/classfile/stringTable.cpp | 3 +- src/hotspot/share/classfile/stringTable.hpp | 3 - src/hotspot/share/memory/filemap.cpp | 107 ++++----- src/hotspot/share/memory/heapShared.cpp | 210 ++++++++++++------ src/hotspot/share/memory/heapShared.hpp | 74 +++++- src/hotspot/share/memory/metaspaceShared.cpp | 25 +-- src/hotspot/share/memory/metaspaceShared.hpp | 28 +-- src/hotspot/share/prims/whitebox.cpp | 2 +- .../share/classes/java/lang/Integer.java | 6 + 9 files changed, 284 insertions(+), 174 deletions(-) diff --git a/src/hotspot/share/classfile/stringTable.cpp b/src/hotspot/share/classfile/stringTable.cpp index ec95e572c98..2d9f0fe197c 100644 --- a/src/hotspot/share/classfile/stringTable.cpp +++ b/src/hotspot/share/classfile/stringTable.cpp @@ -78,7 +78,6 @@ static CompactHashtable< // -------------------------------------------------------------------------- StringTable* StringTable::_the_table = NULL; -volatile bool StringTable::_shared_string_mapped = false; volatile bool StringTable::_alt_hash = false; static juint murmur_seed = 0; @@ -871,7 +870,7 @@ void StringTable::serialize_shared_table_header(SerializeClosure* soc) { if (soc->writing()) { // Sanity. Make sure we don't use the shared table at dump time _shared_table.reset(); - } else if (!_shared_string_mapped) { + } else if (!HeapShared::closed_archive_heap_region_mapped()) { _shared_table.reset(); } } diff --git a/src/hotspot/share/classfile/stringTable.hpp b/src/hotspot/share/classfile/stringTable.hpp index ccd0c043512..815f96f4ccc 100644 --- a/src/hotspot/share/classfile/stringTable.hpp +++ b/src/hotspot/share/classfile/stringTable.hpp @@ -55,7 +55,6 @@ private: // The string table static StringTable* _the_table; - static volatile bool _shared_string_mapped; static volatile bool _alt_hash; private: @@ -166,8 +165,6 @@ private: static void copy_shared_string_table(CompactHashtableWriter* ch_table) NOT_CDS_JAVA_HEAP_RETURN; public: static oop create_archived_string(oop s, Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN_(NULL); - static void set_shared_string_mapped() { _shared_string_mapped = true; } - static bool shared_string_mapped() { return _shared_string_mapped; } static void shared_oops_do(OopClosure* f) NOT_CDS_JAVA_HEAP_RETURN; static void write_to_archive() NOT_CDS_JAVA_HEAP_RETURN; static void serialize_shared_table_header(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN; diff --git a/src/hotspot/share/memory/filemap.cpp b/src/hotspot/share/memory/filemap.cpp index 5f287f301cd..9b310fced42 100644 --- a/src/hotspot/share/memory/filemap.cpp +++ b/src/hotspot/share/memory/filemap.cpp @@ -26,7 +26,6 @@ #include "jvm.h" #include "classfile/classLoader.inline.hpp" #include "classfile/classLoaderExt.hpp" -#include "classfile/stringTable.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionaryShared.hpp" #include "classfile/altHashing.hpp" @@ -615,7 +614,7 @@ void FileMapInfo::write_region(int region, char* base, size_t size, } else { si->_file_offset = _file_offset; } - if (MetaspaceShared::is_heap_region(region)) { + if (HeapShared::is_heap_region(region)) { assert((base - (char*)Universe::narrow_oop_base()) % HeapWordSize == 0, "Sanity"); if (base != NULL) { si->_addr._offset = (intx)CompressedOops::encode_not_null((oop)base); @@ -814,7 +813,7 @@ static const char* shared_region_name[] = { "MiscData", "ReadWrite", "ReadOnly", "String1", "String2", "OpenArchive1", "OpenArchive2" }; char* FileMapInfo::map_region(int i, char** top_ret) { - assert(!MetaspaceShared::is_heap_region(i), "sanity"); + assert(!HeapShared::is_heap_region(i), "sanity"); CDSFileMapRegion* si = space_at(i); size_t used = si->_used; size_t alignment = os::vm_allocation_granularity(); @@ -857,14 +856,14 @@ address FileMapInfo::decode_start_address(CDSFileMapRegion* spc, bool with_curre } } -static MemRegion *string_ranges = NULL; +static MemRegion *closed_archive_heap_ranges = NULL; static MemRegion *open_archive_heap_ranges = NULL; -static int num_string_ranges = 0; +static int num_closed_archive_heap_ranges = 0; static int num_open_archive_heap_ranges = 0; #if INCLUDE_CDS_JAVA_HEAP bool FileMapInfo::has_heap_regions() { - return (_header->_space[MetaspaceShared::first_string]._used > 0); + return (_header->_space[MetaspaceShared::first_closed_archive_heap_region]._used > 0); } // Returns the address range of the archived heap regions computed using the @@ -875,7 +874,9 @@ MemRegion FileMapInfo::get_heap_regions_range_with_current_oop_encoding_mode() { address start = (address) max_uintx; address end = NULL; - for (int i = MetaspaceShared::first_string; i <= MetaspaceShared::last_valid_region; i++) { + for (int i = MetaspaceShared::first_closed_archive_heap_region; + i <= MetaspaceShared::last_valid_region; + i++) { CDSFileMapRegion* si = space_at(i); size_t size = si->_used; if (size > 0) { @@ -894,16 +895,16 @@ MemRegion FileMapInfo::get_heap_regions_range_with_current_oop_encoding_mode() { } // -// Map the shared string objects and open archive heap objects to the runtime -// java heap. +// Map the closed and open archive heap objects to the runtime java heap. // -// The shared strings are mapped close to the end of the java heap top in -// closed archive regions. The mapped strings contain no out-going references -// to any other java heap regions. GC does not write into the mapped shared strings. +// The shared objects are mapped at (or close to ) the java heap top in +// closed archive regions. The mapped objects contain no out-going +// references to any other java heap regions. GC does not write into the +// mapped closed archive heap region. // -// The open archive heap objects are mapped below the shared strings in -// the runtime java heap. The mapped open archive heap data only contain -// references to the shared strings and open archive objects initially. +// The open archive heap objects are mapped below the shared objects in +// the runtime java heap. The mapped open archive heap data only contains +// references to the shared objects and open archive objects initially. // During runtime execution, out-going references to any other java heap // regions may be added. GC may mark and update references in the mapped // open archive objects. @@ -983,29 +984,31 @@ void FileMapInfo::map_heap_regions_impl() { log_info(cds)("CDS heap data relocation delta = " INTX_FORMAT " bytes", delta); HeapShared::init_narrow_oop_decoding(narrow_oop_base() + delta, narrow_oop_shift()); - CDSFileMapRegion* si = space_at(MetaspaceShared::first_string); - address relocated_strings_bottom = start_address_as_decoded_from_archive(si); - if (!is_aligned(relocated_strings_bottom, HeapRegion::GrainBytes)) { - // Align the bottom of the string regions at G1 region boundary. This will avoid - // the situation where the highest open region and the lowest string region sharing - // the same G1 region. Otherwise we will fail to map the open regions. - size_t align = size_t(relocated_strings_bottom) % HeapRegion::GrainBytes; + CDSFileMapRegion* si = space_at(MetaspaceShared::first_closed_archive_heap_region); + address relocated_closed_heap_region_bottom = start_address_as_decoded_from_archive(si); + if (!is_aligned(relocated_closed_heap_region_bottom, HeapRegion::GrainBytes)) { + // Align the bottom of the closed archive heap regions at G1 region boundary. + // This will avoid the situation where the highest open region and the lowest + // closed region sharing the same G1 region. Otherwise we will fail to map the + // open regions. + size_t align = size_t(relocated_closed_heap_region_bottom) % HeapRegion::GrainBytes; delta -= align; log_info(cds)("CDS heap data need to be relocated lower by a further " SIZE_FORMAT - " bytes to " INTX_FORMAT " to be aligned with HeapRegion::GrainBytes", align, delta); + " bytes to " INTX_FORMAT " to be aligned with HeapRegion::GrainBytes", + align, delta); HeapShared::init_narrow_oop_decoding(narrow_oop_base() + delta, narrow_oop_shift()); _heap_pointers_need_patching = true; - relocated_strings_bottom = start_address_as_decoded_from_archive(si); + relocated_closed_heap_region_bottom = start_address_as_decoded_from_archive(si); } - assert(is_aligned(relocated_strings_bottom, HeapRegion::GrainBytes), "must be"); + assert(is_aligned(relocated_closed_heap_region_bottom, HeapRegion::GrainBytes), + "must be"); - // First, map string regions as closed archive heap regions. - // GC does not write into the regions. - if (map_heap_data(&string_ranges, - MetaspaceShared::first_string, - MetaspaceShared::max_strings, - &num_string_ranges)) { - StringTable::set_shared_string_mapped(); + // Map the closed_archive_heap regions, GC does not write into the regions. + if (map_heap_data(&closed_archive_heap_ranges, + MetaspaceShared::first_closed_archive_heap_region, + MetaspaceShared::max_closed_archive_heap_region, + &num_closed_archive_heap_ranges)) { + HeapShared::set_closed_archive_heap_region_mapped(); // Now, map open_archive heap regions, GC can write into the regions. if (map_heap_data(&open_archive_heap_ranges, @@ -1023,8 +1026,9 @@ void FileMapInfo::map_heap_regions() { map_heap_regions_impl(); } - if (!StringTable::shared_string_mapped()) { - assert(string_ranges == NULL && num_string_ranges == 0, "sanity"); + if (!HeapShared::closed_archive_heap_region_mapped()) { + assert(closed_archive_heap_ranges == NULL && + num_closed_archive_heap_ranges == 0, "sanity"); } if (!HeapShared::open_archive_heap_region_mapped()) { @@ -1115,9 +1119,9 @@ void FileMapInfo::patch_archived_heap_embedded_pointers() { return; } - patch_archived_heap_embedded_pointers(string_ranges, - num_string_ranges, - MetaspaceShared::first_string); + patch_archived_heap_embedded_pointers(closed_archive_heap_ranges, + num_closed_archive_heap_ranges, + MetaspaceShared::first_closed_archive_heap_region); patch_archived_heap_embedded_pointers(open_archive_heap_ranges, num_open_archive_heap_ranges, @@ -1136,11 +1140,13 @@ void FileMapInfo::patch_archived_heap_embedded_pointers(MemRegion* ranges, int n // This internally allocates objects using SystemDictionary::Object_klass(), so it // must be called after the well-known classes are resolved. void FileMapInfo::fixup_mapped_heap_regions() { - // If any string regions were found, call the fill routine to make them parseable. - // Note that string_ranges may be non-NULL even if no ranges were found. - if (num_string_ranges != 0) { - assert(string_ranges != NULL, "Null string_ranges array with non-zero count"); - G1CollectedHeap::heap()->fill_archive_regions(string_ranges, num_string_ranges); + // If any closed regions were found, call the fill routine to make them parseable. + // Note that closed_archive_heap_ranges may be non-NULL even if no ranges were found. + if (num_closed_archive_heap_ranges != 0) { + assert(closed_archive_heap_ranges != NULL, + "Null closed_archive_heap_ranges array with non-zero count"); + G1CollectedHeap::heap()->fill_archive_regions(closed_archive_heap_ranges, + num_closed_archive_heap_ranges); } // do the same for mapped open archive heap regions @@ -1170,9 +1176,9 @@ bool FileMapInfo::verify_region_checksum(int i) { if (sz == 0) { return true; // no data } - if ((MetaspaceShared::is_string_region(i) && - !StringTable::shared_string_mapped()) || - (MetaspaceShared::is_open_archive_heap_region(i) && + if ((HeapShared::is_closed_archive_heap_region(i) && + !HeapShared::closed_archive_heap_region_mapped()) || + (HeapShared::is_open_archive_heap_region(i) && !HeapShared::open_archive_heap_region_mapped())) { return true; // archived heap data is not mapped } @@ -1188,7 +1194,7 @@ bool FileMapInfo::verify_region_checksum(int i) { // Unmap a memory region in the address space. void FileMapInfo::unmap_region(int i) { - assert(!MetaspaceShared::is_heap_region(i), "sanity"); + assert(!HeapShared::is_heap_region(i), "sanity"); CDSFileMapRegion* si = space_at(i); size_t used = si->_used; size_t size = align_up(used, os::vm_allocation_granularity()); @@ -1259,7 +1265,7 @@ bool FileMapInfo::initialize() { char* FileMapInfo::region_addr(int idx) { CDSFileMapRegion* si = space_at(idx); - if (MetaspaceShared::is_heap_region(idx)) { + if (HeapShared::is_heap_region(idx)) { assert(DumpSharedSpaces, "The following doesn't work at runtime"); return si->_used > 0 ? (char*)start_address_as_decoded_with_current_oop_encoding_mode(si) : NULL; @@ -1326,7 +1332,7 @@ bool FileMapHeader::validate() { if (prop != NULL) { warning("Archived non-system classes are disabled because the " "java.system.class.loader property is specified (value = \"%s\"). " - "To use archived non-system classes, this property must be not be set", prop); + "To use archived non-system classes, this property must not be set", prop); _has_platform_or_app_classes = false; } @@ -1383,7 +1389,7 @@ void FileMapInfo::stop_sharing_and_unmap(const char* msg) { if (map_info) { map_info->fail_continue("%s", msg); for (int i = 0; i < MetaspaceShared::num_non_heap_spaces; i++) { - if (!MetaspaceShared::is_heap_region(i)) { + if (!HeapShared::is_heap_region(i)) { char *addr = map_info->region_addr(i); if (addr != NULL) { map_info->unmap_region(i); @@ -1395,7 +1401,8 @@ void FileMapInfo::stop_sharing_and_unmap(const char* msg) { // of the java heap. Unmapping of the heap regions are managed by GC. map_info->dealloc_archive_heap_regions(open_archive_heap_ranges, num_open_archive_heap_ranges); - map_info->dealloc_archive_heap_regions(string_ranges, num_string_ranges); + map_info->dealloc_archive_heap_regions(closed_archive_heap_ranges, + num_closed_archive_heap_ranges); } else if (DumpSharedSpaces) { fail_stop("%s", msg); } diff --git a/src/hotspot/share/memory/heapShared.cpp b/src/hotspot/share/memory/heapShared.cpp index 4c9d55ccf8a..5484fb2d213 100644 --- a/src/hotspot/share/memory/heapShared.cpp +++ b/src/hotspot/share/memory/heapShared.cpp @@ -37,6 +37,7 @@ #include "memory/metaspaceClosure.hpp" #include "memory/resourceArea.hpp" #include "oops/compressedOops.inline.hpp" +#include "oops/fieldStreams.hpp" #include "oops/oop.inline.hpp" #include "runtime/fieldDescriptor.inline.hpp" #include "runtime/safepointVerifiers.hpp" @@ -47,12 +48,40 @@ #if INCLUDE_CDS_JAVA_HEAP +bool HeapShared::_closed_archive_heap_region_mapped = false; bool HeapShared::_open_archive_heap_region_mapped = false; bool HeapShared::_archive_heap_region_fixed = false; address HeapShared::_narrow_oop_base; int HeapShared::_narrow_oop_shift; +// +// If you add new entries to the following tables, you should know what you're doing! +// + +// Entry fields for shareable subgraphs archived in the closed archive heap +// region. Warning: Objects in the subgraphs should not have reference fields +// assigned at runtime. +static ArchivableStaticFieldInfo closed_archive_subgraph_entry_fields[] = { + {"java/lang/Integer$IntegerCache", "archivedCache"}, +}; +// Entry fields for subgraphs archived in the open archive heap region. +static ArchivableStaticFieldInfo open_archive_subgraph_entry_fields[] = { + {"jdk/internal/module/ArchivedModuleGraph", "archivedSystemModules"}, + {"jdk/internal/module/ArchivedModuleGraph", "archivedModuleFinder"}, + {"jdk/internal/module/ArchivedModuleGraph", "archivedMainModule"}, + {"jdk/internal/module/ArchivedModuleGraph", "archivedConfiguration"}, + {"java/util/ImmutableCollections$ListN", "EMPTY_LIST"}, + {"java/util/ImmutableCollections$MapN", "EMPTY_MAP"}, + {"java/util/ImmutableCollections$SetN", "EMPTY_SET"}, + {"java/lang/module/Configuration", "EMPTY_CONFIGURATION"}, +}; + +const static int num_closed_archive_subgraph_entry_fields = + sizeof(closed_archive_subgraph_entry_fields) / sizeof(ArchivableStaticFieldInfo); +const static int num_open_archive_subgraph_entry_fields = + sizeof(open_archive_subgraph_entry_fields) / sizeof(ArchivableStaticFieldInfo); + //////////////////////////////////////////////////////////////// // // Java heap object archiving support @@ -189,6 +218,10 @@ void HeapShared::copy_closed_archive_heap_objects( // Archive interned string objects StringTable::write_to_archive(); + archive_object_subgraphs(closed_archive_subgraph_entry_fields, + num_closed_archive_subgraph_entry_fields, + true /* is_closed_archive */, THREAD); + G1CollectedHeap::heap()->end_archive_alloc_range(closed_archive, os::vm_allocation_granularity()); } @@ -204,7 +237,10 @@ void HeapShared::copy_open_archive_heap_objects( archive_klass_objects(THREAD); - archive_object_subgraphs(THREAD); + archive_object_subgraphs(open_archive_subgraph_entry_fields, + num_open_archive_subgraph_entry_fields, + false /* is_closed_archive */, + THREAD); G1CollectedHeap::heap()->end_archive_alloc_range(open_archive, os::vm_allocation_granularity()); @@ -237,7 +273,8 @@ KlassSubGraphInfo* HeapShared::get_subgraph_info(Klass* k) { } // Add an entry field to the current KlassSubGraphInfo. -void KlassSubGraphInfo::add_subgraph_entry_field(int static_field_offset, oop v) { +void KlassSubGraphInfo::add_subgraph_entry_field( + int static_field_offset, oop v, bool is_closed_archive) { assert(DumpSharedSpaces, "dump time only"); if (_subgraph_entry_fields == NULL) { _subgraph_entry_fields = @@ -245,6 +282,7 @@ void KlassSubGraphInfo::add_subgraph_entry_field(int static_field_offset, oop v) } _subgraph_entry_fields->append((juint)static_field_offset); _subgraph_entry_fields->append(CompressedOops::encode(v)); + _subgraph_entry_fields->append(is_closed_archive ? 1 : 0); } // Add the Klass* for an object in the current KlassSubGraphInfo's subgraphs. @@ -315,7 +353,7 @@ void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) { GrowableArray* entry_fields = info->subgraph_entry_fields(); if (entry_fields != NULL) { int num_entry_fields = entry_fields->length(); - assert(num_entry_fields % 2 == 0, "sanity"); + assert(num_entry_fields % 3 == 0, "sanity"); _entry_field_records = MetaspaceShared::new_ro_array(num_entry_fields); for (int i = 0 ; i < num_entry_fields; i++) { @@ -365,8 +403,8 @@ struct CopyKlassSubGraphInfoToArchive : StackObj { // Build the records of archived subgraph infos, which include: // - Entry points to all subgraphs from the containing class mirror. The entry // points are static fields in the mirror. For each entry point, the field -// offset and value are recorded in the sub-graph info. The value are stored -// back to the corresponding field at runtime. +// offset, value and is_closed_archive flag are recorded in the sub-graph +// info. The value is stored back to the corresponding field at runtime. // - A list of klasses that need to be loaded/initialized before archived // java object sub-graph can be accessed at runtime. void HeapShared::write_subgraph_info_table() { @@ -448,15 +486,25 @@ void HeapShared::initialize_from_archived_subgraph(Klass* k) { Array* entry_field_records = record->entry_field_records(); if (entry_field_records != NULL) { int efr_len = entry_field_records->length(); - assert(efr_len % 2 == 0, "sanity"); + assert(efr_len % 3 == 0, "sanity"); for (i = 0; i < efr_len;) { int field_offset = entry_field_records->at(i); - // The object refereced by the field becomes 'known' by GC from this - // point. All objects in the subgraph reachable from the object are - // also 'known' by GC. - oop v = materialize_archived_object(entry_field_records->at(i+1)); + narrowOop nv = entry_field_records->at(i+1); + int is_closed_archive = entry_field_records->at(i+2); + oop v; + if (is_closed_archive == 0) { + // It's an archived object in the open archive heap regions, not shared. + // The object refereced by the field becomes 'known' by GC from this + // point. All objects in the subgraph reachable from the object are + // also 'known' by GC. + v = materialize_archived_object(nv); + } else { + // Shared object in the closed archive heap regions. Decode directly. + assert(!CompressedOops::is_null(nv), "shared object is null"); + v = HeapShared::decode_from_archive(nv); + } m->obj_field_put(field_offset, v); - i += 2; + i += 3; log_debug(cds, heap)(" " PTR_FORMAT " init field @ %2d = " PTR_FORMAT, p2i(k), field_offset, p2i(v)); } @@ -469,16 +517,20 @@ void HeapShared::initialize_from_archived_subgraph(Klass* k) { class WalkOopAndArchiveClosure: public BasicOopIterateClosure { int _level; + bool _is_closed_archive; bool _record_klasses_only; KlassSubGraphInfo* _subgraph_info; oop _orig_referencing_obj; oop _archived_referencing_obj; Thread* _thread; public: - WalkOopAndArchiveClosure(int level, bool record_klasses_only, + WalkOopAndArchiveClosure(int level, + bool is_closed_archive, + bool record_klasses_only, KlassSubGraphInfo* subgraph_info, oop orig, oop archived, TRAPS) : - _level(level), _record_klasses_only(record_klasses_only), + _level(level), _is_closed_archive(is_closed_archive), + _record_klasses_only(record_klasses_only), _subgraph_info(subgraph_info), _orig_referencing_obj(orig), _archived_referencing_obj(archived), _thread(THREAD) {} @@ -506,7 +558,8 @@ class WalkOopAndArchiveClosure: public BasicOopIterateClosure { obj->print_on(&out); } - oop archived = HeapShared::archive_reachable_objects_from(_level + 1, _subgraph_info, obj, THREAD); + oop archived = HeapShared::archive_reachable_objects_from( + _level + 1, _subgraph_info, obj, _is_closed_archive, THREAD); assert(archived != NULL, "VM should have exited with unarchivable objects for _level > 1"); assert(HeapShared::is_archived_object(archived), "must be"); @@ -520,11 +573,32 @@ class WalkOopAndArchiveClosure: public BasicOopIterateClosure { } }; +void HeapShared::check_closed_archive_heap_region_object(InstanceKlass* k, + Thread* THREAD) { + // Check fields in the object + for (JavaFieldStream fs(k); !fs.done(); fs.next()) { + if (!fs.access_flags().is_static()) { + BasicType ft = fs.field_descriptor().field_type(); + if (!fs.access_flags().is_final() && (ft == T_ARRAY || T_OBJECT)) { + ResourceMark rm(THREAD); + log_warning(cds, heap)( + "Please check reference field in %s instance in closed archive heap region: %s %s", + k->external_name(), (fs.name())->as_C_string(), + (fs.signature())->as_C_string()); + } + } + } +} + // (1) If orig_obj has not been archived yet, archive it. // (2) If orig_obj has not been seen yet (since start_recording_subgraph() was called), // trace all objects that are reachable from it, and make sure these objects are archived. // (3) Record the klasses of all orig_obj and all reachable objects. -oop HeapShared::archive_reachable_objects_from(int level, KlassSubGraphInfo* subgraph_info, oop orig_obj, TRAPS) { +oop HeapShared::archive_reachable_objects_from(int level, + KlassSubGraphInfo* subgraph_info, + oop orig_obj, + bool is_closed_archive, + TRAPS) { assert(orig_obj != NULL, "must be"); assert(!is_archived_object(orig_obj), "sanity"); @@ -578,8 +652,12 @@ oop HeapShared::archive_reachable_objects_from(int level, KlassSubGraphInfo* sub Klass *relocated_k = archived_obj->klass(); subgraph_info->add_subgraph_object_klass(orig_k, relocated_k); - WalkOopAndArchiveClosure walker(level, record_klasses_only, subgraph_info, orig_obj, archived_obj, THREAD); + WalkOopAndArchiveClosure walker(level, is_closed_archive, record_klasses_only, + subgraph_info, orig_obj, archived_obj, THREAD); orig_obj->oop_iterate(&walker); + if (is_closed_archive && orig_k->is_instance_klass()) { + check_closed_archive_heap_region_object(InstanceKlass::cast(orig_k), THREAD); + } return archived_obj; } @@ -621,15 +699,12 @@ void HeapShared::archive_reachable_objects_from_static_field(InstanceKlass *k, const char* klass_name, int field_offset, const char* field_name, + bool is_closed_archive, TRAPS) { assert(DumpSharedSpaces, "dump time only"); assert(k->is_shared_boot_class(), "must be boot class"); oop m = k->java_mirror(); - oop archived_m = find_archived_heap_object(m); - if (CompressedOops::is_null(archived_m)) { - return; - } KlassSubGraphInfo* subgraph_info = get_subgraph_info(k); oop f = m->obj_field(field_offset); @@ -643,7 +718,8 @@ void HeapShared::archive_reachable_objects_from_static_field(InstanceKlass *k, f->print_on(&out); } - oop af = archive_reachable_objects_from(1, subgraph_info, f, CHECK); + oop af = archive_reachable_objects_from(1, subgraph_info, f, + is_closed_archive, CHECK); if (af == NULL) { log_error(cds, heap)("Archiving failed %s::%s (some reachable objects cannot be archived)", @@ -652,13 +728,13 @@ void HeapShared::archive_reachable_objects_from_static_field(InstanceKlass *k, // Note: the field value is not preserved in the archived mirror. // Record the field as a new subGraph entry point. The recorded // information is restored from the archive at runtime. - subgraph_info->add_subgraph_entry_field(field_offset, af); + subgraph_info->add_subgraph_entry_field(field_offset, af, is_closed_archive); log_info(cds, heap)("Archived field %s::%s => " PTR_FORMAT, klass_name, field_name, p2i(af)); } } else { // The field contains null, we still need to record the entry point, // so it can be restored at runtime. - subgraph_info->add_subgraph_entry_field(field_offset, NULL); + subgraph_info->add_subgraph_entry_field(field_offset, NULL, false); } } @@ -687,10 +763,6 @@ void HeapShared::verify_subgraph_from_static_field(InstanceKlass* k, int field_o assert(k->is_shared_boot_class(), "must be boot class"); oop m = k->java_mirror(); - oop archived_m = find_archived_heap_object(m); - if (CompressedOops::is_null(archived_m)) { - return; - } oop f = m->obj_field(field_offset); if (!CompressedOops::is_null(f)) { verify_subgraph_from(f); @@ -783,30 +855,6 @@ void HeapShared::done_recording_subgraph(InstanceKlass *k, const char* class_nam _num_total_recorded_klasses += num_new_recorded_klasses; } -struct ArchivableStaticFieldInfo { - const char* klass_name; - const char* field_name; - InstanceKlass* klass; - int offset; - BasicType type; -}; - -// If you add new entries to this table, you should know what you're doing! -static ArchivableStaticFieldInfo archivable_static_fields[] = { - {"jdk/internal/module/ArchivedModuleGraph", "archivedSystemModules"}, - {"jdk/internal/module/ArchivedModuleGraph", "archivedModuleFinder"}, - {"jdk/internal/module/ArchivedModuleGraph", "archivedMainModule"}, - {"jdk/internal/module/ArchivedModuleGraph", "archivedConfiguration"}, - {"java/util/ImmutableCollections$ListN", "EMPTY_LIST"}, - {"java/util/ImmutableCollections$MapN", "EMPTY_MAP"}, - {"java/util/ImmutableCollections$SetN", "EMPTY_SET"}, - {"java/lang/Integer$IntegerCache", "archivedCache"}, - {"java/lang/module/Configuration", "EMPTY_CONFIGURATION"}, -}; - -const static int num_archivable_static_fields = - sizeof(archivable_static_fields) / sizeof(ArchivableStaticFieldInfo); - class ArchivableStaticFieldFinder: public FieldClosure { InstanceKlass* _ik; Symbol* _field_name; @@ -828,11 +876,10 @@ public: int offset() { return _offset; } }; -void HeapShared::init_archivable_static_fields(Thread* THREAD) { - _dump_time_subgraph_info_table = new (ResourceObj::C_HEAP, mtClass)DumpTimeKlassSubGraphInfoTable(); - - for (int i = 0; i < num_archivable_static_fields; i++) { - ArchivableStaticFieldInfo* info = &archivable_static_fields[i]; +void HeapShared::init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[], + int num, Thread* THREAD) { + for (int i = 0; i < num; i++) { + ArchivableStaticFieldInfo* info = &fields[i]; TempNewSymbol klass_name = SymbolTable::new_symbol(info->klass_name, THREAD); TempNewSymbol field_name = SymbolTable::new_symbol(info->field_name, THREAD); @@ -849,7 +896,26 @@ void HeapShared::init_archivable_static_fields(Thread* THREAD) { } } -void HeapShared::archive_object_subgraphs(Thread* THREAD) { +void HeapShared::init_subgraph_entry_fields(Thread* THREAD) { + _dump_time_subgraph_info_table = new (ResourceObj::C_HEAP, mtClass)DumpTimeKlassSubGraphInfoTable(); + + init_subgraph_entry_fields(closed_archive_subgraph_entry_fields, + num_closed_archive_subgraph_entry_fields, + THREAD); + init_subgraph_entry_fields(open_archive_subgraph_entry_fields, + num_open_archive_subgraph_entry_fields, + THREAD); +} + +void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[], + int num, bool is_closed_archive, + Thread* THREAD) { + _num_total_subgraph_recordings = 0; + _num_total_walked_objs = 0; + _num_total_archived_objs = 0; + _num_total_recorded_klasses = 0; + _num_total_verifications = 0; + // For each class X that has one or more archived fields: // [1] Dump the subgraph of each archived field // [2] Create a list of all the class of the objects that can be reached @@ -857,38 +923,40 @@ void HeapShared::archive_object_subgraphs(Thread* THREAD) { // At runtime, these classes are initialized before X's archived fields // are restored by HeapShared::initialize_from_archived_subgraph(). int i; - for (i = 0; i < num_archivable_static_fields; ) { - ArchivableStaticFieldInfo* info = &archivable_static_fields[i]; + for (i = 0; i < num; ) { + ArchivableStaticFieldInfo* info = &fields[i]; const char* klass_name = info->klass_name; start_recording_subgraph(info->klass, klass_name); // If you have specified consecutive fields of the same klass in - // archivable_static_fields[], these will be archived in the same + // fields[], these will be archived in the same // {start_recording_subgraph ... done_recording_subgraph} pass to // save time. - for (; i < num_archivable_static_fields; i++) { - ArchivableStaticFieldInfo* f = &archivable_static_fields[i]; + for (; i < num; i++) { + ArchivableStaticFieldInfo* f = &fields[i]; if (f->klass_name != klass_name) { break; } archive_reachable_objects_from_static_field(f->klass, f->klass_name, - f->offset, f->field_name, CHECK); + f->offset, f->field_name, + is_closed_archive, CHECK); } done_recording_subgraph(info->klass, klass_name); } - log_info(cds, heap)("Performed subgraph records = %d times", _num_total_subgraph_recordings); - log_info(cds, heap)("Walked %d objects", _num_total_walked_objs); - log_info(cds, heap)("Archived %d objects", _num_total_archived_objs); - log_info(cds, heap)("Recorded %d klasses", _num_total_recorded_klasses); - + log_info(cds, heap)("Archived subgraph records in %s archive heap region = %d", + is_closed_archive ? "closed" : "open", + _num_total_subgraph_recordings); + log_info(cds, heap)(" Walked %d objects", _num_total_walked_objs); + log_info(cds, heap)(" Archived %d objects", _num_total_archived_objs); + log_info(cds, heap)(" Recorded %d klasses", _num_total_recorded_klasses); #ifndef PRODUCT - for (int i = 0; i < num_archivable_static_fields; i++) { - ArchivableStaticFieldInfo* f = &archivable_static_fields[i]; + for (int i = 0; i < num; i++) { + ArchivableStaticFieldInfo* f = &fields[i]; verify_subgraph_from_static_field(f->klass, f->offset); } - log_info(cds, heap)("Verified %d references", _num_total_verifications); + log_info(cds, heap)(" Verified %d references", _num_total_verifications); #endif } diff --git a/src/hotspot/share/memory/heapShared.hpp b/src/hotspot/share/memory/heapShared.hpp index 2e357949ba6..1ac740f7ff1 100644 --- a/src/hotspot/share/memory/heapShared.hpp +++ b/src/hotspot/share/memory/heapShared.hpp @@ -28,6 +28,7 @@ #include "classfile/compactHashtable.hpp" #include "classfile/systemDictionary.hpp" #include "memory/allocation.hpp" +#include "memory/metaspaceShared.hpp" #include "memory/universe.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.hpp" @@ -37,6 +38,14 @@ #include "utilities/resourceHash.hpp" #if INCLUDE_CDS_JAVA_HEAP +struct ArchivableStaticFieldInfo { + const char* klass_name; + const char* field_name; + InstanceKlass* klass; + int offset; + BasicType type; +}; + // A dump time sub-graph info for Klass _k. It includes the entry points // (static fields in _k's mirror) of the archived sub-graphs reachable // from _k's mirror. It also contains a list of Klasses of the objects @@ -50,7 +59,8 @@ class KlassSubGraphInfo: public CHeapObj { // object sub-graphs can be accessed at runtime. GrowableArray* _subgraph_object_klasses; // A list of _k's static fields as the entry points of archived sub-graphs. - // For each entry field, it is a pair of field_offset and field_value. + // For each entry field, it is a tuple of field_offset, field_value and + // is_closed_archive flag. GrowableArray* _subgraph_entry_fields; public: @@ -73,7 +83,8 @@ class KlassSubGraphInfo: public CHeapObj { GrowableArray* subgraph_entry_fields() { return _subgraph_entry_fields; } - void add_subgraph_entry_field(int static_field_offset, oop v); + void add_subgraph_entry_field(int static_field_offset, oop v, + bool is_closed_archive); void add_subgraph_object_klass(Klass *orig_k, Klass *relocated_k); int num_subgraph_object_klasses() { return _subgraph_object_klasses == NULL ? 0 : @@ -109,6 +120,7 @@ class HeapShared: AllStatic { private: #if INCLUDE_CDS_JAVA_HEAP + static bool _closed_archive_heap_region_mapped; static bool _open_archive_heap_region_mapped; static bool _archive_heap_region_fixed; @@ -160,21 +172,34 @@ class HeapShared: AllStatic { static DumpTimeKlassSubGraphInfoTable* _dump_time_subgraph_info_table; static RunTimeKlassSubGraphInfoTable _run_time_subgraph_info_table; + static void check_closed_archive_heap_region_object(InstanceKlass* k, + Thread* THREAD); + + static void archive_object_subgraphs(ArchivableStaticFieldInfo fields[], + int num, + bool is_closed_archive, + Thread* THREAD); + // Archive object sub-graph starting from the given static field // in Klass k's mirror. static void archive_reachable_objects_from_static_field( InstanceKlass* k, const char* klass_name, - int field_offset, const char* field_name, TRAPS); + int field_offset, const char* field_name, + bool is_closed_archive, TRAPS); + static void verify_subgraph_from_static_field( InstanceKlass* k, int field_offset) PRODUCT_RETURN; - static void verify_reachable_objects_from(oop obj, bool is_archived) PRODUCT_RETURN; + static void verify_subgraph_from(oop orig_obj) PRODUCT_RETURN; static KlassSubGraphInfo* get_subgraph_info(Klass *k); static int num_of_subgraph_infos(); static void build_archived_subgraph_info_records(int num_records); + static void init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[], + int num, Thread* THREAD); + // Used by decode_from_archive static address _narrow_oop_base; static int _narrow_oop_shift; @@ -245,6 +270,14 @@ class HeapShared: AllStatic { GrowableArray *open); static void copy_closed_archive_heap_objects(GrowableArray * closed_archive); static void copy_open_archive_heap_objects(GrowableArray * open_archive); + + static oop archive_reachable_objects_from(int level, + KlassSubGraphInfo* subgraph_info, + oop orig_obj, + bool is_closed_archive, + TRAPS); + + static ResourceBitMap calculate_oopmap(MemRegion region); #endif // INCLUDE_CDS_JAVA_HEAP public: @@ -253,6 +286,30 @@ class HeapShared: AllStatic { NOT_CDS_JAVA_HEAP(return false;) } + static bool is_heap_region(int idx) { + CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_closed_archive_heap_region && + idx <= MetaspaceShared::last_open_archive_heap_region)); + NOT_CDS_JAVA_HEAP_RETURN_(false); + } + static bool is_closed_archive_heap_region(int idx) { + CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_closed_archive_heap_region && + idx <= MetaspaceShared::last_closed_archive_heap_region)); + NOT_CDS_JAVA_HEAP_RETURN_(false); + } + static bool is_open_archive_heap_region(int idx) { + CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_open_archive_heap_region && + idx <= MetaspaceShared::last_open_archive_heap_region)); + NOT_CDS_JAVA_HEAP_RETURN_(false); + } + + static void set_closed_archive_heap_region_mapped() { + CDS_JAVA_HEAP_ONLY(_closed_archive_heap_region_mapped = true); + NOT_CDS_JAVA_HEAP_RETURN; + } + static bool closed_archive_heap_region_mapped() { + CDS_JAVA_HEAP_ONLY(return _closed_archive_heap_region_mapped); + NOT_CDS_JAVA_HEAP_RETURN_(false); + } static void set_open_archive_heap_region_mapped() { CDS_JAVA_HEAP_ONLY(_open_archive_heap_region_mapped = true); NOT_CDS_JAVA_HEAP_RETURN; @@ -283,15 +340,8 @@ class HeapShared: AllStatic { static void patch_archived_heap_embedded_pointers(MemRegion mem, address oopmap, size_t oopmap_in_bits) NOT_CDS_JAVA_HEAP_RETURN; - static void init_archivable_static_fields(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN; - static void archive_object_subgraphs(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN; + static void init_subgraph_entry_fields(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN; static void write_subgraph_info_table() NOT_CDS_JAVA_HEAP_RETURN; static void serialize_subgraph_info_table_header(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN; - -#if INCLUDE_CDS_JAVA_HEAP - static ResourceBitMap calculate_oopmap(MemRegion region); - static oop archive_reachable_objects_from(int level, KlassSubGraphInfo* subgraph_info, oop orig_obj, TRAPS); - static void verify_subgraph_from(oop orig_obj) PRODUCT_RETURN; -#endif }; #endif // SHARE_VM_MEMORY_HEAPSHARED_HPP diff --git a/src/hotspot/share/memory/metaspaceShared.cpp b/src/hotspot/share/memory/metaspaceShared.cpp index 52dc24e573e..b025f1f2e28 100644 --- a/src/hotspot/share/memory/metaspaceShared.cpp +++ b/src/hotspot/share/memory/metaspaceShared.cpp @@ -86,8 +86,8 @@ size_t MetaspaceShared::_core_spaces_size = 0; // md - misc data (the c++ vtables) // od - optional data (original class files) // -// s0 - shared strings(closed archive heap space) #0 -// s1 - shared strings(closed archive heap space) #1 (may be empty) +// ca0 - closed archive heap space #0 +// ca1 - closed archive heap space #1 (may be empty) // oa0 - open archive heap space #0 // oa1 - open archive heap space #1 (may be empty) // @@ -198,7 +198,7 @@ public: DumpRegion _mc_region("mc"), _ro_region("ro"), _rw_region("rw"), _md_region("md"), _od_region("od"); -size_t _total_string_region_size = 0, _total_open_archive_region_size = 0; +size_t _total_closed_archive_region_size = 0, _total_open_archive_region_size = 0; char* MetaspaceShared::misc_code_space_alloc(size_t num_bytes) { return _mc_region.allocate(num_bytes); @@ -1274,9 +1274,8 @@ public: // NOTE: after this point, we shouldn't have any globals that can reach the old // objects. - // We cannot use any of the objects in the heap anymore (except for the objects - // in the CDS shared string regions) because their headers no longer point to - // valid Klasses. + // We cannot use any of the objects in the heap anymore (except for the + // shared strings) because their headers no longer point to valid Klasses. } static void iterate_roots(MetaspaceClosure* it) { @@ -1491,11 +1490,11 @@ void VM_PopulateDumpSharedSpace::doit() { write_region(mapinfo, MetaspaceShared::md, &_md_region, /*read_only=*/false,/*allow_exec=*/false); write_region(mapinfo, MetaspaceShared::od, &_od_region, /*read_only=*/true, /*allow_exec=*/false); - _total_string_region_size = mapinfo->write_archive_heap_regions( + _total_closed_archive_region_size = mapinfo->write_archive_heap_regions( _closed_archive_heap_regions, _closed_archive_heap_oopmaps, - MetaspaceShared::first_string, - MetaspaceShared::max_strings); + MetaspaceShared::first_closed_archive_heap_region, + MetaspaceShared::max_closed_archive_heap_region); _total_open_archive_region_size = mapinfo->write_archive_heap_regions( _open_archive_heap_regions, _open_archive_heap_oopmaps, @@ -1529,12 +1528,12 @@ void VM_PopulateDumpSharedSpace::print_region_stats() { const size_t total_reserved = _ro_region.reserved() + _rw_region.reserved() + _mc_region.reserved() + _md_region.reserved() + _od_region.reserved() + - _total_string_region_size + + _total_closed_archive_region_size + _total_open_archive_region_size; const size_t total_bytes = _ro_region.used() + _rw_region.used() + _mc_region.used() + _md_region.used() + _od_region.used() + - _total_string_region_size + + _total_closed_archive_region_size + _total_open_archive_region_size; const double total_u_perc = percent_of(total_bytes, total_reserved); @@ -1543,7 +1542,7 @@ void VM_PopulateDumpSharedSpace::print_region_stats() { _ro_region.print(total_reserved); _md_region.print(total_reserved); _od_region.print(total_reserved); - print_heap_region_stats(_closed_archive_heap_regions, "st", total_reserved); + print_heap_region_stats(_closed_archive_heap_regions, "ca", total_reserved); print_heap_region_stats(_open_archive_heap_regions, "oa", total_reserved); tty->print_cr("total : " SIZE_FORMAT_W(9) " [100.0%% of total] out of " SIZE_FORMAT_W(9) " bytes [%5.1f%% used]", @@ -1715,7 +1714,7 @@ void MetaspaceShared::preload_and_dump(TRAPS) { tty->print_cr("Rewriting and linking classes: done"); SystemDictionary::clear_invoke_method_table(); - HeapShared::init_archivable_static_fields(THREAD); + HeapShared::init_subgraph_entry_fields(THREAD); VM_PopulateDumpSharedSpace op; VMThread::execute(&op); diff --git a/src/hotspot/share/memory/metaspaceShared.hpp b/src/hotspot/share/memory/metaspaceShared.hpp index f461833adc3..331ea94d7b0 100644 --- a/src/hotspot/share/memory/metaspaceShared.hpp +++ b/src/hotspot/share/memory/metaspaceShared.hpp @@ -76,13 +76,14 @@ class MetaspaceShared : AllStatic { num_non_heap_spaces = od + 1, // mapped java heap regions - first_string = od + 1, // index of first string region - max_strings = 2, // max number of string regions in string space - last_string = first_string + max_strings - 1, - first_open_archive_heap_region = first_string + max_strings, + first_closed_archive_heap_region = od + 1, + max_closed_archive_heap_region = 2, + last_closed_archive_heap_region = first_closed_archive_heap_region + max_closed_archive_heap_region - 1, + first_open_archive_heap_region = last_closed_archive_heap_region + 1, max_open_archive_heap_region = 2, + last_open_archive_heap_region = first_open_archive_heap_region + max_open_archive_heap_region - 1, - last_valid_region = first_open_archive_heap_region + max_open_archive_heap_region - 1, + last_valid_region = last_open_archive_heap_region, n_regions = last_valid_region + 1 // total number of regions }; @@ -131,23 +132,6 @@ class MetaspaceShared : AllStatic { // Return true if given address is in the shared region corresponding to the idx static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false); - static bool is_heap_region(int idx) { - CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_string && - idx < MetaspaceShared::first_open_archive_heap_region + - MetaspaceShared::max_open_archive_heap_region)); - NOT_CDS_JAVA_HEAP_RETURN_(false); - } - static bool is_string_region(int idx) { - CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_string && - idx < MetaspaceShared::first_string + MetaspaceShared::max_strings)); - NOT_CDS_JAVA_HEAP_RETURN_(false); - } - static bool is_open_archive_heap_region(int idx) { - CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_open_archive_heap_region && - idx < MetaspaceShared::first_open_archive_heap_region + - MetaspaceShared::max_open_archive_heap_region)); - NOT_CDS_JAVA_HEAP_RETURN_(false); - } static bool is_in_trampoline_frame(address addr) NOT_CDS_RETURN_(false); static void allocate_cpp_vtable_clones(); diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index fea2bc89fc1..34fde46a061 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -1774,7 +1774,7 @@ WB_ENTRY(jboolean, WB_IsSharedClass(JNIEnv* env, jobject wb, jclass clazz)) WB_END WB_ENTRY(jboolean, WB_AreSharedStringsIgnored(JNIEnv* env)) - return !StringTable::shared_string_mapped(); + return !HeapShared::closed_archive_heap_region_mapped(); WB_END WB_ENTRY(jobject, WB_GetResolvedReferences(JNIEnv* env, jobject wb, jclass clazz)) diff --git a/src/java.base/share/classes/java/lang/Integer.java b/src/java.base/share/classes/java/lang/Integer.java index 7b174ac18d0..70e46759791 100644 --- a/src/java.base/share/classes/java/lang/Integer.java +++ b/src/java.base/share/classes/java/lang/Integer.java @@ -992,6 +992,12 @@ public final class Integer extends Number implements Comparable { * During VM initialization, java.lang.Integer.IntegerCache.high property * may be set and saved in the private system properties in the * jdk.internal.misc.VM class. + * + * WARNING: The cache is archived with CDS and reloaded from the shared + * archive at runtime. The archived cache (Integer[]) and Integer objects + * reside in the closed archive heap regions. Care should be taken when + * changing the implementation and the cache array should not be assigned + * with new Integer object(s) after initialization. */ private static class IntegerCache { From 87f243d5390b32e16ebf8445fc99b536f864893d Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Sun, 4 Nov 2018 13:06:02 -0500 Subject: [PATCH 045/128] 8213328: Update test copyrights in test/java/util/zip and test/jdk/tools Reviewed-by: joehw --- test/jdk/java/util/zip/zip.java | 6 ++---- test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java | 6 ++---- test/jdk/tools/jmod/src/apa/module-info.java | 6 ++---- test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java | 6 ++---- .../tools/jmod/src/foo/jdk/test/foo/internal/Message.java | 6 ++---- test/jdk/tools/jmod/src/foo/module-info.java | 6 ++---- .../javax/annotation/processing/Generated.java | 4 +--- .../pack200/pack200-verifier/src/xmlkit/ClassReader.java | 4 +--- .../pack200-verifier/src/xmlkit/CommandLineParser.java | 6 ++---- .../pack200/pack200-verifier/src/xmlkit/TokenList.java | 6 ++---- .../tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java | 6 ++---- 11 files changed, 20 insertions(+), 42 deletions(-) diff --git a/test/jdk/java/util/zip/zip.java b/test/jdk/java/util/zip/zip.java index 878e976d7ea..41c49783c8e 100644 --- a/test/jdk/java/util/zip/zip.java +++ b/test/jdk/java/util/zip/zip.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java b/test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java index 7bc7def8d95..a9cf6195a7f 100644 --- a/test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java +++ b/test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/jmod/src/apa/module-info.java b/test/jdk/tools/jmod/src/apa/module-info.java index ca03826e233..73779f5c4c5 100644 --- a/test/jdk/tools/jmod/src/apa/module-info.java +++ b/test/jdk/tools/jmod/src/apa/module-info.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java b/test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java index 2c56159bab7..f2dfd4909fd 100644 --- a/test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java +++ b/test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/jmod/src/foo/jdk/test/foo/internal/Message.java b/test/jdk/tools/jmod/src/foo/jdk/test/foo/internal/Message.java index 298a4fce0cb..f910a24a4ab 100644 --- a/test/jdk/tools/jmod/src/foo/jdk/test/foo/internal/Message.java +++ b/test/jdk/tools/jmod/src/foo/jdk/test/foo/internal/Message.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/jmod/src/foo/module-info.java b/test/jdk/tools/jmod/src/foo/module-info.java index b46afa0b822..4cbe6c6240a 100644 --- a/test/jdk/tools/jmod/src/foo/module-info.java +++ b/test/jdk/tools/jmod/src/foo/module-info.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java index 2fbd20caaf5..7cf519e38a1 100644 --- a/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java +++ b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java index 3f8d4831f57..e288e9b4eec 100644 --- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java +++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/CommandLineParser.java b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/CommandLineParser.java index 852b4b3f4a3..160f4e5d514 100644 --- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/CommandLineParser.java +++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/CommandLineParser.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/TokenList.java b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/TokenList.java index 5d4934d7f6d..bd7e5ee104f 100644 --- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/TokenList.java +++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/TokenList.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java index 7609386b4d2..a453bb45a92 100644 --- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java +++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From fdb010502b52a492258164e4792f00ff20c05807 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 5 Nov 2018 10:31:47 +0100 Subject: [PATCH 046/128] 8213103: RoundEnvironment.getElementsAnnotatedWith(Class) crashes with -source 8 Correct handling of missing annotation with -source 8. Reviewed-by: darcy, jjg, vromero --- .../processing/JavacRoundEnvironment.java | 10 +- .../GetElementsAnnotatedWithOnMissing.java | 112 ++++++++++++++++++ 2 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 test/langtools/tools/javac/processing/rounds/GetElementsAnnotatedWithOnMissing.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java index cf9c4e3cee5..c0ba595c532 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java @@ -31,6 +31,7 @@ import javax.lang.model.element.*; import javax.lang.model.util.*; import java.util.*; +import com.sun.tools.javac.code.Source.Feature; import com.sun.tools.javac.util.DefinedBy; import com.sun.tools.javac.util.DefinedBy.Api; @@ -53,17 +54,20 @@ public class JavacRoundEnvironment implements RoundEnvironment { private final ProcessingEnvironment processingEnv; private final Elements eltUtils; + private final boolean allowModules; + // Caller must pass in an immutable set private final Set rootElements; JavacRoundEnvironment(boolean processingOver, boolean errorRaised, Set rootElements, - ProcessingEnvironment processingEnv) { + JavacProcessingEnvironment processingEnv) { this.processingOver = processingOver; this.errorRaised = errorRaised; this.rootElements = rootElements; this.processingEnv = processingEnv; + this.allowModules = Feature.MODULES.allowedInSource(processingEnv.source); this.eltUtils = processingEnv.getElementUtils(); } @@ -287,9 +291,11 @@ public class JavacRoundEnvironment implements RoundEnvironment { TypeElement annotationElement = eltUtils.getTypeElement(name); if (annotationElement != null) return annotationElement; - else { + else if (allowModules) { String moduleName = Objects.requireNonNullElse(annotation.getModule().getName(), ""); return eltUtils.getTypeElement(eltUtils.getModuleElement(moduleName), name); + } else { + return null; } } diff --git a/test/langtools/tools/javac/processing/rounds/GetElementsAnnotatedWithOnMissing.java b/test/langtools/tools/javac/processing/rounds/GetElementsAnnotatedWithOnMissing.java new file mode 100644 index 00000000000..eb05f524194 --- /dev/null +++ b/test/langtools/tools/javac/processing/rounds/GetElementsAnnotatedWithOnMissing.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8213103 + * @summary Checking getElementsAnnotatedWith works for unknown annotations and with -source 8. + * @library /tools/lib /tools/javac/lib + * @modules + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * @build toolbox.ToolBox toolbox.JavacTask JavacTestingAbstractProcessor + * @run main GetElementsAnnotatedWithOnMissing + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Set; + +import javax.annotation.processing.RoundEnvironment; +import javax.lang.model.element.TypeElement; + +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.TestRunner; +import toolbox.ToolBox; + +public class GetElementsAnnotatedWithOnMissing extends TestRunner { + + public static void main(String... args) throws Exception { + new GetElementsAnnotatedWithOnMissing().runTests( + m -> new Object[] { Paths.get(m.getName()) } + ); + } + + private ToolBox tb = new ToolBox(); + + public GetElementsAnnotatedWithOnMissing() { + super(System.err); + } + + @Test + public void testModuleInfoInWrongPlace(Path base) throws Exception { + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + + Files.createDirectories(classes); + + tb.writeJavaFiles(src, "package test; public class Test {}"); + + new JavacTask(tb) + .options("-XDrawDiagnostics", + "-source", "8", + "-classpath", "", + "-sourcepath", src.toString(), + "-processorpath", System.getProperty("test.class.path"), + "-processor", AP.class.getName()) + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run() + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + + new JavacTask(tb) + .options("-XDrawDiagnostics", + "-classpath", "", + "-sourcepath", src.toString(), + "-processorpath", System.getProperty("test.class.path"), + "-processor", AP.class.getName()) + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run() + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + } + + public static final class AP extends JavacTestingAbstractProcessor { + + @Override + public boolean process(Set annot, RoundEnvironment env) { + if (elements.getTypeElement(Ann.class.getCanonicalName()) != null) { + throw new IllegalStateException("Can resolve @Ann!"); + } + env.getElementsAnnotatedWith(Ann.class); + return false; + } + + } + + public @interface Ann {} +} From f2fe71b1860b58820cadc19e0894119dfea7f2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Mon, 5 Nov 2018 08:01:39 +0100 Subject: [PATCH 047/128] 8212989: Allow CompiledMethod ExceptionCache have unloaded klasses Reviewed-by: kvn, pliden --- src/hotspot/share/code/codeCache.cpp | 29 +++++++ src/hotspot/share/code/codeCache.hpp | 7 +- src/hotspot/share/code/compiledMethod.cpp | 76 +++++++++++++++---- src/hotspot/share/code/compiledMethod.hpp | 16 ++-- .../share/code/compiledMethod.inline.hpp | 4 - src/hotspot/share/code/nmethod.cpp | 9 +++ 6 files changed, 118 insertions(+), 23 deletions(-) diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 4f070efaa53..99bcc7258ad 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -145,6 +145,7 @@ address CodeCache::_low_bound = 0; address CodeCache::_high_bound = 0; int CodeCache::_number_of_nmethods_with_dependencies = 0; nmethod* CodeCache::_scavenge_root_nmethods = NULL; +ExceptionCache* volatile CodeCache::_exception_cache_purge_list = NULL; // Initialize arrays of CodeHeap subsets GrowableArray* CodeCache::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray (CodeBlobType::All, true); @@ -895,6 +896,34 @@ void CodeCache::verify_icholder_relocations() { #endif } +// Defer freeing of concurrently cleaned ExceptionCache entries until +// after a global handshake operation. +void CodeCache::release_exception_cache(ExceptionCache* entry) { + if (SafepointSynchronize::is_at_safepoint()) { + delete entry; + } else { + for (;;) { + ExceptionCache* purge_list_head = Atomic::load(&_exception_cache_purge_list); + entry->set_purge_list_next(purge_list_head); + if (Atomic::cmpxchg(entry, &_exception_cache_purge_list, purge_list_head) == purge_list_head) { + break; + } + } + } +} + +// Delete exception caches that have been concurrently unlinked, +// followed by a global handshake operation. +void CodeCache::purge_exception_caches() { + ExceptionCache* curr = _exception_cache_purge_list; + while (curr != NULL) { + ExceptionCache* next = curr->purge_list_next(); + delete curr; + curr = next; + } + _exception_cache_purge_list = NULL; +} + void CodeCache::gc_prologue() { } void CodeCache::gc_epilogue() { diff --git a/src/hotspot/share/code/codeCache.hpp b/src/hotspot/share/code/codeCache.hpp index e43d98aa6be..253faadbbfe 100644 --- a/src/hotspot/share/code/codeCache.hpp +++ b/src/hotspot/share/code/codeCache.hpp @@ -72,8 +72,9 @@ // existing ones, make sure to adapt the dtrace scripts (jhelper.d) for // Solaris and BSD. -class OopClosure; +class ExceptionCache; class KlassDepChange; +class OopClosure; class CodeCache : AllStatic { friend class VMStructs; @@ -94,6 +95,8 @@ class CodeCache : AllStatic { static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link() static uint8_t _unloading_cycle; // Global state for recognizing old nmethods that need to be unloaded + static ExceptionCache* volatile _exception_cache_purge_list; + static void mark_scavenge_root_nmethods() PRODUCT_RETURN; static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN; @@ -192,6 +195,8 @@ class CodeCache : AllStatic { static uint16_t unloading_cycle() { return _unloading_cycle; } static void increment_unloading_cycle(); static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN; + static void release_exception_cache(ExceptionCache* entry); + static void purge_exception_caches(); // Apply f to every live code blob in scavengable nmethods. Prune nmethods // from the list of scavengable nmethods if f->fix_relocations() and a nmethod diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index 206a6c677c9..4a160f7fe7e 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -103,34 +103,84 @@ const char* CompiledMethod::state() const { //----------------------------------------------------------------------------- +ExceptionCache* CompiledMethod::exception_cache_acquire() const { + return OrderAccess::load_acquire(&_exception_cache); +} + void CompiledMethod::add_exception_cache_entry(ExceptionCache* new_entry) { assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock"); assert(new_entry != NULL,"Must be non null"); assert(new_entry->next() == NULL, "Must be null"); - ExceptionCache *ec = exception_cache(); - if (ec != NULL) { - new_entry->set_next(ec); + for (;;) { + ExceptionCache *ec = exception_cache(); + if (ec != NULL) { + Klass* ex_klass = ec->exception_type(); + if (!ex_klass->is_loader_alive()) { + // We must guarantee that entries are not inserted with new next pointer + // edges to ExceptionCache entries with dead klasses, due to bad interactions + // with concurrent ExceptionCache cleanup. Therefore, the inserts roll + // the head pointer forward to the first live ExceptionCache, so that the new + // next pointers always point at live ExceptionCaches, that are not removed due + // to concurrent ExceptionCache cleanup. + ExceptionCache* next = ec->next(); + if (Atomic::cmpxchg(next, &_exception_cache, ec) == ec) { + CodeCache::release_exception_cache(ec); + } + continue; + } + ec = exception_cache(); + if (ec != NULL) { + new_entry->set_next(ec); + } + } + if (Atomic::cmpxchg(new_entry, &_exception_cache, ec) == ec) { + return; + } } - release_set_exception_cache(new_entry); } void CompiledMethod::clean_exception_cache() { + // For each nmethod, only a single thread may call this cleanup function + // at the same time, whether called in STW cleanup or concurrent cleanup. + // Note that if the GC is processing exception cache cleaning in a concurrent phase, + // then a single writer may contend with cleaning up the head pointer to the + // first ExceptionCache node that has a Klass* that is alive. That is fine, + // as long as there is no concurrent cleanup of next pointers from concurrent writers. + // And the concurrent writers do not clean up next pointers, only the head. + // Also note that concurent readers will walk through Klass* pointers that are not + // alive. That does not cause ABA problems, because Klass* is deleted after + // a handshake with all threads, after all stale ExceptionCaches have been + // unlinked. That is also when the CodeCache::exception_cache_purge_list() + // is deleted, with all ExceptionCache entries that were cleaned concurrently. + // That similarly implies that CAS operations on ExceptionCache entries do not + // suffer from ABA problems as unlinking and deletion is separated by a global + // handshake operation. ExceptionCache* prev = NULL; - ExceptionCache* curr = exception_cache(); + ExceptionCache* curr = exception_cache_acquire(); while (curr != NULL) { ExceptionCache* next = curr->next(); - Klass* ex_klass = curr->exception_type(); - if (ex_klass != NULL && !ex_klass->is_loader_alive()) { + if (!curr->exception_type()->is_loader_alive()) { if (prev == NULL) { - set_exception_cache(next); + // Try to clean head; this is contended by concurrent inserts, that + // both lazily clean the head, and insert entries at the head. If + // the CAS fails, the operation is restarted. + if (Atomic::cmpxchg(next, &_exception_cache, curr) != curr) { + prev = NULL; + curr = exception_cache_acquire(); + continue; + } } else { + // It is impossible to during cleanup connect the next pointer to + // an ExceptionCache that has not been published before a safepoint + // prior to the cleanup. Therefore, release is not required. prev->set_next(next); } - delete curr; // prev stays the same. + + CodeCache::release_exception_cache(curr); } else { prev = curr; } @@ -145,7 +195,7 @@ address CompiledMethod::handler_for_exception_and_pc(Handle exception, address p // We never grab a lock to read the exception cache, so we may // have false negatives. This is okay, as it can only happen during // the first few exception lookups for a given nmethod. - ExceptionCache* ec = exception_cache(); + ExceptionCache* ec = exception_cache_acquire(); while (ec != NULL) { address ret_val; if ((ret_val = ec->match(exception,pc)) != NULL) { @@ -172,13 +222,11 @@ void CompiledMethod::add_handler_for_exception_and_pc(Handle exception, address } } -//-------------end of code for ExceptionCache-------------- - // private method for handling exception cache // These methods are private, and used to manipulate the exception cache // directly. ExceptionCache* CompiledMethod::exception_cache_entry_for_exception(Handle exception) { - ExceptionCache* ec = exception_cache(); + ExceptionCache* ec = exception_cache_acquire(); while (ec != NULL) { if (ec->match_exception_with_space(exception)) { return ec; @@ -188,6 +236,8 @@ ExceptionCache* CompiledMethod::exception_cache_entry_for_exception(Handle excep return NULL; } +//-------------end of code for ExceptionCache-------------- + bool CompiledMethod::is_at_poll_return(address pc) { RelocIterator iter(this, pc, pc+1); while (iter.next()) { diff --git a/src/hotspot/share/code/compiledMethod.hpp b/src/hotspot/share/code/compiledMethod.hpp index d21066c2f67..6a69e6006a3 100644 --- a/src/hotspot/share/code/compiledMethod.hpp +++ b/src/hotspot/share/code/compiledMethod.hpp @@ -48,7 +48,8 @@ class ExceptionCache : public CHeapObj { address _pc[cache_size]; address _handler[cache_size]; volatile int _count; - ExceptionCache* _next; + ExceptionCache* volatile _next; + ExceptionCache* _purge_list_next; inline address pc_at(int index); void set_pc_at(int index, address a) { assert(index >= 0 && index < cache_size,""); _pc[index] = a; } @@ -65,8 +66,10 @@ class ExceptionCache : public CHeapObj { ExceptionCache(Handle exception, address pc, address handler); Klass* exception_type() { return _exception_type; } - ExceptionCache* next() { return _next; } - void set_next(ExceptionCache *ec) { _next = ec; } + ExceptionCache* next(); + void set_next(ExceptionCache *ec); + ExceptionCache* purge_list_next() { return _purge_list_next; } + void set_purge_list_next(ExceptionCache *ec) { _purge_list_next = ec; } address match(Handle exception, address pc); bool match_exception_with_space(Handle exception) ; @@ -293,11 +296,14 @@ public: virtual Metadata** metadata_addr_at(int index) const = 0; virtual void set_original_pc(const frame* fr, address pc) = 0; +protected: // Exception cache support - // Note: _exception_cache may be read concurrently. We rely on memory_order_consume here. + // Note: _exception_cache may be read and cleaned concurrently. ExceptionCache* exception_cache() const { return _exception_cache; } + ExceptionCache* exception_cache_acquire() const; void set_exception_cache(ExceptionCache *ec) { _exception_cache = ec; } - void release_set_exception_cache(ExceptionCache *ec); + +public: address handler_for_exception_and_pc(Handle exception, address pc); void add_handler_for_exception_and_pc(Handle exception, address pc, address handler); void clean_exception_cache(); diff --git a/src/hotspot/share/code/compiledMethod.inline.hpp b/src/hotspot/share/code/compiledMethod.inline.hpp index 1192a04f1b7..d6381df60c4 100644 --- a/src/hotspot/share/code/compiledMethod.inline.hpp +++ b/src/hotspot/share/code/compiledMethod.inline.hpp @@ -41,10 +41,6 @@ inline bool CompiledMethod::is_deopt_entry(address pc) { ; } -inline void CompiledMethod::release_set_exception_cache(ExceptionCache *ec) { - OrderAccess::release_store(&_exception_cache, ec); -} - // ----------------------------------------------------------------------------- // CompiledMethod::get_deopt_original_pc // diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index e8ed3a659c5..1d5ef75e107 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -244,6 +244,7 @@ ExceptionCache::ExceptionCache(Handle exception, address pc, address handler) { _count = 0; _exception_type = exception->klass(); _next = NULL; + _purge_list_next = NULL; add_address_and_handler(pc,handler); } @@ -293,6 +294,14 @@ bool ExceptionCache::add_address_and_handler(address addr, address handler) { return false; } +ExceptionCache* ExceptionCache::next() { + return Atomic::load(&_next); +} + +void ExceptionCache::set_next(ExceptionCache *ec) { + Atomic::store(ec, &_next); +} + //----------------------------------------------------------------------------- From a836b891b80f04a6d30f0778803531ae684a40e7 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 5 Nov 2018 10:52:36 +0100 Subject: [PATCH 048/128] 8213339: Update precompiled.hpp with headers based on current frequency Reviewed-by: shade, dholmes --- src/hotspot/share/precompiled/precompiled.hpp | 360 +++--------------- 1 file changed, 52 insertions(+), 308 deletions(-) diff --git a/src/hotspot/share/precompiled/precompiled.hpp b/src/hotspot/share/precompiled/precompiled.hpp index 2ccaf8f9a44..07b3699d0ba 100644 --- a/src/hotspot/share/precompiled/precompiled.hpp +++ b/src/hotspot/share/precompiled/precompiled.hpp @@ -22,316 +22,60 @@ * */ -// Precompiled headers are turned off for Sun Studion, +// Precompiled headers are turned off for Solaris Studio, // or if the user passes --disable-precompiled-headers to configure. #ifndef DONT_USE_PRECOMPILED_HEADER -# include "jni.h" -# include "jvm.h" -# include "asm/assembler.hpp" -# include "asm/assembler.inline.hpp" -# include "asm/codeBuffer.hpp" -# include "asm/register.hpp" -# include "ci/ciArray.hpp" -# include "ci/ciArrayKlass.hpp" -# include "ci/ciClassList.hpp" -# include "ci/ciConstant.hpp" -# include "ci/ciConstantPoolCache.hpp" -# include "ci/ciEnv.hpp" -# include "ci/ciExceptionHandler.hpp" -# include "ci/ciField.hpp" -# include "ci/ciFlags.hpp" -# include "ci/ciInstance.hpp" -# include "ci/ciInstanceKlass.hpp" -# include "ci/ciKlass.hpp" -# include "ci/ciMethod.hpp" -# include "ci/ciNullObject.hpp" -# include "ci/ciObjArrayKlass.hpp" -# include "ci/ciObject.hpp" -# include "ci/ciObjectFactory.hpp" -# include "ci/ciSignature.hpp" -# include "ci/ciStreams.hpp" -# include "ci/ciSymbol.hpp" -# include "ci/ciType.hpp" -# include "ci/ciTypeArrayKlass.hpp" -# include "ci/ciUtilities.inline.hpp" -# include "ci/compilerInterface.hpp" -# include "classfile/classFileParser.hpp" -# include "classfile/classFileStream.hpp" -# include "classfile/classLoader.hpp" -# include "classfile/javaClasses.hpp" -# include "classfile/moduleEntry.hpp" -# include "classfile/modules.hpp" -# include "classfile/packageEntry.hpp" -# include "classfile/symbolTable.hpp" -# include "classfile/systemDictionary.hpp" -# include "classfile/vmSymbols.hpp" -# include "code/codeBlob.hpp" -# include "code/codeCache.hpp" -# include "code/compressedStream.hpp" -# include "code/debugInfo.hpp" -# include "code/debugInfoRec.hpp" -# include "code/dependencies.hpp" -# include "code/exceptionHandlerTable.hpp" -# include "code/location.hpp" -# include "code/nativeInst.hpp" -# include "code/nmethod.hpp" -# include "code/oopRecorder.hpp" -# include "code/pcDesc.hpp" -# include "code/relocInfo.hpp" -# include "code/stubs.hpp" -# include "code/vmreg.hpp" -# include "compiler/disassembler.hpp" -# include "compiler/methodLiveness.hpp" -# include "compiler/oopMap.hpp" -# include "gc/shared/adaptiveSizePolicy.hpp" -# include "gc/shared/ageTable.hpp" -# include "gc/shared/barrierSet.hpp" -# include "gc/shared/blockOffsetTable.hpp" -# include "gc/shared/cardTableBarrierSet.hpp" -# include "gc/shared/collectedHeap.hpp" -# include "gc/shared/collectorCounters.hpp" -# include "gc/shared/collectorPolicy.hpp" -# include "gc/shared/gcCause.hpp" -# include "gc/shared/gcLocker.hpp" -# include "gc/shared/gcStats.hpp" -# include "gc/shared/gcUtil.hpp" -# include "gc/shared/genCollectedHeap.hpp" -# include "gc/shared/generation.hpp" -# include "gc/shared/generationCounters.hpp" -# include "gc/shared/jvmFlagConstraintsGC.hpp" -# include "gc/shared/modRefBarrierSet.hpp" -# include "gc/shared/ptrQueue.hpp" -# include "gc/shared/referencePolicy.hpp" -# include "gc/shared/referenceProcessor.hpp" -# include "gc/shared/satbMarkQueue.hpp" -# include "gc/shared/space.hpp" -# include "gc/shared/spaceDecorator.hpp" -# include "gc/shared/taskqueue.hpp" -# include "gc/shared/threadLocalAllocBuffer.hpp" -# include "gc/shared/workgroup.hpp" -# include "interpreter/abstractInterpreter.hpp" -# include "interpreter/bytecode.hpp" -# include "interpreter/bytecodeHistogram.hpp" -# include "interpreter/bytecodeInterpreter.hpp" -# include "interpreter/bytecodeInterpreter.inline.hpp" -# include "interpreter/bytecodeTracer.hpp" -# include "interpreter/bytecodes.hpp" -# include "interpreter/cppInterpreter.hpp" -# include "interpreter/interp_masm.hpp" -# include "interpreter/interpreter.hpp" -# include "interpreter/invocationCounter.hpp" -# include "interpreter/linkResolver.hpp" -# include "interpreter/templateInterpreter.hpp" -# include "interpreter/templateTable.hpp" -# include "jvmtifiles/jvmti.h" -# include "logging/log.hpp" -# include "memory/allocation.hpp" -# include "memory/arena.hpp" -# include "memory/heap.hpp" -# include "memory/iterator.hpp" -# include "memory/memRegion.hpp" -# include "memory/oopFactory.hpp" -# include "memory/resourceArea.hpp" -# include "memory/universe.hpp" -# include "memory/universe.hpp" -# include "memory/virtualspace.hpp" -# include "oops/array.hpp" -# include "oops/arrayKlass.hpp" -# include "oops/arrayOop.hpp" -# include "oops/constMethod.hpp" -# include "oops/instanceKlass.hpp" -# include "oops/instanceOop.hpp" -# include "oops/instanceRefKlass.hpp" -# include "oops/klass.hpp" -# include "oops/klassVtable.hpp" -# include "oops/markOop.hpp" -# include "oops/markOop.inline.hpp" -# include "oops/method.hpp" -# include "oops/methodData.hpp" -# include "oops/objArrayKlass.hpp" -# include "oops/objArrayOop.hpp" -# include "oops/oop.hpp" -# include "oops/oopsHierarchy.hpp" -# include "oops/symbol.hpp" -# include "oops/typeArrayKlass.hpp" -# include "oops/typeArrayOop.hpp" -# include "prims/jvmtiExport.hpp" -# include "prims/methodHandles.hpp" -# include "runtime/arguments.hpp" -# include "runtime/atomic.hpp" -# include "runtime/deoptimization.hpp" -# include "runtime/extendedPC.hpp" -# include "runtime/fieldDescriptor.hpp" -# include "runtime/fieldType.hpp" -# include "runtime/flags/flagSetting.hpp" -# include "runtime/flags/jvmFlag.hpp" -# include "runtime/flags/jvmFlagConstraintList.hpp" -# include "runtime/flags/jvmFlagConstraintsCompiler.hpp" -# include "runtime/flags/jvmFlagConstraintsRuntime.hpp" -# include "runtime/flags/jvmFlagRangeList.hpp" -# include "runtime/flags/jvmFlagWriteableList.hpp" -# include "runtime/frame.hpp" -# include "runtime/frame.inline.hpp" -# include "runtime/globals.hpp" -# include "runtime/globals_extension.hpp" -# include "runtime/handles.hpp" -# include "runtime/handles.inline.hpp" -# include "runtime/icache.hpp" -# include "runtime/init.hpp" -# include "runtime/interfaceSupport.inline.hpp" -# include "runtime/java.hpp" -# include "runtime/javaCalls.hpp" -# include "runtime/javaFrameAnchor.hpp" -# include "runtime/jniHandles.hpp" -# include "runtime/monitorChunk.hpp" -# include "runtime/mutex.hpp" -# include "runtime/mutexLocker.hpp" -# include "runtime/objectMonitor.hpp" -# include "runtime/orderAccess.hpp" -# include "runtime/orderAccess.hpp" -# include "runtime/os.hpp" -# include "runtime/osThread.hpp" -# include "runtime/perfData.hpp" -# include "runtime/perfMemory.hpp" -# include "runtime/prefetch.hpp" -# include "runtime/prefetch.inline.hpp" -# include "runtime/reflection.hpp" -# include "runtime/reflectionUtils.hpp" -# include "runtime/registerMap.hpp" -# include "runtime/safepoint.hpp" -# include "runtime/sharedRuntime.hpp" -# include "runtime/signature.hpp" -# include "runtime/stackValue.hpp" -# include "runtime/stackValueCollection.hpp" -# include "runtime/stubCodeGenerator.hpp" -# include "runtime/stubRoutines.hpp" -# include "runtime/synchronizer.hpp" -# include "runtime/thread.hpp" -# include "runtime/timer.hpp" -# include "runtime/unhandledOops.hpp" -# include "runtime/vframe.hpp" -# include "runtime/vmThread.hpp" -# include "runtime/vm_operations.hpp" -# include "runtime/vm_version.hpp" -# include "services/allocationSite.hpp" -# include "services/lowMemoryDetector.hpp" -# include "services/mallocTracker.hpp" -# include "services/memBaseline.hpp" -# include "services/memReporter.hpp" -# include "services/memTracker.hpp" -# include "services/memoryPool.hpp" -# include "services/memoryService.hpp" -# include "services/memoryUsage.hpp" -# include "services/nmtCommon.hpp" -# include "services/virtualMemoryTracker.hpp" -# include "utilities/accessFlags.hpp" -# include "utilities/bitMap.hpp" -# include "utilities/bitMap.inline.hpp" -# include "utilities/bytes.hpp" -# include "utilities/constantTag.hpp" -# include "utilities/copy.hpp" -# include "utilities/debug.hpp" -# include "utilities/exceptions.hpp" -# include "utilities/globalDefinitions.hpp" -# include "utilities/growableArray.hpp" -# include "utilities/hashtable.hpp" -# include "utilities/histogram.hpp" -# include "utilities/macros.hpp" -# include "utilities/nativeCallStack.hpp" -# include "utilities/numberSeq.hpp" -# include "utilities/ostream.hpp" -# include "utilities/preserveException.hpp" -# include "utilities/sizes.hpp" -# include "utilities/utf8.hpp" -#ifdef COMPILER2 -# include "libadt/dict.hpp" -# include "libadt/set.hpp" -# include "libadt/vectset.hpp" -# include "opto/ad.hpp" -# include "opto/addnode.hpp" -# include "opto/adlcVMDeps.hpp" -# include "opto/block.hpp" -# include "opto/c2_globals.hpp" -# include "opto/callnode.hpp" -# include "opto/castnode.hpp" -# include "opto/cfgnode.hpp" -# include "opto/compile.hpp" -# include "opto/connode.hpp" -# include "opto/convertnode.hpp" -# include "opto/countbitsnode.hpp" -# include "opto/idealGraphPrinter.hpp" -# include "opto/intrinsicnode.hpp" -# include "opto/loopnode.hpp" -# include "opto/machnode.hpp" -# include "opto/matcher.hpp" -# include "opto/memnode.hpp" -# include "opto/movenode.hpp" -# include "opto/mulnode.hpp" -# include "opto/multnode.hpp" -# include "opto/narrowptrnode.hpp" -# include "opto/opaquenode.hpp" -# include "opto/opcodes.hpp" -# include "opto/optoreg.hpp" -# include "opto/phase.hpp" -# include "opto/phaseX.hpp" -# include "opto/regalloc.hpp" -# include "opto/regmask.hpp" -# include "opto/runtime.hpp" -# include "opto/subnode.hpp" -# include "opto/type.hpp" -# include "opto/vectornode.hpp" -#endif // COMPILER2 -#ifdef COMPILER1 -# include "c1/c1_Compilation.hpp" -# include "c1/c1_Defs.hpp" -# include "c1/c1_FrameMap.hpp" -# include "c1/c1_LIR.hpp" -# include "c1/c1_MacroAssembler.hpp" -# include "c1/c1_ValueType.hpp" -# include "c1/c1_globals.hpp" -#endif // COMPILER1 -#if INCLUDE_JVMCI -# include "jvmci/jvmci_globals.hpp" -#endif // INCLUDE_JVMCI -#if INCLUDE_CMSGC -# include "gc/cms/allocationStats.hpp" -# include "gc/cms/compactibleFreeListSpace.hpp" -# include "gc/cms/concurrentMarkSweepGeneration.hpp" -# include "gc/cms/freeChunk.hpp" -# include "gc/cms/gSpaceCounters.hpp" -# include "gc/cms/jvmFlagConstraintsCMS.hpp" -# include "gc/cms/parOopClosures.hpp" -# include "gc/cms/promotionInfo.hpp" -# include "gc/cms/yieldingWorkgroup.hpp" -#endif // INCLUDE_CMSGC -#if INCLUDE_G1GC -# include "gc/g1/dirtyCardQueue.hpp" -# include "gc/g1/g1BlockOffsetTable.hpp" -# include "gc/g1/g1OopClosures.hpp" -# include "gc/g1/g1_globals.hpp" -# include "gc/g1/jvmFlagConstraintsG1.hpp" -#endif // INCLUDE_G1GC -#if INCLUDE_PARALLELGC -# include "gc/parallel/gcAdaptivePolicyCounters.hpp" -# include "gc/parallel/immutableSpace.hpp" -# include "gc/parallel/jvmFlagConstraintsParallel.hpp" -# include "gc/parallel/mutableSpace.hpp" -# include "gc/parallel/objectStartArray.hpp" -# include "gc/parallel/parMarkBitMap.hpp" -# include "gc/parallel/parallelScavengeHeap.hpp" -# include "gc/parallel/psAdaptiveSizePolicy.hpp" -# include "gc/parallel/psCompactionManager.hpp" -# include "gc/parallel/psGCAdaptivePolicyCounters.hpp" -# include "gc/parallel/psGenerationCounters.hpp" -# include "gc/parallel/psOldGen.hpp" -# include "gc/parallel/psVirtualspace.hpp" -# include "gc/parallel/psYoungGen.hpp" -# include "gc/parallel/spaceCounters.hpp" -#endif // INCLUDE_PARALLELGC -#if INCLUDE_SERIALGC -# include "gc/serial/cSpaceCounters.hpp" -# include "gc/serial/defNewGeneration.hpp" -#endif // INCLUDE_SERIALGC + +// These header files are included in at least 130 C++ files, as of +// measurements made in November 2018. This list excludes files named +// *.include.hpp, since including them decreased build performance. + +#include "classfile/classLoaderData.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/gcCause.hpp" +#include "logging/log.hpp" +#include "memory/allocation.hpp" +#include "memory/iterator.hpp" +#include "memory/memRegion.hpp" +#include "memory/resourceArea.hpp" +#include "memory/universe.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klass.hpp" +#include "oops/method.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/oop.hpp" +#include "oops/oopsHierarchy.hpp" +#include "runtime/atomic.hpp" +#include "runtime/globals.hpp" +#include "runtime/handles.hpp" +#include "runtime/mutex.hpp" +#include "runtime/orderAccess.hpp" +#include "runtime/os.hpp" +#include "runtime/thread.hpp" +#include "runtime/timer.hpp" +#include "services/memTracker.hpp" +#include "utilities/align.hpp" +#include "utilities/bitMap.hpp" +#include "utilities/copy.hpp" +#include "utilities/debug.hpp" +#include "utilities/exceptions.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/macros.hpp" +#include "utilities/ostream.hpp" +#include "utilities/ticks.hpp" + +#ifdef TARGET_COMPILER_visCPP +// For Visual Studio, including the *.inline.hpp files actually +// increased performance. +#include "memory/allocation.inline.hpp" +#include "oops/access.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#endif // TARGET_COMPILER_visCPP #endif // !DONT_USE_PRECOMPILED_HEADER From 059682d68136d3d82cede2db774989fabefafa24 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Mon, 5 Nov 2018 11:20:47 +0000 Subject: [PATCH 049/128] 8213301: Fix legal headers in jdk logging tests Reviewed-by: chegar, mchung --- .../SystemLoggerInPlatformLoader.java | 4 +--- .../systempkg/log/SystemLoggerAccessor.java | 4 +--- test/jdk/java/lang/System/LoggerFinder/modules/Base.java | 4 +--- .../System/LoggerFinder/modules/JDKLoggerForImageTest.java | 4 +--- .../lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java | 4 +--- .../lang/System/LoggerFinder/modules/LoggerInImageTest.java | 4 +--- .../System/LoggerFinder/modules/NamedLoggerForImageTest.java | 4 +--- .../System/LoggerFinder/modules/NamedLoggerForJDKTest.java | 4 +--- .../LoggerFinder/modules/UnnamedLoggerForImageTest.java | 4 +--- .../System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java | 4 +--- .../System/LoggerFinder/modules/boot_client/BootClient.java | 4 +--- .../System/LoggerFinder/modules/boot_usage/BootUsage.java | 4 +--- .../LoggerFinder/modules/named_client/m.t.a/module-info.java | 4 +--- .../modules/named_client/m.t.a/pkg/a/t/TestA.java | 4 +--- .../LoggerFinder/modules/named_logger/m.l.a/module-info.java | 4 +--- .../modules/named_logger/m.l.a/pkg/a/l/LoggerA.java | 4 +--- .../modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java | 4 +--- .../LoggerFinder/modules/patched_client/PatchedClient.java | 4 +--- .../patched_usage/java.base/java/lang/PatchedUsage.java | 4 +--- .../LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java | 4 +--- .../LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java | 4 +--- .../modules/unnamed_logger/pkg/b/p/LoggerFinderB.java | 4 +--- test/jdk/java/util/logging/LogManager/LinkageErrorTest.java | 4 +--- 23 files changed, 23 insertions(+), 69 deletions(-) diff --git a/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java b/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java index f391e65e293..5d2cec876a1 100644 --- a/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java +++ b/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/systempkg/log/SystemLoggerAccessor.java b/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/systempkg/log/SystemLoggerAccessor.java index 8defec1a205..35c2ad761e1 100644 --- a/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/systempkg/log/SystemLoggerAccessor.java +++ b/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/systempkg/log/SystemLoggerAccessor.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/Base.java b/test/jdk/java/lang/System/LoggerFinder/modules/Base.java index 80206bffb5b..5befbd62789 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/Base.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/Base.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java index 9588e46131f..b155ba994a6 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java index 6a0543eca9e..68bc6fd839b 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java index 1a617e33395..d3c3ace5a65 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java index ff0b15abdb5..2e621597935 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java index 46facf7e7cb..6abf98c5227 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java index a1ea6bb8eba..038c96697cb 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java index ee93b560365..b239483b0b7 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java b/test/jdk/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java index b4cc85f4dfa..dde084bb2de 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java b/test/jdk/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java index c526cd9e9e9..4aa55948f5a 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java b/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java index 2e87616f268..4a6e6130482 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java b/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java index 4e6e0d7b9c9..4937f6fcdb7 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java index bd4a54c4647..3258b7634bc 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java index 8ab0f5318fa..6dbb458be66 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java index ddb3637f410..729be170eef 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java b/test/jdk/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java index 922a2a8c036..b8a1a5bdf82 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java b/test/jdk/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java index 69bf3daae2d..ede55f3ab82 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java index 8e5f0a6d6ed..38737b567c7 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java index be299867485..e2fc7c3bb6c 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java index 376bb64ea1d..ef7df60805f 100644 --- a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java +++ b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/util/logging/LogManager/LinkageErrorTest.java b/test/jdk/java/util/logging/LogManager/LinkageErrorTest.java index 98e56b0ba6b..011d63598d8 100644 --- a/test/jdk/java/util/logging/LogManager/LinkageErrorTest.java +++ b/test/jdk/java/util/logging/LogManager/LinkageErrorTest.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or From 03ef2b0df5b04a653ce82a5dac78e6168acc7177 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Thu, 4 Oct 2018 09:24:27 +0200 Subject: [PATCH 050/128] 8211320: Aarch64: unsafe.compareAndSetByte() and unsafe.compareAndSetShort() c2 intrinsics broken with negative expected value Reviewed-by: adinn, aph --- src/hotspot/cpu/aarch64/aarch64.ad | 12 +- .../cpu/aarch64/macroAssembler_aarch64.cpp | 29 +++- .../cpu/aarch64/macroAssembler_aarch64.hpp | 3 + .../unsafe/CASandCAEwithNegExpected.java | 143 ++++++++++++++++++ 4 files changed, 172 insertions(+), 15 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 55c958a2045..058dc2d3471 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -8341,8 +8341,7 @@ instruct compareAndExchangeB(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne "cmpxchg $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" %} ins_encode %{ - __ uxtbw(rscratch2, $oldval$$Register); - __ cmpxchg($mem$$Register, rscratch2, $newval$$Register, + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::byte, /*acquire*/ false, /*release*/ true, /*weak*/ false, $res$$Register); __ sxtbw($res$$Register, $res$$Register); @@ -8358,8 +8357,7 @@ instruct compareAndExchangeS(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne "cmpxchg $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" %} ins_encode %{ - __ uxthw(rscratch2, $oldval$$Register); - __ cmpxchg($mem$$Register, rscratch2, $newval$$Register, + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::halfword, /*acquire*/ false, /*release*/ true, /*weak*/ false, $res$$Register); __ sxthw($res$$Register, $res$$Register); @@ -8436,8 +8434,7 @@ instruct weakCompareAndSwapB(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" %} ins_encode %{ - __ uxtbw(rscratch2, $oldval$$Register); - __ cmpxchg($mem$$Register, rscratch2, $newval$$Register, + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::byte, /*acquire*/ false, /*release*/ true, /*weak*/ true, noreg); __ csetw($res$$Register, Assembler::EQ); @@ -8454,8 +8451,7 @@ instruct weakCompareAndSwapS(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" %} ins_encode %{ - __ uxthw(rscratch2, $oldval$$Register); - __ cmpxchg($mem$$Register, rscratch2, $newval$$Register, + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::halfword, /*acquire*/ false, /*release*/ true, /*weak*/ true, noreg); __ csetw($res$$Register, Assembler::EQ); diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 82c2fac6390..47c93928158 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -2367,21 +2367,18 @@ void MacroAssembler::cmpxchg(Register addr, Register expected, bool weak, Register result) { if (result == noreg) result = rscratch1; + BLOCK_COMMENT("cmpxchg {"); if (UseLSE) { mov(result, expected); lse_cas(result, new_val, addr, size, acquire, release, /*not_pair*/ true); - cmp(result, expected); + compare_eq(result, expected, size); } else { - BLOCK_COMMENT("cmpxchg {"); Label retry_load, done; if ((VM_Version::features() & VM_Version::CPU_STXR_PREFETCH)) prfm(Address(addr), PSTL1STRM); bind(retry_load); load_exclusive(result, addr, size, acquire); - if (size == xword) - cmp(result, expected); - else - cmpw(result, expected); + compare_eq(result, expected, size); br(Assembler::NE, done); store_exclusive(rscratch1, new_val, addr, size, release); if (weak) { @@ -2390,10 +2387,28 @@ void MacroAssembler::cmpxchg(Register addr, Register expected, cbnzw(rscratch1, retry_load); } bind(done); - BLOCK_COMMENT("} cmpxchg"); + } + BLOCK_COMMENT("} cmpxchg"); +} + +// A generic comparison. Only compares for equality, clobbers rscratch1. +void MacroAssembler::compare_eq(Register rm, Register rn, enum operand_size size) { + if (size == xword) { + cmp(rm, rn); + } else if (size == word) { + cmpw(rm, rn); + } else if (size == halfword) { + eorw(rscratch1, rm, rn); + ands(zr, rscratch1, 0xffff); + } else if (size == byte) { + eorw(rscratch1, rm, rn); + ands(zr, rscratch1, 0xff); + } else { + ShouldNotReachHere(); } } + static bool different(Register a, RegisterOrConstant b, Register c) { if (b.is_constant()) return a != c; diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index 623b92fc9e0..6eeaa30b802 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -1020,7 +1020,10 @@ public: enum operand_size size, bool acquire, bool release, bool weak, Register result); +private: + void compare_eq(Register rn, Register rm, enum operand_size size); +public: // Calls address trampoline_call(Address entry, CodeBuffer *cbuf = NULL); diff --git a/test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java b/test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java new file mode 100644 index 00000000000..d1ad8a5f756 --- /dev/null +++ b/test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8211320 + * @summary Aarch64: unsafe.compareAndSetByte() and unsafe.compareAndSetShort() c2 intrinsics broken with negative expected value + * + * @modules java.base/jdk.internal.misc + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation CASandCAEwithNegExpected + */ + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +public class CASandCAEwithNegExpected { + public volatile int f_int = -1; + public volatile long f_long = -1; + public volatile byte f_byte = -1; + public volatile short f_short = -1; + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_long_field; + public static Field f_byte_field; + public static Field f_short_field; + public static long f_int_off; + public static long f_long_off; + public static long f_byte_off; + public static long f_short_off; + + static { + try { + f_int_field = CASandCAEwithNegExpected.class.getField("f_int"); + f_long_field = CASandCAEwithNegExpected.class.getField("f_long"); + f_byte_field = CASandCAEwithNegExpected.class.getField("f_byte"); + f_short_field = CASandCAEwithNegExpected.class.getField("f_short"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_long_off = unsafe.objectFieldOffset(f_long_field); + f_byte_off = unsafe.objectFieldOffset(f_byte_field); + f_short_off = unsafe.objectFieldOffset(f_short_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + static public void main(String[] args) { + CASandCAEwithNegExpected t = new CASandCAEwithNegExpected(); + for (int i = 0; i < 20_000; i++) { + t.test(); + } + } + + // check proper handling of sign extension of expected value in comparison + void test() { + f_int = -1; + f_long = -1; + f_byte = -1; + f_short = -1; + + unsafe.compareAndSetInt(this, f_int_off, -1, 42); + if (f_int != 42) { + throw new RuntimeException("CAS failed"); + } + unsafe.compareAndSetLong(this, f_long_off, -1, 42); + if (f_long != 42) { + throw new RuntimeException("CAS failed"); + } + unsafe.compareAndSetByte(this, f_byte_off, (byte)-1, (byte)42); + if (f_byte != 42) { + throw new RuntimeException("CAS failed"); + } + unsafe.compareAndSetShort(this, f_short_off, (short)-1, (short)42); + if (f_short != 42) { + throw new RuntimeException("CAS failed"); + } + + f_int = -1; + f_long = -1; + f_byte = -1; + f_short = -1; + + unsafe.compareAndExchangeInt(this, f_int_off, -1, 42); + if (f_int != 42) { + throw new RuntimeException("CAE failed"); + } + unsafe.compareAndExchangeLong(this, f_long_off, -1, 42); + if (f_long != 42) { + throw new RuntimeException("CAE failed"); + } + unsafe.compareAndExchangeByte(this, f_byte_off, (byte)-1, (byte)42); + if (f_byte != 42) { + throw new RuntimeException("CAE failed"); + } + unsafe.compareAndExchangeShort(this, f_short_off, (short)-1, (short)42); + if (f_short != 42) { + throw new RuntimeException("CAE failed"); + } + + f_int = -1; + f_long = -1; + f_byte = -1; + f_short = -1; + + if (unsafe.weakCompareAndSetInt(this, f_int_off, -1, 42) && f_int != 42) { + throw new RuntimeException("CAS failed"); + } + + if (unsafe.weakCompareAndSetLong(this, f_long_off, -1, 42) && f_long != 42) { + throw new RuntimeException("CAS failed"); + } + + if (unsafe.weakCompareAndSetByte(this, f_byte_off, (byte)-1, (byte)42) && f_byte != 42) { + throw new RuntimeException("CAS failed"); + } + + if (unsafe.weakCompareAndSetShort(this, f_short_off, (short)-1, (short)42) && f_short != 42) { + throw new RuntimeException("CAS failed"); + } + } + +} From b5d2e875f683579e7ce2d20e3b8968482a722e67 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 5 Nov 2018 12:53:55 +0100 Subject: [PATCH 051/128] 8209835: Aarch64: elide barriers on all volatile operations Reviewed-by: aph, adinn --- src/hotspot/cpu/aarch64/aarch64.ad | 472 ++++++++++++- .../c2/aarch64/TestUnsafeVolatileCAE.java | 133 ++++ .../c2/aarch64/TestUnsafeVolatileCAS.java | 54 ++ .../c2/aarch64/TestUnsafeVolatileGAA.java | 76 ++ .../c2/aarch64/TestUnsafeVolatileGAS.java | 90 +++ .../c2/aarch64/TestUnsafeVolatileWeakCAS.java | 139 ++++ .../compiler/c2/aarch64/TestVolatiles.java | 655 +++++++++++++++--- .../compiler/c2/aarch64/TestVolatilesCMS.java | 12 + .../c2/aarch64/TestVolatilesCMSCondMark.java | 12 + .../compiler/c2/aarch64/TestVolatilesG1.java | 17 + .../c2/aarch64/TestVolatilesParallel.java | 12 + .../c2/aarch64/TestVolatilesSerial.java | 12 + 12 files changed, 1541 insertions(+), 143 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAE.java create mode 100644 test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAA.java create mode 100644 test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAS.java create mode 100644 test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileWeakCAS.java diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 058dc2d3471..a86fe76f025 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -1036,7 +1036,7 @@ class HandlerImpl { } }; - bool is_CAS(int opcode); + bool is_CAS(int opcode, bool maybe_volatile); // predicates controlling emit of ldr/ldar and associated dmb @@ -1259,12 +1259,12 @@ source %{ // relevant dmb instructions. // - // is_CAS(int opcode) + // is_CAS(int opcode, bool maybe_volatile) // // return true if opcode is one of the possible CompareAndSwapX // values otherwise false. - bool is_CAS(int opcode) + bool is_CAS(int opcode, bool maybe_volatile) { switch(opcode) { // We handle these @@ -1272,23 +1272,28 @@ source %{ case Op_CompareAndSwapL: case Op_CompareAndSwapP: case Op_CompareAndSwapN: - // case Op_CompareAndSwapB: - // case Op_CompareAndSwapS: + case Op_CompareAndSwapB: + case Op_CompareAndSwapS: + case Op_GetAndSetI: + case Op_GetAndSetL: + case Op_GetAndSetP: + case Op_GetAndSetN: + case Op_GetAndAddI: + case Op_GetAndAddL: return true; - // These are TBD + case Op_CompareAndExchangeI: + case Op_CompareAndExchangeN: + case Op_CompareAndExchangeB: + case Op_CompareAndExchangeS: + case Op_CompareAndExchangeL: + case Op_CompareAndExchangeP: case Op_WeakCompareAndSwapB: case Op_WeakCompareAndSwapS: case Op_WeakCompareAndSwapI: case Op_WeakCompareAndSwapL: case Op_WeakCompareAndSwapP: case Op_WeakCompareAndSwapN: - case Op_CompareAndExchangeB: - case Op_CompareAndExchangeS: - case Op_CompareAndExchangeI: - case Op_CompareAndExchangeL: - case Op_CompareAndExchangeP: - case Op_CompareAndExchangeN: - return false; + return maybe_volatile; default: return false; } @@ -1318,7 +1323,7 @@ bool unnecessary_acquire(const Node *barrier) if (mb->trailing_load_store()) { Node* load_store = mb->in(MemBarNode::Precedent); assert(load_store->is_LoadStore(), "unexpected graph shape"); - return is_CAS(load_store->Opcode()); + return is_CAS(load_store->Opcode(), true); } return false; @@ -1365,7 +1370,7 @@ bool unnecessary_release(const Node *n) } else { assert(mem->is_LoadStore(), ""); assert(trailing_mb->Opcode() == Op_MemBarAcquire, ""); - return is_CAS(mem->Opcode()); + return is_CAS(mem->Opcode(), true); } } return false; @@ -1416,13 +1421,17 @@ bool needs_releasing_store(const Node *n) bool needs_acquiring_load_exclusive(const Node *n) { - assert(is_CAS(n->Opcode()), "expecting a compare and swap"); + assert(is_CAS(n->Opcode(), true), "expecting a compare and swap"); if (UseBarriersForVolatile) { return false; } LoadStoreNode* ldst = n->as_LoadStore(); - assert(ldst->trailing_membar() != NULL, "expected trailing membar"); + if (is_CAS(n->Opcode(), false)) { + assert(ldst->trailing_membar() != NULL, "expected trailing membar"); + } else { + return ldst->trailing_membar() != NULL; + } // so we can just return true here return true; @@ -2943,6 +2952,21 @@ encode %{ /*weak*/ false, noreg); %} + enc_class aarch64_enc_cmpxchgs_acq(memory mem, iRegINoSp oldval, iRegINoSp newval) %{ + MacroAssembler _masm(&cbuf); + guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); + __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register, + Assembler::halfword, /*acquire*/ true, /*release*/ true, + /*weak*/ false, noreg); + %} + + enc_class aarch64_enc_cmpxchgb_acq(memory mem, iRegINoSp oldval, iRegINoSp newval) %{ + MacroAssembler _masm(&cbuf); + guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); + __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register, + Assembler::byte, /*acquire*/ true, /*release*/ true, + /*weak*/ false, noreg); + %} // auxiliary used for CompareAndSwapX to set result register enc_class aarch64_enc_cset_eq(iRegINoSp res) %{ @@ -8240,6 +8264,44 @@ instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoS // alternative CompareAndSwapX when we are eliding barriers +instruct compareAndSwapBAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{ + + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndSwapB mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + + effect(KILL cr); + + format %{ + "cmpxchgb_acq $mem, $oldval, $newval\t# (int) if $mem == $oldval then $mem <-- $newval" + "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + + ins_encode(aarch64_enc_cmpxchgb_acq(mem, oldval, newval), + aarch64_enc_cset_eq(res)); + + ins_pipe(pipe_slow); +%} + +instruct compareAndSwapSAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{ + + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndSwapS mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + + effect(KILL cr); + + format %{ + "cmpxchgs_acq $mem, $oldval, $newval\t# (int) if $mem == $oldval then $mem <-- $newval" + "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + + ins_encode(aarch64_enc_cmpxchgs_acq(mem, oldval, newval), + aarch64_enc_cset_eq(res)); + + ins_pipe(pipe_slow); +%} + instruct compareAndSwapIAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{ predicate(needs_acquiring_load_exclusive(n)); @@ -8338,7 +8400,7 @@ instruct compareAndExchangeB(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne ins_cost(2 * VOLATILE_REF_COST); effect(TEMP_DEF res, KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgb $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" %} ins_encode %{ __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, @@ -8354,7 +8416,7 @@ instruct compareAndExchangeS(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne ins_cost(2 * VOLATILE_REF_COST); effect(TEMP_DEF res, KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgs $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" %} ins_encode %{ __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, @@ -8370,7 +8432,7 @@ instruct compareAndExchangeI(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne ins_cost(2 * VOLATILE_REF_COST); effect(TEMP_DEF res, KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgw $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval" %} ins_encode %{ __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, @@ -8400,7 +8462,7 @@ instruct compareAndExchangeN(iRegNNoSp res, indirect mem, iRegN oldval, iRegN ne ins_cost(2 * VOLATILE_REF_COST); effect(TEMP_DEF res, KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgw $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval" %} ins_encode %{ __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, @@ -8425,12 +8487,112 @@ instruct compareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP ne ins_pipe(pipe_slow); %} +instruct compareAndExchangeBAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndExchangeB mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(TEMP_DEF res, KILL cr); + format %{ + "cmpxchgb_acq $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::byte, /*acquire*/ true, /*release*/ true, + /*weak*/ false, $res$$Register); + __ sxtbw($res$$Register, $res$$Register); + %} + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangeSAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndExchangeS mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(TEMP_DEF res, KILL cr); + format %{ + "cmpxchgs_acq $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::halfword, /*acquire*/ true, /*release*/ true, + /*weak*/ false, $res$$Register); + __ sxthw($res$$Register, $res$$Register); + %} + ins_pipe(pipe_slow); +%} + + +instruct compareAndExchangeIAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndExchangeI mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(TEMP_DEF res, KILL cr); + format %{ + "cmpxchgw_acq $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::word, /*acquire*/ true, /*release*/ true, + /*weak*/ false, $res$$Register); + %} + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangeLAcq(iRegLNoSp res, indirect mem, iRegL oldval, iRegL newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndExchangeL mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(TEMP_DEF res, KILL cr); + format %{ + "cmpxchg_acq $res = $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::xword, /*acquire*/ true, /*release*/ true, + /*weak*/ false, $res$$Register); + %} + ins_pipe(pipe_slow); +%} + + +instruct compareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(TEMP_DEF res, KILL cr); + format %{ + "cmpxchgw_acq $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::word, /*acquire*/ true, /*release*/ true, + /*weak*/ false, $res$$Register); + %} + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(TEMP_DEF res, KILL cr); + format %{ + "cmpxchg_acq $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::xword, /*acquire*/ true, /*release*/ true, + /*weak*/ false, $res$$Register); + %} + ins_pipe(pipe_slow); +%} + instruct weakCompareAndSwapB(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ match(Set res (WeakCompareAndSwapB mem (Binary oldval newval))); ins_cost(2 * VOLATILE_REF_COST); effect(KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgb $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" %} ins_encode %{ @@ -8447,7 +8609,7 @@ instruct weakCompareAndSwapS(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne ins_cost(2 * VOLATILE_REF_COST); effect(KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgs $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" %} ins_encode %{ @@ -8464,7 +8626,7 @@ instruct weakCompareAndSwapI(iRegINoSp res, indirect mem, iRegI oldval, iRegI ne ins_cost(2 * VOLATILE_REF_COST); effect(KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgw $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval" "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" %} ins_encode %{ @@ -8498,7 +8660,7 @@ instruct weakCompareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN ne ins_cost(2 * VOLATILE_REF_COST); effect(KILL cr); format %{ - "cmpxchg $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval" + "cmpxchgw $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval" "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" %} ins_encode %{ @@ -8527,11 +8689,120 @@ instruct weakCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP ne ins_pipe(pipe_slow); %} +instruct weakCompareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (WeakCompareAndSwapB mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(KILL cr); + format %{ + "cmpxchgb_acq $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval" + "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::byte, /*acquire*/ true, /*release*/ true, + /*weak*/ true, noreg); + __ csetw($res$$Register, Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapSAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (WeakCompareAndSwapS mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(KILL cr); + format %{ + "cmpxchgs_acq $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval" + "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::halfword, /*acquire*/ true, /*release*/ true, + /*weak*/ true, noreg); + __ csetw($res$$Register, Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapIAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (WeakCompareAndSwapI mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(KILL cr); + format %{ + "cmpxchgw_acq $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval" + "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::word, /*acquire*/ true, /*release*/ true, + /*weak*/ true, noreg); + __ csetw($res$$Register, Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (WeakCompareAndSwapL mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(KILL cr); + format %{ + "cmpxchg_acq $res = $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval" + "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::xword, /*acquire*/ true, /*release*/ true, + /*weak*/ true, noreg); + __ csetw($res$$Register, Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(KILL cr); + format %{ + "cmpxchgw_acq $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval" + "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::word, /*acquire*/ true, /*release*/ true, + /*weak*/ true, noreg); + __ csetw($res$$Register, Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + ins_cost(VOLATILE_REF_COST); + effect(KILL cr); + format %{ + "cmpxchg_acq $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval" + "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + ins_encode %{ + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, + Assembler::xword, /*acquire*/ true, /*release*/ true, + /*weak*/ true, noreg); + __ csetw($res$$Register, Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + // END This section of the file is automatically generated. Do not edit -------------- // --------------------------------------------------------------------- instruct get_and_setI(indirect mem, iRegI newv, iRegINoSp prev) %{ match(Set prev (GetAndSetI mem newv)); + ins_cost(2 * VOLATILE_REF_COST); format %{ "atomic_xchgw $prev, $newv, [$mem]" %} ins_encode %{ __ atomic_xchgw($prev$$Register, $newv$$Register, as_Register($mem$$base)); @@ -8541,6 +8812,7 @@ instruct get_and_setI(indirect mem, iRegI newv, iRegINoSp prev) %{ instruct get_and_setL(indirect mem, iRegL newv, iRegLNoSp prev) %{ match(Set prev (GetAndSetL mem newv)); + ins_cost(2 * VOLATILE_REF_COST); format %{ "atomic_xchg $prev, $newv, [$mem]" %} ins_encode %{ __ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base)); @@ -8550,6 +8822,7 @@ instruct get_and_setL(indirect mem, iRegL newv, iRegLNoSp prev) %{ instruct get_and_setN(indirect mem, iRegN newv, iRegINoSp prev) %{ match(Set prev (GetAndSetN mem newv)); + ins_cost(2 * VOLATILE_REF_COST); format %{ "atomic_xchgw $prev, $newv, [$mem]" %} ins_encode %{ __ atomic_xchgw($prev$$Register, $newv$$Register, as_Register($mem$$base)); @@ -8559,6 +8832,7 @@ instruct get_and_setN(indirect mem, iRegN newv, iRegINoSp prev) %{ instruct get_and_setP(indirect mem, iRegP newv, iRegPNoSp prev) %{ match(Set prev (GetAndSetP mem newv)); + ins_cost(2 * VOLATILE_REF_COST); format %{ "atomic_xchg $prev, $newv, [$mem]" %} ins_encode %{ __ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base)); @@ -8566,10 +8840,54 @@ instruct get_and_setP(indirect mem, iRegP newv, iRegPNoSp prev) %{ ins_pipe(pipe_serial); %} +instruct get_and_setIAcq(indirect mem, iRegI newv, iRegINoSp prev) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set prev (GetAndSetI mem newv)); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchgw_acq $prev, $newv, [$mem]" %} + ins_encode %{ + __ atomic_xchgalw($prev$$Register, $newv$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_setLAcq(indirect mem, iRegL newv, iRegLNoSp prev) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set prev (GetAndSetL mem newv)); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchg_acq $prev, $newv, [$mem]" %} + ins_encode %{ + __ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_setNAcq(indirect mem, iRegN newv, iRegINoSp prev) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set prev (GetAndSetN mem newv)); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchgw_acq $prev, $newv, [$mem]" %} + ins_encode %{ + __ atomic_xchgalw($prev$$Register, $newv$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_setPAcq(indirect mem, iRegP newv, iRegPNoSp prev) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set prev (GetAndSetP mem newv)); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchg_acq $prev, $newv, [$mem]" %} + ins_encode %{ + __ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + instruct get_and_addL(indirect mem, iRegLNoSp newval, iRegL incr) %{ match(Set newval (GetAndAddL mem incr)); - ins_cost(INSN_COST * 10); + ins_cost(2 * VOLATILE_REF_COST + 1); format %{ "get_and_addL $newval, [$mem], $incr" %} ins_encode %{ __ atomic_add($newval$$Register, $incr$$Register, as_Register($mem$$base)); @@ -8580,7 +8898,7 @@ instruct get_and_addL(indirect mem, iRegLNoSp newval, iRegL incr) %{ instruct get_and_addL_no_res(indirect mem, Universe dummy, iRegL incr) %{ predicate(n->as_LoadStore()->result_not_used()); match(Set dummy (GetAndAddL mem incr)); - ins_cost(INSN_COST * 9); + ins_cost(2 * VOLATILE_REF_COST); format %{ "get_and_addL [$mem], $incr" %} ins_encode %{ __ atomic_add(noreg, $incr$$Register, as_Register($mem$$base)); @@ -8590,7 +8908,7 @@ instruct get_and_addL_no_res(indirect mem, Universe dummy, iRegL incr) %{ instruct get_and_addLi(indirect mem, iRegLNoSp newval, immLAddSub incr) %{ match(Set newval (GetAndAddL mem incr)); - ins_cost(INSN_COST * 10); + ins_cost(2 * VOLATILE_REF_COST + 1); format %{ "get_and_addL $newval, [$mem], $incr" %} ins_encode %{ __ atomic_add($newval$$Register, $incr$$constant, as_Register($mem$$base)); @@ -8601,7 +8919,7 @@ instruct get_and_addLi(indirect mem, iRegLNoSp newval, immLAddSub incr) %{ instruct get_and_addLi_no_res(indirect mem, Universe dummy, immLAddSub incr) %{ predicate(n->as_LoadStore()->result_not_used()); match(Set dummy (GetAndAddL mem incr)); - ins_cost(INSN_COST * 9); + ins_cost(2 * VOLATILE_REF_COST); format %{ "get_and_addL [$mem], $incr" %} ins_encode %{ __ atomic_add(noreg, $incr$$constant, as_Register($mem$$base)); @@ -8611,7 +8929,7 @@ instruct get_and_addLi_no_res(indirect mem, Universe dummy, immLAddSub incr) %{ instruct get_and_addI(indirect mem, iRegINoSp newval, iRegIorL2I incr) %{ match(Set newval (GetAndAddI mem incr)); - ins_cost(INSN_COST * 10); + ins_cost(2 * VOLATILE_REF_COST + 1); format %{ "get_and_addI $newval, [$mem], $incr" %} ins_encode %{ __ atomic_addw($newval$$Register, $incr$$Register, as_Register($mem$$base)); @@ -8622,7 +8940,7 @@ instruct get_and_addI(indirect mem, iRegINoSp newval, iRegIorL2I incr) %{ instruct get_and_addI_no_res(indirect mem, Universe dummy, iRegIorL2I incr) %{ predicate(n->as_LoadStore()->result_not_used()); match(Set dummy (GetAndAddI mem incr)); - ins_cost(INSN_COST * 9); + ins_cost(2 * VOLATILE_REF_COST); format %{ "get_and_addI [$mem], $incr" %} ins_encode %{ __ atomic_addw(noreg, $incr$$Register, as_Register($mem$$base)); @@ -8632,7 +8950,7 @@ instruct get_and_addI_no_res(indirect mem, Universe dummy, iRegIorL2I incr) %{ instruct get_and_addIi(indirect mem, iRegINoSp newval, immIAddSub incr) %{ match(Set newval (GetAndAddI mem incr)); - ins_cost(INSN_COST * 10); + ins_cost(2 * VOLATILE_REF_COST + 1); format %{ "get_and_addI $newval, [$mem], $incr" %} ins_encode %{ __ atomic_addw($newval$$Register, $incr$$constant, as_Register($mem$$base)); @@ -8643,7 +8961,7 @@ instruct get_and_addIi(indirect mem, iRegINoSp newval, immIAddSub incr) %{ instruct get_and_addIi_no_res(indirect mem, Universe dummy, immIAddSub incr) %{ predicate(n->as_LoadStore()->result_not_used()); match(Set dummy (GetAndAddI mem incr)); - ins_cost(INSN_COST * 9); + ins_cost(2 * VOLATILE_REF_COST); format %{ "get_and_addI [$mem], $incr" %} ins_encode %{ __ atomic_addw(noreg, $incr$$constant, as_Register($mem$$base)); @@ -8651,6 +8969,94 @@ instruct get_and_addIi_no_res(indirect mem, Universe dummy, immIAddSub incr) %{ ins_pipe(pipe_serial); %} +instruct get_and_addLAcq(indirect mem, iRegLNoSp newval, iRegL incr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set newval (GetAndAddL mem incr)); + ins_cost(VOLATILE_REF_COST + 1); + format %{ "get_and_addL_acq $newval, [$mem], $incr" %} + ins_encode %{ + __ atomic_addal($newval$$Register, $incr$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addL_no_resAcq(indirect mem, Universe dummy, iRegL incr) %{ + predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n)); + match(Set dummy (GetAndAddL mem incr)); + ins_cost(VOLATILE_REF_COST); + format %{ "get_and_addL_acq [$mem], $incr" %} + ins_encode %{ + __ atomic_addal(noreg, $incr$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addLiAcq(indirect mem, iRegLNoSp newval, immLAddSub incr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set newval (GetAndAddL mem incr)); + ins_cost(VOLATILE_REF_COST + 1); + format %{ "get_and_addL_acq $newval, [$mem], $incr" %} + ins_encode %{ + __ atomic_addal($newval$$Register, $incr$$constant, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addLi_no_resAcq(indirect mem, Universe dummy, immLAddSub incr) %{ + predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n)); + match(Set dummy (GetAndAddL mem incr)); + ins_cost(VOLATILE_REF_COST); + format %{ "get_and_addL_acq [$mem], $incr" %} + ins_encode %{ + __ atomic_addal(noreg, $incr$$constant, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addIAcq(indirect mem, iRegINoSp newval, iRegIorL2I incr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set newval (GetAndAddI mem incr)); + ins_cost(VOLATILE_REF_COST + 1); + format %{ "get_and_addI_acq $newval, [$mem], $incr" %} + ins_encode %{ + __ atomic_addalw($newval$$Register, $incr$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addI_no_resAcq(indirect mem, Universe dummy, iRegIorL2I incr) %{ + predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n)); + match(Set dummy (GetAndAddI mem incr)); + ins_cost(VOLATILE_REF_COST); + format %{ "get_and_addI_acq [$mem], $incr" %} + ins_encode %{ + __ atomic_addalw(noreg, $incr$$Register, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addIiAcq(indirect mem, iRegINoSp newval, immIAddSub incr) %{ + predicate(needs_acquiring_load_exclusive(n)); + match(Set newval (GetAndAddI mem incr)); + ins_cost(VOLATILE_REF_COST + 1); + format %{ "get_and_addI_acq $newval, [$mem], $incr" %} + ins_encode %{ + __ atomic_addalw($newval$$Register, $incr$$constant, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + +instruct get_and_addIi_no_resAcq(indirect mem, Universe dummy, immIAddSub incr) %{ + predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n)); + match(Set dummy (GetAndAddI mem incr)); + ins_cost(VOLATILE_REF_COST); + format %{ "get_and_addI_acq [$mem], $incr" %} + ins_encode %{ + __ atomic_addalw(noreg, $incr$$constant, as_Register($mem$$base)); + %} + ins_pipe(pipe_serial); +%} + // Manifest a CmpL result in an integer register. // (src1 < src2) ? -1 : ((src1 > src2) ? 1 : 0) instruct cmpL3_reg_reg(iRegINoSp dst, iRegL src1, iRegL src2, rFlagsReg flags) diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAE.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAE.java new file mode 100644 index 00000000000..b9d431c7b02 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAE.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileCAE +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + public volatile long f_long = 0; + public volatile byte f_byte = 0; + public volatile short f_short = 0; + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_obj_field; + public static Field f_long_field; + public static Field f_byte_field; + public static Field f_short_field; + public static long f_int_off; + public static long f_obj_off; + public static long f_long_off; + public static long f_byte_off; + public static long f_short_off; + + static { + try { + f_int_field = TestUnsafeVolatileCAE.class.getField("f_int"); + f_obj_field = TestUnsafeVolatileCAE.class.getField("f_obj"); + f_long_field = TestUnsafeVolatileCAE.class.getField("f_long"); + f_byte_field = TestUnsafeVolatileCAE.class.getField("f_byte"); + f_short_field = TestUnsafeVolatileCAE.class.getField("f_short"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_obj_off = unsafe.objectFieldOffset(f_obj_field); + f_long_off = unsafe.objectFieldOffset(f_long_field); + f_byte_off = unsafe.objectFieldOffset(f_byte_field); + f_short_off = unsafe.objectFieldOffset(f_short_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileCAE t = new TestUnsafeVolatileCAE(); + for (int i = 0; i < 100_000; i++) { + t.f_int = -1; + int res = t.testInt(-1, i); + if (res != -1 || t.f_int != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_long = -1; + long res = t.testLong(-1, i); + if (res != -1 || t.f_long != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_byte = -1; + byte i_b = (byte)i; + byte res = t.testByte((byte)-1, i_b); + if (res != (byte)-1 || t.f_byte != i_b) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_short = -1; + short i_s = (short)i; + short res = t.testShort((byte)-1, i_s); + if (res != (short)-1 || t.f_short != i_s) { + throw new RuntimeException("bad result!"); + } + } + Integer minusOne = Integer.valueOf(-1); + for (int i = 0; i < 100_000; i++) { + t.f_obj = minusOne; + Object res = t.testObj(minusOne, Integer.valueOf(i)); + if (res != minusOne || t.f_obj != i) { + throw new RuntimeException("bad result!"); + } + } + } + + public int testInt(int x, int i) + { + return unsafe.compareAndExchangeInt(this, f_int_off, x, i); + } + + public Object testObj(Object x, Object o) + { + return unsafe.compareAndExchangeReference(this, f_obj_off, x, o); + } + public long testLong(long x, long i) + { + return unsafe.compareAndExchangeLong(this, f_long_off, x, i); + } + + public byte testByte(byte x, byte i) + { + return unsafe.compareAndExchangeByte(this, f_byte_off, x, i); + } + + public short testShort(short x, short i) + { + return unsafe.compareAndExchangeShort(this, f_short_off, x, i); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java index 197b9475fd5..70af0ebf671 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java @@ -30,19 +30,34 @@ class TestUnsafeVolatileCAS { public volatile int f_int = 0; public volatile Integer f_obj = Integer.valueOf(0); + public volatile long f_long = 0; + public volatile byte f_byte = 0; + public volatile short f_short = 0; public static Unsafe unsafe = Unsafe.getUnsafe(); public static Field f_int_field; public static Field f_obj_field; + public static Field f_long_field; + public static Field f_byte_field; + public static Field f_short_field; public static long f_int_off; public static long f_obj_off; + public static long f_long_off; + public static long f_byte_off; + public static long f_short_off; static { try { f_int_field = TestUnsafeVolatileCAS.class.getField("f_int"); f_obj_field = TestUnsafeVolatileCAS.class.getField("f_obj"); + f_long_field = TestUnsafeVolatileCAS.class.getField("f_long"); + f_byte_field = TestUnsafeVolatileCAS.class.getField("f_byte"); + f_short_field = TestUnsafeVolatileCAS.class.getField("f_short"); f_int_off = unsafe.objectFieldOffset(f_int_field); f_obj_off = unsafe.objectFieldOffset(f_obj_field); + f_long_off = unsafe.objectFieldOffset(f_long_field); + f_byte_off = unsafe.objectFieldOffset(f_byte_field); + f_short_off = unsafe.objectFieldOffset(f_short_field); } catch (Exception e) { System.out.println("reflection failed " + e); e.printStackTrace(); @@ -59,6 +74,29 @@ class TestUnsafeVolatileCAS throw new RuntimeException("bad result!"); } } + for (int i = 0; i < 100_000; i++) { + t.f_long = -1; + t.testLong(-1, i); + if (t.f_long != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_byte = -1; + byte i_b = (byte)i; + t.testByte((byte)-1, i_b); + if (t.f_byte != i_b) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_short = -1; + short i_s = (short)i; + t.testShort((byte)-1, i_s); + if (t.f_short != i_s) { + throw new RuntimeException("bad result!"); + } + } Integer minusOne = Integer.valueOf(-1); for (int i = 0; i < 100_000; i++) { t.f_obj = minusOne; @@ -68,6 +106,7 @@ class TestUnsafeVolatileCAS } } } + public void testInt(int x, int i) { unsafe.compareAndSetInt(this, f_int_off, x, i); @@ -77,4 +116,19 @@ class TestUnsafeVolatileCAS { unsafe.compareAndSetReference(this, f_obj_off, x, o); } + + public void testLong(long x, long i) + { + unsafe.compareAndSetLong(this, f_long_off, x, i); + } + + public void testByte(byte x, byte i) + { + unsafe.compareAndSetByte(this, f_byte_off, x, i); + } + + public void testShort(short x, short i) + { + unsafe.compareAndSetShort(this, f_short_off, x, i); + } } diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAA.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAA.java new file mode 100644 index 00000000000..25a8af804de --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAA.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileGAA +{ + public volatile int f_int = -1; + public volatile long f_long = -1; + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_long_field; + public static long f_int_off; + public static long f_long_off; + + static { + try { + f_int_field = TestUnsafeVolatileGAA.class.getField("f_int"); + f_long_field = TestUnsafeVolatileGAA.class.getField("f_long"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_long_off = unsafe.objectFieldOffset(f_long_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileGAA t = new TestUnsafeVolatileGAA(); + for (int i = 0; i < 100_000; i++) { + if (t.testInt() != i-1) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + if (t.testLong() != i-1) { + throw new RuntimeException("bad result!"); + } + } + } + + public int testInt() + { + return unsafe.getAndAddInt(this, f_int_off, 1); + } + + public long testLong() + { + return unsafe.getAndAddLong(this, f_long_off, 1); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAS.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAS.java new file mode 100644 index 00000000000..3767757e1f5 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAS.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileGAS +{ + public volatile int f_int = -1; + public volatile Integer f_obj = Integer.valueOf(-1); + public volatile long f_long = -1; + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_obj_field; + public static Field f_long_field; + public static long f_int_off; + public static long f_obj_off; + public static long f_long_off; + + static { + try { + f_int_field = TestUnsafeVolatileGAS.class.getField("f_int"); + f_obj_field = TestUnsafeVolatileGAS.class.getField("f_obj"); + f_long_field = TestUnsafeVolatileGAS.class.getField("f_long"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_obj_off = unsafe.objectFieldOffset(f_obj_field); + f_long_off = unsafe.objectFieldOffset(f_long_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileGAS t = new TestUnsafeVolatileGAS(); + for (int i = 0; i < 100_000; i++) { + if (t.testInt(i) != i-1) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + if (t.testLong(i) != i-1) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + if ((Integer)t.testObj(Integer.valueOf(i)) != i-1) { + throw new RuntimeException("bad result!"); + } + } + } + + public int testInt(int i) + { + return unsafe.getAndSetInt(this, f_int_off, i); + } + + public Object testObj(Object o) + { + return unsafe.getAndSetReference(this, f_obj_off, o); + } + public long testLong(long i) + { + return unsafe.getAndSetLong(this, f_long_off, i); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileWeakCAS.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileWeakCAS.java new file mode 100644 index 00000000000..54d3a8ad34c --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileWeakCAS.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileWeakCAS +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + public volatile long f_long = 0; + public volatile byte f_byte = 0; + public volatile short f_short = 0; + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_obj_field; + public static Field f_long_field; + public static Field f_byte_field; + public static Field f_short_field; + public static long f_int_off; + public static long f_obj_off; + public static long f_long_off; + public static long f_byte_off; + public static long f_short_off; + + static { + try { + f_int_field = TestUnsafeVolatileWeakCAS.class.getField("f_int"); + f_obj_field = TestUnsafeVolatileWeakCAS.class.getField("f_obj"); + f_long_field = TestUnsafeVolatileWeakCAS.class.getField("f_long"); + f_byte_field = TestUnsafeVolatileWeakCAS.class.getField("f_byte"); + f_short_field = TestUnsafeVolatileWeakCAS.class.getField("f_short"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_obj_off = unsafe.objectFieldOffset(f_obj_field); + f_long_off = unsafe.objectFieldOffset(f_long_field); + f_byte_off = unsafe.objectFieldOffset(f_byte_field); + f_short_off = unsafe.objectFieldOffset(f_short_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileWeakCAS t = new TestUnsafeVolatileWeakCAS(); + for (int i = 0; i < 100_000; i++) { + t.f_int = -1; + if (t.testInt(-1, i)) { + if (t.f_int != i) { + throw new RuntimeException("bad result!"); + } + } + } + for (int i = 0; i < 100_000; i++) { + t.f_long = -1; + if (t.testLong(-1, i)) { + if (t.f_long != i) { + throw new RuntimeException("bad result!"); + } + } + } + for (int i = 0; i < 100_000; i++) { + t.f_byte = -1; + byte i_b = (byte)i; + if (t.testByte((byte)-1, i_b)) { + if (t.f_byte != i_b) { + throw new RuntimeException("bad result!"); + } + } + } + for (int i = 0; i < 100_000; i++) { + t.f_short = -1; + short i_s = (short)i; + if (t.testShort((byte)-1, i_s)) { + if (t.f_short != i_s) { + throw new RuntimeException("bad result!"); + } + } + } + Integer minusOne = Integer.valueOf(-1); + for (int i = 0; i < 100_000; i++) { + t.f_obj = minusOne; + if (t.testObj(minusOne, Integer.valueOf(i))) { + if (t.f_obj != i) { + throw new RuntimeException("bad result!"); + } + } + } + } + + public boolean testInt(int x, int i) + { + return unsafe.weakCompareAndSetInt(this, f_int_off, x, i); + } + + public boolean testObj(Object x, Object o) + { + return unsafe.weakCompareAndSetReference(this, f_obj_off, x, o); + } + + public boolean testLong(long x, long i) + { + return unsafe.weakCompareAndSetLong(this, f_long_off, x, i); + } + + public boolean testByte(byte x, byte i) + { + return unsafe.weakCompareAndSetByte(this, f_byte_off, x, i); + } + + public boolean testShort(short x, short i) + { + return unsafe.weakCompareAndSetShort(this, f_short_off, x, i); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java index f8c90d2c500..72e0312518e 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java @@ -31,7 +31,10 @@ * TestVolatileStore, * TestUnsafeVolatileLoad, * TestUnsafeVolatileStore, - * TestUnsafeVolatileCAS} + * TestUnsafeVolatileCAS, + * TestUnsafeVolatileWeakCAS, + * TestUnsafeVolatileCAE, + * TestUnsafeVolatileGAS} * and in {G1, * CMS, * CMSCondMark, @@ -43,13 +46,16 @@ package compiler.c2.aarch64; import java.util.List; +import java.util.ListIterator; import java.util.Iterator; +import java.util.regex.Pattern; import java.io.*; import jdk.test.lib.Asserts; import jdk.test.lib.compiler.InMemoryJavaCompiler; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; +import sun.hotspot.WhiteBox; // runner class that spawns a new JVM to exercises a combination of // volatile MemOp and GC. The ops are compiled with the dmb --> @@ -68,28 +74,28 @@ public class TestVolatiles { // i.e. GC type plus GC conifg switch(testType) { case "G1": - argcount = 8; + argcount = 9; procArgs = new String[argcount]; procArgs[argcount - 2] = "-XX:+UseG1GC"; break; case "Parallel": - argcount = 8; + argcount = 9; procArgs = new String[argcount]; procArgs[argcount - 2] = "-XX:+UseParallelGC"; break; case "Serial": - argcount = 8; + argcount = 9; procArgs = new String[argcount]; procArgs[argcount - 2] = "-XX:+UseSerialGC"; break; case "CMS": - argcount = 9 ; + argcount = 10; procArgs = new String[argcount]; procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC"; procArgs[argcount - 2] = "-XX:-UseCondCardMark"; break; case "CMSCondMark": - argcount = 9 ; + argcount = 10; procArgs = new String[argcount]; procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC"; procArgs[argcount - 2] = "-XX:+UseCondCardMark"; @@ -106,14 +112,34 @@ public class TestVolatiles { // disable the transform. procArgs[0] = "-XX:-UseBarriersForVolatile"; + procArgs[1] = "-XX:+UseCompressedOops"; - procArgs[1] = "-XX:-TieredCompilation"; - procArgs[2] = "-XX:+PrintOptoAssembly"; - procArgs[3] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*"; - procArgs[4] = "--add-exports"; - procArgs[5] = "java.base/jdk.internal.misc=ALL-UNNAMED"; + procArgs[2] = "-XX:-TieredCompilation"; + procArgs[3] = "-XX:+PrintOptoAssembly"; + procArgs[4] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*"; + procArgs[5] = "--add-exports"; + procArgs[6] = "java.base/jdk.internal.misc=ALL-UNNAMED"; procArgs[argcount - 1] = fullclassname; + runtest(classname, testType, false, true, procArgs); + // rerun the test class without the transform applied and + // check the alternative generation is as expected + + procArgs[0] = "-XX:+UseBarriersForVolatile"; + runtest(classname, testType, true, true, procArgs); + + if (!classname.equals("TestUnsafeVolatileGAA")) { + procArgs[0] = "-XX:-UseBarriersForVolatile"; + procArgs[1] = "-XX:-UseCompressedOops"; + runtest(classname, testType, false, false, procArgs); + + procArgs[0] = "-XX:+UseBarriersForVolatile"; + runtest(classname, testType, true, false, procArgs); + } + } + + + public void runtest(String classname, String testType, boolean useBarriersForVolatile, boolean useCompressedOops, String[] procArgs) throws Throwable { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -125,23 +151,7 @@ public class TestVolatiles { // appropriate to test class, test type and whether transform // was applied - checkoutput(output, classname, testType, false); - - // rerun the test class without the transform applied and - // check the alternative generation is as expected - - procArgs[0] = "-XX:+UseBarriersForVolatile"; - - pb = ProcessTools.createJavaProcessBuilder(procArgs); - output = new OutputAnalyzer(pb.start()); - - output.stderrShouldBeEmptyIgnoreVMWarnings(); - output.stdoutShouldNotBeEmpty(); - output.shouldHaveExitValue(0); - - // again check the output for the correct asm sequence - - checkoutput(output, classname, testType, true); + checkoutput(output, classname, testType, useBarriersForVolatile, useCompressedOops); } // skip through output returning a line containing the desireed @@ -150,7 +160,7 @@ public class TestVolatiles { { while (iter.hasNext()) { String nextLine = iter.next(); - if (nextLine.contains(substring)) { + if (nextLine.matches(".*" + substring + ".*")) { return nextLine; } } @@ -163,7 +173,7 @@ public class TestVolatiles { // n.b. the spawned JVM's output is included in the exception // message to make it easeir to identify what is missing. - private void checkCompile(Iterator iter, String methodname, String[] expected, OutputAnalyzer output) + private boolean checkCompile(Iterator iter, String methodname, String[] expected, OutputAnalyzer output, boolean do_throw) { // trace call to allow eyeball check of what we are checking against System.out.println("checkCompile(" + methodname + ","); @@ -176,30 +186,43 @@ public class TestVolatiles { System.out.println(" })"); // look for the start of an opto assembly print block - String match = skipTo(iter, "{method}"); + String match = skipTo(iter, Pattern.quote("{method}")); if (match == null) { - throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput()); + if (do_throw) { + throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput()); + } + return false; } // check the compiled method name is right - match = skipTo(iter, "- name:"); + match = skipTo(iter, Pattern.quote("- name:")); if (match == null) { - throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput()); + if (do_throw) { + throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput()); + } + return false; } if (!match.contains(methodname)) { - throw new RuntimeException("Wrong method " + match + "!\n -- expecting " + methodname + "\n\n" + output.getOutput()); + if (do_throw) { + throw new RuntimeException("Wrong method " + match + "!\n -- expecting " + methodname + "\n\n" + output.getOutput()); + } + return false; } // make sure we can match each expected term in order for (String s : expected) { match = skipTo(iter, s); if (match == null) { - throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput()); + if (do_throw) { + throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput()); + } + return false; } } + return true; } // check for expected asm output from a volatile load - private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable { Iterator iter = output.asLines().listIterator(); @@ -211,7 +234,7 @@ public class TestVolatiles { if (!useBarriersForVolatile) { matches = new String[] { "ldarw", - "membar_acquire (elided)", + "membar_acquire \\(elided\\)", "ret" }; } else { @@ -223,15 +246,30 @@ public class TestVolatiles { }; } - checkCompile(iter, "testInt", matches, output); + checkCompile(iter, "testInt", matches, output, true); - checkCompile(iter, "testObj", matches, output) ; + if (!useBarriersForVolatile) { + matches = new String[] { + useCompressedOops ? "ldarw?" : "ldar", + "membar_acquire \\(elided\\)", + "ret" + }; + } else { + matches = new String[] { + useCompressedOops ? "ldrw?" : "ldr", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, "testObj", matches, output, true); } // check for expected asm output from a volatile store - private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable { Iterator iter = output.asLines().listIterator(); @@ -241,9 +279,9 @@ public class TestVolatiles { if (!useBarriersForVolatile) { // this is the sequence of instructions for all cases matches = new String[] { - "membar_release (elided)", + "membar_release \\(elided\\)", "stlrw", - "membar_volatile (elided)", + "membar_volatile \\(elided\\)", "ret" }; } else { @@ -258,7 +296,7 @@ public class TestVolatiles { }; } - checkCompile(iter, "testInt", matches, output); + checkCompile(iter, "testInt", matches, output, true); // object stores will be as above except for when the GC // introduces barriers for card marking @@ -268,9 +306,9 @@ public class TestVolatiles { default: // this is the basic sequence of instructions matches = new String[] { - "membar_release (elided)", - "stlrw", - "membar_volatile (elided)", + "membar_release \\(elided\\)", + useCompressedOops ? "stlrw?" : "stlr", + "membar_volatile \\(elided\\)", "ret" }; break; @@ -278,12 +316,12 @@ public class TestVolatiles { // a card mark volatile barrier should be generated // before the card mark strb matches = new String[] { - "membar_release (elided)", - "stlrw", + "membar_release \\(elided\\)", + useCompressedOops ? "stlrw?" : "stlr", "membar_volatile", "dmb ish", "strb", - "membar_volatile (elided)", + "membar_volatile \\(elided\\)", "ret" }; break; @@ -292,13 +330,13 @@ public class TestVolatiles { // before the card mark strb from the StoreCM and the // storestore barrier from the StoreCM should be elided matches = new String[] { - "membar_release (elided)", - "stlrw", + "membar_release \\(elided\\)", + useCompressedOops ? "stlrw?" : "stlr", "membar_volatile", "dmb ish", - "storestore (elided)", + "storestore \\(elided\\)", "strb", - "membar_volatile (elided)", + "membar_volatile \\(elided\\)", "ret" }; break; @@ -308,12 +346,12 @@ public class TestVolatiles { // storestore barrier from the StoreCM should be // generated as "dmb ishst" matches = new String[] { - "membar_release (elided)", - "stlrw", + "membar_release \\(elided\\)", + useCompressedOops ? "stlrw?" : "stlr", "storestore", "dmb ishst", "strb", - "membar_volatile (elided)", + "membar_volatile \\(elided\\)", "ret" }; break; @@ -325,7 +363,7 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "strw", + useCompressedOops ? "strw?" : "str", "membar_volatile", "dmb ish", "ret" @@ -337,7 +375,7 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "strw", + useCompressedOops ? "strw?" : "str", "membar_volatile", "dmb ish", "strb", @@ -353,10 +391,10 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "strw", + useCompressedOops ? "strw?" : "str", "membar_volatile", "dmb ish", - "storestore (elided)", + "storestore \\(elided\\)", "strb", "membar_volatile", "dmb ish", @@ -371,7 +409,7 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "strw", + useCompressedOops ? "strw?" : "str", "storestore", "dmb ishst", "strb", @@ -383,40 +421,48 @@ public class TestVolatiles { } } - checkCompile(iter, "testObj", matches, output); + checkCompile(iter, "testObj", matches, output, true); } // check for expected asm output from a volatile cas - private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable { Iterator iter = output.asLines().listIterator(); String[] matches; + String[][] tests = { + { "testInt", "cmpxchgw" }, + { "testLong", "cmpxchg" }, + { "testByte", "cmpxchgb" }, + { "testShort", "cmpxchgs" }, + }; - // non object stores are straightforward - if (!useBarriersForVolatile) { - // this is the sequence of instructions for all cases - matches = new String[] { - "membar_release (elided)", - "cmpxchgw_acq", - "membar_acquire (elided)", - "ret" - }; - } else { - // this is the alternative sequence of instructions - matches = new String[] { - "membar_release", - "dmb ish", - "cmpxchgw", - "membar_acquire", - "dmb ish", - "ret" - }; + for (String[] test : tests) { + // non object stores are straightforward + if (!useBarriersForVolatile) { + // this is the sequence of instructions for all cases + matches = new String[] { + "membar_release \\(elided\\)", + test[1] + "_acq", + "membar_acquire \\(elided\\)", + "ret" + }; + } else { + // this is the alternative sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + test[1] + " ", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, test[0], matches, output, true); } - checkCompile(iter, "testInt", matches, output); - // object stores will be as above except for when the GC // introduces barriers for card marking @@ -425,10 +471,10 @@ public class TestVolatiles { default: // this is the basic sequence of instructions matches = new String[] { - "membar_release (elided)", - "cmpxchgw_acq", + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", "strb", - "membar_acquire (elided)", + "membar_acquire \\(elided\\)", "ret" }; break; @@ -436,12 +482,12 @@ public class TestVolatiles { // a card mark volatile barrier should be generated // before the card mark strb matches = new String[] { - "membar_release (elided)", - "cmpxchgw_acq", + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", "membar_volatile", "dmb ish", "strb", - "membar_acquire (elided)", + "membar_acquire \\(elided\\)", "ret" }; break; @@ -450,13 +496,13 @@ public class TestVolatiles { // before the card mark strb from the StoreCM and the // storestore barrier from the StoreCM should be elided matches = new String[] { - "membar_release (elided)", - "cmpxchgw_acq", + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", "membar_volatile", "dmb ish", - "storestore (elided)", + "storestore \\(elided\\)", "strb", - "membar_acquire (elided)", + "membar_acquire \\(elided\\)", "ret" }; break; @@ -465,12 +511,12 @@ public class TestVolatiles { // before the card mark strb from the StoreCM and the // storestore barrier from the StoreCM should be elided matches = new String[] { - "membar_release (elided)", - "cmpxchgw_acq", + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", "storestore", "dmb ishst", "strb", - "membar_acquire (elided)", + "membar_acquire \\(elided\\)", "ret" }; break; @@ -482,7 +528,7 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "cmpxchgw", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", "membar_acquire", "dmb ish", "ret" @@ -494,7 +540,7 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "cmpxchgw", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", "membar_volatile", "dmb ish", "strb", @@ -510,10 +556,10 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "cmpxchgw", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", "membar_volatile", "dmb ish", - "storestore (elided)", + "storestore \\(elided\\)", "strb", "membar_acquire", "dmb ish", @@ -528,7 +574,7 @@ public class TestVolatiles { matches = new String[] { "membar_release", "dmb ish", - "cmpxchgw", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", "storestore", "dmb ishst", "strb", @@ -540,12 +586,391 @@ public class TestVolatiles { } } - checkCompile(iter, "testObj", matches, output); + checkCompile(iter, "testObj", matches, output, true); + } + + private void checkcae(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable + { + ListIterator iter = output.asLines().listIterator(); + + String[] matches; + String[][] tests = { + { "testInt", "cmpxchgw" }, + { "testLong", "cmpxchg" }, + { "testByte", "cmpxchgb" }, + { "testShort", "cmpxchgs" }, + }; + + for (String[] test : tests) { + // non object stores are straightforward + if (!useBarriersForVolatile) { + // this is the sequence of instructions for all cases + matches = new String[] { + "membar_release \\(elided\\)", + test[1] + "_acq", + "membar_acquire \\(elided\\)", + "ret" + }; + } else { + // this is the alternative sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + test[1] + " ", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, test[0], matches, output, true); + } + + // object stores will be as above except for when the GC + // introduces barriers for card marking + + if (!useBarriersForVolatile) { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release \\(elided\\)", + "strb", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", + "membar_acquire \\(elided\\)", + "ret" + }; + + // card marking store may be scheduled before or after + // the cmpxchg so try both sequences. + int idx = iter.nextIndex(); + if (!checkCompile(iter, "testObj", matches, output, false)) { + iter = output.asLines().listIterator(idx); + + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + + checkCompile(iter, "testObj", matches, output, true); + } + return; + + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", + "membar_volatile", + "dmb ish", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", + "membar_volatile", + "dmb ish", + "storestore \\(elided\\)", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", + "storestore", + "dmb ishst", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + } + } else { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", + "membar_volatile", + "dmb ish", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", + "membar_volatile", + "dmb ish", + "storestore \\(elided\\)", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be generated + // as "dmb ishst" + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "cmpxchgw? " : "cmpxchg ", + "storestore", + "dmb ishst", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + } + } + + checkCompile(iter, "testObj", matches, output, true); + } + + private void checkgas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable + { + Iterator iter = output.asLines().listIterator(); + + String[] matches; + String[][] tests = { + { "testInt", "atomic_xchgw" }, + { "testLong", "atomic_xchg" }, + }; + + for (String[] test : tests) { + // non object stores are straightforward + if (!useBarriersForVolatile) { + // this is the sequence of instructions for all cases + matches = new String[] { + "membar_release \\(elided\\)", + test[1] + "_acq", + "membar_acquire \\(elided\\)", + "ret" + }; + } else { + // this is the alternative sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + test[1] + " ", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, test[0], matches, output, true); + } + + // object stores will be as above except for when the GC + // introduces barriers for card marking + + if (!useBarriersForVolatile) { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", + "membar_volatile", + "dmb ish", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", + "membar_volatile", + "dmb ish", + "storestore \\(elided\\)", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", + "storestore", + "dmb ishst", + "strb", + "membar_acquire \\(elided\\)", + "ret" + }; + break; + } + } else { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ", + "membar_volatile", + "dmb ish", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ", + "membar_volatile", + "dmb ish", + "storestore \\(elided\\)", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be generated + // as "dmb ishst" + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ", + "storestore", + "dmb ishst", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + } + } + + checkCompile(iter, "testObj", matches, output, true); + } + + private void checkgaa(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + { + Iterator iter = output.asLines().listIterator(); + + String[] matches; + String[][] tests = { + { "testInt", "get_and_addI" }, + { "testLong", "get_and_addL" }, + }; + + for (String[] test : tests) { + // non object stores are straightforward + if (!useBarriersForVolatile) { + // this is the sequence of instructions for all cases + matches = new String[] { + "membar_release \\(elided\\)", + test[1] + "_acq", + "membar_acquire \\(elided\\)", + "ret" + }; + } else { + // this is the alternative sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + test[1] + " ", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, test[0], matches, output, true); + } + } // perform a check appropriate to the classname - private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile) throws Throwable + private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable { // trace call to allow eyeball check of what is being checked System.out.println("checkoutput(" + @@ -556,19 +981,29 @@ public class TestVolatiles { switch (classname) { case "TestVolatileLoad": - checkload(output, testType, useBarriersForVolatile); + checkload(output, testType, useBarriersForVolatile, useCompressedOops); break; case "TestVolatileStore": - checkstore(output, testType, useBarriersForVolatile); + checkstore(output, testType, useBarriersForVolatile, useCompressedOops); break; case "TestUnsafeVolatileLoad": - checkload(output, testType, useBarriersForVolatile); + checkload(output, testType, useBarriersForVolatile, useCompressedOops); break; case "TestUnsafeVolatileStore": - checkstore(output, testType, useBarriersForVolatile); + checkstore(output, testType, useBarriersForVolatile, useCompressedOops); break; case "TestUnsafeVolatileCAS": - checkcas(output, testType, useBarriersForVolatile); + case "TestUnsafeVolatileWeakCAS": + checkcas(output, testType, useBarriersForVolatile, useCompressedOops); + break; + case "TestUnsafeVolatileCAE": + checkcae(output, testType, useBarriersForVolatile, useCompressedOops); + break; + case "TestUnsafeVolatileGAS": + checkgas(output, testType, useBarriersForVolatile, useCompressedOops); + break; + case "TestUnsafeVolatileGAA": + checkgaa(output, testType, useBarriersForVolatile); break; } } diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java index e65250ff579..3397fda6a4d 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java @@ -38,6 +38,9 @@ * compiler.c2.aarch64.TestVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileCAS + * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS + * compiler.c2.aarch64.TestUnsafeVolatileCAE + * compiler.c2.aarch64.TestUnsafeVolatileGAS * * @run driver compiler.c2.aarch64.TestVolatilesCMS * TestVolatileLoad CMS @@ -53,6 +56,15 @@ * * @run driver compiler.c2.aarch64.TestVolatilesCMS * TestUnsafeVolatileCAS CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestUnsafeVolatileWeakCAS CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestUnsafeVolatileCAE CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestUnsafeVolatileGAS CMS */ package compiler.c2.aarch64; diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java index b0931b1631b..29ce80493c8 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java @@ -38,6 +38,9 @@ * compiler.c2.aarch64.TestVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileCAS + * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS + * compiler.c2.aarch64.TestUnsafeVolatileCAE + * compiler.c2.aarch64.TestUnsafeVolatileGAS * * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark * TestVolatileLoad CMSCondMark @@ -53,6 +56,15 @@ * * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark * TestUnsafeVolatileCAS CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestUnsafeVolatileWeakCAS CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestUnsafeVolatileCAE CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestUnsafeVolatileGAS CMSCondMark */ package compiler.c2.aarch64; diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java index 658e5ad9d39..88d747e44d9 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java @@ -38,6 +38,10 @@ * compiler.c2.aarch64.TestVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileCAS + * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS + * compiler.c2.aarch64.TestUnsafeVolatileCAE + * compiler.c2.aarch64.TestUnsafeVolatileGAS + * compiler.c2.aarch64.TestUnsafeVolatileGAA * * @run driver compiler.c2.aarch64.TestVolatilesG1 * TestVolatileLoad G1 @@ -53,8 +57,21 @@ * * @run driver compiler.c2.aarch64.TestVolatilesG1 * TestUnsafeVolatileCAS G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileWeakCAS G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileCAE G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileGAS G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileGAA G1 */ + package compiler.c2.aarch64; public class TestVolatilesG1 { diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java index 8f6a78efcf2..c3203c0b276 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java @@ -38,6 +38,9 @@ * compiler.c2.aarch64.TestVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileCAS + * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS + * compiler.c2.aarch64.TestUnsafeVolatileCAE + * compiler.c2.aarch64.TestUnsafeVolatileGAS * * @run driver compiler.c2.aarch64.TestVolatilesParallel * TestVolatileLoad Parallel @@ -53,6 +56,15 @@ * * @run driver compiler.c2.aarch64.TestVolatilesParallel * TestUnsafeVolatileCAS Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestUnsafeVolatileWeakCAS Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestUnsafeVolatileCAE Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestUnsafeVolatileGAS Parallel */ package compiler.c2.aarch64; diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java index 470ae748e12..c04c3594497 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java @@ -38,6 +38,9 @@ * compiler.c2.aarch64.TestVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileStore * compiler.c2.aarch64.TestUnsafeVolatileCAS + * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS + * compiler.c2.aarch64.TestUnsafeVolatileCAE + * compiler.c2.aarch64.TestUnsafeVolatileGAS * * @run driver compiler.c2.aarch64.TestVolatilesSerial * TestVolatileLoad Serial @@ -53,6 +56,15 @@ * * @run driver compiler.c2.aarch64.TestVolatilesSerial * TestUnsafeVolatileCAS Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestUnsafeVolatileWeakCAS Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestUnsafeVolatileCAE Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestUnsafeVolatileGAS Serial */ package compiler.c2.aarch64; From 364f0784a494caba74a888ccc0190b5e194d05d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Mon, 5 Nov 2018 12:36:23 +0100 Subject: [PATCH 052/128] 8212585: Clean up CompiledMethod::oops_reloc_begin() Reviewed-by: kvn, pliden --- src/hotspot/share/code/compiledMethod.cpp | 14 ++++++++++++++ src/hotspot/share/gc/z/zNMethodTable.cpp | 21 +-------------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index 4a160f7fe7e..6e98ed22add 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -293,6 +293,20 @@ address CompiledMethod::oops_reloc_begin() const { // first few bytes. If an oop in the old code was there, that oop // should not get GC'd. Skip the first few bytes of oops on // not-entrant methods. + if (frame_complete_offset() != CodeOffsets::frame_never_safe && + code_begin() + frame_complete_offset() > + verified_entry_point() + NativeJump::instruction_size) + { + // If we have a frame_complete_offset after the native jump, then there + // is no point trying to look for oops before that. This is a requirement + // for being allowed to scan oops concurrently. + return code_begin() + frame_complete_offset(); + } + + // It is not safe to read oops concurrently using entry barriers, if their + // location depend on whether the nmethod is entrant or not. + assert(BarrierSet::barrier_set()->barrier_set_nmethod() == NULL, "Not safe oop scan"); + address low_boundary = verified_entry_point(); if (!is_in_use() && is_nmethod()) { low_boundary += NativeJump::instruction_size; diff --git a/src/hotspot/share/gc/z/zNMethodTable.cpp b/src/hotspot/share/gc/z/zNMethodTable.cpp index 5c409c1ddc0..7a307f2ba52 100644 --- a/src/hotspot/share/gc/z/zNMethodTable.cpp +++ b/src/hotspot/share/gc/z/zNMethodTable.cpp @@ -51,7 +51,6 @@ public: nmethod* method() const; size_t immediate_oops_count() const; oop** immediate_oops_begin() const; - oop** immediate_oops_begin_safe() const; oop** immediate_oops_end() const; }; @@ -95,24 +94,6 @@ oop** ZNMethodWithImmediateOops::immediate_oops_begin() const { return (oop**)((uintptr_t)this + header_size()); } -oop** ZNMethodWithImmediateOops::immediate_oops_begin_safe() const { - // Non-entrant nmethods have a jump instruction patched into the beginning - // of the verified entry point, which could have overwritten an immediate - // oop. If so, make sure we skip over that oop. - if (_nm->is_not_entrant()) { - oop* const first_immediate_oop = *immediate_oops_begin(); - oop* const safe_begin = (oop*)(_nm->verified_entry_point() + NativeJump::instruction_size); - if (first_immediate_oop < safe_begin) { - // First immediate oop overwritten, skip it - return immediate_oops_begin() + 1; - } - } - - // First immediate oop not overwritten - return immediate_oops_begin(); -} - - oop** ZNMethodWithImmediateOops::immediate_oops_end() const { return immediate_oops_begin() + immediate_oops_count(); } @@ -429,7 +410,7 @@ void ZNMethodTable::entry_oops_do(ZNMethodTableEntry entry, OopClosure* cl) { if (entry.immediate_oops()) { // Process immediate oops const ZNMethodWithImmediateOops* const nmi = entry.method_with_immediate_oops(); - oop** const begin = nmi->immediate_oops_begin_safe(); + oop** const begin = nmi->immediate_oops_begin(); oop** const end = nmi->immediate_oops_end(); for (oop** p = begin; p < end; p++) { cl->do_oop(*p); From 3798a62adb960d44bc1164189a2be81311fffe41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Mon, 5 Nov 2018 12:36:23 +0100 Subject: [PATCH 053/128] 8212996: Use AS_NO_KEEPALIVE when accessing dead java.lang.invoke.CallSites during nmethod unloading Reviewed-by: coleenp, pliden --- src/hotspot/share/classfile/javaClasses.cpp | 4 ++-- src/hotspot/share/classfile/javaClasses.hpp | 2 +- src/hotspot/share/code/nmethod.cpp | 8 ++++++++ src/hotspot/share/code/nmethod.hpp | 2 +- src/hotspot/share/prims/methodHandles.cpp | 6 +++--- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index dfa094b3f76..63f16bbb51b 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -3732,10 +3732,10 @@ void java_lang_invoke_CallSite::serialize_offsets(SerializeClosure* f) { } #endif -oop java_lang_invoke_CallSite::context(oop call_site) { +oop java_lang_invoke_CallSite::context_no_keepalive(oop call_site) { assert(java_lang_invoke_CallSite::is_instance(call_site), ""); - oop dep_oop = call_site->obj_field(_context_offset); + oop dep_oop = call_site->obj_field_access(_context_offset); return dep_oop; } diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp index bae23364f3a..7c0d8e56218 100644 --- a/src/hotspot/share/classfile/javaClasses.hpp +++ b/src/hotspot/share/classfile/javaClasses.hpp @@ -1186,7 +1186,7 @@ public: static void set_target( oop site, oop target); static void set_target_volatile( oop site, oop target); - static oop context(oop site); + static oop context_no_keepalive(oop site); // Testers static bool is_subclass(Klass* klass) { diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 1d5ef75e107..839ca5b35b8 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -42,6 +42,7 @@ #include "logging/logStream.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "oops/access.inline.hpp" #include "oops/method.inline.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" @@ -1334,6 +1335,13 @@ void nmethod::flush() { CodeCache::free(this); } +oop nmethod::oop_at(int index) const { + if (index == 0) { + return NULL; + } + return NativeAccess::oop_load(oop_addr_at(index)); +} + // // Notify all classes this nmethod is dependent on that it is no // longer dependent. This should only be called in two situations. diff --git a/src/hotspot/share/code/nmethod.hpp b/src/hotspot/share/code/nmethod.hpp index 053b70b4576..67bc38e5b64 100644 --- a/src/hotspot/share/code/nmethod.hpp +++ b/src/hotspot/share/code/nmethod.hpp @@ -365,7 +365,7 @@ class nmethod : public CompiledMethod { // Support for oops in scopes and relocs: // Note: index 0 is reserved for null. - oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); } + oop oop_at(int index) const; oop* oop_addr_at(int index) const { // for GC // relocation indexes are biased by 1 (because 0 is reserved) assert(index > 0 && index <= oops_count(), "must be a valid non-zero index"); diff --git a/src/hotspot/share/prims/methodHandles.cpp b/src/hotspot/share/prims/methodHandles.cpp index 7a04f42da2b..a519d19f181 100644 --- a/src/hotspot/share/prims/methodHandles.cpp +++ b/src/hotspot/share/prims/methodHandles.cpp @@ -1075,7 +1075,7 @@ static bool safe_to_expunge() { void MethodHandles::add_dependent_nmethod(oop call_site, nmethod* nm) { assert_locked_or_safepoint(CodeCache_lock); - oop context = java_lang_invoke_CallSite::context(call_site); + oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site); DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); // Try to purge stale entries on updates. // Since GC doesn't clean dependency contexts rooted at CallSiteContext objects, @@ -1088,7 +1088,7 @@ void MethodHandles::add_dependent_nmethod(oop call_site, nmethod* nm) { void MethodHandles::remove_dependent_nmethod(oop call_site, nmethod* nm) { assert_locked_or_safepoint(CodeCache_lock); - oop context = java_lang_invoke_CallSite::context(call_site); + oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site); DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); deps.remove_dependent_nmethod(nm, /*expunge_stale_entries=*/safe_to_expunge()); } @@ -1102,7 +1102,7 @@ void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) { NoSafepointVerifier nsv; MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); - oop context = java_lang_invoke_CallSite::context(call_site()); + oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site()); DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); marked = deps.mark_dependent_nmethods(changes); } From b9aa498282f73f46a1e6d5ee9b022129e83c8284 Mon Sep 17 00:00:00 2001 From: Lutz Schmidt Date: Mon, 5 Nov 2018 14:02:04 +0100 Subject: [PATCH 054/128] 8213196: [ppc] [s390]: prepare code for gcc7.3.1 warning (int-in-bool-context) Reviewed-by: mdoerr, stuefe --- src/hotspot/cpu/ppc/ppc.ad | 36 ++++++++++++++++++------------------ src/hotspot/cpu/s390/s390.ad | 8 ++++---- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index e6755ef40e4..e267671aed2 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -7629,7 +7629,7 @@ instruct cmovI_reg(cmpOp cmp, flagsRegSrc crx, iRegIdst dst, iRegIsrc src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_reg(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7642,7 +7642,7 @@ instruct cmovI_imm(cmpOp cmp, flagsRegSrc crx, iRegIdst dst, immI16 src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_imm(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7675,7 +7675,7 @@ instruct cmovL_reg(cmpOp cmp, flagsRegSrc crx, iRegLdst dst, iRegLsrc src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_reg(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7688,7 +7688,7 @@ instruct cmovL_imm(cmpOp cmp, flagsRegSrc crx, iRegLdst dst, immL16 src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_imm(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7722,7 +7722,7 @@ instruct cmovN_reg(cmpOp cmp, flagsRegSrc crx, iRegNdst dst, iRegNsrc src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_reg(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7735,7 +7735,7 @@ instruct cmovN_imm(cmpOp cmp, flagsRegSrc crx, iRegNdst dst, immN_0 src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_imm(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7768,7 +7768,7 @@ instruct cmovP_reg(cmpOp cmp, flagsRegSrc crx, iRegPdst dst, iRegP_N2P src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_reg(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7781,7 +7781,7 @@ instruct cmovP_imm(cmpOp cmp, flagsRegSrc crx, iRegPdst dst, immP_0 src) %{ format %{ "CMOVE $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_imm(dst, crx, src, cmp) ); ins_pipe(pipe_class_default); %} @@ -7794,7 +7794,7 @@ instruct cmovF_reg(cmpOp cmp, flagsRegSrc crx, regF dst, regF src) %{ format %{ "CMOVEF $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); + size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8)); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmovef); Label done; @@ -7816,7 +7816,7 @@ instruct cmovD_reg(cmpOp cmp, flagsRegSrc crx, regD dst, regD src) %{ format %{ "CMOVEF $cmp, $crx, $dst, $src\n\t" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); + size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8)); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmovef); Label done; @@ -9277,7 +9277,7 @@ instruct cmovI_bne_negI_reg(iRegIdst dst, flagsRegSrc crx, iRegIsrc src1) %{ format %{ "CMOVE $dst, neg($src1), $crx" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); + size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8)); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmove); Label done; @@ -9340,7 +9340,7 @@ instruct cmovL_bne_negL_reg(iRegLdst dst, flagsRegSrc crx, iRegLsrc src1) %{ format %{ "CMOVE $dst, neg($src1), $crx" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); + size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8)); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmove); Label done; @@ -11114,7 +11114,7 @@ instruct cmovI_bso_stackSlotL(iRegIdst dst, flagsRegSrc crx, stackSlotL src) %{ format %{ "cmovI $crx, $dst, $src" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); + size((false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8)); ins_encode( enc_cmove_bso_stackSlotL(dst, crx, src) ); ins_pipe(pipe_class_default); %} @@ -11128,7 +11128,7 @@ instruct cmovI_bso_reg(iRegIdst dst, flagsRegSrc crx, regD src) %{ format %{ "cmovI $crx, $dst, $src" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); + size((false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8)); ins_encode( enc_cmove_bso_reg(dst, crx, src) ); ins_pipe(pipe_class_default); %} @@ -11383,7 +11383,7 @@ instruct cmovL_bso_stackSlotL(iRegLdst dst, flagsRegSrc crx, stackSlotL src) %{ format %{ "cmovL $crx, $dst, $src" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_bso_stackSlotL(dst, crx, src) ); ins_pipe(pipe_class_default); %} @@ -11397,7 +11397,7 @@ instruct cmovL_bso_reg(iRegLdst dst, flagsRegSrc crx, regD src) %{ format %{ "cmovL $crx, $dst, $src" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8); + size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8)); ins_encode( enc_cmove_bso_reg(dst, crx, src) ); ins_pipe(pipe_class_default); %} @@ -11890,7 +11890,7 @@ instruct cmovI_conIvalueMinus1_conIvalue1(iRegIdst dst, flagsRegSrc crx) %{ format %{ "cmovI $crx, $dst, -1, 0, +1" %} // Worst case is branch + move + branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORTInsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 20 : 16); + size((false /* TODO: PPC PORTInsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 20 : 16)); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmove); Label done; @@ -12229,7 +12229,7 @@ instruct cmov_bns_less(flagsReg crx) %{ format %{ "cmov $crx" %} // Worst case is branch + move + stop, no stop without scheduler. - size(false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 16 : 12); + size((false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 16 : 12)); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmovecr); Label done; diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index e20bcd8bf0a..89cceced371 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -6480,7 +6480,7 @@ instruct divModI_reg_divmod(roddRegI dst1src1, revenRegI dst2, noOdd_iRegI src2, match(DivModI dst1src1 src2); effect(KILL cr); ins_cost(2 * DEFAULT_COST + BRANCH_COST); - size(VM_Version::has_CompareBranch() ? 24 : 26); + size((VM_Version::has_CompareBranch() ? 24 : 26)); format %{ "DIVMODI ($dst1src1, $dst2) $src2" %} ins_encode %{ Register d1s1 = $dst1src1$$Register; @@ -6513,7 +6513,7 @@ instruct divI_reg_reg(roddRegI dst, iRegI src1, noOdd_iRegI src2, revenRegI tmp, match(Set dst (DivI src1 src2)); effect(KILL tmp, KILL cr); ins_cost(2 * DEFAULT_COST + BRANCH_COST); - size(VM_Version::has_CompareBranch() ? 20 : 22); + size((VM_Version::has_CompareBranch() ? 20 : 22)); format %{ "DIV_checked $dst, $src1,$src2\t # treats special case 0x80../-1" %} ins_encode %{ Register a = $src1$$Register; @@ -6564,7 +6564,7 @@ instruct divModL_reg_divmod(roddRegL dst1src1, revenRegL dst2, iRegL src2, flags match(DivModL dst1src1 src2); effect(KILL cr); ins_cost(2 * DEFAULT_COST + BRANCH_COST); - size(VM_Version::has_CompareBranch() ? 22 : 24); + size((VM_Version::has_CompareBranch() ? 22 : 24)); format %{ "DIVMODL ($dst1src1, $dst2) $src2" %} ins_encode %{ Register d1s1 = $dst1src1$$Register; @@ -6594,7 +6594,7 @@ instruct divL_reg_reg(roddRegL dst, iRegL src, revenRegL tmp, flagsReg cr) %{ match(Set dst (DivL dst src)); effect(KILL tmp, KILL cr); ins_cost(2 * DEFAULT_COST + BRANCH_COST); - size(VM_Version::has_CompareBranch() ? 18 : 20); + size((VM_Version::has_CompareBranch() ? 18 : 20)); format %{ "DIVG_checked $dst, $src\t # long, treats special case 0x80../-1" %} ins_encode %{ Register b = $src$$Register; From 34d2e1ea70fec42627a98f3e5b283c2a49a22d1d Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Mon, 5 Nov 2018 14:40:16 +0100 Subject: [PATCH 055/128] 8209960: -Xlog:jfr* doesn't work with the JFR Reviewed-by: mgronlun --- src/hotspot/share/jfr/dcmd/jfrDcmds.cpp | 6 ++++++ .../share/classes/jdk/jfr/internal/JVMSupport.java | 3 +++ .../share/classes/jdk/jfr/internal/LogTag.java | 10 +--------- .../share/classes/jdk/jfr/internal/Logger.java | 13 +++++++++++-- .../classes/jdk/jfr/internal/MetadataReader.java | 2 +- .../classes/jdk/jfr/internal/PlatformRecording.java | 2 +- .../classes/jdk/jfr/internal/SettingsManager.java | 6 +++--- .../share/classes/jdk/jfr/internal/Type.java | 4 ++-- .../share/classes/jdk/jfr/internal/TypeLibrary.java | 4 ++-- .../classes/jdk/jfr/internal/dcmd/DCmdCheck.java | 2 +- .../jdk/jfr/internal/dcmd/DCmdConfigure.java | 2 +- .../classes/jdk/jfr/internal/dcmd/DCmdDump.java | 2 +- .../classes/jdk/jfr/internal/dcmd/DCmdStart.java | 8 +------- .../classes/jdk/jfr/internal/dcmd/DCmdStop.java | 2 +- 14 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp index 1c2f5726c45..994f804182c 100644 --- a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp +++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp @@ -446,6 +446,12 @@ void JfrStartFlightRecordingDCmd::execute(DCmdSource source, TRAPS) { assert(element != NULL, "invariant"); JfrJavaSupport::set_array_element(settings, element, i, CHECK); } + } else { + settings = JfrJavaSupport::new_string_array(1, CHECK); + assert(settings != NULL, "invariant"); + jobject element = JfrJavaSupport::new_string("default", CHECK); + assert(element != NULL, "invariant"); + JfrJavaSupport::set_array_element(settings, element, 0, CHECK); } static const char klass[] = "jdk/jfr/internal/dcmd/DCmdStart"; diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java index 1fd0a967591..a7d25b6b37a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java @@ -81,4 +81,7 @@ public final class JVMSupport { public static boolean isNotAvailable() { return notAvailable; } + + public static void tryToInitializeJVM() { + } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java index 53b0e3592c3..195d6b06adc 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java @@ -80,19 +80,11 @@ public enum LogTag { JFR_DCMD(10); /* set from native side */ - private volatile int tagSetLevel = 100; // prevent logging if JVM log system has not been initialized + volatile int tagSetLevel = 100; // prevent logging if JVM log system has not been initialized final int id; LogTag(int tagId) { id = tagId; } - - public boolean shouldLog(int level) { - return level >= tagSetLevel; - } - - public boolean shouldLog(LogLevel logLevel) { - return shouldLog(logLevel.level); - } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java index ab4bf421705..3a53f1e3fc6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java @@ -35,15 +35,20 @@ import java.util.function.Supplier; public final class Logger { private final static int MAX_SIZE = 10000; + static { + // This will try to initialize the JVM logging system + JVMSupport.tryToInitializeJVM(); + } + public static void log(LogTag logTag, LogLevel logLevel, String message) { - if (logTag.shouldLog(logLevel.level)) { + if (shouldLog(logTag, logLevel)) { logInternal(logTag, logLevel, message); } } public static void log(LogTag logTag, LogLevel logLevel, Supplier messageSupplier) { - if (logTag.shouldLog(logLevel.level)) { + if (shouldLog(logTag, logLevel)) { logInternal(logTag, logLevel, messageSupplier.get()); } } @@ -55,4 +60,8 @@ public final class Logger { JVM.log(logTag.id, logLevel.level, message.substring(0, MAX_SIZE)); } } + + public static boolean shouldLog(LogTag tag, LogLevel level) { + return level.level >= tag.tagSetLevel; + } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java index 79b9709e645..481e3700dc6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java @@ -79,7 +79,7 @@ final class MetadataReader { descriptor.gmtOffset = time.attribute(MetadataDescriptor.ATTRIBUTE_GMT_OFFSET, 1); descriptor.locale = time.attribute(MetadataDescriptor.ATTRIBUTE_LOCALE, ""); descriptor.root = root; - if (LogTag.JFR_SYSTEM_PARSER.shouldLog(LogLevel.TRACE.level)) { + if (Logger.shouldLog(LogTag.JFR_SYSTEM_PARSER, LogLevel.TRACE)) { List ts = new ArrayList<>(types.values()); Collections.sort(ts, (x,y) -> x.getName().compareTo(y.getName())); for (Type t : ts) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java index 98cfc52ca88..80d88bdd7f4 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java @@ -453,7 +453,7 @@ public final class PlatformRecording implements AutoCloseable { } private void setSettings(Map settings, boolean update) { - if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level) && update) { + if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO) && update) { TreeMap ordered = new TreeMap<>(settings); Logger.log(LogTag.JFR_SETTING, LogLevel.INFO, "New settings for recording \"" + getName() + "\" (" + getId() + ")"); for (Map.Entry entry : ordered.entrySet()) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java index 9d0ee0abf06..29602bc9259 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java @@ -139,7 +139,7 @@ final class SettingsManager { ec.disable(); } } else { - if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level)) { + if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) { Collections.sort(eventControls, (x,y) -> x.getEventType().getName().compareTo(y.getEventType().getName())); } for (EventControl ec : eventControls) { @@ -224,7 +224,7 @@ final class SettingsManager { if (values != null) { control.apply(values); String after = control.getLastValue(); - if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level)) { + if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) { if (Utils.isSettingVisible(control, ec.getEventType().hasEventHook())) { if (values.size() > 1) { StringJoiner sj = new StringJoiner(", ", "{", "}"); @@ -241,7 +241,7 @@ final class SettingsManager { } } else { control.setDefault(); - if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level)) { + if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) { String message = " " + settingName + "=\"" + control.getLastValue() + "\""; Logger.log(LogTag.JFR_SETTING, LogLevel.INFO, message); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java index 188c07592ac..967e7e28274 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java @@ -271,7 +271,7 @@ public class Type implements Comparable { } void log(String action, LogTag logTag, LogLevel level) { - if (logTag.shouldLog(level.level) && !isSimpleType()) { + if (Logger.shouldLog(logTag, level) && !isSimpleType()) { Logger.log(logTag, LogLevel.TRACE, action + " " + typeText() + " " + getLogName() + " {"); for (ValueDescriptor v : getFields()) { String array = v.isArray() ? "[]" : ""; @@ -279,7 +279,7 @@ public class Type implements Comparable { } Logger.log(logTag, LogLevel.TRACE, "}"); } else { - if (logTag.shouldLog(LogLevel.INFO.level) && !isSimpleType()) { + if (Logger.shouldLog(logTag, LogLevel.INFO) && !isSimpleType()) { Logger.log(logTag, LogLevel.INFO, action + " " + typeText() + " " + getLogName()); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java index 218d94d07a3..a511bd03198 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java @@ -68,7 +68,7 @@ public final class TypeLibrary { private TypeLibrary(List jvmTypes) { visitReachable(jvmTypes, t -> !types.containsKey(t.getId()), t -> types.put(t.getId(), t)); - if (LogTag.JFR_SYSTEM_METADATA.shouldLog(LogLevel.INFO.level)) { + if (Logger.shouldLog(LogTag.JFR_SYSTEM_METADATA, LogLevel.INFO)) { Stream s = types.values().stream().sorted((x, y) -> Long.compare(x.getId(), y.getId())); s.forEach(t -> t.log("Added", LogTag.JFR_SYSTEM_METADATA, LogLevel.INFO)); } @@ -422,7 +422,7 @@ public final class TypeLibrary { for (Type type : types.values()) { if (type.getRemove() && !Type.isDefinedByJVM(type.getId())) { removeIds.add(type.getId()); - if (LogTag.JFR_METADATA.shouldLog(LogLevel.TRACE.level)) { + if (Logger.shouldLog(LogTag.JFR_METADATA, LogLevel.TRACE)) { Logger.log(LogTag.JFR_METADATA, LogLevel.TRACE, "Removed obsolete metadata " + type.getName()); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java index 78f4076fd2f..7204ec12223 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java @@ -63,7 +63,7 @@ final class DCmdCheck extends AbstractDCmd { } private void executeInternal(String name, Boolean verbose) throws DCmdException { - if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) { Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdCheck: name=" + name + ", verbose=" + verbose); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java index 079ede60da8..87b300219dd 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java @@ -70,7 +70,7 @@ final class DCmdConfigure extends AbstractDCmd { Boolean sampleThreads ) throws DCmdException { - if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) { Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdConfigure: repositorypath=" + repositoryPath + ", dumppath=" + dumpPath + ", stackdepth=" + stackDepth + diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java index 28593e7aa4d..0fad0c5b8c1 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java @@ -70,7 +70,7 @@ final class DCmdDump extends AbstractDCmd { * @throws DCmdException if the dump could not be completed */ public String execute(String name, String filename, Long maxAge, Long maxSize, String begin, String end, Boolean pathToGcRoots) throws DCmdException { - if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) { Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdDump: name=" + name + ", filename=" + filename + diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java index bc7c6154d50..0be1165b8af 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java @@ -81,7 +81,7 @@ final class DCmdStart extends AbstractDCmd { */ @SuppressWarnings("resource") public String execute(String name, String[] settings, Long delay, Long duration, Boolean disk, String path, Long maxAge, Long maxSize, Boolean dumpOnExit, Boolean pathToGcRoots) throws DCmdException { - if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) { Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdStart: name=" + name + ", settings=" + Arrays.asList(settings) + ", delay=" + delay + @@ -106,13 +106,7 @@ final class DCmdStart extends AbstractDCmd { throw new DCmdException("Filename can only be set for a time bound recording or if dumponexit=true. Set duration/dumponexit or omit filename."); } - Map s = new HashMap<>(); - - if (settings == null || settings.length == 0) { - settings = new String[] { "default" }; - } - for (String configName : settings) { try { s.putAll(JFC.createKnown(configName).getSettings()); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java index 361447861f5..71490b1915a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java @@ -56,7 +56,7 @@ final class DCmdStop extends AbstractDCmd { * @throws DCmdException if recording could not be stopped */ public String execute(String name, String filename) throws DCmdException { - if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) { Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdStart: name=" + name + ", filename=" + filename); } From 8e57878e0a4e2bd891279643e84081145c9121c9 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 5 Nov 2018 13:13:29 +0100 Subject: [PATCH 056/128] 8212610: Fix handling of memory in PhaseIdealLoop::clone_loop_predicates() Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/loopPredicate.cpp | 85 ++++++++++++++++++++++-- src/hotspot/share/opto/loopnode.hpp | 4 ++ 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 6dc2f53da12..dafa978aade 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -301,6 +301,73 @@ Node* PhaseIdealLoop::clone_loop_predicates(Node* old_entry, Node* new_entry, bo return clone_loop_predicates(old_entry, new_entry, clone_limit_check, this, &this->_igvn); } +void PhaseIdealLoop::clone_loop_predicates_fix_mem(ProjNode* dom_proj , ProjNode* proj, + PhaseIdealLoop* loop_phase, + PhaseIterGVN* igvn) { + Compile* C = NULL; + if (loop_phase != NULL) { + igvn = &loop_phase->igvn(); + } + C = igvn->C; + ProjNode* other_dom_proj = dom_proj->in(0)->as_Multi()->proj_out(1-dom_proj->_con); + Node* dom_r = other_dom_proj->unique_ctrl_out(); + if (dom_r->is_Region()) { + assert(dom_r->unique_ctrl_out()->is_Call(), "unc expected"); + ProjNode* other_proj = proj->in(0)->as_Multi()->proj_out(1-proj->_con); + Node* r = other_proj->unique_ctrl_out(); + assert(r->is_Region() && r->unique_ctrl_out()->is_Call(), "cloned predicate should have caused region to be added"); + for (DUIterator_Fast imax, i = dom_r->fast_outs(imax); i < imax; i++) { + Node* dom_use = dom_r->fast_out(i); + if (dom_use->is_Phi() && dom_use->bottom_type() == Type::MEMORY) { + assert(dom_use->in(0) == dom_r, ""); + Node* phi = NULL; + for (DUIterator_Fast jmax, j = r->fast_outs(jmax); j < jmax; j++) { + Node* use = r->fast_out(j); + if (use->is_Phi() && use->bottom_type() == Type::MEMORY && + use->adr_type() == dom_use->adr_type()) { + assert(use->in(0) == r, ""); + assert(phi == NULL, "only one phi"); + phi = use; + } + } + if (phi == NULL) { + const TypePtr* adr_type = dom_use->adr_type(); + int alias = C->get_alias_index(adr_type); + Node* call = r->unique_ctrl_out(); + Node* mem = call->in(TypeFunc::Memory); + MergeMemNode* mm = NULL; + if (mem->is_MergeMem()) { + mm = mem->clone()->as_MergeMem(); + if (adr_type == TypePtr::BOTTOM) { + mem = mem->as_MergeMem()->base_memory(); + } else { + mem = mem->as_MergeMem()->memory_at(alias); + } + } else { + mm = MergeMemNode::make(mem); + } + phi = PhiNode::make(r, mem, Type::MEMORY, adr_type); + if (adr_type == TypePtr::BOTTOM) { + mm->set_base_memory(phi); + } else { + mm->set_memory_at(alias, phi); + } + if (loop_phase != NULL) { + loop_phase->register_new_node(mm, r); + loop_phase->register_new_node(phi, r); + } else { + igvn->register_new_node_with_optimizer(mm); + igvn->register_new_node_with_optimizer(phi); + } + igvn->replace_input_of(call, TypeFunc::Memory, mm); + } + igvn->replace_input_of(phi, r->find_edge(other_proj), dom_use->in(dom_r->find_edge(other_dom_proj))); + } + } + } +} + + // Clone loop predicates to cloned loops (peeled, unswitched, split_if). Node* PhaseIdealLoop::clone_loop_predicates(Node* old_entry, Node* new_entry, bool clone_limit_check, @@ -333,14 +400,24 @@ Node* PhaseIdealLoop::clone_loop_predicates(Node* old_entry, Node* new_entry, } if (predicate_proj != NULL) { // right pattern that can be used by loop predication // clone predicate - new_entry = clone_predicate(predicate_proj, new_entry, - Deoptimization::Reason_predicate, - loop_phase, igvn); - assert(new_entry != NULL && new_entry->is_Proj(), "IfTrue or IfFalse after clone predicate"); + ProjNode* proj = clone_predicate(predicate_proj, new_entry, + Deoptimization::Reason_predicate, + loop_phase, igvn); + assert(proj != NULL, "IfTrue or IfFalse after clone predicate"); + new_entry = proj; if (TraceLoopPredicate) { tty->print("Loop Predicate cloned: "); debug_only( new_entry->in(0)->dump(); ); } + if (profile_predicate_proj != NULL) { + // A node that produces memory may be out of loop and depend on + // a profiled predicates. In that case the memory state at the + // end of profiled predicates and at the end of predicates are + // not the same. The cloned predicates are dominated by the + // profiled predicates but may have the wrong memory + // state. Update it. + clone_loop_predicates_fix_mem(profile_predicate_proj, proj, loop_phase, igvn); + } } if (profile_predicate_proj != NULL) { // right pattern that can be used by loop predication // clone predicate diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index e45b14c133e..d51a7a7ec2a 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1081,6 +1081,10 @@ public: PhaseIdealLoop* loop_phase, PhaseIterGVN* igvn); + static void clone_loop_predicates_fix_mem(ProjNode* dom_proj , ProjNode* proj, + PhaseIdealLoop* loop_phase, + PhaseIterGVN* igvn); + static Node* clone_loop_predicates(Node* old_entry, Node* new_entry, bool clone_limit_check, PhaseIdealLoop* loop_phase, From c8cb3978ba965e354b274f10c856d8d81fc989d0 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 5 Nov 2018 09:10:57 -0800 Subject: [PATCH 057/128] 8213227: Update jib src excludes to filter webrev and Jreg directories Reviewed-by: dholmes, tbell, ihse --- make/conf/jib-profiles.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 3fc6a234860..b08a9cdaaaf 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -201,10 +201,15 @@ var getJibProfiles = function (input) { data.configuration_make_arg = "CONF_NAME="; // Exclude list to use when Jib creates a source bundle - data.src_bundle_excludes = "./build .build webrev* */webrev* */*/webrev* */*/*/webrev* .hg */.hg */*/.hg */*/*/.hg"; + data.src_bundle_excludes = [ + "build", "{,**/}webrev*", "{,**/}.hg", "{,**/}JTwork", "{,**/}JTreport", + "{,**/}.git" + ]; // Include list to use when creating a minimal jib source bundle which // contains just the jib configuration files. - data.conf_bundle_includes = "*/conf/jib-profiles.* make/autoconf/version-numbers" + data.conf_bundle_includes = [ + "make/autoconf/version-numbers", + ]; // Define some common values var common = getJibProfilesCommon(input, data); From 9b4393268d2a82c1b8d8652a2da992a285f810e4 Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Mon, 5 Nov 2018 12:27:38 -0600 Subject: [PATCH 058/128] 8208519: Remove rehashable hashtable Removed RehashableHashtable class Reviewed-by: iklam, ccheung --- src/hotspot/share/utilities/hashtable.cpp | 63 ----------------------- src/hotspot/share/utilities/hashtable.hpp | 34 ------------ 2 files changed, 97 deletions(-) diff --git a/src/hotspot/share/utilities/hashtable.cpp b/src/hotspot/share/utilities/hashtable.cpp index 956de8ba084..03e81c95191 100644 --- a/src/hotspot/share/utilities/hashtable.cpp +++ b/src/hotspot/share/utilities/hashtable.cpp @@ -97,67 +97,6 @@ template HashtableEntry* Hashtable::allocate_n return entry; } -// Check to see if the hashtable is unbalanced. The caller set a flag to -// rehash at the next safepoint. If this bucket is 60 times greater than the -// expected average bucket length, it's an unbalanced hashtable. -// This is somewhat an arbitrary heuristic but if one bucket gets to -// rehash_count which is currently 100, there's probably something wrong. - -template bool RehashableHashtable::check_rehash_table(int count) { - assert(this->table_size() != 0, "underflow"); - if (count > (((double)this->number_of_entries()/(double)this->table_size())*rehash_multiple)) { - // Set a flag for the next safepoint, which should be at some guaranteed - // safepoint interval. - return true; - } - return false; -} - -// Create a new table and using alternate hash code, populate the new table -// with the existing elements. This can be used to change the hash code -// and could in the future change the size of the table. - -template void RehashableHashtable::move_to(RehashableHashtable* new_table) { - - // Initialize the global seed for hashing. - _seed = AltHashing::compute_seed(); - assert(seed() != 0, "shouldn't be zero"); - - int saved_entry_count = this->number_of_entries(); - - // Iterate through the table and create a new entry for the new table - for (int i = 0; i < new_table->table_size(); ++i) { - for (HashtableEntry* p = this->bucket(i); p != NULL; ) { - HashtableEntry* next = p->next(); - T string = p->literal(); - // Use alternate hashing algorithm on the symbol in the first table - unsigned int hashValue = string->new_hash(seed()); - // Get a new index relative to the new table (can also change size) - int index = new_table->hash_to_index(hashValue); - p->set_hash(hashValue); - // Keep the shared bit in the Hashtable entry to indicate that this entry - // can't be deleted. The shared bit is the LSB in the _next field so - // walking the hashtable past these entries requires - // BasicHashtableEntry::make_ptr() call. - bool keep_shared = p->is_shared(); - this->unlink_entry(p); - new_table->add_entry(index, p); - if (keep_shared) { - p->set_shared(); - } - p = next; - } - } - // give the new table the free list as well - new_table->copy_freelist(this); - - // Destroy memory used by the buckets in the hashtable. The memory - // for the elements has been used in a new table and is not - // destroyed. The memory reuse will benefit resizing the SystemDictionary - // to avoid a memory allocation spike at safepoint. - BasicHashtable::free_buckets(); -} - template void BasicHashtable::free_buckets() { if (NULL != _buckets) { // Don't delete the buckets in the shared space. They aren't @@ -452,8 +391,6 @@ template class Hashtable; template class HashtableEntry; template class BasicHashtable; template class Hashtable; -template class RehashableHashtable; -template class RehashableHashtable; template class Hashtable; template class Hashtable; template class Hashtable; diff --git a/src/hotspot/share/utilities/hashtable.hpp b/src/hotspot/share/utilities/hashtable.hpp index f40d1100410..c9f2760c507 100644 --- a/src/hotspot/share/utilities/hashtable.hpp +++ b/src/hotspot/share/utilities/hashtable.hpp @@ -285,38 +285,4 @@ public: } }; -template class RehashableHashtable : public Hashtable { - friend class VMStructs; - protected: - - enum { - rehash_count = 100, - rehash_multiple = 60 - }; - - // Check that the table is unbalanced - bool check_rehash_table(int count); - - public: - RehashableHashtable(int table_size, int entry_size) - : Hashtable(table_size, entry_size) { } - - RehashableHashtable(int table_size, int entry_size, - HashtableBucket* buckets, int number_of_entries) - : Hashtable(table_size, entry_size, buckets, number_of_entries) { } - - - // Function to move these elements into the new table. - void move_to(RehashableHashtable* new_table); - static bool use_alternate_hashcode(); - static juint seed(); - - private: - static juint _seed; -}; - -template juint RehashableHashtable::_seed = 0; -template juint RehashableHashtable::seed() { return _seed; }; -template bool RehashableHashtable::use_alternate_hashcode() { return _seed != 0; }; - #endif // SHARE_VM_UTILITIES_HASHTABLE_HPP From f131a8620c225eb0d0b11146e3f97d6a04fc7d65 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Mon, 5 Nov 2018 14:00:52 -0500 Subject: [PATCH 059/128] 8212883: Setting a double manageable flag with jcmd/jinfo crashes the JVM Reviewed-by: dholmes, gziemski, stuefe --- src/hotspot/share/services/writeableFlags.cpp | 34 +++++++++++++++---- src/hotspot/share/services/writeableFlags.hpp | 4 +++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/services/writeableFlags.cpp b/src/hotspot/share/services/writeableFlags.cpp index 780df4c5884..6f89fb58637 100644 --- a/src/hotspot/share/services/writeableFlags.cpp +++ b/src/hotspot/share/services/writeableFlags.cpp @@ -116,7 +116,7 @@ JVMFlag::Error WriteableFlags::set_bool_flag(const char* name, bool value, JVMFl JVMFlag::Error WriteableFlags::set_int_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { int value; - if (sscanf(arg, "%d", &value)) { + if (sscanf(arg, "%d", &value) == 1) { return set_int_flag(name, value, origin, err_msg); } err_msg.print("flag value must be an integer"); @@ -133,7 +133,7 @@ JVMFlag::Error WriteableFlags::set_int_flag(const char* name, int value, JVMFlag JVMFlag::Error WriteableFlags::set_uint_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { uint value; - if (sscanf(arg, "%u", &value)) { + if (sscanf(arg, "%u", &value) == 1) { return set_uint_flag(name, value, origin, err_msg); } err_msg.print("flag value must be an unsigned integer"); @@ -150,7 +150,7 @@ JVMFlag::Error WriteableFlags::set_uint_flag(const char* name, uint value, JVMFl JVMFlag::Error WriteableFlags::set_intx_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { intx value; - if (sscanf(arg, INTX_FORMAT, &value)) { + if (sscanf(arg, INTX_FORMAT, &value) == 1) { return set_intx_flag(name, value, origin, err_msg); } err_msg.print("flag value must be an integer"); @@ -167,7 +167,7 @@ JVMFlag::Error WriteableFlags::set_intx_flag(const char* name, intx value, JVMFl JVMFlag::Error WriteableFlags::set_uintx_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { uintx value; - if (sscanf(arg, UINTX_FORMAT, &value)) { + if (sscanf(arg, UINTX_FORMAT, &value) == 1) { return set_uintx_flag(name, value, origin, err_msg); } err_msg.print("flag value must be an unsigned integer"); @@ -184,7 +184,7 @@ JVMFlag::Error WriteableFlags::set_uintx_flag(const char* name, uintx value, JVM JVMFlag::Error WriteableFlags::set_uint64_t_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { uint64_t value; - if (sscanf(arg, UINT64_FORMAT, &value)) { + if (sscanf(arg, UINT64_FORMAT, &value) == 1) { return set_uint64_t_flag(name, value, origin, err_msg); } err_msg.print("flag value must be an unsigned 64-bit integer"); @@ -201,7 +201,7 @@ JVMFlag::Error WriteableFlags::set_uint64_t_flag(const char* name, uint64_t valu JVMFlag::Error WriteableFlags::set_size_t_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { size_t value; - if (sscanf(arg, SIZE_FORMAT, &value)) { + if (sscanf(arg, SIZE_FORMAT, &value) == 1) { return set_size_t_flag(name, value, origin, err_msg); } err_msg.print("flag value must be an unsigned integer"); @@ -214,6 +214,23 @@ JVMFlag::Error WriteableFlags::set_size_t_flag(const char* name, size_t value, J return err; } +// set a double global flag +JVMFlag::Error WriteableFlags::set_double_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { + double value; + + if (sscanf(arg, "%lf", &value) == 1) { + return set_double_flag(name, value, origin, err_msg); + } + err_msg.print("flag value must be a double"); + return JVMFlag::WRONG_FORMAT; +} + +JVMFlag::Error WriteableFlags::set_double_flag(const char* name, double value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { + JVMFlag::Error err = JVMFlag::doubleAtPut(name, &value, origin); + print_flag_error_message_if_needed(err, name, err_msg); + return err; +} + // set a string global flag using value from AttachOperation JVMFlag::Error WriteableFlags::set_ccstr_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) { JVMFlag::Error err = JVMFlag::ccstrAtPut((char*)name, &value, origin); @@ -286,6 +303,8 @@ JVMFlag::Error WriteableFlags::set_flag_from_char(JVMFlag* f, const void* value, return set_uint64_t_flag(f->_name, flag_value, origin, err_msg); } else if (f->is_size_t()) { return set_size_t_flag(f->_name, flag_value, origin, err_msg); + } else if (f->is_double()) { + return set_double_flag(f->_name, flag_value, origin, err_msg); } else if (f->is_ccstr()) { return set_ccstr_flag(f->_name, flag_value, origin, err_msg); } else { @@ -319,6 +338,9 @@ JVMFlag::Error WriteableFlags::set_flag_from_jvalue(JVMFlag* f, const void* valu } else if (f->is_size_t()) { size_t svalue = (size_t)new_value.j; return set_size_t_flag(f->_name, svalue, origin, err_msg); + } else if (f->is_double()) { + double dvalue = (double)new_value.d; + return set_double_flag(f->_name, dvalue, origin, err_msg); } else if (f->is_ccstr()) { oop str = JNIHandles::resolve_external_guard(new_value.l); if (str == NULL) { diff --git a/src/hotspot/share/services/writeableFlags.hpp b/src/hotspot/share/services/writeableFlags.hpp index 31065982c4c..511fe2911b3 100644 --- a/src/hotspot/share/services/writeableFlags.hpp +++ b/src/hotspot/share/services/writeableFlags.hpp @@ -52,6 +52,8 @@ private: static JVMFlag::Error set_uint64_t_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); // set a size_t global flag using value from AttachOperation static JVMFlag::Error set_size_t_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); + // set a double global flag using value from AttachOperation + static JVMFlag::Error set_double_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); // set a boolean global flag static JVMFlag::Error set_bool_flag(const char* name, bool value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); // set a int global flag @@ -66,6 +68,8 @@ private: static JVMFlag::Error set_uint64_t_flag(const char* name, uint64_t value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); // set a size_t global flag using value from AttachOperation static JVMFlag::Error set_size_t_flag(const char* name, size_t value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); + // set a double global flag using value from AttachOperation + static JVMFlag::Error set_double_flag(const char* name, double value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); // set a string global flag static JVMFlag::Error set_ccstr_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); From f7a2a60f78e3e8a785fcd36d41be0e126c4f024f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 5 Nov 2018 11:49:03 -0800 Subject: [PATCH 060/128] 8212872: Broken link to Namespaces in XML Errata Reviewed-by: lancea --- .../share/classes/javax/xml/namespace/package-info.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.xml/share/classes/javax/xml/namespace/package-info.java b/src/java.xml/share/classes/javax/xml/namespace/package-info.java index bc34407349e..b7c23a62922 100644 --- a/src/java.xml/share/classes/javax/xml/namespace/package-info.java +++ b/src/java.xml/share/classes/javax/xml/namespace/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,10 +35,10 @@ *

  • * XML Schema Part2: Datatypes specification *
  • - *
  • + *
  • * Namespaces in XML *
  • - *
  • + *
  • * Namespaces in XML Errata *
  • *
From 32d4c852a9190fd86476a7dbbf74067d8b388fac Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 5 Nov 2018 13:45:01 -0800 Subject: [PATCH 061/128] 8212876: ftp: links for character-sets require a login password Reviewed-by: lancea --- src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java b/src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java index b69f8d8f367..f458f540e53 100644 --- a/src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java +++ b/src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java @@ -117,19 +117,19 @@ public interface LSOutput { /** * The character encoding to use for the output. The encoding must be a - * string acceptable for an XML encoding declaration ([XML 1.0] section + * string acceptable for an XML encoding declaration ([XML 1.0] section * 4.3.3 "Character Encoding in Entities"), it is recommended that * character encodings registered (as charsets) with the Internet - * Assigned Numbers Authority [IANA-CHARSETS] + * Assigned Numbers Authority [IANA-CHARSETS] * should be referred to using their registered names. */ public String getEncoding(); /** * The character encoding to use for the output. The encoding must be a - * string acceptable for an XML encoding declaration ([XML 1.0] section + * string acceptable for an XML encoding declaration ([XML 1.0] section * 4.3.3 "Character Encoding in Entities"), it is recommended that * character encodings registered (as charsets) with the Internet - * Assigned Numbers Authority [IANA-CHARSETS] + * Assigned Numbers Authority [IANA-CHARSETS] * should be referred to using their registered names. */ public void setEncoding(String encoding); From a1029a472983b457707f8807b160b7eaf4a123f9 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Mon, 5 Nov 2018 13:55:41 -0800 Subject: [PATCH 062/128] 8213330: Fix legal headers in i18n tests Reviewed-by: lancea --- test/jdk/java/util/Formatter/spi/NoGroupingUsed.java | 4 +--- test/jdk/java/util/Locale/Bug8179071.java | 4 +--- test/jdk/java/util/Locale/LocaleCmdOverrides.java | 4 +--- test/jdk/java/util/Locale/SoftKeys.java | 4 +--- .../spi/ResourceBundleControlProvider/com/foo/XmlRB.xml | 6 ++---- .../spi/ResourceBundleControlProvider/com/foo/XmlRB_ja.xml | 6 ++---- test/jdk/sun/util/calendar/zi/BackEnd.java | 6 ++---- test/jdk/sun/util/calendar/zi/Checksum.java | 6 ++---- test/jdk/sun/util/calendar/zi/DayOfWeek.java | 6 ++---- test/jdk/sun/util/calendar/zi/Gen.java | 6 ++---- test/jdk/sun/util/calendar/zi/GenDoc.java | 6 ++---- test/jdk/sun/util/calendar/zi/Main.java | 6 ++---- test/jdk/sun/util/calendar/zi/Mappings.java | 6 ++---- test/jdk/sun/util/calendar/zi/Month.java | 6 ++---- test/jdk/sun/util/calendar/zi/Rule.java | 6 ++---- test/jdk/sun/util/calendar/zi/RuleDay.java | 6 ++---- test/jdk/sun/util/calendar/zi/RuleRec.java | 6 ++---- test/jdk/sun/util/calendar/zi/Simple.java | 6 ++---- test/jdk/sun/util/calendar/zi/Time.java | 6 ++---- test/jdk/sun/util/calendar/zi/Timezone.java | 6 ++---- test/jdk/sun/util/calendar/zi/TzIDOldMapping.java | 6 ++---- test/jdk/sun/util/calendar/zi/Zone.java | 6 ++---- test/jdk/sun/util/calendar/zi/ZoneInfoFile.java | 6 ++---- test/jdk/sun/util/calendar/zi/ZoneInfoOld.java | 6 ++---- test/jdk/sun/util/calendar/zi/ZoneRec.java | 6 ++---- test/jdk/sun/util/calendar/zi/Zoneinfo.java | 6 ++---- test/jdk/sun/util/calendar/zi/tzdata/VERSION | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/africa | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/antarctica | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/asia | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/australasia | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/backward | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/etcetera | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/europe | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/factory | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/gmt | 6 ++---- test/jdk/sun/util/calendar/zi/tzdata/iso3166.tab | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/jdk11_backward | 6 ++---- test/jdk/sun/util/calendar/zi/tzdata/leapseconds | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/northamerica | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/pacificnew | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/solar87 | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/solar88 | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/solar89 | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/southamerica | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/systemv | 4 +--- test/jdk/sun/util/calendar/zi/tzdata/zone.tab | 4 +--- test/jdk/sun/util/calendar/zi/tzdata_jdk/gmt | 6 ++---- test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_backward | 6 ++---- .../jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_full_backward | 6 ++---- test/jdk/sun/util/locale/provider/Bug8152817.java | 6 ++---- test/jdk/sun/util/resources/cldr/Bug8204603.java | 4 +--- 52 files changed, 80 insertions(+), 184 deletions(-) diff --git a/test/jdk/java/util/Formatter/spi/NoGroupingUsed.java b/test/jdk/java/util/Formatter/spi/NoGroupingUsed.java index 05c8b9ae567..774bdaea88b 100644 --- a/test/jdk/java/util/Formatter/spi/NoGroupingUsed.java +++ b/test/jdk/java/util/Formatter/spi/NoGroupingUsed.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/util/Locale/Bug8179071.java b/test/jdk/java/util/Locale/Bug8179071.java index b0093c6e4a2..1a77b5a95a3 100644 --- a/test/jdk/java/util/Locale/Bug8179071.java +++ b/test/jdk/java/util/Locale/Bug8179071.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/util/Locale/LocaleCmdOverrides.java b/test/jdk/java/util/Locale/LocaleCmdOverrides.java index 07f1a66f4f7..2f68a8ad85f 100644 --- a/test/jdk/java/util/Locale/LocaleCmdOverrides.java +++ b/test/jdk/java/util/Locale/LocaleCmdOverrides.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/util/Locale/SoftKeys.java b/test/jdk/java/util/Locale/SoftKeys.java index 9f968d55f8d..a3e7166a3ea 100644 --- a/test/jdk/java/util/Locale/SoftKeys.java +++ b/test/jdk/java/util/Locale/SoftKeys.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB.xml b/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB.xml index 5382313ad99..cae776ebe4d 100644 --- a/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB.xml +++ b/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB.xml @@ -1,13 +1,11 @@