nashorn/make/build-benchmark.xml
changeset 36764 298caeee3757
parent 36697 665335352bb7
equal deleted inserted replaced
36720:7359994942f8 36764:298caeee3757
   215   </target>
   215   </target>
   216   <target name="octane-zlib-rhino" depends="jar">
   216   <target name="octane-zlib-rhino" depends="jar">
   217     <run-one cond="octane.benchmark.zlib" runtime="rhino"/>
   217     <run-one cond="octane.benchmark.zlib" runtime="rhino"/>
   218   </target>
   218   </target>
   219 
   219 
       
   220   <target name="-define-nashorn-task">
       
   221     <ant dir="${nashorntask.dir}" inheritAll="false"/>
       
   222     <taskdef name="nashorn" classname="jdk.nashorn.ant.NashornTask" classpath="${nashorntask.dir}/dist/nashorntask.jar"/>
       
   223   </target>
       
   224 
   220   <!--
   225   <!--
   221       Benchmark runners for one or more benchmarks, single
   226       Benchmark runners for one or more benchmarks, single
   222       or multiple process
   227       or multiple process
   223   -->
   228   -->
   224 
   229 
   225   <target name="octane-process-separate" if="${octane-test-sys-prop.separate.process}">
   230   <target name="octane-process-separate" if="${octane-test-sys-prop.separate.process}"
       
   231       depends="-define-nashorn-task">
   226     <echo message="Running each benchmark in separate processes, starting new JVMs for each."/>
   232     <echo message="Running each benchmark in separate processes, starting new JVMs for each."/>
   227     <script language="javascript"><![CDATA[
   233     <nashorn><![CDATA[
   228       var props = [];
   234       var props = [];
   229 
   235 
   230       for (var prop in project.getProperties()) {
   236       for (var prop in project.getProperties()) {
   231         if (prop.startsWith("octane.benchmark.")) {
   237         if (prop.startsWith("octane.benchmark.")) {
   232           props.push(prop);
   238           props.push(prop);
   255         var prop = props[i];
   261         var prop = props[i];
   256         task.setDynamicAttribute("cond", prop);
   262         task.setDynamicAttribute("cond", prop);
   257         task.setDynamicAttribute("runtime", runtime);
   263         task.setDynamicAttribute("runtime", runtime);
   258 	task.perform();
   264 	task.perform();
   259       }
   265       }
   260     ]]></script>
   266     ]]></nashorn>
   261   </target>
   267   </target>
   262 
   268 
   263   <target name="octane-process-single" unless="${octane-test-sys-prop.separate.process}">
   269   <target name="octane-process-single" unless="${octane-test-sys-prop.separate.process}">
   264     <echo message="Running all benchmarks in the same process."/>
   270     <echo message="Running all benchmarks in the same process."/>
   265     <pathconvert property="octane.benchmarks" pathsep=" ">
   271     <pathconvert property="octane.benchmarks" pathsep=" ">
   276        run 'octane' in single or separate processes based on config
   282        run 'octane' in single or separate processes based on config
   277        This uses nashorn as the default runtime
   283        This uses nashorn as the default runtime
   278   -->
   284   -->
   279   <target name="octane-nashorn" depends="jar">
   285   <target name="octane-nashorn" depends="jar">
   280     <property name="runtime" value="nashorn"/>
   286     <property name="runtime" value="nashorn"/>
   281     <!--
   287     <antcall target="octane-process-separate"/>
   282        Temporarily disabled because ant script tag is broken with
   288     <antcall target="octane-process-single"/>
   283        jdk9. See also: JDK-8152533.
       
   284 
       
   285        <antcall target="octane-process-separate"/>
       
   286        <antcall target="octane-process-single"/>
       
   287     -->
       
   288     <echo message="octane target temporarily disabled"/>
       
   289   </target>
   289   </target>
   290 
   290 
   291   <!-- alias for 'octane' -->
   291   <!-- alias for 'octane' -->
   292   <target name="octane" depends="octane-nashorn"/>
   292   <target name="octane" depends="octane-nashorn"/>
   293 
   293 
   316   </macrodef>
   316   </macrodef>
   317 
   317 
   318   <target name="run-octane-nashorn">
   318   <target name="run-octane-nashorn">
   319     <java classname="${nashorn.shell.tool}"
   319     <java classname="${nashorn.shell.tool}"
   320           classpath="${run.test.classpath}"
   320           classpath="${run.test.classpath}"
   321           fork="true"
   321           fork="true">
   322           dir=".">
       
   323       <jvmarg line="${boot.class.path}"/>
       
   324       <jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>
   322       <jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>
   325       <!-- pass on all properties prefixed with 'nashorn' to the runtime -->
   323       <!-- pass on all properties prefixed with 'nashorn' to the runtime -->
   326       <syspropertyset>
   324       <syspropertyset>
   327         <propertyref prefix="nashorn."/>
   325         <propertyref prefix="nashorn."/>
   328       </syspropertyset>
   326       </syspropertyset>
   389   <target name="sunspider" depends="sunspider-nashorn"/>
   387   <target name="sunspider" depends="sunspider-nashorn"/>
   390 
   388 
   391   <target name="sunspider-nashorn" depends="sunspider-init">
   389   <target name="sunspider-nashorn" depends="sunspider-init">
   392     <java classname="${nashorn.shell.tool}"
   390     <java classname="${nashorn.shell.tool}"
   393           classpath="${run.test.classpath}"
   391           classpath="${run.test.classpath}"
   394           fork="true"
   392           fork="true">
   395           dir=".">
       
   396       <jvmarg line="${boot.class.path}"/>
       
   397       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   393       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   398       <arg value="-timezone=PST"/>
   394       <arg value="-timezone=PST"/>
   399       <arg value="--class-cache-size=50"/>
   395       <arg value="--class-cache-size=50"/>
   400       <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
   396       <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
   401       <arg value="--"/>
   397       <arg value="--"/>