changeset 1260:fd5d4ebfe7db

Merge
author asaha
date Mon, 27 Oct 2014 14:36:13 -0700
parents cf8a0b40b754 8651c6f57d1d
children 72c7148acf87
files .hgtags bin/checkintest.sh bin/dump_octane_code.sh bin/fixorphantests.sh bin/fixwhitespace.sh bin/jjs bin/jjs.bat bin/jjssecure bin/jjssecure.bat bin/nashorn bin/nashorn.bat bin/nashornsecure bin/nashornsecure.bat bin/rm-non-tracked.sh bin/verbose_octane.bat bin/verbose_octane.sh src/jdk/nashorn/api/scripting/resources/engine.js src/jdk/nashorn/internal/codegen/Attr.java src/jdk/nashorn/internal/codegen/FinalizeTypes.java src/jdk/nashorn/internal/codegen/RangeAnalyzer.java src/jdk/nashorn/internal/codegen/types/Range.java src/jdk/nashorn/internal/ir/TemporarySymbols.java src/jdk/nashorn/internal/objects/annotations/SpecializedConstructor.java src/jdk/nashorn/internal/runtime/CompiledFunctions.java src/jdk/nashorn/internal/runtime/CompiledScript.java src/jdk/nashorn/internal/runtime/DebugLogger.java src/jdk/nashorn/internal/runtime/Logging.java test/script/basic/JDK-8010697.js test/script/basic/JDK-8010697.js.EXPECTED test/script/basic/arraysIntKey.js test/script/basic/arraysIntKey.js.EXPECTED test/script/basic/compile-octane.js.EXPECTED test/script/basic/ranges_disabled.js test/script/basic/ranges_disabled.js.EXPECTED test/script/basic/ranges_enabled.js test/script/basic/ranges_enabled.js.EXPECTED test/script/basic/ranges_payload.js test/script/basic/runsunspider-eager.js test/script/basic/runsunspider-lazy.js test/script/basic/runsunspider-lazy.js.EXPECTED test/script/maptests/property_delete.js
diffstat 1715 files changed, 57045 insertions(+), 23354 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Oct 20 23:09:19 2014 -0700
+++ b/.hgtags	Mon Oct 27 14:36:13 2014 -0700
@@ -328,4 +328,16 @@
 3505d266634ded89bf9617ff6b385ab8a52f78cf jdk8u31-b03
 96acff2ad9e19aa80c4f7ed60d87a422bca1ea91 jdk8u31-b04
 5fc3f210872d365c57ed4e8dba3926d9ed5c7e45 jdk8u31-b05
+f2925491b61b22ac42f8c30ee9c6723ffa401a4c jdk8u40-b00
+62468d841b842769d875bd97d10370585c296eb7 jdk8u40-b01
+b476c69c820ac1e05071f4de5abab8e2dff80e87 jdk8u40-b02
+a2e0a985764b5afd5f316429bfab4f44bf150f7f jdk8u40-b03
+34c17c95665419ed76a98f5cf1210ed58eb2eca3 jdk8u40-b04
+2d75c391f61f31538b4c3dcc9778fc6742125ec4 jdk8u40-b05
+1196f17cf7bc709766319f5bf7a5394a7251b47a jdk8u40-b06
+0032961e1866c22afe3d0bbbb217f8840be61846 jdk8u40-b07
+89551828b279233825204b72233edafc72d8feb3 jdk8u40-b08
+6a8ecdeae4a9a438eed637b5a5d0d18fddb9f711 jdk8u40-b09
+076b1f38a5ccd4692a6f93939a7fc03bc1a1bbb4 jdk8u40-b10
+57c7b273277e00f7a98fafb18ff07aa3245808f0 jdk8u40-b11
 05a3614ed5276e5db2a73cce918be04b1a2922fb jdk8u45-b00
