Path: blob/aarch64-shenandoah-jdk8u272-b10/nashorn/make/build-benchmark.xml
32278 views
<?xml version="1.0" encoding="UTF-8"?>12<!--3Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.4DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.56This code is free software; you can redistribute it and/or modify it7under the terms of the GNU General Public License version 2 only, as8published by the Free Software Foundation.910This code is distributed in the hope that it will be useful, but WITHOUT11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13version 2 for more details (a copy is included in the LICENSE file that14accompanied this code).1516You should have received a copy of the GNU General Public License version172 along with this work; if not, write to the Free Software Foundation,18Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.1920Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21or visit www.oracle.com if you need additional information or have any22questions.23-->242526<project27name="nashorn-benchmarks"28default="all"29basedir=".."30xmlns:if="ant:if">3132<!--33Below are the octane benchmarks that should be run.34The ones that are excluded, as Nashorn currently has35some issues with them (functionality or performance)36are commented out37-->3839<!-- box2d -->40<target name="octane-box2d" depends="octane-box2d-nashorn"/>41<target name="octane-box2d-nashorn" depends="jar">42<run-one cond="octane.benchmark.box2d" runtime="nashorn"/>43</target>44<target name="octane-box2d-v8" depends="jar">45<run-one cond="octane.benchmark.box2d" runtime="v8"/>46</target>47<target name="octane-box2d-rhino" depends="jar">48<run-one cond="octane.benchmark.box2d" runtime="rhino"/>49</target>5051<!-- code-load -->52<target name="octane-code-load" depends="octane-code-load-nashorn"/>53<target name="octane-code-load-nashorn" depends="jar">54<run-one cond="octane.benchmark.code-load" runtime="nashorn"/>55</target>56<target name="octane-code-load-v8" depends="jar">57<run-one cond="octane.benchmark.code-load" runtime="v8"/>58</target>59<target name="octane-code-load-rhino" depends="jar">60<run-one cond="octane.benchmark.code-load" runtime="rhino"/>61</target>6263<!-- crypto -->64<target name="octane-crypto" depends="octane-crypto-nashorn"/>65<target name="octane-crypto-nashorn" depends="jar">66<run-one cond="octane.benchmark.crypto" runtime="nashorn"/>67</target>68<target name="octane-crypto-v8" depends="jar">69<run-one cond="octane.benchmark.crypto" runtime="v8"/>70</target>71<target name="octane-crypto-rhino" depends="jar">72<run-one cond="octane.benchmark.crypto" runtime="rhino"/>73</target>7475<!-- deltablue -->76<target name="octane-deltablue" depends="octane-deltablue-nashorn"/>77<target name="octane-deltablue-nashorn" depends="jar">78<run-one cond="octane.benchmark.deltablue" runtime="nashorn"/>79</target>80<target name="octane-deltablue-v8" depends="jar">81<run-one cond="octane.benchmark.deltablue" runtime="v8"/>82</target>83<target name="octane-deltablue-rhino" depends="jar">84<run-one cond="octane.benchmark.deltablue" runtime="rhino"/>85</target>8687<!-- earley-boyer -->88<target name="octane-earley-boyer" depends="octane-earley-boyer-nashorn"/>89<target name="octane-earley-boyer-nashorn" depends="jar">90<run-one cond="octane.benchmark.earley-boyer" runtime="nashorn"/>91</target>92<target name="octane-earley-boyer-v8" depends="jar">93<run-one cond="octane.benchmark.earley-boyer" runtime="v8"/>94</target>95<target name="octane-earley-boyer-rhino" depends="jar">96<run-one cond="octane.benchmark.earley-boyer" runtime="rhino"/>97</target>9899<!-- gbemu -->100<target name="octane-gbemu" depends="octane-gbemu-nashorn"/>101<target name="octane-gbemu-nashorn" depends="jar">102<run-one cond="octane.benchmark.gbemu" runtime="nashorn"/>103</target>104<target name="octane-gbemu-v8" depends="jar">105<run-one cond="octane.benchmark.gbemu" runtime="v8"/>106</target>107<target name="octane-gbemu-rhino" depends="jar">108<run-one cond="octane.benchmark.gbemu" runtime="rhino"/>109</target>110111<!-- mandreel -->112<target name="octane-mandreel" depends="octane-mandreel-nashorn"/>113<target name="octane-mandreel-nashorn" depends="jar">114<run-one cond="octane.benchmark.mandreel" runtime="nashorn"/>115</target>116<target name="octane-mandreel-v8" depends="jar">117<run-one cond="octane.benchmark.mandreel" runtime="v8"/>118</target>119<target name="octane-mandreel-rhino" depends="jar">120<run-one cond="octane.benchmark.mandreel" runtime="rhino"/>121</target>122123<!-- navier-stokes -->124<target name="octane-navier-stokes" depends="octane-navier-stokes-nashorn"/>125<target name="octane-navier-stokes-nashorn" depends="jar">126<run-one cond="octane.benchmark.navier-stokes" runtime="nashorn"/>127</target>128<target name="octane-navier-stokes-v8" depends="jar">129<run-one cond="octane.benchmark.navier-stokes" runtime="v8"/>130</target>131<target name="octane-navier-stokes-rhino" depends="jar">132<run-one cond="octane.benchmark.navier-stokes" runtime="rhino"/>133</target>134135<!-- pdfjs -->136<target name="octane-pdfjs" depends="octane-pdfjs-nashorn"/>137<target name="octane-pdfjs-nashorn" depends="jar">138<run-one cond="octane.benchmark.pdfjs" runtime="nashorn"/>139</target>140<target name="octane-pdfjs-v8" depends="jar">141<run-one cond="octane.benchmark.pdfjs" runtime="v8"/>142</target>143<target name="octane-pdfjs-rhino" depends="jar">144<run-one cond="octane.benchmark.pdfjs" runtime="rhino"/>145</target>146147<!-- raytrace -->148<target name="octane-raytrace" depends="octane-raytrace-nashorn"/>149<target name="octane-raytrace-nashorn" depends="jar">150<run-one cond="octane.benchmark.raytrace" runtime="nashorn"/>151</target>152<target name="octane-raytrace-v8" depends="jar">153<run-one cond="octane.benchmark.raytrace" runtime="v8"/>154</target>155<target name="octane-raytrace-rhino" depends="jar">156<run-one cond="octane.benchmark.raytrace" runtime="rhino"/>157</target>158159<!-- regexp -->160<target name="octane-regexp" depends="octane-regexp-nashorn"/>161<target name="octane-regexp-nashorn" depends="jar">162<run-one cond="octane.benchmark.regexp" runtime="nashorn"/>163</target>164<target name="octane-regexp-v8" depends="jar">165<run-one cond="octane.benchmark.regexp" runtime="v8"/>166</target>167<target name="octane-regexp-rhino" depends="jar">168<run-one cond="octane.benchmark.regexp" runtime="rhino"/>169</target>170171<!-- richards -->172<target name="octane-richards" depends="octane-richards-nashorn"/>173<target name="octane-richards-nashorn" depends="jar">174<run-one cond="octane.benchmark.richards" runtime="nashorn"/>175</target>176<target name="octane-richards-v8" depends="jar">177<run-one cond="octane.benchmark.richards" runtime="v8"/>178</target>179<target name="octane-richards-rhino" depends="jar">180<run-one cond="octane.benchmark.richards" runtime="rhino"/>181</target>182183<!-- splay -->184<target name="octane-splay" depends="octane-splay-nashorn"/>185<target name="octane-splay-nashorn" depends="jar">186<run-one cond="octane.benchmark.splay" runtime="nashorn"/>187</target>188<target name="octane-splay-v8" depends="jar">189<run-one cond="octane.benchmark.splay" runtime="v8"/>190</target>191<target name="octane-splay-rhino" depends="jar">192<run-one cond="octane.benchmark.splay" runtime="rhino"/>193</target>194195<!-- typescript -->196<target name="octane-typescript" depends="octane-typescript-nashorn"/>197<target name="octane-typescript-nashorn" depends="jar">198<run-one cond="octane.benchmark.typescript" runtime="nashorn"/>199</target>200<target name="octane-typescript-v8" depends="jar">201<run-one cond="octane.benchmark.typescript" runtime="v8"/>202</target>203<target name="octane-typescript-rhino" depends="jar">204<run-one cond="octane.benchmark.typescript" runtime="rhino"/>205</target>206207<!-- zlib -->208<target name="octane-zlib" depends="octane-zlib-nashorn"/>209<target name="octane-zlib-nashorn" depends="jar">210<run-one cond="octane.benchmark.zlib" runtime="nashorn"/>211</target>212<target name="octane-zlib-v8" depends="jar">213<run-one cond="octane.benchmark.zlib" runtime="v8"/>214</target>215<target name="octane-zlib-rhino" depends="jar">216<run-one cond="octane.benchmark.zlib" runtime="rhino"/>217</target>218219<!--220Benchmark runners for one or more benchmarks, single221or multiple process222-->223224<target name="octane-process-separate" if="${octane-test-sys-prop.separate.process}">225<echo message="Running each benchmark in separate processes, starting new JVMs for each."/>226<script language="javascript"><![CDATA[227var props = [];228229for (var prop in project.getProperties()) {230if (prop.startsWith("octane.benchmark.")) {231props.push(prop);232}233}234235//sort benchmark props in alphabetical order by name236props.sort(function(a, b) {237if (a < b) {238return -1;239} else if (a > b) {240return 1;241} else {242return 0;243}244});245246var runtime = project.getProperty("runtime");247248for (var i in props) {249var task = project.createTask("run-one");250// workaround for https://issues.apache.org/bugzilla/show_bug.cgi?id=53831, still not fixed251if (task.getOwningTarget() == null) {252task.setOwningTarget(self.getOwningTarget());253}254var prop = props[i];255task.setDynamicAttribute("cond", prop);256task.setDynamicAttribute("runtime", runtime);257task.perform();258}259]]></script>260</target>261262<target name="octane-process-single" unless="${octane-test-sys-prop.separate.process}">263<echo message="Running all benchmarks in the same process."/>264<pathconvert property="octane.benchmarks" pathsep=" ">265<propertyset>266<propertyref prefix="octane.benchmark."/>267</propertyset>268</pathconvert>269<antcall target="run-octane${runtime}">270<param name="octane-tests" value="${octane.benchmarks}"/>271</antcall>272</target>273274<!--275run 'octane' in single or separate processes based on config276This uses nashorn as the default runtime277-->278<target name="octane-nashorn" depends="jar">279<property name="runtime" value="nashorn"/>280<antcall target="octane-process-separate"/>281<antcall target="octane-process-single"/>282</target>283284<!-- alias for 'octane' -->285<target name="octane" depends="octane-nashorn"/>286287<!-- run octane benchmarks using octane as runtime -->288<target name="octane-v8" depends="jar">289<property name="runtime" value="v8"/>290<antcall target="octane-process-separate"/>291<antcall target="octane-process-single"/>292</target>293294<!-- run octane benchmarks using Rhino as runtime -->295<target name="octane-rhino" depends="jar">296<property name="runtime" value="rhino"/>297<antcall target="octane-process-separate"/>298<antcall target="octane-process-single"/>299</target>300301<macrodef name="run-one">302<attribute name="cond"/>303<attribute name="runtime" default=""/>304<sequential>305<antcall target="run-octane-@{runtime}" if:set="@{cond}">306<param name="octane-tests" value="${@{cond}}"/>307</antcall>308</sequential>309</macrodef>310311<target name="run-octane-nashorn">312<java classname="${nashorn.shell.tool}"313classpath="${run.test.classpath}"314fork="true"315dir=".">316<jvmarg line="${ext.class.path}"/>317<jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>318<!-- pass on all properties prefixed with 'nashorn' to the runtime -->319<syspropertyset>320<propertyref prefix="nashorn."/>321</syspropertyset>322<arg value="${octane-test-sys-prop.test.js.framework}"/>323<arg value="-scripting"/>324<arg value="--"/>325<arg value="${octane-tests}"/>326<arg value="--runtime"/>327<arg value="nashorn"/>328<arg value="--verbose"/>329<arg value="--iterations ${octane.iterations}"/>330</java>331</target>332333<target name="run-octane-v8">334<exec executable="${v8.shell}">335<arg value="${octane-test-sys-prop.test.js.framework}"/>336<arg value="--"/>337<arg value="${octane-tests}"/>338<arg value="--runtime"/>339<arg value="v8"/>340<arg value="--verbose"/>341<arg value="--iterations ${octane.iterations}"/>342</exec>343</target>344345<target name="run-octane-rhino">346<java jar="${rhino.jar}"347classpath="${run.test.classpath}"348fork="true"349dir=".">350<jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>351<arg value="-opt"/>352<arg value="9"/>353<arg value="${octane-test-sys-prop.test.js.framework}"/>354<arg value="${octane-tests}"/>355<arg value="--runtime"/>356<arg value="rhino"/>357<arg value="--verbose"/>358<arg value="--iterations ${octane.iterations}"/>359</java>360</target>361362<!-- run octane with all known runtimes for comparison -->363<target name="octane-all" depends="octane, octane-v8, octane-rhino">364<exec executable="${v8.shell}">365<arg value="${octane-test-sys-prop.test.js.framework}"/>366<arg value="${octane-tests}/"/>367</exec>368</target>369370<target name="sunspider-init" depends="jar">371<fileset id="sunspider-set"372dir="${sunspider-test-sys-prop.test.js.roots}"373excludes="${sunspider-test-sys-prop.test.js.exclude.list}">374<include name="**/*.js"/>375</fileset>376<pathconvert pathsep=" " property="sunspider-tests" refid="sunspider-set"/>377</target>378379<!--- SUNSPIDER JOB BELOW -->380381<!-- run sunspider with Nashorn -->382<target name="sunspider" depends="sunspider-nashorn"/>383384<target name="sunspider-nashorn" depends="sunspider-init">385<java classname="${nashorn.shell.tool}"386classpath="${run.test.classpath}"387fork="true"388dir=".">389<jvmarg line="${ext.class.path}"/>390<jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>391<arg value="-timezone=PST"/>392<arg value="--class-cache-size=50"/>393<arg value="${sunspider-test-sys-prop.test.js.framework}"/>394<arg value="--"/>395<arg value="${sunspider-tests}/"/>396<arg value="--verbose"/>397<arg value="--times"/>398<arg value="${sunspider.iterations}"/>399</java>400</target>401402<!-- run sunspider with v8 -->403<target name="sunspider-v8" depends="sunspider-init">404<exec executable="${v8.shell}">405<arg value="${sunspider-test-sys-prop.test.js.framework}"/>406<arg value="--"/>407<arg value="${sunspider-tests}/"/>408<arg value="--verbose"/>409<arg value="--times"/>410<arg value="${sunspider.iterations}"/>411</exec>412</target>413414<!-- run sunspider with Rhino -->415<target name="sunspider-rhino" depends="sunspider-init">416<java jar="${rhino.jar}"417classpath="${run.test.classpath}"418fork="true"419dir=".">420<jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>421<arg value="-opt"/>422<arg value="9"/>423<arg value="${sunspider-test-sys-prop.test.js.framework}"/>424<arg value="${sunspider-tests}/"/>425<arg value="--verbose"/>426<arg value="--times"/>427<arg value="${sunspider.iterations}"/>428</java>429</target>430431</project>432433434