Fri, 31 May 2013 06:41:50 +0200
8013496: Code cache management command line options work only in special order. Another order of arguments does not deliver the second parameter to the jvm.
Summary: Moved check that ReservedCodeCacheSize >= InitialCodeCacheSize to Arguments::check_vm_args_consistency(). As a result, the ordering in which the two parameters are given to the VM is not relevant. Added a regression test.
Reviewed-by: kvn, twisti
anoll@5224 | 1 | #!/bin/sh |
anoll@5224 | 2 | # |
anoll@5224 | 3 | # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
anoll@5224 | 4 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
anoll@5224 | 5 | # |
anoll@5224 | 6 | # This code is free software; you can redistribute it and/or modify it |
anoll@5224 | 7 | # under the terms of the GNU General Public License version 2 only, as |
anoll@5224 | 8 | # published by the Free Software Foundation. |
anoll@5224 | 9 | # |
anoll@5224 | 10 | # This code is distributed in the hope that it will be useful, but WITHOUT |
anoll@5224 | 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
anoll@5224 | 12 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
anoll@5224 | 13 | # version 2 for more details (a copy is included in the LICENSE file that |
anoll@5224 | 14 | # accompanied this code). |
anoll@5224 | 15 | # |
anoll@5224 | 16 | # You should have received a copy of the GNU General Public License version |
anoll@5224 | 17 | # 2 along with this work; if not, write to the Free Software Foundation, |
anoll@5224 | 18 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
anoll@5224 | 19 | # |
anoll@5224 | 20 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
anoll@5224 | 21 | # or visit www.oracle.com if you need additional information or have any |
anoll@5224 | 22 | # questions. |
anoll@5224 | 23 | # |
anoll@5224 | 24 | # |
anoll@5224 | 25 | # @test |
anoll@5224 | 26 | # @bug 8013496 |
anoll@5224 | 27 | # @summary Test checks that the order in which ReversedCodeCacheSize and |
anoll@5224 | 28 | # InitialCodeCacheSize are passed to the VM is irrelevant. |
anoll@5224 | 29 | # @run shell Test8013496.sh |
anoll@5224 | 30 | # |
anoll@5224 | 31 | # |
anoll@5224 | 32 | ## some tests require path to find test source dir |
anoll@5224 | 33 | if [ "${TESTSRC}" = "" ] |
anoll@5224 | 34 | then |
anoll@5224 | 35 | TESTSRC=${PWD} |
anoll@5224 | 36 | echo "TESTSRC not set. Using "${TESTSRC}" as default" |
anoll@5224 | 37 | fi |
anoll@5224 | 38 | echo "TESTSRC=${TESTSRC}" |
anoll@5224 | 39 | ## Adding common setup Variables for running shell tests. |
anoll@5224 | 40 | . ${TESTSRC}/../../test_env.sh |
anoll@5224 | 41 | set -x |
anoll@5224 | 42 | |
anoll@5224 | 43 | ${TESTJAVA}/bin/java ${TESTVMOPTS} -XX:ReservedCodeCacheSize=2m -XX:InitialCodeCacheSize=500K -version > 1.out 2>&1 |
anoll@5224 | 44 | ${TESTJAVA}/bin/java ${TESTVMOPTS} -XX:InitialCodeCacheSize=500K -XX:ReservedCodeCacheSize=2m -version > 2.out 2>&1 |
anoll@5224 | 45 | |
anoll@5224 | 46 | diff 1.out 2.out |
anoll@5224 | 47 | |
anoll@5224 | 48 | result=$? |
anoll@5224 | 49 | if [ $result -eq 0 ] ; then |
anoll@5224 | 50 | echo "Test Passed" |
anoll@5224 | 51 | exit 0 |
anoll@5224 | 52 | else |
anoll@5224 | 53 | echo "Test Failed" |
anoll@5224 | 54 | exit 1 |
anoll@5224 | 55 | fi |