--- a/bin/checkintest.sh	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, 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
-# 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.
-#
-
-#best pass rate at test 262 known
-TEST262_PASS_AT_LEAST=435
-
-RUN_TEST="true"
-RUN_TEST262="true"
-RUN_NODE="true"
-KEEP_OUTPUT="true"
-CLEAN_AND_BUILD_NASHORN="true"
-
-#the stable node version to sync against
-NODE_LAST_STABLE=v0.6.18
-
-#parse args
-for arg in $*
-do
-    if [ $arg = "--no-test" ]; then
-	RUN_TEST="false"
-	echo "**** WARNING - you have disabled 'ant test', which is a minimum checkin requirement..."
-    elif [ $arg = "--no-262" ]; then
-	RUN_TEST262="false"
-    elif [ $arg = "--no-node" ]; then
-	RUN_NODE="false"
-    elif [ $arg = "--no-build" ]; then
-	CLEAN_AND_BUILD_NASHORN="false"
-    elif [ $arg = "--no-logs" ]; then
-	KEEP_OUTPUT="false"
-    fi
-done
-
-function lastpart() {        
-    arr=$(echo $1 | tr "/" "\n")
-    for x in $arr
-    do
-	_last=$x
-    done
-    echo $_last
-}
-
-function check_installed() {
-    which $1 >/dev/null
-    if [ $? -ne 0 ]; then
-	echo "Error $1 not installed: $?"
-	exit 2
-    fi
-}
-
-check_installed hg
-check_installed git
-check_installed mv
-check_installed git
-
-PWD=$(pwd);
-
-while [ -z $NASHORN_ROOT ]
-do
-    if [ -e $PWD/.hg ]; then
-	NASHORN_ROOT=${PWD}
-	break
-    fi
-    PWD=$(dirname ${PWD})
-done
-
-echo "Nashorn root detected at ${NASHORN_ROOT}"
-
-COMMON_ROOT=$(dirname $NASHORN_ROOT)
-echo "Common root is ${COMMON_ROOT}"
-
-echo "Running checkintest..."
-
-ABSOLUTE_NASHORN_HOME=$COMMON_ROOT/$(lastpart $NASHORN_ROOT)
-
-if [ $CLEAN_AND_BUILD_NASHORN != "false" ]; then
-    echo "Cleaning and building nashorn at $ABSOLUTE_NASHORN_HOME/nashorn..."
-    $(cd $ABSOLUTE_NASHORN_HOME/nashorn; ant clean >/dev/null 2>/dev/null)
-    $(cd $ABSOLUTE_NASHORN_HOME/nashorn; ant jar >/dev/null 2>/dev/null)
-    echo "Done."
-fi
-
-function failure_check() {
-    while read line
-    do
-	LINE=$(echo $line | grep "Tests run")    
-	if [ "${LINE}" != "" ]; then
-	    RESULT=$(echo $line | grep "Failures: 0" | grep "Errors: 0")
-	    if [ "${RESULT}" == "" ]; then
-		TESTNAME=$2
-		echo "There were errors in ${TESTNAME} : ${LINE}"
-		exit 1
-	    fi
-	fi
-    done < $1
-}
-
-function test() {
-    TEST_OUTPUT=$ABSOLUTE_NASHORN_HOME/$(mktemp tmp.XXXXX)
-    echo "Running 'ant test' on nashorn from ${ABSOLUTE_NASHORN_HOME}/nashorn..."
-    $(cd $ABSOLUTE_NASHORN_HOME/nashorn; ant test >$TEST_OUTPUT)
-    echo "Done."
-
-    failure_check $TEST_OUTPUT
-
-    echo "**** SUCCESS: 'ant test' successful"
-
-    if [ $KEEP_OUTPUT == "true" ]; then
-	cp $TEST_OUTPUT ./checkintest.test.log
-	rm -fr $TEST_OUTPUT
-    fi
-}
-
-if [ $RUN_TEST != "false" ]; then
-    test;
-fi
-
-function test262() {
-
-    echo "Running 'ant test262parallel' on nashorn from ${ABSOLUTE_NASHORN_HOME}/nashorn..."
-    TEST262_OUTPUT=$ABSOLUTE_NASHORN_HOME/$(mktemp tmp.XXXXX)
-
-    echo "Looking for ${ABSOLUTE_NASHORN_HOME}/test/test262..."
-
-    if [ ! -e $ABSOLUTE_NASHORN_HOME/nashorn/test/test262 ]; then
-	echo "test262 is missing... looking in $COMMON_ROOT..."
-	if [ ! -e $COMMON_ROOT/test262 ]; then
-	    echo "... not there either... cloning from repo..."
-	    hg clone http://hg.ecmascript.org/tests/test262 $COMMON_ROOT/test262 >/dev/null 2>/dev/null
-	    echo "Done."
-	fi
-	echo "Adding soft link ${COMMON_ROOT}/test262 -> ${ABSOLUTE_NASHORN_HOME}/test/test262..."
-	ln -s $COMMON_ROOT/test262 $ABSOLUTE_NASHORN_HOME/nashorn/test/test262
-	echo "Done."
-    fi
-
-    echo "Ensuring test262 is up to date..."
-    $(cd $ABSOLUTE_NASHORN_HOME/nashorn/test/test262; hg pull -u >/dev/null 2>/dev/null)
-    echo "Done."
-
-    echo "Running test262..."
-    $(cd $ABSOLUTE_NASHORN_HOME/nashorn; ant test262parallel > $TEST262_OUTPUT)
-    
-    FAILED=$(cat $TEST262_OUTPUT|grep "Tests run:"| cut -d ' ' -f 15 |tr -cd '"[[:digit:]]')
-    if [ $FAILED -gt $TEST262_PASS_AT_LEAST ]; then 
-	echo "FAILURE: There are ${FAILED} failures in test262 and can be no more than ${TEST262_PASS_AT_LEAST}"
-	cp $TEST262_OUTPUT ./checkintest.test262.log
-	echo "See ./checkintest.test262.log"
-	echo "Terminating due to error"
-	exit 1
-    elif [ $FAILED -lt $TEST262_PASS_AT_LEAST ]; then
-	echo "There seem to have been fixes to 262. ${FAILED} < ${TEST262_PASS_AT_LEAST}. Please update limit in bin/checkintest.sh"
-    fi
-    
-    echo "**** SUCCESS: Test262 passed with no more than ${TEST262_PASS_AT_LEAST} failures."
-
-    if [ $KEEP_OUTPUT == "true" ]; then
-	cp $TEST262_OUTPUT ./checkintest.test262.log
-	rm -fr $TEST262_OUTPUT
-    fi    
-}
-
-if [ $RUN_TEST262 != "false" ]; then
-    test262;    
-fi;
-
-function testnode() {
-    TESTNODEJAR_OUTPUT=$ABSOLUTE_NASHORN_HOME/$(mktemp tmp.XXXXX)
-   
-    echo "Running node tests..."
-#replace node jar properties nashorn with this nashorn
-    
-    NODEJAR_PROPERTIES=~/nodejar.properties
-    
-    NODE_HOME=$(cat $NODEJAR_PROPERTIES | grep ^node.home | cut -f2 -d=)    
-    NASHORN_HOME=$(cat $NODEJAR_PROPERTIES | grep ^nashorn.home | cut -f2 -d=)
-    
-    ABSOLUTE_NODE_HOME=$COMMON_ROOT/$(lastpart $NODE_HOME)    
-    
-    echo "Writing nodejar.properties..."
-
-    cat > $NODEJAR_PROPERTIES << EOF
-node.home=../node
-nashorn.home=../$(lastpart $NASHORN_ROOT)
-EOF
-    echo "Done."
-    echo "Checking node home ${ABSOLUTE_NODE_HOME}..."
-
-    if [ ! -e $ABSOLUTE_NODE_HOME ]; then
-	echo "Node base dir not found. Cloning node..."    
-	$(cd $COMMON_ROOT; git clone https://github.com/joyent/node.git $(lastpart $NODE_HOME) >/dev/null 2>/dev/null)
-	echo "Done."
-	echo "Updating to last stable version ${NODE_LAST_STABLE}..."
-	$(cd $ABSOLUTE_NODE_HOME; git checkout $NODE_LAST_STABLE >/dev/null 2>/dev/null)
-	echo "Done."
-	echo "Running configure..."
-	$(cd $ABSOLUTE_NODE_HOME; ./configure >/dev/null 2>/dev/null)
-	echo "Done."
-    fi
-    
-    echo "Ensuring node is built..."
-#make sure node is built
-    $(cd $ABSOLUTE_NODE_HOME; make >/dev/null 2>/dev/null)
-    echo "Done."
-
-    NODEJAR_HOME=$COMMON_ROOT/nodejar
-
-    if [ ! -e $NODEJAR_HOME ]; then
-	echo "No node jar home found. cloning from depot..."
-	$(cd $COMMON_ROOT; hg clone https://hg.kenai.com/hg/nodejs~source nodejar >/dev/null 2>/dev/null) 
-	$(cd $COMMON_ROOT/nodejar; ant >/dev/null)
-	echo "Done."
-	echo "Copying node files..."
-	$(cd $COMMON_ROOT/nodejar; ant copy-node-files >/dev/null 2>/dev/null)
-	echo "Patching node files..."
-	$(cd $COMMON_ROOT/nodejar; ant patch-node-files >/dev/null 2>/dev/null)
-	echo "Done."
-    fi
-    
-    echo "Ensuring node.jar is up to date from source depot..."
-    $(cd $COMMON_ROOT/nodejar; hg pull -u >/dev/null 2>/dev/null)
-    echo "Done."
-
-    echo "Installing nashorn..."
-    $(cd $COMMON_ROOT/nodejar; ant >/dev/null)
-    echo "Done."
-
-    echo "Running node.jar test..."
-    $(cd $COMMON_ROOT/nodejar; mvn clean verify >$TESTNODEJAR_OUTPUT)
-    echo "Done."
-
-    failure_check $TESTNODEJAR_OUTPUT
-    
-    echo "**** SUCCESS: Node test successful."
-
-    if [ $KEEP_OUTPUT == "true" ]; then
-	rm -fr $TESTNODEJAR_OUTPUT
-	cp $TESTNODEJAR_OUTPUT ./checkintest.nodejar.log
-    fi
-}
-
-if [ $RUN_NODE != "false" ]; then
-    testnode;
-fi;
-
-echo "Finished"
--- a/bin/dump_octane_code.sh	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2010, 2013, 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
-# 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.
-#
-
-#
-# The purpose of this script is to provide a large amount of IR/bytecode from a known
-# application to be diffed against the same output with a different Nashorn version.
-# That way we can quickly detect if a seemingly minute change modifies a lot of code,
-# which it most likely shouldn't. One example of this was when AccessSpecializer was
-# moved into Lower the first time, it worked fine, but as a lot of Scope information
-# at the time was finalized further down the code pipeline it did a lot fewer callsite
-# specializations. This would have been immediately detected with a before and after 
-# diff using the output from this script.
-#
-
-ITERS=$1
-if [ -z $ITERS ]; then 
-    ITERS=7
-fi
-NASHORN_JAR=dist/nashorn.jar
-JVM_FLAGS="-ea -esa -server -jar ${NASHORN_JAR}"
-
-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" )
-
-for BENCHMARK in "${BENCHMARKS[@]}"
-do     
-    echo "START: ${BENCHMARK}"
-    CMD="${JAVA_HOME}/bin/java ${JVM_FLAGS} -co --print-lower-parse test/script/external/octane/${BENCHMARK}"
-    $CMD
-    echo "END: ${BENCHMARK}"
-    echo ""
-done
-
-echo "Done"
--- a/bin/fixorphantests.sh	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2010, 2013, 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
-# 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.
-#
-
-#ensure that all tests tagged with @test are also tagged with @run
-
-for f in $(find test/script/basic/*.js); do 
-    grep @test $f >/dev/null
-    TEST=$?
-    grep @run $f >/dev/null
-    RUN=$?    
-
-    if [ $TEST -eq 0 ] && [ ! $RUN -eq 0 ]; then		
-	echo "repairing ${f}..."
-	TEMP=$(mktemp /tmp/scratch.XXXXXX)
-
-	#IFS='', -raw flag to preserve white space
-	while IFS='' read -r line; do 	    
-	    echo $line | grep @test >/dev/null
-	    TEST=$?
-	    printf "%s\n" "$line" 
-	    if [ $TEST -eq 0 ]; then
-		printf "%s\n" "$line" | sed s/@test/@run/g 
-	    fi	   
-	done < $f >$TEMP
-
-	cp $TEMP $f
-
-	rm -fr $TEMP
-    fi
-
-done
--- a/bin/fixwhitespace.sh	Mon Oct 20 23:09:19 2014 -0700
+++ b/bin/fixwhitespace.sh	Mon Oct 27 14:36:13 2014 -0700
@@ -22,9 +22,16 @@
 # questions.
 #
 
-#convert tabs to spaces
-find . -name "*.java" -exec sed -i "" 's/	/    /g' {} \;
+fix() {
+    #convert tabs to spaces
+    find . -name $1 -exec sed -i "" 's/	/    /g' {} \;
+    #remove trailing whitespace
+    find . -name $1 -exec sed -i "" 's/[ 	]*$//' \{} \;
+}
 
-#remove trailing whitespace
-find . -name "*.java" -exec sed -i "" 's/[ 	]*$//' \{} \;
-
+if [ ! -z $1 ]; then 
+    fix $1;
+else
+    fix "*.java"
+    fix "*.js"
+fi
--- a/bin/jjs	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# 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.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/java -server -XX:+TieredCompilation -Xms2G -Xmx2G -esa -ea -Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+HeapDumpOnOutOfMemoryError -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.debug=true jdk.nashorn.tools.Shell $*
--- a/bin/jjs.bat	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.ext.dirs=%~dp0\..\dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false jdk.nashorn.tools.Shell
--- a/bin/jjssecure	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# 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.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.security.properties=`dirname $0`/../make/java.security.override -Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=true -Dnashorn.home=`dirname $0`/.. -Djava.security.manager jdk.nashorn.tools.Shell $*
--- a/bin/jjssecure.bat	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-java -Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -Djava.security.properties=%~dp0\..\make\java.security.override -Djava.ext.dirs=%~dp0\..\dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.home=%~dp0\.. -Djava.security.manager jdk.nashorn.tools.Shell
--- a/bin/nashorn	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# 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.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/jrunscript -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $*
--- a/bin/nashorn.bat	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-jrunscript -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=%~dp0\..\dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Dnashorn.debug=true -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -l nashorn
--- a/bin/nashornsecure	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# 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.
-#
-
-[ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
-
-$JAVA_HOME/bin/jrunscript -J-Djava.security.properties=`dirname $0`/../make/java.security.override -J-Djava.security.manager -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $*
--- a/bin/nashornsecure.bat	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.  Oracle designates this
-rem particular file as subject to the "Classpath" exception as provided
-rem by Oracle in the LICENSE file that accompanied this code.
-rem
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-jrunscript -J-Djava.security.properties=%~dp0\..\make\java.security.override -J-Djava.security.manager -J-Xms2G -J-Xmx2G -J-XX:-TieredCompilation -J-server -J-esa -J-ea -J-Djava.ext.dirs=%~dp0\..\dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Dnashorn.debug=true -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -l nashorn
--- a/bin/rm-non-tracked.sh	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, 2013, 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
-# 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.
-#
-hg status|grep ^\?|awk '{print $2}'|xargs rm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/runopt.sh	Mon Oct 27 14:36:13 2014 -0700
@@ -0,0 +1,107 @@
+#!/bin/sh
+#
+# 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
+# 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.
+#
+
+###########################################################################################
+# This is a helper script to evaluate nashorn with optimistic types
+# it produces a flight recording for every run, and uses the best 
+# known flags for performance for the current configration
+###########################################################################################
+
+# Flags to instrument lambdaform computation, caching, interpretation and compilation
+# Default compile threshold for lambdaforms is 30
+#FLAGS="-Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=3 -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true -Djava.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE=true -Djava.lang.invoke.MethodHandle.TRACE_INTERPRETER=true"
+
+
+# Flags to run trusted tests from the Nashorn test suite
+#FLAGS="-Djava.security.manager -Djava.security.policy=../build/nashorn.policy -Dnashorn.debug"
+
+
+# Unique timestamped file name for JFR recordings. For JFR, we also have to
+# crank up the stack cutoff depth to 1024, because of ridiculously long lambda form
+# stack traces.
+#
+# It is also recommended that you go into $JAVA_HOME/jre/lib/jfr/default.jfc and
+# set the "method-sampling-interval" Normal and Maximum sample time as low as you
+# can go (10 ms on most platforms). The default is normally higher. The increased
+# sampling overhead is usually negligible for Nashorn runs, but the data is better
+
+JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr"
+
+
+# Directory where to look for nashorn.jar in a dist folder. The default is "..", assuming
+# that we run the script from the make dir
+DIR=..
+NASHORN_JAR=$DIR/dist/nashorn.jar
+
+
+# The built Nashorn jar is placed first in the bootclasspath to override the JDK
+# nashorn.jar in $JAVA_HOME/jre/lib/ext. Thus, we also need -esa, as assertions in
+# nashorn count as system assertions in this configuration
+
+$JAVA_HOME/bin/java \
+$FLAGS \
+-ea \
+-esa \
+-Xbootclasspath/p:$NASHORN_JAR \
+-Xms2G -Xmx2G \
+-cp $CLASSPATH:../build/test/classes/ \
+jdk.nashorn.tools.Shell ${@}
+
+# Below are flags that may come in handy, but aren't used for default runs
+
+
+# Type profiling default level is 111, 222 adds some compile time, but produces better code.
+# -XX:TypeProfileLevel=222 \
+
+
+# Testing out new code optimizations using the generic hotspot "new code" parameter
+#-XX:+UnlockDiagnosticVMOptions \
+#-XX:+UseNewCode \
+
+
+# Type specialization and math intrinsic replacement should be enabled by default in 8u20 and nine,
+# keeping this flag around for experimental reasons. Replace + with - to switch it off
+#-XX:+UseTypeSpeculation \
+
+
+# Same with math intrinsics. They should be enabled by default in 8u20 and 9
+#-XX:+UseMathExactIntrinsics \
+
+
+# Add -Dnashorn.time to time the compilation phases.
+#-Dnashorn.time \
+
+
+# Add ShowHiddenFrames to get lambda form internals on the stack traces
+#-XX:+ShowHiddenFrames \
+
+
+# Add print optoassembly to get an asm dump. This requires 1) a debug build, not product,
+# That tired compilation is switched off, for C2 only output and that the number of
+# compiler threads is set to 1 for determinsm.
+#-XX:+PrintOptoAssembly -XX:-TieredCompilation -XX:CICompilerCount=1 \
+
+# Tier compile threasholds. Default value is 10. (1-100 is useful for experiments)
+# -XX:IncreaseFirstTierCompileThresholdAt=XX
+
--- a/bin/verbose_octane.bat	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-rem
-rem Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-rem DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-rem 
-rem This code is free software; you can redistribute it and/or modify it
-rem under the terms of the GNU General Public License version 2 only, as
-rem published by the Free Software Foundation.
-rem 
-rem This code is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-rem version 2 for more details (a copy is included in the LICENSE file that
-rem accompanied this code).
-rem 
-rem You should have received a copy of the GNU General Public License version
-rem 2 along with this work; if not, write to the Free Software Foundation,
-rem Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-rem 
-rem Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-rem or visit www.oracle.com if you need additional information or have any
-rem questions.
-rem
-@echo off
-
-if "%JAVA_HOME%" neq "" (
-  call :run "%JAVA_HOME%/bin/java"
-) else (
-  call :run java
-)
-goto :EOF
-
-:run
-setlocal
-set NASHORN_JAR=dist/nashorn.jar
-set JVM_FLAGS=-Xms2G -Xmx2G -XX:-TieredCompilation -server -esa -ea -jar %NASHORN_JAR%
-set JVM_FLAGS7=-Xbootclasspath/p:%NASHORN_JAR% %JVM_FLAGS%
-set OCTANE_ARGS=--verbose --iterations 7
-
-%1 -fullversion 2>&1 | findstr /L /C:"version ""1.7"
-if %errorlevel% equ 0 (
-  set CMD=%1 %JVM_FLAGS7%
-) else (
-  %1 -fullversion
-  set CMD=%1 %JVM_FLAGS%
-)
-
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/box2d.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/code-load.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/crypto.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/deltablue.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/gbemu.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/navier-stokes.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/pdfjs.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/raytrace.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/regexp.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/richards.js %OCTANE_ARGS%
-%CMD% test/script/basic/run-octane.js -- test/script/external/octane/splay.js %OCTANE_ARGS%
-endlocal
-goto :EOF
--- a/bin/verbose_octane.sh	Mon Oct 20 23:09:19 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2010, 2013, 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
-# 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.
-#
-
-ITERS=$1
-if [ -z $ITERS ]; then 
-    ITERS=7
-fi
-NASHORN_JAR=dist/nashorn.jar
-JVM_FLAGS="-Djava.ext.dirs=`dirname $0`/../dist:$JAVA_HOME/jre/lib/ext -XX:+UnlockDiagnosticVMOptions -Dnashorn.unstable.relink.threshold=8 -Xms2G -Xmx2G -XX:+TieredCompilation -server -jar ${NASHORN_JAR}"
-JVM_FLAGS7="-Xbootclasspath/p:${NASHORN_JAR} ${JVM_FLAGS}"
-OCTANE_ARGS="--verbose --iterations ${ITERS}"
-
-BENCHMARKS=( "box2d.js" "code-load.js" "crypto.js" "deltablue.js" "earley-boyer.js" "gbemu.js" "navier-stokes.js" "pdfjs.js" "raytrace.js" "regexp.js" "richards.js" "splay.js" )
-# TODO mandreel.js has metaspace issues
-
-if [ ! -z $JAVA7_HOME ]; then	
-    echo "running ${ITERS} iterations with java7 using JAVA_HOME=${JAVA7_HOME}..."
-    for BENCHMARK in "${BENCHMARKS[@]}"
-    do 
-	CMD="${JAVA7_HOME}/bin/java ${JVM_FLAGS} test/script/basic/run-octane.js -- test/script/external/octane/${BENCHMARK} ${OCTANE_ARGS}"
-	$CMD
-    done
-else
-    echo "no JAVA7_HOME set. skipping java7"
-fi
-
-if [ ! -z $JAVA8_HOME ]; then
-    echo "running ${ITERS} iterations with java8 using JAVA_HOME=${JAVA8_HOME}..."   
-    for BENCHMARK in "${BENCHMARKS[@]}"
-    do 
-	CMD="${JAVA8_HOME}/bin/java ${JVM_FLAGS} test/script/basic/run-octane.js -- test/script/external/octane/${BENCHMARK} ${OCTANE_ARGS}"
-	$CMD
-    done
-else 
-    echo "no JAVA8_HOME set."
-fi
-
-echo "Done"
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java	Mon Oct 27 14:36:13 2014 -0700
@@ -31,29 +31,29 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESTATIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKEVIRTUAL;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_CREATE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_CREATE_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ARRAYLIST_INIT_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ARRAYLIST_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.CLINIT;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTIONS_EMPTY_LIST;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTIONS_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_ADD;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_ADD_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.DEFAULT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.GETTER_PREFIX;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.GET_CLASS_NAME;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.GET_CLASS_NAME_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_CREATE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_CREATE_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.LIST_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.ARRAYLIST_TYPE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.ARRAYLIST_INIT_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_TYPE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_ADD;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_ADD_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTIONS_TYPE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTIONS_EMPTY_LIST;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_FIELD_NAME;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_NEWMAP;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_NEWMAP_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_TYPE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTFUNCTIONIMPL_MAKEFUNCTION;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTFUNCTIONIMPL_MAKEFUNCTION_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTFUNCTIONIMPL_MAKEFUNCTION_SPECS_DESC;
@@ -292,7 +292,6 @@
             mi.push(memInfo.getArity());
             mi.invokeVirtual(SCRIPTFUNCTION_TYPE, SCRIPTFUNCTION_SETARITY, SCRIPTFUNCTION_SETARITY_DESC);
         }
-
     }
 
     static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo memInfo) {
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java	Mon Oct 27 14:36:13 2014 -0700
@@ -32,9 +32,9 @@
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.CONSTRUCTOR_SUFFIX;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.DEFAULT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_FIELD_NAME;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_SETCONSTRUCTOR;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_SETCONSTRUCTOR_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_TYPE;
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java	Mon Oct 27 14:36:13 2014 -0700
@@ -28,7 +28,6 @@
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTOBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.STRING_DESC;
-
 import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.internal.org.objectweb.asm.Type;
 import jdk.nashorn.internal.objects.annotations.Where;
@@ -75,10 +74,6 @@
          * This is a specialized version of a function
          */
         SPECIALIZED_FUNCTION,
-        /**
-         * This is a specialized version of a constructor
-         */
-        SPECIALIZED_CONSTRUCTOR
     }
 
     // keep in sync with jdk.nashorn.internal.objects.annotations.Attribute
@@ -107,6 +102,12 @@
 
     private Where where;
 
+    private Type linkLogicClass;
+
+    private boolean isSpecializedConstructor;
+
+    private boolean isOptimistic;
+
     /**
      * @return the kind
      */
@@ -136,6 +137,57 @@
     }
 
     /**
+     * Tag something as specialized constructor or not
+     * @param isSpecializedConstructor boolean, true if specialized constructor
+     */
+    public void setIsSpecializedConstructor(final boolean isSpecializedConstructor) {
+        this.isSpecializedConstructor = isSpecializedConstructor;
+    }
+
+    /**
+     * Check if something is a specialized constructor
+     * @return true if specialized constructor
+     */
+    public boolean isSpecializedConstructor() {
+        return isSpecializedConstructor;
+    }
+
+    /**
+     * Check if this is an optimistic builtin function
+     * @return true if optimistic builtin
+     */
+    public boolean isOptimistic() {
+        return isOptimistic;
+    }
+
+    /**
+     * Tag something as optimitic builtin or not
+     * @param isOptimistic boolean, true if builtin constructor
+     */
+    public void setIsOptimistic(final boolean isOptimistic) {
+        this.isOptimistic = isOptimistic;
+    }
+
+    /**
+     * Get the SpecializedFunction guard for specializations, i.e. optimistic
+     * builtins
+     * @return specialization, null if none
+     */
+    public Type getLinkLogicClass() {
+        return linkLogicClass;
+    }
+
+    /**
+     * Set thre SpecializedFunction link logic class for specializations, i.e. optimistic
+     * builtins
+     * @param linkLogicClass link logic class
+     */
+
+    public void setLinkLogicClass(final Type linkLogicClass) {
+        this.linkLogicClass = linkLogicClass;
+    }
+
+    /**
      * @return the attributes
      */
     public int getAttributes() {
@@ -304,22 +356,9 @@
                 }
             }
             break;
