Thu, 30 Jul 2009 10:29:53 +0100
6827648: Extremely slow compilation time for visitor pattern code + generics
Summary: Javac unnecessarily recomputates type-substitutions multiple times
Reviewed-by: jjg
duke@1 | 1 | #!/bin/sh |
duke@1 | 2 | |
duke@1 | 3 | # |
duke@1 | 4 | # Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. |
duke@1 | 5 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 6 | # |
duke@1 | 7 | # This code is free software; you can redistribute it and/or modify it |
duke@1 | 8 | # under the terms of the GNU General Public License version 2 only, as |
duke@1 | 9 | # published by the Free Software Foundation. |
duke@1 | 10 | # |
duke@1 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | # accompanied this code). |
duke@1 | 16 | # |
duke@1 | 17 | # You should have received a copy of the GNU General Public License version |
duke@1 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | # |
duke@1 | 21 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@1 | 22 | # CA 95054 USA or visit www.sun.com if you need additional information or |
duke@1 | 23 | # have any questions. |
duke@1 | 24 | # |
duke@1 | 25 | |
duke@1 | 26 | # |
duke@1 | 27 | # @test |
duke@1 | 28 | # @bug 4914724 4973116 5014511 |
duke@1 | 29 | # @summary Ensure that a supplementary character can be used as part/whole of a class |
duke@1 | 30 | # name on platforms that have Unicode aware filesystems. |
duke@1 | 31 | # @author Naoto Sato |
duke@1 | 32 | # @run shell SupplementaryJavaID6.sh SupplementaryJavaID6 |
duke@1 | 33 | |
duke@1 | 34 | |
duke@1 | 35 | if [ "${TESTSRC}" = "" ] |
duke@1 | 36 | then |
duke@1 | 37 | echo "TESTSRC not set. Test cannot execute. Failed." |
duke@1 | 38 | exit 1 |
duke@1 | 39 | fi |
duke@1 | 40 | echo "TESTSRC=${TESTSRC}" |
duke@1 | 41 | if [ "${TESTJAVA}" = "" ] |
duke@1 | 42 | then |
duke@1 | 43 | echo "TESTJAVA not set. Test cannot execute. Failed." |
duke@1 | 44 | exit 1 |
duke@1 | 45 | fi |
duke@1 | 46 | echo "TESTJAVA=${TESTJAVA}" |
duke@1 | 47 | if [ "${TESTCLASSES}" = "" ] |
duke@1 | 48 | then |
duke@1 | 49 | echo "TESTCLASSES not set. Test cannot execute. Failed." |
duke@1 | 50 | exit 1 |
duke@1 | 51 | fi |
duke@1 | 52 | echo "TESTCLASSES=${TESTCLASSES}" |
duke@1 | 53 | echo "CLASSPATH=${CLASSPATH}" |
duke@1 | 54 | |
duke@1 | 55 | # set platform-dependent variables |
duke@1 | 56 | OS=`uname -s` |
duke@1 | 57 | case "$OS" in |
duke@1 | 58 | SunOS | Linux ) |
duke@1 | 59 | if [ -d /usr/lib/locale/en_US.UTF-8 -o -d /usr/lib/locale/en_US.utf8 ] |
duke@1 | 60 | then |
duke@1 | 61 | ENV="env LANG=en_US.UTF-8" |
duke@1 | 62 | PS=":" |
duke@1 | 63 | FS="/" |
duke@1 | 64 | else |
duke@1 | 65 | echo "As there is no en_US.UTF-8 locale available on this system, the compilation of the test case may or may not fail. Ignoring this test." |
duke@1 | 66 | exit 0; |
duke@1 | 67 | fi |
duke@1 | 68 | ;; |
duke@1 | 69 | Windows_98 | Windows_ME ) |
duke@1 | 70 | echo "As Windows 98/Me do not provide Unicode-aware file system, the compilation of the test case is expected to fail on these platforms. Ignoring this test." |
duke@1 | 71 | exit 0; |
duke@1 | 72 | ;; |
duke@1 | 73 | Windows* ) |
duke@1 | 74 | ENV="" |
duke@1 | 75 | PS=";" |
duke@1 | 76 | FS="\\" |
duke@1 | 77 | ;; |
duke@1 | 78 | * ) |
duke@1 | 79 | echo "Unrecognized system!" |
duke@1 | 80 | exit 1; |
duke@1 | 81 | ;; |
duke@1 | 82 | esac |
duke@1 | 83 | |
duke@1 | 84 | # compile |
duke@1 | 85 | cp "${TESTSRC}${FS}$1.java" . |
duke@1 | 86 | ${ENV} "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . -classpath ".${PS}${TESTSRC}" $1.java |
duke@1 | 87 | result=$? |
duke@1 | 88 | |
duke@1 | 89 | if [ $result -ne 0 ] |
duke@1 | 90 | then |
duke@1 | 91 | echo "Failed" |
duke@1 | 92 | exit $result |
duke@1 | 93 | fi |
duke@1 | 94 | |
duke@1 | 95 | # run |
duke@1 | 96 | ${ENV} "${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} $1 |
duke@1 | 97 | result=$? |
duke@1 | 98 | |
duke@1 | 99 | if [ $result -eq 0 ] |
duke@1 | 100 | then |
duke@1 | 101 | echo "Passed" |
duke@1 | 102 | else |
duke@1 | 103 | echo "Failed" |
duke@1 | 104 | fi |
duke@1 | 105 | |
duke@1 | 106 | # Cleanup |
duke@1 | 107 | ${ENV} rm -f ./$1*.class |
duke@1 | 108 | |
duke@1 | 109 | exit $result |