# HG changeset patch # User lagergren # Date 1401218707 -7200 # Node ID 0b8af588070b2cb24dcf0821d74bce5f70064102 # Parent 7b54e2362c6c4a5cdd769e6fce8fccb252a7e7a0 8044012: Integrate the latest best known performance flags int ant octane jobs, and make sure that it's easy to compare 'ant octane-nashorn' and 'ant octane-v8' at the push of a button. (or rather; the entry of a command line) Reviewed-by: jlaskey, sundar diff -r 7b54e2362c6c -r 0b8af588070b nashorn/docs/DEVELOPER_README --- a/nashorn/docs/DEVELOPER_README Wed May 21 16:12:40 2014 +0200 +++ b/nashorn/docs/DEVELOPER_README Tue May 27 21:25:07 2014 +0200 @@ -922,11 +922,10 @@ -cp, -classpath (-cp path. Specify where to find user class files.) - -co, --compile-only (Compile script without running. Exit after compilation) + -co, --compile-only (Compile without running.) param: [true|false] default: false - -d, --dump-debug-dir (specify a destination directory to dump class files. - This must be combined with the --compile-only option to work) + -d, --dump-debug-dir (specify a destination directory to dump class files.) param: --debug-lines (Generate line number table in .class files.) @@ -962,10 +961,6 @@ -h, -help (Print help for command line flags.) param: [true|false] default: false - --lazy-compilation (EXPERIMENTAL: Use lazy code generation strategies - do not compile - the entire script at once.) - param: [true|false] default: false - --loader-per-compile (Create a new class loader per compile.) param: [true|false] default: true @@ -973,16 +968,16 @@ param: default: en-US --log (Enable logging of a given level for a given number of sub systems. - [for example: --log=fields:finest,codegen:info]) + [for example: --log=fields:finest,codegen:info].) param: ,* - -nj, --no-java (No Java support) + -nj, --no-java (Disable Java support.) param: [true|false] default: false - -nse, --no-syntax-extensions (No non-standard syntax extensions) + -nse, --no-syntax-extensions (Disallow non-standard syntax extensions.) param: [true|false] default: false - -nta, --no-typed-arrays (No Typed arrays support) + -nta, --no-typed-arrays (Disable typed arrays support.) param: [true|false] default: false --parse-only (Parse without compiling.) @@ -991,13 +986,15 @@ --print-ast (Print abstract syntax tree.) param: [true|false] default: false - --print-code (Print bytecode.) - param: [true|false] default: false + -pc, --print-code (Print generated bytecode. If a directory is specified, nothing will + be dumped to stderr. Also, in that case, .dot files will be generated + for all functions or for the function with the specified name only.) + param: [dir:,function:] --print-lower-ast (Print lowered abstract syntax tree.) param: [true|false] default: false - --print-lower-parse (Print the parse tree after lowering.) + -plp, --print-lower-parse (Print the parse tree after lowering.) param: [true|false] default: false --print-mem-usage (Print memory usage of IR after each compile stage.) @@ -1006,7 +1003,7 @@ --print-no-newline (Print function will not print new line char.) param: [true|false] default: false - --print-parse (Print the parse tree.) + -pp, --print-parse (Print the parse tree.) param: [true|false] default: false --print-symbols (Print the symbol table.) @@ -1015,21 +1012,13 @@ -pcs, --profile-callsites (Dump callsite profile data.) param: [true|false] default: false - --range-analysis (EXPERIMENTAL: Do range analysis using known compile time types, - and try to narrow number types) - param: [true|false] default: false - -scripting (Enable scripting features.) param: [true|false] default: false - --specialize-calls (EXPERIMENTAL: Specialize all or a set of method according - to callsite parameter types) - param: [=function_1,...,function_n] - - --stderr (Redirect stderr to a filename or to another tty, e.g. stdout) + --stderr (Redirect stderr to a filename or to another tty, e.g. stdout.) param: - --stdout (Redirect stdout to a filename or to another tty, e.g. stderr) + --stdout (Redirect stdout to a filename or to another tty, e.g. stderr.) param: -strict (Run scripts in strict mode.) @@ -1039,7 +1028,7 @@ param: default: Europe/Stockholm -tcs, --trace-callsites (Enable callsite trace mode. Options are: miss [trace callsite misses] - enterexit [trace callsite enter/exit], objects [print object properties]) + enterexit [trace callsite enter/exit], objects [print object properties].) param: [=[option,]*] --verify-code (Verify byte code before running.) diff -r 7b54e2362c6c -r 0b8af588070b nashorn/make/build-benchmark.xml --- a/nashorn/make/build-benchmark.xml Wed May 21 16:12:40 2014 +0200 +++ b/nashorn/make/build-benchmark.xml Tue May 27 21:25:07 2014 +0200 @@ -1,372 +1,291 @@ + - + + + - - - - - - - - - + + - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - + - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - - - - - - + + - - - + - - - - + - + - - - - - + + - - - + - - - - + - - - - - + + - - - + - - - - + - - - + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + - - + + + + + + - - - + + + - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + @@ -375,9 +294,9 @@ - + - + @@ -389,7 +308,7 @@ - + @@ -404,9 +323,9 @@ - + - + @@ -427,6 +346,8 @@ + + + + diff -r 7b54e2362c6c -r 0b8af588070b nashorn/make/build.xml --- a/nashorn/make/build.xml Wed May 21 16:12:40 2014 +0200 +++ b/nashorn/make/build.xml Tue May 27 21:25:07 2014 +0200 @@ -23,10 +23,8 @@ --> - - @@ -616,4 +614,6 @@ + + diff -r 7b54e2362c6c -r 0b8af588070b nashorn/make/project.properties --- a/nashorn/make/project.properties Wed May 21 16:12:40 2014 +0200 +++ b/nashorn/make/project.properties Tue May 27 21:25:07 2014 +0200 @@ -53,6 +53,7 @@ # test classes directory build.test.classes.dir=${build.dir}/test/classes + # nashorn test jar - internal tests jar and api tests jar nashorn.internal.tests.jar=${build.dir}/nashorn-internal-tests.jar nashorn.api.tests.jar=${build.dir}/nashorn-api-tests.jar @@ -161,19 +162,12 @@ # test root for octane octane-test-sys-prop.test.js.roots=${test.external.dir}/octane/ -# run octane benchmars in separate processes? +# run octane benchmars in separate processes? (recommended) octane-test-sys-prop.separate.process=true # framework root for octane octane-test-sys-prop.test.js.framework=${test.basic.dir}/run-octane.js -# list of tests to be excluded -# mandreel excluded due to OOM -octane-test-sys-prop.test.js.exclude.list=\ - base.js \ - run.js \ - mandreel.js - # test root for sunspider sunspider-test-sys-prop.test.js.roots=${test.external.dir}/sunspider/tests/sunspider-1.0.2/ @@ -261,8 +255,11 @@ run.test.xmx=3G run.test.xms=2G -#uncomment to enable flight recording - crank up stack trace for lambda forms +# uncomment this jfr.args to enable light recordings. the stack needs to be cranked up to 1024 frames, +# or everything will as of the now drown in lambda forms and be cut off. +# #jfr.args=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath="test_suite.jfr",stackdepth=1024 \ + jfr.args= run.test.user.language=tr @@ -276,34 +273,80 @@ ${jfr.args} \ -XX:+HeapDumpOnOutOfMemoryError -#-XX:-UseCompressedKlassPointers -XX:+PrintHeapAtGC -XX:ClassMetaspaceSize=300M -# -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMethods +# turn on assertions for tests +run.test.jvmargs.main=${run.test.jvmargs.common} -ea -Dnashorn.lazy -# turn on assertions for tests -run.test.jvmargs.main=${run.test.jvmargs.common} -ea -Dnashorn.optimistic -Dnashorn.lazy +# extra jvmargs that might be useful for debugging +# +# -XX:+UnlockDiagnosticVMOptions +# +# turn off compressed class pointers in metaspace +# -XX:-UseCompressedKlassPointers +# +# dump the heap after every GC +# -XX:+PrintHeapAtGC +# +# manually set a metaspace size for class data +# -XX:ClassMetaspaceSize=300M +# +# print out methods compiled +# -XX:+PrintCompilation +# +# print all compiled nmethods with oopmaps and lots of other info +# -XX:+PrintNMethods -#-XX:-UseCompressedKlassPointers -XX:+PrintHeapAtGC -XX:ClassMetaspaceSize=300M -run.test.jvmargs.octane.main=${run.test.jvmargs.common} +# Use best known performance options for octane +run.test.jvmargs.octane.main=${run.test.jvmargs.common} -Dnashorn.lazy -XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode -XX:TypeProfileLevel=222 +# Security manager args - make sure that we run with the nashorn.policy that the build creates run.test.jvmsecurityargs=-Xverify:all -Djava.security.manager -Djava.security.policy=${basedir}/build/nashorn.policy # VM options for script tests with @fork option test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -cp ${run.test.classpath} # path of rhino.jar for benchmarks -rhino.jar= +rhino.dir=/Users/marcus/src/rhino +rhino.jar=${rhino.dir}/js.jar v8.shell=d8 +# How many iterations should 'ant octane' run for each +# benchmark +octane.iterations=25 + +# List of octane tests to run, as properties prefixed with +# "octane.benchmark." mapping to the benchmark name in +# the test harness +# +# Octane tests that are disabled should have their entire line +# commented out Tests may be disabled for functionality reasons when +# they have bugs or when the runtime doesn't handle them (yet) +octane.benchmark.box2d=box2d +#octane.benchmark.code-load=code-load +octane.benchmark.crypto=crypto +octane.benchmark.deltablue=deltablue +octane.benchmark.earley-boyer=earley-boyer +octane.benchmark.gbemu=gbemu +octane.benchmark.navier-stokes=navier-stokes +octane.benchmark.mandreel=mandreel +octane.benchmark.pdfjs=pdfjs +octane.benchmark.raytrace=raytrace +octane.benchmark.regexp=regexp +octane.benchmark.richards=richards +octane.benchmark.splay=splay +#octane.benchmark.typescript=typescript +#octane.benchmark.zlib=zlib + #path to rhino jar file octaneperf-sys-prop.rhino.jar=${rhino.jar} #timeout for performance tests in minutes octaneperf-sys-prop.timeout.value=10 -################ -# codecoverage # -################ +################# +# code coverage # +################# + #enable/disable code coverage; please redifine in the ${user.home}/.nashorn.project.local.properties make.code.coverage=false #type of codecoverage; one of static or dynamic. Now only dynamic is supported diff -r 7b54e2362c6c -r 0b8af588070b nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties --- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties Wed May 21 16:12:40 2014 +0200 +++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties Tue May 27 21:25:07 2014 +0200 @@ -170,7 +170,7 @@ is_undocumented=true, \ params=",*", \ desc="Enable logging of a given level for a given number of sub systems. \ - [for example: --log=fields:finest,codegen:info]", \ + [for example: --log=fields:finest,codegen:info].", \ type=Log \ } @@ -198,23 +198,23 @@ name="--no-java", \ short_name="-nj", \ is_undocumented=true, \ - desc="No Java support", \ + desc="Disable Java support.", \ default=false \ } -nashorn.option.no.syntax.extensions = { \ - name="--no-syntax-extensions", \ - short_name="-nse", \ - is_undocumented=true, \ - desc="No non-standard syntax extensions", \ - default=false \ +nashorn.option.no.syntax.extensions = { \ + name="--no-syntax-extensions", \ + short_name="-nse", \ + is_undocumented=true, \ + desc="Disallow non-standard syntax extensions.", \ + default=false \ } nashorn.option.no.typed.arrays = { \ name="--no-typed-arrays", \ short_name="-nta", \ is_undocumented=true, \ - desc="No Typed arrays support", \ + desc="Disable typed arrays support.", \ default=false \ } @@ -300,20 +300,20 @@ desc="Enable scripting features." \ } -nashorn.option.stdout = { \ - name="--stdout", \ - is_undocumented=true, \ - type=String, \ - params="", \ - desc="Redirect stdout to a filename or to another tty, e.g. stderr" \ +nashorn.option.stdout = { \ + name="--stdout", \ + is_undocumented=true, \ + type=String, \ + params="", \ + desc="Redirect stdout to a filename or to another tty, e.g. stderr." \ } -nashorn.option.stderr = { \ - name="--stderr", \ - is_undocumented=true, \ - type=String, \ - params="", \ - desc="Redirect stderr to a filename or to another tty, e.g. stdout" \ +nashorn.option.stderr = { \ + name="--stderr", \ + is_undocumented=true, \ + type=String, \ + params="", \ + desc="Redirect stderr to a filename or to another tty, e.g. stdout." \ } nashorn.option.timezone = { \ @@ -333,14 +333,14 @@ type=Locale \ } -nashorn.option.trace.callsites = { \ - name="--trace-callsites", \ - short_name="-tcs", \ - is_undocumented=true, \ - type=keyvalues, \ - params="[=[option,]*]", \ - desc="Enable callsite trace mode. Options are: miss [trace callsite misses] \ - enterexit [trace callsite enter/exit], objects [print object properties]" \ +nashorn.option.trace.callsites = { \ + name="--trace-callsites", \ + short_name="-tcs", \ + is_undocumented=true, \ + type=keyvalues, \ + params="[=[option,]*]", \ + desc="Enable callsite trace mode. Options are: miss [trace callsite misses] \ + enterexit [trace callsite enter/exit], objects [print object properties]." \ } nashorn.option.verify.code = { \ diff -r 7b54e2362c6c -r 0b8af588070b nashorn/test/script/basic/run-octane.js --- a/nashorn/test/script/basic/run-octane.js Wed May 21 16:12:40 2014 +0200 +++ b/nashorn/test/script/basic/run-octane.js Tue May 27 21:25:07 2014 +0200 @@ -25,13 +25,6 @@ * @subtest */ -var read; -try { - read = readFully; -} catch (e) { - print("ABORTING: Cannot find 'readFully'. You must have scripting enabled to use this test harness. (-scripting)"); - throw e; -} function initZlib() { zlib = new BenchmarkSuite('zlib', [152815148], [ @@ -62,7 +55,7 @@ // TODO: why is this path hard coded when it's defined in project properties? var path = dir + "../external/octane/"; -var runtime = ""; +var runtime = undefined; var verbose = false; var numberOfIterations = 5; @@ -133,7 +126,7 @@ benchmarks[x].Setup(); } BenchmarkSuite.ResetRNG(); - print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); + print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds"); var scores = []; @@ -188,8 +181,12 @@ print_always(arg, res); } +function runtime_string() { + return runtime == undefined ? "" : ("[" + runtime + "] "); +} + function print_always(arg, x) { - print("[" + arg.name + "] " + x); + print(runtime_string() + "[" + arg.name + "] " + x); } function print_verbose(arg, x) { @@ -204,8 +201,6 @@ } } -runtime = "command line"; - var args = []; if (typeof $ARGS !== 'undefined') { @@ -281,7 +276,30 @@ } } -tests_found.sort(); +// returns false for rhino, v8 and all other javascript runtimes, true for Nashorn +function is_this_nashorn() { + return typeof Error.dumpStack == 'function' +} + +if (is_this_nashorn()) { + try { + read = readFully; + } catch (e) { + print("ABORTING: Cannot find 'readFully'. You must have scripting enabled to use this test harness. (-scripting)"); + throw e; + } +} + +// run tests in alphabetical order by name +tests_found.sort(function(a, b) { + if (a.name < b.name) { + return -1; + } else if (a.name > b.name) { + return 1; + } else { + return 0; + } +}); load(path + 'base.js'); run_suite(tests_found, iters);