-            case SPECIALIZED_CONSTRUCTOR: {
-                final Type returnType = Type.getReturnType(javaDesc);
-                if (!isJSObjectType(returnType)) {
-                    error("return value of a @SpecializedConstructor method should be a valid JS type, found " + returnType);
-                }
-                final Type[] argTypes = Type.getArgumentTypes(javaDesc);
-                for (int i = 0; i < argTypes.length; i++) {
-                    if (!isValidJSType(argTypes[i])) {
-                        error(i + "'th argument of a @SpecializedConstructor method is not valid JS type, found " + argTypes[i]);
-                    }
-                }
-            }
-            break;
             case FUNCTION: {
                 final Type returnType = Type.getReturnType(javaDesc);
-                if (!isValidJSType(returnType)) {
+                if (!(isValidJSType(returnType) || Type.VOID_TYPE == returnType)) {
                     error("return value of a @Function method should be a valid JS type, found " + returnType);
                 }
                 final Type[] argTypes = Type.getArgumentTypes(javaDesc);
@@ -351,7 +390,7 @@
             break;
             case SPECIALIZED_FUNCTION: {
                 final Type returnType = Type.getReturnType(javaDesc);
-                if (!isValidJSType(returnType)) {
+                if (!(isValidJSType(returnType) || (isSpecializedConstructor() && Type.VOID_TYPE == returnType))) {
                     error("return value of a @SpecializedFunction method should be a valid JS type, found " + returnType);
                 }
                 final Type[] argTypes = Type.getArgumentTypes(javaDesc);
@@ -371,9 +410,8 @@
                     error("first argument of a @Getter method should be of Object type, found: " + argTypes[0]);
                 }
 
-                final Type returnType = Type.getReturnType(javaDesc);
-                if (!isJavaLangObject(returnType)) {
-                    error("return type of a @Getter method should be Object, found: " + javaDesc);
+                if (Type.getReturnType(javaDesc).equals(Type.VOID_TYPE)) {
+                    error("return type of getter should not be void");
                 }
             }
             break;
@@ -413,6 +451,10 @@
                     }
                 }
             }
+            break;
+
+            default:
+            break;
         }
     }
 
