From d4287c22884798b8b910ecbf211c96841bae3e9b Mon Sep 17 00:00:00 2001 From: Marcus Lagergren Date: Wed, 28 May 2014 13:58:46 +0200 Subject: [PATCH] 8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness Reviewed-by: attila, sundar --- nashorn/bin/fixwhitespace.sh | 23 +-- nashorn/make/build-benchmark.xml | 212 +++++++++++++--------- nashorn/make/build.xml | 28 +-- nashorn/make/project.properties | 21 ++- nashorn/test/script/basic/runsunspider.js | 22 ++- 5 files changed, 181 insertions(+), 125 deletions(-) diff --git a/nashorn/bin/fixwhitespace.sh b/nashorn/bin/fixwhitespace.sh index 1005a98caa6..d3274700f71 100644 --- a/nashorn/bin/fixwhitespace.sh +++ b/nashorn/bin/fixwhitespace.sh @@ -22,15 +22,16 @@ # questions. # -#convert tabs to spaces -find . -name "*.java" -exec sed -i "" 's/ / /g' {} \; - -#remove trailing whitespace -find . -name "*.java" -exec sed -i "" 's/[ ]*$//' \{} \; - -#convert tabs to spaces -find . -name "*.js" -exec sed -i "" 's/ / /g' {} \; - -#remove trailing whitespace -find . -name "*.js" -exec sed -i "" 's/[ ]*$//' \{} \; +fix() { + #convert tabs to spaces + find . -name $1 -exec sed -i "" 's/ / /g' {} \; + #remove trailing whitespace + find . -name $1 -exec sed -i "" 's/[ ]*$//' \{} \; +} +if [ ! -z $1 ]; then + fix $1; +else + fix "*.java" + fix "*.js" +fi diff --git a/nashorn/make/build-benchmark.xml b/nashorn/make/build-benchmark.xml index c2666d18d4d..ae76718fd03 100644 --- a/nashorn/make/build-benchmark.xml +++ b/nashorn/make/build-benchmark.xml @@ -7,40 +7,41 @@ This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. - + This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). - + You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - - - + - + + - + @@ -48,10 +49,11 @@ - - + + + - + @@ -60,9 +62,10 @@ - + + - + @@ -71,9 +74,10 @@ - + + - + @@ -82,20 +86,22 @@ - + + - + - - - + + + + - + @@ -103,10 +109,11 @@ - - + + + - + @@ -115,9 +122,10 @@ - + + - + @@ -126,9 +134,10 @@ - + + - + @@ -137,9 +146,10 @@ - + + - + @@ -148,9 +158,10 @@ - + + - + @@ -159,9 +170,10 @@ - + + - + @@ -170,9 +182,10 @@ - + + - + @@ -181,9 +194,10 @@ - + + - + @@ -192,9 +206,10 @@ - + + - + @@ -209,76 +224,92 @@ - - - - - - - - - - - - - - - - + - - + + - - + - - + - - - + - + - + - + - + - + - - - + + + - + - + @@ -336,11 +367,11 @@ - + + dir="${sunspider-test-sys-prop.test.js.roots}" + excludes="${sunspider-test-sys-prop.test.js.exclude.list}"> @@ -349,7 +380,9 @@ - + + + + + + @@ -370,6 +406,9 @@ + + + @@ -384,6 +423,9 @@ + + + diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml index a20473548a5..993b6e155d3 100644 --- a/nashorn/make/build.xml +++ b/nashorn/make/build.xml @@ -1,4 +1,5 @@ + + @@ -46,7 +48,7 @@ - + @@ -381,15 +383,15 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + - + - + - - + + @@ -404,7 +406,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + @@ -423,7 +425,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + @@ -463,20 +465,18 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - - + failonerror="true" + fork="true"> - + @@ -593,7 +593,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties index d7ac22a533f..847c0caa163 100644 --- a/nashorn/make/project.properties +++ b/nashorn/make/project.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -185,6 +185,7 @@ test262-test-sys-prop.test.js.shared.context=true # test262 test root test262-test-sys-prop.test.js.roots=${test262.suite.dir} + # test262 enable/disable strict mode tests test262-test-sys-prop.test.js.enable.strict.mode=true @@ -305,7 +306,7 @@ run.test.jvmsecurityargs=-Xverify:all -Djava.security.manager -Djava.security.po 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.dir=/Users/marcus/src/rhino +rhino.dir= rhino.jar=${rhino.dir}/js.jar v8.shell=d8 @@ -343,19 +344,25 @@ octaneperf-sys-prop.rhino.jar=${rhino.jar} #timeout for performance tests in minutes octaneperf-sys-prop.timeout.value=10 +#how many iterations to run sunspider after warmup +sunspider.iterations=3000 + ################# # code coverage # ################# - #enable/disable code coverage; please redifine in the ${user.home}/.nashorn.project.local.properties +#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 + +#type of codecoverage; one of static or dynamic. Now only dynamic is supported jcov=dynamic - #naming of CC results - #NB directory specified in the cc.dir will be cleaned up!!! + +#naming of CC results +#NB directory specified in the cc.dir will be cleaned up!!! cc.dir=${basedir}/../Codecoverage_Nashorn cc.result.file.name=CC_${jcov}_nashorn.xml - #dynamic CC parameters; please redefine in the ${user.home}/.nashorn.project.local.properties + +#dynamic CC parameters; please redefine in the ${user.home}/.nashorn.project.local.properties jcov2.lib.dir=${basedir}/../jcov2/lib jcov.jar=${jcov2.lib.dir}/jcov.jar cc.include=jdk\.nashorn\.* diff --git a/nashorn/test/script/basic/runsunspider.js b/nashorn/test/script/basic/runsunspider.js index f0abc114084..d86f09b3335 100644 --- a/nashorn/test/script/basic/runsunspider.js +++ b/nashorn/test/script/basic/runsunspider.js @@ -127,26 +127,32 @@ function runsuite(tests) { assertEq(tests[n].actual(), tests[n].expected()); } + var times = 0; if (typeof tests[n].rerun !== 'undefined' && tests[n].times > 0) { pprint("rerunning " + tests[n].name + " " + tests[n].times + " times..."); - var times = 0; var to = tests[n].times; var elemsPerPercent = to / 100; var po = 0|(to / 10); - times = 0; - for (; times < to; times++) { + pprint("Doing warmup."); + for (times = 0; times < to; times++) { + initrandom(); + tests[n].rerun(); + } + + pprint("Doing hot runs."); + for (times = 0; times < to; times++) { initrandom(); tests[n].rerun(); if ((times % (po|0)) == 0) { - pprint(times/to * 100 + "%"); + pprint("\t" + times/to * 100 + "%"); } } } - var t = new Date - dd; - pprint("time: " + t + " ms"); + var t = Math.round(((new Date - dd) / (times == 0 ? 1 : times)) * 100 / 100); + pprint("time per iteration: " + t + " ms"); if (typeof tests[n].actual !== 'undefined') { assertEq(tests[n].actual(), tests[n].expected()); } @@ -156,7 +162,7 @@ function runsuite(tests) { changed = true; } catch(e) { - if(runall) { + if (runall) { print("FAIL!"); } else { throw e; @@ -174,7 +180,7 @@ function runsuite(tests) { for (var n = 0; n < tests.length; n++) { var time = "" + res[n]; - while (time.length < 4) { + while (time.length < 6) { time = " " + time; } time += " ms";