author | lagergren |
Mon, 19 May 2014 15:29:42 +0200 (2014-05-19) | |
changeset 24759 | 31aed7d9c02a |
parent 24745 | 3a6e1477362b |
child 24764 | 722a9603b237 |
permissions | -rw-r--r-- |
24719 | 1 |
#!/bin/sh |
2 |
||
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
3 |
########################################################################################### |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
4 |
# This is a helper script to evaluate nashorn with optimistic types |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
5 |
# it produces a flight recording for every run, and uses the best |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
6 |
# known flags for performance for the current configration |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
7 |
########################################################################################### |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
8 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
9 |
# Flags to instrument lambdaform computation, caching, interpretation and compilation |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
10 |
# Default compile threshold for lambdaforms is 30 |
24719 | 11 |
#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" |
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
12 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
13 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
14 |
# Flags to run trusted tests from the Nashorn test suite |
24731
ab0c8fc915ae
8038406: Testability: as a first step of moving loggers away from the process global space, the Debug object now supports logging POJOs from log entries as an event queue, which can be introspected from test scripts. This is way better than screen scraping brittle and subject-to-change log output.
lagergren
parents:
24722
diff
changeset
|
15 |
#FLAGS="-Djava.security.manager -Djava.security.policy=../build/nashorn.policy -Dnashorn.debug" |
24719 | 16 |
|
24720 | 17 |
|
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
18 |
# Unique timestamped file name for JFR recordings. For JFR, we also have to |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
19 |
# crank up the stack cutoff depth to 1024, because of ridiculously long lambda form |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
20 |
# stack traces. |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
21 |
# |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
22 |
# It is also recommended that you go into $JAVA_HOME/jre/lib/jfr/default.jfc and |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
23 |
# set the "method-sampling-interval" Normal and Maximum sample time as low as you |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
24 |
# can go (10 ms on most platforms). The default is normally higher. The increased |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
25 |
# sampling overhead is usually negligible for Nashorn runs, but the data is better |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
26 |
JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr" |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
27 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
28 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
29 |
# Directory where to look for nashorn.jar in a dist folder. The default is "..", assuming |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
30 |
# that we run the script from the make dir |
24721
81f70e23cd3b
8036127: Prototype filter needs to be applied to getter guard as well, not just getter
lagergren
parents:
24720
diff
changeset
|
31 |
DIR=.. |
24720 | 32 |
NASHORN_JAR=$DIR/dist/nashorn.jar |
24719 | 33 |
|
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
34 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
35 |
# The built Nashorn jar is placed first in the bootclasspath to override the JDK |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
36 |
# nashorn.jar in $JAVA_HOME/jre/lib/ext. Thus, we also need -esa, as assertions in |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
37 |
# nashorn count as system assertions in this configuration |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
38 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
39 |
# Type profiling default level is 111, 222 adds some compile time, but is faster |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
40 |
|
24719 | 41 |
$JAVA_HOME/bin/java \ |
24720 | 42 |
$FLAGS \ |
24719 | 43 |
-ea \ |
44 |
-esa \ |
|
24741
4232289c3235
8040102: Remove all references to Unsafe and definition of anonymous clases from the code
lagergren
parents:
24740
diff
changeset
|
45 |
-Xbootclasspath/p:$NASHORN_JAR \ |
24719 | 46 |
-Xms2G -Xmx2G \ |
47 |
-XX:+UnlockCommercialFeatures \ |
|
48 |
-XX:+FlightRecorder \ |
|
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
49 |
-XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024 \ |
24719 | 50 |
-XX:TypeProfileLevel=222 \ |
51 |
-cp $CLASSPATH:../build/test/classes/ \ |
|
52 |
jdk.nashorn.tools.Shell ${@} |
|
53 |
||
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
54 |
# Below are flags that may come in handy, but aren't used for default runs |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
55 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
56 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
57 |
# Type specialization and math intrinsic replacement should be enabled by default in 8u20 and nine, |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
58 |
# keeping this flag around for experimental reasons. Replace + with - to switch it off |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
59 |
#-XX:+UseTypeSpeculation \ |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
60 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
61 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
62 |
# Same with math intrinsics. They should be enabled by default in 8u20 and 9 |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
63 |
#-XX:+UseMathExactIntrinsics \ |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
64 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
65 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
66 |
# Add -Dnashorn.time to time the compilation phases. |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
67 |
#-Dnashorn.time \ |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
68 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
69 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
70 |
# Add ShowHiddenFrames to get lambda form internals on the stack traces |
24720 | 71 |
#-XX:+ShowHiddenFrames \ |
24759
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
72 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
73 |
|
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
74 |
# Add print optoassembly to get an asm dump. This requires 1) a debug build, not product, |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
75 |
# That tired compilation is switched off, for C2 only output and that the number of |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
76 |
# compiler threads is set to 1 for determinsm. |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
77 |
#-XX:+PrintOptoAssembly -XX:-TieredCompilation -XX:CICompilerCount=1 \ |
31aed7d9c02a
8034206: Make parts of code pipeline reusable in order to facilitate faster warmup and faster lazy compilation.
lagergren
parents:
24745
diff
changeset
|
78 |