@@ -451,7 +493,7 @@
 
         if (type.getSort() == Type.OBJECT) {
             try {
-                final Class clazz = Class.forName(type.getClassName(), false, myLoader);
+                final Class<?> clazz = Class.forName(type.getClassName(), false, myLoader);
                 return ScriptObject.class.isAssignableFrom(clazz);
             } catch (final ClassNotFoundException cnfe) {
                 return false;
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java	Mon Oct 27 14:36:13 2014 -0700
@@ -56,6 +56,7 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.IALOAD;
 import static jdk.internal.org.objectweb.asm.Opcodes.IASTORE;
 import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
+import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_1;
 import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEINTERFACE;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
@@ -76,13 +77,16 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.SASTORE;
 import static jdk.internal.org.objectweb.asm.Opcodes.SIPUSH;
 import static jdk.internal.org.objectweb.asm.Opcodes.SWAP;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.METHODHANDLE_TYPE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.TYPE_METHODHANDLE;
-
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.SPECIALIZATION_INIT2;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.SPECIALIZATION_INIT3;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.SPECIALIZATION_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.TYPE_SPECIALIZATION;
 import java.util.List;
 import jdk.internal.org.objectweb.asm.Handle;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Type;
+import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
 
 /**
  * Base class for all method generating classes.
@@ -95,6 +99,8 @@
     private final Type returnType;
     private final Type[] argumentTypes;
 
+    static final Type EMPTY_LINK_LOGIC_TYPE = Type.getType(LinkLogic.getEmptyLinkLogicClass());
+
     MethodGenerator(final MethodVisitor mv, final int access, final String name, final String descriptor) {
         super(ASM4, mv);
         this.access        = access;
@@ -380,6 +386,11 @@
         super.visitFieldInsn(GETFIELD, owner, field, desc);
     }
 
+    private static boolean linkLogicIsEmpty(final Type type) {
+        assert EMPTY_LINK_LOGIC_TYPE != null; //type is ok for null if we are a @SpecializedFunction without any attribs
+        return EMPTY_LINK_LOGIC_TYPE.equals(type);
+    }
+
     void memberInfoArray(final String className, final List<MemberInfo> mis) {
         if (mis.isEmpty()) {
             pushNull();
@@ -388,12 +399,22 @@
 
         int pos = 0;
         push(mis.size());
-        newObjectArray(METHODHANDLE_TYPE);
+        newObjectArray(SPECIALIZATION_TYPE);
         for (final MemberInfo mi : mis) {
             dup();
             push(pos++);
+            visitTypeInsn(NEW, SPECIALIZATION_TYPE);
+            dup();
             visitLdcInsn(new Handle(H_INVOKESTATIC, className, mi.getJavaName(), mi.getJavaDesc()));
-            arrayStore(TYPE_METHODHANDLE);
+            final Type    linkLogicClass = mi.getLinkLogicClass();
+            final boolean linkLogic      = !linkLogicIsEmpty(linkLogicClass);
+            final String  ctor           = linkLogic ? SPECIALIZATION_INIT3 : SPECIALIZATION_INIT2;
+            if (linkLogic) {
+                visitLdcInsn(linkLogicClass);
+            }
+            visitInsn(mi.isOptimistic() ? ICONST_1 : ICONST_0);
+            visitMethodInsn(INVOKESPECIAL, SPECIALIZATION_TYPE, INIT, ctor, false);
+            arrayStore(TYPE_SPECIALIZATION);
         }
     }
 
@@ -413,7 +434,8 @@
         super.visitMethodInsn(INVOKEVIRTUAL,
                     "java/io/PrintStream",
                     "println",
-                    "(Ljava/lang/String;)V", false);
+                    "(Ljava/lang/String;)V",
+                    false);
     }
 
     // print the object on the top of the stack
@@ -426,6 +448,7 @@
         super.visitMethodInsn(INVOKEVIRTUAL,
                     "java/io/PrintStream",
                     "println",
-                    "(Ljava/lang/Object;)V", false);
+                    "(Ljava/lang/Object;)V",
+                    false);
     }
 }
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java	Mon Oct 27 14:36:13 2014 -0700
@@ -31,9 +31,9 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.DEFAULT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_FIELD_NAME;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPE_SUFFIX;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTOBJECT_INIT_DESC;
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java	Mon Oct 27 14:36:13 2014 -0700
@@ -37,8 +37,8 @@
 import jdk.nashorn.internal.objects.annotations.Property;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
 import jdk.nashorn.internal.objects.annotations.Setter;
-import jdk.nashorn.internal.objects.annotations.SpecializedConstructor;
 import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
+import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
 import jdk.nashorn.internal.objects.annotations.Where;
 import jdk.nashorn.internal.tools.nasgen.MemberInfo.Kind;
 
@@ -56,8 +56,8 @@
     static final String SETTER_ANNO_DESC        = Type.getDescriptor(Setter.class);
     static final String PROPERTY_ANNO_DESC      = Type.getDescriptor(Property.class);
     static final String WHERE_ENUM_DESC         = Type.getDescriptor(Where.class);
+    static final String LINK_LOGIC_DESC         = Type.getDescriptor(LinkLogic.class);
     static final String SPECIALIZED_FUNCTION    = Type.getDescriptor(SpecializedFunction.class);
-    static final String SPECIALIZED_CONSTRUCTOR = Type.getDescriptor(SpecializedConstructor.class);
 
     static final Map<String, Kind> annotations = new HashMap<>();
 
@@ -69,7 +69,6 @@
         annotations.put(SETTER_ANNO_DESC, Kind.SETTER);
         annotations.put(PROPERTY_ANNO_DESC, Kind.PROPERTY);
         annotations.put(SPECIALIZED_FUNCTION, Kind.SPECIALIZED_FUNCTION);
-        annotations.put(SPECIALIZED_CONSTRUCTOR, Kind.SPECIALIZED_CONSTRUCTOR);
     }
 
     // name of the script class
@@ -119,11 +118,12 @@
     List<MemberInfo> getSpecializedConstructors() {
         final List<MemberInfo> res = new LinkedList<>();
         for (final MemberInfo memInfo : members) {
-            if (memInfo.getKind() == Kind.SPECIALIZED_CONSTRUCTOR) {
+            if (memInfo.isSpecializedConstructor()) {
+                assert memInfo.getKind() == Kind.SPECIALIZED_FUNCTION;
                 res.add(memInfo);
             }
         }
-        return res;
+        return Collections.unmodifiableList(res);
     }
 
     int getPrototypeMemberCount() {
@@ -175,7 +175,7 @@
                 res.add(memInfo);
             }
         }
-        return res;
+        return Collections.unmodifiableList(res);
     }
 
     MemberInfo findSetter(final MemberInfo getter) {
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.java	Mon Oct 27 14:36:13 2014 -0700
@@ -27,7 +27,6 @@
 
 import static jdk.nashorn.internal.tools.nasgen.ScriptClassInfo.SCRIPT_CLASS_ANNO_DESC;
 import static jdk.nashorn.internal.tools.nasgen.ScriptClassInfo.WHERE_ENUM_DESC;
-
 import java.io.BufferedInputStream;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -41,6 +40,7 @@
 import jdk.internal.org.objectweb.asm.FieldVisitor;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
 import jdk.nashorn.internal.objects.annotations.Where;
 import jdk.nashorn.internal.tools.nasgen.MemberInfo.Kind;
 
@@ -194,6 +194,7 @@
 
                     final MemberInfo memInfo = new MemberInfo();
 
+                    //annokind == e.g. GETTER or SPECIALIZED_FUNCTION
                     memInfo.setKind(annoKind);
                     memInfo.setJavaName(methodName);
                     memInfo.setJavaDesc(methodDesc);
@@ -208,12 +209,18 @@
                         private Integer attributes;
                         private Integer arity;
                         private Where   where;
+                        private boolean isSpecializedConstructor;
+                        private boolean isOptimistic;
+                        private Type    linkLogicClass = MethodGenerator.EMPTY_LINK_LOGIC_TYPE;
 
                         @Override
                         public void visit(final String annotationName, final Object annotationValue) {
                             switch (annotationName) {
                             case "name":
                                 this.name = (String)annotationValue;
+                                if (name.isEmpty()) {
+                                    name = null;
+                                }
                                 break;
                             case "attributes":
                                 this.attributes = (Integer)annotationValue;
@@ -221,6 +228,17 @@
                             case "arity":
                                 this.arity = (Integer)annotationValue;
                                 break;
+                            case "isConstructor":
+                                assert annoKind == Kind.SPECIALIZED_FUNCTION;
+                                this.isSpecializedConstructor = (Boolean)annotationValue;
+                                break;
+                            case "isOptimistic":
+                                assert annoKind == Kind.SPECIALIZED_FUNCTION;
+                                this.isOptimistic = (Boolean)annotationValue;
+                                break;
+                            case "linkLogic":
+                                this.linkLogicClass = (Type)annotationValue;
+                                break;
                             default:
                                 break;
                             }
@@ -230,12 +248,19 @@
 
                         @Override
                         public void visitEnum(final String enumName, final String desc, final String enumValue) {
-                            if ("where".equals(enumName) && WHERE_ENUM_DESC.equals(desc)) {
-                                this.where = Where.valueOf(enumValue);
+                            switch (enumName) {
+                            case "where":
+                                if (WHERE_ENUM_DESC.equals(desc)) {
+                                    this.where = Where.valueOf(enumValue);
+                                }
+                                break;
+                            default:
+                                break;
                             }
                             super.visitEnum(enumName, desc, enumValue);
                         }
 
+                        @SuppressWarnings("fallthrough")
                         @Override
                         public void visitEnd() {
                             super.visitEnd();
@@ -256,7 +281,6 @@
                                     case SETTER:
                                         where = Where.INSTANCE;
                                         break;
-                                    case SPECIALIZED_CONSTRUCTOR:
                                     case CONSTRUCTOR:
                                         where = Where.CONSTRUCTOR;
                                         break;
@@ -264,12 +288,18 @@
                                         where = Where.PROTOTYPE;
                                         break;
                                     case SPECIALIZED_FUNCTION:
-                                        //TODO is this correct
+                                        if (isSpecializedConstructor) {
+                                            where = Where.CONSTRUCTOR;
+                                        }
+                                        //fallthru
                                     default:
                                         break;
                                 }
                             }
                             memInfo.setWhere(where);
+                            memInfo.setLinkLogicClass(linkLogicClass);
+                            memInfo.setIsSpecializedConstructor(isSpecializedConstructor);
+                            memInfo.setIsOptimistic(isOptimistic);
                         }
                     };
                 }
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Mon Oct 27 14:36:13 2014 -0700
@@ -38,7 +38,6 @@
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTOBJECT_TYPE;
-
 import java.io.BufferedInputStream;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java	Mon Oct 27 14:36:13 2014 -0700
@@ -26,9 +26,8 @@
 package jdk.nashorn.internal.tools.nasgen;
 
 import java.lang.invoke.MethodHandle;
-import java.lang.reflect.Method;
+import java.util.ArrayList;
 import java.util.Collection;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import jdk.internal.org.objectweb.asm.Type;
@@ -38,6 +37,7 @@
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
+import jdk.nashorn.internal.runtime.Specialization;
 
 /**
  * String constants used for code generation/instrumentation.
@@ -45,20 +45,26 @@
 @SuppressWarnings("javadoc")
 public interface StringConstants {
     // standard jdk types, methods
-    static final Type TYPE_METHODHANDLE       = Type.getType(MethodHandle.class);
-    static final Type TYPE_METHODHANDLE_ARRAY = Type.getType(MethodHandle[].class);
-    static final Type TYPE_OBJECT             = Type.getType(Object.class);
-    static final Type TYPE_STRING             = Type.getType(String.class);
-    static final Type TYPE_COLLECTION         = Type.getType(Collection.class);
-    static final Type TYPE_COLLECTIONS        = Type.getType(Collections.class);
-    static final Type TYPE_ARRAYLIST          = Type.getType(ArrayList.class);
-    static final Type TYPE_LIST               = Type.getType(List.class);
+    static final Type TYPE_METHODHANDLE         = Type.getType(MethodHandle.class);
+    static final Type TYPE_METHODHANDLE_ARRAY   = Type.getType(MethodHandle[].class);
+    static final Type TYPE_SPECIALIZATION       = Type.getType(Specialization.class);
+    static final Type TYPE_SPECIALIZATION_ARRAY = Type.getType(Specialization[].class);
+    static final Type TYPE_OBJECT               = Type.getType(Object.class);
+    static final Type TYPE_STRING               = Type.getType(String.class);
+    static final Type TYPE_CLASS                = Type.getType(Class.class);
+    static final Type TYPE_COLLECTION           = Type.getType(Collection.class);
+    static final Type TYPE_COLLECTIONS          = Type.getType(Collections.class);
+    static final Type TYPE_ARRAYLIST            = Type.getType(ArrayList.class);
+    static final Type TYPE_LIST                 = Type.getType(List.class);
 
     static final String CLINIT = "<clinit>";
     static final String INIT = "<init>";
     static final String DEFAULT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE);
 
     static final String METHODHANDLE_TYPE = TYPE_METHODHANDLE.getInternalName();
+    static final String SPECIALIZATION_TYPE = TYPE_SPECIALIZATION.getInternalName();
+    static final String SPECIALIZATION_INIT2 = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_METHODHANDLE, Type.getType(boolean.class));
+    static final String SPECIALIZATION_INIT3 = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_METHODHANDLE, TYPE_CLASS, Type.getType(boolean.class));
     static final String OBJECT_TYPE = TYPE_OBJECT.getInternalName();
     static final String OBJECT_DESC = TYPE_OBJECT.getDescriptor();
     static final String STRING_TYPE = TYPE_STRING.getInternalName();
@@ -123,11 +129,11 @@
     static final String SCRIPTFUNCTIONIMPL_MAKEFUNCTION_DESC =
         Type.getMethodDescriptor(TYPE_SCRIPTFUNCTION, TYPE_STRING, TYPE_METHODHANDLE);
     static final String SCRIPTFUNCTIONIMPL_MAKEFUNCTION_SPECS_DESC =
-        Type.getMethodDescriptor(TYPE_SCRIPTFUNCTION, TYPE_STRING, TYPE_METHODHANDLE, TYPE_METHODHANDLE_ARRAY);
+        Type.getMethodDescriptor(TYPE_SCRIPTFUNCTION, TYPE_STRING, TYPE_METHODHANDLE, TYPE_SPECIALIZATION_ARRAY);
     static final String SCRIPTFUNCTIONIMPL_INIT_DESC3 =
-        Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_STRING, TYPE_METHODHANDLE, TYPE_METHODHANDLE_ARRAY);
+        Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_STRING, TYPE_METHODHANDLE, TYPE_SPECIALIZATION_ARRAY);
     static final String SCRIPTFUNCTIONIMPL_INIT_DESC4 =
-        Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_STRING, TYPE_METHODHANDLE, TYPE_PROPERTYMAP, TYPE_METHODHANDLE_ARRAY);
+        Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_STRING, TYPE_METHODHANDLE, TYPE_PROPERTYMAP, TYPE_SPECIALIZATION_ARRAY);
 
     // ScriptObject
     static final String SCRIPTOBJECT_TYPE = TYPE_SCRIPTOBJECT.getInternalName();
--- a/docs/DEVELOPER_README	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/DEVELOPER_README	Mon Oct 27 14:36:13 2014 -0700
@@ -737,26 +737,6 @@
 the JRuby project. The default value for this flag is "joni"
 
 
-SYSTEM PROPERTY: -Dnashorn.time
-
-This enables timers for various phases of script compilation. The timers
-will be dumped when the Nashorn process exits. We see a percentage value
-of how much time was spent not executing bytecode (i.e. compilation and
-internal tasks) at the end of the report. 
-
-Here is an example:
-
-[JavaScript Parsing]    61  ms
-[Constant Folding]      11  ms
-[Control Flow Lowering] 26  ms
-[Type Attribution]      81  ms
-[Range Analysis]        0  ms
-[Code Splitting]        29  ms
-[Type Finalization]     19  ms
-[Bytecode Generation]   189  ms
-[Code Installation]     7  ms
-Total runtime: 508 ms (Non-runtime: 423 ms [83%])
-
 ===============
 2. The loggers.
 ===============
@@ -887,6 +867,34 @@
 (Object in the normal case, unless running with the dual field
 representation)
 
+* time
+
+This enables timers for various phases of script compilation. The timers
+will be dumped when the Nashorn process exits. We see a percentage value
+of how much time was spent not executing bytecode (i.e. compilation and
+internal tasks) at the end of the report. 
+
+A finer level than "info" will show individual compilation timings as they
+happen.
+
+Here is an example:
+
+[time] Accumulated complation phase Timings:
+[time] 
+[time] 'JavaScript Parsing'              1076 ms
+[time] 'Constant Folding'                 159 ms
+[time] 'Control Flow Lowering'            303 ms
+[time] 'Program Point Calculation'        282 ms
+[time] 'Builtin Replacement'               71 ms
+[time] 'Code Splitting'                   670 ms
+[time] 'Symbol Assignment'                474 ms
+[time] 'Scope Depth Computation'          249 ms
+[time] 'Optimistic Type Assignment'       186 ms
+[time] 'Local Variable Type Calculation'  526 ms
+[time] 'Bytecode Generation'             5177 ms
+[time] 'Class Installation'              1854 ms
+[time] 
+[time] Total runtime: 11994 ms (Non-runtime: 11027 ms [91%])
 
 =======================
 3. Undocumented options
@@ -914,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: <path>   
 
 	--debug-lines (Generate line number table in .class files.)
@@ -954,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
 
@@ -965,16 +968,16 @@
 		param: <locale>   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: <module:level>,*   
 
-	-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.)
@@ -983,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:<output-dir>,function:<name>]   
 
 	--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.)
@@ -998,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.)
@@ -1007,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: <output console>   
 
-	--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: <output console>   
 
 	-strict (Run scripts in strict mode.)
@@ -1031,7 +1028,7 @@
 		param: <timezone>   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.)
--- a/docs/genshelldoc.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/genshelldoc.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, 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
  * 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.
@@ -61,7 +61,7 @@
 
 for each (opt in Options.validOptions) {
 
-var isTimezone = (opt.type == "timezone");   
+var isTimezone = (opt.type == "timezone");
 var defValue = opt.defaultValue;
 if (defValue == null) {
     defValue = "&lt;none&gt;";
--- a/docs/source/importpackageclass.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/importpackageclass.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -32,7 +32,7 @@
 // load compatibility script
 load("nashorn:mozilla_compat.js");
 
-// Import Java packages and classes 
+// Import Java packages and classes
 // like import package.*; in Java
 importPackage(java.awt);
 // like import java.awt.Frame in Java
--- a/docs/source/javaarray.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/javaarray.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/docs/source/javaextend.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/javaextend.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/docs/source/javaimporter.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/javaimporter.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/docs/source/javatypes.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/javatypes.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/docs/source/overload.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/overload.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -31,6 +31,6 @@
 
 var out = java.lang.System.out;
 
-// select a particular print function 
+// select a particular print function
 out["println(java.lang.Object)"]("hello");
 
--- a/docs/source/runnable.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/runnable.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/docs/source/samfunc.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/samfunc.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/docs/source/test.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/docs/source/test.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/make/BuildNashorn.gmk	Mon Oct 20 23:09:19 2014 -0700
+++ b/make/BuildNashorn.gmk	Mon Oct 27 14:36:13 2014 -0700
@@ -65,7 +65,7 @@
     SETUP := GENERATE_NEWBYTECODE_DEBUG, \
     SRC := $(NASGEN_SRC) $(ASM_SRC), \
     BIN := $(NASHORN_OUTPUTDIR)/nasgen_classes, \
-    ADD_JAVAC_FLAGS := -cp $(NASHORN_OUTPUTDIR)/nashorn_classes))
+    ADD_JAVAC_FLAGS := -bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes"))
 
 # Nasgen needs nashorn classes
 $(BUILD_NASGEN): $(BUILD_NASHORN)
--- a/make/build-benchmark.xml	Mon Oct 20 23:09:19 2014 -0700
+++ b/make/build-benchmark.xml	Mon Oct 27 14:36:13 2014 -0700
@@ -1,381 +1,333 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
- Copyright (c) 2010, 2013, 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
- 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.
+    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
+    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.
 -->
-<project name="nashorn-benchmarks" default="all" basedir="..">
 
-  <target name="octane-init" depends="jar">
-    <property name="octane-tests" value="box2d code-load crypto deltablue earley-boyer gbemu navier-stokes pdfjs raytrace regexp richards splay"/>
+
+<project
+    name="nashorn-benchmarks"
+    default="all"
+    basedir=".."
+    xmlns:if="ant:if">
+
+  <!--
+       Below are the octane benchmarks that should be run.
+       The ones that are excluded, as Nashorn currently has
+       some issues with them (functionality or performance)
+       are commented out
+  -->
+
+  <!-- box2d -->
+  <target name="octane-box2d" depends="octane-box2d-nashorn"/>
+  <target name="octane-box2d-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.box2d" runtime="nashorn"/>
+  </target>
+  <target name="octane-box2d-v8" depends="jar">
+    <run-one cond="octane.benchmark.box2d" runtime="v8"/>
+  </target>
+  <target name="octane-box2d-rhino" depends="jar">
+    <run-one cond="octane.benchmark.box2d" runtime="rhino"/>
+  </target>
+
+  <!-- code-load -->
+  <target name="octane-code-load" depends="octane-code-load-nashorn"/>
+  <target name="octane-code-load-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.code-load" runtime="nashorn"/>
+  </target>
+  <target name="octane-code-load-v8" depends="jar">
+    <run-one cond="octane.benchmark.code-load" runtime="v8"/>
+  </target>
+  <target name="octane-code-load-rhino" depends="jar">
+    <run-one cond="octane.benchmark.code-load" runtime="rhino"/>
+  </target>
+
+  <!-- crypto -->
+  <target name="octane-crypto" depends="octane-crypto-nashorn"/>
+  <target name="octane-crypto-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.crypto" runtime="nashorn"/>
+  </target>
+  <target name="octane-crypto-v8" depends="jar">
+    <run-one cond="octane.benchmark.crypto" runtime="v8"/>
+  </target>
+  <target name="octane-crypto-rhino" depends="jar">
+    <run-one cond="octane.benchmark.crypto" runtime="rhino"/>
+  </target>
+
+  <!-- deltablue -->
+  <target name="octane-deltablue" depends="octane-deltablue-nashorn"/>
+  <target name="octane-deltablue-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.deltablue" runtime="nashorn"/>
+  </target>
+  <target name="octane-deltablue-v8" depends="jar">
+    <run-one cond="octane.benchmark.deltablue" runtime="v8"/>
+  </target>
+  <target name="octane-deltablue-rhino" depends="jar">
+    <run-one cond="octane.benchmark.deltablue" runtime="rhino"/>
+  </target>
+
+  <!-- earley-boyer -->
+  <target name="octane-earley-boyer" depends="octane-earley-boyer-nashorn"/>
+  <target name="octane-earley-boyer-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.earley-boyer" runtime="nashorn"/>
+  </target>
+  <target name="octane-earley-boyer-v8" depends="jar">
+    <run-one cond="octane.benchmark.earley-boyer" runtime="v8"/>
+  </target>
+  <target name="octane-earley-boyer-rhino" depends="jar">
+    <run-one cond="octane.benchmark.earley-boyer" runtime="rhino"/>
   </target>
   
-  <!-- ignore benchmarks where rhino crashes -->
-  <target name="octane-init-rhino" depends="jar">
-    <property name="octane-tests" value="box2d code-load crypto deltablue earley-boyer gbemu navier-stokes raytrace regexp richards splay"/>
+  <!-- gbemu -->
+  <target name="octane-gbemu" depends="octane-gbemu-nashorn"/>
+  <target name="octane-gbemu-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.gbemu" runtime="nashorn"/>
+  </target>
+  <target name="octane-gbemu-v8" depends="jar">
+    <run-one cond="octane.benchmark.gbemu" runtime="v8"/>
+  </target>
+  <target name="octane-gbemu-rhino" depends="jar">
+    <run-one cond="octane.benchmark.gbemu" runtime="rhino"/>
   </target>
 
-  <!-- box2d -->
-  <target name="octane-box2d" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="box2d"/>
+  <!-- mandreel -->
+  <target name="octane-mandreel" depends="octane-mandreel-nashorn"/>
+  <target name="octane-mandreel-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.mandreel" runtime="nashorn"/>
+  </target>
+  <target name="octane-mandreel-v8" depends="jar">
+    <run-one cond="octane.benchmark.mandreel" runtime="v8"/>
+  </target>
+  <target name="octane-mandreel-rhino" depends="jar">
+    <run-one cond="octane.benchmark.mandreel" runtime="rhino"/>
+  </target>
+
+  <!-- navier-stokes -->
+  <target name="octane-navier-stokes" depends="octane-navier-stokes-nashorn"/>
+  <target name="octane-navier-stokes-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.navier-stokes" runtime="nashorn"/>
+  </target>
+  <target name="octane-navier-stokes-v8" depends="jar">
+    <run-one cond="octane.benchmark.navier-stokes" runtime="v8"/>
+  </target>
+  <target name="octane-navier-stokes-rhino" depends="jar">
+    <run-one cond="octane.benchmark.navier-stokes" runtime="rhino"/>
+  </target>
+
+  <!-- pdfjs -->
+  <target name="octane-pdfjs" depends="octane-pdfjs-nashorn"/>
+  <target name="octane-pdfjs-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.pdfjs" runtime="nashorn"/>
+  </target>
+  <target name="octane-pdfjs-v8" depends="jar">
+    <run-one cond="octane.benchmark.pdfjs" runtime="v8"/>
+  </target>
+  <target name="octane-pdfjs-rhino" depends="jar">
+    <run-one cond="octane.benchmark.pdfjs" runtime="rhino"/>
+  </target>
+
+  <!-- raytrace -->
+  <target name="octane-raytrace" depends="octane-raytrace-nashorn"/>
+  <target name="octane-raytrace-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.raytrace" runtime="nashorn"/>
+  </target>
+  <target name="octane-raytrace-v8" depends="jar">
+    <run-one cond="octane.benchmark.raytrace" runtime="v8"/>
+  </target>
+  <target name="octane-raytrace-rhino" depends="jar">
+    <run-one cond="octane.benchmark.raytrace" runtime="rhino"/>
+  </target>
+
+  <!-- regexp -->
+  <target name="octane-regexp" depends="octane-regexp-nashorn"/>
+  <target name="octane-regexp-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.regexp" runtime="nashorn"/>
+  </target>
+  <target name="octane-regexp-v8" depends="jar">
+    <run-one cond="octane.benchmark.regexp" runtime="v8"/>
+  </target>
+  <target name="octane-regexp-rhino" depends="jar">
+    <run-one cond="octane.benchmark.regexp" runtime="rhino"/>
+  </target>
+
+  <!-- richards -->
+  <target name="octane-richards" depends="octane-richards-nashorn"/>
+  <target name="octane-richards-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.richards" runtime="nashorn"/>
+  </target>
+  <target name="octane-richards-v8" depends="jar">
+    <run-one cond="octane.benchmark.richards" runtime="v8"/>
+  </target>
+  <target name="octane-richards-rhino" depends="jar">
+    <run-one cond="octane.benchmark.richards" runtime="rhino"/>
+  </target>
+
+  <!-- splay -->
+  <target name="octane-splay" depends="octane-splay-nashorn"/>
+  <target name="octane-splay-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.splay" runtime="nashorn"/>
+  </target>
+  <target name="octane-splay-v8" depends="jar">
+    <run-one cond="octane.benchmark.splay" runtime="v8"/>
+  </target>
+  <target name="octane-splay-rhino" depends="jar">
+    <run-one cond="octane.benchmark.splay" runtime="rhino"/>
+  </target>
+
+  <!-- typescript -->
+  <target name="octane-typescript" depends="octane-typescript-nashorn"/>
+  <target name="octane-typescript-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.typescript" runtime="nashorn"/>
+  </target>
+  <target name="octane-typescript-v8" depends="jar">
+    <run-one cond="octane.benchmark.typescript" runtime="v8"/>
+  </target>
+  <target name="octane-typescript-rhino" depends="jar">
+    <run-one cond="octane.benchmark.typescript" runtime="rhino"/>
+  </target>
+
+  <!-- zlib -->
+  <target name="octane-zlib" depends="octane-zlib-nashorn"/>
+  <target name="octane-zlib-nashorn" depends="jar">
+    <run-one cond="octane.benchmark.zlib" runtime="nashorn"/>
+  </target>
+  <target name="octane-zlib-v8" depends="jar">
+    <run-one cond="octane.benchmark.zlib" runtime="v8"/>
+  </target>
+  <target name="octane-zlib-rhino" depends="jar">
+    <run-one cond="octane.benchmark.zlib" runtime="rhino"/>
+  </target>
+
+  <!--
+      Benchmark runners for one or more benchmarks, single
+      or multiple process
+  -->
+
+  <target name="octane-process-separate" if="${octane-test-sys-prop.separate.process}">
+    <echo message="Running each benchmark in separate processes, starting new JVMs for each."/>
+    <script language="javascript"><![CDATA[
+      var props = [];
+
+      for (var prop in project.getProperties()) {
+        if (prop.startsWith("octane.benchmark.")) {
+          props.push(prop);
+        }
+      }
+
+      //sort benchmark props in alphabetical order by name
+      props.sort(function(a, b) {
+        if (a < b) {
+          return -1;
+        } else if (a > b) {
+          return 1;
+        } else {
+           return 0;
+        }
+      });
+      
+      var runtime = project.getProperty("runtime");
+
+      for (var i in props) {
+        var task = project.createTask("run-one");
+	// workaround for https://issues.apache.org/bugzilla/show_bug.cgi?id=53831, still not fixed
+        if (task.getOwningTarget() == null) {
+	  task.setOwningTarget(self.getOwningTarget());
+	}
+        var prop = props[i];
+        task.setDynamicAttribute("cond", prop);
+        task.setDynamicAttribute("runtime", runtime);
+	task.perform();
+      }
+    ]]></script>
+  </target>
+
+  <target name="octane-process-single" unless="${octane-test-sys-prop.separate.process}">
+    <echo message="Running all benchmarks in the same process."/>
+    <pathconvert property="octane.benchmarks" pathsep=" ">
+      <propertyset>
+    <propertyref prefix="octane.benchmark."/>
+      </propertyset>
+    </pathconvert>
+    <antcall target="run-octane${runtime}">
+      <param name="octane-tests" value="${octane.benchmarks}"/>
     </antcall>
   </target>
 
-  <target name="octane-box2d-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="box2d"/>
-    </antcall>
+  <!--
+       run 'octane' in single or separate processes based on config
+       This uses nashorn as the default runtime
+  -->
+  <target name="octane-nashorn" depends="jar">
+    <property name="runtime" value="nashorn"/>
+    <antcall target="octane-process-separate"/>
+    <antcall target="octane-process-single"/>
   </target>
 
-  <target name="octane-box2d-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="box2d"/>
-    </antcall>
-  </target>
-
-
-  <!-- code-load -->  
-  <target name="octane-code-load" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="code-load"/>
-    </antcall>
-  </target>
-
-  <target name="octane-code-load-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="code-load"/>
-    </antcall>
-  </target>
-
-  <target name="octane-code-load-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="code-load"/>
-    </antcall>
-  </target>
-
-
-  <!-- crypto -->
-  <target name="octane-crypto" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="crypto"/>
-    </antcall>
-  </target>
-
-  <target name="octane-crypto-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="crypto"/>
-    </antcall>
-  </target>
-
-  <target name="octane-crypto-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="crypto"/>
-    </antcall>
-  </target>
-
-
-  <!-- deltablue -->
-  <target name="octane-deltablue" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="deltablue"/>
-    </antcall>
-  </target>
-
-  <target name="octane-deltablue-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="deltablue"/>
-    </antcall>
-  </target>
-
-  <target name="octane-deltablue-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="deltablue"/>
-    </antcall>
-  </target>
-
-
-  <!-- earley-boyer -->
-  <target name="octane-earley-boyer" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="earley-boyer"/>
-    </antcall>
-  </target>
-
-  <target name="octane-earley-boyer-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="earley-boyer"/>
-    </antcall>
-  </target>
-
-  <target name="octane-earley-boyer-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="earley-boyer"/>
-    </antcall>
-  </target>
-
-
-  <!-- gbemu -->  
-  <target name="octane-gbemu" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="gbemu"/>
-    </antcall>
-  </target>
-
-  <target name="octane-gbemu-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="gbemu"/>
-    </antcall>
-  </target>
-
-  <target name="octane-gbemu-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="gbemu"/>
-    </antcall>
-  </target>
-
-
-  <!-- mandreel -->  
-  <target name="octane-mandreel" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="mandreel"/>
-    </antcall>
-  </target>
-
-  <target name="octane-mandreel-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="mandreel"/>
-    </antcall>
-  </target>
-
-  <target name="octane-mandreel-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="mandreel"/>
-    </antcall>
-  </target>
-
-
-  <!-- navier-stokes -->
-  <target name="octane-navier-stokes" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="navier-stokes"/>
-    </antcall>
-  </target>
-
-  <target name="octane-navier-stokes-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="navier-stokes"/>
-    </antcall>
-  </target>
-
-  <target name="octane-navier-stokes-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="navier-stokes"/>
-    </antcall>
-  </target>
-
-
-  <!-- pdfjs -->  
-  <target name="octane-pdfjs" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="pdfjs"/>
-    </antcall>
-  </target>
-
-  <target name="octane-pdfjs-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="pdfjs"/>
-    </antcall>
-  </target>
-
-  <target name="octane-pdfjs-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="pdfjs"/>
-    </antcall>
-  </target>
-
-
-  <!-- raytrace -->
-  <target name="octane-raytrace" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="raytrace"/>
-    </antcall>
-  </target>
-
-  <target name="octane-raytrace-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="raytrace"/>
-    </antcall>
-  </target>
-
-  <target name="octane-raytrace-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="raytrace"/>
-    </antcall>
-  </target>
-
-
-  <!-- regexp -->
-  <target name="octane-regexp" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="regexp"/>
-    </antcall>
-  </target>
-
-  <target name="octane-regexp-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="regexp"/>
-    </antcall>
-  </target>
-
-  <target name="octane-regexp-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="regexp"/>
-    </antcall>
-  </target>
-
-
-  <!-- richards -->
-  <target name="octane-richards" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="richards"/>
-    </antcall>
-  </target>
-
-  <target name="octane-richards-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="richards"/>
-    </antcall>
-  </target>
-
-  <target name="octane-richards-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="richards"/>
-    </antcall>
-  </target>
-
-
-  <!-- splay -->
-  <target name="octane-splay" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="splay"/>
-    </antcall>
-  </target>
-
-  <target name="octane-splay-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-tests" value="splay"/>
-    </antcall>
-  </target>
-
-  <target name="octane-splay-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="splay"/>
-    </antcall>
-  </target>
-
-  <!-- splay -->
-  <target name="octane-typescript" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="typescript"/>
-    </antcall>
-  </target>
-
-  <target name="octane-typescript-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-typescript" value="typescript"/>
-    </antcall>
-  </target>
-
-  <target name="octane-typescript-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="typescript"/>
-    </antcall>
-  </target>
-
-  <!-- zlib -->
-  <target name="octane-zlib" depends="jar">
-    <antcall target="run-octane">
-      <param name="octane-tests" value="zlib"/>
-    </antcall>
-  </target>
-
-  <target name="octane-zlib-v8" depends="jar">
-    <antcall target="run-octane-v8">
-      <param name="octane-typescript" value="zlib"/>
-    </antcall>
-  </target>
-
-  <target name="octane-zlib-rhino" depends="jar">
-    <antcall target="run-octane-rhino">
-      <param name="octane-tests" value="zlib"/>
-    </antcall>
-  </target>
-
-  <!-- run octane benchmarks in a single process  -->
-  <target name="octane-single-process" depends="octane-init">
-    <antcall target="run-octane"/>
-  </target>
-
-  <!-- zlib excluded due to missing implementation of 'read' -->
-  <target name="octane-separate-process" depends=
-     "octane-box2d, octane-code-load, octane-crypto, 
-      octane-deltablue, octane-earley-boyer, octane-gbemu,
-      octane-mandreel, octane-navier-stokes, octane-pdfjs, 
-      octane-raytrace, octane-regexp, octane-richards, 
-      octane-splay, octane-typescript"/>
-
-  <target name="--single-process" unless="${octane-test-sys-prop.separate.process}">
-    <antcall target="octane-single-process"/>
-  </target>
-  <target name="--separate-process" if="${octane-test-sys-prop.separate.process}">
-    <antcall target="octane-separate-process"/>
-  </target>
-
-  <!-- run 'octane' in single or separate processes based on config -->
-  <target name="octane" depends="init, --single-process, --separate-process"/>
+  <!-- alias for 'octane' -->
+  <target name="octane" depends="octane-nashorn"/>
 
   <!-- run octane benchmarks using octane as runtime -->
-  <target name="octane-v8" depends="octane-init">
-    <antcall target="run-octane-v8"/>
+  <target name="octane-v8" depends="jar">
+    <property name="runtime" value="v8"/>
+    <antcall target="octane-process-separate"/>
+    <antcall target="octane-process-single"/>
   </target>
 
   <!-- run octane benchmarks using Rhino as runtime -->
-  <target name="octane-rhino" depends="octane-init-rhino">
-    <antcall target="run-octane-rhino"/>
+  <target name="octane-rhino" depends="jar">
+    <property name="runtime" value="rhino"/>
+    <antcall target="octane-process-separate"/>
+    <antcall target="octane-process-single"/>
   </target>
-  
-  <target name="run-octane">
+
+  <macrodef name="run-one">
+    <attribute name="cond"/>
+    <attribute name="runtime" default=""/>
+    <sequential>
+	<antcall target="run-octane-@{runtime}" if:set="@{cond}">
+	  <param name="octane-tests" value="${@{cond}}"/>
+	</antcall>
+    </sequential>
+  </macrodef>
+
+  <target name="run-octane-nashorn">
     <java classname="${nashorn.shell.tool}"
           classpath="${run.test.classpath}"
           fork="true"
           dir=".">
       <jvmarg line="${ext.class.path}"/>
       <jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>
+      <!-- pass on all properties prefixed with 'nashorn' to the runtime -->
+      <syspropertyset>
+        <propertyref prefix="nashorn."/>
+      </syspropertyset>
       <arg value="${octane-test-sys-prop.test.js.framework}"/>
+      <arg value="-scripting"/>
       <arg value="--"/>
       <arg value="${octane-tests}"/>
       <arg value="--runtime"/>
-      <arg value="Nashorn"/>
+      <arg value="nashorn"/>
       <arg value="--verbose"/>
-      <arg value="--iterations 8"/>
+      <arg value="--iterations ${octane.iterations}"/>
     </java>
   </target>
 
@@ -383,11 +335,11 @@
     <exec executable="${v8.shell}">
       <arg value="${octane-test-sys-prop.test.js.framework}"/>
       <arg value="--"/>
-      <arg value="${octane-tests}"/>      
+      <arg value="${octane-tests}"/>
       <arg value="--runtime"/>
       <arg value="v8"/>
       <arg value="--verbose"/>
-      <arg value="--iterations 8"/>
+      <arg value="--iterations ${octane.iterations}"/>
     </exec>
   </target>
 
@@ -397,12 +349,14 @@
           fork="true"
           dir=".">
       <jvmarg line="${run.test.jvmargs.octane} -Xms${run.test.xms} -Xmx${run.test.xmx}"/>
+      <arg value="-opt"/>
+      <arg value="9"/>
       <arg value="${octane-test-sys-prop.test.js.framework}"/>
       <arg value="${octane-tests}"/>
       <arg value="--runtime"/>
-      <arg value="Rhino"/>
+      <arg value="rhino"/>
       <arg value="--verbose"/>
-      <arg value="--iterations 8"/>
+      <arg value="--iterations ${octane.iterations}"/>
     </java>
   </target>
 
@@ -413,18 +367,22 @@
       <arg value="${octane-tests}/"/>
     </exec>
   </target>
-   
+
   <target name="sunspider-init" depends="jar">
     <fileset id="sunspider-set"
-	     dir="${sunspider-test-sys-prop.test.js.roots}"
-	     excludes="${sunspider-test-sys-prop.test.js.exclude.list}">
+         dir="${sunspider-test-sys-prop.test.js.roots}"
+         excludes="${sunspider-test-sys-prop.test.js.exclude.list}">
       <include name="**/*.js"/>
     </fileset>
     <pathconvert pathsep=" " property="sunspider-tests" refid="sunspider-set"/>
   </target>
 
+  <!--- SUNSPIDER JOB BELOW -->
+
   <!-- run sunspider with Nashorn -->
-  <target name="sunspider" depends="sunspider-init">
+  <target name="sunspider" depends="sunspider-nashorn"/>
+
+  <target name="sunspider-nashorn" depends="sunspider-init">
     <java classname="${nashorn.shell.tool}"
           classpath="${run.test.classpath}"
           fork="true"
@@ -436,6 +394,9 @@
       <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
       <arg value="--"/>
       <arg value="${sunspider-tests}/"/>
+      <arg value="--verbose"/>
+      <arg value="--times"/>
+      <arg value="${sunspider.iterations}"/>
     </java>
   </target>
 
@@ -445,6 +406,9 @@
       <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
       <arg value="--"/>
       <arg value="${sunspider-tests}/"/>
+      <arg value="--verbose"/>
+      <arg value="--times"/>
+      <arg value="${sunspider.iterations}"/>
     </exec>
   </target>
 
@@ -455,8 +419,13 @@
           fork="true"
           dir=".">
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
+      <arg value="-opt"/>
+      <arg value="9"/>
       <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
       <arg value="${sunspider-tests}/"/>
+      <arg value="--verbose"/>
+      <arg value="--times"/>
+      <arg value="${sunspider.iterations}"/>
     </java>
   </target>
 
--- a/make/build-nasgen.xml	Mon Oct 20 23:09:19 2014 -0700
+++ b/make/build-nasgen.xml	Mon Oct 27 14:36:13 2014 -0700
@@ -36,11 +36,13 @@
                 <pathelement location="${basedir}/jcov2/lib/jcov_j2se_rt.jar"/>
                 <pathelement location="${basedir}/buildtools/nasgen/dist/nasgen.jar"/>
                 <pathelement path="${basedir}/build/classes"/>
+                <pathelement location="${dist.dir}/nasgen.jar"/>
+                <pathelement path="${build.dir}/classes"/>
             </classpath>
             <jvmarg value="-Djava.ext.dirs="/>
-            <arg value="${basedir}/build/classes"/>
+            <arg value="${build.dir}/classes"/>
             <arg value="jdk.nashorn.internal.objects"/>
-            <arg value="${basedir}/build/classes"/>
+            <arg value="${build.dir}/classes"/>
         </java>
     </target>
 
--- a/make/build.xml	Mon Oct 20 23:09:19 2014 -0700
+++ b/make/build.xml	Mon Oct 27 14:36:13 2014 -0700
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
  Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -21,19 +22,22 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
+
 <project name="nashorn" default="test" basedir="..">
   <import file="build-nasgen.xml"/>
-  <import file="build-benchmark.xml"/>
   <import file="code_coverage.xml"/>
 
-
   <target name="init-conditions">
     <!-- loading locally defined resources and properties. NB they owerwrite default ones defined later -->
     <property file="${user.home}/.nashorn.project.local.properties"/>
 
     <loadproperties srcFile="make/project.properties"/>
+    <path id="dist.path">
+         <pathelement location="${dist.dir}"/>
+    </path>
     <path id="nashorn.ext.path">
       <pathelement location="${dist.dir}"/>
+      <pathelement location="${java.ext.dirs}"/>
     </path>
     <property name="ext.class.path" value="-Djava.ext.dirs=&quot;${toString:nashorn.ext.path}&quot;"/>
     <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
@@ -51,7 +55,7 @@
     <available property="testng.available" file="${file.reference.testng.jar}"/>
     <!-- check if Jemmy ang testng.jar are avaiable -->
     <condition property="jemmy.jfx.testng.available" value="true">
-      <and> 
+      <and>
         <available file="${file.reference.jemmyfx.jar}"/>
         <available file="${file.reference.jemmycore.jar}"/>
         <available file="${file.reference.jemmyawtinput.jar}"/>
@@ -69,13 +73,16 @@
     <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt">
       <istrue value="${make.code.coverage}" />
     </condition>
+
+    <condition property="jfr.options" value="${run.test.jvmargs.jfr}" else="">
+      <istrue value="${jfr}"/>
+    </condition>
   </target>
-
+  
   <target name="init" depends="init-conditions, init-cc">
-
     <!-- extends jvm args -->
-    <property name="run.test.jvmargs" value="${run.test.jvmargs.main}  ${run.test.cc.jvmargs}"/>
-    <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main}  ${run.test.cc.jvmargs}" />
+    <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
+    <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
 
     <echo message="run.test.jvmargs=${run.test.jvmargs}"/>
     <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
@@ -122,8 +129,7 @@
            encoding="${javac.encoding}"
            includeantruntime="false" fork="true">
       <compilerarg value="-J-Djava.ext.dirs="/>
-      <compilerarg value="-Xlint:unchecked"/>
-      <compilerarg value="-Xlint:deprecation"/>
+      <compilerarg value="-Xlint:all"/>
       <compilerarg value="-XDignore.symbol.file"/>
       <compilerarg value="-Xdiags:verbose"/>
     </javac>
@@ -291,6 +297,10 @@
   <target name="generate-policy-file" depends="prepare">
     <echo file="${build.dir}/nashorn.policy">
 
+grant codeBase "file:/${toString:dist.path}/nashorn.jar" {
+    permission java.security.AllPermission;
+};
+
 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
     permission java.security.AllPermission;
 };
