bin/runopt.sh

Wed, 10 Sep 2014 09:05:38 -0700

author
katleman
date
Wed, 10 Sep 2014 09:05:38 -0700
changeset 989
0a2b63f54b1c
parent 963
e2497b11a021
child 1071
78eb2b415108
permissions
-rw-r--r--

Added tag jdk8u40-b05 for changeset 2d75c391f61f

attila@963 1 #!/bin/sh
attila@963 2 #
attila@963 3 # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
attila@963 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@963 5 #
attila@963 6 # This code is free software; you can redistribute it and/or modify it
attila@963 7 # under the terms of the GNU General Public License version 2 only, as
attila@963 8 # published by the Free Software Foundation.
attila@963 9 #
attila@963 10 # This code is distributed in the hope that it will be useful, but WITHOUT
attila@963 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
attila@963 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
attila@963 13 # version 2 for more details (a copy is included in the LICENSE file that
attila@963 14 # accompanied this code).
attila@963 15 #
attila@963 16 # You should have received a copy of the GNU General Public License version
attila@963 17 # 2 along with this work; if not, write to the Free Software Foundation,
attila@963 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@963 19 #
attila@963 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
attila@963 21 # or visit www.oracle.com if you need additional information or have any
attila@963 22 # questions.
attila@963 23 #
attila@963 24
attila@963 25 ###########################################################################################
attila@963 26 # This is a helper script to evaluate nashorn with optimistic types
attila@963 27 # it produces a flight recording for every run, and uses the best
attila@963 28 # known flags for performance for the current configration
attila@963 29 ###########################################################################################
attila@963 30
attila@963 31 # Flags to instrument lambdaform computation, caching, interpretation and compilation
attila@963 32 # Default compile threshold for lambdaforms is 30
attila@963 33 #FLAGS="-Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=3 -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true -Djava.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE=true -Djava.lang.invoke.MethodHandle.TRACE_INTERPRETER=true"
attila@963 34
attila@963 35
attila@963 36 # Flags to run trusted tests from the Nashorn test suite
attila@963 37 #FLAGS="-Djava.security.manager -Djava.security.policy=../build/nashorn.policy -Dnashorn.debug"
attila@963 38
attila@963 39
attila@963 40 # Unique timestamped file name for JFR recordings. For JFR, we also have to
attila@963 41 # crank up the stack cutoff depth to 1024, because of ridiculously long lambda form
attila@963 42 # stack traces.
attila@963 43 #
attila@963 44 # It is also recommended that you go into $JAVA_HOME/jre/lib/jfr/default.jfc and
attila@963 45 # set the "method-sampling-interval" Normal and Maximum sample time as low as you
attila@963 46 # can go (10 ms on most platforms). The default is normally higher. The increased
attila@963 47 # sampling overhead is usually negligible for Nashorn runs, but the data is better
attila@963 48
attila@963 49 JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr"
attila@963 50
attila@963 51
attila@963 52 # Directory where to look for nashorn.jar in a dist folder. The default is "..", assuming
attila@963 53 # that we run the script from the make dir
attila@963 54 DIR=..
attila@963 55 NASHORN_JAR=$DIR/dist/nashorn.jar
attila@963 56
attila@963 57
attila@963 58 # The built Nashorn jar is placed first in the bootclasspath to override the JDK
attila@963 59 # nashorn.jar in $JAVA_HOME/jre/lib/ext. Thus, we also need -esa, as assertions in
attila@963 60 # nashorn count as system assertions in this configuration
attila@963 61
attila@963 62 $JAVA_HOME/bin/java \
attila@963 63 $FLAGS \
attila@963 64 -ea \
attila@963 65 -esa \
attila@963 66 -Xbootclasspath/p:$NASHORN_JAR \
attila@963 67 -Xms2G -Xmx2G \
attila@963 68 -cp $CLASSPATH:../build/test/classes/ \
attila@963 69 jdk.nashorn.tools.Shell ${@}
attila@963 70
attila@963 71 # Below are flags that may come in handy, but aren't used for default runs
attila@963 72
attila@963 73
attila@963 74 # Type profiling default level is 111, 222 adds some compile time, but produces better code.
attila@963 75 # -XX:TypeProfileLevel=222 \
attila@963 76
attila@963 77
attila@963 78 # Testing out new code optimizations using the generic hotspot "new code" parameter
attila@963 79 #-XX:+UnlockDiagnosticVMOptions \
attila@963 80 #-XX:+UseNewCode \
attila@963 81
attila@963 82
attila@963 83 # Type specialization and math intrinsic replacement should be enabled by default in 8u20 and nine,
attila@963 84 # keeping this flag around for experimental reasons. Replace + with - to switch it off
attila@963 85 #-XX:+UseTypeSpeculation \
attila@963 86
attila@963 87
attila@963 88 # Same with math intrinsics. They should be enabled by default in 8u20 and 9
attila@963 89 #-XX:+UseMathExactIntrinsics \
attila@963 90
attila@963 91
attila@963 92 # Add -Dnashorn.time to time the compilation phases.
attila@963 93 #-Dnashorn.time \
attila@963 94
attila@963 95
attila@963 96 # Add ShowHiddenFrames to get lambda form internals on the stack traces
attila@963 97 #-XX:+ShowHiddenFrames \
attila@963 98
attila@963 99
attila@963 100 # Add print optoassembly to get an asm dump. This requires 1) a debug build, not product,
attila@963 101 # That tired compilation is switched off, for C2 only output and that the number of
attila@963 102 # compiler threads is set to 1 for determinsm.
attila@963 103 #-XX:+PrintOptoAssembly -XX:-TieredCompilation -XX:CICompilerCount=1 \
attila@963 104
attila@963 105 # Tier compile threasholds. Default value is 10. (1-100 is useful for experiments)
attila@963 106 # -XX:IncreaseFirstTierCompileThresholdAt=XX
attila@963 107

mercurial