nashorn/bin/dump_octane_code.sh
changeset 16168 f0c208287983
equal deleted inserted replaced
16167:d99db3541813 16168:f0c208287983
       
     1 #!/bin/bash
       
     2 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
       
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4 # 
       
     5 # This code is free software; you can redistribute it and/or modify it
       
     6 # under the terms of the GNU General Public License version 2 only, as
       
     7 # published by the Free Software Foundation.
       
     8 # 
       
     9 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12 # version 2 for more details (a copy is included in the LICENSE file that
       
    13 # accompanied this code).
       
    14 # 
       
    15 # You should have received a copy of the GNU General Public License version
       
    16 # 2 along with this work; if not, write to the Free Software Foundation,
       
    17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    18 # 
       
    19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    20 # or visit www.oracle.com if you need additional information or have any
       
    21 # questions.
       
    22 #
       
    23 
       
    24 #
       
    25 # The purpose of this script is to provide a large amount of IR/bytecode from a known
       
    26 # application to be diffed against the same output with a different Nashorn version.
       
    27 # That way we can quickly detect if a seemingly minute change modifies a lot of code,
       
    28 # which it most likely shouldn't. One example of this was when AccessSpecializer was
       
    29 # moved into Lower the first time, it worked fine, but as a lot of Scope information
       
    30 # at the time was finalized further down the code pipeline it did a lot fewer callsite
       
    31 # specializations. This would have been immediately detected with a before and after 
       
    32 # diff using the output from this script.
       
    33 #
       
    34 
       
    35 ITERS=$1
       
    36 if [ -z $ITERS ]; then 
       
    37     ITERS=7
       
    38 fi
       
    39 NASHORN_JAR=dist/nashorn.jar
       
    40 JVM_FLAGS="-ea -esa -server -jar ${NASHORN_JAR}"
       
    41 
       
    42 BENCHMARKS=( "box2d.js" "code-load.js" "crypto.js" "deltablue.js" "earley-boyer.js" "gbemu.js" "mandreel.js" "navier-stokes.js" "pdfjs.js" "raytrace.js" "regexp.js" "richards.js" "splay.js" )
       
    43 
       
    44 for BENCHMARK in "${BENCHMARKS[@]}"
       
    45 do     
       
    46     echo "START: ${BENCHMARK}"
       
    47     CMD="${JAVA_HOME}/bin/java ${JVM_FLAGS} -co --print-lower-parse test/script/external/octane/${BENCHMARK}"
       
    48     $CMD
       
    49     echo "END: ${BENCHMARK}"
       
    50     echo ""
       
    51 done
       
    52 
       
    53 echo "Done"