@@ -298,6 +308,14 @@
 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
     permission java.security.AllPermission;
 };
+//// in case of absolute path:
+grant codeBase "file:/${nashorn.internal.tests.jar}" {
+    permission java.security.AllPermission;
+};
+
+grant codeBase "file:/${file.reference.testng.jar}" {
+    permission java.security.AllPermission;
+};
 
 grant codeBase "file:/${basedir}/test/script/trusted/*" {
     permission java.security.AllPermission;
@@ -322,6 +340,13 @@
     permission java.util.PropertyPermission "nashorn.test.*", "read";
 };
 
+grant codeBase "file:/${basedir}/test/script/basic/es6/*" {
+    permission java.io.FilePermission "${basedir}/test/script/-", "read";
+    permission java.io.FilePermission "$${user.dir}", "read";
+    permission java.util.PropertyPermission "user.dir", "read";
+    permission java.util.PropertyPermission "nashorn.test.*", "read";
+};
+
 grant codeBase "file:/${basedir}/test/script/basic/JDK-8010946-privileged.js" {
     permission java.util.PropertyPermission "java.security.policy", "read";
 };
@@ -330,6 +355,10 @@
     permission java.lang.RuntimePermission "nashorn.JavaReflection";
 };
 
+grant codeBase "file:/${basedir}/test/script/markdown.js" {
+    permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read";
+};
+
     </echo>
 
     <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace>    <!--hack for Windows - to make URLs with normal path separators -->
