Thu, 28 Jan 2016 12:39:39 -0800
Added tag jdk8u74-b01 for changeset ae6c74c1197a
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 | |
lagergren@1071 | 31 | # Flags to enable assertions, we need the system assertions too, since |
lagergren@1071 | 32 | # this script runs Nashorn in the BCP to override any nashorn.jar that might |
lagergren@1071 | 33 | # reside in your $JAVA_HOME/jre/lib/ext/nashorn.jar |
lagergren@1071 | 34 | # |
lagergren@1071 | 35 | ENABLE_ASSERTIONS_FLAGS="-ea -esa" |
lagergren@1071 | 36 | |
attila@963 | 37 | # Flags to instrument lambdaform computation, caching, interpretation and compilation |
attila@963 | 38 | # Default compile threshold for lambdaforms is 30 |
lagergren@1071 | 39 | # |
lagergren@1071 | 40 | #LAMBDAFORM_FLAGS="\ |
lagergren@1071 | 41 | # -Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=3 \ |
lagergren@1071 | 42 | # -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true \ |
lagergren@1071 | 43 | # -Djava.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE=true \ |
lagergren@1071 | 44 | # -Djava.lang.invoke.MethodHandle.TRACE_INTERPRETER=true" |
attila@963 | 45 | |
attila@963 | 46 | # Flags to run trusted tests from the Nashorn test suite |
lagergren@1071 | 47 | # |
lagergren@1071 | 48 | #TRUSTED_TEST_FLAGS="\ |
lagergren@1071 | 49 | #-Djava.security.manager \ |
lagergren@1071 | 50 | #-Djava.security.policy=../build/nashorn.policy -Dnashorn.debug" |
attila@963 | 51 | |
lagergren@1071 | 52 | # Testing out new code optimizations using the generic hotspot "new code" parameter |
lagergren@1071 | 53 | # |
lagergren@1071 | 54 | #USE_NEW_CODE_FLAGS=-XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode |
lagergren@1071 | 55 | |
lagergren@1071 | 56 | # |
lagergren@1071 | 57 | #-Dnashorn.typeInfo.disabled=false \ |
lagergren@1071 | 58 | # and for Nashorn options: |
lagergren@1071 | 59 | # --class-cache-size=0 --persistent-code-cache=false |
attila@963 | 60 | |
attila@963 | 61 | # Unique timestamped file name for JFR recordings. For JFR, we also have to |
attila@963 | 62 | # crank up the stack cutoff depth to 1024, because of ridiculously long lambda form |
attila@963 | 63 | # stack traces. |
attila@963 | 64 | # |
attila@963 | 65 | # It is also recommended that you go into $JAVA_HOME/jre/lib/jfr/default.jfc and |
attila@963 | 66 | # set the "method-sampling-interval" Normal and Maximum sample time as low as you |
attila@963 | 67 | # can go (10 ms on most platforms). The default is normally higher. The increased |
attila@963 | 68 | # sampling overhead is usually negligible for Nashorn runs, but the data is better |
attila@963 | 69 | |
lagergren@1071 | 70 | if [ -z $JFR_FILENAME ]; then |
lagergren@1071 | 71 | JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr" |
lagergren@1071 | 72 | fi |
attila@963 | 73 | |
lagergren@1071 | 74 | # Flight recorder |
lagergren@1071 | 75 | # |
lagergren@1071 | 76 | # see above - already in place, copy the flags down here to disable |
lagergren@1071 | 77 | ENABLE_FLIGHT_RECORDER_FLAGS="\ |
lagergren@1071 | 78 | -XX:+UnlockCommercialFeatures \ |
lagergren@1071 | 79 | -XX:+FlightRecorder \ |
lagergren@1071 | 80 | -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024" |
lagergren@1071 | 81 | |
lagergren@1071 | 82 | # Type specialization and math intrinsic replacement should be enabled by default in 8u20 and nine, |
lagergren@1071 | 83 | # keeping this flag around for experimental reasons. Replace + with - to switch it off |
lagergren@1071 | 84 | # |
lagergren@1071 | 85 | #ENABLE_TYPE_SPECIALIZATION_FLAGS=-XX:+UseTypeSpeculation |
lagergren@1071 | 86 | |
lagergren@1071 | 87 | # Same with math intrinsics. They should be enabled by default in 8u20 and 9, so |
lagergren@1071 | 88 | # this disables them if needed |
lagergren@1071 | 89 | # |
lagergren@1071 | 90 | #DISABLE_MATH_INTRINSICS_FLAGS=-XX:-UseMathExactIntrinsics |
lagergren@1071 | 91 | |
lagergren@1071 | 92 | # Add timing to time the compilation phases. |
lagergren@1071 | 93 | #ENABLE_TIME_FLAGS=--log=time |
lagergren@1071 | 94 | |
lagergren@1071 | 95 | # Add ShowHiddenFrames to get lambda form internals on the stack traces |
lagergren@1071 | 96 | #ENABLE_SHOW_HIDDEN_FRAMES_FLAGS=-XX:+ShowHiddenFrames |
lagergren@1071 | 97 | |
lagergren@1071 | 98 | # Add print optoassembly to get an asm dump. This requires 1) a debug build, not product, |
lagergren@1071 | 99 | # That tired compilation is switched off, for C2 only output and that the number of |
lagergren@1071 | 100 | # compiler threads is set to 1 for determinsm. |
lagergren@1071 | 101 | # |
lagergren@1071 | 102 | #PRINT_ASM_FLAGS=-XX:+PrintOptoAssembly -XX:-TieredCompilation -XX:CICompilerCount=1 \ |
lagergren@1071 | 103 | |
lagergren@1071 | 104 | # Tier compile threasholds. Default value is 10. (1-100 is useful for experiments) |
lagergren@1071 | 105 | #TIER_COMPILATION_THRESHOLD_FLAGS=-XX:IncreaseFirstTierCompileThresholdAt=10 |
attila@963 | 106 | |
attila@963 | 107 | # Directory where to look for nashorn.jar in a dist folder. The default is "..", assuming |
attila@963 | 108 | # that we run the script from the make dir |
attila@963 | 109 | DIR=.. |
attila@963 | 110 | NASHORN_JAR=$DIR/dist/nashorn.jar |
attila@963 | 111 | |
attila@963 | 112 | |
attila@963 | 113 | # The built Nashorn jar is placed first in the bootclasspath to override the JDK |
attila@963 | 114 | # nashorn.jar in $JAVA_HOME/jre/lib/ext. Thus, we also need -esa, as assertions in |
attila@963 | 115 | # nashorn count as system assertions in this configuration |
attila@963 | 116 | |
lagergren@1071 | 117 | # Type profiling default level is 111, 222 adds some compile time, but is faster |
lagergren@1071 | 118 | |
attila@963 | 119 | $JAVA_HOME/bin/java \ |
lagergren@1071 | 120 | $ENABLE_ASSERTIONS_FLAGS \ |
lagergren@1071 | 121 | $LAMBDAFORM_FLAGS \ |
lagergren@1071 | 122 | $TRUSTED_FLAGS \ |
lagergren@1071 | 123 | $USE_NEW_CODE_FLAGS \ |
lagergren@1071 | 124 | $ENABLE_SHOW_HIDDEN_FRAMES_FLAGS \ |
lagergren@1071 | 125 | $ENABLE_FLIGHT_RECORDER_FLAGS \ |
lagergren@1071 | 126 | $ENABLE_TYPE_SPECIALIZATION_FLAGS \ |
lagergren@1071 | 127 | $TIERED_COMPILATION_THRESOLD_FLAGS \ |
lagergren@1071 | 128 | $DISABLE_MATH_INTRINSICS_FLAGS \ |
lagergren@1071 | 129 | $PRINT_ASM_FLAGS \ |
attila@963 | 130 | -Xbootclasspath/p:$NASHORN_JAR \ |
attila@963 | 131 | -Xms2G -Xmx2G \ |
lagergren@1071 | 132 | -XX:TypeProfileLevel=222 \ |
attila@963 | 133 | -cp $CLASSPATH:../build/test/classes/ \ |
lagergren@1071 | 134 | jdk.nashorn.tools.Shell $ENABLE_TIME_FLAGS ${@} |
attila@963 | 135 | |
attila@963 | 136 |