@@ -345,6 +374,7 @@
       <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/>
       <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/>
       <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
+      <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/>
   </target>
 
   <target name="check-testng" unless="testng.available">
@@ -380,7 +410,8 @@
     <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
       <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
+      <sysproperty key="nashorn.jar" value="${dist.dir}/nashorn.jar"/>
       <propertyset>
         <propertyref prefix="nashorn."/>
       </propertyset>
@@ -388,6 +419,7 @@
         <propertyref prefix="test-sys-prop-no-security."/>
         <mapper from="test-sys-prop-no-security.*" to="*" type="glob"/>
       </propertyset>
+      <sysproperty key="optimistic.override" value="${optimistic}"/>
       <classpath>
           <pathelement path="${run.test.classpath}"/>
       </classpath>
@@ -399,14 +431,18 @@
     <delete dir="${build.dir}/nashorn_code_cache"/>
     <property name="debug.test.jvmargs" value=""/>
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
-       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+	    verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
       <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
       <jvmarg line="${debug.test.jvmargs}"/>
       <propertyset>
+        <propertyref prefix="nashorn."/>
+      </propertyset>
+      <propertyset>
         <propertyref prefix="test-sys-prop."/>
         <mapper from="test-sys-prop.*" to="*" type="glob"/>
       </propertyset>
+      <sysproperty key="optimistic.override" value="${optimistic}"/>
       <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
       <classpath>
           <pathelement path="${run.test.classpath}"/>
@@ -414,18 +450,26 @@
     </testng>
   </target>
 
-  <target name="test" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file, -test-security, -test-nosecurity" if="testng.available"/>
+  <target name="test" depends="test-pessimistic, test-optimistic"/>
 
-  <target name="test-basicparallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file">
-      <!-- use just build.test.classes.dir to avoid referring to TestNG -->
-      <java classname="${parallel.test.runner}" dir="${basedir}" classpath="${build.test.classes.dir}" failonerror="true" fork="true">
-      <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
-      <syspropertyset>
-          <propertyref prefix="test-sys-prop."/>
-          <mapper type="glob" from="test-sys-prop.*" to="*"/>
-      </syspropertyset>
-      </java>
+  <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+    <echo message="Running test suite in OPTIMISTIC mode..."/>
+    <antcall target="-test-nosecurity" inheritRefs="true">
+      <param name="optimistic" value="true"/>
+    </antcall>    
+    <antcall target="-test-security" inheritRefs="true">
+      <param name="optimistic" value="true"/>
+    </antcall>
+  </target>
+
+  <target name="test-pessimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+    <echo message="Running test suite in PESSIMISTIC mode..."/>
+    <antcall target="-test-nosecurity" inheritRefs="true">
+      <param name="optimistic" value="false"/>
+    </antcall>    
+    <antcall target="-test-security" inheritRefs="true">
+      <param name="optimistic" value="false"/>
+    </antcall>
   </target>
 
   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
@@ -436,19 +480,19 @@
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
     </fileset>
-    
+
     <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
-    
+
     <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
-		<not>
+        <not>
             <os family="mac"/>
         </not>
-	</condition>
-    
+    </condition>
+
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
       <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
       <propertyset>
         <propertyref prefix="testjfx-test-sys-prop."/>
         <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
@@ -459,7 +503,26 @@
       </classpath>
     </testng>
   </target>
-  
+
+  <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+    <fileset id="test.classes" dir="${build.test.classes.dir}">
+       <include name="**/framework/*Test.class"/>
+    </fileset>
+
+    <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
+       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
+      <propertyset>
+        <propertyref prefix="testmarkdown-test-sys-prop."/>
+        <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
+      </propertyset>
+      <classpath>
+          <pathelement path="${run.test.classpath}"/>
+      </classpath>
+    </testng>
+  </target>
+
   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
@@ -468,7 +531,10 @@
     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
       <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
+      <propertyset>
+        <propertyref prefix="nashorn."/>
+      </propertyset>
       <propertyset>
         <propertyref prefix="test262-test-sys-prop."/>
         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
@@ -485,7 +551,9 @@
     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
       <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
+      <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
+      <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
       <classpath>
           <pathelement path="${run.test.classpath}"/>
       </classpath>
@@ -496,6 +564,26 @@
     </java>
   </target>
 
+  <target name="testparallel" depends="test-parallel"/>
+
+  <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+      <!-- use just build.test.classes.dir to avoid referring to TestNG -->
+      <java classname="${parallel.test.runner}" dir="${basedir}"
+        failonerror="true"
+        fork="true">
+      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+      <classpath>
+          <pathelement path="${run.test.classpath}"/>
+      <pathelement path="${build.test.classes.dir}"/>
+      </classpath>
+      <syspropertyset>
+          <propertyref prefix="test-sys-prop."/>
+          <mapper type="glob" from="test-sys-prop.*" to="*"/>
+      </syspropertyset>
+      </java>
+  </target>
+
   <target name="all" depends="test, docs"
       description="Build, test and generate docs for nashorn"/>
 
@@ -529,6 +617,8 @@
     <!-- clone test262 git repo -->
     <exec executable="${git.executable}">
        <arg value="clone"/>
+       <arg value="--branch"/>
+       <arg value="es5-tests"/>
        <arg value="https://github.com/tc39/test262"/>
        <arg value="${test.external.dir}/test262"/>
     </exec>
@@ -604,6 +694,11 @@
     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
 
+    <!-- showdown -->
+    <mkdir dir="${test.external.dir}/showdown"/>
+    <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
+    <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
+
   </target>
 
   <!-- update external test suites that are pulled from source control systems -->
@@ -619,4 +714,6 @@
 
   <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
 
+  <import file="build-benchmark.xml"/>
+
 </project>
--- a/make/nbproject/ide-targets.xml	Mon Oct 20 23:09:19 2014 -0700
+++ b/make/nbproject/ide-targets.xml	Mon Oct 27 14:36:13 2014 -0700
@@ -31,9 +31,10 @@
             <classpath path="${run.test.classpath}"/>
         </nbjpdastart>
         <java classname="jdk.nashorn.tools.Shell" classpath="${run.test.classpath}" dir="samples" fork="true">
+	    <jvmarg line="-Dnashorn.optimistic"/>
             <jvmarg line="${ext.class.path}"/> 
             <jvmarg line="${run.test.jvmargs}"/>
-            <arg value="test.js"/>
+            <arg value="../samples/test.js"/>
             <jvmarg value="-Xdebug"/>
             <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
         </java>
--- a/make/project.properties	Mon Oct 20 23:09:19 2014 -0700
+++ b/make/project.properties	Mon Oct 27 14:36:13 2014 -0700
@@ -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
@@ -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
@@ -60,6 +61,7 @@
 # test results directory
 build.test.results.dir=${build.dir}/test/reports
 build.nosecurity.test.results.dir=${build.dir}/test/nosecurity/reports
+build.nooptimistic.test.results.dir=${build.dir}/test/nooptimistic/reports
 
 # This directory is removed when the project is cleaned:
 dist.dir=dist
@@ -72,6 +74,9 @@
 fxshell.dir = tools/fxshell
 fxshell.jar = ${dist.dir}/nashornfx.jar
 
+# configuration for java flight recorder
+run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128
+
 # jars refererred
 file.reference.testng.jar=test/lib/testng.jar
 
@@ -122,6 +127,7 @@
 test262.dir=${test.external.dir}/test262
 test262.suite.dir=${test262.dir}/test/suite
 testjfx.dir=${test.script.dir}/jfx
+testmarkdown.dir=${test.script.dir}/markdown
 
 test-sys-prop.test.dir=${test.dir}
 test-sys-prop.test.js.roots=${test.basic.dir} ${test.maptests.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir}
@@ -163,21 +169,14 @@
 # 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/
+sunspider-test-sys-prop.test.js.roots=${test.external.dir}/sunspider/tests/sunspider-1.0.2/
 
 # framework root for sunspider
 sunspider-test-sys-prop.test.js.framework=${test.basic.dir}/runsunspider.js
@@ -193,6 +192,7 @@
 
 # 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
 
@@ -202,7 +202,7 @@
 # list of test262 test dirs to be excluded
 test262-test-sys-prop.test.js.exclude.dir=\
     ${test262.suite.dir}/intl402/ \
-    ${test262.suite.dir}/bestPractice/ 
+    ${test262.suite.dir}/bestPractice/
 
 test262-test-sys-prop.test.failed.list.file=${build.dir}/test/failedTests
 
@@ -216,8 +216,18 @@
     ${test262.dir}/test/harness/framework.js \
     ${test262.dir}/test/harness/sta.js
 
+# testmarkdown test root
+testmarkdown-test-sys-prop.test.js.roots=${testmarkdown.dir}
+
+# execute testmarkdown tests in shared nashorn context or not?
+testmarkdown-test-sys-prop.test.js.shared.context=false
+
+# framework root for markdown script tests
+testmarkdown-test-sys-prop.test.js.framework=\
+    ${test.script.dir}${file.separator}markdown.js
+
 # testjfx test root
-testjfx-test-sys-prop.test.js.roots=${testjfx.dir}   
+testjfx-test-sys-prop.test.js.roots=${testjfx.dir}
 
 # execute testjfx tests in shared nashorn context or not?
 testjfx-test-sys-prop.test.js.shared.context=false
@@ -254,48 +264,131 @@
 run.test.xmx=2G
 run.test.xms=2G
 
+# 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
 run.test.user.country=TR
 
-run.test.jvmargs.common=-server -XX:+TieredCompilation -Dfile.encoding=UTF-8 -Duser.language=${run.test.user.language} -Duser.country=${run.test.user.country} -XX:+HeapDumpOnOutOfMemoryError
-
-#-XX:-UseCompressedKlassPointers -XX:+PrintHeapAtGC -XX:ClassMetaspaceSize=300M
-# -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMethods
+run.test.jvmargs.common=\
+  -server \
+  -Dfile.encoding=UTF-8 \
+  -Duser.language=${run.test.user.language} \
+  -Duser.country=${run.test.user.country} \
+  -Dnashorn.typeInfo.cacheDir=${build.dir}${file.separator}test${file.separator}type_info_cache \
+  ${jfr.args} \
+  -XX:+HeapDumpOnOutOfMemoryError
 
 # turn on assertions for tests
 run.test.jvmargs.main=${run.test.jvmargs.common} -ea
 
-#-XX:-UseCompressedKlassPointers -XX:+PrintHeapAtGC -XX:ClassMetaspaceSize=300M  
-run.test.jvmargs.octane.main=${run.test.jvmargs.common}
+# Extra jvmargs that might be useful for debugging
+# and performance improvements/monitoring
+#
+# -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
+#
+# activate the generic "UseNewCode" flag to test whatever functionality
+# lies behind it. This is the preferred way to test a, yet flagless,
+# feature in HotSpot - for example, the uncommon trap placement fix
+# was hidden behind this flag before it became the default
+#
+# -XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode 
+#
+# Crank up the type profile level to 222, which has some warmup
+# penalties, but produces much better code for JavaScript, where better
+# and more intrusive type profiling is required to get rid of
+# a large amount of unnecessary guard code, that could not otherwise
+# be eliminated
+#
+# -XX:TypeProfileLevel=222
+#
 
-run.test.jvmsecurityargs=-Xverify:all -Djava.security.manager -Djava.security.policy=${basedir}/build/nashorn.policy
+# Use best known performance options for octane
+run.test.jvmargs.octane.main=${run.test.jvmargs.common} -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=${build.dir}/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=
+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 #
-################
-	#enable/disable code coverage; please redifine in the ${user.home}/.nashorn.project.local.properties
+#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
 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\.*
--- a/samples/BufferArray.java	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/BufferArray.java	Mon Oct 27 14:36:13 2014 -0700
@@ -29,8 +29,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.nio.DoubleBuffer;
 import jdk.nashorn.api.scripting.AbstractJSObject;
-import java.nio.DoubleBuffer;
 
 /**
  * Simple class demonstrating pluggable script object
@@ -52,41 +52,49 @@
     // underlying nio buffer
     private final DoubleBuffer buf;
 
-    public BufferArray(int size) {
+    /**
+     * Constructor
+     * @param size initial size
+     */
+    public BufferArray(final int size) {
         buf = DoubleBuffer.allocate(size);
     }
 
-    public BufferArray(DoubleBuffer buf) {
+    /**
+     * Constructur
+     * @param buf {@link DoubleBuffer} to link to
+     */
+    public BufferArray(final DoubleBuffer buf) {
         this.buf = buf;
     }
 
     // called to check if indexed property exists
     @Override
-    public boolean hasSlot(int index) {
+    public boolean hasSlot(final int index) {
         return index > 0 && index < buf.capacity();
     }
 
     // get the value from that index
     @Override
-    public Object getSlot(int index) {
+    public Object getSlot(final int index) {
        return buf.get(index);
     }
 
     // set the value at that index
     @Override
-    public void setSlot(int index, Object value) {
+    public void setSlot(final int index, final Object value) {
        buf.put(index, ((Number)value).doubleValue());
     }
 
     // do you have a property of that given name?
     @Override
-    public boolean hasMember(String name) {
+    public boolean hasMember(final String name) {
        return "length".equals(name) || "buf".equals(name);
     }
 
     // get the value of that named property
     @Override
-    public Object getMember(String name) {
+    public Object getMember(final String name) {
        switch (name) {
           case "length":
               return buf.capacity();
@@ -94,7 +102,7 @@
               // return a 'function' value for this property
               return new AbstractJSObject() {
                   @Override
-                  public Object call(Object thiz, Object... args) {
+                  public Object call(final Object thiz, final Object... args) {
                       return BufferArray.this.buf;
                   }
 
@@ -104,6 +112,8 @@
                       return true;
                   }
               };
+          default:
+              break;
        }
        return null;
     }
--- a/samples/array_mapreduce.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/array_mapreduce.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -31,9 +31,9 @@
 
 // Usage: jjs array_mapreduce.js
 
-// Many Array.prototype functions such as map, 
+// Many Array.prototype functions such as map,
 // filter, reduce, reduceRight, every, some are generic.
-// These functions accept ECMAScript array as well as 
+// These functions accept ECMAScript array as well as
 // many array-like objects including java arrays.
 // So, you can do map/filter/reduce with Java streams or
 // you can also use Array.prototype functions as below.
@@ -73,6 +73,6 @@
 // print sum of squares of the random numbers
 print("Square sum:",
     reduce.call(
-        map.call(jarr, function(x) x*x), 
+        map.call(jarr, function(x) x*x),
         function(x, y) x + y)
 );
--- a/samples/astviewer.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/astviewer.js	Mon Oct 27 14:36:13 2014 -0700
@@ -2,22 +2,22 @@
 
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -82,7 +82,7 @@
 // load parser.js from nashorn resources
 load("nashorn:parser.js");
 
-// read the full content of the file and parse it 
+// read the full content of the file and parse it
 // to get AST of the script specified
 var ast = parse(readFully(sourceName));
 
--- a/samples/barchart_weather.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/barchart_weather.js	Mon Oct 27 14:36:13 2014 -0700
@@ -2,22 +2,22 @@
 
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/samples/call_lambda.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/call_lambda.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/samples/counters.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/counters.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/samples/dirname.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/dirname.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/samples/disassemble.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/disassemble.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -33,7 +33,7 @@
 
 // Simple .class disassembler that uses bundled ObjectWeb ASM
 // classes in jdk8. WARNING: Bundled ObjectWeb ASM classes are
-// not part of official jdk8 API. It can be changed/removed 
+// not part of official jdk8 API. It can be changed/removed
 // without notice. So, this script is brittle by design!
 
 // This example demonstrates passing arguments to script
--- a/samples/engine/accessvar.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/engine/accessvar.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/samples/engine/callfunc.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/engine/callfunc.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -29,7 +29,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// simple example showing how to call a global script 
+// simple example showing how to call a global script
 // function from caller
 
 var ScriptEngineManager = Java.type("javax.script.ScriptEngineManager");
@@ -42,7 +42,7 @@
 engine.eval("function func(name) { print('I am func, hello ' + name) }");
 
 // invoke functions, methods of code evaluated by engine
-// from javax.script.Invocable interface. But, hey, 
+// from javax.script.Invocable interface. But, hey,
 // calling code is JavaScript and don't worry about types :)
 
 engine.invokeFunction("func", "Nashorn");
--- a/samples/engine/callmethod.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/engine/callmethod.js	Mon Oct 27 14:36:13 2014 -0700
@@ -2,22 +2,22 @@
 
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -55,7 +55,7 @@
 CODE);
 
 // invoke methods of an object in script world
-// from javax.script.Invocable interface. But, hey, 
+// from javax.script.Invocable interface. But, hey,
 // calling code is JavaScript and don't worry about types :)
 
 // get that script object on which to call a method
--- a/samples/engine/exposevar.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/engine/exposevar.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
--- a/samples/engine/foreignobject.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/engine/foreignobject.js	Mon Oct 27 14:36:13 2014 -0700
@@ -2,22 +2,22 @@
 
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -54,7 +54,7 @@
 // the class jdk.nashorn.api.scripting.ScriptObjectMirror
 // But nashorn's dynalink linker can treat these objects
 // specially to support natural script syntax to access..
-// In Java code, you need to use ScriptObjectMirror's 
+// In Java code, you need to use ScriptObjectMirror's
 // methods though. Once again, script world is simpler :-)
 
 var foreignObj = engine.get("obj");
--- a/samples/engine/hello.js	Mon Oct 20 23:09:19 2014 -0700
+++ b/samples/engine/hello.js	Mon Oct 27 14:36:13 2014 -0700
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  *   - Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
- * 
+ *
  *   - Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution.
- * 
+ *
  *   - Neither the name of Oracle nor the names of its
  *     contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR