Merge
authorlana
Fri, 05 Apr 2013 14:51:24 -0700
changeset 16738 6f8cb5f8be7d
parent 16737 8f36190e097a (current diff)
parent 16635 f70e8440f306 (diff)
child 16739 018660b0c613
Merge
hotspot/make/windows/projectfiles/kernel/Makefile
hotspot/make/windows/projectfiles/kernel/vm.def
hotspot/make/windows/projectfiles/kernel/vm.dsw
hotspot/test/runtime/8007736/TestStaticIF.java
langtools/src/share/classes/com/sun/tools/javac/Server.java
langtools/src/share/classes/com/sun/tools/jdeps/resources/jdk.properties
langtools/src/share/classes/javax/lang/model/type/AnnotatedType.java
langtools/test/tools/javac/annotations/repeatingAnnotations/combo/TestCaseGenerator.java
nashorn/src/jdk/nashorn/api/scripting/resources/init.js
nashorn/src/jdk/nashorn/internal/ir/ReferenceNode.java
nashorn/src/jdk/nashorn/internal/ir/annotations/ChildNode.java
nashorn/src/jdk/nashorn/internal/ir/annotations/ParentNode.java
nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionTrampolineImpl.java
nashorn/src/jdk/nashorn/internal/runtime/SpecializedMethodChooser.java
nashorn/test/script/basic/runsunspider.js.EXPECTED
nashorn/test/script/sandbox/reflection.js.EXPECTED
nashorn/test/script/sandbox/unsafe.js.EXPECTED
nashorn/test/src/jdk/nashorn/internal/runtime/Nashorn401TestSubject.java
nashorn/test/src/jdk/nashorn/internal/test/models/ConstructorWithArgument.java
nashorn/test/src/jdk/nashorn/internal/test/models/DessertTopping.java
nashorn/test/src/jdk/nashorn/internal/test/models/DessertToppingFloorWaxDriver.java
nashorn/test/src/jdk/nashorn/internal/test/models/FinalClass.java
nashorn/test/src/jdk/nashorn/internal/test/models/FloorWax.java
nashorn/test/src/jdk/nashorn/internal/test/models/NoAccessibleConstructorClass.java
nashorn/test/src/jdk/nashorn/internal/test/models/NonPublicClass.java
nashorn/test/src/jdk/nashorn/internal/test/models/OuterClass.java
nashorn/test/src/jdk/nashorn/internal/test/models/OverloadedSam.java
nashorn/test/src/jdk/nashorn/internal/test/models/OverrideObject.java
nashorn/test/src/jdk/nashorn/internal/test/models/StringArgs.java
nashorn/test/src/jdk/nashorn/internal/test/models/Toothpaste.java
--- a/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -204,3 +204,4 @@
 3fa21fbf9be7e6b482af43aacb6a09acfa30bdb6 jdk8-b80
 e41d716405b209d3eddef8bd4240cec2bd34dcca jdk8-b81
 5e8c55025644730385a6f8fa029ecdb2d2c98a07 jdk8-b82
+bcebd3fdefc91abb9d7fa0c5af6211b3f8720da6 jdk8-b83
--- a/.hgtags-top-repo	Fri Apr 05 12:12:34 2013 -0700
+++ b/.hgtags-top-repo	Fri Apr 05 14:51:24 2013 -0700
@@ -204,3 +204,4 @@
 907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80
 145dbc56f931c134e837b675b9e6e7bf08902e93 jdk8-b81
 29153d0df68f84162ffe8c2cf4f402a3f2245e85 jdk8-b82
+466685ba01bfb7bc1e1ac61490fd8c0f3cc18763 jdk8-b83
--- a/common/autoconf/autogen.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/common/autoconf/autogen.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -43,14 +43,24 @@
 
 custom_hook=$custom_script_dir/custom-hook.m4
 
-if test "x`which autoconf 2> /dev/null`" = x; then
+AUTOCONF=$(which autoconf 2> /dev/null);
+AUTOCONF_267=$(which autoconf-2.67 2> /dev/null);
+
+echo "Autoconf found: ${AUTOCONF}"
+echo "Autoconf-2.67 found: ${AUTOCONF_267}"
+
+if test "x${AUTOCONF}" = x; then
   echo You need autoconf installed to be able to regenerate the configure script
   echo Error: Cannot find autoconf 1>&2
   exit 1
 fi
 
-echo Generating generated-configure.sh
-cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
+if test "x${AUTOCONF_267}" != x; then
+  AUTOCONF=${AUTOCONF_267};
+fi
+
+echo Generating generated-configure.sh with ${AUTOCONF}
+cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | ${AUTOCONF} -W all -I$script_dir - > $script_dir/generated-configure.sh
 rm -rf autom4te.cache
 
 if test -e $custom_hook; then
@@ -58,7 +68,7 @@
   # We have custom sources available; also generate configure script
   # with custom hooks compiled in.
   cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
-    sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
+    sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | ${AUTOCONF} -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
   rm -rf autom4te.cache
 else
   echo No custom hook found:  $custom_hook
--- a/common/autoconf/generated-configure.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/common/autoconf/generated-configure.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -1013,6 +1013,7 @@
 with_alsa
 with_alsa_include
 with_alsa_lib
+with_giflib
 with_zlib
 with_stdc__lib
 with_num_cores
@@ -1771,6 +1772,8 @@
                           headers under PATH/include)
   --with-alsa-include     specify directory for the alsa include files
   --with-alsa-lib         specify directory for the alsa library
+  --with-giflib           use giflib from build system or OpenJDK source
+                          (system, bundled) [bundled]
   --with-zlib             use zlib from build system or OpenJDK source
                           (system, bundled) [bundled]
   --with-stdc++lib=<static>,<dynamic>,<default>
@@ -3753,7 +3756,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1363706268
+DATE_WHEN_GENERATED=1364922883
 
 ###############################################################################
 #
@@ -28903,14 +28906,15 @@
 #
 # ZIP_DEBUGINFO_FILES
 #
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5
+$as_echo_n "checking if we should zip debug-info files... " >&6; }
 # Check whether --enable-zip-debug-info was given.
 if test "${enable_zip_debug_info+set}" = set; then :
-  enableval=$enable_zip_debug_info;
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5
-$as_echo_n "checking if we should zip debug-info files... " >&6; }
+  enableval=$enable_zip_debug_info; enable_zip_debug_info="${enableval}"
+else
+  enable_zip_debug_info="yes"
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_zip_debug_info}" >&5
 $as_echo "${enable_zip_debug_info}" >&6; }
 
@@ -31178,10 +31182,44 @@
 # Check for the gif library
 #
 
-USE_EXTERNAL_LIBJPEG=true
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5
-$as_echo_n "checking for main in -lgif... " >&6; }
-if ${ac_cv_lib_gif_main+:} false; then :
+
+# Check whether --with-giflib was given.
+if test "${with_giflib+set}" = set; then :
+  withval=$with_giflib;
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which giflib to use" >&5
+$as_echo_n "checking for which giflib to use... " >&6; }
+
+# default is bundled
+DEFAULT_GIFLIB=bundled
+
+#
+# if user didn't specify, use DEFAULT_GIFLIB
+#
+if test "x${with_giflib}" = "x"; then
+    with_giflib=${DEFAULT_GIFLIB}
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_giflib}" >&5
+$as_echo "${with_giflib}" >&6; }
+
+if test "x${with_giflib}" = "xbundled"; then
+    USE_EXTERNAL_LIBGIF=false
+elif test "x${with_giflib}" = "xsystem"; then
+    ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
+if test "x$ac_cv_header_gif_lib_h" = xyes; then :
+
+else
+   as_fn_error $? "--with-giflib=system specified, but gif_lib.h not found!" "$LINENO" 5
+fi
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifGetCode in -lgif" >&5
+$as_echo_n "checking for DGifGetCode in -lgif... " >&6; }
+if ${ac_cv_lib_gif_DGifGetCode+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -31189,27 +31227,33 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-
-int
-main ()
-{
-return main ();
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DGifGetCode ();
+int
+main ()
+{
+return DGifGetCode ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_gif_main=yes
-else
-  ac_cv_lib_gif_main=no
+  ac_cv_lib_gif_DGifGetCode=yes
+else
+  ac_cv_lib_gif_DGifGetCode=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5
-$as_echo "$ac_cv_lib_gif_main" >&6; }
-if test "x$ac_cv_lib_gif_main" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifGetCode" >&5
+$as_echo "$ac_cv_lib_gif_DGifGetCode" >&6; }
+if test "x$ac_cv_lib_gif_DGifGetCode" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBGIF 1
 _ACEOF
@@ -31217,12 +31261,14 @@
   LIBS="-lgif $LIBS"
 
 else
-   USE_EXTERNAL_LIBGIF=false
-               { $as_echo "$as_me:${as_lineno-$LINENO}: Will use gif decoder bundled with the OpenJDK source" >&5
-$as_echo "$as_me: Will use gif decoder bundled with the OpenJDK source" >&6;}
-
-fi
-
+   as_fn_error $? "--with-giflib=system specified, but no giflib found!" "$LINENO" 5
+fi
+
+
+    USE_EXTERNAL_LIBGIF=true
+else
+    as_fn_error $? "Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'" "$LINENO" 5
+fi
 
 
 ###############################################################################
--- a/common/autoconf/jdk-options.m4	Fri Apr 05 12:12:34 2013 -0700
+++ b/common/autoconf/jdk-options.m4	Fri Apr 05 14:51:24 2013 -0700
@@ -519,10 +519,10 @@
 #
 # ZIP_DEBUGINFO_FILES
 #
+AC_MSG_CHECKING([if we should zip debug-info files])
 AC_ARG_ENABLE([zip-debug-info],
-              [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])])
-
-AC_MSG_CHECKING([if we should zip debug-info files])
+              [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
+	      [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
 AC_MSG_RESULT([${enable_zip_debug_info}])
 
 if test "x${enable_zip_debug_info}" = "xno"; then
--- a/common/autoconf/libraries.m4	Fri Apr 05 12:12:34 2013 -0700
+++ b/common/autoconf/libraries.m4	Fri Apr 05 14:51:24 2013 -0700
@@ -499,11 +499,36 @@
 # Check for the gif library
 #
 
-USE_EXTERNAL_LIBJPEG=true
-AC_CHECK_LIB(gif, main, [],
-             [ USE_EXTERNAL_LIBGIF=false
-               AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source])
-             ])
+AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
+	[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
+
+
+AC_MSG_CHECKING([for which giflib to use])
+
+# default is bundled
+DEFAULT_GIFLIB=bundled
+
+#
+# if user didn't specify, use DEFAULT_GIFLIB
+#
+if test "x${with_giflib}" = "x"; then
+    with_giflib=${DEFAULT_GIFLIB}
+fi
+
+AC_MSG_RESULT(${with_giflib})
+
+if test "x${with_giflib}" = "xbundled"; then
+    USE_EXTERNAL_LIBGIF=false
+elif test "x${with_giflib}" = "xsystem"; then
+    AC_CHECK_HEADER(gif_lib.h, [],
+             [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
+    AC_CHECK_LIB(gif, DGifGetCode, [],
+             [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
+
+    USE_EXTERNAL_LIBGIF=true
+else
+    AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
+fi
 AC_SUBST(USE_EXTERNAL_LIBGIF)
 
 ###############################################################################
--- a/common/makefiles/MakeBase.gmk	Fri Apr 05 12:12:34 2013 -0700
+++ b/common/makefiles/MakeBase.gmk	Fri Apr 05 14:51:24 2013 -0700
@@ -51,9 +51,8 @@
 		     -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
 		     -e 's|X00|X|g' | tr '\n' '$2'
 
-# Subst in an extra $ to prevent it from disappearing.
 define ListPathsSafely_If
-    $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(subst $$,$$$$,$(wordlist $3,$4,$($1))))))
+    $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
 endef
 
 define ListPathsSafely_Printf
--- a/corba/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -204,3 +204,4 @@
 5f3d4a6bdd027a1631d97e2dfff63fd5e46987a4 jdk8-b80
 2a00aeeb466b9dee22508f6261f63b70f9c696fe jdk8-b81
 48e1bc77004d9af575b733c04637b98fd17603c2 jdk8-b82
+a45bb25a67c7517b45f00c9682e317f46fecbba9 jdk8-b83
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
@@ -23,9 +23,9 @@
 # questions.
 #
 
-orbd.usage=Utilizzo: {0} <opzioni> \n\ndove <opzioni> include:\n  -port                  Porta di attivazione da cui avviare ORBD, valore predefinito 1049 (opzionale)\n  -defaultdb             Directory per i file ORBD, valore predefinito "./orb.db" (opzionale)\n  -serverid              ID server per ORBD, valore predefinito 1 (opzionale)\n  -ORBInitialPort        Porta iniziale (richiesta)\n  -ORBInitialHost       HostName iniziale (richiesto)\n
+orbd.usage=Uso: {0} <opzioni> \n\ndove <opzioni> include:\n  -port                  Porta di attivazione da cui avviare ORBD, valore predefinito 1049 (opzionale)\n  -defaultdb             Directory per i file ORBD, valore predefinito "./orb.db" (opzionale)\n  -serverid              ID server per ORBD, valore predefinito 1 (opzionale)\n  -ORBInitialPort        Porta iniziale (richiesta)\n  -ORBInitialHost       HostName iniziale (richiesto)\n
 
-servertool.usage=Utilizzo: {0} <opzioni> \n\ndove <opzioni> include:\n  -ORBInitialPort        Porta iniziale (richiesta)\n  -ORBInitialHost        HostName iniziale (richiesto)\n
+servertool.usage=Uso: {0} <opzioni> \n\ndove <opzioni> include:\n  -ORBInitialPort        Porta iniziale (richiesta)\n  -ORBInitialHost        HostName iniziale (richiesto)\n
 servertool.banner=\n\nBenvenuti in Java IDL Server Tool     \nimmettere i comandi quando richiesto \n
 servertool.shorthelp=\n\n\tComandi disponibili:\n\t-------------------- \n
 servertool.baddef=Definizione server errata: {0}
@@ -82,13 +82,13 @@
 servertool.help=\thelp\n\tOR\n\thelp <nome comando>\n
 servertool.help1=Guida
 
-servertool.orbidmap=\tUtilizzo: orblist [ -serverid <id server> | -applicationName <nome> ]\n
+servertool.orbidmap=\tUso: orblist [ -serverid <id server> | -applicationName <nome> ]\n
 servertool.orbidmap1=lista nomi orb e relativa mappatura
 servertool.orbidmap2=\n\tId ORB\t\tNome ORB\n\t------\t\t--------\n
 pnameserv.success=NameServer persistente avviato correttamente
 
 
-bootstrap.usage=Utilizzo: {0} <opzioni> \n\ndove <opzioni> include:\n  -ORBInitialPort        Porta iniziale (richiesta)\n  -InitialServicesFile   File contenente la lista dei servizi iniziali (richiesto)\n
+bootstrap.usage=Uso: {0} <opzioni> \n\ndove <opzioni> include:\n  -ORBInitialPort        Porta iniziale (richiesta)\n  -InitialServicesFile   File contenente la lista dei servizi iniziali (richiesto)\n
 bootstrap.success=impostazione porta su {0} e lettura servizi da {1} in corso
 bootstrap.filenotreadable=il file {0} non \u00E8 leggibile
 bootstrap.filenotfound=impossibile trovare il file {0}
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
@@ -60,12 +60,12 @@
 servertool.getserverid1=applicationName\u306E\u30B5\u30FC\u30D0\u30FCID\u3092\u8FD4\u3057\u307E\u3059
 servertool.getserverid2=\tapplicationName {0}\u306E\u30B5\u30FC\u30D0\u30FCID\u306F{1}\u3067\u3059
 
-servertool.list=\n\t\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n
+servertool.list=\n\tlist\n
 servertool.list1=\u767B\u9332\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
 servertool.list2=\n\t\u30B5\u30FC\u30D0\u30FCID\t\u30B5\u30FC\u30D0\u30FC\u306E\u30AF\u30E9\u30B9\u540D\t\t\u30B5\u30FC\u30D0\u30FC\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\n\t---------\t----------------\t\t----------------------\n
-servertool.listactive=\n\t\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
+servertool.listactive=\n\tlistactive
 servertool.listactive1=\u73FE\u5728\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
-servertool.listappnames=\tapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n
+servertool.listappnames=\tlistappnames\n
 servertool.listappnames1=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308BapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059
 servertool.listappnames2=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30B5\u30FC\u30D0\u30FCapplicationNames:
 
@@ -76,7 +76,7 @@
 servertool.startserver1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u3092\u8D77\u52D5\u3057\u307E\u3059
 servertool.startserver2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u8D77\u52D5\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002
 
-servertool.quit=\n\t\u7D42\u4E86\u3057\u307E\u3059\n
+servertool.quit=\n\tquit\n
 servertool.quit1=\u3053\u306E\u30C4\u30FC\u30EB\u3092\u7D42\u4E86\u3057\u307E\u3059
 
 servertool.help=\thelp\n\t\u307E\u305F\u306F\n\thelp <command name>\n
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2005, 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
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp	Fri Apr 05 14:51:24 2013 -0700
@@ -68,7 +68,7 @@
 Compile.parseDone=\u5B8C\u4E86  - %0
 Compile.generating=%0\u306E\u751F\u6210\u4E2D
 Compile.genDone=\u5B8C\u4E86   -   %0
-Deprecated.keyword=\u8B66\u544A: \u30AD\u30FC\u30EF\u30FC\u30C9`%0'\u306F\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
+Deprecated.keyword=\u8B66\u544A: \u30AD\u30FC\u30EF\u30FC\u30C9`%0'\u306F\u975E\u63A8\u5968\u3067\u3059\u3002
 EvaluationException.1=%0\u6F14\u7B97\u5B50\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u306B\u4E00\u8CAB\u6027\u304C\u3042\u308A\u307E\u305B\u3093: %1\u304A\u3088\u3073%2\u3002
 EvaluationException.2=%0\u6F14\u7B97\u5B50\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u306F\u3001%1\u3067\u306F\u306A\u304F\u6570\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 EvaluationException.or=\u30D3\u30C3\u30C8\u5358\u4F4D\u306EOR\u6F14\u7B97
@@ -114,7 +114,7 @@
 ParseException.badState=%0 (\u884C%1): %2\u306F\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u3067\u304D\u307E\u305B\u3093\u3002\u8907\u6570\u306E\u30B9\u30C6\u30FC\u30C8\u30D5\u30EB\u89AA\u304C\u3042\u308A\u307E\u3059\u3002\n%3\n%4
 ParseException.branchLabel=%0 (\u884C%1): case %2\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
 ParseException.branchName=%0 (\u884C%1): %2\u3068\u3044\u3046\u540D\u524D\u306E\u5206\u5C90\u306F\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n%3\n%4
-ParseException.duplicateInit=%0 (\u884C%1): \u521D\u671F\u5316\u5B50\u306B\u306F\u524D\u306E\u521D\u671F\u5316\u5B50\u3068\u540C\u3058\u7F72\u540D\u304C\u3042\u308A\u307E\u3059\u3002\n%2\n%3
+ParseException.duplicateInit=%0 (\u884C%1): \u521D\u671F\u5316\u5B50\u306B\u306F\u524D\u306E\u521D\u671F\u5316\u5B50\u3068\u540C\u3058\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u3042\u308A\u307E\u3059\u3002\n%2\n%3
 ParseException.duplicateState=%0 (\u884C%1): \u30C7\u30FC\u30BF\u30FB\u30E1\u30F3\u30D0\u30FC%2\u306E\u540D\u524D\u304C\u524D\u306E\u30C7\u30FC\u30BF\u30FB\u30E1\u30F3\u30D0\u30FC\u3068\u540C\u3058\u3067\u3059\u3002\n%3\n%4
 ParseException.elseNoIf=%0 (\u884C%1): \u4E00\u81F4\u3059\u308B#if\u304C\u306A\u3044#else\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%2\n%3
 ParseException.endNoIf=%0 (\u884C%1): \u4E00\u81F4\u3059\u308B#if\u304C\u306A\u3044#endif\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%2\n%3
@@ -146,7 +146,7 @@
 ParseException.stringTooLong=%0 (\u884C%1): "%2"\u306F%3\u6587\u5B57\u4EE5\u5185\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n%4\n%5
 ParseException.syntax1=%0 (\u884C%1): `%2'\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001`%3'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%4\n%5
 ParseException.syntax2=%0 (\u884C%1): %2\u306E1\u3064\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001`%3'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\n%4\n%5
-ParseException.unclosed=%0: \u30B3\u30E1\u30F3\u30C8\u3067\u4E88\u671F\u3057\u306A\u3044EOF\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002
+ParseException.unclosed=%0: \u30B3\u30E1\u30F3\u30C8\u3067\u4E88\u671F\u3057\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002
 ParseException.undeclaredType=%0 (\u884C%1): %2\u306F\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u578B\u3067\u3059\u3002\n%3\n%4
 ParseException.warning=%0 (\u884C%1): %2\n%3\n%4
 ParseException.constExprType=%0 (\u884C%1): \u5B9A\u6570\u5F0F\u306E\u578B\u306F%2\u3067\u3059\u304C\u3001%3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n%4\n%5
@@ -173,5 +173,5 @@
 #             -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define
 #             Do not translate the string "java com.sun.tools.corba.se.idl.Compile"
 
-usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\ java com.sun.tools.corba.se.idl.Compile [options] <idl file>\n<idl file>\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002<idl file>\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\ \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d <symbol>          IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n\                     \u540C\u3058\u3067\u3059:  #define <symbol>\n-emitAll             #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\n\                     \u767A\u884C\u3057\u307E\u3059\u3002\n-i <include path>    \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n\                     \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep                \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n\                     \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn              \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-v, -verbose         \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version             \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n
+usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n java com.sun.tools.corba.se.idl.Compile [options] <idl file>\n<idl file>\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002<idl file>\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d <symbol>          IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n                     \u540C\u3058\u3067\u3059:  #define <symbol>\n-emitAll             #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\n                     \u767A\u884C\u3057\u307E\u3059\u3002\n-i <include path>    \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n                     \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep                \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n                     \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn              \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-v, -verbose         \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version             \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n
 
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp	Fri Apr 05 14:51:24 2013 -0700
@@ -173,5 +173,5 @@
 #             -i, -d, -keep, -emitAll, -noWarn, -v, -verbose, -version, #define
 #             Do not translate the string "java com.sun.tools.corba.se.idl.Compile"
 
-usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\ java com.sun.tools.corba.se.idl.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u8FD9\u4E9B\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n\ \n\u9009\u9879:\n-d <\u7B26\u53F7>          \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n\                     \u4E0B\u9762\u4E00\u884C:  #define <\u7B26\u53F7>\n-emitAll             \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included\n\                     \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-i <\u5305\u542B\u8DEF\u5F84>    \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n\                     \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep                \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n\                     \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn              \u9690\u85CF\u8B66\u544A\u3002\n-v, -verbose         \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version             \u663E\u793A\u7248\u672C\u53F7\u3002\n
+usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n java com.sun.tools.corba.se.idl.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u8FD9\u4E9B\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n \n\u9009\u9879:\n-d <\u7B26\u53F7>          \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n                     \u4E0B\u9762\u4E00\u884C:  #define <\u7B26\u53F7>\n-emitAll             \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included\n                     \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-i <\u5305\u542B\u8DEF\u5F84>    \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n                     \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep                \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n                     \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn              \u9690\u85CF\u8B66\u544A\u3002\n-v, -verbose         \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version             \u663E\u793A\u7248\u672C\u53F7\u3002\n
 
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp	Fri Apr 05 14:51:24 2013 -0700
@@ -53,7 +53,7 @@
 #
 toJavaProlog1=%0\u306B\u3088\u3063\u3066\u751F\u6210\u3055\u308C\u307E\u3057\u305F
 toJavaProlog2=%0\u304B\u3089
-PreEmit.indeterminateTypeInfo=%0\u306E\u30BF\u30A4\u30D7\u60C5\u5831\u3092\u5224\u65AD\u3067\u304D\u307E\u305B\u3093\u3002
+PreEmit.indeterminateTypeInfo=%0\u306E\u30BF\u30A4\u30D7\u60C5\u5831\u3092\u5224\u5225\u3067\u304D\u307E\u305B\u3093\u3002
 InterfaceGen.noImpl=%0\u306E\u30ED\u30FC\u30AB\u30EB\u5B9F\u88C5\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 Version.product=IDL-to-Java\u30B3\u30F3\u30D1\u30A4\u30E9(\u30DD\u30FC\u30BF\u30D6\u30EB)\u3001\u30D0\u30FC\u30B8\u30E7\u30F3"%0"
 Version.number=3.2
@@ -65,4 +65,4 @@
 #             -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase
 #             Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile"
 #
-usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\n\    java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] <idl file>\n\n<idl file>\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002<idl file>\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\ \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d <symbol>               IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n\                          \u540C\u3058\u3067\u3059:  #define <symbol>\n-emitAll                  #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\u767A\u884C\u3057\u307E\u3059\u3002\n-f<side>                  \u767A\u884C\u3059\u308B\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002<side>\u306Fclient\u3001\n\                          server\u3001all\u3001serverTIE\u3001allTIE\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002serverTIE\u3068allTIE\u306F\n\                          \u59D4\u4EFB\u30E2\u30C7\u30EB\u30FB\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u767A\u884C\u3057\u307E\u3059\u3002\u3053\u306E\u30D5\u30E9\u30B0\u3092\n\                          \u4F7F\u7528\u3057\u306A\u3044\u5834\u5408\u306F\u3001-fclient\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002\n-i <include path>         \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n\                          \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep                     \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n\                          \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn                   \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-oldImplBase              \u53E4\u3044(1.4\u4EE5\u524D) JDK ORB\u3068\u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n-pkgPrefix <t> <prefix>   \u30D5\u30A1\u30A4\u30EB\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D<t>\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n\                          <t>\u306B\u5BFE\u3057\u3066\u751F\u6210\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u306EJava\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u3092\n\                          <prefix>\u3067\u59CB\u3081\u307E\u3059\u3002\n-pkgTranslate <t> <pkg>   \u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D<t>\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n\                          \u751F\u6210\u3055\u308C\u305FJava\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u3067<pkg>\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002pkgPrefix\u306E\n\                          \u5909\u66F4\u304C\u5148\u306B\u884C\u308F\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002<t>\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n\                          \u6B63\u5F0F\u540D\u3068\u5B8C\u5168\u306B\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305F\u3001<t>\u3092\n\                          org\u3001org.omg\u307E\u305F\u306Forg.omg\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\n-skeletonName <xxx%yyy>   \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066\u30B9\u30B1\u30EB\u30C8\u30F3\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\n\                          \u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\                          POA\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F%POA (-fserver\u307E\u305F\u306F-fall) \n\                          oldImplBase\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F_%ImplBase\n\                          (-oldImplBase\u304A\u3088\u3073(-fserver\u307E\u305F\u306F-fall))\u3002\n-td <dir>                 \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u304B\u308F\u308A\u306B<dir>\u3092\n\                          \u4F7F\u7528\u3057\u307E\u3059\u3002\n-tieName <xxx%yyy>        \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066tie\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\                          POA tie\u306E\u5834\u5408\u306F%POATie (-fserverTie\u307E\u305F\u306F-fallTie) \n\                          oldImplBase tie\u306E\u5834\u5408\u306F%_Tie\n\                          (-oldImplBase\u304A\u3088\u3073(-fserverTie\u307E\u305F\u306F-fallTie))\u3002\n-v, -verbose              \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version                  \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059\u3002\n
+usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\n    java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] <idl file>\n\n<idl file>\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002<idl file>\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d <symbol>               IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n                          \u540C\u3058\u3067\u3059:  #define <symbol>\n-emitAll                  #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\u767A\u884C\u3057\u307E\u3059\u3002\n-f<side>                  \u767A\u884C\u3059\u308B\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002<side>\u306Fclient\u3001\n                          server\u3001all\u3001serverTIE\u3001allTIE\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002serverTIE\u3068allTIE\u306F\n                          \u59D4\u4EFB\u30E2\u30C7\u30EB\u30FB\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u767A\u884C\u3057\u307E\u3059\u3002\u3053\u306E\u30D5\u30E9\u30B0\u3092\n                          \u4F7F\u7528\u3057\u306A\u3044\u5834\u5408\u306F\u3001-fclient\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002\n-i <include path>         \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n                          \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep                     \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n                          \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn                   \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-oldImplBase              \u53E4\u3044(1.4\u4EE5\u524D) JDK ORB\u3068\u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n-pkgPrefix <t> <prefix>   \u30D5\u30A1\u30A4\u30EB\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D<t>\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n                          <t>\u306B\u5BFE\u3057\u3066\u751F\u6210\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u306EJava\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u3092\n                          <prefix>\u3067\u59CB\u3081\u307E\u3059\u3002\n-pkgTranslate <t> <pkg>   \u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D<t>\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n                          \u751F\u6210\u3055\u308C\u305FJava\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u3067<pkg>\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002pkgPrefix\u306E\n                          \u5909\u66F4\u304C\u5148\u306B\u884C\u308F\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002<t>\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n                          \u6B63\u5F0F\u540D\u3068\u5B8C\u5168\u306B\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305F\u3001<t>\u3092\n                          org\u3001org.omg\u307E\u305F\u306Forg.omg\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\n-skeletonName <xxx%yyy>   \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066\u30B9\u30B1\u30EB\u30C8\u30F3\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\n                          \u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n                          POA\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F%POA (-fserver\u307E\u305F\u306F-fall) \n                          oldImplBase\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F_%ImplBase\n                          (-oldImplBase\u304A\u3088\u3073(-fserver\u307E\u305F\u306F-fall))\u3002\n-td <dir>                 \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u304B\u308F\u308A\u306B<dir>\u3092\n                          \u4F7F\u7528\u3057\u307E\u3059\u3002\n-tieName <xxx%yyy>        \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066tie\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n                          POA tie\u306E\u5834\u5408\u306F%POATie (-fserverTie\u307E\u305F\u306F-fallTie) \n                          oldImplBase tie\u306E\u5834\u5408\u306F%_Tie\n                          (-oldImplBase\u304A\u3088\u3073(-fserverTie\u307E\u305F\u306F-fallTie))\u3002\n-v, -verbose              \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version                  \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059\u3002\n
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp	Fri Apr 05 12:12:34 2013 -0700
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp	Fri Apr 05 14:51:24 2013 -0700
@@ -65,4 +65,4 @@
 #             -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase
 #             Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile"
 #
-usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\n\    java com.sun.tools.corba.se.idl.toJavaPortable.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684,\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n\ \n\u9009\u9879:\n-d <\u7B26\u53F7>               \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n\                          \u4E0B\u9762\u4E00\u884C:  #define <\u7B26\u53F7>\n-emitAll                  \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-f<side>                  \u5B9A\u4E49\u8981\u53D1\u51FA\u54EA\u4E9B\u7ED1\u5B9A\u3002<side> \u662F client,\n\                          server, all, serverTIE, allTIE \u4E4B\u4E00\u3002serverTIE \u548C allTIE\n\                          \u5BFC\u81F4\u53D1\u51FA\u59D4\u6D3E\u6A21\u578B\u9AA8\u67B6\u3002\u5982\u679C\u672A\u4F7F\u7528\n\                          \u6B64\u6807\u8BB0, \u5C06\u5047\u5B9A\u4E3A -fclient\u3002\n-i <\u5305\u542B\u8DEF\u5F84>         \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n\                          \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep                     \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n\                          \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn                   \u9690\u85CF\u8B66\u544A\u3002\n-oldImplBase              \u751F\u6210\u4E0E\u65E7\u7248 (1.4 \u7248\u4E4B\u524D) JDK ORB \u517C\u5BB9\u7684\u9AA8\u67B6\u3002\n-pkgPrefix <t> <\u524D\u7F00>   \u5F53\u5728\u6587\u4EF6\u8303\u56F4\u5185\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6,\n\                          \u5728\u4E3A <t> \u751F\u6210\u7684\u6240\u6709\u6587\u4EF6\u7684 Java \u7A0B\u5E8F\u5305\u540D\u524D\n\                          \u6DFB\u52A0 <\u524D\u7F00>\u3002\n-pkgTranslate <t> <pkg>   \u5F53\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6, \u5728\n\                          \u751F\u6210\u7684 Java \u7A0B\u5E8F\u5305\u4E2D\u5C06\u5176\u66FF\u6362\u4E3A <pkg>\u3002\u8BF7\u6CE8\u610F, \n\                          \u5C06\u9996\u5148\u8FDB\u884C pkgPrefix \u66F4\u6539\u3002<t> \u5FC5\u987B\u4E0E\n\                          \u5B8C\u6574\u7A0B\u5E8F\u5305\u540D\u5B8C\u5168\u5339\u914D\u3002\u53E6\u5916, <t> \u4E0D\u80FD\u4E3A\n\                          org, org.omg \u6216 org.omg \u7684\u4EFB\u4F55\u5B50\u7A0B\u5E8F\u5305\u3002\n-skeletonName <xxx%yyy>   \u6839\u636E\u6A21\u5F0F\u547D\u540D\u9AA8\u67B6\u3002\n\                          \u9ED8\u8BA4\u503C\u4E3A:\n\                          %POA \u8868\u793A POA \u57FA\u7C7B (-fserver \u6216 -fall) \n\                          _%ImplBase \u8868\u793A oldImplBase \u57FA\u7C7B\n\                          (-oldImplBase \u548C (-fserver \u6216 -fall))\u3002\n-td <dir>                 \u4F7F\u7528 <dir> \u8868\u793A\u8F93\u51FA\u76EE\u5F55\u4EE5\u4EE3\u66FF\n\                          \u5F53\u524D\u76EE\u5F55\u3002\n-tieName <xxx%yyy>        \u6839\u636E\u6A21\u5F0F\u547D\u540D tie\u3002\u9ED8\u8BA4\u503C\u4E3A:\n\                          %POATie \u8868\u793A POA tie (-fserverTie \u6216 -fallTie) \n\                          %_Tie \u8868\u793A oldImplBase tie\n\                          (-oldImplBase \u548C (-fserverTie \u6216 -fallTie))\u3002\n-v, -verbose              \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version                  \u663E\u793A\u7248\u672C\u53F7\u5E76\u9000\u51FA\u3002\n
+usage=\u7F16\u8BD1\u5668\u7528\u6CD5:\n\n    java com.sun.tools.corba.se.idl.toJavaPortable.Compile [\u9009\u9879] <idl \u6587\u4EF6>\n\n\u5176\u4E2D, <idl \u6587\u4EF6> \u662F\u5305\u542B IDL \u5B9A\u4E49\u7684\u6587\u4EF6\u7684\u540D\u79F0, \u800C\n[\u9009\u9879] \u662F\u4E0B\u5217\u9009\u9879\u7684\u4EFB\u610F\u7EC4\u5408\u3002\u9009\u9879\n\u662F\u53EF\u9009\u7684, \u5E76\u4E14\u663E\u793A\u987A\u5E8F\u5E76\u4E0D\u56FA\u5B9A; <idl \u6587\u4EF6> \u662F\u5FC5\u9700\u7684,\n\u5E76\u4E14\u5FC5\u987B\u663E\u793A\u5728\u6700\u540E\u3002\n \n\u9009\u9879:\n-d <\u7B26\u53F7>               \u8FD9\u7B49\u540C\u4E8E IDL \u6587\u4EF6\u4E2D\u7684\n                          \u4E0B\u9762\u4E00\u884C:  #define <\u7B26\u53F7>\n-emitAll                  \u53D1\u51FA\u6240\u6709\u7C7B\u578B, \u5305\u62EC\u5728 #included \u6587\u4EF6\u4E2D\u627E\u5230\u7684\u7C7B\u578B\u3002\n-f<side>                  \u5B9A\u4E49\u8981\u53D1\u51FA\u54EA\u4E9B\u7ED1\u5B9A\u3002<side> \u662F client,\n                          server, all, serverTIE, allTIE \u4E4B\u4E00\u3002serverTIE \u548C allTIE\n                          \u5BFC\u81F4\u53D1\u51FA\u59D4\u6D3E\u6A21\u578B\u9AA8\u67B6\u3002\u5982\u679C\u672A\u4F7F\u7528\n                          \u6B64\u6807\u8BB0, \u5C06\u5047\u5B9A\u4E3A -fclient\u3002\n-i <\u5305\u542B\u8DEF\u5F84>         \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u5728\u5F53\u524D\u76EE\u5F55\u4E2D\u626B\u63CF\n                          \u5305\u542B\u7684\u6587\u4EF6\u3002\u6B64\u9009\u9879\u5C06\u6DFB\u52A0\u53E6\u4E00\u4E2A\u76EE\u5F55\u3002\n-keep                     \u5982\u679C\u8981\u751F\u6210\u7684\u6587\u4EF6\u5DF2\u5B58\u5728, \u8BF7\u4E0D\u8981\n                          \u8986\u76D6\u5B83\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u8986\u76D6\u5B83\u3002\n-noWarn                   \u9690\u85CF\u8B66\u544A\u3002\n-oldImplBase              \u751F\u6210\u4E0E\u65E7\u7248 (1.4 \u7248\u4E4B\u524D) JDK ORB \u517C\u5BB9\u7684\u9AA8\u67B6\u3002\n-pkgPrefix <t> <\u524D\u7F00>   \u5F53\u5728\u6587\u4EF6\u8303\u56F4\u5185\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6,\n                          \u5728\u4E3A <t> \u751F\u6210\u7684\u6240\u6709\u6587\u4EF6\u7684 Java \u7A0B\u5E8F\u5305\u540D\u524D\n                          \u6DFB\u52A0 <\u524D\u7F00>\u3002\n-pkgTranslate <t> <pkg>   \u5F53\u9047\u5230\u7C7B\u578B\u6216\u6A21\u5757\u540D <t> \u65F6, \u5728\n                          \u751F\u6210\u7684 Java \u7A0B\u5E8F\u5305\u4E2D\u5C06\u5176\u66FF\u6362\u4E3A <pkg>\u3002\u8BF7\u6CE8\u610F, \n                          \u5C06\u9996\u5148\u8FDB\u884C pkgPrefix \u66F4\u6539\u3002<t> \u5FC5\u987B\u4E0E\n                          \u5B8C\u6574\u7A0B\u5E8F\u5305\u540D\u5B8C\u5168\u5339\u914D\u3002\u53E6\u5916, <t> \u4E0D\u80FD\u4E3A\n                          org, org.omg \u6216 org.omg \u7684\u4EFB\u4F55\u5B50\u7A0B\u5E8F\u5305\u3002\n-skeletonName <xxx%yyy>   \u6839\u636E\u6A21\u5F0F\u547D\u540D\u9AA8\u67B6\u3002\n                          \u9ED8\u8BA4\u503C\u4E3A:\n                          %POA \u8868\u793A POA \u57FA\u7C7B (-fserver \u6216 -fall) \n                          _%ImplBase \u8868\u793A oldImplBase \u57FA\u7C7B\n                          (-oldImplBase \u548C (-fserver \u6216 -fall))\u3002\n-td <dir>                 \u4F7F\u7528 <dir> \u8868\u793A\u8F93\u51FA\u76EE\u5F55\u4EE5\u4EE3\u66FF\n                          \u5F53\u524D\u76EE\u5F55\u3002\n-tieName <xxx%yyy>        \u6839\u636E\u6A21\u5F0F\u547D\u540D tie\u3002\u9ED8\u8BA4\u503C\u4E3A:\n                          %POATie \u8868\u793A POA tie (-fserverTie \u6216 -fallTie) \n                          %_Tie \u8868\u793A oldImplBase tie\n                          (-oldImplBase \u548C (-fserverTie \u6216 -fallTie))\u3002\n-v, -verbose              \u8BE6\u7EC6\u6A21\u5F0F\u3002\n-version                  \u663E\u793A\u7248\u672C\u53F7\u5E76\u9000\u51FA\u3002\n
--- a/hotspot/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -326,3 +326,5 @@
 0631ebcc45f05c73b09a56c2586685af1f781c1d hs25-b23
 3db4ab0e12f437fe374817de346b2b0c6b4a5b31 jdk8-b82
 e3a41fc0234895eba4f272b984f7dacff495f8eb hs25-b24
+1c8db54ee9f315e20d6d5d9bf0b5c10349e9d301 jdk8-b83
+8d0f263a370c5f3e61791bb06054560804117288 hs25-b25
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug	Fri Apr 05 14:51:24 2013 -0700
@@ -135,6 +135,7 @@
                 JVM_GetEnclosingMethodInfo;
                 JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
+                JVM_GetFieldTypeAnnotations;
                 JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
@@ -156,6 +157,7 @@
                 JVM_GetMethodIxSignatureUTF;
                 JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
+                JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
                 JVM_GetSockName;
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product	Fri Apr 05 14:51:24 2013 -0700
@@ -135,6 +135,7 @@
                 JVM_GetEnclosingMethodInfo;
                 JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
+                JVM_GetFieldTypeAnnotations;
                 JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
@@ -156,6 +157,7 @@
                 JVM_GetMethodIxSignatureUTF;
                 JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
+                JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
                 JVM_GetSockName;
--- a/hotspot/make/excludeSrc.make	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/excludeSrc.make	Fri Apr 05 14:51:24 2013 -0700
@@ -28,7 +28,8 @@
       Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
 	jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
 	jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
-	jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp
+	jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
+	jvmtiClassFileReconstituter.cpp
 endif
 
 ifeq ($(INCLUDE_FPROF), false)
--- a/hotspot/make/hotspot_version	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/hotspot_version	Fri Apr 05 14:51:24 2013 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=24
+HS_BUILD_NUMBER=25
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug	Fri Apr 05 14:51:24 2013 -0700
@@ -131,6 +131,7 @@
                 JVM_GetEnclosingMethodInfo;
                 JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
+                JVM_GetFieldTypeAnnotations;
                 JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
@@ -152,6 +153,7 @@
                 JVM_GetMethodIxSignatureUTF;
                 JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
+                JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
                 JVM_GetSockName;
--- a/hotspot/make/linux/makefiles/mapfile-vers-product	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product	Fri Apr 05 14:51:24 2013 -0700
@@ -131,6 +131,7 @@
                 JVM_GetEnclosingMethodInfo;
                 JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
+                JVM_GetFieldTypeAnnotations;
                 JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
@@ -152,6 +153,7 @@
                 JVM_GetMethodIxSignatureUTF;
                 JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
+                JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
                 JVM_GetSockName;
--- a/hotspot/make/solaris/makefiles/mapfile-vers	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/solaris/makefiles/mapfile-vers	Fri Apr 05 14:51:24 2013 -0700
@@ -131,6 +131,7 @@
                 JVM_GetEnclosingMethodInfo;
                 JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
+                JVM_GetFieldTypeAnnotations;
                 JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
@@ -152,6 +153,7 @@
                 JVM_GetMethodIxSignatureUTF;
                 JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
+                JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
                 JVM_GetSockName;
--- a/hotspot/make/windows/build.make	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/windows/build.make	Fri Apr 05 14:51:24 2013 -0700
@@ -110,8 +110,6 @@
 !endif
 !elseif "$(Variant)" == "tiered"
 VARIANT_TEXT=Tiered
-!elseif "$(Variant)" == "kernel"
-VARIANT_TEXT=Kernel
 !endif
 
 #########################################################################
@@ -305,9 +303,9 @@
 checks: checkVariant checkWorkSpace checkSA
 
 checkVariant:
-	@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
-	@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
-          echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
+	@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false
+	@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "core" \
+          echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false
 
 checkWorkSpace:
 	@ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
--- a/hotspot/make/windows/create.bat	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/windows/create.bat	Fri Apr 05 14:51:24 2013 -0700
@@ -148,7 +148,7 @@
 
 REM This is now safe to do.
 :copyfiles
-for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
+for /D %%i in (compiler1, compiler2, tiered, core) do (
 if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
 copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
 )
@@ -156,7 +156,7 @@
 REM force regneration of ProjectFile
 if exist %ProjectFile% del %ProjectFile%
 
-for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
+for /D %%i in (compiler1, compiler2, tiered, core) do (
 echo -- %%i --
 echo # Generated file!                                                        >    %HotSpotBuildSpace%\%%i\local.make
 echo # Changing a variable below and then deleting %ProjectFile% will cause  >>    %HotSpotBuildSpace%\%%i\local.make
--- a/hotspot/make/windows/makefiles/compile.make	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/windows/makefiles/compile.make	Fri Apr 05 14:51:24 2013 -0700
@@ -221,13 +221,6 @@
 !endif
 !endif
 
-# Compile for space above time.
-!if "$(Variant)" == "kernel"
-PRODUCT_OPT_OPTION   = /O1 /Oy-
-FASTDEBUG_OPT_OPTION = /O1 /Oy-
-DEBUG_OPT_OPTION     = /Od
-!endif
-
 # If NO_OPTIMIZATIONS is defined in the environment, turn everything off
 !ifdef NO_OPTIMIZATIONS
 PRODUCT_OPT_OPTION   = $(DEBUG_OPT_OPTION)
--- a/hotspot/make/windows/makefiles/product.make	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/windows/makefiles/product.make	Fri Apr 05 14:51:24 2013 -0700
@@ -51,13 +51,6 @@
 # Force resources to be rebuilt every time
 $(Res_Files): FORCE
 
-# Kernel doesn't need exported vtbl symbols.
-!if "$(Variant)" == "kernel"
-$(AOUT): $(Res_Files) $(Obj_Files)
-	$(LD) @<<
-  $(LD_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files)
-<<
-!else
 vm.def: $(Obj_Files)
 	sh $(WorkSpace)/make/windows/build_vm_def.sh
 
@@ -65,7 +58,6 @@
 	$(LD) @<<
   $(LD_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
 <<
-!endif
 !if "$(MT)" != ""
 # The previous link command created a .manifest file that we want to
 # insert into the linked artifact so we do not need to track it
--- a/hotspot/make/windows/makefiles/vm.make	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/make/windows/makefiles/vm.make	Fri Apr 05 14:51:24 2013 -0700
@@ -89,12 +89,8 @@
 # AsyncGetCallTrace is not supported on IA64 yet
 AGCT_EXPORT=
 !else
-!if "$(Variant)" == "kernel"
-AGCT_EXPORT=
-!else
 AGCT_EXPORT=/export:AsyncGetCallTrace
 !endif
-!endif
 
 # If you modify exports below please do the corresponding changes in
 # src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
--- a/hotspot/make/windows/projectfiles/kernel/Makefile	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#
-# Copyright (c) 2007, 2010, 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.
-#  
-#
-
-!include ../local.make
-
-!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- a/hotspot/make/windows/projectfiles/kernel/vm.def	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-;
-; This .DEF file is a placeholder for one which is automatically
-; generated during the build process. See
-; make\windows\build_vm_def.sh and
-; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
-; options).
-;
--- a/hotspot/make/windows/projectfiles/kernel/vm.dsw	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "vm"=.\vm.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -1811,13 +1811,15 @@
 class VM_LinuxDllLoad: public VM_Operation {
  private:
   const char *_filename;
+  char *_ebuf;
+  int _ebuflen;
   void *_lib;
  public:
-  VM_LinuxDllLoad(const char *fn) :
-    _filename(fn), _lib(NULL) {}
+  VM_LinuxDllLoad(const char *fn, char *ebuf, int ebuflen) :
+    _filename(fn), _ebuf(ebuf), _ebuflen(ebuflen), _lib(NULL) {}
   VMOp_Type type() const { return VMOp_LinuxDllLoad; }
   void doit() {
-    _lib = os::Linux::dll_load_inner(_filename);
+    _lib = os::Linux::dll_load_in_vmthread(_filename, _ebuf, _ebuflen);
     os::Linux::_stack_is_executable = true;
   }
   void* loaded_library() { return _lib; }
@@ -1865,13 +1867,13 @@
             // This is for the case where the DLL has an static
             // constructor function that executes JNI code. We cannot
             // load such DLLs in the VMThread.
-            result = ::dlopen(filename, RTLD_LAZY);
+            result = os::Linux::dlopen_helper(filename, ebuf, ebuflen);
           }
 
           ThreadInVMfromNative tiv(jt);
           debug_only(VMNativeEntryWrapper vew;)
 
-          VM_LinuxDllLoad op(filename);
+          VM_LinuxDllLoad op(filename, ebuf, ebuflen);
           VMThread::execute(&op);
           if (LoadExecStackDllInVMThread) {
             result = op.loaded_library();
@@ -1883,7 +1885,7 @@
   }
 
   if (!load_attempted) {
-    result = ::dlopen(filename, RTLD_LAZY);
+    result = os::Linux::dlopen_helper(filename, ebuf, ebuflen);
   }
 
   if (result != NULL) {
@@ -1892,11 +1894,6 @@
   }
 
   Elf32_Ehdr elf_head;
-
-  // Read system error message into ebuf
-  // It may or may not be overwritten below
-  ::strncpy(ebuf, ::dlerror(), ebuflen-1);
-  ebuf[ebuflen-1]='\0';
   int diag_msg_max_length=ebuflen-strlen(ebuf);
   char* diag_msg_buf=ebuf+strlen(ebuf);
 
@@ -2039,10 +2036,19 @@
   return NULL;
 }
 
-void * os::Linux::dll_load_inner(const char *filename) {
+void * os::Linux::dlopen_helper(const char *filename, char *ebuf, int ebuflen) {
+  void * result = ::dlopen(filename, RTLD_LAZY);
+  if (result == NULL) {
+    ::strncpy(ebuf, ::dlerror(), ebuflen - 1);
+    ebuf[ebuflen-1] = '\0';
+  }
+  return result;
+}
+
+void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, int ebuflen) {
   void * result = NULL;
   if (LoadExecStackDllInVMThread) {
-    result = ::dlopen(filename, RTLD_LAZY);
+    result = dlopen_helper(filename, ebuf, ebuflen);
   }
 
   // Since 7019808, libjvm.so is linked with -noexecstack. If the VM loads a
--- a/hotspot/src/os/linux/vm/os_linux.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -95,7 +95,8 @@
 
  public:
   static bool _stack_is_executable;
-  static void *dll_load_inner(const char *name);
+  static void *dlopen_helper(const char *name, char *ebuf, int ebuflen);
+  static void *dll_load_in_vmthread(const char *name, char *ebuf, int ebuflen);
 
   static void init_thread_fpu_state();
   static int  get_fpu_control_word();
--- a/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -46,7 +46,7 @@
 
 define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 
 #endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
--- a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -41,7 +41,7 @@
 define_pd_global(intx,  CompilerThreadStackSize, 0);
 define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 
 #endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
--- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -33,7 +33,7 @@
 define_pd_global(uintx, JVMInvokeMethodSlack,    12288);
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx, HeapBaseMinAddress,      CONST64(4)*G);
 
 #endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
--- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -44,7 +44,7 @@
 
 define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx,HeapBaseMinAddress,       2*G);
 
 #endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
--- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -41,7 +41,7 @@
 define_pd_global(intx,  CompilerThreadStackSize, 0);
 define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 
 #endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
--- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -33,7 +33,7 @@
 define_pd_global(uintx, JVMInvokeMethodSlack,    12288);
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 #ifdef _LP64
 define_pd_global(uintx, HeapBaseMinAddress,      CONST64(4)*G);
 #else
--- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -43,7 +43,7 @@
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx,HeapBaseMinAddress,       256*M);
 
 #endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
--- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -45,7 +45,7 @@
 
 define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
 
-// Used on 64 bit platforms for UseCompressedOops base address or CDS
+// Used on 64 bit platforms for UseCompressedOops base address
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 
 #endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
--- a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java	Fri Apr 05 14:51:24 2013 -0700
@@ -568,36 +568,6 @@
     }
 }
 
-class KernelDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    KernelDebugConfig() {
-        initNames("kernel", "debug", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class KernelFastDebugConfig extends GenericDebugConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    KernelFastDebugConfig() {
-        initNames("kernel", "fastdebug", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-class KernelProductConfig extends ProductConfig {
-    KernelProductConfig() {
-        initNames("kernel", "product", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
 
 abstract class CompilerInterface {
     abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java	Fri Apr 05 14:51:24 2013 -0700
@@ -564,12 +564,6 @@
         allConfigs.add(new CoreFastDebugConfig());
         allConfigs.add(new CoreProductConfig());
 
-        if (platform.equals("Win32")) {
-            allConfigs.add(new KernelDebugConfig());
-            allConfigs.add(new KernelFastDebugConfig());
-            allConfigs.add(new KernelProductConfig());
-        }
-
         return allConfigs;
     }
 
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -2196,8 +2196,7 @@
                                       true,     // is LVTT
                                       CHECK_(nullHandle));
           lvtt_cnt++;
-        } else if (UseSplitVerifier &&
-                   _major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION &&
+        } else if (_major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION &&
                    _cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_stack_map_table()) {
           // Stack map is only needed by the new verifier in JDK1.5.
           if (parsed_stackmap_attribute) {
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -61,8 +61,8 @@
 # include "bytes_ppc.hpp"
 #endif
 
-#define NOFAILOVER_MAJOR_VERSION                  51
-#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION  52
+#define NOFAILOVER_MAJOR_VERSION                       51
+#define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION  51
 
 // Access to external entry for VerifyClassCodes - old byte code verifier
 
@@ -127,8 +127,7 @@
     if (TraceClassInitialization) {
       tty->print_cr("Start class verification for: %s", klassName);
     }
-    if (UseSplitVerifier &&
-        klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) {
+    if (klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) {
       ClassVerifier split_verifier(klass, THREAD);
       split_verifier.verify_class(THREAD);
       exception_name = split_verifier.result();
@@ -2027,16 +2026,19 @@
   address bcp = bcs->bcp();
   address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize);
 
-  // 4639449 & 4647081: padding bytes must be 0
-  u2 padding_offset = 1;
-  while ((bcp + padding_offset) < aligned_bcp) {
-    if(*(bcp + padding_offset) != 0) {
-      verify_error(ErrorContext::bad_code(bci),
-                   "Nonzero padding byte in lookswitch or tableswitch");
-      return;
+  if (_klass->major_version() < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) {
+    // 4639449 & 4647081: padding bytes must be 0
+    u2 padding_offset = 1;
+    while ((bcp + padding_offset) < aligned_bcp) {
+      if(*(bcp + padding_offset) != 0) {
+        verify_error(ErrorContext::bad_code(bci),
+                     "Nonzero padding byte in lookswitch or tableswitch");
+        return;
+      }
+      padding_offset++;
     }
-    padding_offset++;
   }
+
   int default_offset = (int) Bytes::get_Java_u4(aligned_bcp);
   int keys, delta;
   current_frame->pop_stack(
@@ -2318,11 +2320,6 @@
       types = (1 << JVM_CONSTANT_InterfaceMethodref) |
               (1 << JVM_CONSTANT_Methodref);
       break;
-    case Bytecodes::_invokestatic:
-      types = (_klass->major_version() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ?
-        (1 << JVM_CONSTANT_Methodref) :
-        ((1 << JVM_CONSTANT_InterfaceMethodref) | (1 << JVM_CONSTANT_Methodref));
-      break;
     default:
       types = 1 << JVM_CONSTANT_Methodref;
   }
--- a/hotspot/src/share/vm/memory/filemap.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -372,7 +372,7 @@
   // other reserved memory (like the code cache).
   ReservedSpace rs(size, alignment, false, requested_addr);
   if (!rs.is_reserved()) {
-    fail_continue(err_msg("Unable to reserved shared space at required address " INTPTR_FORMAT, requested_addr));
+    fail_continue(err_msg("Unable to reserve shared space at required address " INTPTR_FORMAT, requested_addr));
     return rs;
   }
   // the reserved virtual memory is for mapping class data sharing archive
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -337,27 +337,16 @@
   // align up to vm allocation granularity
   byte_size = align_size_up(byte_size, os::vm_allocation_granularity());
 
-  // This allocates memory with mmap.  For DumpSharedspaces, allocate the
-  // space at low memory so that other shared images don't conflict.
-  // This is the same address as memory needed for UseCompressedOops but
-  // compressed oops don't work with CDS (offsets in metadata are wrong), so
-  // borrow the same address.
+  // This allocates memory with mmap.  For DumpSharedspaces, try to reserve
+  // configurable address, generally at the top of the Java heap so other
+  // memory addresses don't conflict.
   if (DumpSharedSpaces) {
-    char* shared_base = (char*)HeapBaseMinAddress;
+    char* shared_base = (char*)SharedBaseAddress;
     _rs = ReservedSpace(byte_size, 0, false, shared_base, 0);
     if (_rs.is_reserved()) {
-      assert(_rs.base() == shared_base, "should match");
+      assert(shared_base == 0 || _rs.base() == shared_base, "should match");
     } else {
-      // If we are dumping the heap, then allocate a wasted block of address
-      // space in order to push the heap to a lower address.  This extra
-      // address range allows for other (or larger) libraries to be loaded
-      // without them occupying the space required for the shared spaces.
-      uintx reserved = 0;
-      uintx block_size = 64*1024*1024;
-      while (reserved < SharedDummyBlockSize) {
-        char* dummy = os::reserve_memory(block_size);
-        reserved += block_size;
-      }
+      // Get a mmap region anywhere if the SharedBaseAddress fails.
       _rs = ReservedSpace(byte_size);
     }
     MetaspaceShared::set_shared_rs(&_rs);
--- a/hotspot/src/share/vm/prims/jvm.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -1457,7 +1457,7 @@
 JVM_ENTRY(jbyteArray, JVM_GetClassAnnotations(JNIEnv *env, jclass cls))
   assert (cls != NULL, "illegal class");
   JVMWrapper("JVM_GetClassAnnotations");
-  ResourceMark rm(THREAD);
+
   // Return null for arrays and primitives
   if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
     Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
@@ -1470,20 +1470,15 @@
 JVM_END
 
 
-JVM_ENTRY(jbyteArray, JVM_GetFieldAnnotations(JNIEnv *env, jobject field))
-  assert(field != NULL, "illegal field");
-  JVMWrapper("JVM_GetFieldAnnotations");
-
+static bool jvm_get_field_common(jobject field, fieldDescriptor& fd, TRAPS) {
   // some of this code was adapted from from jni_FromReflectedField
 
-  // field is a handle to a java.lang.reflect.Field object
   oop reflected = JNIHandles::resolve_non_null(field);
   oop mirror    = java_lang_reflect_Field::clazz(reflected);
   Klass* k    = java_lang_Class::as_Klass(mirror);
   int slot      = java_lang_reflect_Field::slot(reflected);
   int modifiers = java_lang_reflect_Field::modifiers(reflected);
 
-  fieldDescriptor fd;
   KlassHandle kh(THREAD, k);
   intptr_t offset = InstanceKlass::cast(kh())->field_offset(slot);
 
@@ -1491,16 +1486,29 @@
     // for static fields we only look in the current class
     if (!InstanceKlass::cast(kh())->find_local_field_from_offset(offset, true, &fd)) {
       assert(false, "cannot find static field");
-      return NULL;  // robustness
+      return false;
     }
   } else {
     // for instance fields we start with the current class and work
     // our way up through the superclass chain
     if (!InstanceKlass::cast(kh())->find_field_from_offset(offset, false, &fd)) {
       assert(false, "cannot find instance field");
-      return NULL;  // robustness
+      return false;
     }
   }
+  return true;
+}
+
+JVM_ENTRY(jbyteArray, JVM_GetFieldAnnotations(JNIEnv *env, jobject field))
+  // field is a handle to a java.lang.reflect.Field object
+  assert(field != NULL, "illegal field");
+  JVMWrapper("JVM_GetFieldAnnotations");
+
+  fieldDescriptor fd;
+  bool gotFd = jvm_get_field_common(field, fd, CHECK_NULL);
+  if (!gotFd) {
+    return NULL;
+  }
 
   return (jbyteArray) JNIHandles::make_local(env, Annotations::make_java_array(fd.annotations(), THREAD));
 JVM_END
@@ -1525,12 +1533,8 @@
   Klass* k = java_lang_Class::as_Klass(mirror);
 
   Method* m = InstanceKlass::cast(k)->method_with_idnum(slot);
-  if (m == NULL) {
-    assert(false, "cannot find method");
-    return NULL;  // robustness
-  }
-
-  return m;
+  assert(m != NULL, "cannot find method");
+  return m;  // caller has to deal with NULL in product mode
 }
 
 
@@ -1539,6 +1543,10 @@
 
   // method is a handle to a java.lang.reflect.Method object
   Method* m = jvm_get_method_common(method);
+  if (m == NULL) {
+    return NULL;
+  }
+
   return (jbyteArray) JNIHandles::make_local(env,
     Annotations::make_java_array(m->annotations(), THREAD));
 JVM_END
@@ -1549,6 +1557,10 @@
 
   // method is a handle to a java.lang.reflect.Method object
   Method* m = jvm_get_method_common(method);
+  if (m == NULL) {
+    return NULL;
+  }
+
   return (jbyteArray) JNIHandles::make_local(env,
     Annotations::make_java_array(m->annotation_default(), THREAD));
 JVM_END
@@ -1559,6 +1571,10 @@
 
   // method is a handle to a java.lang.reflect.Method object
   Method* m = jvm_get_method_common(method);
+  if (m == NULL) {
+    return NULL;
+  }
+
   return (jbyteArray) JNIHandles::make_local(env,
     Annotations::make_java_array(m->parameter_annotations(), THREAD));
 JVM_END
@@ -1583,6 +1599,38 @@
   return NULL;
 JVM_END
 
+JVM_ENTRY(jbyteArray, JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method))
+  assert (method != NULL, "illegal method");
+  JVMWrapper("JVM_GetMethodTypeAnnotations");
+
+  // method is a handle to a java.lang.reflect.Method object
+  Method* m = jvm_get_method_common(method);
+  if (m == NULL) {
+    return NULL;
+  }
+
+  AnnotationArray* type_annotations = m->type_annotations();
+  if (type_annotations != NULL) {
+    typeArrayOop a = Annotations::make_java_array(type_annotations, CHECK_NULL);
+    return (jbyteArray) JNIHandles::make_local(env, a);
+  }
+
+  return NULL;
+JVM_END
+
+JVM_ENTRY(jbyteArray, JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field))
+  assert (field != NULL, "illegal field");
+  JVMWrapper("JVM_GetFieldTypeAnnotations");
+
+  fieldDescriptor fd;
+  bool gotFd = jvm_get_field_common(field, fd, CHECK_NULL);
+  if (!gotFd) {
+    return NULL;
+  }
+
+  return (jbyteArray) JNIHandles::make_local(env, Annotations::make_java_array(fd.type_annotations(), THREAD));
+JVM_END
+
 static void bounds_check(constantPoolHandle cp, jint index, TRAPS) {
   if (!cp->is_within_bounds(index)) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Constant pool index out of bounds");
@@ -1722,7 +1770,7 @@
   int i;
   for (i = 0; i < methods_length; i++) {
     methodHandle method(THREAD, methods->at(i));
-    if (!method->is_initializer()) {
+    if (!method->is_initializer() && !method->is_overpass()) {
       if (!publicOnly || method->is_public()) {
         ++num_methods;
       }
@@ -1736,7 +1784,7 @@
   int out_idx = 0;
   for (i = 0; i < methods_length; i++) {
     methodHandle method(THREAD, methods->at(i));
-    if (!method->is_initializer()) {
+    if (!method->is_initializer() && !method->is_overpass()) {
       if (!publicOnly || method->is_public()) {
         oop m = Reflection::new_method(method, UseNewReflection, false, CHECK_NULL);
         result->obj_at_put(out_idx, m);
--- a/hotspot/src/share/vm/prims/jvm.h	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/prims/jvm.h	Fri Apr 05 14:51:24 2013 -0700
@@ -523,6 +523,14 @@
 JNIEXPORT jbyteArray JNICALL
 JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls);
 
+// field is a handle to a java.lang.reflect.Field object
+JNIEXPORT jbyteArray JNICALL
+JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field);
+
+// method is a handle to a java.lang.reflect.Method object
+JNIEXPORT jbyteArray JNICALL
+JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method);
+
 /*
  * New (JDK 1.4) reflection implementation
  */
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -260,6 +260,7 @@
   { "CMSRevisitStackSize",           JDK_Version::jdk(8), JDK_Version::jdk(9) },
   { "PrintRevisitStats",             JDK_Version::jdk(8), JDK_Version::jdk(9) },
   { "UseVectoredExceptions",         JDK_Version::jdk(8), JDK_Version::jdk(9) },
+  { "UseSplitVerifier",              JDK_Version::jdk(8), JDK_Version::jdk(9) },
 #ifdef PRODUCT
   { "DesiredMethodLimit",
                            JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
@@ -1169,7 +1170,6 @@
     set_parnew_gc_flags();
   }
 
-  // MaxHeapSize is aligned down in collectorPolicy
   size_t max_heap = align_size_down(MaxHeapSize,
                                     CardTableRS::ct_max_alignment_constraint());
 
@@ -1207,10 +1207,6 @@
     }
 
     // Code along this path potentially sets NewSize and OldSize
-
-    assert(max_heap >= InitialHeapSize, "Error");
-    assert(max_heap >= NewSize, "Error");
-
     if (PrintGCDetails && Verbose) {
       // Too early to use gclog_or_tty
       tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT
--- a/hotspot/src/share/vm/runtime/globals.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -679,9 +679,6 @@
   product(bool, UseCompilerSafepoints, true,                                \
           "Stop at safepoints in compiled code")                            \
                                                                             \
-  product(bool, UseSplitVerifier, true,                                     \
-          "use split verifier with StackMapTable attributes")               \
-                                                                            \
   product(bool, FailOverToOldVerifier, true,                                \
           "fail over to old verifier when split verifier fails")            \
                                                                             \
@@ -869,6 +866,11 @@
   diagnostic(bool, PrintNMTStatistics, false,                               \
           "Print native memory tracking summary data if it is on")          \
                                                                             \
+  diagnostic(bool, AutoShutdownNMT, true,                                   \
+          "Automatically shutdown native memory tracking under stress "     \
+          "situation. When set to false, native memory tracking tries to "  \
+          "stay alive at the expense of JVM performance")                   \
+                                                                            \
   diagnostic(bool, LogCompilation, false,                                   \
           "Log compilation activity in detail to hotspot.log or LogFile")   \
                                                                             \
@@ -2905,6 +2907,10 @@
           "if non-zero, start verifying C heap after Nth call to "          \
           "malloc/realloc/free")                                            \
                                                                             \
+  diagnostic(uintx, MallocMaxTestWords,     0,                              \
+          "if non-zero, max # of Words that malloc/realloc can allocate "   \
+          "(for testing only)")                                             \
+                                                                            \
   product(intx, TypeProfileWidth,     2,                                    \
           "number of receiver types to record in call/cast profile")        \
                                                                             \
@@ -3569,8 +3575,9 @@
   product(uintx, SharedMiscCodeSize,    120*K,                              \
           "Size of the shared miscellaneous code area (in bytes)")          \
                                                                             \
-  product(uintx, SharedDummyBlockSize, 0,                                   \
-          "Size of dummy block used to shift heap addresses (in bytes)")    \
+  product(uintx, SharedBaseAddress, LP64_ONLY(32*G)                         \
+          NOT_LP64(LINUX_ONLY(2*G) NOT_LINUX(0)),                           \
+          "Address to allocate shared memory region for class data")        \
                                                                             \
   diagnostic(bool, EnableInvokeDynamic, true,                               \
           "support JSR 292 (method handles, invokedynamic, "                \
--- a/hotspot/src/share/vm/runtime/os.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/runtime/os.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -80,6 +80,8 @@
 julong os::free_bytes = 0;          // # of bytes freed
 #endif
 
+static juint cur_malloc_words = 0;  // current size for MallocMaxTestWords
+
 void os_init_globals() {
   // Called from init_globals().
   // See Threads::create_vm() in thread.cpp, and init.cpp.
@@ -570,6 +572,26 @@
 }
 #endif
 
+//
+// This function supports testing of the malloc out of memory
+// condition without really running the system out of memory.
+//
+static u_char* testMalloc(size_t alloc_size) {
+  assert(MallocMaxTestWords > 0, "sanity check");
+
+  if ((cur_malloc_words + (alloc_size / BytesPerWord)) > MallocMaxTestWords) {
+    return NULL;
+  }
+
+  u_char* ptr = (u_char*)::malloc(alloc_size);
+
+  if (ptr != NULL) {
+    Atomic::add(((jint) (alloc_size / BytesPerWord)),
+                (volatile jint *) &cur_malloc_words);
+  }
+  return ptr;
+}
+
 void* os::malloc(size_t size, MEMFLAGS memflags, address caller) {
   NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
   NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));
@@ -579,11 +601,22 @@
     // if NULL is returned the calling functions assume out of memory.
     size = 1;
   }
-  if (size > size + space_before + space_after) { // Check for rollover.
+
+  const size_t alloc_size = size + space_before + space_after;
+
+  if (size > alloc_size) { // Check for rollover.
     return NULL;
   }
+
   NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
-  u_char* ptr = (u_char*)::malloc(size + space_before + space_after);
+
+  u_char* ptr;
+
+  if (MallocMaxTestWords > 0) {
+    ptr = testMalloc(alloc_size);
+  } else {
+    ptr = (u_char*)::malloc(alloc_size);
+  }
 
 #ifdef ASSERT
   if (ptr == NULL) return NULL;
--- a/hotspot/src/share/vm/services/memTracker.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/services/memTracker.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -68,6 +68,7 @@
 volatile jint                   MemTracker::_pooled_recorder_count = 0;
 volatile unsigned long          MemTracker::_processing_generation = 0;
 volatile bool                   MemTracker::_worker_thread_idle = false;
+volatile bool                   MemTracker::_slowdown_calling_thread = false;
 debug_only(intx                 MemTracker::_main_thread_tid = 0;)
 NOT_PRODUCT(volatile jint       MemTracker::_pending_recorder_count = 0;)
 
@@ -364,6 +365,12 @@
     }
 
     if (thread != NULL) {
+      // slow down all calling threads except NMT worker thread, so it
+      // can catch up.
+      if (_slowdown_calling_thread && thread != _worker_thread) {
+        os::yield_all();
+      }
+
       if (thread->is_Java_thread() && ((JavaThread*)thread)->is_safepoint_visible()) {
         JavaThread*      java_thread = (JavaThread*)thread;
         JavaThreadState  state = java_thread->thread_state();
@@ -442,6 +449,7 @@
 #define MAX_SAFEPOINTS_TO_SKIP     128
 #define SAFE_SEQUENCE_THRESHOLD    30
 #define HIGH_GENERATION_THRESHOLD  60
+#define MAX_RECORDER_THREAD_RATIO  30
 
 void MemTracker::sync() {
   assert(_tracking_level > NMT_off, "NMT is not enabled");
@@ -487,6 +495,13 @@
         pending_recorders = _global_recorder;
         _global_recorder = NULL;
       }
+
+      // see if NMT has too many outstanding recorder instances, it usually
+      // means that worker thread is lagging behind in processing them.
+      if (!AutoShutdownNMT) {
+        _slowdown_calling_thread = (MemRecorder::_instance_count > MAX_RECORDER_THREAD_RATIO * _thread_count);
+      }
+
       // check _worker_thread with lock to avoid racing condition
       if (_worker_thread != NULL) {
         _worker_thread->at_sync_point(pending_recorders, InstanceKlass::number_of_instance_classes());
--- a/hotspot/src/share/vm/services/memTracker.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/services/memTracker.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -84,6 +84,7 @@
    static inline bool baseline() { return false; }
    static inline bool has_baseline() { return false; }
 
+   static inline void set_autoShutdown(bool value) { }
    static void shutdown(ShutdownReason reason) { }
    static inline bool shutdown_in_progress() {  }
    static bool print_memory_usage(BaselineOutputer& out, size_t unit,
@@ -238,6 +239,16 @@
   // if native memory tracking tracks callsite
   static inline bool track_callsite() { return _tracking_level == NMT_detail; }
 
+  // NMT automatically shuts itself down under extreme situation by default.
+  // When the value is set to false,  NMT will try its best to stay alive,
+  // even it has to slow down VM.
+  static inline void set_autoShutdown(bool value) {
+    AutoShutdownNMT = value;
+    if (AutoShutdownNMT && _slowdown_calling_thread) {
+      _slowdown_calling_thread = false;
+    }
+  }
+
   // shutdown native memory tracking capability. Native memory tracking
   // can be shutdown by VM when it encounters low memory scenarios.
   // Memory tracker should gracefully shutdown itself, and preserve the
@@ -507,6 +518,10 @@
   // although NMT is still procesing current generation, but
   // there is not more recorder to process, set idle state
   static volatile bool             _worker_thread_idle;
+
+  // if NMT should slow down calling thread to allow
+  // worker thread to catch up
+  static volatile bool             _slowdown_calling_thread;
 };
 
 #endif // !INCLUDE_NMT
--- a/hotspot/src/share/vm/services/nmtDCmd.cpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/services/nmtDCmd.cpp	Fri Apr 05 14:51:24 2013 -0700
@@ -49,6 +49,9 @@
   _shutdown("shutdown", "request runtime to shutdown itself and free the " \
             "memory used by runtime.",
             "BOOLEAN", false, "false"),
+  _auto_shutdown("autoShutdown", "automatically shutdown itself under "    \
+            "stress situation",
+            "BOOLEAN", true, "true"),
 #ifndef PRODUCT
   _debug("debug", "print tracker statistics. Debug only, not thread safe", \
             "BOOLEAN", false, "false"),
@@ -61,6 +64,7 @@
   _dcmdparser.add_dcmd_option(&_summary_diff);
   _dcmdparser.add_dcmd_option(&_detail_diff);
   _dcmdparser.add_dcmd_option(&_shutdown);
+  _dcmdparser.add_dcmd_option(&_auto_shutdown);
 #ifndef PRODUCT
   _dcmdparser.add_dcmd_option(&_debug);
 #endif
@@ -84,17 +88,19 @@
   }
 
   int nopt = 0;
-  if(_summary.is_set() && _summary.value()) { ++nopt; }
-  if(_detail.is_set() && _detail.value()) { ++nopt; }
-  if(_baseline.is_set() && _baseline.value()) { ++nopt; }
-  if(_summary_diff.is_set() && _summary_diff.value()) { ++nopt; }
-  if(_detail_diff.is_set() && _detail_diff.value()) { ++nopt; }
-  if(_shutdown.is_set() && _shutdown.value()) { ++nopt; }
+  if (_summary.is_set() && _summary.value()) { ++nopt; }
+  if (_detail.is_set() && _detail.value()) { ++nopt; }
+  if (_baseline.is_set() && _baseline.value()) { ++nopt; }
+  if (_summary_diff.is_set() && _summary_diff.value()) { ++nopt; }
+  if (_detail_diff.is_set() && _detail_diff.value()) { ++nopt; }
+  if (_shutdown.is_set() && _shutdown.value()) { ++nopt; }
+  if (_auto_shutdown.is_set()) { ++nopt; }
+
 #ifndef PRODUCT
-  if(_debug.is_set() && _debug.value()) { ++nopt; }
+  if (_debug.is_set() && _debug.value()) { ++nopt; }
 #endif
 
-  if(nopt > 1) {
+  if (nopt > 1) {
       output()->print_cr("At most one of the following option can be specified: " \
         "summary, detail, baseline, summary.diff, detail.diff, shutdown"
 #ifndef PRODUCT
@@ -156,6 +162,8 @@
     MemTracker::shutdown(MemTracker::NMT_shutdown_user);
     output()->print_cr("Shutdown is in progress, it will take a few moments to " \
       "completely shutdown");
+  } else if (_auto_shutdown.is_set()) {
+    MemTracker::set_autoShutdown(_auto_shutdown.value());
   } else {
     ShouldNotReachHere();
     output()->print_cr("Unknown command");
--- a/hotspot/src/share/vm/services/nmtDCmd.hpp	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/src/share/vm/services/nmtDCmd.hpp	Fri Apr 05 14:51:24 2013 -0700
@@ -39,6 +39,7 @@
   DCmdArgument<bool>  _summary_diff;
   DCmdArgument<bool>  _detail_diff;
   DCmdArgument<bool>  _shutdown;
+  DCmdArgument<bool>  _auto_shutdown;
 #ifndef PRODUCT
   DCmdArgument<bool>  _debug;
 #endif
--- a/hotspot/test/compiler/5091921/Test6890943.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/compiler/5091921/Test6890943.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -22,26 +22,16 @@
 # questions.
 # 
 # 
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
 echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
+
 
 set -x
 
@@ -50,7 +40,7 @@
 cp ${TESTSRC}/output6890943.txt .
 cp ${TESTSRC}/Test6890943.sh .
 
-${TESTJAVA}/bin/javac -d . Test6890943.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6890943.java
 
 ${TESTJAVA}/bin/java -XX:-PrintVMOptions -XX:+IgnoreUnrecognizedVMOptions ${TESTVMOPTS} Test6890943 < input6890943.txt > pretest.out 2>&1
 
--- a/hotspot/test/compiler/5091921/Test7005594.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/compiler/5091921/Test7005594.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -22,26 +22,15 @@
 # questions.
 # 
 # 
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
 echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 # Amount of physical memory in megabytes
 MEM=0
@@ -87,7 +76,7 @@
 cp ${TESTSRC}/Test7005594.java .
 cp ${TESTSRC}/Test7005594.sh .
 
-${TESTJAVA}/bin/javac -d . Test7005594.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1
 
--- a/hotspot/test/compiler/6857159/Test6857159.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/compiler/6857159/Test6857159.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -22,33 +22,22 @@
 # questions.
 # 
 # 
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
 echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 set -x
 
 cp ${TESTSRC}/Test6857159.java .
 cp ${TESTSRC}/Test6857159.sh .
 
-${TESTJAVA}/bin/javac -d . Test6857159.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6857159.java
 
 ${TESTJAVA}/bin/java  ${TESTVMOPTS} -Xbatch -XX:+PrintCompilation -XX:CompileOnly=Test6857159\$ct.run Test6857159 > test.out 2>&1
 
--- a/hotspot/test/compiler/7068051/Test7068051.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/compiler/7068051/Test7068051.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -22,28 +22,24 @@
 # questions.
 # 
 # 
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
 echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 set -x
 
-${TESTJAVA}/bin/jar xf ${TESTJAVA}/jre/lib/javaws.jar
-${TESTJAVA}/bin/jar cf foo.jar *
+${COMPILEJAVA}/bin/jar xf ${COMPILEJAVA}/jre/lib/javaws.jar
+${COMPILEJAVA}/bin/jar cf foo.jar *
 cp ${TESTSRC}/Test7068051.java ./
-${TESTJAVA}/bin/jar -uf0 foo.jar Test7068051.java
+${COMPILEJAVA}/bin/jar -uf0 foo.jar Test7068051.java
 
-${TESTJAVA}/bin/javac -d . Test7068051.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7068051.java
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} -showversion -Xbatch Test7068051 foo.jar
 
--- a/hotspot/test/compiler/7070134/Test7070134.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/compiler/7070134/Test7070134.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -22,33 +22,22 @@
 # questions.
 # 
 # 
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
 echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 set -x
 
 cp ${TESTSRC}/Stemmer.java .
 cp ${TESTSRC}/words .
 
-${TESTJAVA}/bin/javac -d . Stemmer.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Stemmer.java
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbatch Stemmer words > test.out 2>&1
 
--- a/hotspot/test/compiler/7200264/Test7200264.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/compiler/7200264/Test7200264.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -23,50 +23,15 @@
 # 
 # 
 
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
 echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin )
-    NULL=/dev/null
-    PS=":"
-    FS="/"
-    ;;
-  Windows_* )
-    NULL=NUL
-    PS=";"
-    FS="\\"
-    ;;
-  CYGWIN_* )
-    NULL=/dev/null
-    PS=";"
-    FS="/"
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
-
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion | sed 's/amd64/x86/' | grep "x86" | grep "Server VM" | grep "debug"
 
@@ -88,7 +53,7 @@
 fi
 
 cp ${TESTSRC}${FS}TestIntVect.java .
-${TESTJAVA}${FS}bin${FS}javac -d . TestIntVect.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} -d . TestIntVect.java
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1
 
--- a/hotspot/test/gc/6941923/test6941923.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/gc/6941923/test6941923.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -5,38 +5,25 @@
 ## @author yqi 
 ## @run shell test6941923.sh
 ##
+## some tests require path to find test source dir
+if [ "${TESTSRC}" = "" ]
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
+fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 ## skip on windows
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux | Darwin )
-    NULL=/dev/null
-    PS=":"
-    FS="/"
-    ;;
   Windows_* | CYGWIN_* )
     echo "Test skipped for Windows"
     exit 0 
     ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
 esac
 
-if [ "${JAVA_HOME}" = "" ]
-then
-  echo "JAVA_HOME not set"
-  exit 0
-fi
-
-$JAVA_HOME/bin/java ${TESTVMOPTS} -version > $NULL 2>&1
-
-if [ $? != 0 ]; then
-  echo "Wrong JAVA_HOME? JAVA_HOME: $JAVA_HOME"
-  exit $?
-fi
-
 # create a small test case
 testname="Test"
 if [ -e ${testname}.java ]; then
@@ -96,10 +83,10 @@
 msgfail="failed"
 gclogsize="16K"
 filesize=$((16*1024))
-$JAVA_HOME/bin/javac ${testname}.java > $NULL 2>&1
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${testname}.java > $NULL 2>&1
 
 if [ $? != 0 ]; then
-  echo "$JAVA_HOME/bin/javac ${testname}.java $fail"
+  echo "${COMPILEJAVA}/bin/javac ${testname}.java $fail"
   exit -1
 fi
 
@@ -119,7 +106,7 @@
 
 options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation  -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=$gclogsize"
 echo "Test gc log rotation in same file, wait for $tts minutes ...."
-$JAVA_HOME/bin/java ${TESTVMOPTS} $options $testname $tts
+${TESTJAVA}/bin/java $options $testname $tts
 if [ $? != 0 ]; then
   echo "$msgfail"
   exit -1
@@ -148,7 +135,7 @@
 numoffiles=3
 options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation  -XX:NumberOfGCLogFiles=$numoffiles -XX:GCLogFileSize=$gclogsize"
 echo "Test gc log rotation in $numoffiles files, wait for $tts minutes ...."
-$JAVA_HOME/bin/java ${TESTVMOPTS} $options $testname $tts
+${TESTJAVA}/bin/java $options $testname $tts
 if [ $? != 0 ]; then
   echo "$msgfail"
   exit -1
--- a/hotspot/test/runtime/6626217/Test6626217.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/6626217/Test6626217.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -27,78 +27,29 @@
 # @summary Loader-constraint table allows arrays instead of only the base-classes
 # @run shell Test6626217.sh
 #
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
-  then TESTSRC=.
-fi
-
-if [ "${TESTJAVA}" = "" ]
 then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-  echo "If this is incorrect, try setting the variable manually."
-fi
-
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin )
-    NULL=/dev/null
-    PS=":"
-    FS="/"
-    RM=/bin/rm
-    CP=/bin/cp
-    MV=/bin/mv
-    ;;
-  Windows_* )
-    NULL=NUL
-    PS=";"
-    FS="\\"
-    RM=rm
-    CP=cp
-    MV=mv
-    ;;
-  CYGWIN_* )
-    NULL=/dev/null
-    PS=";"
-    FS="/"
-    RM=rm
-    CP=cp
-    MV=mv
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
-
-JEMMYPATH=${CPAPPEND}
-CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
-
-THIS_DIR=`pwd`
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 JAVA=${TESTJAVA}${FS}bin${FS}java
-JAVAC=${TESTJAVA}${FS}bin${FS}javac
-
-${JAVA} ${TESTVMOPTS} -version
+JAVAC=${COMPILEJAVA}${FS}bin${FS}javac
 
 # Current directory is scratch directory, copy all the test source there
 # (for the subsequent moves to work).
-${CP} ${TESTSRC}${FS}*  ${THIS_DIR}
+${CP} ${TESTSRC}${FS}* ${THIS_DIR}
 
 # A Clean Compile: this line will probably fail within jtreg as have a clean dir:
 ${RM} -f *.class *.impl many_loader.java
 
 # Compile all the usual suspects, including the default 'many_loader'
 ${CP} many_loader1.java.foo many_loader.java
-${JAVAC} -source 1.4 -target 1.4 -Xlint *.java
+${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
 
 # Rename the class files, so the custom loader (and not the system loader) will find it
 ${MV} from_loader2.class from_loader2.impl2
@@ -106,7 +57,7 @@
 # Compile the next version of 'many_loader'
 ${MV} many_loader.class many_loader.impl1
 ${CP} many_loader2.java.foo many_loader.java
-${JAVAC} -source 1.4 -target 1.4 -Xlint many_loader.java
+${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
 
 # Rename the class file, so the custom loader (and not the system loader) will find it
 ${MV} many_loader.class many_loader.impl2
--- a/hotspot/test/runtime/6878713/Test6878713.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/6878713/Test6878713.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -1,71 +1,137 @@
 #!/bin/sh
 
+# 
+#  Copyright (c) 2011, 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.
+# 
+
+ 
+
 ##
 ## @test
 ## @bug 6878713
+## @bug 7030610
+## @bug 7037122
+## @bug 7123945
 ## @summary Verifier heap corruption, relating to backward jsrs
-## @run shell/timeout=120 Test6878713.sh
+## @run shell Test6878713.sh
 ##
-
+## some tests require path to find test source dir
 if [ "${TESTSRC}" = "" ]
-then TESTSRC=.
-fi
-
-if [ "${TESTJAVA}" = "" ]
 then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-  echo "If this is incorrect, try setting the variable manually."
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
+TARGET_CLASS=OOMCrashClass1960_2
+
+echo "INFO: extracting the target class."
+${COMPILEJAVA}${FS}bin${FS}jar xvf \
+    ${TESTSRC}${FS}testcase.jar ${TARGET_CLASS}.class
+
+# remove any hs_err_pid that might exist here
+rm -f hs_err_pid*.log
+
+echo "INFO: checking for 32-bit versus 64-bit VM."
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version 2>&1 \
+    | grep "64-Bit [^ ][^ ]* VM" > /dev/null 2>&1
+status="$?"
+if [ "$status" = 0 ]; then
+    echo "INFO: testing a 64-bit VM."
+    is_64_bit=true
+else
+    echo "INFO: testing a 32-bit VM."
 fi
 
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin )
-    NULL=/dev/null
-    PS=":"
-    FS="/"
-    ;;
-  Windows_* )
-    NULL=NUL
-    PS=";"
-    FS="\\"
-    ;;
-  CYGWIN_* )
-    NULL=/dev/null
-    PS=";"
-    FS="/"
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
+if [ "$is_64_bit" = true ]; then
+    # limit is 768MB in 8-byte words (1024 * 1024 * 768 / 8) == 100663296
+    MALLOC_MAX=100663296
+else
+    # limit is 768MB in 4-byte words (1024 * 1024 * 768 / 4) == 201326592
+    MALLOC_MAX=201326592
+fi
+echo "INFO: MALLOC_MAX=$MALLOC_MAX"
+
+echo "INFO: executing the target class."
+# -XX:+PrintCommandLineFlags for debugging purposes
+# -XX:+IgnoreUnrecognizedVMOptions so test will run on a VM without
+#     the new -XX:MallocMaxTestWords option
+# -XX:+UnlockDiagnosticVMOptions so we can use -XX:MallocMaxTestWords
+# -XX:MallocMaxTestWords limits malloc to $MALLOC_MAX
+${TESTJAVA}${FS}bin${FS}java \
+    -XX:+PrintCommandLineFlags \
+    -XX:+IgnoreUnrecognizedVMOptions \
+    -XX:+UnlockDiagnosticVMOptions \
+    -XX:MallocMaxTestWords=$MALLOC_MAX \
+    ${TESTVMOPTS} ${TARGET_CLASS} > test.out 2>&1
+
+echo "INFO: begin contents of test.out:"
+cat test.out
+echo "INFO: end contents of test.out."
 
-JEMMYPATH=${CPAPPEND}
-CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
-
-THIS_DIR=`pwd`
-
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version
-
-${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
+echo "INFO: checking for memory allocation error message."
+# We are looking for this specific memory allocation failure mesg so
+# we know we exercised the right allocation path with the test class:
+MESG1="Native memory allocation (malloc) failed to allocate 25696531[0-9][0-9] bytes"
+grep "$MESG1" test.out
+status="$?"
+if [ "$status" = 0 ]; then
+    echo "INFO: found expected memory allocation error message."
+else
+    echo "INFO: did not find expected memory allocation error message."
 
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass1960_2 > test.out 2>&1
+    # If we didn't find MESG1 above, then there are several scenarios:
+    # 1) -XX:MallocMaxTestWords is not supported by the current VM and we
+    #    didn't fail TARGET_CLASS's memory allocation attempt; instead
+    #    we failed to find TARGET_CLASS's main() method. The TARGET_CLASS
+    #    is designed to provoke a memory allocation failure during class
+    #    loading; we actually don't care about running the class which is
+    #    why it doesn't have a main() method.
+    # 2) we failed a memory allocation, but not the one we were looking
+    #    so it might be that TARGET_CLASS no longer tickles the same
+    #    memory allocation code path
+    # 3) TARGET_CLASS reproduces the failure mode (SIGSEGV) fixed by
+    #    6878713 because the test is running on a pre-fix VM.
+    echo "INFO: checking for no main() method message."
+    MESG2="Error: Main method not found in class"
+    grep "$MESG2" test.out
+    status="$?"
+    if [ "$status" = 0 ]; then
+        echo "INFO: found no main() method message."
+    else
+        echo "FAIL: did not find no main() method message."
+        # status is non-zero for exit below
 
-if [ -s core -o -s "hs_*.log" ]
-then
-    cat hs*.log
-    echo "Test Failed"
-    exit 1
-else
-    echo "Test Passed"
-    exit 0
+        if [ -s hs_err_pid*.log ]; then
+            echo "INFO: begin contents of hs_err_pid file:"
+            cat hs_err_pid*.log
+            echo "INFO: end contents of hs_err_pid file."
+        fi
+    fi
 fi
+
+if [ "$status" = 0 ]; then
+    echo "PASS: test found one of the expected messages."
+fi
+exit "$status"
--- a/hotspot/test/runtime/6929067/Test6929067.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/6929067/Test6929067.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -7,18 +7,15 @@
 ## @compile T.java
 ## @run shell Test6929067.sh
 ##
-
+set -x
 if [ "${TESTSRC}" = "" ]
-then TESTSRC=.
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-if [ "${TESTJAVA}" = "" ]
-then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-  echo "If this is incorrect, try setting the variable manually."
-fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 # set platform-dependent variables
 OS=`uname -s`
@@ -107,7 +104,7 @@
 fi
 
 
-LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 
 cp ${TESTSRC}${FS}invoke.c .
@@ -115,15 +112,16 @@
 # Copy the result of our @compile action:
 cp ${TESTCLASSES}${FS}T.class .
 
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion
-
 echo "Architecture: ${ARCH}"
 echo "Compilation flag: ${COMP_FLAG}"
 echo "VM type: ${VMTYPE}"
+# Note pthread may not be found thus invoke creation will fail to be created.
+# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
+# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
 
 gcc -DLINUX ${COMP_FLAG} -o invoke \
-  -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
-  -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \
+  -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
+  -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \
   -ljvm -lpthread invoke.c
 
 ./invoke
--- a/hotspot/test/runtime/7020373/Test7020373.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/7020373/Test7020373.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -10,55 +10,15 @@
 ##
 
 if [ "${TESTSRC}" = "" ]
-then TESTSRC=.
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-if [ "${TESTJAVA}" = "" ]
-then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-  echo "If this is incorrect, try setting the variable manually."
-fi
-
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin )
-    NULL=/dev/null
-    PS=":"
-    FS="/"
-    ;;
-  Windows_* )
-    NULL=NUL
-    PS=";"
-    FS="\\"
-    ;;
-  CYGWIN_* )
-    NULL=/dev/null
-    PS=";"
-    FS="/"
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
-
-JEMMYPATH=${CPAPPEND}
-CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
-
-THIS_DIR=`pwd`
-
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version
-
-${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
+${COMPILEJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass4000_1 > test.out 2>&1
 
--- a/hotspot/test/runtime/7051189/Xchecksig.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/7051189/Xchecksig.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -29,34 +29,22 @@
 #
 
 if [ "${TESTSRC}" = "" ]
-  then TESTSRC=.
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-if [ "${TESTJAVA}" = "" ]
-then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  printf "TESTJAVA not set, selecting " ${TESTJAVA}
-  printf "  If this is incorrect, try setting the variable manually.\n"
-fi
-
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux | Darwin )
-    FS="/"
-    ;;
   Windows_* | CYGWIN_* )
     printf "Not testing libjsig.so on Windows. PASSED.\n "
     exit 0
     ;;
-  * )
-    printf "Not testing libjsig.so on unrecognised system. PASSED.\n "
-    exit 0
-    ;;
 esac
 
-
 JAVA=${TESTJAVA}${FS}bin${FS}java
 
 # LD_PRELOAD arch needs to match the binary we run, so run the java
@@ -97,7 +85,7 @@
   ;; 
 esac
 
-LIBJSIG=${TESTJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so
+LIBJSIG=${COMPILEJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so
 
 # If libjsig and binary do not match, skip test.
 
--- a/hotspot/test/runtime/7107135/Test7107135.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/7107135/Test7107135.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -32,26 +32,19 @@
 ##
 
 if [ "${TESTSRC}" = "" ]
-then TESTSRC=.
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-if [ "${TESTJAVA}" = "" ]
-then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-  echo "If this is incorrect, try setting the variable manually."
-fi
-
-BIT_FLAG=""
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
   Linux)
-    NULL=/dev/null
-    PS=":"
-    FS="/"
+    echo "Testing on Linux"
     ;;
   *)
     NULL=NUL
@@ -64,7 +57,7 @@
 
 ARCH=`uname -m`
 
-THIS_DIR=`pwd`
+THIS_DIR=.
 
 cp ${TESTSRC}${FS}*.java ${THIS_DIR}
 ${TESTJAVA}${FS}bin${FS}javac *.java
--- a/hotspot/test/runtime/7110720/Test7110720.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/7110720/Test7110720.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -12,22 +12,13 @@
 #
 
 if [ "${TESTSRC}" = "" ]
-  then TESTSRC=.
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-if [ "${TESTJAVA}" = "" ]
-then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-  echo "If this is incorrect, try setting the variable manually."
-fi
-
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 # Jtreg sets TESTVMOPTS which may include -d64 which is
 # required to test a 64-bit JVM on some platforms.
--- a/hotspot/test/runtime/7158804/Test7158804.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/7158804/Test7158804.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -10,13 +10,14 @@
 ## @summary Improve config file parsing
 ## @run shell Test7158804.sh
 ##
-
-if [ "${TESTJAVA}" = "" ]
+if [ "${TESTSRC}" = "" ]
 then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-echo "TESTJAVA=${TESTJAVA}"
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 rm -f .hotspotrc
 echo -XX:+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >.hotspotrc
--- a/hotspot/test/runtime/7162488/Test7162488.sh	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/7162488/Test7162488.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -29,27 +29,13 @@
 #
 
 if [ "${TESTSRC}" = "" ]
-  then TESTSRC=.
-fi
-
-if [ "${TESTJAVA}" = "" ]
 then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  printf "TESTJAVA not set, selecting " ${TESTJAVA}
-  printf "  If this is incorrect, try setting the variable manually.\n"
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
 fi
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Windows_* )
-    FS="\\"
-    ;;
-  * )
-    FS="/"
-    ;;
-esac
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
 
 JAVA=${TESTJAVA}${FS}bin${FS}java
 
--- a/hotspot/test/runtime/8007736/TestStaticIF.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- */
-
-/*
- * @test
- * @bug 8007736
- * @summary Test static interface method.
- * @run main/othervm -Xverify:all TestStaticIF
- */
-
-public class TestStaticIF implements StaticMethodInInterface {
-
-    public static void main(String[] args) {
-        System.out.printf("main: %s%n", StaticMethodInInterface.get());
-    }
-}
-
-interface StaticMethodInInterface {
-
-    public static String get() {
-        return "Hello from StaticMethodInInterface.get()";
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/8010389/VMThreadDlopen.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.io.File;
+
+/*
+ * @test
+ * @key regression
+ * @bug 8010389
+ * @run main/othervm -Djava.library.path=. VMThreadDlopen
+ */
+
+public class VMThreadDlopen {
+    public static void main(String[] args) throws Exception {
+        File file = new File("libbroken.so");
+        file.createNewFile();
+        try {
+            System.loadLibrary("broken");
+        } catch (UnsatisfiedLinkError e) {
+            e.printStackTrace();
+            // expected
+        }
+    }
+}
--- a/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java	Fri Apr 05 14:51:24 2013 -0700
@@ -33,17 +33,17 @@
 public class BooleanFlagWithInvalidValue {
   public static void main(String[] args) throws Exception {
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-        "-XX:+UseLargePages=8", "-version");
+        "-XX:+PrintWarnings=8", "-version");
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Improperly specified VM option 'UseLargePages=8'");
+    output.shouldContain("Improperly specified VM option 'PrintWarnings=8'");
     output.shouldHaveExitValue(1);
 
     pb = ProcessTools.createJavaProcessBuilder(
-        "-XX:-UseLargePages=8", "-version");
+        "-XX:-PrintWarnings=8", "-version");
 
     output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Improperly specified VM option 'UseLargePages=8'");
+    output.shouldContain("Improperly specified VM option 'PrintWarnings=8'");
     output.shouldHaveExitValue(1);
   }
 }
--- a/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java	Fri Apr 05 14:51:24 2013 -0700
@@ -33,10 +33,10 @@
 public class FlagWithInvalidValue {
   public static void main(String[] args) throws Exception {
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-        "-XX:ObjectAlignmentInBytes=v", "-version");
+        "-XX:MaxRAMFraction=v", "-version");
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Improperly specified VM option 'ObjectAlignmentInBytes=v'");
+    output.shouldContain("Improperly specified VM option 'MaxRAMFraction=v'");
     output.shouldHaveExitValue(1);
   }
 }
--- a/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java	Fri Apr 05 14:51:24 2013 -0700
@@ -33,17 +33,17 @@
 public class NonBooleanFlagWithInvalidBooleanPrefix {
   public static void main(String[] args) throws Exception {
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-        "-XX:-ObjectAlignmentInBytes=16", "-version");
+        "-XX:-MaxRAMFraction=16", "-version");
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Unexpected +/- setting in VM option 'ObjectAlignmentInBytes=16'");
+    output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'");
     output.shouldHaveExitValue(1);
 
     pb = ProcessTools.createJavaProcessBuilder(
-        "-XX:+ObjectAlignmentInBytes=16", "-version");
+        "-XX:+MaxRAMFraction=16", "-version");
 
     output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Unexpected +/- setting in VM option 'ObjectAlignmentInBytes=16'");
+    output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'");
     output.shouldHaveExitValue(1);
 
   }
--- a/hotspot/test/runtime/NMT/BaselineWithParameter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/NMT/BaselineWithParameter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -43,7 +43,7 @@
 
     // Run 'jcmd <pid> VM.native_memory baseline=false'
     pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "baseline=false"});
-    pb.start();
+    pb.start().waitFor();
 
     // Run 'jcmd <pid> VM.native_memory summary=false'
     pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary=false"});
--- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java	Fri Apr 05 14:51:24 2013 -0700
@@ -27,7 +27,9 @@
  * @bug 8005936
  * @summary Make sure PrintNMTStatistics works on normal JVM exit
  * @library /testlibrary /testlibrary/whitebox
- * @run compile PrintNMTStatistics.java
+ * @build PrintNMTStatistics
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main PrintNMTStatistics
  */
 
 import com.oracle.java.testlibrary.*;
@@ -52,13 +54,15 @@
 
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
         "-XX:+UnlockDiagnosticVMOptions",
+        "-Xbootclasspath/a:.",
+        "-XX:+WhiteBoxAPI",
         "-XX:NativeMemoryTracking=summary",
-        "+XX:+PrintNMTStatistics",
+        "-XX:+PrintNMTStatistics",
         "PrintNMTStatistics",
         "test");
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Java Heap  (reserved=");
+    output.shouldContain("Java Heap (reserved=");
     output.shouldNotContain("error");
     output.shouldNotContain("warning");
     output.shouldHaveExitValue(0);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/test_env.sh	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,193 @@
+#!/bin/sh
+#
+#  Copyright (c) 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.
+# 
+
+#
+# This Environment script was written to capture typically used environment
+# setup for a given shell test. 
+#
+
+# TESTJAVA can be a JDK or JRE. If JRE you need to set COMPILEJAVA
+if [ "${TESTJAVA}" = "" ]
+then
+  echo "TESTJAVA not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+echo "TESTJAVA=${TESTJAVA}"
+
+# COMPILEJAVA requires a JDK, some shell test use javac,jar,etc 
+if [ "${COMPILEJAVA}" = "" ]
+then
+ echo "COMPILEJAVA not set.  Using TESTJAVA as default"
+ COMPILEJAVA=${TESTJAVA}
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASES not set.  Using "." as default"
+  TESTCLASSES=.
+fi
+echo "TESTCLASSES=${TESTCLASSES}"
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    NULL=/dev/null
+    PS=":"
+    FS="/"
+    RM=/bin/rm
+    CP=/bin/cp
+    MV=/bin/mv
+    ;;
+  Windows_* )
+    NULL=NUL
+    PS=";"
+    FS="\\"
+    RM=rm
+    CP=cp
+    MV=mv
+    ;;
+  CYGWIN_* )
+    NULL=/dev/null
+    PS=";"
+    FS="/"
+    RM=rm
+    CP=cp
+    MV=mv
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+export NULL PS FS RM CP MV
+echo "NULL =${NULL}"
+echo "PS =${PS}"
+echo "FS =${FS}"
+echo "RM =${RM}"
+echo "CP =${CP}"
+echo "MV =${MV}"
+
+# jtreg -classpathappend:<path>
+JEMMYPATH=${CPAPPEND}
+CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
+echo "CLASSPATH =${CLASSPATH}"
+
+# Current directory is scratch directory 
+THIS_DIR=.
+echo "THIS_DIR=${THIS_DIR}"
+
+# Check to ensure the java defined actually works
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version
+if [ $? != 0 ]; then
+  echo "Wrong TESTJAVA or TESTVMOPTS:"
+  echo $TESTJAVA TESTVMOPTS
+  exit 1
+fi
+
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1
+
+VM_TYPE="unknown"
+grep "Server" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_TYPE="server"
+fi
+grep "Client" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_TYPE="client"
+fi
+
+VM_BITS="32"
+grep "64-Bit" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_BITS="64"
+fi
+
+VM_OS="unknown"
+grep "solaris" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_OS="solaris"
+fi
+grep "linux" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_OS="linux"
+fi
+grep "windows" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_OS="windows"
+fi
+grep "bsd" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_OS="bsd"
+fi
+
+VM_CPU="unknown"
+grep "sparc" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="sparc"
+  if [ $VM_BITS = "64" ]
+  then
+    VM_CPU="sparcv9"
+  fi
+fi
+grep "x86" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="i386"
+fi
+grep "amd64" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="amd64"
+fi
+grep "arm" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="arm"
+fi
+grep "ppc" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="ppc"
+fi
+grep "ia64" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="ia64"
+fi
+export VM_TYPE VM_BITS VM_OS VM_CPU
+echo "VM_TYPE=${VM_TYPE}"
+echo "VM_BITS=${VM_BITS}"
+echo "VM_OS=${VM_OS}"
+echo "VM_CPU=${VM_CPU}"
--- a/jaxp/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/jaxp/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -204,3 +204,4 @@
 4873a0499bc3bd263b7dd3b551a2b4e275ab5a0b jdk8-b80
 ef3495555a4c6e706a3058c18aa229b14220de0b jdk8-b81
 d5a58291f09a5081eaf22c2a6ab2f9ced4b78882 jdk8-b82
+a46d69a1a8ec9652a48114823535372e1c980799 jdk8-b83
--- a/jaxws/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/jaxws/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -204,3 +204,4 @@
 b0224010e2f0c2474055ac592c8d3f37b9264690 jdk8-b80
 c88bb21560ccf1a9e6d2a2ba08ed2045a002676f jdk8-b81
 d8d8032d02d77fbf5f9b3bb8df73663f42fd4dd0 jdk8-b82
+a1dcc0d83da1e07f3ada60ef110dd105d95d3554 jdk8-b83
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,7 +31,9 @@
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
 import com.sun.xml.internal.bind.v2.runtime.Location;
 
+import java.lang.annotation.Annotation;
 import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.AnnotationMirror;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.ExecutableElement;
@@ -372,6 +374,21 @@
         public TypeKind getKind() {
             throw new IllegalStateException();
         }
+
+        @Override
+        public List<? extends AnnotationMirror> getAnnotationMirrors() {
+            throw new IllegalStateException();
+        }
+
+        @Override
+        public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+            throw new IllegalStateException();
+        }
+
+        @Override
+        public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {
+            throw new IllegalStateException();
+        }
     };
 
     public Location getClassLocation(TypeElement typeElement) {
--- a/jdk/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/jdk/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -205,3 +205,4 @@
 c0f8022eba536dcdc8aae659005b33f3982b9368 jdk8-b81
 624bcb4800065c6656171948e31ebb2925f25c7a jdk8-b82
 ac519af51769e92c51b597a730974e8607357709 jdk8-b83
+7b4721e4edb4e1c65e9c839a70d7cc67f81c7632 jdk8-b84
--- a/jdk/makefiles/CompileNativeLibraries.gmk	Fri Apr 05 12:12:34 2013 -0700
+++ b/jdk/makefiles/CompileNativeLibraries.gmk	Fri Apr 05 14:51:24 2013 -0700
@@ -2386,18 +2386,23 @@
 
 ifndef BUILD_HEADLESS_ONLY
 LIBSPLASHSCREEN_DIRS:=\
-	$(JDK_TOPDIR)/src/share/native/sun/awt/giflib \
 	$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
 	$(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
 	$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
 
+ifeq ($(USE_EXTERNAL_LIBGIF),true)
+    GIFLIB_LDFLAGS := -lgif
+else
+    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
+    GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
+endif
+
 ifneq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
 else
     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
 endif
 
-
 LIBSPLASHSCREEN_CFLAGS:=-DSPLASHSCREEN -DPNG_NO_MMX_CODE \
 	$(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir))
 
@@ -2449,11 +2454,11 @@
 		EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
 		LANG:=C,\
 		OPTIMIZATION:=LOW, \
-		CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB),\
+		CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS),\
 		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ),\
+		LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS),\
 		LDFLAGS_SUFFIX_solaris:=-lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
--- a/jdk/makefiles/Images.gmk	Fri Apr 05 12:12:34 2013 -0700
+++ b/jdk/makefiles/Images.gmk	Fri Apr 05 14:51:24 2013 -0700
@@ -649,7 +649,7 @@
         EXEC_LIST_BIN:=$(filter-out %$(notdir $(MSVCR_DLL)),$(filter %.exe %.dll,$(ALL_BIN_LIST)))
     else
         # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
-        EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \
+        EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \
 		| $(EGREP) 'ELF' | $(CUT) -d':' -f1)
         # On mac, the old build searches for static libraries for stripping instead of shared.
         # Not clear if it's intentional.
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	Fri Apr 05 12:12:34 2013 -0700
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	Fri Apr 05 14:51:24 2013 -0700
@@ -26,7 +26,7 @@
 #include "splashscreen_impl.h"
 #include "splashscreen_gfx.h"
 
-#include "../giflib/gif_lib.h"
+#include <gif_lib.h>
 
 #define GIF_TRANSPARENT     0x01
 #define GIF_USER_INPUT      0x02
--- a/langtools/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -204,3 +204,4 @@
 a8227c61768499dac847ea718af6719027c949f2 jdk8-b80
 ed69d087fdfd394491657a28ba9bc58e7849b7db jdk8-b81
 825da6847791994a8f405ee397df9e7fa638a458 jdk8-b82
+22ba3f92d4ae43bbc19793e854171cae2586f644 jdk8-b83
--- a/langtools/make/build.xml	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/make/build.xml	Fri Apr 05 14:51:24 2013 -0700
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 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
@@ -432,6 +432,31 @@
         </zip>
     </target>
 
+    <target name="doclint-api" depends="build-all-classes">
+        <delete dir="${build.dir}/doclint/classes"/>
+        <mkdir dir="${build.dir}/doclint/classes"/>
+        <javac fork="true"
+               executable="${boot.javac}"
+               srcdir="${src.classes.dir}:${build.gensrc.dir}"
+               destdir="${build.dir}/doclint/classes"
+               includes="javax/lang/model/** com/sun/javadoc/** com/sun/source/**"
+               excludes=""
+               sourcepath="${javac.sourcepath}"
+               classpath="${javac.classpath}"
+               includeAntRuntime="no"
+               source="${javac.source}"
+               target="${javac.target}"
+               debug="${javac.debug}"
+               debuglevel="${javac.debuglevel}">
+            <compilerarg value="-implicit:none"/>
+            <compilerarg value="-Xprefer:source"/>
+            <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
+            <compilerarg line="${javac.no.jdk.warnings}"/>
+            <compilerarg line="${javac.version.opt}"/>
+            <compilerarg line="-Xdoclint:all/protected,-missing"/>
+        </javac>
+    </target>
+
     <!--
     **** Debugging/diagnostic targets.
     -->
@@ -678,7 +703,7 @@
                     jarclasspath="sjavac.jar"/>
         <build-tool name="sjavac"/>
     </target>
-    
+
     <!-- (no javadoc for javap) -->
 
     <target name="jtreg-sjavac" depends="build-sjavac,-def-jtreg">
--- a/langtools/make/netbeans/langtools/nbproject/project.xml	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/make/netbeans/langtools/nbproject/project.xml	Fri Apr 05 14:51:24 2013 -0700
@@ -29,15 +29,13 @@
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
-
-<!DOCTYPE project [
-    <!ENTITY standard-ide-actions SYSTEM "standard-ide-actions.ent">
-    <!ENTITY standard-context-menu-items SYSTEM "standard-context-menu-items.ent">
-]>
 <project xmlns="http://www.netbeans.org/ns/project/1">
     <type>org.netbeans.modules.ant.freeform</type>
     <configuration>
         <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+            <name>langtools</name>
+        </general-data>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">
             <!-- Do not use Project Properties customizer when editing this file manually. -->
             <name>langtools</name>
             <properties>
@@ -49,11 +47,6 @@
                     <location>${root}</location>
                 </source-folder>
                 <source-folder>
-                    <label>Source files</label>
-                    <type>java</type>
-                    <location>${root}/src/share/classes</location>
-                </source-folder>
-                <source-folder>
                     <label>Test files</label>
                     <type>tests</type>
                     <location>${root}/test</location>
@@ -63,9 +56,169 @@
                     <type>build</type>
                     <location>${root}/make</location>
                 </source-folder>
+                <source-folder>
+                    <label>Source files</label>
+                    <type>java</type>
+                    <location>${root}/src/share/classes</location>
+                </source-folder>
+                <build-file>
+                    <location>${root}/build/classes</location>
+                </build-file>
             </folders>
             <ide-actions>
-                &standard-ide-actions;
+                <!--
+ Copyright (c) 2007, 2009, 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
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+                <!-- 
+ This file defines the standard actions accepted by langtools projects.
+ It is normally included as an entity into a project's project.xml file.
+
+ For information on these actions, see
+   - NetBeans: Setting Up Projects
+     at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
+   - NetBeans: Advanced Freeform Project Configuration
+     at http://www.netbeans.org/kb/41/freeform-config.html 
+-->
+                <action name="build">
+                    <target>build</target>
+                </action>
+                <action name="clean">
+                    <target>clean</target>
+                </action>
+                <action name="rebuild">
+                    <target>clean</target>
+                    <target>build</target>
+                </action>
+                <action name="compile.single">
+                    <target>compile-single</target>
+                    <property name="srcdir">${root}/src/share/classes</property>
+                    <context>
+                        <property>includes</property>
+                        <folder>${root}/src/share/classes</folder>
+                        <pattern>\.java$</pattern>
+                        <format>relative-path</format>
+                        <arity>
+                            <separated-files>,</separated-files>
+                        </arity>
+                    </context>
+                </action>
+                <action name="run">
+                    <target>run</target>
+                </action>
+                <action name="run.single">
+                    <target>run-single</target>
+                    <context>
+                        <property>run.classname</property>
+                        <folder>${root}/src/share/classes</folder>
+                        <pattern>\.java$</pattern>
+                        <format>java-name</format>
+                        <arity>
+                            <one-file-only/>
+                        </arity>
+                    </context>
+                </action>
+                <!-- 
+ Note: NetBeans does not appear to support context menu items
+ on shell scripts :-(
+-->
+                <action name="run.single">
+                    <target>jtreg</target>
+                    <context>
+                        <property>jtreg.tests</property>
+                        <folder>${root}/test</folder>
+                        <pattern>\.(java|sh)$</pattern>
+                        <format>relative-path</format>
+                        <arity>
+                            <separated-files>,</separated-files>
+                        </arity>
+                    </context>
+                </action>
+                <action name="test">
+                    <target>jtreg</target>
+                </action>
+                <action name="debug">
+                    <target>debug</target>
+                </action>
+                <action name="debug.single">
+                    <target>debug-single</target>
+                    <context>
+                        <property>debug.classname</property>
+                        <folder>${root}/src/share/classes</folder>
+                        <pattern>\.java$</pattern>
+                        <format>java-name</format>
+                        <arity>
+                            <one-file-only/>
+                        </arity>
+                    </context>
+                </action>
+                <!-- 
+ Note: NetBeans does not appear to support context menu items
+ on shell scripts :-(
+-->
+                <action name="debug.single">
+                    <target>debug-jtreg</target>
+                    <context>
+                        <property>jtreg.tests</property>
+                        <folder>${root}/test</folder>
+                        <pattern>\.(java|sh)$</pattern>
+                        <format>relative-path</format>
+                        <arity>
+                            <one-file-only/>
+                        </arity>
+                    </context>
+                </action>
+                <action name="debug.fix">
+                    <target>debug-fix</target>
+                    <property name="srcdir">${root}/src/share/classes</property>
+                    <context>
+                        <property>class</property>
+                        <folder>${root}/src/share/classes</folder>
+                        <pattern>\.java$</pattern>
+                        <format>relative-path-noext</format>
+                        <arity>
+                            <one-file-only/>
+                        </arity>
+                    </context>
+                </action>
+                <action name="javadoc">
+                    <target>javadoc</target>
+                </action>
+                <action name="select-tool">
+                    <target>select-tool</target>
+                </action>
+                <action name="test-select-tool-1">
+                    <target>test-select-tool-1</target>
+                </action>
+                <action name="test-select-tool-2">
+                    <target>test-select-tool-2</target>
+                </action>
             </ide-actions>
             <export>
                 <type>folder</type>
@@ -86,13 +239,68 @@
                         <label>Build files</label>
                         <location>${root}/make</location>
                     </source-folder>
+                    <source-folder style="packages">
+                        <label>Source files</label>
+                        <location>${root}/src/share/classes</location>
+                    </source-folder>
                     <source-file>
                         <label>README</label>
                         <location>README</location>
                     </source-file>
                 </items>
                 <context-menu>
-                    &standard-context-menu-items;
+                    <!--
+ Copyright (c) 2007, 2009, 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
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+                    <!-- 
+ This file defines the actions that will appear on the project's context
+ menu, in the Projects viewer.
+ It is normally included as an entity into a project's project.xml file.
+
+ For information on these actions, see
+   - NetBeans: Setting Up Projects
+     at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
+   - NetBeans: Advanced Freeform Project Configuration
+     at http://www.netbeans.org/kb/41/freeform-config.html 
+-->
+                    <ide-action name="select-tool"/>
+                    <separator/>
+                    <ide-action name="build"/>
+                    <ide-action name="rebuild"/>
+                    <ide-action name="clean"/>
+                    <ide-action name="javadoc"/>
+                    <separator/>
+                    <ide-action name="run"/>
+                    <ide-action name="debug"/>
+                    <separator/>
+                    <ide-action name="test"/>
                 </context-menu>
             </view>
             <subprojects/>
@@ -101,7 +309,7 @@
             <compilation-unit>
                 <package-root>${root}/src/share/classes</package-root>
                 <built-to>${root}/build/classes</built-to>
-                <source-level>1.5</source-level>  <!-- FIXME -->
+                <source-level>1.5</source-level>
             </compilation-unit>
         </java-data>
     </configuration>
--- a/langtools/src/share/classes/com/sun/source/util/DocTreeScanner.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/DocTreeScanner.java	Fri Apr 05 14:51:24 2013 -0700
@@ -53,7 +53,7 @@
  *
  * <p>Here is an example to count the number of erroneous nodes in a tree:
  * <pre>
- *   class CountErrors extends DocTreeScanner<Integer,Void> {
+ *   class CountErrors extends DocTreeScanner&lt;Integer,Void&gt; {
  *      {@literal @}Override
  *      public Integer visitErroneous(ErroneousTree node, Void p) {
  *          return 1;
--- a/langtools/src/share/classes/com/sun/source/util/JavacTask.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/JavacTask.java	Fri Apr 05 14:51:24 2013 -0700
@@ -56,7 +56,7 @@
      * If the compiler is being invoked using a
      * {@link javax.tools.JavaCompiler.CompilationTask CompilationTask},
      * then that task will be returned.
-     * @param processingEnvironment
+     * @param processingEnvironment the processing environment
      * @return the {@code JavacTask} for a {@code ProcessingEnvironment}
      * @since 1.8
      */
--- a/langtools/src/share/classes/com/sun/source/util/Plugin.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/Plugin.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,7 +38,7 @@
  *
  * <p>Plug-ins are located via a {@link ServiceLoader},
  * using the same class path as annotation processors (i.e.
- * {@link StandardLocation#PROCESSOR_PATH PROCESSOR_PATH} or
+ * {@link StandardLocation#ANNOTATION_PROCESSOR_PATH ANNOTATION_PROCESSOR_PATH} or
  * {@code -processorpath}).
  *
  * <p>It is expected that a typical plug-in will simply register a
--- a/langtools/src/share/classes/com/sun/tools/classfile/Code_attribute.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Code_attribute.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -38,7 +38,7 @@
  *  deletion without notice.</b>
  */
 public class Code_attribute extends Attribute {
-    public class InvalidIndex extends AttributeException {
+    public static class InvalidIndex extends AttributeException {
         private static final long serialVersionUID = -8904527774589382802L;
         InvalidIndex(int index) {
             this.index = index;
@@ -143,7 +143,7 @@
     public final Exception_data[] exception_table;
     public final Attributes attributes;
 
-    public class Exception_data {
+    public static class Exception_data {
         Exception_data(ClassReader cr) throws IOException {
             start_pc = cr.readUnsignedShort();
             end_pc = cr.readUnsignedShort();
--- a/langtools/src/share/classes/com/sun/tools/classfile/Descriptor.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Descriptor.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -37,7 +37,7 @@
  *  deletion without notice.</b>
  */
 public class Descriptor {
-    public class InvalidDescriptor extends DescriptorException {
+    public static class InvalidDescriptor extends DescriptorException {
         private static final long serialVersionUID = 1L;
         InvalidDescriptor(String desc) {
             this.desc = desc;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -135,13 +135,7 @@
     protected Content getFrameDetails() {
         HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame",
                 "top.loadFrames()");
-        if (configuration.showProfiles) {
-            HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
-                "top.loadFrames()");
-            addAllProfilesFrameTag(leftFrameset);
-            addAllClassesFrameTag(leftFrameset);
-            frameset.addContent(leftFrameset);
-        } else if (noOfPackages <= 1) {
+        if (noOfPackages <= 1) {
             addAllClassesFrameTag(frameset);
         } else if (noOfPackages > 1) {
             HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
@@ -156,17 +150,6 @@
     }
 
     /**
-     * Add the FRAME tag for the frame that lists all profiles.
-     *
-     * @param contentTree the content tree to which the information will be added
-     */
-    private void addAllProfilesFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME(DocPaths.PROFILE_OVERVIEW_FRAME.getPath(),
-                "profileListFrame", configuration.getText("doclet.All_Profiles"));
-        contentTree.addContent(frame);
-    }
-
-    /**
      * Add the FRAME tag for the frame that lists all packages.
      *
      * @param contentTree the content tree to which the information will be added
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -162,7 +162,7 @@
      */
     protected void addAllProfilesLink(Content div) {
         Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
-                allprofilesLabel, "", "profileListFrame");
+                allprofilesLabel, "", "packageListFrame");
         Content span = HtmlTree.SPAN(linkContent);
         div.addContent(span);
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -107,7 +107,7 @@
         String profileName = (Profile.lookup(profile)).name;
         profileLabel = new StringContent(profileName);
         profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "",
-                    "profileListFrame");
+                    "packageListFrame");
         Content li = HtmlTree.LI(profileLinkContent);
         return li;
     }
@@ -154,7 +154,7 @@
      */
     protected void addAllPackagesLink(Content div) {
         Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME,
-                allpackagesLabel, "", "profileListFrame");
+                allpackagesLabel, "", "packageListFrame");
         Content span = HtmlTree.SPAN(linkContent);
         div.addContent(span);
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -172,7 +172,7 @@
      */
     protected void addAllPackagesLink(Content div) {
         Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME,
-                allpackagesLabel, "", "profileListFrame");
+                allpackagesLabel, "", "packageListFrame");
         Content span = HtmlTree.SPAN(linkContent);
         div.addContent(span);
     }
@@ -185,7 +185,7 @@
      */
     protected void addAllProfilesLink(Content div) {
         Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
-                allprofilesLabel, "", "profileListFrame");
+                allprofilesLabel, "", "packageListFrame");
         Content span = HtmlTree.SPAN(linkContent);
         div.addContent(span);
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -32,7 +32,7 @@
 doclet.navAnnotationTypeRequiredMember=\u5FC5\u9808
 doclet.navAnnotationTypeMember=\u8981\u7D20
 doclet.navField=\u30D5\u30A3\u30FC\u30EB\u30C9
-doclet.navEnum=\u5217\u6319\u5B9A\u6570
+doclet.navEnum=\u5217\u6319\u578B\u5B9A\u6570
 doclet.navConstructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
 doclet.navMethod=\u30E1\u30BD\u30C3\u30C9
 doclet.Index=\u7D22\u5F15
@@ -41,59 +41,47 @@
 doclet.Help=\u30D8\u30EB\u30D7
 doclet.Skip_navigation_links=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30F3\u30AF\u3092\u30B9\u30AD\u30C3\u30D7
 doclet.New_Page=NewPage
-doclet.None=\u306A\u3057
-doclet.Factory_Method_Detail=static\u30D5\u30A1\u30AF\u30C8\u30EA\u30FB\u30E1\u30BD\u30C3\u30C9\u306E\u8A73\u7D30
 doclet.navDeprecated=\u975E\u63A8\u5968
-doclet.Deprecated_List=\u975E\u63A8\u5968API\u306E\u30EA\u30B9\u30C8
-doclet.Window_Deprecated_List=\u975E\u63A8\u5968API\u306E\u30EA\u30B9\u30C8
-doclet.Note_0_is_deprecated=\u6CE8\u610F: {0}\u306F\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
+doclet.Window_Deprecated_List=\u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8
 doclet.Overrides=\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9:
 doclet.in_class=\u30AF\u30E9\u30B9\u5185
-doclet.0_Fields_and_Methods=&quot;{0}&quot;\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9
-doclet.Index_of_Fields_and_Methods=\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u7D22\u5F15
 doclet.Static_variable_in={0}\u306Estatic\u5909\u6570
 doclet.Variable_in={0}\u306E\u5909\u6570
 doclet.Constructor_for={0}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
 doclet.Static_method_in={0}\u306Estatic\u30E1\u30BD\u30C3\u30C9
 doclet.Method_in={0}\u306E\u30E1\u30BD\u30C3\u30C9
-doclet.throws=\u30B9\u30ED\u30FC
 doclet.package=\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.MalformedURL=\u4E0D\u6B63\u306AURL: {0}
 doclet.File_error=\u30D5\u30A1\u30A4\u30EB\u8AAD\u8FBC\u307F\u30A8\u30E9\u30FC: {0}
 doclet.URL_error=URL\u53D6\u51FA\u3057\u30A8\u30E9\u30FC: {0}
-doclet.No_Package_Comment_File=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306EPackage.Comment\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
-doclet.No_Source_For_Class=\u30AF\u30E9\u30B9{0}\u306E\u30BD\u30FC\u30B9\u60C5\u5831\u304C\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
 doclet.see.class_or_package_not_found=\u30BF\u30B0{0}: \u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {1}
 doclet.see.class_or_package_not_accessible=\u30BF\u30B0{0}: \u53C2\u7167\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {1}
-doclet.see.malformed_tag={0}\u30BF\u30B0: \u4E0D\u6B63\u306A{1}\u30BF\u30B0
-doclet.Inherited_API_Summary=\u7D99\u627F\u3055\u308C\u305FAPI\u306E\u6982\u8981
-doclet.Deprecated_API=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044API
-doclet.Deprecated_Classes=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30AF\u30E9\u30B9
-doclet.Deprecated_Enums=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B
-doclet.Deprecated_Interfaces=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
-doclet.Deprecated_Exceptions=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u4F8B\u5916
-doclet.Deprecated_Annotation_Types=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B
-doclet.Deprecated_Errors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30E9\u30FC
-doclet.Deprecated_Fields=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D5\u30A3\u30FC\u30EB\u30C9
-doclet.Deprecated_Constructors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
-doclet.Deprecated_Methods=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30E1\u30BD\u30C3\u30C9
-doclet.Deprecated_Enum_Constants=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B\u5B9A\u6570
-doclet.Deprecated_Annotation_Type_Members=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B\u306E\u8981\u7D20
-doclet.deprecated_classes=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30AF\u30E9\u30B9
-doclet.deprecated_enums=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B
-doclet.deprecated_interfaces=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
-doclet.deprecated_exceptions=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u4F8B\u5916
-doclet.deprecated_annotation_types=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B
-doclet.deprecated_errors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30E9\u30FC
-doclet.deprecated_fields=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D5\u30A3\u30FC\u30EB\u30C9
-doclet.deprecated_constructors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
-doclet.deprecated_methods=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30E1\u30BD\u30C3\u30C9
-doclet.deprecated_enum_constants=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B\u5B9A\u6570
-doclet.deprecated_annotation_type_members=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B\u306E\u8981\u7D20
-doclet.Frame_Output=\u30D5\u30EC\u30FC\u30E0\u51FA\u529B
-doclet.Docs_generated_by_Javadoc=\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306Fjavadoc\u3067\u751F\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002
+doclet.Deprecated_API=\u975E\u63A8\u5968\u306EAPI
+doclet.Deprecated_Packages=\u975E\u63A8\u5968\u306E\u30D1\u30C3\u30B1\u30FC\u30B8
+doclet.Deprecated_Classes=\u975E\u63A8\u5968\u306E\u30AF\u30E9\u30B9
+doclet.Deprecated_Enums=\u975E\u63A8\u5968\u306E\u5217\u6319\u578B
+doclet.Deprecated_Interfaces=\u975E\u63A8\u5968\u306E\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
+doclet.Deprecated_Exceptions=\u975E\u63A8\u5968\u306E\u4F8B\u5916
+doclet.Deprecated_Annotation_Types=\u975E\u63A8\u5968\u306E\u6CE8\u91C8\u578B
+doclet.Deprecated_Errors=\u975E\u63A8\u5968\u306E\u30A8\u30E9\u30FC
+doclet.Deprecated_Fields=\u975E\u63A8\u5968\u306E\u30D5\u30A3\u30FC\u30EB\u30C9
+doclet.Deprecated_Constructors=\u975E\u63A8\u5968\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
+doclet.Deprecated_Methods=\u975E\u63A8\u5968\u306E\u30E1\u30BD\u30C3\u30C9
+doclet.Deprecated_Enum_Constants=\u975E\u63A8\u5968\u306E\u5217\u6319\u578B\u5B9A\u6570
+doclet.Deprecated_Annotation_Type_Members=\u975E\u63A8\u5968\u306E\u6CE8\u91C8\u578B\u306E\u8981\u7D20
+doclet.deprecated_packages=\u975E\u63A8\u5968\u306E\u30D1\u30C3\u30B1\u30FC\u30B8
+doclet.deprecated_classes=\u975E\u63A8\u5968\u306E\u30AF\u30E9\u30B9
+doclet.deprecated_enums=\u975E\u63A8\u5968\u306E\u5217\u6319\u578B
+doclet.deprecated_interfaces=\u975E\u63A8\u5968\u306E\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
+doclet.deprecated_exceptions=\u975E\u63A8\u5968\u306E\u4F8B\u5916
+doclet.deprecated_annotation_types=\u975E\u63A8\u5968\u306E\u6CE8\u91C8\u578B
+doclet.deprecated_errors=\u975E\u63A8\u5968\u306E\u30A8\u30E9\u30FC
+doclet.deprecated_fields=\u975E\u63A8\u5968\u306E\u30D5\u30A3\u30FC\u30EB\u30C9
+doclet.deprecated_constructors=\u975E\u63A8\u5968\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
+doclet.deprecated_methods=\u975E\u63A8\u5968\u306E\u30E1\u30BD\u30C3\u30C9
+doclet.deprecated_enum_constants=\u975E\u63A8\u5968\u306E\u5217\u6319\u578B\u5B9A\u6570
+doclet.deprecated_annotation_type_members=\u975E\u63A8\u5968\u306E\u6CE8\u91C8\u578B\u306E\u8981\u7D20
 doclet.Generated_Docs_Untitled=\u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8(\u30BF\u30A4\u30C8\u30EB\u306A\u3057)
-doclet.Blank=\u30D6\u30E9\u30F3\u30AF
 doclet.Other_Packages=\u305D\u306E\u4ED6\u306E\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.Package_Description=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u8AAC\u660E
 doclet.Description=\u8AAC\u660E
@@ -102,33 +90,25 @@
 doclet.Subclasses=\u76F4\u7CFB\u306E\u65E2\u77E5\u306E\u30B5\u30D6\u30AF\u30E9\u30B9:
 doclet.Subinterfaces=\u65E2\u77E5\u306E\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8:
 doclet.Implementing_Classes=\u65E2\u77E5\u306E\u5B9F\u88C5\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8:
+doclet.Functional_Interface=\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
+doclet.Functional_Interface_Message=\u3053\u308C\u306F\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306A\u306E\u3067\u3001\u30E9\u30E0\u30C0\u5F0F\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u5272\u5F53\u3066\u30BF\u30FC\u30B2\u30C3\u30C8\u3068\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 
 doclet.also=\u540C\u69D8\u306B
-doclet.Option=\u30AA\u30D7\u30B7\u30E7\u30F3
-doclet.Or=\u307E\u305F\u306F
 doclet.Frames=\u30D5\u30EC\u30FC\u30E0
 doclet.No_Frames=\u30D5\u30EC\u30FC\u30E0\u306A\u3057
 doclet.Package_Hierarchies=\u30D1\u30C3\u30B1\u30FC\u30B8\u968E\u5C64:
 doclet.Hierarchy_For_Package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u968E\u5C64
-doclet.Source_Code=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9:
 doclet.Hierarchy_For_All_Packages=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64
-doclet.Cannot_handle_no_packages=\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u51E6\u7406\u3067\u304D\u307E\u305B\u3093\u3002
 doclet.Frame_Alert=\u30D5\u30EC\u30FC\u30E0\u95A2\u9023\u306E\u30A2\u30E9\u30FC\u30C8
-doclet.Overview-Member-Frame=\u6982\u8981\u30E1\u30F3\u30D0\u30FC\u30FB\u30D5\u30EC\u30FC\u30E0
 doclet.Frame_Warning_Message=\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306F\u30D5\u30EC\u30FC\u30E0\u6A5F\u80FD\u3092\u4F7F\u7528\u3057\u3066\u8868\u793A\u3059\u308B\u3088\u3046\u306B\u4F5C\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30D5\u30EC\u30FC\u30E0\u3092\u8868\u793A\u3067\u304D\u306A\u3044Web\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u306E\u5834\u5408\u306B\u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002{0}\u306B\u30EA\u30F3\u30AF\u3057\u307E\u3059\u3002
 doclet.No_Script_Message=\u30D6\u30E9\u30A6\u30B6\u306EJavaScript\u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002
 doclet.Non_Frame_Version=\u30D5\u30EC\u30FC\u30E0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u306A\u3044\u30D0\u30FC\u30B8\u30E7\u30F3
-doclet.Frame_Version=\u30D5\u30EC\u30FC\u30E0\u3042\u308A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3
-doclet.Following_From_Class=\u30AF\u30E9\u30B9{0}\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u30BF\u30B0:
-doclet.Following_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u30BF\u30B0:
 doclet.Description_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E:
 doclet.Description_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E:
-doclet.Standard_doclet_invoked=\u6A19\u6E96\u306Edoclet\u304C\u8D77\u52D5\u3055\u308C\u307E\u3057\u305F...
-doclet.No_Non_Deprecated_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308B\u975E\u63A8\u5968\u4EE5\u5916\u306E\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
+doclet.No_Non_Deprecated_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308B\u975E\u63A8\u5968\u3067\u306A\u3044\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 doclet.Interfaces_Italic=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u30A4\u30BF\u30EA\u30C3\u30AF)
 doclet.Enclosing_Class=\u542B\u307E\u308C\u3066\u3044\u308B\u30AF\u30E9\u30B9:
 doclet.Enclosing_Interface=\u542B\u307E\u308C\u3066\u3044\u308B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9:
 doclet.Window_Source_title=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9
-doclet.Help_title=API\u30D8\u30EB\u30D7
 doclet.Window_Help_title=API\u30D8\u30EB\u30D7
 doclet.Help_line_1=API\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u69CB\u6210
 doclet.Help_line_2=\u3053\u306EAPI(Application Programming Interface)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u3001\u6B21\u306B\u8AAC\u660E\u3059\u308B\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u3042\u308B\u9805\u76EE\u306B\u5BFE\u5FDC\u3059\u308B\u30DA\u30FC\u30B8\u304C\u542B\u307E\u308C\u307E\u3059\u3002
@@ -149,7 +129,7 @@
 doclet.Help_line_17_with_tree_link=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F{0}\u30DA\u30FC\u30B8\u304C\u3042\u308A\u3001\u3055\u3089\u306B\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u3042\u308A\u307E\u3059\u3002\u5404\u968E\u5C64\u30DA\u30FC\u30B8\u306F\u3001\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3092\u542B\u307F\u307E\u3059\u3002\u30AF\u30E9\u30B9\u306F <code>java.lang.Object</code> \u3092\u958B\u59CB\u70B9\u3068\u3059\u308B\u7D99\u627F\u69CB\u9020\u3067\u7DE8\u6210\u3055\u308C\u307E\u3059\u3002\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u3001<code>java.lang.Object</code> \u304B\u3089\u306F\u7D99\u627F\u3057\u307E\u305B\u3093\u3002
 doclet.Help_line_18=\u6982\u8981\u30DA\u30FC\u30B8\u3092\u8868\u793A\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u300C\u968E\u5C64\u30C4\u30EA\u30FC\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002
 doclet.Help_line_19=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u8868\u793A\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u300C\u968E\u5C64\u30C4\u30EA\u30FC\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u8A72\u5F53\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u307F\u306E\u968E\u5C64\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002
-doclet.Help_line_20_with_deprecated_api_link={0}\u30DA\u30FC\u30B8\u306F\u3001\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u3059\u3079\u3066\u306EAPI\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u975E\u63A8\u5968API\u3068\u306F\u3001\u6A5F\u80FD\u6539\u826F\u306A\u3069\u306E\u7406\u7531\u304B\u3089\u4F7F\u7528\u3092\u304A\u85A6\u3081\u3067\u304D\u306A\u304F\u306A\u3063\u305FAPI\u306E\u3053\u3068\u3067\u3001\u901A\u5E38\u306F\u305D\u308C\u306B\u4EE3\u308F\u308BAPI\u304C\u63D0\u4F9B\u3055\u308C\u307E\u3059\u3002\u975E\u63A8\u5968API\u306F\u4ECA\u5F8C\u306E\u5B9F\u88C5\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
+doclet.Help_line_20_with_deprecated_api_link={0}\u30DA\u30FC\u30B8\u306F\u3001\u975E\u63A8\u5968\u306EAPI\u3092\u3059\u3079\u3066\u30EA\u30B9\u30C8\u3057\u307E\u3059\u3002\u975E\u63A8\u5968\u306EAPI\u3068\u306F\u3001\u6A5F\u80FD\u6539\u826F\u306A\u3069\u306E\u7406\u7531\u304B\u3089\u4F7F\u7528\u3092\u304A\u85A6\u3081\u3067\u304D\u306A\u304F\u306A\u3063\u305FAPI\u306E\u3053\u3068\u3067\u3001\u901A\u5E38\u306F\u305D\u308C\u306B\u4EE3\u308F\u308BAPI\u304C\u63D0\u4F9B\u3055\u308C\u307E\u3059\u3002\u975E\u63A8\u5968\u306EAPI\u306F\u4ECA\u5F8C\u306E\u5B9F\u88C5\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
 doclet.Help_line_21=\u7D22\u5F15
 doclet.Help_line_22={0}\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3001\u30E1\u30BD\u30C3\u30C9\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\u9806\u306E\u30EA\u30B9\u30C8\u304C\u542B\u307E\u308C\u307E\u3059\u3002
 doclet.Help_line_23=\u524D/\u6B21
@@ -158,7 +138,7 @@
 doclet.Help_line_26=\u3053\u308C\u3089\u306E\u30EA\u30F3\u30AF\u306FHTML\u30D5\u30EC\u30FC\u30E0\u306E\u8868\u793A\u3068\u975E\u8868\u793A\u3092\u5207\u308A\u66FF\u3048\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u30DA\u30FC\u30B8\u306F\u30D5\u30EC\u30FC\u30E0\u3042\u308A\u3067\u3082\u3001\u30D5\u30EC\u30FC\u30E0\u306A\u3057\u3067\u3082\u8868\u793A\u3067\u304D\u307E\u3059\u3002
 doclet.Help_line_27={0}\u30EA\u30F3\u30AF\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F)\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002
 doclet.Help_line_28=\u76F4\u5217\u5316\u53EF\u80FD\u307E\u305F\u306F\u5916\u90E8\u5316\u53EF\u80FD\u306A\u5404\u30AF\u30E9\u30B9\u306F\u3001\u76F4\u5217\u5316\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u8AAC\u660E\u3092\u542B\u307F\u307E\u3059\u3002\u3053\u306E\u60C5\u5831\u306F\u3001API\u3092\u4F7F\u7528\u3059\u308B\u958B\u767A\u8005\u3067\u306F\u306A\u304F\u3001\u518D\u5B9F\u88C5\u3092\u884C\u3046\u62C5\u5F53\u8005\u306B\u5F79\u7ACB\u3061\u307E\u3059\u3002\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u30EA\u30F3\u30AF\u304C\u306A\u3044\u5834\u5408\u3001\u76F4\u5217\u5316\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306B\u79FB\u52D5\u3057\u3066\u3001\u30AF\u30E9\u30B9\u8A18\u8FF0\u306E\u300C\u95A2\u9023\u9805\u76EE\u300D\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u3042\u308B\u300C\u76F4\u5217\u5316\u3055\u308C\u305F\u5F62\u5F0F\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u3053\u306E\u60C5\u5831\u3092\u8868\u793A\u3067\u304D\u307E\u3059\u3002
-doclet.Help_line_29=<a href="constant-values.html">\u300C\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u5024\u300D</a> \u30DA\u30FC\u30B8\u306B\u306F\u3001static final\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u305D\u306E\u5024\u306E\u30EA\u30B9\u30C8\u304C\u3042\u308A\u307E\u3059\u3002
+doclet.Help_line_29={0}\u30DA\u30FC\u30B8\u306B\u306F\u3001static final\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u305D\u306E\u5024\u306E\u30EA\u30B9\u30C8\u304C\u3042\u308A\u307E\u3059\u3002
 doclet.Help_line_30=\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u6A19\u6E96doclet\u3092\u4F7F\u7528\u3057\u3066\u751F\u6210\u3055\u308C\u305FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002
 doclet.Help_enum_line_1=\u5404\u5217\u6319\u578B\u306B\u306F\u3001\u305D\u308C\u81EA\u8EAB\u306E\u500B\u5225\u306E\u30DA\u30FC\u30B8\u3068\u6B21\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059:
 doclet.Help_enum_line_2=\u5217\u6319\u578B\u306E\u5BA3\u8A00
@@ -166,19 +146,6 @@
 doclet.Help_annotation_type_line_1=\u5404\u6CE8\u91C8\u578B\u306B\u306F\u3001\u305D\u308C\u81EA\u8EAB\u306E\u500B\u5225\u306E\u30DA\u30FC\u30B8\u3068\u6B21\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059:
 doclet.Help_annotation_type_line_2=\u6CE8\u91C8\u578B\u306E\u5BA3\u8A00
 doclet.Help_annotation_type_line_3=\u6CE8\u91C8\u578B\u306E\u8AAC\u660E
-doclet.Style_line_1=javadoc\u30B9\u30BF\u30A4\u30EB\u30FB\u30B7\u30FC\u30C8
-doclet.Style_line_2=\u8272\u3084\u30D5\u30A9\u30F3\u30C8\u306A\u3069\u306E\u30B9\u30BF\u30A4\u30EB\u5C5E\u6027\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\u306B\u306F\u3001\u3053\u3053\u3067\u5B9A\u7FA9\u3057\u307E\u3059
-doclet.Style_line_3=\u30DA\u30FC\u30B8\u306E\u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u8272
-doclet.Style_Headings=\u898B\u51FA\u3057
-doclet.Style_line_4=\u8868\u306E\u8272
-doclet.Style_line_5=\u6FC3\u3044\u85E4\u8272
-doclet.Style_line_6=\u8584\u3044\u85E4\u8272
-doclet.Style_line_7=\u767D
-doclet.Style_line_8=\u5DE6\u5074\u306E\u30D5\u30EC\u30FC\u30E0\u306E\u30EA\u30B9\u30C8\u306B\u4F7F\u7528\u3059\u308B\u30D5\u30A9\u30F3\u30C8
-doclet.Style_line_9=\u30D5\u30EC\u30FC\u30E0\u306B\u304A\u3051\u308B\u3001\u3088\u308A\u5C0F\u3055\u3044sans-serif\u30D5\u30A9\u30F3\u30C8\u306E\u4F8B
-doclet.Style_line_10=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306E\u30D5\u30A9\u30F3\u30C8\u3068\u8272
-doclet.Style_line_11=\u6FC3\u3044\u9752
-doclet.Style_line_12=\u8868\u306E\u30AD\u30E3\u30D7\u30B7\u30E7\u30F3\u30FB\u30B9\u30BF\u30A4\u30EB
 doclet.ClassUse_Packages.that.use.0={0}\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.ClassUse_Uses.of.0.in.1={1}\u3067\u306E{0}\u306E\u4F7F\u7528
 doclet.ClassUse_Classes.in.0.used.by.1={1}\u306B\u3088\u308A\u4F7F\u7528\u3055\u308C\u308B{0}\u306E\u30AF\u30E9\u30B9
@@ -208,13 +175,11 @@
 doclet.Window_ClassUse_Header={0} {1}\u306E\u4F7F\u7528
 doclet.ClassUse_Title={0}<br>{1}\u306E\u4F7F\u7528
 doclet.navClassUse=\u4F7F\u7528
-doclet.link_option_twice=\u5916\u90E8URL\u30EA\u30F3\u30AF\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3(link\u307E\u305F\u306Flinkoffline)\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002
 doclet.Error_in_packagelist=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u30A8\u30E9\u30FC: {0} {1}
 doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
 doclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
-doclet.Serialization.Excluded_Class=\u5E38\u99D0\u30D5\u30A3\u30FC\u30EB\u30C9{1}\u306F\u3001\u9664\u5916\u3055\u308C\u305F\u30AF\u30E9\u30B9{0}\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
-doclet.Serialization.Nonexcluded_Class=\u5E38\u99D0\u30D5\u30A3\u30FC\u30EB\u30C9{1}\u306F\u3001\u975E\u8868\u793A\u306E\u3001\u542B\u307E\u308C\u306A\u3044\u30AF\u30E9\u30B9{0}\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
-doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n-d <directory>                    \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n-use                             \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n-version                          @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-author                           @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-docfilessubdirs                  doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n-splitindex                       1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n-windowtitle <text>               \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n-doctitle <html-code>             \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top    <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link <url>                       <url>\u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline <url> <url2>         <url2>\u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066<url>\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir <name1>:.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n-group <name> <p1>:<p2>..         \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n-nocomment                        \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n-nodeprecated                     @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-noqualifier <name1>:<name2>:...  \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n-nosince                          @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-notimestamp                      \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n-nodeprecatedlist                 \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n-notree                           \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n-noindex                          \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n-nohelp                           \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n-nonavbar                         \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n-serialwarn                       @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n-tag <name>:<locations>:<header>  \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n-taglet                           \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n-tagletpath                       \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n-charset <charset>                \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n-helpfile <file>                  \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n-linksource                       HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n-sourcetab <tab length>           \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n-keywords                         HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n-stylesheetfile <path>            \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n-docencoding <name>               \u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D
+doclet.exception_encountered={1}\u306E\u51E6\u7406\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n{0}
+doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n-d <directory>                    \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n-use                              \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n-version                          @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-author                           @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-docfilessubdirs                  doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n-splitindex                       1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n-windowtitle <text>               \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n-doctitle <html-code>             \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top    <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom <html-code>               \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link <url>                       <url>\u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline <url> <url2>         <url2>\u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066<url>\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir <name1>:.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n-group <name> <p1>:<p2>..         \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n-nocomment                        \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n-nodeprecated                     @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-noqualifier <name1>:<name2>:...  \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n-nosince                          @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-notimestamp                      \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n-nodeprecatedlist                 \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n-notree                           \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n-noindex                          \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n-nohelp                           \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n-nonavbar                         \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n-serialwarn                       @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n-tag <name>:<locations>:<header>  \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n-taglet                           \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n-tagletpath                       \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n-Xdocrootparent <url>             \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B3\u30E1\u30F3\u30C8\u5185\u306E@docRoot(\u3053\u306E\u5F8C\u306B\u306F/..\u304C\u7D9A\u304F)\u306E\u3059\u3079\u3066\u306E\u51FA\u73FE\u7B87\u6240\u3092<url>\u3067\u7F6E\u63DB\u3059\u308B\n-charset <charset>                \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n-helpfile <file>                  \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n-linksource                       HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n-sourcetab <tab length>           \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n-keywords                         HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n-stylesheetfile <path>            \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n-docencoding <name>               \u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D
 
 
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -41,33 +41,23 @@
 doclet.Help=\u5E2E\u52A9
 doclet.Skip_navigation_links=\u8DF3\u8FC7\u5BFC\u822A\u94FE\u63A5
 doclet.New_Page=NewPage
-doclet.None=\u65E0
-doclet.Factory_Method_Detail=\u9759\u6001\u5DE5\u5382\u65B9\u6CD5\u8BE6\u7EC6\u8D44\u6599
 doclet.navDeprecated=\u5DF2\u8FC7\u65F6
-doclet.Deprecated_List=\u5DF2\u8FC7\u65F6\u7684\u5217\u8868
 doclet.Window_Deprecated_List=\u5DF2\u8FC7\u65F6\u7684\u5217\u8868
-doclet.Note_0_is_deprecated=\u6CE8: {0}\u5DF2\u8FC7\u65F6\u3002
 doclet.Overrides=\u8986\u76D6:
 doclet.in_class=\u5728\u7C7B\u4E2D
-doclet.0_Fields_and_Methods=&quot;{0}&quot; \u5B57\u6BB5\u548C\u65B9\u6CD5
-doclet.Index_of_Fields_and_Methods=\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u7D22\u5F15
 doclet.Static_variable_in={0}\u4E2D\u7684\u9759\u6001\u53D8\u91CF
 doclet.Variable_in={0}\u4E2D\u7684\u53D8\u91CF
 doclet.Constructor_for={0}\u7684\u6784\u9020\u5668
 doclet.Static_method_in={0}\u4E2D\u7684\u9759\u6001\u65B9\u6CD5
 doclet.Method_in={0}\u4E2D\u7684\u65B9\u6CD5
-doclet.throws=\u629B\u51FA
 doclet.package=\u7A0B\u5E8F\u5305
 doclet.MalformedURL=\u683C\u5F0F\u9519\u8BEF\u7684 URL: {0}
 doclet.File_error=\u8BFB\u53D6\u6587\u4EF6\u65F6\u51FA\u9519: {0}
 doclet.URL_error=\u83B7\u53D6 URL \u65F6\u51FA\u9519: {0}
-doclet.No_Package_Comment_File=\u5BF9\u4E8E\u7A0B\u5E8F\u5305{0}, \u627E\u4E0D\u5230 Package.Comment \u6587\u4EF6
-doclet.No_Source_For_Class=\u7C7B{0}\u7684\u6E90\u4FE1\u606F\u4E0D\u53EF\u7528\u3002
 doclet.see.class_or_package_not_found=\u6807\u8BB0{0}: \u627E\u4E0D\u5230\u5F15\u7528: {1}
 doclet.see.class_or_package_not_accessible=\u6807\u8BB0{0}: \u65E0\u6CD5\u8BBF\u95EE\u5F15\u7528: {1}
-doclet.see.malformed_tag=\u6807\u8BB0{0}: \u683C\u5F0F\u9519\u8BEF: {1}
-doclet.Inherited_API_Summary=\u7EE7\u627F\u7684 API \u6982\u8981
 doclet.Deprecated_API=\u5DF2\u8FC7\u65F6\u7684 API
+doclet.Deprecated_Packages=\u5DF2\u8FC7\u65F6\u7A0B\u5E8F\u5305
 doclet.Deprecated_Classes=\u5DF2\u8FC7\u65F6\u7684\u7C7B
 doclet.Deprecated_Enums=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E
 doclet.Deprecated_Interfaces=\u5DF2\u8FC7\u65F6\u7684\u63A5\u53E3
@@ -79,6 +69,7 @@
 doclet.Deprecated_Methods=\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5
 doclet.Deprecated_Enum_Constants=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E\u5E38\u91CF
 doclet.Deprecated_Annotation_Type_Members=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20
+doclet.deprecated_packages=\u5DF2\u8FC7\u65F6\u7A0B\u5E8F\u5305
 doclet.deprecated_classes=\u5DF2\u8FC7\u65F6\u7684\u7C7B
 doclet.deprecated_enums=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E
 doclet.deprecated_interfaces=\u5DF2\u8FC7\u65F6\u7684\u63A5\u53E3
@@ -90,10 +81,7 @@
 doclet.deprecated_methods=\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5
 doclet.deprecated_enum_constants=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E\u5E38\u91CF
 doclet.deprecated_annotation_type_members=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20
-doclet.Frame_Output=\u6846\u67B6\u8F93\u51FA
-doclet.Docs_generated_by_Javadoc=\u7531 Javadoc \u751F\u6210\u7684\u6587\u6863\u3002
 doclet.Generated_Docs_Untitled=\u751F\u6210\u7684\u6587\u6863 (\u65E0\u6807\u9898)
-doclet.Blank=\u7A7A\u767D
 doclet.Other_Packages=\u5176\u4ED6\u7A0B\u5E8F\u5305
 doclet.Package_Description=\u7A0B\u5E8F\u5305{0}\u7684\u8BF4\u660E
 doclet.Description=\u8BF4\u660E
@@ -102,33 +90,25 @@
 doclet.Subclasses=\u76F4\u63A5\u5DF2\u77E5\u5B50\u7C7B:
 doclet.Subinterfaces=\u6240\u6709\u5DF2\u77E5\u5B50\u63A5\u53E3:
 doclet.Implementing_Classes=\u6240\u6709\u5DF2\u77E5\u5B9E\u73B0\u7C7B:
+doclet.Functional_Interface=\u51FD\u6570\u63A5\u53E3:
+doclet.Functional_Interface_Message=\u8FD9\u662F\u4E00\u4E2A\u51FD\u6570\u63A5\u53E3, \u56E0\u6B64\u53EF\u7528\u4F5C lambda \u8868\u8FBE\u5F0F\u6216\u65B9\u6CD5\u5F15\u7528\u7684\u8D4B\u503C\u76EE\u6807\u3002
 doclet.also=\u5E76
-doclet.Option=\u9009\u9879
-doclet.Or=\u6216
 doclet.Frames=\u6846\u67B6
 doclet.No_Frames=\u65E0\u6846\u67B6
 doclet.Package_Hierarchies=\u7A0B\u5E8F\u5305\u5206\u5C42\u7ED3\u6784:
 doclet.Hierarchy_For_Package=\u7A0B\u5E8F\u5305{0}\u7684\u5206\u5C42\u7ED3\u6784
-doclet.Source_Code=\u6E90\u4EE3\u7801:
 doclet.Hierarchy_For_All_Packages=\u6240\u6709\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784
-doclet.Cannot_handle_no_packages=\u65E0\u6CD5\u5904\u7406\u6CA1\u6709\u7A0B\u5E8F\u5305\u7684\u60C5\u51B5\u3002
 doclet.Frame_Alert=\u6846\u67B6\u9884\u8B66
-doclet.Overview-Member-Frame=\u6210\u5458\u6846\u67B6\u6982\u89C8
 doclet.Frame_Warning_Message=\u8BF7\u4F7F\u7528\u6846\u67B6\u529F\u80FD\u67E5\u770B\u6B64\u6587\u6863\u3002\u5982\u679C\u770B\u5230\u6B64\u6D88\u606F, \u5219\u8868\u660E\u60A8\u4F7F\u7528\u7684\u662F\u4E0D\u652F\u6301\u6846\u67B6\u7684 Web \u5BA2\u6237\u673A\u3002\u94FE\u63A5\u5230{0}\u3002
 doclet.No_Script_Message=\u60A8\u7684\u6D4F\u89C8\u5668\u5DF2\u7981\u7528 JavaScript\u3002
 doclet.Non_Frame_Version=\u975E\u6846\u67B6\u7248\u672C
-doclet.Frame_Version=\u6846\u67B6\u7248\u672C
-doclet.Following_From_Class=\u4EE5\u4E0B\u5185\u5BB9\u662F\u4ECE\u7C7B{0}\u590D\u5236\u7684
-doclet.Following_From_Interface=\u4EE5\u4E0B\u5185\u5BB9\u662F\u4ECE\u63A5\u53E3{0}\u590D\u5236\u7684
 doclet.Description_From_Interface=\u4ECE\u63A5\u53E3\u590D\u5236\u7684\u8BF4\u660E:
 doclet.Description_From_Class=\u4ECE\u7C7B\u590D\u5236\u7684\u8BF4\u660E:
-doclet.Standard_doclet_invoked=\u5DF2\u8C03\u7528\u7684\u6807\u51C6 doclet...
 doclet.No_Non_Deprecated_Classes_To_Document=\u627E\u4E0D\u5230\u53EF\u4EE5\u6587\u6863\u5316\u7684\u672A\u8FC7\u65F6\u7684\u7C7B\u3002
 doclet.Interfaces_Italic=\u63A5\u53E3 (\u659C\u4F53)
 doclet.Enclosing_Class=\u5C01\u95ED\u7C7B:
 doclet.Enclosing_Interface=\u5C01\u95ED\u63A5\u53E3:
 doclet.Window_Source_title=\u6E90\u4EE3\u7801
-doclet.Help_title=API \u5E2E\u52A9
 doclet.Window_Help_title=API \u5E2E\u52A9
 doclet.Help_line_1=\u6B64 API \u6587\u6863\u7684\u7EC4\u7EC7\u65B9\u5F0F
 doclet.Help_line_2=\u6B64 API (\u5E94\u7528\u7A0B\u5E8F\u7F16\u7A0B\u63A5\u53E3) \u6587\u6863\u5305\u542B\u5BF9\u5E94\u4E8E\u5BFC\u822A\u680F\u4E2D\u7684\u9879\u76EE\u7684\u9875\u9762, \u5982\u4E0B\u6240\u8FF0\u3002
@@ -158,7 +138,7 @@
 doclet.Help_line_26=\u8FD9\u4E9B\u94FE\u63A5\u7528\u4E8E\u663E\u793A\u548C\u9690\u85CF HTML \u6846\u67B6\u3002\u6240\u6709\u9875\u9762\u5747\u5177\u6709\u6709\u6846\u67B6\u548C\u65E0\u6846\u67B6\u4E24\u79CD\u663E\u793A\u65B9\u5F0F\u3002
 doclet.Help_line_27={0}\u94FE\u63A5\u663E\u793A\u6240\u6709\u7C7B\u548C\u63A5\u53E3 (\u9664\u4E86\u975E\u9759\u6001\u5D4C\u5957\u7C7B\u578B)\u3002
 doclet.Help_line_28=\u6BCF\u4E2A\u53EF\u5E8F\u5217\u5316\u6216\u53EF\u5916\u90E8\u5316\u7684\u7C7B\u90FD\u6709\u5176\u5E8F\u5217\u5316\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u8BF4\u660E\u3002\u6B64\u4FE1\u606F\u5BF9\u91CD\u65B0\u5B9E\u73B0\u8005\u6709\u7528, \u800C\u5BF9\u4F7F\u7528 API \u7684\u5F00\u53D1\u8005\u5219\u6CA1\u6709\u4EC0\u4E48\u7528\u5904\u3002\u5C3D\u7BA1\u5BFC\u822A\u680F\u4E2D\u6CA1\u6709\u94FE\u63A5, \u4F46\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E0B\u5217\u65B9\u5F0F\u83B7\u53D6\u6B64\u4FE1\u606F: \u8F6C\u81F3\u4EFB\u4F55\u5E8F\u5217\u5316\u7C7B, \u7136\u540E\u5355\u51FB\u7C7B\u8BF4\u660E\u7684 "\u53E6\u8BF7\u53C2\u9605" \u90E8\u5206\u4E2D\u7684 "\u5E8F\u5217\u5316\u8868\u683C"\u3002
-doclet.Help_line_29=<a href="constant-values.html">\u5E38\u91CF\u5B57\u6BB5\u503C</a>\u9875\u9762\u5217\u51FA\u4E86\u9759\u6001\u6700\u7EC8\u5B57\u6BB5\u53CA\u5176\u503C\u3002
+doclet.Help_line_29={0}\u9875\u9762\u5217\u51FA\u4E86\u9759\u6001\u6700\u7EC8\u5B57\u6BB5\u53CA\u5176\u503C\u3002
 doclet.Help_line_30=\u6B64\u5E2E\u52A9\u6587\u4EF6\u9002\u7528\u4E8E\u4F7F\u7528\u6807\u51C6 doclet \u751F\u6210\u7684 API \u6587\u6863\u3002
 doclet.Help_enum_line_1=\u6BCF\u4E2A\u679A\u4E3E\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762, \u5176\u4E2D\u5305\u542B\u4EE5\u4E0B\u90E8\u5206:
 doclet.Help_enum_line_2=\u679A\u4E3E\u58F0\u660E
@@ -166,19 +146,6 @@
 doclet.Help_annotation_type_line_1=\u6BCF\u4E2A\u6CE8\u91CA\u7C7B\u578B\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762, \u5176\u4E2D\u5305\u542B\u4EE5\u4E0B\u90E8\u5206:
 doclet.Help_annotation_type_line_2=\u6CE8\u91CA\u7C7B\u578B\u58F0\u660E
 doclet.Help_annotation_type_line_3=\u6CE8\u91CA\u7C7B\u578B\u8BF4\u660E
-doclet.Style_line_1=Javadoc \u6837\u5F0F\u8868
-doclet.Style_line_2=\u5728\u6B64\u5904\u5B9A\u4E49\u989C\u8272, \u5B57\u4F53\u548C\u5176\u4ED6\u6837\u5F0F\u5C5E\u6027\u4EE5\u8986\u76D6\u9ED8\u8BA4\u503C
-doclet.Style_line_3=\u9875\u9762\u80CC\u666F\u989C\u8272
-doclet.Style_Headings=\u6807\u9898
-doclet.Style_line_4=\u8868\u683C\u989C\u8272
-doclet.Style_line_5=\u6DF1\u7D2B\u8272
-doclet.Style_line_6=\u6DE1\u7D2B\u8272
-doclet.Style_line_7=\u767D\u8272
-doclet.Style_line_8=\u5DE6\u4FA7\u7684\u6846\u67B6\u5217\u8868\u4E2D\u4F7F\u7528\u7684\u5B57\u4F53
-doclet.Style_line_9=\u6846\u67B6\u4E2D\u5C0F\u53F7 sans-serif \u5B57\u4F53\u7684\u793A\u4F8B
-doclet.Style_line_10=\u5BFC\u822A\u680F\u5B57\u4F53\u548C\u989C\u8272
-doclet.Style_line_11=\u6DF1\u84DD\u8272
-doclet.Style_line_12=\u8868\u6807\u9898\u6837\u5F0F
 doclet.ClassUse_Packages.that.use.0=\u4F7F\u7528{0}\u7684\u7A0B\u5E8F\u5305
 doclet.ClassUse_Uses.of.0.in.1={1}\u4E2D{0}\u7684\u4F7F\u7528
 doclet.ClassUse_Classes.in.0.used.by.1={1}\u4F7F\u7528\u7684{0}\u4E2D\u7684\u7C7B
@@ -208,13 +175,11 @@
 doclet.Window_ClassUse_Header={0} {1}\u7684\u4F7F\u7528
 doclet.ClassUse_Title={0} {1}<br>\u7684\u4F7F\u7528
 doclet.navClassUse=\u4F7F\u7528
-doclet.link_option_twice=\u5916\u90E8 URL \u94FE\u63A5\u9009\u9879 (link \u6216 linkoffline) \u4F7F\u7528\u4E86\u4E24\u6B21\u3002
 doclet.Error_in_packagelist=\u4F7F\u7528 -group \u9009\u9879\u65F6\u51FA\u9519: {0} {1}
 doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0}
 doclet.Same_package_name_used=\u7A0B\u5E8F\u5305\u540D\u79F0\u5F62\u5F0F\u4F7F\u7528\u4E86\u4E24\u6B21: {0}
-doclet.Serialization.Excluded_Class=\u975E\u77AC\u6001\u5B57\u6BB5{1}\u4F7F\u7528\u4E86\u6392\u9664\u7684\u7C7B{0}\u3002
-doclet.Serialization.Nonexcluded_Class=\u975E\u77AC\u6001\u5B57\u6BB5{1}\u4F7F\u7528\u4E86\u9690\u85CF\u7684, \u672A\u5305\u542B\u7684\u7C7B{0}\u3002
-doclet.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n-d <directory>                    \u8F93\u51FA\u6587\u4EF6\u7684\u76EE\u6807\u76EE\u5F55\n-use                              \u521B\u5EFA\u7C7B\u548C\u7A0B\u5E8F\u5305\u7528\u6CD5\u9875\u9762\n-version                          \u5305\u542B @version \u6BB5\n-author                           \u5305\u542B @author \u6BB5\n-docfilessubdirs                  \u9012\u5F52\u590D\u5236\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\n-splitindex                       \u5C06\u7D22\u5F15\u5206\u4E3A\u6BCF\u4E2A\u5B57\u6BCD\u5BF9\u5E94\u4E00\u4E2A\u6587\u4EF6\n-windowtitle <text>               \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n-doctitle <html-code>             \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n-header <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n-footer <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n-top    <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n-bottom <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n-link <url>                       \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E <url> \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n-linkoffline <url> <url2>         \u5229\u7528\u4F4D\u4E8E <url2> \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E <url> \u7684\u6587\u6863\n-excludedocfilessubdir <name1>:..\u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n-group <name> <p1>:<p2>..\u5728\u6982\u89C8\u9875\u9762\u4E2D, \u5C06\u6307\u5B9A\u7684\u7A0B\u5E8F\u5305\u5206\u7EC4\n-nocomment                        \u4E0D\u751F\u6210\u8BF4\u660E\u548C\u6807\u8BB0, \u53EA\u751F\u6210\u58F0\u660E\u3002\n-nodeprecated                     \u4E0D\u5305\u542B @deprecated \u4FE1\u606F\n-noqualifier <name1>:<name2>:...\u8F93\u51FA\u4E2D\u4E0D\u5305\u62EC\u6307\u5B9A\u9650\u5B9A\u7B26\u7684\u5217\u8868\u3002\n-nosince                          \u4E0D\u5305\u542B @since \u4FE1\u606F\n-notimestamp                      \u4E0D\u5305\u542B\u9690\u85CF\u65F6\u95F4\u6233\n-nodeprecatedlist                 \u4E0D\u751F\u6210\u5DF2\u8FC7\u65F6\u7684\u5217\u8868\n-notree                           \u4E0D\u751F\u6210\u7C7B\u5206\u5C42\u7ED3\u6784\n-noindex                          \u4E0D\u751F\u6210\u7D22\u5F15\n-nohelp                           \u4E0D\u751F\u6210\u5E2E\u52A9\u94FE\u63A5\n-nonavbar                         \u4E0D\u751F\u6210\u5BFC\u822A\u680F\n-serialwarn                       \u751F\u6210\u6709\u5173 @serial \u6807\u8BB0\u7684\u8B66\u544A\n-tag <name>:<locations>:<header>  \u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0\n-taglet                           \u8981\u6CE8\u518C\u7684 Taglet \u7684\u5168\u9650\u5B9A\u540D\u79F0\n-tagletpath                       Taglet \u7684\u8DEF\u5F84\n-charset <charset>                \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n-helpfile <file>                  \u5305\u542B\u5E2E\u52A9\u94FE\u63A5\u6240\u94FE\u63A5\u5230\u7684\u6587\u4EF6\n-linksource                       \u4EE5 HTML \u683C\u5F0F\u751F\u6210\u6E90\u6587\u4EF6\n-sourcetab <tab length>           \u6307\u5B9A\u6E90\u4E2D\u6BCF\u4E2A\u5236\u8868\u7B26\u5360\u636E\u7684\u7A7A\u683C\u6570\n-keywords                         \u4F7F\u7A0B\u5E8F\u5305, \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u9644\u5E26 HTML \u5143\u6807\u8BB0\n-stylesheetfile <path>            \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n-docencoding <name>               \u8F93\u51FA\u7F16\u7801\u540D\u79F0
+doclet.exception_encountered=\u5904\u7406{1}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\n{0}
+doclet.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n-d <directory>                    \u8F93\u51FA\u6587\u4EF6\u7684\u76EE\u6807\u76EE\u5F55\n-use                              \u521B\u5EFA\u7C7B\u548C\u7A0B\u5E8F\u5305\u7528\u6CD5\u9875\u9762\n-version                          \u5305\u542B @version \u6BB5\n-author                           \u5305\u542B @author \u6BB5\n-docfilessubdirs                  \u9012\u5F52\u590D\u5236\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\n-splitindex                       \u5C06\u7D22\u5F15\u5206\u4E3A\u6BCF\u4E2A\u5B57\u6BCD\u5BF9\u5E94\u4E00\u4E2A\u6587\u4EF6\n-windowtitle <text>               \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n-doctitle <html-code>             \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n-header <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n-footer <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n-top    <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n-bottom <html-code>               \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n-link <url>                       \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E <url> \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n-linkoffline <url> <url2>         \u5229\u7528\u4F4D\u4E8E <url2> \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E <url> \u7684\u6587\u6863\n-excludedocfilessubdir <name1>:.. \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n-group <name> <p1>:<p2>..         \u5728\u6982\u89C8\u9875\u9762\u4E2D, \u5C06\u6307\u5B9A\u7684\u7A0B\u5E8F\u5305\u5206\u7EC4\n-nocomment                        \u4E0D\u751F\u6210\u8BF4\u660E\u548C\u6807\u8BB0, \u53EA\u751F\u6210\u58F0\u660E\u3002\n-nodeprecated                     \u4E0D\u5305\u542B @deprecated \u4FE1\u606F\n-noqualifier <name1>:<name2>:...  \u8F93\u51FA\u4E2D\u4E0D\u5305\u62EC\u9650\u5B9A\u7B26\u7684\u5217\u8868\u3002\n-nosince                          \u4E0D\u5305\u542B @since \u4FE1\u606F\n-notimestamp                      \u4E0D\u5305\u542B\u9690\u85CF\u65F6\u95F4\u6233\n-nodeprecatedlist                 \u4E0D\u751F\u6210\u5DF2\u8FC7\u65F6\u7684\u5217\u8868\n-notree                           \u4E0D\u751F\u6210\u7C7B\u5206\u5C42\u7ED3\u6784\n-noindex                          \u4E0D\u751F\u6210\u7D22\u5F15\n-nohelp                           \u4E0D\u751F\u6210\u5E2E\u52A9\u94FE\u63A5\n-nonavbar                         \u4E0D\u751F\u6210\u5BFC\u822A\u680F\n-serialwarn                       \u751F\u6210\u6709\u5173 @serial \u6807\u8BB0\u7684\u8B66\u544A\n-tag <name>:<locations>:<header>  \u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0\n-taglet                           \u8981\u6CE8\u518C\u7684 Taglet \u7684\u5168\u9650\u5B9A\u540D\u79F0\n-tagletpath                       Taglet \u7684\u8DEF\u5F84\n-Xdocrootparent <url>             \u5C06\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\u6240\u6709\u540E\u8DDF /.. \u7684 @docRoot \u66FF\u6362\u4E3A <url>\n-charset <charset>                \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n-helpfile <file>                  \u5305\u542B\u5E2E\u52A9\u94FE\u63A5\u6240\u94FE\u63A5\u5230\u7684\u6587\u4EF6\n-linksource                       \u4EE5 HTML \u683C\u5F0F\u751F\u6210\u6E90\u6587\u4EF6\n-sourcetab <tab length>           \u6307\u5B9A\u6E90\u4E2D\u6BCF\u4E2A\u5236\u8868\u7B26\u5360\u636E\u7684\u7A7A\u683C\u6570\n-keywords                         \u4F7F\u7A0B\u5E8F\u5305, \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u9644\u5E26 HTML \u5143\u6807\u8BB0\n-stylesheetfile <path>            \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n-docencoding <name>               \u8F93\u51FA\u7F16\u7801\u540D\u79F0
 
 
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Fri Apr 05 14:51:24 2013 -0700
@@ -56,7 +56,7 @@
     /**
      * Exception used to report a problem during setOptions.
      */
-    public class Fault extends Exception {
+    public static class Fault extends Exception {
         private static final long serialVersionUID = 0;
 
         Fault(String msg) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -116,9 +116,9 @@
       * @param contentTree the content tree to which the documentation will be added
       */
      public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws Exception {
-        contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") +
+         contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") +
                 " " + annotationTypeDoc.name());
-        Content annotationContentTree = writer.getAnnotationContentHeader();
+         Content annotationContentTree = writer.getAnnotationContentHeader();
          buildChildren(node, annotationContentTree);
          contentTree.addContent(annotationContentTree);
          writer.addFooter(contentTree);
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -11,6 +11,8 @@
 doclet.Class_0_extends_implements_serializable=Class {0} extends {1} implements Serializable
 doclet.Option_conflict=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u304C{1}\u3068\u77DB\u76FE\u3057\u307E\u3059
 doclet.Option_reuse=\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u518D\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
+doclet.Option_doclint_no_qualifiers=\u30A2\u30AF\u30BB\u30B9\u4FEE\u98FE\u5B50\u306F-Xdoclint\u306E\u5F15\u6570\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
+doclet.Option_doclint_invalid_arg=-Xdoclint\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059
 doclet.exception_encountered= {0}\u3092\u691C\u51FA\n\t\u30D5\u30A1\u30A4\u30EB\u306E\u4F5C\u6210\u4E2D: {1}
 doclet.perform_copy_exception_encountered= \u30B3\u30D4\u30FC\u5B9F\u884C\u4E2D\u306B{0}\u3092\n\u691C\u51FA\u3057\u307E\u3057\u305F\u3002
 doclet.File_not_found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
@@ -19,10 +21,8 @@
 doclet.Copying_File_0_To_File_1=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u30D5\u30A1\u30A4\u30EB{1}\u306B\u30B3\u30D4\u30FC\u4E2D...
 doclet.No_Public_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308Bpublic\u307E\u305F\u306Fprotected\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 doclet.Unable_to_create_directory_0=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
-doclet.destination_directory_not_found_0=\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 doclet.destination_directory_not_directory_0=\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 doclet.destination_directory_not_writable_0=\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u53EF\u80FD\u3067\u306F\u3042\u308A\u307E\u305B\u3093
-doclet.Error_creating_tmp_file=\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u4F7F\u7528\u3057\u3066\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002
 doclet.Encoding_not_supported=\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 doclet.Building_Tree=\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u30AF\u30E9\u30B9\u306E\u968E\u5C64\u30C4\u30EA\u30FC\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059...
 doclet.Building_Index=\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059...
@@ -72,7 +72,6 @@
 doclet.Enum_Constant_Summary=\u5217\u6319\u578B\u5B9A\u6570\u306E\u6982\u8981
 doclet.Constructor_Summary=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u6982\u8981
 doclet.Method_Summary=\u30E1\u30BD\u30C3\u30C9\u306E\u6982\u8981
-doclet.Factory_Method_Summary=static\u30D5\u30A1\u30AF\u30C8\u30EA\u30FB\u30E1\u30BD\u30C3\u30C9\u306E\u6982\u8981
 doclet.Interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.Enums=\u5217\u6319\u578B
 doclet.AnnotationTypes=\u6CE8\u91C8\u578B
@@ -86,15 +85,14 @@
 doclet.All_Implemented_Interfaces=\u3059\u3079\u3066\u306E\u5B9F\u88C5\u3055\u308C\u305F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9:
 doclet.All_classes_and_interfaces=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F)
 doclet.Package_class_and_interface_descriptions=\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u8AAC\u660E
-doclet.Members=\u30E1\u30F3\u30D0\u30FC
 doclet.Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.Class=\u30AF\u30E9\u30B9
 doclet.AnnotationType=\u6CE8\u91C8\u578B
 doclet.annotationtype=\u6CE8\u91C8\u578B
 doclet.annotationtypes=\u6CE8\u91C8\u578B
 doclet.Enum=\u5217\u6319\u578B
-doclet.enum=\u5217\u6319
-doclet.enums=\u5217\u6319
+doclet.enum=\u5217\u6319\u578B
+doclet.enums=\u5217\u6319\u578B
 doclet.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.class=\u30AF\u30E9\u30B9
@@ -105,26 +103,20 @@
 doclet.Exception=\u4F8B\u5916
 doclet.exception=\u4F8B\u5916
 doclet.exceptions=\u4F8B\u5916
-doclet.extended_by=\u4E0A\u4F4D\u3092\u62E1\u5F35
-doclet.extends=extends
 doclet.Package_private=(package private)
-doclet.implements=implementsdoclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
 doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.Nested_Classes_Interface_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.Methods_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9
 doclet.Methods_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9
 doclet.Fields_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9
 doclet.Fields_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9
-doclet.Serializable=\u76F4\u5217\u5316\u53EF\u80FD
-doclet.Externalizable=\u5916\u90E8\u5316\u53EF\u80FD
 doclet.Annotation_Type_Member_Detail=\u8981\u7D20\u306E\u8A73\u7D30
 doclet.Enum_Constant_Detail=\u5217\u6319\u578B\u5B9A\u6570\u306E\u8A73\u7D30
 doclet.Constants_Summary=\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u5024
 doclet.Field_Detail=\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u8A73\u7D30
 doclet.Method_Detail=\u30E1\u30BD\u30C3\u30C9\u306E\u8A73\u7D30
 doclet.Constructor_Detail=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u8A73\u7D30
-doclet.Deprecated=\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-doclet.Deprecated_class=\u3053\u306E\u30AF\u30E9\u30B9\u306F\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
+doclet.Deprecated=\u975E\u63A8\u5968\u3067\u3059\u3002
 doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
 doclet.value_tag_invalid_reference={0}(@value\u30BF\u30B0\u306B\u3088\u308A\u53C2\u7167\u3055\u308C\u3066\u3044\u308B)\u306F\u4E0D\u660E\u306A\u53C2\u7167\u3067\u3059\u3002
 doclet.value_tag_invalid_constant=@value\u30BF\u30B0({0}\u3092\u53C2\u7167\u3057\u3066\u3044\u308B)\u306F\u5B9A\u6570\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
@@ -144,7 +136,7 @@
 doclet.annotation_type_required_members=\u5FC5\u9808\u8981\u7D20
 doclet.Annotation_Type_Required_Members=\u5FC5\u9808\u8981\u7D20
 doclet.enum_constants=\u5217\u6319\u578B\u5B9A\u6570
-doclet.Enum_Constants=\u5217\u6319\u5B9A\u6570
+doclet.Enum_Constants=\u5217\u6319\u578B\u5B9A\u6570
 doclet.nested_classes=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9
 doclet.Nested_Classes=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9
 doclet.subclasses=\u30B5\u30D6\u30AF\u30E9\u30B9
@@ -167,4 +159,4 @@
 #Documentation for Enums
 doclet.enum_values_doc=\n\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u914D\u5217\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u8FD4\u3057\u307E\u3059\u3002\n\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u6B21\u306E\u3088\u3046\u306B\u3057\u3066\u5B9A\u6570\u3092\u53CD\u5FA9\u3059\u308B\u305F\u3081\u306B\n\u4F7F\u7528\u3067\u304D\u307E\u3059:\n<pre>\nfor({0} c: {0}.values())\n&nbsp; System.out.println(c);\n</pre>\n@return\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\n\u542B\u3080\u914D\u5217
 
-doclet.enum_valueof_doc=\n\u6307\u5B9A\u3057\u305F\u540D\u524D\u3092\u6301\u3064\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u6587\u5B57\u5217\u306F\u3001\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u5BA3\u8A00\u3059\u308B\u306E\u306B\u4F7F\u7528\u3057\u305F\u8B58\u5225\u5B50\u3068\u53B3\u5BC6\u306B\n\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n(\u4F59\u5206\u306A\u7A7A\u767D\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002)\n\n@param name\u8FD4\u3055\u308C\u308B\u5217\u6319\u578B\u5B9A\u6570\u306E\u540D\u524D\n@return\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u3092\u6301\u3064\u5217\u6319\u578B\u5B9A\u6570\n@throws IllegalArgumentException\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u3092\u6301\u3064\u5B9A\u6570\u3092\n\u3053\u306E\u5217\u6319\u578B\u304C\u6301\u3063\u3066\u3044\u306A\u3044\u5834\u5408\n@throws NullPointerException\u5F15\u6570\u304Cnull\u306E\u5834\u5408
+doclet.enum_valueof_doc=\n\u6307\u5B9A\u3057\u305F\u540D\u524D\u3092\u6301\u3064\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u6587\u5B57\u5217\u306F\u3001\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u5BA3\u8A00\u3059\u308B\u306E\u306B\u4F7F\u7528\u3057\u305F\u8B58\u5225\u5B50\u3068<i>\u6B63\u78BA\u306B</i>\n\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n(\u4F59\u5206\u306A\u7A7A\u767D\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002)\n\n@param name\u8FD4\u3055\u308C\u308B\u5217\u6319\u578B\u5B9A\u6570\u306E\u540D\u524D\n@return\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u3092\u6301\u3064\u5217\u6319\u578B\u5B9A\u6570\n@throws IllegalArgumentException\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u3092\u6301\u3064\u5B9A\u6570\u3092\n\u3053\u306E\u5217\u6319\u578B\u304C\u6301\u3063\u3066\u3044\u306A\u3044\u5834\u5408\n@throws NullPointerException\u5F15\u6570\u304Cnull\u306E\u5834\u5408
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -11,6 +11,8 @@
 doclet.Class_0_extends_implements_serializable=\u7C7B{0}\u6269\u5C55{1}\u5B9E\u73B0\u53EF\u5E8F\u5217\u5316
 doclet.Option_conflict=\u9009\u9879{0}\u4E0E{1}\u51B2\u7A81
 doclet.Option_reuse=\u91CD\u590D\u4F7F\u7528\u7684\u9009\u9879: {0}
+doclet.Option_doclint_no_qualifiers=-Xdoclint \u53C2\u6570\u4E0D\u5141\u8BB8\u4F7F\u7528\u8BBF\u95EE\u9650\u5B9A\u7B26
+doclet.Option_doclint_invalid_arg=-Xdoclint \u9009\u9879\u7684\u53C2\u6570\u65E0\u6548
 doclet.exception_encountered= \u5C1D\u8BD5\u521B\u5EFA\u6587\u4EF6{1}\u65F6 \n\t\u9047\u5230{0}
 doclet.perform_copy_exception_encountered= \u6267\u884C\u590D\u5236\u65F6 \n\u9047\u5230{0}\u3002
 doclet.File_not_found=\u627E\u4E0D\u5230\u6587\u4EF6: {0}
@@ -19,10 +21,8 @@
 doclet.Copying_File_0_To_File_1=\u6B63\u5728\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230\u6587\u4EF6{1}...
 doclet.No_Public_Classes_To_Document=\u627E\u4E0D\u5230\u53EF\u4EE5\u6587\u6863\u5316\u7684\u516C\u5171\u6216\u53D7\u4FDD\u62A4\u7684\u7C7B\u3002
 doclet.Unable_to_create_directory_0=\u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55 {0}
-doclet.destination_directory_not_found_0=\u627E\u4E0D\u5230\u76EE\u6807\u76EE\u5F55 {0}
 doclet.destination_directory_not_directory_0=\u76EE\u6807\u76EE\u5F55\u4E0D\u662F\u76EE\u5F55 {0}
 doclet.destination_directory_not_writable_0=\u76EE\u6807\u76EE\u5F55\u4E0D\u53EF\u5199\u5165 {0}
-doclet.Error_creating_tmp_file=\u4F7F\u7528\u9ED8\u8BA4\u5E73\u53F0\u7F16\u7801\u521B\u5EFA\u4E34\u65F6\u6587\u4EF6\u65F6\u51FA\u9519\u3002
 doclet.Encoding_not_supported=\u4E0D\u652F\u6301\u7F16\u7801: {0}
 doclet.Building_Tree=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7A0B\u5E8F\u5305\u548C\u7C7B\u7684\u6811...
 doclet.Building_Index=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7A0B\u5E8F\u5305\u548C\u7C7B\u7684\u7D22\u5F15...
@@ -72,7 +72,6 @@
 doclet.Enum_Constant_Summary=\u679A\u4E3E\u5E38\u91CF\u6982\u8981
 doclet.Constructor_Summary=\u6784\u9020\u5668\u6982\u8981
 doclet.Method_Summary=\u65B9\u6CD5\u6982\u8981
-doclet.Factory_Method_Summary=\u9759\u6001\u5DE5\u5382\u65B9\u6CD5\u6982\u8981
 doclet.Interfaces=\u63A5\u53E3
 doclet.Enums=\u679A\u4E3E
 doclet.AnnotationTypes=\u6CE8\u91CA\u7C7B\u578B
@@ -86,7 +85,6 @@
 doclet.All_Implemented_Interfaces=\u6240\u6709\u5DF2\u5B9E\u73B0\u7684\u63A5\u53E3:
 doclet.All_classes_and_interfaces=\u6240\u6709\u7C7B\u548C\u63A5\u53E3 (\u9664\u4E86\u975E\u9759\u6001\u5D4C\u5957\u7C7B\u578B)
 doclet.Package_class_and_interface_descriptions=\u7A0B\u5E8F\u5305, \u7C7B\u548C\u63A5\u53E3\u8BF4\u660E
-doclet.Members=\u6210\u5458
 doclet.Interface=\u63A5\u53E3
 doclet.Class=\u7C7B
 doclet.AnnotationType=\u6CE8\u91CA\u7C7B\u578B
@@ -105,18 +103,13 @@
 doclet.Exception=\u5F02\u5E38\u9519\u8BEF
 doclet.exception=\u5F02\u5E38\u9519\u8BEF
 doclet.exceptions=\u5F02\u5E38\u9519\u8BEF
-doclet.extended_by=\u6269\u5C55\u8005
-doclet.extends=\u6269\u5C55
 doclet.Package_private=(\u4E13\u7528\u7A0B\u5E8F\u5305)
-doclet.implements=implementsdoclet.Same_package_name_used=\u7A0B\u5E8F\u5305\u540D\u79F0\u5F62\u5F0F\u4F7F\u7528\u4E86\u4E24\u6B21: {0}
 doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3
 doclet.Nested_Classes_Interface_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3
 doclet.Methods_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u65B9\u6CD5
 doclet.Methods_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u65B9\u6CD5
 doclet.Fields_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5B57\u6BB5
 doclet.Fields_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5B57\u6BB5
-doclet.Serializable=\u53EF\u5E8F\u5217\u5316
-doclet.Externalizable=\u53EF\u5916\u90E8\u5316
 doclet.Annotation_Type_Member_Detail=\u5143\u7D20\u8BE6\u7EC6\u8D44\u6599
 doclet.Enum_Constant_Detail=\u679A\u4E3E\u5E38\u91CF\u8BE6\u7EC6\u8D44\u6599
 doclet.Constants_Summary=\u5E38\u91CF\u5B57\u6BB5\u503C
@@ -124,7 +117,6 @@
 doclet.Method_Detail=\u65B9\u6CD5\u8BE6\u7EC6\u8D44\u6599
 doclet.Constructor_Detail=\u6784\u9020\u5668\u8BE6\u7EC6\u8D44\u6599
 doclet.Deprecated=\u5DF2\u8FC7\u65F6\u3002
-doclet.Deprecated_class=\u8BE5\u7C7B\u5DF2\u8FC7\u65F6\u3002
 doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0}
 doclet.value_tag_invalid_reference={0} (\u7531 @value \u6807\u8BB0\u5F15\u7528) \u4E3A\u672A\u77E5\u5F15\u7528\u3002
 doclet.value_tag_invalid_constant=@value \u6807\u8BB0 (\u5F15\u7528{0}) \u53EA\u80FD\u5728\u5E38\u91CF\u4E2D\u4F7F\u7528\u3002
@@ -167,4 +159,4 @@
 #Documentation for Enums
 doclet.enum_values_doc=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n<pre>\nfor ({0} c : {0}.values())\n&nbsp;   System.out.println(c);\n</pre>\n@\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4
 
-doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26<i>\u5B8C\u5168</i>\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@return \u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@throws \u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@throws \u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException
+doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26<i>\u5B8C\u5168</i>\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@\u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@\u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException
--- a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,20 +25,18 @@
 
 package com.sun.tools.doclint;
 
-import com.sun.source.doctree.LiteralTree;
-import java.util.regex.Matcher;
-import com.sun.source.doctree.LinkTree;
+import java.io.IOException;
+import java.io.StringWriter;
 import java.net.URI;
-import java.util.regex.Pattern;
-import java.io.IOException;
-import com.sun.tools.javac.tree.DocPretty;
-import java.io.StringWriter;
+import java.net.URISyntaxException;
 import java.util.Deque;
 import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
@@ -52,12 +50,15 @@
 import com.sun.source.doctree.AttributeTree;
 import com.sun.source.doctree.AuthorTree;
 import com.sun.source.doctree.DocCommentTree;
+import com.sun.source.doctree.DocRootTree;
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.EndElementTree;
 import com.sun.source.doctree.EntityTree;
 import com.sun.source.doctree.ErroneousTree;
 import com.sun.source.doctree.IdentifierTree;
 import com.sun.source.doctree.InheritDocTree;
+import com.sun.source.doctree.LinkTree;
+import com.sun.source.doctree.LiteralTree;
 import com.sun.source.doctree.ParamTree;
 import com.sun.source.doctree.ReferenceTree;
 import com.sun.source.doctree.ReturnTree;
@@ -67,11 +68,12 @@
 import com.sun.source.doctree.StartElementTree;
 import com.sun.source.doctree.TextTree;
 import com.sun.source.doctree.ThrowsTree;
+import com.sun.source.doctree.ValueTree;
 import com.sun.source.doctree.VersionTree;
 import com.sun.source.util.DocTreeScanner;
 import com.sun.source.util.TreePath;
 import com.sun.tools.doclint.HtmlTag.AttrKind;
-import java.net.URISyntaxException;
+import com.sun.tools.javac.tree.DocPretty;
 import static com.sun.tools.doclint.Messages.Group.*;
 
 
@@ -95,6 +97,7 @@
     public enum Flag {
         TABLE_HAS_CAPTION,
         HAS_ELEMENT,
+        HAS_INLINE_TAG,
         HAS_TEXT,
         REPORTED_BAD_INLINE
     }
@@ -418,7 +421,8 @@
                     }
                     if (t.flags.contains(HtmlTag.Flag.EXPECT_CONTENT)
                             && !top.flags.contains(Flag.HAS_TEXT)
-                            && !top.flags.contains(Flag.HAS_ELEMENT)) {
+                            && !top.flags.contains(Flag.HAS_ELEMENT)
+                            && !top.flags.contains(Flag.HAS_INLINE_TAG)) {
                         env.messages.warning(HTML, tree, "dc.tag.empty", treeName);
                     }
                     tagStack.pop();
@@ -571,7 +575,14 @@
     }
 
     @Override
+    public Void visitDocRoot(DocRootTree tree, Void ignore) {
+        markEnclosingTag(Flag.HAS_INLINE_TAG);
+        return super.visitDocRoot(tree, ignore);
+    }
+
+    @Override
     public Void visitInheritDoc(InheritDocTree tree, Void ignore) {
+        markEnclosingTag(Flag.HAS_INLINE_TAG);
         // TODO: verify on overridden method
         foundInheritDoc = true;
         return super.visitInheritDoc(tree, ignore);
@@ -579,6 +590,7 @@
 
     @Override
     public Void visitLink(LinkTree tree, Void ignore) {
+        markEnclosingTag(Flag.HAS_INLINE_TAG);
         // simulate inline context on tag stack
         HtmlTag t = (tree.getKind() == DocTree.Kind.LINK)
                 ? HtmlTag.CODE : HtmlTag.SPAN;
@@ -592,6 +604,7 @@
 
     @Override
     public Void visitLiteral(LiteralTree tree, Void ignore) {
+        markEnclosingTag(Flag.HAS_INLINE_TAG);
         if (tree.getKind() == DocTree.Kind.CODE) {
             for (TagStackItem tsi: tagStack) {
                 if (tsi.tag == HtmlTag.CODE) {
@@ -746,6 +759,12 @@
     }
 
     @Override
+    public Void visitValue(ValueTree tree, Void ignore) {
+        markEnclosingTag(Flag.HAS_INLINE_TAG);
+        return super.visitValue(tree, ignore);
+    }
+
+    @Override
     public Void visitVersion(VersionTree tree, Void ignore) {
         warnIfEmpty(tree, tree.getBody());
         return super.visitVersion(tree, ignore);
--- a/langtools/src/share/classes/com/sun/tools/javac/Server.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2005, 2012, 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.
- */
-
-package com.sun.tools.javac;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.logging.Logger;
-import javax.tools.*;
-
-/**
- * Java Compiler Server.  Can be used to speed up a set of (small)
- * compilation tasks by caching jar files between compilations.
- *
- * <p><b>This is NOT part of any supported API.
- * If you write code that depends on this, you do so at your own
- * risk.  This code and its internal interfaces are subject to change
- * or deletion without notice.</b></p>
- *
- * @author Peter von der Ah&eacute;
- * @since 1.6
- */
-@jdk.Supported(false)
-class Server implements Runnable {
-    private final BufferedReader in;
-    private final OutputStream out;
-    private final boolean isSocket;
-    private static final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
-    private static final Logger logger = Logger.getLogger("com.sun.tools.javac");
-    static class CwdFileManager extends ForwardingJavaFileManager<JavaFileManager> {
-        String cwd;
-        CwdFileManager(JavaFileManager fileManager) {
-            super(fileManager);
-        }
-        String getAbsoluteName(String name) {
-            if (new File(name).isAbsolute()) {
-                return name;
-            } else {
-                return new File(cwd,name).getPath();
-            }
-        }
-//      public JavaFileObject getFileForInput(String name)
-//          throws IOException
-//      {
-//          return super.getFileForInput(getAbsoluteName(name));
-//      }
-    }
-    // static CwdFileManager fm = new CwdFileManager(tool.getStandardFileManager());
-    static final StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
-    static {
-        // Use the same file manager for all compilations.  This will
-        // cache jar files in the standard file manager.  Use
-        // tool.getStandardFileManager().close() to release.
-        // FIXME tool.setFileManager(fm);
-        logger.setLevel(java.util.logging.Level.SEVERE);
-    }
-    private Server(BufferedReader in, OutputStream out, boolean isSocket) {
-        this.in = in;
-        this.out = out;
-        this.isSocket = isSocket;
-    }
-    private Server(BufferedReader in, OutputStream out) {
-        this(in, out, false);
-    }
-    private Server(Socket socket) throws IOException, UnsupportedEncodingException {
-        this(new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8")),
-             socket.getOutputStream(),
-             true);
-    }
-    public void run() {
-        List<String> args = new ArrayList<String>();
-        int res = -1;
-        try {
-            String line = null;
-            try {
-                line = in.readLine();
-            } catch (IOException e) {
-                System.err.println(e.getLocalizedMessage());
-                System.exit(0);
-                line = null;
-            }
-            // fm.cwd=null;
-            String cwd = null;
-            while (line != null) {
-                if (line.startsWith("PWD:")) {
-                    cwd = line.substring(4);
-                } else if (line.equals("END")) {
-                    break;
-                } else if (!"-XDstdout".equals(line)) {
-                    args.add(line);
-                }
-                try {
-                    line = in.readLine();
-                } catch (IOException e) {
-                    System.err.println(e.getLocalizedMessage());
-                    System.exit(0);
-                    line = null;
-                }
-            }
-            Iterable<File> path = cwd == null ? null : Arrays.<File>asList(new File(cwd));
-            // try { in.close(); } catch (IOException e) {}
-            long msec = System.currentTimeMillis();
-            try {
-                synchronized (tool) {
-                    for (StandardLocation location : StandardLocation.values())
-                        fm.setLocation(location, path);
-                    res = compile(out, fm, args);
-                    // FIXME res = tool.run((InputStream)null, null, out, args.toArray(new String[args.size()]));
-                }
-            } catch (Throwable ex) {
-                logger.log(java.util.logging.Level.SEVERE, args.toString(), ex);
-                PrintWriter p = new PrintWriter(out, true);
-                ex.printStackTrace(p);
-                p.flush();
-            }
-            if (res >= 3) {
-                logger.severe(String.format("problem: %s", args));
-            } else {
-                logger.info(String.format("success: %s", args));
-            }
-            // res = compile(args.toArray(new String[args.size()]), out);
-            msec -= System.currentTimeMillis();
-            logger.info(String.format("Real time: %sms", -msec));
-        } finally {
-            if (!isSocket) {
-                try { in.close(); } catch (IOException e) {}
-            }
-            try {
-                out.write(String.format("EXIT: %s%n", res).getBytes());
-            } catch (IOException ex) {
-                logger.log(java.util.logging.Level.SEVERE, args.toString(), ex);
-            }
-            try {
-                out.flush();
-                out.close();
-            } catch (IOException ex) {
-                logger.log(java.util.logging.Level.SEVERE, args.toString(), ex);
-            }
-            logger.info(String.format("EXIT: %s", res));
-        }
-    }
-    public static void main(String... args) throws FileNotFoundException {
-        if (args.length == 2) {
-            for (;;) {
-                throw new UnsupportedOperationException("TODO");
-//              BufferedReader in = new BufferedReader(new FileReader(args[0]));
-//              PrintWriter out = new PrintWriter(args[1]);
-//              new Server(in, out).run();
-//              System.out.flush();
-//              System.err.flush();
-            }
-        } else {
-            ExecutorService pool = Executors.newCachedThreadPool();
-            try
-                {
-                ServerSocket socket = new ServerSocket(0xcafe, -1, null);
-                for (;;) {
-                    pool.execute(new Server(socket.accept()));
-                }
-            }
-            catch (IOException e) {
-                System.err.format("Error: %s%n", e.getLocalizedMessage());
-                pool.shutdown();
-            }
-        }
-    }
-
-    private int compile(OutputStream out, StandardJavaFileManager fm, List<String> args) {
-        // FIXME parse args and use getTask
-        // System.err.println("Running " + args);
-        return tool.run(null, null, out, args.toArray(new String[args.size()]));
-    }
-}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Fri Apr 05 14:51:24 2013 -0700
@@ -311,9 +311,9 @@
             }
             if (args.head.unannotatedType().getKind() == TypeKind.ARRAY) {
                 buf.append(visit(((ArrayType) args.head.unannotatedType()).elemtype, locale));
-                if (args.head.getAnnotations().nonEmpty()) {
+                if (args.head.getAnnotationMirrors().nonEmpty()) {
                     buf.append(' ');
-                    buf.append(args.head.getAnnotations());
+                    buf.append(args.head.getAnnotationMirrors());
                     buf.append(' ');
                 }
                 buf.append("...");
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Fri Apr 05 14:51:24 2013 -0700
@@ -483,12 +483,12 @@
      */
     @Deprecated
     public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A> annoType) {
-        return JavacElements.getAnnotation(this, annoType);
+        return JavacAnnoConstructs.getAnnotation(this, annoType);
     }
 
     // This method is part of the javax.lang.model API, do not use this in javac code.
     public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(Class<A> annoType) {
-        return JavacElements.getAnnotations(this, annoType);
+        return JavacAnnoConstructs.getAnnotations(this, annoType);
     }
 
     // TODO: getEnclosedElements should return a javac List, fix in FilteredMemberList
@@ -935,11 +935,12 @@
         }
 
         /**
-         * @deprecated this method should never be used by javac internally.
+         * Since this method works in terms of the runtime representation
+         * of annotations, it should never be used by javac internally.
          */
-        @Override @Deprecated
+        @Override
         public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A> annoType) {
-            return JavacElements.getAnnotation(this, annoType);
+            return JavacAnnoConstructs.getAnnotation(this, annoType);
         }
 
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
@@ -1444,6 +1445,10 @@
             return v.visitMethodSymbol(this, p);
         }
 
+        public Type getReceiverType() {
+            return asType().getReceiverType();
+        }
+
         public Type getReturnType() {
             return asType().getReturnType();
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,6 +25,9 @@
 
 package com.sun.tools.javac.code;
 
+import com.sun.tools.javac.model.JavacAnnoConstructs;
+import com.sun.tools.javac.model.JavacTypes;
+import java.lang.annotation.Annotation;
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.EnumSet;
@@ -246,6 +249,10 @@
         return this;
     }
 
+    public boolean isAnnotated() {
+        return false;
+    }
+
     /**
      * If this is an annotated type, return the underlying type.
      * Otherwise, return the type itself.
@@ -254,6 +261,23 @@
         return this;
     }
 
+    @Override
+    public List<? extends Attribute.TypeCompound> getAnnotationMirrors() {
+        return List.nil();
+    }
+
+    @Override
+    public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+        return null;
+    }
+
+    @Override
+    public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {
+        @SuppressWarnings("unchecked")
+        A[] tmp = (A[]) java.lang.reflect.Array.newInstance(annotationType, 0);
+        return tmp;
+    }
+
     /** Return the base types of a list of types.
      */
     public static List<Type> baseTypes(List<Type> ts) {
@@ -350,8 +374,8 @@
         }
         if (args.head.unannotatedType().tag == ARRAY) {
             buf.append(((ArrayType)args.head.unannotatedType()).elemtype);
-            if (args.head.getAnnotations().nonEmpty()) {
-                buf.append(args.head.getAnnotations());
+            if (args.head.getAnnotationMirrors().nonEmpty()) {
+                buf.append(args.head.getAnnotationMirrors());
             }
             buf.append("...");
         } else {
@@ -362,7 +386,6 @@
 
     /** Access methods.
      */
-    public List<? extends AnnotationMirror> getAnnotations() { return List.nil(); }
     public List<Type>        getTypeArguments()  { return List.nil(); }
     public Type              getEnclosingType()  { return null; }
     public List<Type>        getParameterTypes() { return List.nil(); }
@@ -1539,7 +1562,12 @@
     }
 
     public static class AnnotatedType extends Type
-            implements javax.lang.model.type.AnnotatedType {
+            implements
+                javax.lang.model.type.ArrayType,
+                javax.lang.model.type.DeclaredType,
+                javax.lang.model.type.PrimitiveType,
+                javax.lang.model.type.TypeVariable,
+                javax.lang.model.type.WildcardType {
         /** The type annotations on this type.
          */
         public List<Attribute.TypeCompound> typeAnnotations;
@@ -1552,7 +1580,7 @@
             super(underlyingType.tag, underlyingType.tsym);
             this.typeAnnotations = List.nil();
             this.underlyingType = underlyingType;
-            Assert.check(underlyingType.getKind() != TypeKind.ANNOTATED,
+            Assert.check(!underlyingType.isAnnotated(),
                     "Can't annotate already annotated type: " + underlyingType);
         }
 
@@ -1561,24 +1589,34 @@
             super(underlyingType.tag, underlyingType.tsym);
             this.typeAnnotations = typeAnnotations;
             this.underlyingType = underlyingType;
-            Assert.check(underlyingType.getKind() != TypeKind.ANNOTATED,
+            Assert.check(!underlyingType.isAnnotated(),
                     "Can't annotate already annotated type: " + underlyingType +
                     "; adding: " + typeAnnotations);
         }
 
         @Override
-        public TypeKind getKind() {
-            return TypeKind.ANNOTATED;
+        public boolean isAnnotated() {
+            return true;
         }
 
         @Override
-        public List<? extends AnnotationMirror> getAnnotations() {
+        public List<? extends Attribute.TypeCompound> getAnnotationMirrors() {
             return typeAnnotations;
         }
 
         @Override
-        public TypeMirror getUnderlyingType() {
-            return underlyingType;
+        public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+            return JavacAnnoConstructs.getAnnotation(this, annotationType);
+        }
+
+        @Override
+        public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {
+            return JavacAnnoConstructs.getAnnotationsByType(this, annotationType);
+        }
+
+        @Override
+        public TypeKind getKind() {
+            return underlyingType.getKind();
         }
 
         @Override
@@ -1593,7 +1631,7 @@
 
         @Override
         public <R, P> R accept(TypeVisitor<R, P> v, P p) {
-            return v.visitAnnotated(this, p);
+            return underlyingType.accept(v, p);
         }
 
         @Override
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Fri Apr 05 14:51:24 2013 -0700
@@ -233,7 +233,7 @@
                 Type.ArrayType arType;
                 {
                     Type touse = type;
-                    if (type.getKind() == TypeKind.ANNOTATED) {
+                    if (type.isAnnotated()) {
                         Type.AnnotatedType atype = (Type.AnnotatedType)type;
                         toreturn = new Type.AnnotatedType(atype.underlyingType);
                         ((Type.AnnotatedType)toreturn).typeAnnotations = atype.typeAnnotations;
@@ -252,7 +252,7 @@
                 ListBuffer<TypePathEntry> depth = ListBuffer.lb();
                 depth = depth.append(TypePathEntry.ARRAY);
                 while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
-                    if (arType.elemtype.getKind() == TypeKind.ANNOTATED) {
+                    if (arType.elemtype.isAnnotated()) {
                         Type.AnnotatedType aelemtype = (Type.AnnotatedType) arType.elemtype;
                         Type.AnnotatedType newAT = new Type.AnnotatedType(aelemtype.underlyingType);
                         tomodify.elemtype = newAT;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1178,6 +1178,17 @@
             protected boolean containsTypes(List<Type> ts1, List<Type> ts2) {
                 return isSameTypes(ts1, ts2, true);
             }
+
+            @Override
+            public Boolean visitWildcardType(WildcardType t, Type s) {
+                if (!s.hasTag(WILDCARD)) {
+                    return false;
+                } else {
+                    WildcardType t2 = (WildcardType)s;
+                    return t.kind == t2.kind &&
+                            isSameType(t.type, t2.type, true);
+                }
+            }
         };
     // </editor-fold>
 
@@ -1418,23 +1429,10 @@
                     }
                 }
 
-                if (t.isCompound()) {
-                    Warner oldWarner = warnStack.head;
-                    warnStack.head = noWarnings;
-                    if (!visit(supertype(t), s))
-                        return false;
-                    for (Type intf : interfaces(t)) {
-                        if (!visit(intf, s))
-                            return false;
-                    }
-                    if (warnStack.head.hasLint(LintCategory.UNCHECKED))
-                        oldWarner.warn(LintCategory.UNCHECKED);
-                    return true;
-                }
-
-                if (s.isCompound()) {
-                    // call recursively to reuse the above code
-                    return visitClassType((ClassType)s, t);
+                if (t.isCompound() || s.isCompound()) {
+                    return !t.isCompound() ?
+                            visitIntersectionType((IntersectionClassType)s, t, true) :
+                            visitIntersectionType((IntersectionClassType)t, s, false);
                 }
 
                 if (s.tag == CLASS || s.tag == ARRAY) {
@@ -1512,6 +1510,18 @@
                 return false;
             }
 
+            boolean visitIntersectionType(IntersectionClassType ict, Type s, boolean reverse) {
+                Warner warn = noWarnings;
+                for (Type c : ict.getComponents()) {
+                    warn.clear();
+                    if (reverse ? !isCastable(s, c, warn) : !isCastable(c, s, warn))
+                        return false;
+                }
+                if (warn.hasLint(LintCategory.UNCHECKED))
+                    warnStack.head.warn(LintCategory.UNCHECKED);
+                return true;
+            }
+
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
                 switch (s.tag) {
@@ -2091,7 +2101,7 @@
             @Override
             public Type visitAnnotatedType(AnnotatedType t, Boolean recurse) {
                 Type erased = erasure(t.underlyingType, recurse);
-                if (erased.getKind() == TypeKind.ANNOTATED) {
+                if (erased.isAnnotated()) {
                     // This can only happen when the underlying type is a
                     // type variable and the upper bound of it is annotated.
                     // The annotation on the type variable overrides the one
@@ -3889,11 +3899,18 @@
     }
 
     private boolean giveWarning(Type from, Type to) {
-        Type subFrom = asSub(from, to.tsym);
-        return to.isParameterized() &&
-                (!(isUnbounded(to) ||
-                isSubtype(from, to) ||
-                ((subFrom != null) && containsType(to.allparams(), subFrom.allparams()))));
+        List<Type> bounds = to.isCompound() ?
+                ((IntersectionClassType)to).getComponents() : List.of(to);
+        for (Type b : bounds) {
+            Type subFrom = asSub(from, b.tsym);
+            if (b.isParameterized() &&
+                    (!(isUnbounded(b) ||
+                    isSubtype(from, b) ||
+                    ((subFrom != null) && containsType(b.allparams(), subFrom.allparams()))))) {
+                return true;
+            }
+        }
+        return false;
     }
 
     private List<Type> superClosure(Type t, Type s) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Apr 05 14:51:24 2013 -0700
@@ -3362,7 +3362,7 @@
                         Type normOuter = site;
                         if (normOuter.hasTag(CLASS)) {
                             normOuter = types.asEnclosingSuper(site, ownOuter.tsym);
-                            if (site.getKind() == TypeKind.ANNOTATED) {
+                            if (site.isAnnotated()) {
                                 // Propagate any type annotations.
                                 // TODO: should asEnclosingSuper do this?
                                 // Note that the type annotations in site will be updated
@@ -4009,8 +4009,7 @@
                 // Enums may not be extended by source-level classes
                 if (st.tsym != null &&
                     ((st.tsym.flags_field & Flags.ENUM) != 0) &&
-                    ((c.flags_field & (Flags.ENUM | Flags.COMPOUND)) == 0) &&
-                    !target.compilerBootstrap(c)) {
+                    ((c.flags_field & (Flags.ENUM | Flags.COMPOUND)) == 0)) {
                     log.error(env.tree.pos(), "enum.types.not.extensible");
                 }
                 attribClassBody(env, c);
@@ -4279,7 +4278,7 @@
             validateAnnotatedType(errtree, type);
             if (type.tsym != null &&
                     type.tsym.isStatic() &&
-                    type.getAnnotations().nonEmpty()) {
+                    type.getAnnotationMirrors().nonEmpty()) {
                     // Enclosing static classes cannot have type annotations.
                 log.error(errtree.pos(), "cant.annotate.static.class");
             }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Apr 05 14:51:24 2013 -0700
@@ -2779,25 +2779,17 @@
     }
 
     private void validateTarget(Symbol container, Symbol contained, DiagnosticPosition pos) {
-        Attribute.Array containedTarget = getAttributeTargetAttribute(contained);
-
-        // If contained has no Target, we are done
-        if (containedTarget == null) {
-            return;
-        }
-
-        // If contained has Target m1, container must have a Target
-        // annotation, m2, and m2 must be a subset of m1. (This is
-        // trivially true if contained has no target as per above).
-
-        // contained has target, but container has not, error
+        // The set of targets the container is applicable to must be a subset
+        // (with respect to annotation target semantics) of the set of targets
+        // the contained is applicable to. The target sets may be implicit or
+        // explicit.
+
+        Set<Name> containerTargets;
         Attribute.Array containerTarget = getAttributeTargetAttribute(container);
         if (containerTarget == null) {
-            log.error(pos, "invalid.repeatable.annotation.incompatible.target", container, contained);
-            return;
-        }
-
-        Set<Name> containerTargets = new HashSet<Name>();
+            containerTargets = getDefaultTargetSet();
+        } else {
+            containerTargets = new HashSet<Name>();
         for (Attribute app : containerTarget.values) {
             if (!(app instanceof Attribute.Enum)) {
                 continue; // recovery
@@ -2805,8 +2797,14 @@
             Attribute.Enum e = (Attribute.Enum)app;
             containerTargets.add(e.value.name);
         }
-
-        Set<Name> containedTargets = new HashSet<Name>();
+        }
+
+        Set<Name> containedTargets;
+        Attribute.Array containedTarget = getAttributeTargetAttribute(contained);
+        if (containedTarget == null) {
+            containedTargets = getDefaultTargetSet();
+        } else {
+            containedTargets = new HashSet<Name>();
         for (Attribute app : containedTarget.values) {
             if (!(app instanceof Attribute.Enum)) {
                 continue; // recovery
@@ -2814,20 +2812,42 @@
             Attribute.Enum e = (Attribute.Enum)app;
             containedTargets.add(e.value.name);
         }
-
-        if (!isTargetSubset(containedTargets, containerTargets)) {
+        }
+
+        if (!isTargetSubsetOf(containerTargets, containedTargets)) {
             log.error(pos, "invalid.repeatable.annotation.incompatible.target", container, contained);
         }
     }
 
-    /** Checks that t is a subset of s, with respect to ElementType
+    /* get a set of names for the default target */
+    private Set<Name> getDefaultTargetSet() {
+        if (defaultTargets == null) {
+            Set<Name> targets = new HashSet<Name>();
+            targets.add(names.ANNOTATION_TYPE);
+            targets.add(names.CONSTRUCTOR);
+            targets.add(names.FIELD);
+            targets.add(names.LOCAL_VARIABLE);
+            targets.add(names.METHOD);
+            targets.add(names.PACKAGE);
+            targets.add(names.PARAMETER);
+            targets.add(names.TYPE);
+
+            defaultTargets = java.util.Collections.unmodifiableSet(targets);
+        }
+
+        return defaultTargets;
+    }
+    private Set<Name> defaultTargets;
+
+
+    /** Checks that s is a subset of t, with respect to ElementType
      * semantics, specifically {ANNOTATION_TYPE} is a subset of {TYPE}
      */
-    private boolean isTargetSubset(Set<Name> s, Set<Name> t) {
-        // Check that all elements in t are present in s
-        for (Name n2 : t) {
+    private boolean isTargetSubsetOf(Set<Name> s, Set<Name> t) {
+        // Check that all elements in s are present in t
+        for (Name n2 : s) {
             boolean currentElementOk = false;
-            for (Name n1 : s) {
+            for (Name n1 : t) {
                 if (n1 == n2) {
                     currentElementOk = true;
                     break;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Apr 05 14:51:24 2013 -0700
@@ -229,9 +229,9 @@
         public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
             switch (deferredAttrContext.mode) {
                 case SPECULATIVE:
-                    Assert.check(dt.mode == null ||
-                            (dt.mode == AttrMode.SPECULATIVE &&
-                            dt.speculativeType(deferredAttrContext.msym, deferredAttrContext.phase).hasTag(NONE)));
+                    //Note: if a symbol is imported twice we might do two identical
+                    //speculative rounds...
+                    Assert.check(dt.mode == null || dt.mode == AttrMode.SPECULATIVE);
                     JCTree speculativeTree = attribSpeculative(dt.tree, dt.env, resultInfo);
                     dt.speculativeCache.put(deferredAttrContext.msym, speculativeTree, deferredAttrContext.phase);
                     return speculativeTree.type;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Apr 05 14:51:24 2013 -0700
@@ -585,11 +585,7 @@
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
                     for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
-                        if (!inferenceContext.inferenceVars().contains(b1) &&
-                                !inferenceContext.inferenceVars().contains(b2) &&
-                                infer.types.asSuper(b2, b1.tsym) != null) {
-                            infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
-                        }
+                        infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
                     }
                 }
             }
@@ -603,11 +599,7 @@
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
                     for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
-                        if (!inferenceContext.inferenceVars().contains(b1) &&
-                                !inferenceContext.inferenceVars().contains(b2) &&
-                                infer.types.asSuper(b2, b1.tsym) != null) {
-                            infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
-                        }
+                        infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
                     }
                 }
             }
@@ -621,10 +613,22 @@
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
                     for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
-                        if (!inferenceContext.inferenceVars().contains(b1) &&
-                                !inferenceContext.inferenceVars().contains(b2) &&
-                                infer.types.asSuper(b2, b1.tsym) != null) {
-                            infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
+                        infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
+                    }
+                }
+            }
+        },
+        /**
+         * Given a bound set containing {@code alpha == S} and {@code alpha == T}
+         * perform {@code S == T} (which could lead to new bounds).
+         */
+        CROSS_EQ_EQ() {
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
+                Infer infer = inferenceContext.infer();
+                for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
+                    for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
+                        if (b1 != b2) {
+                            infer.types.isSameType(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
                         }
                     }
                 }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1019,14 +1019,14 @@
             } else if (refSym.enclClass().isInterface()) {
                 return ClassFile.REF_invokeInterface;
             } else {
-                return ClassFile.REF_invokeVirtual;
+                return (refSym.flags() & PRIVATE) != 0 ?
+                        ClassFile.REF_invokeSpecial :
+                        ClassFile.REF_invokeVirtual;
             }
         }
     }
 
-    // </editor-fold>
-
-    // <editor-fold defaultstate="collapsed" desc="Lambda/reference analyzer">\
+    // <editor-fold defaultstate="collapsed" desc="Lambda/reference analyzer">
     /**
      * This visitor collects information about translation of a lambda expression.
      * More specifically, it keeps track of the enclosing contexts and captured locals
@@ -1293,9 +1293,16 @@
             return names.lambda.append(names.fromString("" + lambdaCount++));
         }
 
+        /**
+         * For a serializable lambda, generate a name which maximizes name
+         * stability across deserialization.
+         * @param owner
+         * @return Name to use for the synthetic lambda method name
+         */
         private Name serializedLambdaName(Symbol owner) {
             StringBuilder buf = new StringBuilder();
             buf.append(names.lambda);
+            // Append the name of the method enclosing the lambda.
             String methodName = owner.name.toString();
             if (methodName.equals("<clinit>"))
                 methodName = "static";
@@ -1303,9 +1310,18 @@
                 methodName = "new";
             buf.append(methodName);
             buf.append('$');
-            int methTypeHash = methodSig(owner.type).hashCode();
-            buf.append(Integer.toHexString(methTypeHash));
+            // Append a hash of the enclosing method signature to differentiate
+            // overloaded enclosing methods.  For lambdas enclosed in lambdas,
+            // the generated lambda method will not have type yet, but the
+            // enclosing method's name will have been generated with this same
+            // method, so it will be unique and never be overloaded.
+            if (owner.type != null) {
+                int methTypeHash = methodSig(owner.type).hashCode();
+                buf.append(Integer.toHexString(methTypeHash));
+            }
             buf.append('$');
+            // The above appended name components may not be unique, append a
+            // count based on the above name components.
             String temp = buf.toString();
             Integer count = serializableLambdaCounts.get(temp);
             if (count == null) {
@@ -1619,16 +1635,16 @@
              * Translate a symbol of a given kind into something suitable for the
              * synthetic lambda body
              */
-            Symbol translate(String name, final Symbol sym, LambdaSymbolKind skind) {
+            Symbol translate(Name name, final Symbol sym, LambdaSymbolKind skind) {
                 switch (skind) {
                     case CAPTURED_THIS:
                         return sym;  // self represented
                     case TYPE_VAR:
                         // Just erase the type var
-                        return new VarSymbol(sym.flags(), names.fromString(name),
+                        return new VarSymbol(sym.flags(), name,
                                 types.erasure(sym.type), sym.owner);
                     case CAPTURED_VAR:
-                        return new VarSymbol(SYNTHETIC | FINAL, names.fromString(name), types.erasure(sym.type), translatedSym) {
+                        return new VarSymbol(SYNTHETIC | FINAL, name, types.erasure(sym.type), translatedSym) {
                             @Override
                             public Symbol baseSymbol() {
                                 //keep mapping with original captured symbol
@@ -1642,27 +1658,27 @@
 
             void addSymbol(Symbol sym, LambdaSymbolKind skind) {
                 Map<Symbol, Symbol> transMap = null;
-                String preferredName;
+                Name preferredName;
                 switch (skind) {
                     case CAPTURED_THIS:
                         transMap = capturedThis;
-                        preferredName = "encl$" + capturedThis.size();
+                        preferredName = names.fromString("encl$" + capturedThis.size());
                         break;
                     case CAPTURED_VAR:
                         transMap = capturedLocals;
-                        preferredName = "cap$" + capturedLocals.size();
+                        preferredName = names.fromString("cap$" + capturedLocals.size());
                         break;
                     case LOCAL_VAR:
                         transMap = lambdaLocals;
-                        preferredName = sym.name.toString();
+                        preferredName = sym.name;
                         break;
                     case PARAM:
                         transMap = lambdaParams;
-                        preferredName = sym.name.toString();
+                        preferredName = sym.name;
                         break;
                     case TYPE_VAR:
                         transMap = typeVars;
-                        preferredName = sym.name.toString();
+                        preferredName = sym.name;
                         break;
                     default: throw new AssertionError();
                 }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Fri Apr 05 14:51:24 2013 -0700
@@ -2604,11 +2604,6 @@
 
         enumDefs.appendList(otherDefs.toList());
         tree.defs = enumDefs.toList();
-
-        // Add the necessary members for the EnumCompatibleMode
-        if (target.compilerBootstrap(tree.sym)) {
-            addEnumCompatibleMembers(tree);
-        }
     }
         // where
         private MethodSymbol systemArraycopyMethod;
@@ -2657,30 +2652,6 @@
                 olderasure.getReturnType(),
                 olderasure.getThrownTypes(),
                 syms.methodClass);
-
-            if (target.compilerBootstrap(m.owner)) {
-                // Initialize synthetic name field
-                Symbol nameVarSym = lookupSynthetic(names.fromString("$name"),
-                                                    tree.sym.owner.members());
-                JCIdent nameIdent = make.Ident(nameParam.sym);
-                JCIdent id1 = make.Ident(nameVarSym);
-                JCAssign newAssign = make.Assign(id1, nameIdent);
-                newAssign.type = id1.type;
-                JCExpressionStatement nameAssign = make.Exec(newAssign);
-                nameAssign.type = id1.type;
-                tree.body.stats = tree.body.stats.prepend(nameAssign);
-
-                // Initialize synthetic ordinal field
-                Symbol ordinalVarSym = lookupSynthetic(names.fromString("$ordinal"),
-                                                       tree.sym.owner.members());
-                JCIdent ordIdent = make.Ident(ordParam.sym);
-                id1 = make.Ident(ordinalVarSym);
-                newAssign = make.Assign(id1, ordIdent);
-                newAssign.type = id1.type;
-                JCExpressionStatement ordinalAssign = make.Exec(newAssign);
-                ordinalAssign.type = id1.type;
-                tree.body.stats = tree.body.stats.prepend(ordinalAssign);
-            }
         }
 
         JCMethodDecl prevMethodDef = currentMethodDef;
@@ -3434,14 +3405,16 @@
                 tree.expr = make.TypeCast(types.erasure(iterableType), tree.expr);
             Symbol iterator = lookupMethod(tree.expr.pos(),
                                            names.iterator,
-                                           types.erasure(syms.iterableType),
+                                           eType,
                                            List.<Type>nil());
             VarSymbol itvar = new VarSymbol(0, names.fromString("i" + target.syntheticNameChar()),
                                             types.erasure(iterator.type.getReturnType()),
                                             currentMethodSym);
-            JCStatement init = make.
-                VarDef(itvar,
-                       make.App(make.Select(tree.expr, iterator)));
+
+             JCStatement init = make.
+                VarDef(itvar, make.App(make.Select(tree.expr, iterator)
+                     .setType(types.erasure(iterator.type))));
+
             Symbol hasNext = lookupMethod(tree.expr.pos(),
                                           names.hasNext,
                                           itvar.type,
@@ -3886,168 +3859,4 @@
         }
         return translated.toList();
     }
-
-    //////////////////////////////////////////////////////////////
-    // The following contributed by Borland for bootstrapping purposes
-    //////////////////////////////////////////////////////////////
-    private void addEnumCompatibleMembers(JCClassDecl cdef) {
-        make_at(null);
-
-        // Add the special enum fields
-        VarSymbol ordinalFieldSym = addEnumOrdinalField(cdef);
-        VarSymbol nameFieldSym = addEnumNameField(cdef);
-
-        // Add the accessor methods for name and ordinal
-        MethodSymbol ordinalMethodSym = addEnumFieldOrdinalMethod(cdef, ordinalFieldSym);
-        MethodSymbol nameMethodSym = addEnumFieldNameMethod(cdef, nameFieldSym);
-
-        // Add the toString method
-        addEnumToString(cdef, nameFieldSym);
-
-        // Add the compareTo method
-        addEnumCompareTo(cdef, ordinalFieldSym);
-    }
-
-    private VarSymbol addEnumOrdinalField(JCClassDecl cdef) {
-        VarSymbol ordinal = new VarSymbol(PRIVATE|FINAL|SYNTHETIC,
-                                          names.fromString("$ordinal"),
-                                          syms.intType,
-                                          cdef.sym);
-        cdef.sym.members().enter(ordinal);
-        cdef.defs = cdef.defs.prepend(make.VarDef(ordinal, null));
-        return ordinal;
-    }
-
-    private VarSymbol addEnumNameField(JCClassDecl cdef) {
-        VarSymbol name = new VarSymbol(PRIVATE|FINAL|SYNTHETIC,
-                                          names.fromString("$name"),
-                                          syms.stringType,
-                                          cdef.sym);
-        cdef.sym.members().enter(name);
-        cdef.defs = cdef.defs.prepend(make.VarDef(name, null));
-        return name;
-    }
-
-    private MethodSymbol addEnumFieldOrdinalMethod(JCClassDecl cdef, VarSymbol ordinalSymbol) {
-        // Add the accessor methods for ordinal
-        Symbol ordinalSym = lookupMethod(cdef.pos(),
-                                         names.ordinal,
-                                         cdef.type,
-                                         List.<Type>nil());
-
-        Assert.check(ordinalSym instanceof MethodSymbol);
-
-        JCStatement ret = make.Return(make.Ident(ordinalSymbol));
-        cdef.defs = cdef.defs.append(make.MethodDef((MethodSymbol)ordinalSym,
-                                                    make.Block(0L, List.of(ret))));
-
-        return (MethodSymbol)ordinalSym;
-    }
-
-    private MethodSymbol addEnumFieldNameMethod(JCClassDecl cdef, VarSymbol nameSymbol) {
-        // Add the accessor methods for name
-        Symbol nameSym = lookupMethod(cdef.pos(),
-                                   names._name,
-                                   cdef.type,
-                                   List.<Type>nil());
-
-        Assert.check(nameSym instanceof MethodSymbol);
-
-        JCStatement ret = make.Return(make.Ident(nameSymbol));
-
-        cdef.defs = cdef.defs.append(make.MethodDef((MethodSymbol)nameSym,
-                                                    make.Block(0L, List.of(ret))));
-
-        return (MethodSymbol)nameSym;
-    }
-
-    private MethodSymbol addEnumToString(JCClassDecl cdef,
-                                         VarSymbol nameSymbol) {
-        Symbol toStringSym = lookupMethod(cdef.pos(),
-                                          names.toString,
-                                          cdef.type,
-                                          List.<Type>nil());
-
-        JCTree toStringDecl = null;
-        if (toStringSym != null)
-            toStringDecl = TreeInfo.declarationFor(toStringSym, cdef);
-
-        if (toStringDecl != null)
-            return (MethodSymbol)toStringSym;
-
-        JCStatement ret = make.Return(make.Ident(nameSymbol));
-
-        JCTree resTypeTree = make.Type(syms.stringType);
-
-        MethodType toStringType = new MethodType(List.<Type>nil(),
-                                                 syms.stringType,
-                                                 List.<Type>nil(),
-                                                 cdef.sym);
-        toStringSym = new MethodSymbol(PUBLIC,
-                                       names.toString,
-                                       toStringType,
-                                       cdef.type.tsym);
-        toStringDecl = make.MethodDef((MethodSymbol)toStringSym,
-                                      make.Block(0L, List.of(ret)));
-
-        cdef.defs = cdef.defs.prepend(toStringDecl);
-        cdef.sym.members().enter(toStringSym);
-
-        return (MethodSymbol)toStringSym;
-    }
-
-    private MethodSymbol addEnumCompareTo(JCClassDecl cdef, VarSymbol ordinalSymbol) {
-        Symbol compareToSym = lookupMethod(cdef.pos(),
-                                   names.compareTo,
-                                   cdef.type,
-                                   List.of(cdef.sym.type));
-
-        Assert.check(compareToSym instanceof MethodSymbol);
-
-        JCMethodDecl compareToDecl = (JCMethodDecl) TreeInfo.declarationFor(compareToSym, cdef);
-
-        ListBuffer<JCStatement> blockStatements = new ListBuffer<JCStatement>();
-
-        JCModifiers mod1 = make.Modifiers(0L);
-        Name oName = names.fromString("o");
-        JCVariableDecl par1 = make.Param(oName, cdef.type, compareToSym);
-
-        JCIdent paramId1 = make.Ident(names.java_lang_Object);
-        paramId1.type = cdef.type;
-        paramId1.sym = par1.sym;
-
-        ((MethodSymbol)compareToSym).params = List.of(par1.sym);
-
-        JCIdent par1UsageId = make.Ident(par1.sym);
-        JCIdent castTargetIdent = make.Ident(cdef.sym);
-        JCTypeCast cast = make.TypeCast(castTargetIdent, par1UsageId);
-        cast.setType(castTargetIdent.type);
-
-        Name otherName = names.fromString("other");
-
-        VarSymbol otherVarSym = new VarSymbol(mod1.flags,
-                                              otherName,
-                                              cdef.type,
-                                              compareToSym);
-        JCVariableDecl otherVar = make.VarDef(otherVarSym, cast);
-        blockStatements.append(otherVar);
-
-        JCIdent id1 = make.Ident(ordinalSymbol);
-
-        JCIdent fLocUsageId = make.Ident(otherVarSym);
-        JCExpression sel = make.Select(fLocUsageId, ordinalSymbol);
-        JCBinary bin = makeBinary(MINUS, id1, sel);
-        JCReturn ret = make.Return(bin);
-        blockStatements.append(ret);
-        JCMethodDecl compareToMethod = make.MethodDef((MethodSymbol)compareToSym,
-                                                   make.Block(0L,
-                                                              blockStatements.toList()));
-        compareToMethod.params = List.of(par1);
-        cdef.defs = cdef.defs.append(compareToMethod);
-
-        return (MethodSymbol)compareToSym;
-    }
-    //////////////////////////////////////////////////////////////
-    // The above contributed by Borland for bootstrapping purposes
-    //////////////////////////////////////////////////////////////
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -473,44 +473,6 @@
                       null, //make.Block(0, Tree.emptyList.prepend(make.Return(make.Ident(names._null)))),
                       null);
         memberEnter(valueOf, env);
-
-        // the remaining members are for bootstrapping only
-        if (!target.compilerBootstrap(tree.sym)) return;
-
-        // public final int ordinal() { return ???; }
-        JCMethodDecl ordinal = make.at(tree.pos).
-            MethodDef(make.Modifiers(Flags.PUBLIC|Flags.FINAL),
-                      names.ordinal,
-                      make.Type(syms.intType),
-                      List.<JCTypeParameter>nil(),
-                      List.<JCVariableDecl>nil(),
-                      List.<JCExpression>nil(),
-                      null,
-                      null);
-        memberEnter(ordinal, env);
-
-        // public final String name() { return ???; }
-        JCMethodDecl name = make.
-            MethodDef(make.Modifiers(Flags.PUBLIC|Flags.FINAL),
-                      names._name,
-                      make.Type(syms.stringType),
-                      List.<JCTypeParameter>nil(),
-                      List.<JCVariableDecl>nil(),
-                      List.<JCExpression>nil(),
-                      null,
-                      null);
-        memberEnter(name, env);
-
-        // public int compareTo(E other) { return ???; }
-        MethodSymbol compareTo = new
-            MethodSymbol(Flags.PUBLIC,
-                         names.compareTo,
-                         new MethodType(List.of(tree.sym.type),
-                                        syms.intType,
-                                        List.<Type>nil(),
-                                        syms.methodClass),
-                         tree.sym);
-        memberEnter(make.MethodDef(compareTo, null), env);
     }
 
     public void visitTopLevel(JCCompilationUnit tree) {
@@ -936,7 +898,7 @@
             Type supertype =
                 (tree.extending != null)
                 ? attr.attribBase(tree.extending, baseEnv, true, false, true)
-                : ((tree.mods.flags & Flags.ENUM) != 0 && !target.compilerBootstrap(c))
+                : ((tree.mods.flags & Flags.ENUM) != 0)
                 ? attr.attribBase(enumBase(tree.pos, c), baseEnv,
                                   true, false, false)
                 : (c.fullname == names.java_lang_Object)
@@ -949,16 +911,6 @@
             ListBuffer<Type> all_interfaces = null; // lazy init
             Set<Type> interfaceSet = new HashSet<Type>();
             List<JCExpression> interfaceTrees = tree.implementing;
-            if ((tree.mods.flags & Flags.ENUM) != 0 && target.compilerBootstrap(c)) {
-                // add interface Comparable<T>
-                interfaceTrees =
-                    interfaceTrees.prepend(make.Type(new ClassType(syms.comparableType.getEnclosingType(),
-                                                                   List.of(c.type),
-                                                                   syms.comparableType.tsym)));
-                // add interface Serializable
-                interfaceTrees =
-                    interfaceTrees.prepend(make.Type(syms.serializableType));
-            }
             for (JCExpression iface : interfaceTrees) {
                 Type i = attr.attribBase(iface, baseEnv, false, true, true);
                 if (i.hasTag(CLASS)) {
@@ -1401,8 +1353,7 @@
         if (c.type != syms.objectType)
             stats = stats.prepend(SuperCall(make, typarams, params, based));
         if ((c.flags() & ENUM) != 0 &&
-            (types.supertype(c.type).tsym == syms.enumSym ||
-             target.compilerBootstrap(c))) {
+            (types.supertype(c.type).tsym == syms.enumSym)) {
             // constructors of true enums are private
             flags = (flags & ~AccessFlags) | PRIVATE | GENERATEDCONSTR;
         } else
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -48,17 +48,6 @@
     /** J2SE1.4 = Merlin. */
     JDK1_4("1.4", 48, 0),
 
-    /** Support for the JSR14 prototype compiler (targeting 1.4 VMs
-     *  augmented with a few support classes).  This is a transitional
-     *  option that will not be supported in the product.  */
-    JSR14("jsr14", 48, 0),
-
-    /** The following are undocumented transitional targets that we
-     *  had used to test VM fixes in update releases.  We do not
-     *  promise to retain support for them.  */
-    JDK1_4_1("1.4.1", 48, 0),
-    JDK1_4_2("1.4.2", 48, 0),
-
     /** Tiger. */
     JDK1_5("1.5", 49, 0),
 
@@ -175,23 +164,23 @@
         return compareTo(JDK1_5) >= 0;
     }
 
-    /** Beginning in -target 1.4.2, we make synthetic variables
+    /** Beginning in -target 1.5, we make synthetic variables
      *  package-private instead of private.  This is to prevent the
      *  necessity of access methods, which effectively relax the
      *  protection of the field but bloat the class files and affect
      *  execution.
      */
     public boolean usePrivateSyntheticFields() {
-        return compareTo(JDK1_4_2) < 0;
+        return compareTo(JDK1_5) < 0;
     }
 
     /** Sometimes we need to create a field to cache a value like a
-     *  class literal of the assertions flag.  In -target 1.4.2 and
+     *  class literal of the assertions flag.  In -target 1.5 and
      *  later we create a new synthetic class for this instead of
      *  using the outermost class.  See 4401576.
      */
     public boolean useInnerCacheClass() {
-        return compareTo(JDK1_4_2) >= 0;
+        return compareTo(JDK1_5) >= 0;
     }
 
     /** Return true if cldc-style stack maps need to be generated. */
@@ -276,7 +265,7 @@
      *  See 4468823
      */
     public boolean classLiteralsNoInit() {
-        return compareTo(JDK1_4_2) >= 0;
+        return compareTo(JDK1_5) >= 0;
     }
 
     /** Although we may not have support for class literals, when we
@@ -300,22 +289,10 @@
         return compareTo(JDK1_5) >= 0;
     }
 
-    /** For bootstrapping javac only, we do without java.lang.Enum if
-     *  necessary.
-     */
-    public boolean compilerBootstrap(Symbol c) {
-        return
-            this == JSR14 &&
-            (c.flags() & Flags.ENUM) != 0 &&
-            c.flatName().toString().startsWith("com.sun.tools.")
-            // && !Target.class.getSuperclass().getName().equals("java.lang.Enum")
-            ;
-    }
-
     /** In J2SE1.5.0, we introduced the "EnclosingMethod" attribute
      *  for improved reflection support.
      */
     public boolean hasEnclosingMethodAttribute() {
-        return compareTo(JDK1_5) >= 0 || this == JSR14;
+        return compareTo(JDK1_5) >= 0;
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -273,7 +273,7 @@
 
     /**
      * ExceptionProxy for MirroredTypeException.
-     * The toString, hashCode, and equals methods foward to the underlying
+     * The toString, hashCode, and equals methods forward to the underlying
      * type.
      */
     private static final class MirroredTypeExceptionProxy extends ExceptionProxy {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 2005, 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.
+ */
+package com.sun.tools.javac.model;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Inherited;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import com.sun.tools.javac.code.Attribute;
+import com.sun.tools.javac.code.Kinds;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.AnnotatedType;
+import com.sun.tools.javac.util.ListBuffer;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+
+/**
+ * Utility methods for operating on annotated constructs.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk.  This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+public class JavacAnnoConstructs {
+
+    // <editor-fold defaultstate="collapsed" desc="Symbols">
+
+    /**
+     * An internal-use utility that creates a runtime view of an
+     * annotation. This is the implementation of
+     * Element.getAnnotation(Class).
+     */
+    public static <A extends Annotation> A getAnnotation(Symbol annotated,
+                                                         Class<A> annoType) {
+        if (!annoType.isAnnotation())
+            throw new IllegalArgumentException("Not an annotation type: "
+                                               + annoType);
+        Attribute.Compound c;
+        if (annotated.kind == Kinds.TYP && annotated instanceof ClassSymbol) {
+            c = getAttributeOnClass((ClassSymbol)annotated, annoType);
+        } else {
+            c = getAttribute(annotated, annoType);
+        }
+        return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
+    }
+
+    // Helper to getAnnotation[s]
+    private static <A extends Annotation> Attribute.Compound getAttribute(Symbol annotated,
+                                                                          Class<A> annoType) {
+        String name = annoType.getName();
+
+        for (Attribute.Compound anno : annotated.getRawAttributes()) {
+            if (name.equals(anno.type.tsym.flatName().toString()))
+                return anno;
+        }
+
+        return null;
+    }
+
+    // Helper to getAnnotation[s]
+    private static <A extends Annotation> Attribute.Compound getAttributeOnClass(ClassSymbol annotated,
+                                                                Class<A> annoType) {
+        boolean inherited = annoType.isAnnotationPresent(Inherited.class);
+        Attribute.Compound result = null;
+        while (annotated.name != annotated.name.table.names.java_lang_Object) {
+            result = getAttribute(annotated, annoType);
+            if (result != null || !inherited)
+                break;
+            Type sup = annotated.getSuperclass();
+            if (!sup.hasTag(CLASS) || sup.isErroneous())
+                break;
+            annotated = (ClassSymbol) sup.tsym;
+        }
+        return result;
+    }
+
+    /**
+     * An internal-use utility that creates a runtime view of
+     * annotations. This is the implementation of
+     * Element.getAnnotations(Class).
+     */
+    public static <A extends Annotation> A[] getAnnotations(Symbol annotated,
+                                                            Class<A> annoType) {
+        if (!annoType.isAnnotation())
+            throw new IllegalArgumentException("Not an annotation type: "
+                                               + annoType);
+        // If annoType does not declare a container this is equivalent to wrapping
+        // getAnnotation(...) in an array.
+        Class <? extends Annotation> containerType = getContainer(annoType);
+        if (containerType == null) {
+            A res = getAnnotation(annotated, annoType);
+            int size;
+            if (res == null) {
+                size = 0;
+            } else {
+                size = 1;
+            }
+            @SuppressWarnings("unchecked") // annoType is the Class for A
+            A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
+            if (res != null)
+                arr[0] = res;
+            return arr;
+        }
+
+        // So we have a containing type
+        String name = annoType.getName();
+        String annoTypeName = annoType.getSimpleName();
+        String containerTypeName = containerType.getSimpleName();
+        int directIndex = -1, containerIndex = -1;
+        Attribute.Compound direct = null, container = null;
+        Attribute.Compound[] rawAttributes = annotated.getRawAttributes().toArray(new Attribute.Compound[0]);
+
+        // Find directly present annotations
+        for (int i = 0; i < rawAttributes.length; i++) {
+            if (annoTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
+                directIndex = i;
+                direct = rawAttributes[i];
+            } else if(containerTypeName != null &&
+                      containerTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
+                containerIndex = i;
+                container = rawAttributes[i];
+            }
+        }
+
+        // Deal with inherited annotations
+        if (annotated.kind == Kinds.TYP &&
+                (annotated instanceof ClassSymbol)) {
+            ClassSymbol s = (ClassSymbol)annotated;
+            if (direct == null && container == null) {
+                direct = getAttributeOnClass(s, annoType);
+                container = getAttributeOnClass(s, containerType);
+
+                // both are inherited and found, put container last
+                if (direct != null && container != null) {
+                    directIndex = 0;
+                    containerIndex = 1;
+                } else if (direct != null) {
+                    directIndex = 0;
+                } else {
+                    containerIndex = 0;
+                }
+            } else if (direct == null) {
+                direct = getAttributeOnClass(s, annoType);
+                if (direct != null)
+                    directIndex = containerIndex + 1;
+            } else if (container == null) {
+                container = getAttributeOnClass(s, containerType);
+                if (container != null)
+                    containerIndex = directIndex + 1;
+            }
+        }
+
+        // Pack them in an array
+        Attribute[] contained0 = new Attribute[0];
+        if (container != null)
+            contained0 = unpackAttributes(container);
+        ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
+        for (Attribute a : contained0)
+            if (a instanceof Attribute.Compound)
+                compounds = compounds.append((Attribute.Compound)a);
+        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[0]);
+
+        int size = (direct == null ? 0 : 1) + contained.length;
+        @SuppressWarnings("unchecked") // annoType is the Class for A
+        A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
+
+        // if direct && container, which is first?
+        int insert = -1;
+        int length = arr.length;
+        if (directIndex >= 0 && containerIndex >= 0) {
+            if (directIndex < containerIndex) {
+                arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
+                insert = 1;
+            } else {
+                arr[arr.length - 1] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
+                insert = 0;
+                length--;
+            }
+        } else if (directIndex >= 0) {
+            arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
+            return arr;
+        } else {
+            // Only container
+            insert = 0;
+        }
+
+        for (int i = 0; i + insert < length; i++)
+            arr[insert + i] = AnnotationProxyMaker.generateAnnotation(contained[i], annoType);
+
+        return arr;
+    }
+
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="Types">
+
+    /**
+     * An internal-use utility that creates a runtime view of an
+     * annotation. This is the implementation of
+     * TypeMirror.getAnnotation(Class).
+     */
+    public static <A extends Annotation> A getAnnotation(AnnotatedType annotated, Class<A> annoType) {
+        if (!annoType.isAnnotation())
+            throw new IllegalArgumentException("Not an annotation type: "
+                                               + annoType);
+        Attribute.Compound c = getAttribute(annotated, annoType);
+        return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
+    }
+
+    // Helper to getAnnotation[s]
+    private static <A extends Annotation> Attribute.Compound getAttribute(Type annotated,
+                                                                          Class<A> annoType) {
+        String name = annoType.getName();
+
+        for (Attribute.Compound anno : annotated.getAnnotationMirrors()) {
+            if (name.equals(anno.type.tsym.flatName().toString()))
+                return anno;
+        }
+
+        return null;
+    }
+
+    /**
+     * An internal-use utility that creates a runtime view of
+     * annotations. This is the implementation of
+     * TypeMirror.getAnnotationsByType(Class).
+     */
+    public static <A extends Annotation> A[] getAnnotationsByType(AnnotatedType annotated, Class<A> annoType) {
+        if (!annoType.isAnnotation())
+            throw new IllegalArgumentException("Not an annotation type: "
+                                               + annoType);
+        // If annoType does not declare a container this is equivalent to wrapping
+        // getAnnotation(...) in an array.
+        Class <? extends Annotation> containerType = getContainer(annoType);
+        if (containerType == null) {
+            A res = getAnnotation(annotated, annoType);
+            int size;
+            if (res == null) {
+                size = 0;
+            } else {
+                size = 1;
+            }
+            @SuppressWarnings("unchecked") // annoType is the Class for A
+            A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
+            if (res != null)
+                arr[0] = res;
+            return arr;
+        }
+
+        // So we have a containing type
+        String name = annoType.getName();
+        String annoTypeName = annoType.getSimpleName();
+        String containerTypeName = containerType.getSimpleName();
+        int directIndex = -1, containerIndex = -1;
+        Attribute.Compound direct = null, container = null;
+        Attribute.Compound[] rawAttributes = annotated.getAnnotationMirrors().toArray(new Attribute.Compound[0]);
+
+        // Find directly present annotations
+        for (int i = 0; i < rawAttributes.length; i++) {
+            if (annoTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
+                directIndex = i;
+                direct = rawAttributes[i];
+            } else if(containerTypeName != null &&
+                      containerTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
+                containerIndex = i;
+                container = rawAttributes[i];
+            }
+        }
+
+        // Pack them in an array
+        Attribute[] contained0 = new Attribute[0];
+        if (container != null)
+            contained0 = unpackAttributes(container);
+        ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
+        for (Attribute a : contained0) {
+            if (a instanceof Attribute.Compound)
+                compounds = compounds.append((Attribute.Compound)a);
+        }
+        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[0]);
+
+        int size = (direct == null ? 0 : 1) + contained.length;
+        @SuppressWarnings("unchecked") // annoType is the Class for A
+        A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
+
+        // if direct && container, which is first?
+        int insert = -1;
+        int length = arr.length;
+        if (directIndex >= 0 && containerIndex >= 0) {
+            if (directIndex < containerIndex) {
+                arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
+                insert = 1;
+            } else {
+                arr[arr.length - 1] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
+                insert = 0;
+                length--;
+            }
+        } else if (directIndex >= 0) {
+            arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
+            return arr;
+        } else {
+            // Only container
+            insert = 0;
+        }
+
+        for (int i = 0; i + insert < length; i++)
+            arr[insert + i] = AnnotationProxyMaker.generateAnnotation(contained[i], annoType);
+
+        return arr;
+    }
+
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="Container support">
+
+    // Needed to unpack the runtime view of containing annotations
+    private static final Class<? extends Annotation> REPEATABLE_CLASS = initRepeatable();
+    private static final Method VALUE_ELEMENT_METHOD = initValueElementMethod();
+
+    private static Class<? extends Annotation> initRepeatable() {
+        try {
+            // Repeatable will not be available when bootstrapping on
+            // JDK 7 so use a reflective lookup instead of a class
+            // literal for Repeatable.class.
+            return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
+        } catch (ClassNotFoundException e) {
+            return null;
+        } catch (SecurityException e) {
+            return null;
+        }
+    }
+
+    private static Method initValueElementMethod() {
+        if (REPEATABLE_CLASS == null)
+            return null;
+
+        Method m = null;
+        try {
+            m = REPEATABLE_CLASS.getMethod("value");
+            if (m != null)
+                m.setAccessible(true);
+            return m;
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
+
+    // Helper to getAnnotations
+    private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType) {
+        // Since we can not refer to java.lang.annotation.Repeatable until we are
+        // bootstrapping with java 8 we need to get the Repeatable annotation using
+        // reflective invocations instead of just using its type and element method.
+        if (REPEATABLE_CLASS != null &&
+            VALUE_ELEMENT_METHOD != null) {
+            // Get the Repeatable instance on the annotations declaration
+            Annotation repeatable = (Annotation)annoType.getAnnotation(REPEATABLE_CLASS);
+            if (repeatable != null) {
+                try {
+                    // Get the value element, it should be a class
+                    // indicating the containing annotation type
+                    @SuppressWarnings("unchecked")
+                    Class<? extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(repeatable);
+                    if (containerType == null)
+                        return null;
+
+                    return containerType;
+                } catch (ClassCastException e) {
+                    return null;
+                } catch (IllegalAccessException e) {
+                    return null;
+                } catch (InvocationTargetException e ) {
+                    return null;
+                }
+            }
+        }
+        return null;
+    }
+
+    // Helper to getAnnotations
+    private static Attribute[] unpackAttributes(Attribute.Compound container) {
+        // We now have an instance of the container,
+        // unpack it returning an instance of the
+        // contained type or null
+        return ((Attribute.Array)container.member(container.type.tsym.name.table.names.value)).values;
+    }
+
+    // </editor-fold>
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,10 +25,6 @@
 
 package com.sun.tools.javac.model;
 
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Inherited;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.Map;
 
 import javax.lang.model.SourceVersion;
@@ -40,7 +36,6 @@
 
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.comp.Env;
@@ -98,237 +93,6 @@
         enter = Enter.instance(context);
     }
 
-    /**
-     * An internal-use utility that creates a runtime view of an
-     * annotation. This is the implementation of
-     * Element.getAnnotation(Class).
-     */
-    public static <A extends Annotation> A getAnnotation(Symbol annotated,
-                                                         Class<A> annoType) {
-        if (!annoType.isAnnotation())
-            throw new IllegalArgumentException("Not an annotation type: "
-                                               + annoType);
-        Attribute.Compound c;
-        if (annotated.kind == Kinds.TYP && annotated instanceof ClassSymbol) {
-            c = getAttributeOnClass((ClassSymbol)annotated, annoType);
-        } else {
-            c = getAttribute(annotated, annoType);
-        }
-        return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
-    }
-
-    // Helper to getAnnotation[s]
-    private static <A extends Annotation> Attribute.Compound getAttribute(Symbol annotated,
-                                                                          Class<A> annoType) {
-        String name = annoType.getName();
-
-        for (Attribute.Compound anno : annotated.getRawAttributes())
-            if (name.equals(anno.type.tsym.flatName().toString()))
-                return anno;
-
-        return null;
-    }
-    // Helper to getAnnotation[s]
-    private static <A extends Annotation> Attribute.Compound getAttributeOnClass(ClassSymbol annotated,
-                                                                Class<A> annoType) {
-        boolean inherited = annoType.isAnnotationPresent(Inherited.class);
-        Attribute.Compound result = null;
-        while (annotated.name != annotated.name.table.names.java_lang_Object) {
-            result = getAttribute(annotated, annoType);
-            if (result != null || !inherited)
-                break;
-            Type sup = annotated.getSuperclass();
-            if (!sup.hasTag(CLASS) || sup.isErroneous())
-                break;
-            annotated = (ClassSymbol) sup.tsym;
-        }
-        return result;
-    }
-
-    /**
-     * An internal-use utility that creates a runtime view of
-     * annotations. This is the implementation of
-     * Element.getAnnotations(Class).
-     */
-    public static <A extends Annotation> A[] getAnnotations(Symbol annotated,
-                                                            Class<A> annoType) {
-        if (!annoType.isAnnotation())
-            throw new IllegalArgumentException("Not an annotation type: "
-                                               + annoType);
-        // If annoType does not declare a container this is equivalent to wrapping
-        // getAnnotation(...) in an array.
-        Class <? extends Annotation> containerType = getContainer(annoType);
-        if (containerType == null) {
-            A res = getAnnotation(annotated, annoType);
-            int size;
-            if (res == null) {
-                size = 0;
-            } else {
-                size = 1;
-            }
-            @SuppressWarnings("unchecked") // annoType is the Class for A
-            A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
-            if (res != null)
-                arr[0] = res;
-            return arr;
-        }
-
-        // So we have a containing type
-        String name = annoType.getName();
-        String annoTypeName = annoType.getSimpleName();
-        String containerTypeName = containerType.getSimpleName();
-        int directIndex = -1, containerIndex = -1;
-        Attribute.Compound direct = null, container = null;
-        Attribute.Compound[] rawAttributes = annotated.getRawAttributes().toArray(new Attribute.Compound[0]);
-
-        // Find directly present annotations
-        for (int i = 0; i < rawAttributes.length; i++) {
-            if (annoTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
-                directIndex = i;
-                direct = rawAttributes[i];
-            } else if(containerTypeName != null &&
-                      containerTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
-                containerIndex = i;
-                container = rawAttributes[i];
-            }
-        }
-        // Deal with inherited annotations
-        if (annotated.kind == Kinds.TYP &&
-                (annotated instanceof ClassSymbol)) {
-            ClassSymbol s = (ClassSymbol)annotated;
-            if (direct == null && container == null) {
-                direct = getAttributeOnClass(s, annoType);
-                container = getAttributeOnClass(s, containerType);
-
-                // both are inherited and found, put container last
-                if (direct != null && container != null) {
-                    directIndex = 0;
-                    containerIndex = 1;
-                } else if (direct != null) {
-                    directIndex = 0;
-                } else {
-                    containerIndex = 0;
-                }
-            } else if (direct == null) {
-                direct = getAttributeOnClass(s, annoType);
-                if (direct != null)
-                    directIndex = containerIndex + 1;
-            } else if (container == null) {
-                container = getAttributeOnClass(s, containerType);
-                if (container != null)
-                    containerIndex = directIndex + 1;
-            }
-        }
-
-        // Pack them in an array
-        Attribute[] contained0 = new Attribute[0];
-        if (container != null)
-            contained0 = unpackAttributes(container);
-        ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
-        for (Attribute a : contained0)
-            if (a instanceof Attribute.Compound)
-                compounds = compounds.append((Attribute.Compound)a);
-        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[0]);
-
-        int size = (direct == null ? 0 : 1) + contained.length;
-        @SuppressWarnings("unchecked") // annoType is the Class for A
-        A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
-
-        // if direct && container, which is first?
-        int insert = -1;
-        int length = arr.length;
-        if (directIndex >= 0 && containerIndex >= 0) {
-            if (directIndex < containerIndex) {
-                arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
-                insert = 1;
-            } else {
-                arr[arr.length - 1] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
-                insert = 0;
-                length--;
-            }
-        } else if (directIndex >= 0) {
-            arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
-            return arr;
-        } else {
-            // Only container
-            insert = 0;
-        }
-
-        for (int i = 0; i + insert < length; i++)
-            arr[insert + i] = AnnotationProxyMaker.generateAnnotation(contained[i], annoType);
-
-        return arr;
-    }
-
-    // Needed to unpack the runtime view of containing annotations
-    private static final Class<? extends Annotation> REPEATABLE_CLASS = initRepeatable();
-    private static final Method VALUE_ELEMENT_METHOD = initValueElementMethod();
-
-    private static Class<? extends Annotation> initRepeatable() {
-        try {
-            // Repeatable will not be available when bootstrapping on
-            // JDK 7 so use a reflective lookup instead of a class
-            // literal for Repeatable.class.
-            return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
-        } catch (ClassNotFoundException e) {
-            return null;
-        } catch (SecurityException e) {
-            return null;
-        }
-    }
-    private static Method initValueElementMethod() {
-        if (REPEATABLE_CLASS == null)
-            return null;
-
-        Method m = null;
-        try {
-            m = REPEATABLE_CLASS.getMethod("value");
-            if (m != null)
-                m.setAccessible(true);
-            return m;
-        } catch (NoSuchMethodException e) {
-            return null;
-        }
-    }
-
-    // Helper to getAnnotations
-    private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType) {
-        // Since we can not refer to java.lang.annotation.Repeatable until we are
-        // bootstrapping with java 8 we need to get the Repeatable annotation using
-        // reflective invocations instead of just using its type and element method.
-        if (REPEATABLE_CLASS != null &&
-            VALUE_ELEMENT_METHOD != null) {
-            // Get the Repeatable instance on the annotations declaration
-            Annotation repeatable = (Annotation)annoType.getAnnotation(REPEATABLE_CLASS);
-            if (repeatable != null) {
-                try {
-                    // Get the value element, it should be a class
-                    // indicating the containing annotation type
-                    @SuppressWarnings("unchecked")
-                    Class<? extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(repeatable);
-                    if (containerType == null)
-                        return null;
-
-                    return containerType;
-                } catch (ClassCastException e) {
-                    return null;
-                } catch (IllegalAccessException e) {
-                    return null;
-                } catch (InvocationTargetException e ) {
-                    return null;
-                }
-            }
-        }
-        return null;
-    }
-    // Helper to getAnnotations
-    private static Attribute[] unpackAttributes(Attribute.Compound container) {
-        // We now have an instance of the container,
-        // unpack it returning an instance of the
-        // contained type or null
-        return ((Attribute.Array)container.member(container.type.tsym.name.table.names.value)).values;
-    }
-
     public PackageSymbol getPackageElement(CharSequence name) {
         String strName = name.toString();
         if (strName.equals(""))
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,7 +25,6 @@
 
 package com.sun.tools.javac.model;
 
-import java.lang.annotation.Annotation;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.LinkedHashSet;
@@ -333,28 +332,4 @@
 
         return results;
     }
-
-    public List<? extends AnnotationMirror> typeAnnotationsOf(TypeMirror type) {
-        // TODO: these methods can be removed.
-        return null; // ((Type)type).typeAnnotations;
-    }
-
-    public <A extends Annotation> A typeAnnotationOf(TypeMirror type,
-            Class<A> annotationType) {
-        // TODO: these methods can be removed.
-        return null; // JavacElements.getAnnotation(((Type)type).typeAnnotations, annotationType);
-    }
-
-    public TypeMirror receiverTypeOf(ExecutableType type) {
-        return ((Type)type).asMethodType().recvtype;
-    }
-
-    /*
-    public <A extends Annotation> A receiverTypeAnnotationOf(
-            ExecutableType type, Class<A> annotationType) {
-        return JavacElements.getAnnotation(
-                ((Type)type).asMethodType().receiverTypeAnnotations,
-                annotationType);
-    }*/
-
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -65,8 +65,11 @@
 
 compiler.err.already.annotated={0} {1}\u306F\u6CE8\u91C8\u304C\u4ED8\u3044\u3066\u3044\u307E\u3059
 
-# 0: symbol, 1: symbol
-compiler.err.already.defined={0}\u306F{1}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+# 0: symbol kind, 1: symbol, 2: symbol kind, 3: symbol
+compiler.err.already.defined={0} {1}\u306F\u3059\u3067\u306B{2} {3}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: symbol kind, 1: symbol, 2: symbol kind, 3: symbol kind, 4: symbol
+compiler.err.already.defined.in.clinit={0} {1}\u306F\u3059\u3067\u306B{3} {4}\u306E{2}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
 
 # 0: string
 compiler.err.already.defined.single.import={0}\u306F\u5358\u4E00\u306E\u578B\u30A4\u30F3\u30DD\u30FC\u30C8\u5BA3\u8A00\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
@@ -109,28 +112,84 @@
 # 0: type
 compiler.err.array.req.but.found=\u914D\u5217\u304C\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001{0}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F
 
-compiler.err.assignment.from.super-bound=\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9{0}\u304B\u3089\u4EE3\u5165\u3057\u3066\u3044\u307E\u3059
-
-compiler.err.assignment.to.extends-bound=\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9{0}\u3078\u4EE3\u5165\u3057\u3066\u3044\u307E\u3059
-
 compiler.err.attribute.value.must.be.constant=\u5C5E\u6027\u306E\u5024\u306F\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
+# 0: statement type
+compiler.err.bad.initializer={0}\u306E\u4E0D\u6B63\u306A\u521D\u671F\u5316\u5B50
+
 compiler.err.break.outside.switch.loop=break\u304Cswitch\u6587\u307E\u305F\u306F\u30EB\u30FC\u30D7\u306E\u5916\u306B\u3042\u308A\u307E\u3059
 
 # 0: name
 compiler.err.call.must.be.first.stmt.in.ctor={0}\u306E\u547C\u51FA\u3057\u306F\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5148\u982D\u6587\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
-compiler.err.cant.apply.symbol={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}
-
 # 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
-compiler.err.cant.apply.symbol.1={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}\n\u7406\u7531: {6}
+compiler.err.cant.apply.symbol={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}\n\u7406\u7531: {6}
 
 # 0: symbol kind, 1: name, 2: list of type
 compiler.err.cant.apply.symbols={1}\u306B\u9069\u5207\u306A{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093({2})
 
+# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
+compiler.misc.cant.apply.symbol={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}\n\u7406\u7531: {6}
+
+# 0: symbol kind, 1: name, 2: list of type
+compiler.misc.cant.apply.symbols={1}\u306B\u9069\u5207\u306A{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093({2})
+
+# 0: symbol kind, 1: symbol
+compiler.misc.no.abstracts={0} {1}\u3067\u62BD\u8C61\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
+
+# 0: symbol kind, 1: symbol
+compiler.misc.incompatible.abstracts={0} {1}\u3067\u8907\u6570\u306E\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u306A\u3044\u62BD\u8C61\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F
+
+compiler.err.bad.functional.intf.anno=\u4E88\u671F\u3057\u306A\u3044@FunctionalInterface\u6CE8\u91C8
+
+# 0: message segment
+compiler.err.bad.functional.intf.anno.1=\u4E88\u671F\u3057\u306A\u3044@FunctionalInterface\u6CE8\u91C8\n{0}
+
+# 0: symbol
+compiler.misc.not.a.functional.intf={0}\u306F\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
+
+# 0: symbol, 1: message segment
+compiler.misc.not.a.functional.intf.1={0}\u306F\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\n{1}
+
+# 0: symbol, 1: symbol kind, 2: symbol
+compiler.misc.invalid.generic.lambda.target=\u30E9\u30E0\u30C0\u5F0F\u306E\u6A5F\u80FD\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u304C\u7121\u52B9\u3067\u3059\n{1} {2}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u306F\u6C4E\u7528\u3067\u3059
+
+# 0: symbol kind, 1: symbol
+compiler.misc.incompatible.descs.in.functional.intf={0} {1}\u3067\u4E0D\u9069\u5408\u306A\u6A5F\u80FD\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F
+
+# 0: name, 1: list of type, 2: type, 3: list of type
+compiler.misc.descriptor=\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF: {2} {0}({1})
+
+# 0: name, 1: list of type, 2: type, 3: list of type
+compiler.misc.descriptor.throws=\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF: {2} {0}({1})\u3067{3}\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3059
+
+# 0: type
+compiler.misc.no.suitable.functional.intf.inst={0}\u306E\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093
+
+# 0: type
+compiler.misc.secondary.bound.must.be.marker.intf=\u30BB\u30AB\u30F3\u30C0\u30EA\u30FB\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30DE\u30FC\u30AB\u30FC\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+
+# 0: symbol kind, 1: message segment
+compiler.err.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\u3002{1}
+
+# 0: symbol kind, 1: message segment
+compiler.misc.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\u3002{1}
+
+compiler.misc.static.mref.with.targs=static\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u5316\u3055\u308C\u305F\u4FEE\u98FE\u5B50
+
+compiler.misc.static.bound.mref=static\u306E\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167
+
 # 0: symbol
 compiler.err.cant.assign.val.to.final.var=final\u5909\u6570{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
+# 0: symbol, 1: message segment
+compiler.err.cant.ref.non.effectively.final.var={1}\u304B\u3089\u53C2\u7167\u3055\u308C\u308B\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u306F\u3001final\u307E\u305F\u306F\u4E8B\u5B9F\u4E0A\u306Efinal\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+
+
+compiler.misc.lambda=\u30E9\u30E0\u30C0\u5F0F
+
+compiler.misc.inner.cls=\u5185\u90E8\u30AF\u30E9\u30B9
+
 # 0: type
 compiler.err.cant.deref={0}\u306F\u9593\u63A5\u53C2\u7167\u3067\u304D\u307E\u305B\u3093
 
@@ -142,8 +201,6 @@
 # 0: symbol
 compiler.err.cant.ref.before.ctor.called=\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u547C\u51FA\u3057\u524D\u306F{0}\u3092\u53C2\u7167\u3067\u304D\u307E\u305B\u3093
 
-compiler.err.cant.ret.val.from.meth.decl.void=\u623B\u308A\u5024\u306E\u578B\u304Cvoid\u306E\u30E1\u30BD\u30C3\u30C9\u304B\u3089\u306F\u5024\u3092\u8FD4\u305B\u307E\u305B\u3093
-
 compiler.err.cant.select.static.class.from.param.type=\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3055\u308C\u305F\u578B\u304B\u3089static\u30AF\u30E9\u30B9\u3092\u9078\u629E\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
 # 0: symbol, 1: string, 2: string
@@ -154,6 +211,8 @@
 # 0: symbol kind, 1: symbol
 compiler.err.clash.with.pkg.of.same.name={0} {1}\u306F\u540C\u540D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u7AF6\u5408\u3057\u307E\u3059
 
+compiler.err.class.not.allowed=\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u307E\u305F\u306F\u5217\u6319\u578B\u306E\u5BA3\u8A00\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
+
 compiler.err.const.expr.req=\u5B9A\u6570\u5F0F\u304C\u5FC5\u8981\u3067\u3059
 
 compiler.err.cont.outside.loop=continue\u304C\u30EB\u30FC\u30D7\u306E\u5916\u306B\u3042\u308A\u307E\u3059
@@ -169,10 +228,8 @@
 # 0: type
 compiler.err.no.superclass={0}\u306B\u306F\u30B9\u30FC\u30D1\u30FC\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u305B\u3093
 
-compiler.err.wrong.target.for.polymorphic.signature.definition=MethodHandle API\u306E\u4F5C\u6210\u306B\u306F-target 7\u30E9\u30F3\u30BF\u30A4\u30E0\u4EE5\u4E0A\u304C\u5FC5\u8981\u3067\u3059\u3002\u73FE\u5728\u306F-target {0}\u3067\u3059
-
 # 0: symbol, 1: type, 2: symbol, 3: type, 4: unused
-compiler.err.concrete.inheritance.conflict={1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u3068{3}\u306E{2}\u306F\u540C\u3058\u30B7\u30B0\u30CB\u30C1\u30E3\u304B\u3089\u7D99\u627F\u3055\u308C\u3066\u3044\u307E\u3059
+compiler.err.concrete.inheritance.conflict={1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u3068{3}\u306E{2}\u306F\u540C\u3058\u30B7\u30B0\u30CD\u30C1\u30E3\u304B\u3089\u7D99\u627F\u3055\u308C\u3066\u3044\u307E\u3059
 
 compiler.err.default.allowed.in.intf.annotation.member=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306F@interface\u30E1\u30F3\u30D0\u30FC\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059
 
@@ -181,9 +238,48 @@
 
 compiler.err.duplicate.annotation=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059
 
+# 0: type
+compiler.err.duplicate.annotation.invalid.repeated=\u6CE8\u91C8{0}\u3092\u7E70\u308A\u8FD4\u305B\u307E\u305B\u3093\n\u6709\u52B9\u306A\u5305\u542B\u3059\u308B\u6CE8\u91C8\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
+
 # 0: name, 1: type
 compiler.err.duplicate.annotation.member.value={1}\u306E\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC\u306E\u5024{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059
 
+# 0: type, 1: type
+compiler.err.duplicate.annotation.missing.container=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306E\u5BA3\u8A00\u306B\u306F\u6709\u52B9\u306A{1}\u6CE8\u91C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+# 0: type
+compiler.err.invalid.repeatable.annotation=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u7121\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u6CE8\u91C8\u3067\u6CE8\u91C8\u4ED8\u3051\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: type
+compiler.err.invalid.repeatable.annotation.no.value=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5024\u8981\u7D20\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+# 0: type, 1: number
+compiler.err.invalid.repeatable.annotation.multiple.values=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002{1}\u5024\u8981\u7D20\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: type
+compiler.err.invalid.repeatable.annotation.invalid.value=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5024\u8981\u7D20\u304C\u7121\u52B9\u3067\u3059\u3002\u30E1\u30BD\u30C3\u30C9\u304C\u5FC5\u8981\u3067\u3059
+
+# 0: type, 1: type, 2: type
+compiler.err.invalid.repeatable.annotation.value.return=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002\u5305\u542B\u3059\u308B\u6CE8\u91C8{0}\u306E\u5024\u8981\u7D20\u306B\u306F\u578B{2}\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002{1}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F
+
+# 0: type, 1: symbol
+compiler.err.invalid.repeatable.annotation.elem.nondefault=\u5305\u542B\u3059\u308B\u6CE8\u91C8{0}\u306B\u306F\u8981\u7D20{1}\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+# 0: symbol, 1: type, 2: symbol, 3: type
+compiler.err.invalid.repeatable.annotation.retention=\u5305\u542B\u3059\u308B\u6CE8\u91C8{0}\u306B\u306F\u3001\u4FDD\u6709{3}\u3092\u542B\u3080\u5305\u542B\u3055\u308C\u305F\u6CE8\u91C8{2}\u3088\u308A\u77ED\u3044\u4FDD\u6709({1})\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: symbol, 1: symbol
+compiler.err.invalid.repeatable.annotation.not.documented=\u7E70\u308A\u8FD4\u3055\u308C\u305F\u6CE8\u91C8{1}\u306F@Documented\u3067\u3059\u304C\u3001\u5305\u542B\u3059\u308B\u6CE8\u91C8\u30BF\u30A4\u30D7{0}\u306F\u9055\u3044\u307E\u3059
+
+# 0: symbol, 1: symbol
+compiler.err.invalid.repeatable.annotation.not.inherited=\u308A\u8FD4\u3055\u308C\u305F\u6CE8\u91C8\u30BF\u30A4\u30D7{1}\u306F@Inherited\u3067\u3059\u304C\u3001\u5305\u542B\u3059\u308B\u6CE8\u91C8\u30BF\u30A4\u30D7{0}\u306F\u9055\u3044\u307E\u3059
+
+# 0: symbol, 1: symbol
+compiler.err.invalid.repeatable.annotation.incompatible.target=\u30B3\u30F3\u30C6\u30CA\u6CE8\u91C8{0}\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u306F\u3001\u7E70\u308A\u8FD4\u3055\u308C\u305F\u6CE8\u91C8{1}\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u30B5\u30D6\u30BB\u30C3\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
+
+# 0: symbol
+compiler.err.invalid.repeatable.annotation.repeated.and.container.present=\u30B3\u30F3\u30C6\u30CA{0}\u306F\u542B\u307E\u308C\u3066\u3044\u308B\u8981\u7D20\u3068\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093
+
 # 0: name
 compiler.err.duplicate.class=\u30AF\u30E9\u30B9{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059
 
@@ -245,10 +341,10 @@
 compiler.err.generic.throwable=\u6C4E\u7528\u30AF\u30E9\u30B9\u306Fjava.lang.Throwable\u3092\u62E1\u5F35\u3067\u304D\u307E\u305B\u3093
 
 # 0: symbol
-compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u30AF\u30E9\u30B9{0}\u306E\u9759\u7684\u5BA3\u8A00\u304C\u4E0D\u6B63\u3067\u3059\n\u4FEE\u98FE\u5B50\''static\''\u306F\u5B9A\u6570\u304A\u3088\u3073\u5909\u6570\u306E\u5BA3\u8A00\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059
+compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u30AF\u30E9\u30B9{0}\u306E\u9759\u7684\u5BA3\u8A00\u304C\u4E0D\u6B63\u3067\u3059\n\u4FEE\u98FE\u5B50''static''\u306F\u5B9A\u6570\u304A\u3088\u3073\u5909\u6570\u306E\u5BA3\u8A00\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059
 
 # 0: string
-compiler.err.illegal.char=\\{0}\u306F\u4E0D\u6B63\u306A\u6587\u5B57\u3067\u3059
+compiler.err.illegal.char=''{0}''\u306F\u4E0D\u6B63\u306A\u6587\u5B57\u3067\u3059
 
 compiler.err.illegal.char.for.encoding=\u3053\u306E\u6587\u5B57\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306B\u30DE\u30C3\u30D7\u3067\u304D\u307E\u305B\u3093
 
@@ -280,11 +376,15 @@
 
 compiler.err.illegal.underscore=\u4E0D\u6B63\u306A\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u3067\u3059
 
+compiler.err.illegal.dot=\u4E0D\u6B63\u306A''.''\u3067\u3059
+
 # 0: symbol
 compiler.err.illegal.qual.not.icls=\u4FEE\u98FE\u5B50\u304C\u4E0D\u6B63\u3067\u3059\u3002{0}\u306F\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 
 compiler.err.illegal.start.of.expr=\u5F0F\u306E\u958B\u59CB\u304C\u4E0D\u6B63\u3067\u3059
 
+compiler.err.illegal.start.of.stmt=\u6587\u306E\u958B\u59CB\u304C\u4E0D\u6B63\u3067\u3059
+
 compiler.err.illegal.start.of.type=\u578B\u306E\u958B\u59CB\u304C\u4E0D\u6B63\u3067\u3059
 
 compiler.err.illegal.unicode.esc=Unicode\u30A8\u30B9\u30B1\u30FC\u30D7\u304C\u4E0D\u6B63\u3067\u3059
@@ -302,8 +402,6 @@
 # 0: number
 compiler.err.int.number.too.large=\u6574\u6570{0}\u304C\u5927\u304D\u3059\u304E\u307E\u3059
 
-compiler.err.internal.error.cant.instantiate=\u5185\u90E8\u30A8\u30E9\u30FC\u3067\u3059\u3002{0}\u3092{1}\u3067({2})\u306B\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u751F\u6210\u3067\u304D\u307E\u305B\u3093
-
 compiler.err.intf.annotation.members.cant.have.params=@interface\u30E1\u30F3\u30D0\u30FC\u304C\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
 compiler.err.intf.annotation.cant.have.type.params=@interface\u304C\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
@@ -315,7 +413,7 @@
 
 compiler.err.intf.expected.here=\u3053\u3053\u306B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304C\u5FC5\u8981\u3067\u3059
 
-compiler.err.intf.meth.cant.have.body=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
+compiler.err.intf.meth.cant.have.body=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u62BD\u8C61\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
 compiler.err.invalid.annotation.member.type=\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059
 
@@ -327,6 +425,8 @@
 
 compiler.err.varargs.and.old.array.syntax=\u65E7\u5F0F\u306E\u914D\u5217\u8868\u8A18\u6CD5\u306F\u53EF\u5909\u5F15\u6570\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
 
+compiler.err.variable.not.allowed=\u5909\u6570\u306E\u5BA3\u8A00\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
+
 # 0: name
 compiler.err.label.already.in.use=\u30E9\u30D9\u30EB{0}\u306F\u3059\u3067\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059
 
@@ -337,6 +437,8 @@
 
 compiler.err.cannot.create.array.with.type.arguments=\u578B\u5F15\u6570\u3092\u6301\u3064\u914D\u5217\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
 
+compiler.err.cannot.create.array.with.diamond=''<>''\u3092\u6301\u3064\u914D\u5217\u306F\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
+
 #
 # limits.  We don't give the limits in the diagnostic because we expect
 # them to change, yet we want to use the same diagnostic.  These are all
@@ -360,7 +462,7 @@
 
 compiler.err.limit.string=\u5B9A\u6570\u6587\u5B57\u5217\u304C\u9577\u3059\u304E\u307E\u3059
 
-compiler.err.limit.string.overflow=\u6587\u5B57\u5217\"{0}...\"\u306EUTF8\u8868\u73FE\u304C\u3001\u5B9A\u6570\u30D7\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u9577\u3059\u304E\u307E\u3059
+compiler.err.limit.string.overflow=\u6587\u5B57\u5217"{0}..."\u306EUTF8\u8868\u73FE\u304C\u3001\u5B9A\u6570\u30D7\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u9577\u3059\u304E\u307E\u3059
 
 compiler.err.malformed.fp.lit=\u6D6E\u52D5\u5C0F\u6570\u70B9\u30EA\u30C6\u30E9\u30EB\u304C\u4E0D\u6B63\u3067\u3059
 
@@ -370,7 +472,9 @@
 
 compiler.err.missing.ret.stmt=return\u6587\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 
-compiler.err.missing.ret.val=\u623B\u308A\u5024\u304C\u3042\u308A\u307E\u305B\u3093
+compiler.misc.missing.ret.val=\u623B\u308A\u5024\u304C\u3042\u308A\u307E\u305B\u3093
+
+compiler.misc.unexpected.ret.val=\u4E88\u671F\u3057\u306A\u3044\u623B\u308A\u5024
 
 # 0: set of modifier
 compiler.err.mod.not.allowed.here=\u4FEE\u98FE\u5B50{0}\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
@@ -396,7 +500,26 @@
 compiler.err.native.meth.cant.have.body=native\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
 # 0: type, 1: type
-compiler.err.neither.conditional.subtype=?\u306B\u5BFE\u3059\u308B\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B : \u3069\u3061\u3089\u3082\u4ED6\u65B9\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n2\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {0}\n3\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {1}
+compiler.err.neither.conditional.subtype=?\u306B\u5BFE\u3059\u308B\u4E0D\u9069\u5408\u306A\u578B : \u3069\u3061\u3089\u3082\u4ED6\u65B9\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n2\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {0}\n3\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {1}
+
+# 0: message segment
+compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u5F0F\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059\u3002{0}
+
+compiler.misc.conditional.target.cant.be.void=\u6761\u4EF6\u5F0F\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306Fvoid\u306B\u3067\u304D\u307E\u305B\u3093
+
+# 0: type
+compiler.misc.incompatible.ret.type.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u306E\u623B\u308A\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0}
+
+# 0: type
+compiler.misc.incompatible.ret.type.in.mref=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u623B\u308A\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0}
+
+# 0: list of type
+compiler.err.incompatible.thrown.types.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u3067\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u4E0D\u9069\u5408\u3067\u3059
+
+# 0: list of type
+compiler.err.incompatible.thrown.types.in.mref=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u4E0D\u9069\u5408\u3067\u3059
+
+compiler.misc.incompatible.arg.types.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u578B\u306F\u4E0D\u9069\u5408\u3067\u3059
 
 compiler.err.new.not.allowed.in.annotation=''new''\u306F\u6CE8\u91C8\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
 
@@ -414,6 +537,12 @@
 compiler.err.not.def.access.class.intf.cant.access={1}\u306E{0}\u304C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
 
 # 0: symbol, 1: symbol
+compiler.misc.not.def.access.class.intf.cant.access={1}\u306E{0}\u304C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: symbol, 1: list of type, 2: type
+compiler.misc.cant.access.inner.cls.constr=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF{0}({1})\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u56F2\u3080\u578B{2}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u30B9\u30B3\u30FC\u30D7\u5185\u306B\u3042\u308A\u307E\u305B\u3093
+
+# 0: symbol, 1: symbol
 compiler.err.not.def.public.cant.access={1}\u306E{0}\u306Fpublic\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u5916\u304B\u3089\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093
 
 # 0: name
@@ -440,7 +569,7 @@
 # Errors related to annotation processing
 
 # 0: symbol, 1: string, 2: stack-trace
-compiler.err.proc.cant.access={0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n{1}\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n{2}
+compiler.err.proc.cant.access={0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n{1}\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n{2}
 
 # 0: symbol, 1: string
 compiler.err.proc.cant.access.1={0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n{1}
@@ -455,15 +584,13 @@
 # 0: list of string
 compiler.err.proc.no.explicit.annotation.processing.requested=\u30AF\u30E9\u30B9\u540D''{0}''\u304C\u53D7\u3051\u5165\u308C\u3089\u308C\u308B\u306E\u306F\u3001\u6CE8\u91C8\u51E6\u7406\u304C\u660E\u793A\u7684\u306B\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u305F\u5834\u5408\u306E\u307F\u3067\u3059
 
-compiler.err.proc.no.service=\u30B5\u30FC\u30D3\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u30FB\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\njava.util.ServiceLoader\u304Bsun.misc.Service\u304C\u4F7F\u7528\u3067\u304D\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
+compiler.err.proc.no.service=\u30B5\u30FC\u30D3\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u304C\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u304C\u3001\u6CE8\u91C8\u51E6\u7406\u306B\u5FC5\u8981\u3067\u3059\u3002
 
 compiler.err.proc.processor.bad.option.name=\u30D7\u30ED\u30BB\u30C3\u30B5''{1}''\u306B\u3088\u3063\u3066\u6307\u5B9A\u3055\u308C\u305F\u30AA\u30D7\u30B7\u30E7\u30F3\u540D''{0}''\u304C\u4E0D\u6B63\u3067\u3059
 
 # 0: string
 compiler.err.proc.processor.cant.instantiate=\u30D7\u30ED\u30BB\u30C3\u30B5''{0}''\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
 
-compiler.err.proc.processor.constructor.error=\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u69CB\u7BC9\u4E2D\u306B\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F: {0}
-
 # 0: string
 compiler.err.proc.processor.not.found=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 
@@ -482,7 +609,10 @@
 compiler.err.recursive.ctor.invocation=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u547C\u51FA\u3057\u304C\u518D\u5E30\u7684\u3067\u3059
 
 # 0: name, 1: symbol kind, 2: symbol, 3: symbol, 4: symbol kind, 5: symbol, 6: symbol
-compiler.err.ref.ambiguous={0}\u306E\u53C2\u7167\u306F\u3042\u3044\u307E\u3044\u3067\u3059\u3002{3}\u306E{1} {2}\u3068{6}\u306E{4} {5}\u304C\u4E21\u65B9\u9069\u5408\u3057\u307E\u3059
+compiler.err.ref.ambiguous={0}\u306E\u53C2\u7167\u306F\u3042\u3044\u307E\u3044\u3067\u3059\n{3}\u306E{1} {2}\u3068{6}\u306E{4} {5}\u306E\u4E21\u65B9\u304C\u4E00\u81F4\u3057\u307E\u3059
+
+# 0: name, 1: symbol kind, 2: symbol, 3: symbol, 4: symbol kind, 5: symbol, 6: symbol
+compiler.misc.ref.ambiguous={0}\u306E\u53C2\u7167\u306F\u3042\u3044\u307E\u3044\u3067\u3059\n{3}\u306E{1} {2}\u3068{6}\u306E{4} {5}\u306E\u4E21\u65B9\u304C\u4E00\u81F4\u3057\u307E\u3059
 
 compiler.err.repeated.annotation.target=\u6CE8\u91C8\u30BF\u30FC\u30B2\u30C3\u30C8\u304C\u7E70\u308A\u8FD4\u3055\u308C\u3066\u3044\u307E\u3059
 
@@ -495,9 +625,9 @@
 
 compiler.err.ret.outside.meth=\u30E1\u30BD\u30C3\u30C9\u306E\u5916\u306Ereturn\u6587\u3067\u3059
 
-compiler.err.signature.doesnt.match.supertype=\u30B7\u30B0\u30CB\u30C1\u30E3\u304C{0}\u306B\u9069\u5408\u3057\u307E\u305B\u3093\u3002\u4E92\u63DB\u6027\u306E\u306A\u3044\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u3067\u3059
-
-compiler.err.signature.doesnt.match.intf=\u30B7\u30B0\u30CB\u30C1\u30E3\u304C{0}\u306B\u9069\u5408\u3057\u307E\u305B\u3093\u3002\u4E92\u63DB\u6027\u306E\u306A\u3044\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3059
+compiler.err.signature.doesnt.match.supertype=\u30B7\u30B0\u30CD\u30C1\u30E3\u304C{0}\u306B\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u4E0D\u9069\u5408\u306A\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u3067\u3059
+
+compiler.err.signature.doesnt.match.intf=\u30B7\u30B0\u30CD\u30C1\u30E3\u304C{0}\u306B\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u4E0D\u9069\u5408\u306A\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3059
 
 # 0: symbol, 1: symbol, 2: symbol
 compiler.err.does.not.override.abstract={0}\u306Fabstract\u3067\u306A\u304F\u3001{2}\u5185\u306Eabstract\u30E1\u30BD\u30C3\u30C9{1}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u305B\u3093
@@ -534,7 +664,28 @@
 compiler.err.type.var.more.than.once.in.result=\u578B\u5909\u6570{0}\u306F{1}\u306E\u578B\u30672\u56DE\u4EE5\u4E0A\u51FA\u73FE\u3057\u307E\u3059\u3002\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u751F\u6210\u3055\u308C\u306A\u3044\u307E\u307E\u306B\u306F\u3067\u304D\u307E\u305B\u3093
 
 # 0: type, 1: type, 2: string
-compiler.err.types.incompatible.diff.ret=\u578B{0}\u3068\u578B{1}\u306E\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u4E21\u65B9\u3068\u3082{2}\u3092\u5B9A\u7FA9\u3057\u3066\u3044\u307E\u3059\u304C\u3001\u623B\u308A\u5024\u306E\u578B\u304C\u7121\u95A2\u4FC2\u3067\u3059
+compiler.err.types.incompatible.diff.ret=\u578B{0}\u3068\u578B{1}\u304C\u9069\u5408\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u4E21\u65B9\u3068\u3082{2}\u3092\u5B9A\u7FA9\u3057\u3066\u3044\u307E\u3059\u304C\u3001\u623B\u308A\u5024\u306E\u578B\u304C\u7121\u95A2\u4FC2\u3067\u3059
+
+# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+compiler.err.types.incompatible.unrelated.defaults={0} {1}\u306F\u578B{4}\u3068{5}\u304B\u3089{2}({3})\u306E\u95A2\u9023\u3057\u306A\u3044\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u7D99\u627F\u3057\u307E\u3059
+
+# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+compiler.err.types.incompatible.abstract.default={0} {1}\u306F\u578B{4}\u3068{5}\u304B\u3089{2}({3})\u306E\u62BD\u8C61\u3068\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u7D99\u627F\u3057\u307E\u3059
+
+# 0: name, 1: kind, 2: symbol
+compiler.err.default.overrides.object.member={1} {2}\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9{0}\u306Fjava.lang.Object\u306E\u30E1\u30F3\u30D0\u30FC\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059
+
+# 0: type
+compiler.err.illegal.static.intf.meth.call=static\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9\u30FB\u30B3\u30FC\u30EB\u304C\u4E0D\u6B63\u3067\u3059\n\u53D7\u4FE1\u5F0F\u306F\u578B\u4FEE\u98FE\u5B50''{0}''\u3067\u7F6E\u63DB\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+
+# 0: type, 1: message segment
+compiler.err.illegal.default.super.call=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30B9\u30FC\u30D1\u30FC\u30FB\u30B3\u30FC\u30EB\u306E\u578B\u4FEE\u98FE\u5B50{0}\u304C\u4E0D\u6B63\u3067\u3059\n{1}
+
+# 0: symbol, 1: type
+compiler.misc.overridden.default={1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u307E\u3059
+
+# 0: symbol, 1: symbol
+compiler.misc.redundant.supertype=\u5197\u9577\u306A\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u306F{1}\u306B\u3088\u3063\u3066\u62E1\u5F35\u3055\u308C\u307E\u3057\u305F
 
 compiler.err.unclosed.char.lit=\u6587\u5B57\u30EA\u30C6\u30E9\u30EB\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093
 
@@ -550,19 +701,14 @@
 # 0: name
 compiler.err.undef.label=\u30E9\u30D9\u30EB{0}\u306F\u672A\u5B9A\u7FA9\u3067\u3059
 
-compiler.err.undetermined.type={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093
-
-# 0: type, 1: message segment
-compiler.err.undetermined.type.1={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\n\u7406\u7531: {1}
-
-# 0: list of type, 1: message segment
-compiler.err.invalid.inferred.types={0}\u306E\u63A8\u5B9A\u578B\u304C\u7121\u52B9\u3067\u3059\u3002{1}
-
 # 0: message segment, 1: unused
-compiler.err.cant.apply.diamond={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093
-
-# 0: message segment, 1: message segment
-compiler.err.cant.apply.diamond.1={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\n\u7406\u7531: {1}
+compiler.err.cant.apply.diamond={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093
+
+# 0: message segment or type, 1: message segment
+compiler.err.cant.apply.diamond.1={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093\n\u7406\u7531: {1}
+
+# 0: message segment or type, 1: message segment
+compiler.misc.cant.apply.diamond.1={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093\n\u7406\u7531: {1}
 
 compiler.err.unreachable.stmt=\u3053\u306E\u6587\u306B\u5236\u5FA1\u304C\u79FB\u308B\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093
 
@@ -605,7 +751,7 @@
 # 0: symbol
 compiler.misc.varargs.trustme.on.virtual.varargs=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9{0}\u306Ffinal\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
 
-# 0: type, 1: kind, 2: symbol
+# 0: type, 1: symbol kind, 2: symbol
 compiler.misc.inaccessible.varargs.type=\u4EEE\u53EF\u5909\u5F15\u6570\u8981\u7D20\u578B{0}\u306F{1} {2}\u304B\u3089\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093
 
 # In the following string, {1} will always be the detail message from
@@ -620,7 +766,7 @@
 
 ## All errors which do not refer to a particular line in the source code are
 ## preceded by this string.
-compiler.err.error=\u30A8\u30E9\u30FC:\u0020
+compiler.err.error=\u30A8\u30E9\u30FC: 
 
 # The following error messages do not refer to a line in the source code.
 compiler.err.cant.read.file={0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093
@@ -637,7 +783,7 @@
 
 compiler.misc.fatal.err.cant.locate.ctor=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: {0}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3092\u691C\u51FA\u3067\u304D\u307E\u305B\u3093
 
-compiler.misc.fatal.err.cant.close.loader=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: \u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u306E\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u3092\u9589\u3058\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093
+compiler.misc.fatal.err.cant.close=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: \u30B3\u30F3\u30D1\u30A4\u30E9\u30FB\u30EA\u30BD\u30FC\u30B9\u3092\u9589\u3058\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093
 
 #####
 
@@ -659,21 +805,24 @@
 
 ## The following string will appear before all messages keyed as:
 ## "compiler.note".
+
+compiler.note.potential.lambda.found=\u3053\u306E\u533F\u540D\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u30E9\u30E0\u30C0\u5F0F\u306B\u5909\u63DB\u3067\u304D\u307E\u3059\u3002
+
 compiler.note.note=\u6CE8\u610F:
 
 # 0: file name
-compiler.note.deprecated.filename={0}\u306F\u63A8\u5968\u3055\u308C\u306A\u3044API\u3092\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002
-
-compiler.note.deprecated.plural=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u63A8\u5968\u3055\u308C\u306A\u3044API\u3092\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002
+compiler.note.deprecated.filename={0}\u306F\u975E\u63A8\u5968\u306EAPI\u3092\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002
+
+compiler.note.deprecated.plural=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u975E\u63A8\u5968\u306EAPI\u3092\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002
 
 # The following string may appear after one of the above deprecation
 # messages.
 compiler.note.deprecated.recompile=\u8A73\u7D30\u306F\u3001-Xlint:deprecation\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 
 # 0: file name
-compiler.note.deprecated.filename.additional={0}\u306B\u63A8\u5968\u3055\u308C\u306A\u3044API\u306E\u8FFD\u52A0\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u304C\u3042\u308A\u307E\u3059\u3002
-
-compiler.note.deprecated.plural.additional=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u63A8\u5968\u3055\u308C\u306A\u3044API\u3092\u8FFD\u52A0\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002
+compiler.note.deprecated.filename.additional={0}\u306B\u975E\u63A8\u5968\u306EAPI\u306E\u8FFD\u52A0\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u304C\u3042\u308A\u307E\u3059\u3002
+
+compiler.note.deprecated.plural.additional=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u975E\u63A8\u5968\u306EAPI\u3092\u8FFD\u52A0\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002
 
 # 0: file name
 compiler.note.unchecked.filename={0}\u306E\u64CD\u4F5C\u306F\u3001\u672A\u30C1\u30A7\u30C3\u30AF\u307E\u305F\u306F\u5B89\u5168\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
@@ -773,12 +922,12 @@
 ##
 
 ## All warning messages are preceded by the following string.
-compiler.warn.warning=\u8B66\u544A:
+compiler.warn.warning=\u8B66\u544A: 
 
 ## Warning messages may also include the following prefix to identify a
 ## lint option
 # 0: option name
-compiler.warn.lintOption=[{0}]\u0020
+compiler.warn.lintOption=[{0}] 
 
 # 0: symbol
 compiler.warn.constant.SVUID=serialVersionUID\u306F\u30AF\u30E9\u30B9{0}\u306E\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
@@ -789,7 +938,7 @@
 compiler.warn.finally.cannot.complete=finally\u7BC0\u304C\u6B63\u5E38\u306B\u5B8C\u4E86\u3067\u304D\u307E\u305B\u3093
 
 # 0: symbol, 1: symbol
-compiler.warn.has.been.deprecated={1}\u306E{0}\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093
+compiler.warn.has.been.deprecated={1}\u306E{0}\u306F\u975E\u63A8\u5968\u306B\u306A\u308A\u307E\u3057\u305F
 
 # 0: symbol
 compiler.warn.sun.proprietary={0}\u306F\u5185\u90E8\u6240\u6709\u306EAPI\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
@@ -925,7 +1074,7 @@
 # 0: symbol
 compiler.warn.varargs.unsafe.use.varargs.param=\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u306F\u3001\u578B\u60C5\u5831\u4FDD\u6301\u53EF\u80FD\u3067\u306A\u3044\u53EF\u5909\u5F15\u6570\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u304B\u3089\u306E\u30D2\u30FC\u30D7\u6C5A\u67D3\u306E\u539F\u56E0\u3068\u306A\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
 
-compiler.warn.missing.deprecated.annotation=\u63A8\u5968\u3055\u308C\u306A\u3044\u9805\u76EE\u306F@Deprecated\u3067\u6CE8\u91C8\u304C\u4ED8\u3051\u3089\u308C\u3066\u3044\u307E\u305B\u3093
+compiler.warn.missing.deprecated.annotation=\u975E\u63A8\u5968\u306E\u9805\u76EE\u306F@Deprecated\u3067\u6CE8\u91C8\u304C\u4ED8\u3051\u3089\u308C\u3066\u3044\u307E\u305B\u3093
 
 compiler.warn.invalid.archive.file=\u30D1\u30B9\u4E0A\u306E\u4E88\u671F\u3057\u306A\u3044\u30D5\u30A1\u30A4\u30EB: {0}
 
@@ -952,7 +1101,7 @@
 compiler.warn.diamond.redundant.args=\u65B0\u3057\u3044\u5F0F\u306E\u578B\u5F15\u6570\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059(\u304B\u308F\u308A\u306B\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u3092\u4F7F\u7528\u3057\u307E\u3059)\u3002
 
 # 0: type, 1: type
-compiler.warn.diamond.redundant.args.1=\u65B0\u3057\u3044\u5F0F\u306E\u578B\u5F15\u6570\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059(\u304B\u308F\u308A\u306B\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u3092\u4F7F\u7528\u3057\u307E\u3059)\u3002\n\u660E\u793A\u7684: {0}\n\u63A8\u5B9A: {1}
+compiler.warn.diamond.redundant.args.1=\u65B0\u3057\u3044\u5F0F\u306E\u578B\u5F15\u6570\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059(\u304B\u308F\u308A\u306B\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u3092\u4F7F\u7528\u3057\u307E\u3059)\u3002\n\u660E\u793A\u7684: {0}\n\u63A8\u8AD6: {1}
 
 # 0: symbol, 1: message segment
 compiler.warn.varargs.redundant.trustme.anno={0}\u6CE8\u91C8\u304C\u5197\u9577\u3067\u3059\u3002{1}
@@ -1030,7 +1179,7 @@
 
 ## The following are all possible strings for the second argument ({1}) of the
 ## above strings.
-compiler.misc.bad.class.signature=\u30AF\u30E9\u30B9{0}\u306E\u30B7\u30B0\u30CB\u30C1\u30E3\u304C\u4E0D\u6B63\u3067\u3059
+compiler.misc.bad.class.signature=\u30AF\u30E9\u30B9{0}\u306E\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u4E0D\u6B63\u3067\u3059
 
 #0: symbol, 1: symbol
 compiler.misc.bad.enclosing.class={0}\u306E\u5185\u90E8\u30AF\u30E9\u30B9\u304C\u4E0D\u6B63\u3067\u3059: {1}
@@ -1044,7 +1193,9 @@
 
 compiler.misc.bad.const.pool.tag.at=\u5B9A\u6570\u30D7\u30FC\u30EB\u30FB\u30BF\u30B0{1}\u3067\u306E{0}\u304C\u4E0D\u6B63\u3067\u3059
 
-compiler.misc.bad.signature=\u30B7\u30B0\u30CB\u30C1\u30E3{0}\u304C\u4E0D\u6B63\u3067\u3059
+compiler.misc.bad.signature=\u30B7\u30B0\u30CD\u30C1\u30E3{0}\u304C\u4E0D\u6B63\u3067\u3059
+
+compiler.misc.bad.type.annotation.value=\u6CE8\u91C8\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306E\u5024\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059: {0}
 
 compiler.misc.class.file.wrong.class=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0D\u6B63\u306A\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u3059
 
@@ -1077,24 +1228,17 @@
 
 #####
 
-# 0: message segment, 1: type, 2: type
-compiler.err.prob.found.req={0}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024:    {1}
+# 0: message segment
+compiler.err.prob.found.req=\u4E0D\u9069\u5408\u306A\u578B: {0}
 
 # 0: message segment, 1: type, 2: type
 compiler.warn.prob.found.req={0}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024:    {1}
 
-compiler.err.prob.found.req.1={0} {3}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024:    {1}
-
-## The following are all possible strings for the first argument ({0}) of the
-## above strings.
-compiler.misc.incompatible.types=\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B
-
-# 0: message segment
-compiler.misc.incompatible.types.1=\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B\u3002{0}
-
-compiler.misc.inconvertible.types=\u5909\u63DB\u3067\u304D\u306A\u3044\u578B
-
-compiler.misc.possible.loss.of.precision=\u7CBE\u5EA6\u304C\u4F4E\u4E0B\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027
+# 0: type, 1: type
+compiler.misc.inconvertible.types={0}\u3092{1}\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093:
+
+# 0: type, 1: type
+compiler.misc.possible.loss.of.precision=\u7CBE\u5EA6\u304C\u5931\u308F\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B{0}\u304B\u3089{1}\u3078\u306E\u5909\u63DB
 
 compiler.misc.unchecked.assign=\u7121\u691C\u67FB\u5909\u63DB
 
@@ -1104,16 +1248,13 @@
 #     assigned array cannot dynamically check its stores
 compiler.misc.unchecked.cast.to.type=\u7121\u691C\u67FB\u30AD\u30E3\u30B9\u30C8
 
-compiler.misc.assignment.from.super-bound=\u30B9\u30FC\u30D1\u30FC\u30D0\u30A6\u30F3\u30C9\u578B{0}\u304B\u3089\u306E\u4EE3\u5165
-
-compiler.misc.assignment.to.extends-bound=\u62E1\u5F35\u30D0\u30A6\u30F3\u30C9\u578B{0}\u3078\u306E\u4EE3\u5165
-
 # compiler.err.star.expected=\
 #     ''*'' expected
 # compiler.err.no.elem.type=\
 #     \[\*\] cannot have a type
 
-compiler.misc.try.not.applicable.to.type=try-with-resource\u306F\u5909\u6570\u578B\u306B\u9069\u7528\u3055\u308C\u307E\u305B\u3093
+# 0: type
+compiler.misc.try.not.applicable.to.type=try-with-resource\u306F\u5909\u6570\u578B\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\n({0})
 
 #####
 
@@ -1139,25 +1280,44 @@
 
 ## The following are all possible strings for the last argument of all those
 ## diagnostics whose key ends in ".1"
-compiler.misc.undetermined.type=\u672A\u5B9A\u578B
-
-compiler.misc.type.variable.has.undetermined.type=\u578B\u5909\u6570{0}\u306F\u672A\u5B9A\u578B\u3067\u3059
 
 # 0: type, 1: list of type
 compiler.misc.no.unique.maximal.instance.exists=\u578B\u5909\u6570{0}(\u4E0A\u9650{1})\u306E\u56FA\u6709\u306E\u6700\u5927\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093
 
 compiler.misc.no.unique.minimal.instance.exists=\u578B\u5909\u6570{0}(\u4E0B\u9650{1})\u306E\u56FA\u6709\u306E\u6700\u5C0F\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093
 
-# 0: list of type, 1: type, 2: type
-compiler.misc.infer.no.conforming.instance.exists=\u578B\u5909\u6570{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044\u306E\u3067\u3001{1}\u306F{2}\u306B\u9069\u5408\u3057\u307E\u305B\u3093
+# 0: type, 1: list of type
+compiler.misc.incompatible.upper.bounds=\u63A8\u8AD6\u5909\u6570{0}\u306B\u306F\u3001\u4E0D\u9069\u5408\u306A\u4E0A\u9650{1}\u304C\u3042\u308A\u307E\u3059
+
+# 0: type, 1: list of type, 2: list of type
+compiler.misc.incompatible.eq.upper.bounds=\u63A8\u8AD6\u5909\u6570{0}\u306B\u306F\u3001\u4E0D\u9069\u5408\u306A\u5883\u754C\u304C\u3042\u308A\u307E\u3059\n\u7B49\u4FA1\u5236\u7D04: {1}\n\u4E0A\u9650: {2}
+
+# 0: type, 1: list of type, 2: list of type
+compiler.misc.incompatible.eq.lower.bounds=\u63A8\u8AD6\u5909\u6570{0}\u306B\u306F\u3001\u4E0D\u9069\u5408\u306A\u5883\u754C\u304C\u3042\u308A\u307E\u3059\n\u7B49\u4FA1\u5236\u7D04: {1}\n\u4E0B\u9650: {2}
 
 # 0: list of type, 1: type, 2: type
-compiler.misc.infer.no.conforming.assignment.exists=\u578B\u5909\u6570{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044\u306E\u3067\u3001\u5F15\u6570\u578B{1}\u306F\u4EEE\u30D1\u30E9\u30E1\u30FC\u30BF\u578B{2}\u306B\u9069\u5408\u3057\u307E\u305B\u3093
-
-compiler.misc.infer.arg.length.mismatch=\u5B9F\u5F15\u6570\u30EA\u30B9\u30C8\u3068\u4EEE\u5F15\u6570\u30EA\u30B9\u30C8\u306E\u9577\u3055\u304C\u7570\u306A\u308B\u305F\u3081\u3001\u5F15\u6570\u304B\u3089\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
+compiler.misc.infer.no.conforming.instance.exists=\u578B\u5909\u6570{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044\u306E\u3067\u3001{1}\u306F{2}\u306B\u9069\u5408\u3057\u307E\u305B\u3093
+
+# 0: list of type, 1: message segment
+compiler.misc.infer.no.conforming.assignment.exists=\u578B\u5909\u6570{0}\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093\n(\u5F15\u6570\u306E\u4E0D\u4E00\u81F4: {1})
+
+# 0: list of type
+compiler.misc.infer.arg.length.mismatch=\u578B\u5909\u6570{0}\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093\n(\u5B9F\u5F15\u6570\u30EA\u30B9\u30C8\u3068\u4EEE\u5F15\u6570\u30EA\u30B9\u30C8\u306E\u9577\u3055\u304C\u7570\u306A\u308A\u307E\u3059)
+
+# 0: list of type, 1: message segment
+compiler.misc.infer.varargs.argument.mismatch=\u578B\u5909\u6570{0}\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093\n(\u53EF\u5909\u5F15\u6570\u306E\u4E0D\u4E00\u81F4: {1})
 
 # 0: type, 1: list of type
-compiler.misc.inferred.do.not.conform.to.bounds=\u63A8\u5B9A\u578B\u306F\u5BA3\u8A00\u3055\u308C\u305F\u5883\u754C\u306B\u9069\u5408\u3057\u307E\u305B\u3093\n\u63A8\u5B9A: {0}\n\u5883\u754C: {1}
+compiler.misc.inferred.do.not.conform.to.upper.bounds=\u63A8\u8AD6\u578B\u304C\u4E0A\u9650\u306B\u9069\u5408\u3057\u307E\u305B\u3093\n\u63A8\u8AD6: {0}\n\u4E0A\u9650: {1}
+
+# 0: type, 1: list of type
+compiler.misc.inferred.do.not.conform.to.lower.bounds=\u63A8\u8AD6\u578B\u304C\u4E0B\u9650\u306B\u9069\u5408\u3057\u307E\u305B\u3093\n\u63A8\u8AD6: {0}\n\u4E0B\u9650: {1}
+
+# 0: type, 1: list of type
+compiler.misc.inferred.do.not.conform.to.eq.bounds=\u63A8\u8AD6\u578B\u304C\u7B49\u4FA1\u5236\u7D04\u306B\u9069\u5408\u3057\u307E\u305B\u3093\n\u63A8\u8AD6: {0}\n\u7B49\u4FA1\u5236\u7D04: {1}
+
+# 0: list of type
+compiler.misc.cyclic.inference=\u63A8\u8AD6\u306E\u30EB\u30FC\u30D7\u306E\u305F\u3081\u3001\u63A8\u8AD6\u5909\u6570{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093
 
 # 0: symbol
 compiler.misc.diamond={0}<>
@@ -1165,6 +1325,7 @@
 # 0: type
 compiler.misc.diamond.non.generic=\u975E\u6C4E\u7528\u30AF\u30E9\u30B9{0}\u3067''<>''\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
+# 0: unused
 compiler.misc.diamond.and.explicit.params=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u660E\u793A\u7684\u306A\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F''<>''\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
 
 # 0: type, 1: list of type
@@ -1172,14 +1333,18 @@
 
 compiler.misc.arg.length.mismatch=\u5B9F\u5F15\u6570\u30EA\u30B9\u30C8\u3068\u4EEE\u5F15\u6570\u30EA\u30B9\u30C8\u306E\u9577\u3055\u304C\u7570\u306A\u308A\u307E\u3059
 
-# 0: type, 1: type
-compiler.misc.no.conforming.assignment.exists=\u5B9F\u5F15\u6570{0}\u306F\u30E1\u30BD\u30C3\u30C9\u547C\u51FA\u5909\u63DB\u306B\u3088\u3063\u3066{1}\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093
-
-# 0: type, 1: type
-compiler.misc.varargs.argument.mismatch=\u5F15\u6570\u578B{0}\u306F\u53EF\u5909\u5F15\u6570\u8981\u7D20\u578B{1}\u306B\u9069\u5408\u3057\u307E\u305B\u3093
+# 0: message segment
+compiler.misc.no.conforming.assignment.exists=\u5F15\u6570\u306E\u4E0D\u4E00\u81F4: {0}
+
+# 0: message segment
+compiler.misc.varargs.argument.mismatch=\u53EF\u5909\u5F15\u6570\u306E\u4E0D\u4E00\u81F4: {0}
 
 #####
 
+# 0: type, 1: file name
+compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file={1}\u306E\u88DC\u52A9\u30AF\u30E9\u30B9{0}\u306B\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u5916\u304B\u3089\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093
+
+
 ## The first argument ({0}) is a "kindname".
 # 0: symbol kind, 1: symbol, 2: symbol
 compiler.err.abstract.cant.be.accessed.directly=\u62BD\u8C61{0}\u3067\u3042\u308B{1}({2}\u5185)\u306B\u76F4\u63A5\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
@@ -1188,10 +1353,17 @@
 # 0: symbol kind, 1: symbol
 compiler.err.non-static.cant.be.ref=static\u3067\u306A\u3044{0} {1}\u3092static\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u53C2\u7167\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
+# 0: symbol kind, 1: symbol
+compiler.misc.non-static.cant.be.ref=static\u3067\u306A\u3044{0} {1}\u3092static\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u53C2\u7167\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
+
 ## Both arguments ({0}, {1}) are "kindname"s.  {0} is a comma-separated list
 ## of kindnames (the list should be identical to that provided in source.
 compiler.err.unexpected.type=\u4E88\u671F\u3057\u306A\u3044\u578B\n\u671F\u5F85\u5024: {0}\n\u691C\u51FA\u5024:    {1}
 
+compiler.err.unexpected.lambda=\u3053\u3053\u3067\u306F\u30E9\u30E0\u30C0\u5F0F\u306F\u4E88\u671F\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+compiler.err.unexpected.mref=\u3053\u3053\u3067\u306F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306F\u4E88\u671F\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
 ## The first argument {0} is a "kindname" (e.g. 'constructor', 'field', etc.)
 ## The second argument {1} is the non-resolved symbol
 ## The third argument {2} is a list of type parameters (non-empty if {1} is a method)
@@ -1216,12 +1388,20 @@
 # 0: symbol kind, 1: name, 2: list of type, 3: list, 4: message segment
 compiler.err.cant.resolve.location.args.params=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB:   {0} <{2}>{1}({3})\n\u5834\u6240: {4}
 
+### Following are replicated/used for method reference diagnostics
+
+# 0: symbol kind, 1: name, 2: unused, 3: list of type, 4: message segment
+compiler.misc.cant.resolve.location.args=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB:   {0} {1}({3})\n\u5834\u6240: {4}
+
+# 0: symbol kind, 1: name, 2: list of type, 3: list, 4: message segment
+compiler.misc.cant.resolve.location.args.params=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB:   {0} <{2}>{1}({3})\n\u5834\u6240: {4}
+
 ##a location subdiagnostic is composed as follows:
 ## The first argument {0} is the location "kindname" (e.g. 'constructor', 'field', etc.)
 ## The second argument {1} is the location name
 ## The third argument {2} is the location type (only when {1} is a variable name)
 
-# 0: symbol kind, 1: symbol, 2: unused
+# 0: symbol kind, 1: type or symbol, 2: unused
 compiler.misc.location={0} {1}
 
 # 0: symbol kind, 1: symbol, 2: type
@@ -1236,7 +1416,7 @@
 
 compiler.misc.kindname.constructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF
 
-compiler.misc.kindname.enum=\u5217\u6319
+compiler.misc.kindname.enum=\u5217\u6319\u578B
 
 compiler.misc.kindname.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 
@@ -1256,6 +1436,10 @@
 
 compiler.misc.kindname.package=\u30D1\u30C3\u30B1\u30FC\u30B8
 
+compiler.misc.kindname.static.init=static\u521D\u671F\u5316\u5B50
+
+compiler.misc.kindname.instance.init=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u521D\u671F\u5316\u5B50
+
 #####
 
 compiler.misc.no.args=\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093
@@ -1312,6 +1496,7 @@
 # 0: symbol, 1: symbol, 2: symbol, 3: symbol
 compiler.misc.varargs.clash.with={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059
 
+# 0: unused
 compiler.misc.diamond.and.anon.class=\u533F\u540D\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306F''<>''\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
 
 # 0: symbol kind, 1: symbol, 2: symbol, 3: message segment
@@ -1336,13 +1521,23 @@
 
 compiler.warn.assert.as.identifier=\u30EA\u30EA\u30FC\u30B91.4\u304B\u3089''assert''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u3001\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''assert''\u3092\u30AD\u30FC\u30EF\u30FC\u30C9\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001-source 1.4\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
+compiler.warn.underscore.as.identifier=\u8B58\u5225\u5B50\u3068\u3057\u3066''_''\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\n(\u8B58\u5225\u5B50\u3068\u3057\u3066\u306E''_''\u306E\u4F7F\u7528\u306F\u3001\u5C06\u6765\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)
+
 compiler.err.enum.as.identifier=\u30EA\u30EA\u30FC\u30B95\u304B\u3089''enum''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''enum''\u3092\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F-source 1.4\u4EE5\u524D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
 compiler.err.assert.as.identifier=\u30EA\u30EA\u30FC\u30B91.4\u304B\u3089''assert''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u3001\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''assert''\u3092\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001-source 1.3\u4EE5\u524D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
 # TODO 308: make a better error message
-# compiler.err.this.as.identifier=\
-#    as of release 8, ''this'' is allowed as the parameter name for the receiver type only, which has to be the first parameter
+compiler.err.this.as.identifier=\u30EA\u30EA\u30FC\u30B98\u304B\u3089''this''\u306F\u53D7\u4FE1\u30BF\u30A4\u30D7\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u3068\u3057\u3066\u306E\u307F\u8A31\u53EF\u3055\u308C\u3001\u6700\u521D\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+
+# TODO 308: make a better error message
+compiler.err.cant.annotate.static.class=\u5305\u542B\u3059\u308Bstatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306F\u6CE8\u91C8\u4ED8\u3051\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
+# TODO 308: make a better error message
+compiler.err.cant.annotate.nested.type=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306F\u6CE8\u91C8\u4ED8\u3051\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
+
+compiler.err.incorrect.receiver.type=\u53D7\u4FE1\u30BF\u30A4\u30D7\u304C\u3001\u5305\u542B\u3059\u308B\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093
+
+compiler.err.no.annotations.on.dot.class=\u6CE8\u91C8\u306F\u30AF\u30E9\u30B9\u30FB\u30EA\u30C6\u30E9\u30EB\u306E\u30BF\u30A4\u30D7\u3067\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
 
 # 0: string
 compiler.err.generics.not.supported.in.source=\u7DCF\u79F0\u578B\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u7DCF\u79F0\u578B\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
@@ -1353,9 +1548,8 @@
 # 0: string
 compiler.err.annotations.not.supported.in.source=\u6CE8\u91C8\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u6CE8\u91C8\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
-#308 compiler.err.type.annotations.not.supported.in.source=\
-#308     type annotations are not supported in -source {0}\n\
-#308 (use -source 8 or higher to enable type annotations)
+# 0: string
+compiler.err.type.annotations.not.supported.in.source=\u30BF\u30A4\u30D7\u6CE8\u91C8\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30BF\u30A4\u30D7\u6CE8\u91C8\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
 # 0: string
 compiler.err.foreach.not.supported.in.source=for-each\u30EB\u30FC\u30D7\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(for-each\u30EB\u30FC\u30D7\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
@@ -1375,6 +1569,47 @@
 # 0: string
 compiler.err.string.switch.not.supported.in.source=switch\u5185\u306E\u6587\u5B57\u5217\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(switch\u5185\u306E\u6587\u5B57\u5217\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
+# 0: string
+compiler.err.lambda.not.supported.in.source=\u30E9\u30E0\u30C0\u5F0F\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30E9\u30E0\u30C0\u5F0F\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
+
+# 0: string
+compiler.err.method.references.not.supported.in.source=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
+
+# 0: string
+compiler.err.default.methods.not.supported.in.source=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
+
+# 0: string
+compiler.err.intersection.types.in.cast.not.supported.in.source=\u30AD\u30E3\u30B9\u30C8\u5185\u306Eintersection\u578B\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
+
+# 0: string
+compiler.err.static.intf.methods.not.supported.in.source=static\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(static\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
+
+########################################
+# Diagnostics for verbose resolution
+# used by Resolve (debug only)
+########################################
+
+# 0: number, 1: symbol, 2: unused
+compiler.misc.applicable.method.found=#{0}\u500B\u306E\u4F7F\u7528\u53EF\u80FD\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {1}
+
+# 0: number, 1: symbol, 2: message segment
+compiler.misc.applicable.method.found.1=#{0}\u500B\u306E\u4F7F\u7528\u53EF\u80FD\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {1}\n({2})
+
+# 0: number, 1: symbol, 2: message segment
+compiler.misc.not.applicable.method.found=#{0}\u500B\u306E\u4F7F\u7528\u3067\u304D\u306A\u3044\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {1}\n({2})
+
+# 0: type
+compiler.misc.partial.inst.sig=\u90E8\u5206\u7684\u306B\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3055\u308C\u307E\u3057\u305F: {0}
+
+# 0: name, 1: symbol, 2: number, 3: MethodResolutionPhase, 4: list of type or message segment, 5: list of type or message segment
+compiler.note.verbose.resolve.multi=\u578B{1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u3092\u5019\u88DC{2}\u306B\u89E3\u6C7A\u3057\u3066\u3044\u307E\u3059\n\u30D5\u30A7\u30FC\u30BA: {3}\n\u5B9F\u969B\u306E\u578B: {4}\n\u578B\u5F15\u6570: {5}\n\u5019\u88DC:
+
+# 0: name, 1: symbol, 2: unused, 3: MethodResolutionPhase, 4: list of type or message segment, 5: list of type or message segment
+compiler.note.verbose.resolve.multi.1=\u578B{1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u306E\u89E3\u6C7A\u306B\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\n\u30D5\u30A7\u30FC\u30BA: {3}\n\u5B9F\u969B\u306E\u578B: {4}\n\u578B\u5F15\u6570: {5}\n\u5019\u88DC:
+
+# 0: symbol, 1: type, 2: type
+compiler.note.deferred.method.inst=\u30E1\u30BD\u30C3\u30C9{0}\u306E\u9045\u5EF6\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\n\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3055\u308C\u305F\u30B7\u30B0\u30CD\u30C1\u30E3: {1}\n\u30BF\u30FC\u30B2\u30C3\u30C8\u578B: {2}
+
 ########################################
 # Diagnostics for where clause implementation
 # used by the RichDiagnosticFormatter.
@@ -1397,26 +1632,32 @@
 # where clause for captured type: contains upper ('extends {1}') and lower
 # ('super {2}') bound along with the wildcard that generated this captured type ({3})
 # 0: type, 1: type, 2: type, 3: type
-compiler.misc.where.captured={3}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3\u304B\u3089\u306E{0} extends {1} super: {2}
+compiler.misc.where.captured={0}\u306F{3}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3\u304B\u3089{1}\u3092\u62E1\u5F35\u3057{2}\u3092\u30B9\u30FC\u30D1\u30FC\u3057\u307E\u3059
 
 # compact where clause for captured type: contains upper ('extends {1}') along
 # with the wildcard that generated this captured type ({3})
 # 0: type, 1: type, 2: unused, 3: type
-compiler.misc.where.captured.1={3}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3\u304B\u3089\u306E{0} extends {1}
+compiler.misc.where.captured.1={0}\u306F{3}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3\u304B\u3089{1}\u3092\u62E1\u5F35\u3057\u307E\u3059
 
 # where clause for type variable: contains upper bound(s) ('extends {1}') along with
 # the kindname ({2}) and location ({3}) in which the typevar has been declared
 # 0: type, 1: list of type, 2: symbol kind, 3: symbol
-compiler.misc.where.typevar={2} {3}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B{0} extends {1}
+compiler.misc.where.typevar={2} {3}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B{0}\u306F{1}\u3092\u62E1\u5F35\u3057\u307E\u3059
 
 # compact where clause for type variable: contains the kindname ({2}) and location ({3})
 # in which the typevar has been declared
+# 0: type, 1: list of type, 2: symbol kind, 3: symbol
 compiler.misc.where.typevar.1={2} {3}\u3067\u5BA3\u8A00\u3055\u308C\u305F{0}
 
+# where clause for fresh type variable: contains upper bound(s) ('extends {1}').
+# Since a fresh type-variable is synthetic - there's no location/kindname here.
+# 0: type, 1: list of type
+compiler.misc.where.fresh.typevar={0}\u306F{1}\u3092\u62E1\u5F35\u3057\u307E\u3059
+
 # where clause for type variable: contains all the upper bound(s) ('extends {1}')
 # of this intersection type
 # 0: type, 1: list of type
-compiler.misc.where.intersection={0} extends {1}
+compiler.misc.where.intersection={0}\u306F{1}\u3092\u62E1\u5F35\u3057\u307E\u3059
 
 ### Where clause headers ###
 compiler.misc.where.description.captured={0}\u304C\u65B0\u3057\u3044\u578B\u5909\u6570\u306E\u5834\u5408:
@@ -1435,4 +1676,39 @@
 
 compiler.misc.where.description.intersection.1={0}\u304Cintersection\u578B\u306E\u5834\u5408:
 
-
+###
+# errors related to doc comments
+
+compiler.err.dc.bad.entity=HTML\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u304C\u4E0D\u6B63\u3067\u3059
+
+compiler.err.dc.bad.gt=''>''\u306E\u4F7F\u7528\u304C\u4E0D\u6B63\u3067\u3059
+
+compiler.err.dc.bad.inline.tag=\u30A4\u30F3\u30E9\u30A4\u30F3\u30FB\u30BF\u30B0\u306E\u4F7F\u7528\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093
+
+compiler.err.dc.identifier.expected=\u8B58\u5225\u5B50\u304C\u5FC5\u8981\u3067\u3059
+
+compiler.err.dc.malformed.html=HTML\u304C\u4E0D\u6B63\u3067\u3059
+
+compiler.err.dc.missing.semicolon=\u30BB\u30DF\u30B3\u30ED\u30F3\u304C\u3042\u308A\u307E\u305B\u3093
+
+compiler.err.dc.no.content=\u30B3\u30F3\u30C6\u30F3\u30C4\u306A\u3057
+
+compiler.err.dc.no.tag.name='@'\u306E\u5F8C\u306B\u30BF\u30B0\u540D\u304C\u3042\u308A\u307E\u305B\u3093
+
+compiler.err.dc.gt.expected=''>''\u304C\u5FC5\u8981\u3067\u3059
+
+compiler.err.dc.ref.bad.parens=\u53C2\u7167\u306B'')''\u304C\u3042\u308A\u307E\u305B\u3093
+
+compiler.err.dc.ref.syntax.error=\u53C2\u7167\u306B\u69CB\u6587\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059
+
+compiler.err.dc.ref.unexpected.input=\u4E88\u671F\u3057\u306A\u3044\u30C6\u30AD\u30B9\u30C8\u3067\u3059
+
+compiler.err.dc.unexpected.content=\u4E88\u671F\u3057\u306A\u3044\u30B3\u30F3\u30C6\u30F3\u30C4\u3067\u3059
+
+compiler.err.dc.unterminated.inline.tag=\u30A4\u30F3\u30E9\u30A4\u30F3\u30FB\u30BF\u30B0\u304C\u7D42\u4E86\u3057\u3066\u3044\u307E\u305B\u3093
+
+compiler.err.dc.unterminated.signature=\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u7D42\u4E86\u3057\u3066\u3044\u307E\u305B\u3093
+
+compiler.err.dc.unterminated.string=\u6587\u5B57\u5217\u304C\u7D42\u4E86\u3057\u3066\u3044\u307E\u305B\u3093
+
+
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -65,8 +65,11 @@
 
 compiler.err.already.annotated={0} {1}\u5DF2\u8FDB\u884C\u6CE8\u91CA
 
-# 0: symbol, 1: symbol
-compiler.err.already.defined=\u5DF2\u5728{1}\u4E2D\u5B9A\u4E49{0}
+# 0: symbol kind, 1: symbol, 2: symbol kind, 3: symbol
+compiler.err.already.defined=\u5DF2\u5728{2} {3}\u4E2D\u5B9A\u4E49\u4E86{0} {1}
+
+# 0: symbol kind, 1: symbol, 2: symbol kind, 3: symbol kind, 4: symbol
+compiler.err.already.defined.in.clinit=\u5DF2\u5728{3} {4}\u7684{2}\u4E2D\u5B9A\u4E49\u4E86{0} {1}
 
 # 0: string
 compiler.err.already.defined.single.import=\u5DF2\u5728 single-type \u5BFC\u5165\u4E2D\u5B9A\u4E49{0}
@@ -109,28 +112,84 @@
 # 0: type
 compiler.err.array.req.but.found=\u9700\u8981\u6570\u7EC4, \u4F46\u627E\u5230{0}
 
-compiler.err.assignment.from.super-bound=\u901A\u8FC7\u901A\u914D\u7B26 {0} \u5206\u914D
-
-compiler.err.assignment.to.extends-bound=\u5206\u914D\u7ED9\u901A\u914D\u7B26 {0}
-
 compiler.err.attribute.value.must.be.constant=\u5C5E\u6027\u503C\u5FC5\u987B\u4E3A\u5E38\u91CF
 
+# 0: statement type
+compiler.err.bad.initializer={0}\u7684\u521D\u59CB\u5316\u7A0B\u5E8F\u9519\u8BEF
+
 compiler.err.break.outside.switch.loop=\u5728 switch \u6216 loop \u5916\u90E8\u4E2D\u65AD
 
 # 0: name
 compiler.err.call.must.be.first.stmt.in.ctor=\u5BF9{0}\u7684\u8C03\u7528\u5FC5\u987B\u662F\u6784\u9020\u5668\u4E2D\u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5
 
-compiler.err.cant.apply.symbol=\u65E0\u6CD5\u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B\n\u9700\u8981: {2}\n\u627E\u5230: {3}
-
 # 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
-compiler.err.cant.apply.symbol.1=\u65E0\u6CD5\u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B;\n\u9700\u8981: {2}\n\u627E\u5230: {3}\n\u539F\u56E0: {6}
+compiler.err.cant.apply.symbol=\u65E0\u6CD5\u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B;\n\u9700\u8981: {2}\n\u627E\u5230: {3}\n\u539F\u56E0: {6}
 
 # 0: symbol kind, 1: name, 2: list of type
 compiler.err.cant.apply.symbols=\u5BF9\u4E8E{1}({2}), \u627E\u4E0D\u5230\u5408\u9002\u7684{0}
 
+# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment
+compiler.misc.cant.apply.symbol=\u65E0\u6CD5\u5C06 {4} {5}\u4E2D\u7684 {0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B\n\u9700\u8981: {2}\n\u627E\u5230: {3}\n\u539F\u56E0: {6}
+
+# 0: symbol kind, 1: name, 2: list of type
+compiler.misc.cant.apply.symbols=\u5BF9\u4E8E{1}({2}), \u627E\u4E0D\u5230\u5408\u9002\u7684{0}
+
+# 0: symbol kind, 1: symbol
+compiler.misc.no.abstracts=\u5728 {0} {1} \u4E2D\u627E\u4E0D\u5230\u62BD\u8C61\u65B9\u6CD5
+
+# 0: symbol kind, 1: symbol
+compiler.misc.incompatible.abstracts=\u5728 {0} {1} \u4E2D\u627E\u5230\u591A\u4E2A\u975E\u8986\u76D6\u62BD\u8C61\u65B9\u6CD5
+
+compiler.err.bad.functional.intf.anno=\u610F\u5916\u7684 @FunctionalInterface \u6CE8\u91CA
+
+# 0: message segment
+compiler.err.bad.functional.intf.anno.1=\u610F\u5916\u7684 @FunctionalInterface \u6CE8\u91CA\n{0}
+
+# 0: symbol
+compiler.misc.not.a.functional.intf={0} \u4E0D\u662F\u51FD\u6570\u63A5\u53E3
+
+# 0: symbol, 1: message segment
+compiler.misc.not.a.functional.intf.1={0} \u4E0D\u662F\u51FD\u6570\u63A5\u53E3\n{1}
+
+# 0: symbol, 1: symbol kind, 2: symbol
+compiler.misc.invalid.generic.lambda.target=lambda \u8868\u8FBE\u5F0F\u7684\u51FD\u6570\u63CF\u8FF0\u7B26\u65E0\u6548\n{1} {2} \u4E2D\u7684\u65B9\u6CD5 {0} \u4E3A\u6CDB\u578B\u65B9\u6CD5
+
+# 0: symbol kind, 1: symbol
+compiler.misc.incompatible.descs.in.functional.intf=\u5728 {0} {1} \u4E2D\u627E\u5230\u4E0D\u517C\u5BB9\u7684\u51FD\u6570\u63CF\u8FF0\u7B26
+
+# 0: name, 1: list of type, 2: type, 3: list of type
+compiler.misc.descriptor=\u63CF\u8FF0\u7B26: {2} {0}({1})
+
+# 0: name, 1: list of type, 2: type, 3: list of type
+compiler.misc.descriptor.throws=\u63CF\u8FF0\u7B26: {2} {0}({1}) \u629B\u51FA{3}
+
+# 0: type
+compiler.misc.no.suitable.functional.intf.inst=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u51FD\u6570\u63A5\u53E3\u63CF\u8FF0\u7B26
+
+# 0: type
+compiler.misc.secondary.bound.must.be.marker.intf=\u6B21\u7EA7\u9650\u5236\u8303\u56F4{0}\u5FC5\u987B\u4E3A\u6807\u8BB0\u63A5\u53E3
+
+# 0: symbol kind, 1: message segment
+compiler.err.invalid.mref={0} \u5F15\u7528\u65E0\u6548; {1}
+
+# 0: symbol kind, 1: message segment
+compiler.misc.invalid.mref={0} \u5F15\u7528\u65E0\u6548; {1}
+
+compiler.misc.static.mref.with.targs=\u6709\u5173\u9759\u6001\u65B9\u6CD5\u5F15\u7528\u7684\u53C2\u6570\u5316\u9650\u5B9A\u7B26
+
+compiler.misc.static.bound.mref=\u9759\u6001\u9650\u5236\u8303\u56F4\u65B9\u6CD5\u5F15\u7528
+
 # 0: symbol
 compiler.err.cant.assign.val.to.final.var=\u65E0\u6CD5\u4E3A\u6700\u7EC8\u53D8\u91CF{0}\u5206\u914D\u503C
 
+# 0: symbol, 1: message segment
+compiler.err.cant.ref.non.effectively.final.var=\u4ECE{1}\u5F15\u7528\u7684\u672C\u5730\u53D8\u91CF\u5FC5\u987B\u662F\u6700\u7EC8\u53D8\u91CF\u6216\u5B9E\u9645\u4E0A\u7684\u6700\u7EC8\u53D8\u91CF
+
+
+compiler.misc.lambda=lambda \u8868\u8FBE\u5F0F
+
+compiler.misc.inner.cls=\u5185\u90E8\u7C7B
+
 # 0: type
 compiler.err.cant.deref=\u65E0\u6CD5\u53D6\u6D88\u5F15\u7528{0}
 
@@ -142,8 +201,6 @@
 # 0: symbol
 compiler.err.cant.ref.before.ctor.called=\u65E0\u6CD5\u5728\u8C03\u7528\u8D85\u7C7B\u578B\u6784\u9020\u5668\u4E4B\u524D\u5F15\u7528{0}
 
-compiler.err.cant.ret.val.from.meth.decl.void=\u5BF9\u4E8E\u7ED3\u679C\u7C7B\u578B\u4E3A\u7A7A\u7684\u65B9\u6CD5, \u65E0\u6CD5\u8FD4\u56DE\u503C
-
 compiler.err.cant.select.static.class.from.param.type=\u65E0\u6CD5\u4ECE\u53C2\u6570\u5316\u7684\u7C7B\u578B\u4E2D\u9009\u62E9\u9759\u6001\u7C7B
 
 # 0: symbol, 1: string, 2: string
@@ -154,6 +211,8 @@
 # 0: symbol kind, 1: symbol
 compiler.err.clash.with.pkg.of.same.name={0} {1}\u4E0E\u5E26\u6709\u76F8\u540C\u540D\u79F0\u7684\u7A0B\u5E8F\u5305\u51B2\u7A81
 
+compiler.err.class.not.allowed=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B, \u63A5\u53E3\u6216\u679A\u4E3E\u58F0\u660E
+
 compiler.err.const.expr.req=\u9700\u8981\u5E38\u91CF\u8868\u8FBE\u5F0F
 
 compiler.err.cont.outside.loop=continue \u5728 loop \u5916\u90E8
@@ -169,8 +228,6 @@
 # 0: type
 compiler.err.no.superclass={0}\u4E0D\u5177\u6709\u8D85\u7C7B
 
-compiler.err.wrong.target.for.polymorphic.signature.definition=MethodHandle API \u6784\u5EFA\u9700\u8981 -target 7 \u8FD0\u884C\u65F6\u6216\u66F4\u9AD8; \u5F53\u524D\u4E3A -target {0}
-
 # 0: symbol, 1: type, 2: symbol, 3: type, 4: unused
 compiler.err.concrete.inheritance.conflict={1}\u4E2D\u7684\u65B9\u6CD5{0}\u548C{3}\u4E2D\u7684\u65B9\u6CD5{2}\u662F\u4F7F\u7528\u76F8\u540C\u7684\u7B7E\u540D\u7EE7\u627F\u7684
 
@@ -181,9 +238,48 @@
 
 compiler.err.duplicate.annotation=\u6CE8\u91CA\u91CD\u590D
 
+# 0: type
+compiler.err.duplicate.annotation.invalid.repeated=\u65E0\u6CD5\u91CD\u590D\u6CE8\u91CA{0}\n\u5B83\u6CA1\u6709\u5B9A\u4E49\u6709\u6548\u7684\u5305\u542B\u6CE8\u91CA\u3002
+
 # 0: name, 1: type
 compiler.err.duplicate.annotation.member.value={1}\u4E2D\u7684\u6CE8\u91CA\u6210\u5458\u503C{0}\u91CD\u590D
 
+# 0: type, 1: type
+compiler.err.duplicate.annotation.missing.container=\u6CE8\u91CA\u91CD\u590D, {0}\u7684\u58F0\u660E\u6CA1\u6709\u6709\u6548\u7684{1}\u6CE8\u91CA
+
+# 0: type
+compiler.err.invalid.repeatable.annotation=\u6CE8\u91CA\u91CD\u590D, \u4F7F\u7528\u65E0\u6548\u7684\u53EF\u91CD\u590D\u6CE8\u91CA\u5BF9{0}\u8FDB\u884C\u4E86\u6CE8\u91CA
+
+# 0: type
+compiler.err.invalid.repeatable.annotation.no.value=\u6CE8\u91CA\u91CD\u590D, {0}\u4E0D\u662F\u6709\u6548\u7684\u53EF\u91CD\u590D\u7C7B\u578B, \u672A\u58F0\u660E\u4EFB\u4F55\u503C\u5143\u7D20\u65B9\u6CD5
+
+# 0: type, 1: number
+compiler.err.invalid.repeatable.annotation.multiple.values=\u6CE8\u91CA\u91CD\u590D, {0}\u4E0D\u662F\u6709\u6548\u7684\u53EF\u91CD\u590D\u7C7B\u578B, \u5DF2\u58F0\u660E {1} \u4E2A\u503C\u5143\u7D20\u65B9\u6CD5
+
+# 0: type
+compiler.err.invalid.repeatable.annotation.invalid.value=\u6CE8\u91CA\u91CD\u590D, {0}\u4E0D\u662F\u6709\u6548\u7684\u53EF\u91CD\u590D\u7C7B\u578B, \u503C\u5143\u7D20\u65E0\u6548, \u9700\u8981\u65B9\u6CD5
+
+# 0: type, 1: type, 2: type
+compiler.err.invalid.repeatable.annotation.value.return=\u6CE8\u91CA\u91CD\u590D, \u5305\u542B\u6CE8\u91CA{0}\u7684\u503C\u5143\u7D20\u5E94\u5177\u6709\u7C7B\u578B{2}, \u4F46\u627E\u5230\u7684\u662F{1}
+
+# 0: type, 1: symbol
+compiler.err.invalid.repeatable.annotation.elem.nondefault=\u5305\u542B\u6CE8\u91CA{0}\u6CA1\u6709\u5143\u7D20 {1} \u7684\u9ED8\u8BA4\u503C
+
+# 0: symbol, 1: type, 2: symbol, 3: type
+compiler.err.invalid.repeatable.annotation.retention=\u5305\u542B\u6CE8\u91CA {0} \u7684\u4FDD\u7559\u671F ({1}) \u77ED\u4E8E\u5DF2\u5305\u542B\u6CE8\u91CA {2} \u7684\u4FDD\u7559\u671F ({3})
+
+# 0: symbol, 1: symbol
+compiler.err.invalid.repeatable.annotation.not.documented=\u5305\u542B\u6CE8\u91CA\u7C7B\u578B {0} \u4E0D\u662F @Documented, \u800C\u91CD\u590D\u7684\u6CE8\u91CA\u7C7B\u578B {1} \u4E3A
+
+# 0: symbol, 1: symbol
+compiler.err.invalid.repeatable.annotation.not.inherited=\u5305\u542B\u6CE8\u91CA\u7C7B\u578B {0} \u4E0D\u662F @Inherited, \u800C\u91CD\u590D\u7684\u6CE8\u91CA\u7C7B\u578B {1} \u4E3A
+
+# 0: symbol, 1: symbol
+compiler.err.invalid.repeatable.annotation.incompatible.target=\u5BB9\u5668\u6CE8\u91CA {0} \u7684\u76EE\u6807\u4E0D\u662F\u91CD\u590D\u6CE8\u91CA {1} \u7684\u76EE\u6807\u5B50\u96C6
+
+# 0: symbol
+compiler.err.invalid.repeatable.annotation.repeated.and.container.present=\u5BB9\u5668 {0} \u4E0D\u5F97\u4E0E\u5176\u5305\u542B\u7684\u5143\u7D20\u540C\u65F6\u5B58\u5728
+
 # 0: name
 compiler.err.duplicate.class=\u7C7B\u91CD\u590D: {0}
 
@@ -245,10 +341,10 @@
 compiler.err.generic.throwable=\u6CDB\u578B\u7C7B\u4E0D\u80FD\u6269\u5C55 java.lang.Throwable
 
 # 0: symbol
-compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u7C7B{0}\u4E2D\u7684\u9759\u6001\u58F0\u660E\u975E\u6CD5\n\u4FEE\u9970\u7B26 \''static\'' \u4EC5\u5141\u8BB8\u5728\u5E38\u91CF\u53D8\u91CF\u58F0\u660E\u4E2D\u4F7F\u7528
+compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u7C7B{0}\u4E2D\u7684\u9759\u6001\u58F0\u660E\u975E\u6CD5\n\u4FEE\u9970\u7B26 ''static'' \u4EC5\u5141\u8BB8\u5728\u5E38\u91CF\u53D8\u91CF\u58F0\u660E\u4E2D\u4F7F\u7528
 
 # 0: string
-compiler.err.illegal.char=\u975E\u6CD5\u5B57\u7B26: \\{0}
+compiler.err.illegal.char=\u975E\u6CD5\u5B57\u7B26: ''{0}''
 
 compiler.err.illegal.char.for.encoding=\u7F16\u7801{0}\u7684\u4E0D\u53EF\u6620\u5C04\u5B57\u7B26
 
@@ -280,11 +376,15 @@
 
 compiler.err.illegal.underscore=\u975E\u6CD5\u4E0B\u5212\u7EBF
 
+compiler.err.illegal.dot=\u975E\u6CD5 ''.''
+
 # 0: symbol
 compiler.err.illegal.qual.not.icls=\u975E\u6CD5\u9650\u5B9A\u7B26; {0}\u4E0D\u662F\u5185\u90E8\u7C7B
 
 compiler.err.illegal.start.of.expr=\u975E\u6CD5\u7684\u8868\u8FBE\u5F0F\u5F00\u59CB
 
+compiler.err.illegal.start.of.stmt=\u975E\u6CD5\u7684\u8BED\u53E5\u5F00\u59CB
+
 compiler.err.illegal.start.of.type=\u975E\u6CD5\u7684\u7C7B\u578B\u5F00\u59CB
 
 compiler.err.illegal.unicode.esc=\u975E\u6CD5\u7684 Unicode \u8F6C\u4E49
@@ -302,8 +402,6 @@
 # 0: number
 compiler.err.int.number.too.large=\u8FC7\u5927\u7684\u6574\u6570: {0}
 
-compiler.err.internal.error.cant.instantiate=\u5185\u90E8\u9519\u8BEF; \u65E0\u6CD5\u5C06\u4F4D\u4E8E{1}\u7684{0}\u5B9E\u4F8B\u5316\u4E3A ({2})
-
 compiler.err.intf.annotation.members.cant.have.params=@interface \u6210\u5458\u4E0D\u80FD\u5E26\u6709\u53C2\u6570
 
 compiler.err.intf.annotation.cant.have.type.params=@interface \u4E0D\u80FD\u5E26\u6709\u7C7B\u578B\u53C2\u6570
@@ -315,7 +413,7 @@
 
 compiler.err.intf.expected.here=\u6B64\u5904\u9700\u8981\u63A5\u53E3
 
-compiler.err.intf.meth.cant.have.body=\u63A5\u53E3\u65B9\u6CD5\u4E0D\u80FD\u5E26\u6709\u4E3B\u4F53
+compiler.err.intf.meth.cant.have.body=\u63A5\u53E3\u62BD\u8C61\u65B9\u6CD5\u4E0D\u80FD\u5E26\u6709\u4E3B\u4F53
 
 compiler.err.invalid.annotation.member.type=\u6CE8\u91CA\u6210\u5458\u7684\u7C7B\u578B\u65E0\u6548
 
@@ -327,6 +425,8 @@
 
 compiler.err.varargs.and.old.array.syntax=variable-arity \u53C2\u6570\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4F20\u7EDF\u6570\u7EC4\u8BB0\u53F7
 
+compiler.err.variable.not.allowed=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u53D8\u91CF\u58F0\u660E
+
 # 0: name
 compiler.err.label.already.in.use=\u6807\u7B7E{0}\u5DF2\u4F7F\u7528
 
@@ -337,6 +437,8 @@
 
 compiler.err.cannot.create.array.with.type.arguments=\u65E0\u6CD5\u521B\u5EFA\u5177\u6709\u7C7B\u578B\u53D8\u91CF\u7684\u6570\u7EC4
 
+compiler.err.cannot.create.array.with.diamond=\u65E0\u6CD5\u521B\u5EFA\u5177\u6709 ''<>'' \u7684\u6570\u7EC4
+
 #
 # limits.  We don't give the limits in the diagnostic because we expect
 # them to change, yet we want to use the same diagnostic.  These are all
@@ -360,7 +462,7 @@
 
 compiler.err.limit.string=\u5E38\u91CF\u5B57\u7B26\u4E32\u8FC7\u957F
 
-compiler.err.limit.string.overflow=\u5BF9\u4E8E\u5E38\u91CF\u6C60\u6765\u8BF4, \u5B57\u7B26\u4E32 \"{0}...\" \u7684 UTF8 \u8868\u793A\u8FC7\u957F
+compiler.err.limit.string.overflow=\u5BF9\u4E8E\u5E38\u91CF\u6C60\u6765\u8BF4, \u5B57\u7B26\u4E32 "{0}..." \u7684 UTF8 \u8868\u793A\u8FC7\u957F
 
 compiler.err.malformed.fp.lit=\u6D6E\u70B9\u6587\u5B57\u7684\u683C\u5F0F\u9519\u8BEF
 
@@ -370,7 +472,9 @@
 
 compiler.err.missing.ret.stmt=\u7F3A\u5C11\u8FD4\u56DE\u8BED\u53E5
 
-compiler.err.missing.ret.val=\u7F3A\u5C11\u8FD4\u56DE\u503C
+compiler.misc.missing.ret.val=\u7F3A\u5C11\u8FD4\u56DE\u503C
+
+compiler.misc.unexpected.ret.val=\u610F\u5916\u7684\u8FD4\u56DE\u503C
 
 # 0: set of modifier
 compiler.err.mod.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u4FEE\u9970\u7B26{0}
@@ -398,6 +502,25 @@
 # 0: type, 1: type
 compiler.err.neither.conditional.subtype=? \u7684\u4E0D\u517C\u5BB9\u7C7B\u578B: \u4E24\u8005\u90FD\u4E0D\u662F\u5BF9\u65B9\u7684\u5B50\u7C7B\u578B\n\u7B2C\u4E8C\u4E2A\u64CD\u4F5C\u6570: {0}\n\u7B2C\u4E09\u4E2A\u64CD\u4F5C\u6570: {1}
 
+# 0: message segment
+compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u8868\u8FBE\u5F0F\u4E2D\u7684\u7C7B\u578B\u9519\u8BEF; {0}
+
+compiler.misc.conditional.target.cant.be.void=\u6761\u4EF6\u8868\u8FBE\u5F0F\u7684\u76EE\u6807\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A
+
+# 0: type
+compiler.misc.incompatible.ret.type.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u8FD4\u56DE\u7C7B\u578B\u9519\u8BEF\n{0}
+
+# 0: type
+compiler.misc.incompatible.ret.type.in.mref=\u65B9\u6CD5\u5F15\u7528\u4E2D\u7684\u8FD4\u56DE\u7C7B\u578B\u9519\u8BEF\n{0}
+
+# 0: list of type
+compiler.err.incompatible.thrown.types.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u629B\u51FA\u7684\u7C7B\u578B{0}\u4E0D\u517C\u5BB9
+
+# 0: list of type
+compiler.err.incompatible.thrown.types.in.mref=\u65B9\u6CD5\u5F15\u7528\u4E2D\u629B\u51FA\u7684\u7C7B\u578B{0}\u4E0D\u517C\u5BB9
+
+compiler.misc.incompatible.arg.types.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u53C2\u6570\u7C7B\u578B\u4E0D\u517C\u5BB9
+
 compiler.err.new.not.allowed.in.annotation=\u6CE8\u91CA\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 ''new''
 
 compiler.err.no.annotation.member={1}\u4E2D\u6CA1\u6709\u6CE8\u91CA\u6210\u5458{0}
@@ -414,6 +537,12 @@
 compiler.err.not.def.access.class.intf.cant.access={1}\u4E2D\u7684{0}\u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684
 
 # 0: symbol, 1: symbol
+compiler.misc.not.def.access.class.intf.cant.access={1}\u4E2D\u7684{0}\u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684
+
+# 0: symbol, 1: list of type, 2: type
+compiler.misc.cant.access.inner.cls.constr=\u65E0\u6CD5\u8BBF\u95EE\u6784\u9020\u5668 {0}({1})\n\u4F5C\u7528\u57DF\u4E2D\u6CA1\u6709\u7C7B\u578B\u4E3A{2}\u7684\u5C01\u95ED\u5B9E\u4F8B
+
+# 0: symbol, 1: symbol
 compiler.err.not.def.public.cant.access={0}\u5728{1}\u4E2D\u4E0D\u662F\u516C\u5171\u7684; \u65E0\u6CD5\u4ECE\u5916\u90E8\u7A0B\u5E8F\u5305\u4E2D\u5BF9\u5176\u8FDB\u884C\u8BBF\u95EE
 
 # 0: name
@@ -455,15 +584,13 @@
 # 0: list of string
 compiler.err.proc.no.explicit.annotation.processing.requested=\u4EC5\u5F53\u663E\u5F0F\u8BF7\u6C42\u6CE8\u91CA\u5904\u7406\u65F6\u624D\u63A5\u53D7\u7C7B\u540D\u79F0 ''{0}''
 
-compiler.err.proc.no.service=\u627E\u4E0D\u5230\u670D\u52A1\u52A0\u8F7D\u5668\u7C7B\u3002\njava.util.ServiceLoader \u6216 sun.misc.Service \u5FC5\u987B\u53EF\u7528\u3002
+compiler.err.proc.no.service=ServiceLoader \u4E0D\u53EF\u7528, \u4F46\u5B83\u662F\u6CE8\u91CA\u5904\u7406\u6240\u5FC5\u9700\u7684\u3002
 
 compiler.err.proc.processor.bad.option.name=\u5904\u7406\u7A0B\u5E8F ''{1}'' \u63D0\u4F9B\u7684\u9009\u9879\u540D\u79F0 ''{0}'' \u9519\u8BEF
 
 # 0: string
 compiler.err.proc.processor.cant.instantiate=\u65E0\u6CD5\u5B9E\u4F8B\u5316\u5904\u7406\u7A0B\u5E8F ''{0}'' \u7684\u5B9E\u4F8B
 
-compiler.err.proc.processor.constructor.error=\u6784\u9020\u5904\u7406\u7A0B\u5E8F\u5BF9\u8C61{0}\u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF
-
 # 0: string
 compiler.err.proc.processor.not.found=\u627E\u4E0D\u5230\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F ''{0}''
 
@@ -482,7 +609,10 @@
 compiler.err.recursive.ctor.invocation=\u9012\u5F52\u6784\u9020\u5668\u8C03\u7528
 
 # 0: name, 1: symbol kind, 2: symbol, 3: symbol, 4: symbol kind, 5: symbol, 6: symbol
-compiler.err.ref.ambiguous=\u5BF9{0}\u7684\u5F15\u7528\u4E0D\u660E\u786E, {3}\u4E2D\u7684{1} {2}\u548C{6}\u4E2D\u7684{4} {5}\u90FD\u5339\u914D
+compiler.err.ref.ambiguous=\u5BF9{0}\u7684\u5F15\u7528\u4E0D\u660E\u786E\n{3} \u4E2D\u7684{1} {2} \u548C {6} \u4E2D\u7684{4} {5} \u90FD\u5339\u914D
+
+# 0: name, 1: symbol kind, 2: symbol, 3: symbol, 4: symbol kind, 5: symbol, 6: symbol
+compiler.misc.ref.ambiguous=\u5BF9{0}\u7684\u5F15\u7528\u4E0D\u660E\u786E\n{3} \u4E2D\u7684{1} {2} \u548C {6} \u4E2D\u7684{4} {5} \u90FD\u5339\u914D
 
 compiler.err.repeated.annotation.target=\u6CE8\u91CA\u76EE\u6807\u91CD\u590D
 
@@ -536,6 +666,27 @@
 # 0: type, 1: type, 2: string
 compiler.err.types.incompatible.diff.ret=\u7C7B\u578B{0}\u548C{1}\u4E0D\u517C\u5BB9; \u4E24\u8005\u90FD\u5B9A\u4E49\u4E86{2}, \u4F46\u5374\u5E26\u6709\u4E0D\u76F8\u5173\u7684\u8FD4\u56DE\u7C7B\u578B
 
+# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+compiler.err.types.incompatible.unrelated.defaults={0} {1}\u4ECE\u7C7B\u578B {4} \u548C {5} \u4E2D\u7EE7\u627F\u4E86{2}({3}) \u7684\u4E0D\u76F8\u5173\u9ED8\u8BA4\u503C
+
+# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+compiler.err.types.incompatible.abstract.default={0} {1}\u4ECE\u7C7B\u578B {4} \u548C {5} \u4E2D\u7EE7\u627F\u4E86{2}({3}) \u7684\u62BD\u8C61\u548C\u9ED8\u8BA4\u503C
+
+# 0: name, 1: kind, 2: symbol
+compiler.err.default.overrides.object.member={1} {2} \u4E2D\u7684\u9ED8\u8BA4\u65B9\u6CD5{0}\u8986\u76D6\u4E86 java.lang.Object \u7684\u6210\u5458
+
+# 0: type
+compiler.err.illegal.static.intf.meth.call=\u9759\u6001\u63A5\u53E3\u65B9\u6CD5\u8C03\u7528\u975E\u6CD5\n\u5E94\u5C06\u63A5\u6536\u65B9\u8868\u8FBE\u5F0F\u66FF\u6362\u4E3A\u7C7B\u578B\u9650\u5B9A\u7B26 ''{0}''
+
+# 0: type, 1: message segment
+compiler.err.illegal.default.super.call=\u9ED8\u8BA4\u8D85\u7EA7\u8C03\u7528\u4E2D\u7684\u7C7B\u578B\u9650\u5B9A\u7B26{0}\u9519\u8BEF\n{1}
+
+# 0: symbol, 1: type
+compiler.misc.overridden.default=\u8986\u76D6\u4E86{1}\u4E2D\u7684\u65B9\u6CD5 {0}
+
+# 0: symbol, 1: symbol
+compiler.misc.redundant.supertype=\u5197\u4F59\u63A5\u53E3 {0} \u5DF2\u7531 {1} \u6269\u5C55
+
 compiler.err.unclosed.char.lit=\u672A\u7ED3\u675F\u7684\u5B57\u7B26\u6587\u5B57
 
 compiler.err.unclosed.comment=\u672A\u7ED3\u675F\u7684\u6CE8\u91CA
@@ -550,19 +701,14 @@
 # 0: name
 compiler.err.undef.label=\u672A\u5B9A\u4E49\u7684\u6807\u7B7E: {0}
 
-compiler.err.undetermined.type=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570
-
-# 0: type, 1: message segment
-compiler.err.undetermined.type.1=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570;\n\u539F\u56E0: {1}
-
-# 0: list of type, 1: message segment
-compiler.err.invalid.inferred.types={0}\u7684\u63A8\u65AD\u7C7B\u578B\u65E0\u6548; {1}
-
 # 0: message segment, 1: unused
 compiler.err.cant.apply.diamond=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570
 
-# 0: message segment, 1: message segment
-compiler.err.cant.apply.diamond.1=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570;\n\u539F\u56E0: {1}
+# 0: message segment or type, 1: message segment
+compiler.err.cant.apply.diamond.1=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570\n\u539F\u56E0: {1}
+
+# 0: message segment or type, 1: message segment
+compiler.misc.cant.apply.diamond.1=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570\n\u539F\u56E0: {1}
 
 compiler.err.unreachable.stmt=\u65E0\u6CD5\u8BBF\u95EE\u7684\u8BED\u53E5
 
@@ -605,7 +751,7 @@
 # 0: symbol
 compiler.misc.varargs.trustme.on.virtual.varargs=\u5B9E\u4F8B\u65B9\u6CD5 {0} \u4E0D\u662F\u6700\u7EC8\u7684\u3002
 
-# 0: type, 1: kind, 2: symbol
+# 0: type, 1: symbol kind, 2: symbol
 compiler.misc.inaccessible.varargs.type=\u5F62\u5F0F varargs \u5143\u7D20\u7C7B\u578B{0}\u65E0\u6CD5\u4ECE {1} {2} \u8FDB\u884C\u8BBF\u95EE
 
 # In the following string, {1} will always be the detail message from
@@ -620,7 +766,7 @@
 
 ## All errors which do not refer to a particular line in the source code are
 ## preceded by this string.
-compiler.err.error=\u9519\u8BEF:\u0020
+compiler.err.error=\u9519\u8BEF: 
 
 # The following error messages do not refer to a line in the source code.
 compiler.err.cant.read.file=\u65E0\u6CD5\u8BFB\u53D6: {0}
@@ -637,7 +783,7 @@
 
 compiler.misc.fatal.err.cant.locate.ctor=\u81F4\u547D\u9519\u8BEF: \u627E\u4E0D\u5230{0}\u7684\u6784\u9020\u5668
 
-compiler.misc.fatal.err.cant.close.loader=\u81F4\u547D\u9519\u8BEF: \u65E0\u6CD5\u5173\u95ED\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u7C7B\u52A0\u8F7D\u5668
+compiler.misc.fatal.err.cant.close=\u81F4\u547D\u9519\u8BEF: \u65E0\u6CD5\u5173\u95ED\u7F16\u8BD1\u5668\u8D44\u6E90
 
 #####
 
@@ -659,7 +805,10 @@
 
 ## The following string will appear before all messages keyed as:
 ## "compiler.note".
-compiler.note.note=\u6CE8:\u0020
+
+compiler.note.potential.lambda.found=\u53EF\u5C06\u6B64\u533F\u540D\u5185\u90E8\u7C7B\u521B\u5EFA\u8F6C\u6362\u4E3A lambda \u8868\u8FBE\u5F0F\u3002
+
+compiler.note.note=\u6CE8: 
 
 # 0: file name
 compiler.note.deprecated.filename={0}\u4F7F\u7528\u6216\u8986\u76D6\u4E86\u5DF2\u8FC7\u65F6\u7684 API\u3002
@@ -773,12 +922,12 @@
 ##
 
 ## All warning messages are preceded by the following string.
-compiler.warn.warning=\u8B66\u544A:\u0020
+compiler.warn.warning=\u8B66\u544A: 
 
 ## Warning messages may also include the following prefix to identify a
 ## lint option
 # 0: option name
-compiler.warn.lintOption=[{0}]\u0020
+compiler.warn.lintOption=[{0}] 
 
 # 0: symbol
 compiler.warn.constant.SVUID=serialVersionUID \u5728\u7C7B{0}\u4E2D\u5FC5\u987B\u662F\u5E38\u91CF
@@ -1046,6 +1195,8 @@
 
 compiler.misc.bad.signature=\u9519\u8BEF\u7684\u7B7E\u540D: {0}
 
+compiler.misc.bad.type.annotation.value=\u9519\u8BEF\u7684\u7C7B\u578B\u6CE8\u91CA\u76EE\u6807\u7C7B\u578B\u503C: {0}
+
 compiler.misc.class.file.wrong.class=\u7C7B\u6587\u4EF6\u5305\u542B\u9519\u8BEF\u7684\u7C7B: {0}
 
 compiler.misc.class.file.not.found=\u627E\u4E0D\u5230{0}\u7684\u7C7B\u6587\u4EF6
@@ -1077,24 +1228,17 @@
 
 #####
 
-# 0: message segment, 1: type, 2: type
-compiler.err.prob.found.req={0}\n\u9700\u8981: {2}\n\u627E\u5230:    {1}
+# 0: message segment
+compiler.err.prob.found.req=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B: {0}
 
 # 0: message segment, 1: type, 2: type
 compiler.warn.prob.found.req={0}\n\u9700\u8981: {2}\n\u627E\u5230:    {1}
 
-compiler.err.prob.found.req.1={0} {3}\n\u9700\u8981: {2}\n\u627E\u5230:    {1}
-
-## The following are all possible strings for the first argument ({0}) of the
-## above strings.
-compiler.misc.incompatible.types=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B
-
-# 0: message segment
-compiler.misc.incompatible.types.1=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B; {0}
-
-compiler.misc.inconvertible.types=\u4E0D\u53EF\u8F6C\u6362\u7684\u7C7B\u578B
-
-compiler.misc.possible.loss.of.precision=\u53EF\u80FD\u635F\u5931\u7CBE\u5EA6
+# 0: type, 1: type
+compiler.misc.inconvertible.types={0}\u65E0\u6CD5\u8F6C\u6362\u4E3A{1}
+
+# 0: type, 1: type
+compiler.misc.possible.loss.of.precision=\u4ECE{0}\u8F6C\u6362\u5230{1}\u53EF\u80FD\u4F1A\u6709\u635F\u5931
 
 compiler.misc.unchecked.assign=\u672A\u7ECF\u68C0\u67E5\u7684\u8F6C\u6362
 
@@ -1104,16 +1248,13 @@
 #     assigned array cannot dynamically check its stores
 compiler.misc.unchecked.cast.to.type=\u672A\u7ECF\u68C0\u67E5\u7684\u8F6C\u6362
 
-compiler.misc.assignment.from.super-bound=\u4ECE super-bound \u7C7B\u578B{0}\u8FDB\u884C\u5206\u914D
-
-compiler.misc.assignment.to.extends-bound=\u5230 extends-bound \u7C7B\u578B{0}\u7684\u5206\u914D
-
 # compiler.err.star.expected=\
 #     ''*'' expected
 # compiler.err.no.elem.type=\
 #     \[\*\] cannot have a type
 
-compiler.misc.try.not.applicable.to.type=try-with-resources \u4E0D\u9002\u7528\u4E8E\u53D8\u91CF\u7C7B\u578B
+# 0: type
+compiler.misc.try.not.applicable.to.type=try-with-resources \u4E0D\u9002\u7528\u4E8E\u53D8\u91CF\u7C7B\u578B\n({0})
 
 #####
 
@@ -1139,25 +1280,44 @@
 
 ## The following are all possible strings for the last argument of all those
 ## diagnostics whose key ends in ".1"
-compiler.misc.undetermined.type=\u672A\u786E\u5B9A\u7684\u7C7B\u578B
-
-compiler.misc.type.variable.has.undetermined.type=\u7C7B\u578B\u53D8\u91CF{0}\u5E26\u6709\u672A\u786E\u5B9A\u7684\u7C7B\u578B
 
 # 0: type, 1: list of type
 compiler.misc.no.unique.maximal.instance.exists=\u5BF9\u4E8E\u4E0A\u9650\u4E3A{1}\u7684\u7C7B\u578B\u53D8\u91CF{0}, \u4E0D\u5B58\u5728\u552F\u4E00\u6700\u5927\u5B9E\u4F8B
 
 compiler.misc.no.unique.minimal.instance.exists=\u5BF9\u4E8E\u4E0B\u9650\u4E3A{1}\u7684\u7C7B\u578B\u53D8\u91CF{0}, \u4E0D\u5B58\u5728\u552F\u4E00\u6700\u5C0F\u5B9E\u4F8B
 
-# 0: list of type, 1: type, 2: type
-compiler.misc.infer.no.conforming.instance.exists=\u4E0D\u5B58\u5728\u7C7B\u578B\u53D8\u91CF{0}\u7684\u5B9E\u4F8B, \u4EE5\u4F7F{1}\u4E0E{2}\u4E00\u81F4
+# 0: type, 1: list of type
+compiler.misc.incompatible.upper.bounds=\u63A8\u8BBA\u53D8\u91CF {0} \u5177\u6709\u4E0D\u517C\u5BB9\u7684\u4E0A\u9650 {1}
+
+# 0: type, 1: list of type, 2: list of type
+compiler.misc.incompatible.eq.upper.bounds=\u63A8\u8BBA\u53D8\u91CF {0} \u5177\u6709\u4E0D\u517C\u5BB9\u7684\u9650\u5236\u8303\u56F4\n\u7B49\u5F0F\u7EA6\u675F\u6761\u4EF6: {1}\n\u4E0A\u9650: {2}
+
+# 0: type, 1: list of type, 2: list of type
+compiler.misc.incompatible.eq.lower.bounds=\u63A8\u8BBA\u53D8\u91CF{0}\u5177\u6709\u4E0D\u517C\u5BB9\u7684\u9650\u5236\u8303\u56F4\n\u7B49\u5F0F\u7EA6\u675F\u6761\u4EF6: {1}\n\u4E0B\u9650: {2}
 
 # 0: list of type, 1: type, 2: type
-compiler.misc.infer.no.conforming.assignment.exists=\u4E0D\u5B58\u5728\u7C7B\u578B\u53D8\u91CF{0}\u7684\u5B9E\u4F8B, \u4EE5\u4F7F\u53C2\u6570\u7C7B\u578B{1}\u4E0E\u5F62\u5F0F\u53C2\u6570\u7C7B\u578B{2}\u4E00\u81F4
-
-compiler.misc.infer.arg.length.mismatch=\u65E0\u6CD5\u4ECE\u53C2\u6570\u8FDB\u884C\u5B9E\u4F8B\u5316, \u56E0\u4E3A\u5B9E\u9645\u53C2\u6570\u5217\u8868\u548C\u5F62\u5F0F\u53C2\u6570\u5217\u8868\u957F\u5EA6\u4E0D\u540C
+compiler.misc.infer.no.conforming.instance.exists=\u4E0D\u5B58\u5728\u7C7B\u578B\u53D8\u91CF{0}\u7684\u5B9E\u4F8B, \u4EE5\u4F7F{1}\u4E0E{2}\u4E00\u81F4
+
+# 0: list of type, 1: message segment
+compiler.misc.infer.no.conforming.assignment.exists=\u65E0\u6CD5\u63A8\u65AD\u7C7B\u578B\u53D8\u91CF {0}\n(\u53C2\u6570\u4E0D\u5339\u914D; {1})
+
+# 0: list of type
+compiler.misc.infer.arg.length.mismatch=\u65E0\u6CD5\u63A8\u65AD\u7C7B\u578B\u53D8\u91CF {0}\n(\u5B9E\u9645\u53C2\u6570\u5217\u8868\u548C\u5F62\u5F0F\u53C2\u6570\u5217\u8868\u957F\u5EA6\u4E0D\u540C)
+
+# 0: list of type, 1: message segment
+compiler.misc.infer.varargs.argument.mismatch=\u65E0\u6CD5\u63A8\u65AD\u7C7B\u578B\u53D8\u91CF {0}\n(varargs \u4E0D\u5339\u914D; {1})
 
 # 0: type, 1: list of type
-compiler.misc.inferred.do.not.conform.to.bounds=\u63A8\u65AD\u7C7B\u578B\u4E0D\u7B26\u5408\u58F0\u660E\u7684\u8303\u56F4\n\u63A8\u65AD: {0}\n\u8303\u56F4: {1}
+compiler.misc.inferred.do.not.conform.to.upper.bounds=\u63A8\u65AD\u7C7B\u578B\u4E0D\u7B26\u5408\u4E0A\u9650\n\u63A8\u65AD: {0}\n\u4E0A\u9650: {1}
+
+# 0: type, 1: list of type
+compiler.misc.inferred.do.not.conform.to.lower.bounds=\u63A8\u65AD\u7C7B\u578B\u4E0D\u7B26\u5408\u4E0B\u9650\n\u63A8\u65AD: {0}\n\u4E0B\u9650: {1}
+
+# 0: type, 1: list of type
+compiler.misc.inferred.do.not.conform.to.eq.bounds=\u63A8\u65AD\u7C7B\u578B\u4E0D\u7B26\u5408\u7B49\u5F0F\u7EA6\u675F\u6761\u4EF6\n\u63A8\u65AD: {0}\n\u7B49\u5F0F\u7EA6\u675F\u6761\u4EF6: {1}
+
+# 0: list of type
+compiler.misc.cyclic.inference=\u7531\u4E8E\u63A8\u8BBA\u5FAA\u73AF, \u65E0\u6CD5\u5B9E\u4F8B\u5316\u63A8\u8BBA\u53D8\u91CF{0}
 
 # 0: symbol
 compiler.misc.diamond={0}<>
@@ -1165,6 +1325,7 @@
 # 0: type
 compiler.misc.diamond.non.generic=\u65E0\u6CD5\u5C06 ''<>'' \u4E0E\u975E\u6CDB\u578B\u7C7B{0}\u4E00\u8D77\u4F7F\u7528
 
+# 0: unused
 compiler.misc.diamond.and.explicit.params=\u4E0D\u80FD\u5C06 ''<>'' \u4E0E\u6784\u9020\u5668\u7684\u663E\u5F0F\u7C7B\u578B\u53C2\u6570\u4E00\u8D77\u4F7F\u7528
 
 # 0: type, 1: list of type
@@ -1172,14 +1333,18 @@
 
 compiler.misc.arg.length.mismatch=\u5B9E\u9645\u53C2\u6570\u5217\u8868\u548C\u5F62\u5F0F\u53C2\u6570\u5217\u8868\u957F\u5EA6\u4E0D\u540C
 
-# 0: type, 1: type
-compiler.misc.no.conforming.assignment.exists=\u65E0\u6CD5\u901A\u8FC7\u65B9\u6CD5\u8C03\u7528\u8F6C\u6362\u5C06\u5B9E\u9645\u53C2\u6570{0}\u8F6C\u6362\u4E3A{1}
-
-# 0: type, 1: type
-compiler.misc.varargs.argument.mismatch=\u53C2\u6570\u7C7B\u578B{0}\u4E0D\u7B26\u5408 vararg \u5143\u7D20\u7C7B\u578B{1}
+# 0: message segment
+compiler.misc.no.conforming.assignment.exists=\u53C2\u6570\u4E0D\u5339\u914D; {0}
+
+# 0: message segment
+compiler.misc.varargs.argument.mismatch=varargs \u4E0D\u5339\u914D; {0}
 
 #####
 
+# 0: type, 1: file name
+compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file={1} \u4E2D\u7684\u8F85\u52A9\u7C7B{0}\u4E0D\u5E94\u4ECE\u5176\u81EA\u8EAB\u7684\u6E90\u6587\u4EF6\u4EE5\u5916\u8BBF\u95EE
+
+
 ## The first argument ({0}) is a "kindname".
 # 0: symbol kind, 1: symbol, 2: symbol
 compiler.err.abstract.cant.be.accessed.directly=\u65E0\u6CD5\u76F4\u63A5\u8BBF\u95EE{2}\u4E2D\u7684\u62BD\u8C61{0} {1}
@@ -1188,10 +1353,17 @@
 # 0: symbol kind, 1: symbol
 compiler.err.non-static.cant.be.ref=\u65E0\u6CD5\u4ECE\u9759\u6001\u4E0A\u4E0B\u6587\u4E2D\u5F15\u7528\u975E\u9759\u6001 {0} {1}
 
+# 0: symbol kind, 1: symbol
+compiler.misc.non-static.cant.be.ref=\u65E0\u6CD5\u4ECE\u9759\u6001\u4E0A\u4E0B\u6587\u4E2D\u5F15\u7528\u975E\u9759\u6001 {0} {1}
+
 ## Both arguments ({0}, {1}) are "kindname"s.  {0} is a comma-separated list
 ## of kindnames (the list should be identical to that provided in source.
 compiler.err.unexpected.type=\u610F\u5916\u7684\u7C7B\u578B\n\u9700\u8981: {0}\n\u627E\u5230:    {1}
 
+compiler.err.unexpected.lambda=\u6B64\u5904\u4E0D\u5E94\u4E3A lambda \u8868\u8FBE\u5F0F
+
+compiler.err.unexpected.mref=\u6B64\u5904\u4E0D\u5E94\u4E3A\u65B9\u6CD5\u5F15\u7528
+
 ## The first argument {0} is a "kindname" (e.g. 'constructor', 'field', etc.)
 ## The second argument {1} is the non-resolved symbol
 ## The third argument {2} is a list of type parameters (non-empty if {1} is a method)
@@ -1216,12 +1388,20 @@
 # 0: symbol kind, 1: name, 2: list of type, 3: list, 4: message segment
 compiler.err.cant.resolve.location.args.params=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7:   {0} <{2}>{1}({3})\n\u4F4D\u7F6E: {4}
 
+### Following are replicated/used for method reference diagnostics
+
+# 0: symbol kind, 1: name, 2: unused, 3: list of type, 4: message segment
+compiler.misc.cant.resolve.location.args=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7:   {0} {1}({3})\n\u4F4D\u7F6E: {4}
+
+# 0: symbol kind, 1: name, 2: list of type, 3: list, 4: message segment
+compiler.misc.cant.resolve.location.args.params=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7:   {0} <{2}>{1}({3})\n\u4F4D\u7F6E: {4}
+
 ##a location subdiagnostic is composed as follows:
 ## The first argument {0} is the location "kindname" (e.g. 'constructor', 'field', etc.)
 ## The second argument {1} is the location name
 ## The third argument {2} is the location type (only when {1} is a variable name)
 
-# 0: symbol kind, 1: symbol, 2: unused
+# 0: symbol kind, 1: type or symbol, 2: unused
 compiler.misc.location={0} {1}
 
 # 0: symbol kind, 1: symbol, 2: type
@@ -1256,6 +1436,10 @@
 
 compiler.misc.kindname.package=\u7A0B\u5E8F\u5305
 
+compiler.misc.kindname.static.init=\u9759\u6001\u521D\u59CB\u5316\u7A0B\u5E8F
+
+compiler.misc.kindname.instance.init=\u5B9E\u4F8B\u521D\u59CB\u5316\u7A0B\u5E8F
+
 #####
 
 compiler.misc.no.args=\u6CA1\u6709\u53C2\u6570
@@ -1312,6 +1496,7 @@
 # 0: symbol, 1: symbol, 2: symbol, 3: symbol
 compiler.misc.varargs.clash.with={1}\u4E2D\u7684{0}\u8986\u76D6\u4E86{3}\u4E2D\u7684{2}
 
+# 0: unused
 compiler.misc.diamond.and.anon.class=\u65E0\u6CD5\u5C06 ''<>'' \u4E0E\u533F\u540D\u5185\u90E8\u7C7B\u4E00\u8D77\u4F7F\u7528
 
 # 0: symbol kind, 1: symbol, 2: symbol, 3: message segment
@@ -1336,13 +1521,23 @@
 
 compiler.warn.assert.as.identifier=\u4ECE\u53D1\u884C\u7248 1.4 \u5F00\u59CB, ''assert'' \u662F\u4E00\u4E2A\u5173\u952E\u5B57, \u4F46\u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 1.4 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u5C06 ''assert'' \u7528\u4F5C\u5173\u952E\u5B57)
 
+compiler.warn.underscore.as.identifier=''_'' \u5DF2\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u4EE5\u540E\u7684\u53D1\u884C\u7248\u53EF\u80FD\u4E0D\u652F\u6301\u5C06 ''_'' \u7528\u4F5C\u6807\u8BC6\u7B26)
+
 compiler.err.enum.as.identifier=\u4ECE\u53D1\u884C\u7248 5 \u5F00\u59CB, ''enum'' \u4E3A\u5173\u952E\u5B57, \u800C\u4E0D\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 1.4 \u6216\u66F4\u4F4E\u7248\u672C\u4EE5\u5C06 ''enum'' \u7528\u4F5C\u6807\u8BC6\u7B26)
 
 compiler.err.assert.as.identifier=\u4ECE\u53D1\u884C\u7248 1.4 \u5F00\u59CB, ''assert'' \u662F\u4E00\u4E2A\u5173\u952E\u5B57, \u4F46\u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 1.3 \u6216\u66F4\u4F4E\u7248\u672C\u4EE5\u5C06 ''assert'' \u7528\u4F5C\u6807\u8BC6\u7B26)
 
 # TODO 308: make a better error message
-# compiler.err.this.as.identifier=\
-#    as of release 8, ''this'' is allowed as the parameter name for the receiver type only, which has to be the first parameter
+compiler.err.this.as.identifier=\u4ECE\u53D1\u884C\u7248 8 \u5F00\u59CB, ''this'' \u53EA\u80FD\u4F5C\u4E3A\u63A5\u6536\u65B9\u7C7B\u578B\u7684\u53C2\u6570\u540D, \u8BE5\u53C2\u6570\u5FC5\u987B\u4E3A\u7B2C\u4E00\u4E2A\u53C2\u6570
+
+# TODO 308: make a better error message
+compiler.err.cant.annotate.static.class=\u65E0\u6CD5\u5BF9\u5C01\u95ED\u9759\u6001\u5D4C\u5957\u7C7B\u8FDB\u884C\u6CE8\u91CA
+# TODO 308: make a better error message
+compiler.err.cant.annotate.nested.type=\u65E0\u6CD5\u5BF9\u5D4C\u5957\u7C7B\u578B\u8FDB\u884C\u6CE8\u91CA
+
+compiler.err.incorrect.receiver.type=\u63A5\u6536\u65B9\u7C7B\u578B\u4E0E\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D
+
+compiler.err.no.annotations.on.dot.class=\u7C7B\u6587\u5B57\u7C7B\u578B\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4EFB\u4F55\u6CE8\u91CA
 
 # 0: string
 compiler.err.generics.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u6CDB\u578B\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u6CDB\u578B)
@@ -1353,9 +1548,8 @@
 # 0: string
 compiler.err.annotations.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u6CE8\u91CA\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u6CE8\u91CA)
 
-#308 compiler.err.type.annotations.not.supported.in.source=\
-#308     type annotations are not supported in -source {0}\n\
-#308 (use -source 8 or higher to enable type annotations)
+# 0: string
+compiler.err.type.annotations.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u7C7B\u578B\u6CE8\u91CA\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u7C7B\u578B\u6CE8\u91CA)
 
 # 0: string
 compiler.err.foreach.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 for-each \u5FAA\u73AF\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 for-each \u5FAA\u73AF)
@@ -1375,6 +1569,47 @@
 # 0: string
 compiler.err.string.switch.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 switch \u4E2D\u5B58\u5728\u5B57\u7B26\u4E32\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u5141\u8BB8 switch \u4E2D\u5B58\u5728\u5B57\u7B26\u4E32)
 
+# 0: string
+compiler.err.lambda.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 lambda \u8868\u8FBE\u5F0F\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 lambda \u8868\u8FBE\u5F0F)
+
+# 0: string
+compiler.err.method.references.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u65B9\u6CD5\u5F15\u7528\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u65B9\u6CD5\u5F15\u7528)
+
+# 0: string
+compiler.err.default.methods.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u9ED8\u8BA4\u65B9\u6CD5\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9ED8\u8BA4\u65B9\u6CD5)
+
+# 0: string
+compiler.err.intersection.types.in.cast.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u8F6C\u6362\u4E2D\u7684\u4EA4\u53C9\u7C7B\u578B\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9ED8\u8BA4\u65B9\u6CD5)
+
+# 0: string
+compiler.err.static.intf.methods.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u9759\u6001\u63A5\u53E3\u65B9\u6CD5\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9759\u6001\u63A5\u53E3\u65B9\u6CD5)
+
+########################################
+# Diagnostics for verbose resolution
+# used by Resolve (debug only)
+########################################
+
+# 0: number, 1: symbol, 2: unused
+compiler.misc.applicable.method.found=\u627E\u5230\u7B2C {0} \u4E2A\u9002\u7528\u65B9\u6CD5: {1}
+
+# 0: number, 1: symbol, 2: message segment
+compiler.misc.applicable.method.found.1=\u627E\u5230\u7B2C {0} \u4E2A\u9002\u7528\u65B9\u6CD5: {1}\n({2})
+
+# 0: number, 1: symbol, 2: message segment
+compiler.misc.not.applicable.method.found=\u627E\u5230\u7B2C {0} \u4E2A\u4E0D\u9002\u7528\u7684\u65B9\u6CD5: {1}\n({2})
+
+# 0: type
+compiler.misc.partial.inst.sig=\u90E8\u5206\u5B9E\u4F8B\u5316\u4E3A: {0}
+
+# 0: name, 1: symbol, 2: number, 3: MethodResolutionPhase, 4: list of type or message segment, 5: list of type or message segment
+compiler.note.verbose.resolve.multi=\u5C06\u7C7B\u578B {1} \u7684\u65B9\u6CD5 {0} \u89E3\u6790\u4E3A\u5019\u9009\u9879 {2}\n\u9636\u6BB5: {3}\n\u5177\u6709\u5B9E\u9645\u503C: {4}\n\u5177\u6709\u7C7B\u578B\u53C2\u6570: {5}\n\u5019\u9009\u9879:
+
+# 0: name, 1: symbol, 2: unused, 3: MethodResolutionPhase, 4: list of type or message segment, 5: list of type or message segment
+compiler.note.verbose.resolve.multi.1=\u7C7B\u578B {1} \u7684\u65B9\u6CD5 {0} \u89E3\u6790\u9519\u8BEF\n\u9636\u6BB5: {3}\n\u5177\u6709\u5B9E\u9645\u503C: {4}\n\u5177\u6709\u7C7B\u578B\u53C2\u6570: {5}\n\u5019\u9009\u9879:
+
+# 0: symbol, 1: type, 2: type
+compiler.note.deferred.method.inst=\u65B9\u6CD5 {0} \u7684\u5EF6\u8FDF\u5B9E\u4F8B\u5316\n\u5B9E\u4F8B\u5316\u7B7E\u540D: {1}\n\u76EE\u6807\u7C7B\u578B: {2}
+
 ########################################
 # Diagnostics for where clause implementation
 # used by the RichDiagnosticFormatter.
@@ -1411,8 +1646,14 @@
 
 # compact where clause for type variable: contains the kindname ({2}) and location ({3})
 # in which the typevar has been declared
+# 0: type, 1: list of type, 2: symbol kind, 3: symbol
 compiler.misc.where.typevar.1={0}\u5DF2\u5728{2} {3}\u4E2D\u58F0\u660E
 
+# where clause for fresh type variable: contains upper bound(s) ('extends {1}').
+# Since a fresh type-variable is synthetic - there's no location/kindname here.
+# 0: type, 1: list of type
+compiler.misc.where.fresh.typevar={0}\u6269\u5C55{1}
+
 # where clause for type variable: contains all the upper bound(s) ('extends {1}')
 # of this intersection type
 # 0: type, 1: list of type
@@ -1435,4 +1676,39 @@
 
 compiler.misc.where.description.intersection.1=\u5176\u4E2D, {0}\u662F\u4EA4\u53C9\u7C7B\u578B:
 
-
+###
+# errors related to doc comments
+
+compiler.err.dc.bad.entity=HTML \u5B9E\u4F53\u9519\u8BEF
+
+compiler.err.dc.bad.gt=''>'' \u7684\u7528\u6CD5\u9519\u8BEF
+
+compiler.err.dc.bad.inline.tag=\u5185\u5D4C\u6807\u8BB0\u7684\u7528\u6CD5\u4E0D\u6B63\u786E
+
+compiler.err.dc.identifier.expected=\u9700\u8981\u6807\u8BC6\u7B26
+
+compiler.err.dc.malformed.html=\u683C\u5F0F\u9519\u8BEF\u7684 HTML
+
+compiler.err.dc.missing.semicolon=\u7F3A\u5C11\u5206\u53F7
+
+compiler.err.dc.no.content=\u65E0\u5185\u5BB9
+
+compiler.err.dc.no.tag.name='@' \u540E\u6CA1\u6709\u6807\u8BB0\u540D
+
+compiler.err.dc.gt.expected=\u9700\u8981 ''>''
+
+compiler.err.dc.ref.bad.parens=\u5F15\u7528\u4E2D\u7F3A\u5C11 '')''
+
+compiler.err.dc.ref.syntax.error=\u5F15\u7528\u4E2D\u51FA\u73B0\u8BED\u6CD5\u9519\u8BEF
+
+compiler.err.dc.ref.unexpected.input=\u610F\u5916\u7684\u6587\u672C
+
+compiler.err.dc.unexpected.content=\u610F\u5916\u7684\u5185\u5BB9
+
+compiler.err.dc.unterminated.inline.tag=\u672A\u7EC8\u6B62\u7684\u5185\u5D4C\u6807\u8BB0
+
+compiler.err.dc.unterminated.signature=\u672A\u7EC8\u6B62\u7684\u7B7E\u540D
+
+compiler.err.dc.unterminated.string=\u672A\u7EC8\u6B62\u7684\u5B57\u7B26\u4E32
+
+
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -30,7 +30,7 @@
 javac.opt.g.lines.vars.source=\u3044\u304F\u3064\u304B\u306E\u30C7\u30D0\u30C3\u30B0\u60C5\u5831\u306E\u307F\u3092\u751F\u6210\u3059\u308B
 javac.opt.nowarn=\u8B66\u544A\u3092\u767A\u751F\u3055\u305B\u306A\u3044
 javac.opt.verbose=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u52D5\u4F5C\u306B\u3064\u3044\u3066\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B
-javac.opt.deprecation=\u63A8\u5968\u3055\u308C\u306A\u3044API\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u30BD\u30FC\u30B9\u306E\u4F4D\u7F6E\u3092\u51FA\u529B\u3059\u308B
+javac.opt.deprecation=\u975E\u63A8\u5968\u306EAPI\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u30BD\u30FC\u30B9\u306E\u4F4D\u7F6E\u3092\u51FA\u529B\u3059\u308B
 javac.opt.classpath=\u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304A\u3088\u3073\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.sourcepath=\u5165\u529B\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.bootclasspath=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u4F4D\u7F6E\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B
@@ -40,9 +40,11 @@
 javac.opt.extdirs=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u62E1\u5F35\u6A5F\u80FD\u306E\u4F4D\u7F6E\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B
 javac.opt.processorpath=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.processor=\u5B9F\u884C\u3059\u308B\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u306E\u540D\u524D\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u691C\u51FA\u51E6\u7406\u3092\u30D0\u30A4\u30D1\u30B9
+javac.opt.parameters=\u30E1\u30BD\u30C3\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u30EA\u30D5\u30EC\u30AF\u30B7\u30E7\u30F3\u7528\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u751F\u6210\u3057\u307E\u3059
 javac.opt.proc.none.only=\u6CE8\u91C8\u51E6\u7406\u3084\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u304B\u3069\u3046\u304B\u3092\u5236\u5FA1\u3057\u307E\u3059\u3002
 javac.opt.d=\u751F\u6210\u3055\u308C\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u683C\u7D0D\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.sourceDest=\u751F\u6210\u3055\u308C\u305F\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u683C\u7D0D\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B
+javac.opt.headerDest=\u751F\u6210\u3055\u308C\u305F\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u683C\u7D0D\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.J=<flag>\u3092\u5B9F\u884C\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059
 javac.opt.encoding=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u4F7F\u7528\u3059\u308B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.target=\u7279\u5B9A\u306EVM\u30D0\u30FC\u30B8\u30E7\u30F3\u7528\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B
@@ -61,6 +63,8 @@
 javac.opt.arg.encoding=<encoding>
 javac.opt.arg.release=<release>
 javac.opt.arg.number=<number>
+javac.opt.plugin=\u5B9F\u884C\u3055\u308C\u308B\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u540D\u524D\u3068\u30AA\u30D7\u30B7\u30E7\u30F3\u5F15\u6570
+javac.opt.arg.plugin="name args"
 
 ## extended options
 
@@ -80,6 +84,9 @@
 javac.opt.arg.file=<filename>
 javac.opt.Xlint=\u63A8\u5968\u306E\u8B66\u544A\u3092\u6709\u52B9\u306B\u3059\u308B
 javac.opt.Xlint.suboptlist=\u7279\u5B9A\u306E\u8B66\u544A\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3059\u308B
+javac.opt.Xdoclint=javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306B\u95A2\u3059\u308B\u63A8\u5968\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B
+javac.opt.Xdoclint.subopts = (all|[-]<group>)[/<access>]
+javac.opt.Xdoclint.custom=\n        javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306B\u95A2\u3059\u308B\u7279\u5B9A\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\n        \u3053\u3053\u3067\u3001<group>\u306Faccessibility\u3001html\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3001\n        <access>\u306Fpublic\u3001protected\u3001package\u307E\u305F\u306Fprivate\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002
 javac.opt.Xstdout=\u6A19\u6E96\u51FA\u529B\u3092\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3059\u308B
 javac.opt.X=\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B
 javac.opt.help=\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B
@@ -107,6 +114,7 @@
 javac.err.file.not.found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 javac.err.file.not.directory=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0}
 javac.err.file.not.file=\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0}
+javac.msg.plugin.not.found=\u30D7\u30E9\u30B0\u30A4\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 ## messages
 
 javac.msg.usage.header=\u4F7F\u7528\u65B9\u6CD5: {0} <options> <source files>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002
@@ -117,11 +125,13 @@
 
 javac.msg.bug=\u30B3\u30F3\u30D1\u30A4\u30E9\u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002Bug Parade\u306B\u540C\u3058\u30D0\u30B0\u304C\u767B\u9332\u3055\u308C\u3066\u3044\u306A\u3044\u3053\u3068\u3092\u3054\u78BA\u8A8D\u306E\u4E0A\u3001Java Developer Connection(http://java.sun.com/webapps/bugreport)\u3067\u30D0\u30B0\u306E\u767B\u9332\u3092\u304A\u9858\u3044\u3044\u305F\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306B\u306F\u3001\u305D\u306E\u30D7\u30ED\u30B0\u30E9\u30E0\u3068\u4E0B\u8A18\u306E\u8A3A\u65AD\u5185\u5BB9\u3092\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u3054\u5354\u529B\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002
 
-javac.msg.io=\n\n\u5165\u51FA\u529B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
+javac.msg.io=\n\n\u5165\u51FA\u529B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
+
+javac.msg.proc.annotation.uncaught.exception=\n\n\u6CE8\u91C8\u51E6\u7406\u3067\u6355\u6349\u3055\u308C\u306A\u3044\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
 
-javac.msg.proc.annotation.uncaught.exception=\n\n\u6CE8\u91C8\u51E6\u7406\u3067\u6355\u6349\u3055\u308C\u306A\u3044\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
+javac.msg.plugin.uncaught.exception=\n\n\u30D7\u30E9\u30B0\u30A4\u30F3\u3067\u6355\u6349\u3055\u308C\u306A\u3044\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
 
-javac.msg.resource=\n\n\u30B7\u30B9\u30C6\u30E0\u30FB\u30EA\u30BD\u30FC\u30B9\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
+javac.msg.resource=\n\n\u30B7\u30B9\u30C6\u30E0\u30FB\u30EA\u30BD\u30FC\u30B9\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
 
 javac.version={0} {1}
 javac.fullVersion={0}\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"{1}"
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -40,9 +40,11 @@
 javac.opt.extdirs=\u8986\u76D6\u6240\u5B89\u88C5\u6269\u5C55\u7684\u4F4D\u7F6E
 javac.opt.processorpath=\u6307\u5B9A\u67E5\u627E\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u4F4D\u7F6E
 javac.opt.processor=\u8981\u8FD0\u884C\u7684\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u540D\u79F0; \u7ED5\u8FC7\u9ED8\u8BA4\u7684\u641C\u7D22\u8FDB\u7A0B
+javac.opt.parameters=\u751F\u6210\u5143\u6570\u636E\u4EE5\u7528\u4E8E\u65B9\u6CD5\u53C2\u6570\u7684\u53CD\u5C04
 javac.opt.proc.none.only=\u63A7\u5236\u662F\u5426\u6267\u884C\u6CE8\u91CA\u5904\u7406\u548C/\u6216\u7F16\u8BD1\u3002
 javac.opt.d=\u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E
 javac.opt.sourceDest=\u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u6E90\u6587\u4EF6\u7684\u4F4D\u7F6E
+javac.opt.headerDest=\u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u672C\u673A\u6807\u5934\u6587\u4EF6\u7684\u4F4D\u7F6E
 javac.opt.J=\u76F4\u63A5\u5C06 <\u6807\u8BB0> \u4F20\u9012\u7ED9\u8FD0\u884C\u65F6\u7CFB\u7EDF
 javac.opt.encoding=\u6307\u5B9A\u6E90\u6587\u4EF6\u4F7F\u7528\u7684\u5B57\u7B26\u7F16\u7801
 javac.opt.target=\u751F\u6210\u7279\u5B9A VM \u7248\u672C\u7684\u7C7B\u6587\u4EF6
@@ -61,6 +63,8 @@
 javac.opt.arg.encoding=<\u7F16\u7801>
 javac.opt.arg.release=<\u53D1\u884C\u7248>
 javac.opt.arg.number=<\u7F16\u53F7>
+javac.opt.plugin=\u8981\u8FD0\u884C\u7684\u63D2\u4EF6\u7684\u540D\u79F0\u548C\u53EF\u9009\u53C2\u6570
+javac.opt.arg.plugin="\u540D\u79F0\u53C2\u6570"
 
 ## extended options
 
@@ -80,6 +84,9 @@
 javac.opt.arg.file=<\u6587\u4EF6\u540D>
 javac.opt.Xlint=\u542F\u7528\u5EFA\u8BAE\u7684\u8B66\u544A
 javac.opt.Xlint.suboptlist=\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u7684\u8B66\u544A
+javac.opt.Xdoclint=\u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u5EFA\u8BAE\u7684\u68C0\u67E5
+javac.opt.Xdoclint.subopts = (all|[-]<group>)[/<access>]
+javac.opt.Xdoclint.custom=\n        \u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5,\n        \u5176\u4E2D <group> \u4E3A\u53EF\u8BBF\u95EE\u6027, html, \u5F15\u7528\u6216\u8BED\u6CD5\u4E4B\u4E00,\n        <access> \u4E3A public, protected, package \u6216 private \u4E4B\u4E00\u3002
 javac.opt.Xstdout=\u91CD\u5B9A\u5411\u6807\u51C6\u8F93\u51FA
 javac.opt.X=\u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981
 javac.opt.help=\u8F93\u51FA\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981
@@ -107,6 +114,7 @@
 javac.err.file.not.found=\u627E\u4E0D\u5230\u6587\u4EF6: {0}
 javac.err.file.not.directory=\u4E0D\u662F\u76EE\u5F55: {0}
 javac.err.file.not.file=\u4E0D\u662F\u6587\u4EF6: {0}
+javac.msg.plugin.not.found=\u627E\u4E0D\u5230\u63D2\u4EF6: {0}
 ## messages
 
 javac.msg.usage.header=\u7528\u6CD5: {0} <options> <source files>\n\u5176\u4E2D, \u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC:
@@ -121,6 +129,8 @@
 
 javac.msg.proc.annotation.uncaught.exception=\n\n\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u629B\u51FA\u672A\u6355\u83B7\u7684\u5F02\u5E38\u9519\u8BEF\u3002\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u4EE5\u4E0B\u5806\u6808\u8DDF\u8E2A\u3002\n
 
+javac.msg.plugin.uncaught.exception=\n\n\u63D2\u4EF6\u629B\u51FA\u672A\u6355\u83B7\u7684\u5F02\u5E38\u9519\u8BEF\u3002\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u4EE5\u4E0B\u5806\u6808\u8DDF\u8E2A\u3002\n
+
 javac.msg.resource=\n\n\u7CFB\u7EDF\u8D44\u6E90\u4E0D\u8DB3\u3002\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u4EE5\u4E0B\u5806\u6808\u8DDF\u8E2A\u3002\n
 
 javac.version={0} {1}
--- a/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java	Fri Apr 05 14:51:24 2013 -0700
@@ -149,12 +149,13 @@
         }
 
         final static Map<String, Package> packages = new TreeMap<String, Package>();
-        int maxProfile;
+
+        final int maxProfile = 4;  // Three compact profiles plus full JRE
 
         MakefileProfiles(Properties p) {
-            int profile = 1;
-            while (true) {
-                String inclPackages = p.getProperty("PROFILE_" + profile + "_RTJAR_INCLUDE_PACKAGES");
+            for (int profile = 1; profile <= maxProfile; profile++) {
+                String prefix = (profile < maxProfile ? "PROFILE_" + profile : "FULL_JRE");
+                String inclPackages = p.getProperty(prefix + "_RTJAR_INCLUDE_PACKAGES");
                 if (inclPackages == null)
                     break;
                 for (String pkg: inclPackages.substring(1).trim().split("\\s+")) {
@@ -162,22 +163,20 @@
                         pkg = pkg.substring(0, pkg.length() - 1);
                     includePackage(profile, pkg);
                 }
-                String inclTypes =  p.getProperty("PROFILE_" + profile + "_RTJAR_INCLUDE_TYPES");
+                String inclTypes =  p.getProperty(prefix + "_RTJAR_INCLUDE_TYPES");
                 if (inclTypes != null) {
                     for (String type: inclTypes.replace("$$", "$").split("\\s+")) {
                         if (type.endsWith(".class"))
                             includeType(profile, type.substring(0, type.length() - 6));
                     }
                 }
-                String exclTypes =  p.getProperty("PROFILE_" + profile + "_RTJAR_EXCLUDE_TYPES");
+                String exclTypes =  p.getProperty(prefix + "_RTJAR_EXCLUDE_TYPES");
                 if (exclTypes != null) {
                     for (String type: exclTypes.replace("$$", "$").split("\\s+")) {
                         if (type.endsWith(".class"))
                             excludeType(profile, type.substring(0, type.length() - 6));
                     }
                 }
-                maxProfile = profile;
-                profile++;
             }
         }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ArrayUtils.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ArrayUtils.java	Fri Apr 05 14:51:24 2013 -0700
@@ -85,17 +85,4 @@
         }
     }
 
-    public static <T> T[] concat(T[] anArr, T[] anotherArr) {
-        int newLength = anArr.length + anotherArr.length;
-        @SuppressWarnings("unchecked")
-        T[] result = (T[]) Array.newInstance(anArr.getClass().getComponentType(), newLength);
-        System.arraycopy(anArr, 0, result, 0, anArr.length);
-        System.arraycopy(anotherArr, 0, result, anArr.length, anotherArr.length);
-        return result;
-    }
-
-    @SuppressWarnings("unchecked")
-    public static <T> T[] concatOpen(T[] anArr, T... anotherArr) {
-        return concat(anArr, anotherArr);
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -509,6 +509,16 @@
                     visit(supertype);
                     visit(interfaces);
                 }
+            } else if (t.tsym.name.isEmpty()) {
+                //anon class
+                ClassType norm = (ClassType) t.tsym.type;
+                if (norm != null) {
+                    if (norm.interfaces_field != null && norm.interfaces_field.nonEmpty()) {
+                        visit(norm.interfaces_field.head);
+                    } else {
+                        visit(norm.supertype_field);
+                    }
+                }
             }
             nameSimplifier.addUsage(t.tsym);
             visit(t.getTypeArguments());
@@ -562,7 +572,7 @@
     // <editor-fold defaultstate="collapsed" desc="symbol scanner">
     /**
      * Preprocess a given symbol looking for (i) additional info (where clauses) to be
-     * asdded to the main diagnostic (ii) names to be compacted
+     * added to the main diagnostic (ii) names to be compacted
      */
     protected void preprocessSymbol(Symbol s) {
         symbolPreprocessor.visit(s, null);
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java	Fri Apr 05 14:51:24 2013 -0700
@@ -205,7 +205,7 @@
         if (recvtype == null) {
             return new AnnotationDesc[0];
         }
-        if (recvtype.getKind() != TypeKind.ANNOTATED) {
+        if (!recvtype.isAnnotated()) {
             return new AnnotationDesc[0];
         }
         List<? extends Compound> typeAnnos = ((com.sun.tools.javac.code.Type.AnnotatedType)recvtype).typeAnnotations;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Fri Apr 05 14:51:24 2013 -0700
@@ -65,11 +65,11 @@
             t = env.types.erasure(t);
         }
         if (considerAnnotations
-                && t.getKind() == TypeKind.ANNOTATED) {
+                && t.isAnnotated()) {
             return new AnnotatedTypeImpl(env, (com.sun.tools.javac.code.Type.AnnotatedType) t);
         }
 
-        if (t.getKind() == TypeKind.ANNOTATED) {
+        if (t.isAnnotated()) {
             Type.AnnotatedType at = (Type.AnnotatedType) t;
             return new AnnotatedTypeImpl(env, at);
         }
@@ -147,7 +147,7 @@
      */
     static String getTypeString(DocEnv env, Type t, boolean full) {
         // TODO: should annotations be included here?
-        if (t.getKind() == TypeKind.ANNOTATED) {
+        if (t.isAnnotated()) {
             Type.AnnotatedType at = (Type.AnnotatedType)t;
             t = at.underlyingType;
         }
--- a/langtools/src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java	Fri Apr 05 14:51:24 2013 -0700
@@ -127,7 +127,7 @@
         final Type upperBound = v.getUpperBound();
         Name boundname = upperBound.tsym.getQualifiedName();
         if (boundname == boundname.table.names.java_lang_Object
-            && upperBound.getKind() != TypeKind.ANNOTATED) {
+            && !upperBound.isAnnotated()) {
             return List.nil();
         } else {
             return env.types.getBounds(v);
@@ -139,7 +139,7 @@
      * Return an empty array if there are none.
      */
     public AnnotationDesc[] annotations() {
-        if (type.getKind() != TypeKind.ANNOTATED) {
+        if (!type.isAnnotated()) {
             return new AnnotationDesc[0];
         }
         List<TypeCompound> tas = ((com.sun.tools.javac.code.Type.AnnotatedType) type).typeAnnotations;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -37,7 +37,6 @@
 main.incompatible.access.flags=-public\u3001-private\u3001-package\u307E\u305F\u306F-protected\u306E\u3046\u3061\u306E2\u3064\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u307E\u3057\u305F\u3002
 main.cant.read={0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093
 main.Loading_source_files_for_package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059...
-main.Loading_source_file_for_class=\u30AF\u30E9\u30B9{0}\u306E\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059...
 main.Loading_source_file=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059...
 main.Building_tree=Javadoc\u60C5\u5831\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059...
 main.no_source_files_for_package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093
@@ -67,13 +66,12 @@
 tag.see.can_not_find_member=\u30BF\u30B0{0}: {2}\u3067{1}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 tag.see.no_close_bracket_on_url=\u30BF\u30B0{0}: \u9589\u3058\u30BF\u30B0''>''\u304C\u3042\u308A\u307E\u305B\u3093: "{1}"
 tag.see.no_close_quote=\u30BF\u30B0{0}: \u9589\u3058\u5F15\u7528\u7B26\u304C\u3042\u308A\u307E\u305B\u3093: "{1}"
-tag.see.class_not_found=@see\u30BF\u30B0\u7528\u306E\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "{1}"
 tag.see.class_not_specified=\u30BF\u30B0{0}: \u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093: "{1}"
 tag.see.illegal_character=\u30BF\u30B0{0}: "{2}"\u306B\u4E0D\u6B63\u306A\u6587\u5B57"{1}"\u304C\u3042\u308A\u307E\u3059
 tag.see.malformed_see_tag=\u30BF\u30B0{0}: \u66F8\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: "{1}"
-tag.throws.exception_not_found={0}\u30BF\u30B0\u3001\u30AF\u30E9\u30B9{1}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 tag.End_delimiter_missing_for_possible_SeeTag=\u30B3\u30E1\u30F3\u30C8\u6587\u5B57\u5217"{0}"\u3067\u3001\u6709\u52B9\u306Asee\u30BF\u30B0\u306B\u7D42\u7AEF\u30C7\u30EA\u30DF\u30BF}\u304C\u3042\u308A\u307E\u305B\u3093
 tag.Improper_Use_Of_Link_Tag=\u30A4\u30F3\u30E9\u30A4\u30F3\u30FB\u30BF\u30B0"{0}"\u306B\u7D42\u4E86\u6587\u5B57''}''\u304C\u3042\u308A\u307E\u305B\u3093
+tag.serialField.illegal_character=@serialField\u30BF\u30B0\u306B\u4E0D\u6B63\u306A\u6587\u5B57{0}\u304C\u3042\u308A\u307E\u3059: {1}\u3002
 javadoc.File_Read_Error=\u30D5\u30A1\u30A4\u30EB{0}\u306E\u8AAD\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
 javadoc.Body_missing_from_html_file=HTML\u306Bbody\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093
 javadoc.End_body_missing_from_html_file=HTML\u30D5\u30A1\u30A4\u30EB\u306Bbody\u306E\u9589\u3058\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093
@@ -81,4 +79,8 @@
 javadoc.class_not_found=\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 javadoc.error=\u30A8\u30E9\u30FC
 javadoc.warning=\u8B66\u544A
-tag.serialField.illegal_character=@serialField\u30BF\u30B0\u306B\u4E0D\u6B63\u306A\u6587\u5B57{0}\u304C\u3042\u308A\u307E\u3059: {1}\u3002
+
+javadoc.error.msg={0}: \u30A8\u30E9\u30FC - {1}
+javadoc.warning.msg={0}: \u8B66\u544A - {1}
+javadoc.note.msg = {1}
+javadoc.note.pos.msg= {0}: {1}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -37,7 +37,6 @@
 main.incompatible.access.flags=\u6307\u5B9A\u4E86\u591A\u4E2A -public, -private, -package \u6216 -protected\u3002
 main.cant.read=\u65E0\u6CD5\u8BFB\u53D6{0}
 main.Loading_source_files_for_package=\u6B63\u5728\u52A0\u8F7D\u7A0B\u5E8F\u5305{0}\u7684\u6E90\u6587\u4EF6...
-main.Loading_source_file_for_class=\u6B63\u5728\u52A0\u8F7D\u7C7B{0}\u7684\u6E90\u6587\u4EF6...
 main.Loading_source_file=\u6B63\u5728\u52A0\u8F7D\u6E90\u6587\u4EF6{0}...
 main.Building_tree=\u6B63\u5728\u6784\u9020 Javadoc \u4FE1\u606F...
 main.no_source_files_for_package=\u6CA1\u6709\u7A0B\u5E8F\u5305{0}\u7684\u6E90\u6587\u4EF6
@@ -67,13 +66,12 @@
 tag.see.can_not_find_member=\u6807\u8BB0{0}: \u5728{2}\u4E2D\u627E\u4E0D\u5230{1}
 tag.see.no_close_bracket_on_url=\u6807\u8BB0{0}: \u7F3A\u5C11\u6700\u540E\u7684 ''>'': "{1}"
 tag.see.no_close_quote=\u6807\u8BB0{0}: \u65E0\u53F3\u5F15\u53F7: "{1}"
-tag.see.class_not_found=\u627E\u4E0D\u5230 @see \u6807\u8BB0\u7684\u7C7B{0}: "{1}"
 tag.see.class_not_specified=\u6807\u8BB0{0}: \u672A\u6307\u5B9A\u7C7B: "{1}"
 tag.see.illegal_character=\u6807\u8BB0{0}: "{2}" \u4E2D\u7684 "{1}" \u4E3A\u975E\u6CD5\u5B57\u7B26
 tag.see.malformed_see_tag=\u6807\u8BB0{0}: \u683C\u5F0F\u9519\u8BEF: "{1}"
-tag.throws.exception_not_found=\u6807\u8BB0{0}: \u627E\u4E0D\u5230\u7C7B{1}\u3002
 tag.End_delimiter_missing_for_possible_SeeTag=\u6CE8\u91CA\u5B57\u7B26\u4E32\u4E2D\u53EF\u80FD\u51FA\u73B0\u7684 See \u6807\u8BB0\u7F3A\u5C11\u7ED3\u675F\u5206\u9694\u7B26 }: "{0}"
 tag.Improper_Use_Of_Link_Tag=\u5185\u5D4C\u6807\u8BB0\u7F3A\u5C11\u7ED3\u675F ''}'' \u5B57\u7B26: "{0}"
+tag.serialField.illegal_character=@serialField \u6807\u8BB0\u4E2D\u7684\u975E\u6CD5\u5B57\u7B26 {0}: {1}\u3002
 javadoc.File_Read_Error=\u8BFB\u53D6\u6587\u4EF6{0}\u65F6\u51FA\u9519
 javadoc.Body_missing_from_html_file=HTML \u6587\u4EF6\u4E2D\u7F3A\u5C11\u4E3B\u4F53\u6807\u8BB0
 javadoc.End_body_missing_from_html_file=HTML \u6587\u4EF6\u4E2D\u7F3A\u5C11\u4E3B\u4F53\u7ED3\u675F\u6807\u8BB0
@@ -81,4 +79,8 @@
 javadoc.class_not_found=\u627E\u4E0D\u5230\u7C7B{0}\u3002
 javadoc.error=\u9519\u8BEF
 javadoc.warning=\u8B66\u544A
-tag.serialField.illegal_character=@serialField \u6807\u8BB0\u4E2D\u7684\u975E\u6CD5\u5B57\u7B26 {0}: {1}\u3002
+
+javadoc.error.msg={0}: \u9519\u8BEF - {1}
+javadoc.warning.msg={0}: \u8B66\u544A - {1}
+javadoc.note.msg = {1}
+javadoc.note.pos.msg= {0}: {1}
--- a/langtools/src/share/classes/com/sun/tools/javah/Util.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/Util.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -144,10 +144,6 @@
         throw new Exit(15);
     }
 
-    private void fatal(String msg) throws Exit {
-        fatal(msg, null);
-    }
-
     private void fatal(String msg, Exception e) throws Exit {
         dl.report(createDiagnostic(Diagnostic.Kind.ERROR, "", msg));
         throw new Exit(10, e);
--- a/langtools/src/share/classes/com/sun/tools/javah/resources/l10n_ja.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/resources/l10n_ja.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, 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
@@ -33,10 +33,10 @@
 old.jni.mixed=\u30AA\u30D7\u30B7\u30E7\u30F3-jni\u3068-old\u3092\u540C\u6642\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002-help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 old.llni.mixed=\u30AA\u30D7\u30B7\u30E7\u30F3-old\u3068-llni\u3092\u540C\u6642\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002-help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 old.not.supported=\u3053\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306Ejavah\u3067\u306F\u30AA\u30D7\u30B7\u30E7\u30F3-old\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-invalid.method.signature=\u7121\u52B9\u306A\u30E1\u30BD\u30C3\u30C9\u30FB\u30B7\u30B0\u30CB\u30C1\u30E3: {0}
+invalid.method.signature=\u7121\u52B9\u306A\u30E1\u30BD\u30C3\u30C9\u30FB\u30B7\u30B0\u30CD\u30C1\u30E3: {0}
 jni.llni.mixed=\u30AA\u30D7\u30B7\u30E7\u30F3-jni\u3068-llni\u3092\u540C\u6642\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002-help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 jni.no.stubs=JNI\u306F\u30B9\u30BF\u30D6\u3092\u5FC5\u8981\u3068\u3057\u307E\u305B\u3093\u3002JNI\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
-jni.sigerror={0}\u306E\u7F72\u540D\u3092\u5224\u5B9A\u3067\u304D\u307E\u305B\u3093
+jni.sigerror={0}\u306E\u30B7\u30B0\u30CD\u30C1\u30E3\u3092\u5224\u5225\u3067\u304D\u307E\u305B\u3093
 dir.file.mixed=\u30AA\u30D7\u30B7\u30E7\u30F3-d\u3068-o\u3092\u540C\u6642\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002-help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 no.classes.specified=\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002-help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 no.outputfile.specified=\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002-help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
@@ -51,7 +51,7 @@
 #
 usage=\u4F7F\u7528\u65B9\u6CD5: javah [options] <classes>\n\n[options]\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n\n\t-help           \u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n\t-classpath <path>   \u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\n\t-bootclasspath <path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\n\t-d<dir>         \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n\t-o <file>         \u51FA\u529B\u30D5\u30A1\u30A4\u30EB(-d\u304B-o\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u4F7F\u7528\u3059\u308B)\n\t-jni           JNI\u5F62\u5F0F\u306E\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n\t-version         \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3059\u308B\n\t-verbose         \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n\t-force          \u5E38\u306B\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u66F8\u304D\u8FBC\u3080\n\n<classes> \u306F\u5B8C\u5168\u6307\u5B9A\u306E\u540D\u524D\u3067\u6307\u5B9A\u3057\u307E\u3059\n(java.lang.Object\u306A\u3069)\u3002\n
 
-main.usage=\u4F7F\u7528\u65B9\u6CD5: \n\  javah [options] <classes>\n[options]\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002
+main.usage=\u4F7F\u7528\u65B9\u6CD5: \n  javah [options] <classes>\n[options]\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002
 main.opt.o=\  -o <file>                \u51FA\u529B\u30D5\u30A1\u30A4\u30EB(-d\u304B-o\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u4F7F\u7528\u3059\u308B)
 main.opt.d=\  -d <dir>                 \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA
 main.opt.v=\  -v  -verbose             \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046
--- a/langtools/src/share/classes/com/sun/tools/javah/resources/l10n_zh_CN.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/resources/l10n_zh_CN.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, 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
@@ -51,7 +51,7 @@
 #
 usage=\u7528\u6CD5: javah [options] <classes>\n\n\u5176\u4E2D, [options] \u5305\u62EC:\n\n\t-help                 \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\u5E76\u9000\u51FA\n\t-classpath <path>     \u4ECE\u4E2D\u52A0\u8F7D\u7C7B\u7684\u8DEF\u5F84\n\t-bootclasspath <path> \u4ECE\u4E2D\u52A0\u8F7D\u5F15\u5BFC\u7C7B\u7684\u8DEF\u5F84\n\t-d <dir>              \u8F93\u51FA\u76EE\u5F55\n\t-o <file>             \u8F93\u51FA\u6587\u4EF6 (\u53EA\u80FD\u4F7F\u7528 -d \u6216 -o \u4E4B\u4E00)\n\t-jni                  \u751F\u6210 JNI \u6837\u5F0F\u7684\u6807\u5934\u6587\u4EF6 (\u9ED8\u8BA4\u503C)\n\t-version              \u8F93\u51FA\u7248\u672C\u4FE1\u606F\n\t-verbose              \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n\t-force                \u59CB\u7EC8\u5199\u5165\u8F93\u51FA\u6587\u4EF6\n\n<classes> \u662F\u4F7F\u7528\u5176\u5168\u9650\u5B9A\u540D\u79F0\u6307\u5B9A\u7684,\n(\u4F8B\u5982 java.lang.Object)\u3002\n
 
-main.usage=\u7528\u6CD5: \n\  javah [options] <classes>\n\u5176\u4E2D, [options] \u5305\u62EC:
+main.usage=\u7528\u6CD5: \n  javah [options] <classes>\n\u5176\u4E2D, [options] \u5305\u62EC:
 main.opt.o=\  -o <file>                \u8F93\u51FA\u6587\u4EF6 (\u53EA\u80FD\u4F7F\u7528 -d \u6216 -o \u4E4B\u4E00)
 main.opt.d=\  -d <dir>                 \u8F93\u51FA\u76EE\u5F55
 main.opt.v=\  -v  -verbose             \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA
--- a/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -269,7 +269,7 @@
 
     }
 
-    class StackMap {
+    static class StackMap {
         StackMap(verification_type_info[] locals, verification_type_info[] stack) {
             this.locals = locals;
             this.stack = stack;
@@ -279,7 +279,7 @@
         private final verification_type_info[] stack;
     }
 
-    class CustomVerificationTypeInfo extends verification_type_info {
+    static class CustomVerificationTypeInfo extends verification_type_info {
         public CustomVerificationTypeInfo(String text) {
             super(-1);
             this.text = text;
--- a/langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java	Fri Apr 05 14:51:24 2013 -0700
@@ -91,9 +91,11 @@
                             result.requiredArchives.add(source);
                         }
                         // either a profile name or the archive name
-                        String tname = getProfile(target);
-                        if (tname.isEmpty()){
-                            tname = source.toString();
+                        String tname = result.getTargetProfile(target);
+                        if (tname.isEmpty()) {
+                            tname = PlatformClassPath.contains(source)
+                                        ? "JDK internal API (" + source.getFileName() + ")"
+                                        : source.toString();
                         }
                         if (!result.targetNames.contains(tname)) {
                             result.targetNames.add(tname);
@@ -110,7 +112,7 @@
          * a fully-qualified classname, a package name, a profile or
          * archive name depending on the Analyzer's type.
          */
-        void visit(String origin, String target);
+        void visit(String origin, String target, String profile);
         /**
          * Visits the source archive to its destination archive of
          * a recorded dependency.
@@ -124,7 +126,7 @@
                 v.visit(r.archive, a);
             }
             for (String name : r.targetNames) {
-                v.visit(r.archive.getFileName(), name);
+                v.visit(r.archive.getFileName(), name, name);
             }
         }
     }
@@ -138,7 +140,7 @@
                 for (String target : r.deps.get(origin)) {
                     // filter intra-dependency unless in verbose mode
                     if (type == Type.VERBOSE || getArchive(origin) != getArchive(target)) {
-                        v.visit(origin, target);
+                        v.visit(origin, target, r.getTargetProfile(target));
                     }
                 }
             }
@@ -149,21 +151,16 @@
         return map.containsKey(name) ? map.get(name) : NOT_FOUND;
     }
 
-    public String getArchiveName(String name) {
-        return getArchive(name).getFileName();
-    }
-
-    public String getProfile(String name) {
-        String pn = type == Type.CLASS ? packageOf(name) : name;
-        Archive source = map.get(name);
-        if (source != null && PlatformClassPath.contains(source)) {
-            String profile = PlatformClassPath.getProfileName(pn);
-            if (profile.isEmpty()) {
-                return "JDK internal API (" + source.getFileName() + ")";
-            }
-            return profile;
-        }
-        return "";
+    /**
+     * Returns the file name of the archive for non-JRE class or
+     * internal JRE classes.  It returns empty string for SE API.
+     */
+    public String getArchiveName(String target, String profile) {
+        Archive source = getArchive(target);
+        String name = source.getFileName();
+        if (PlatformClassPath.contains(source))
+            return profile.isEmpty() ? "JDK internal API (" + name + ")" : "";
+        return name;
     }
 
     private abstract class ArchiveDeps implements Archive.Visitor {
@@ -200,6 +197,8 @@
         }
 
         public abstract void visit(Location o, Location t);
+        public abstract String getTargetProfile(String target);
+
     }
 
     private class ClassVisitor extends ArchiveDeps {
@@ -212,6 +211,10 @@
         public void visit(Location o, Location t) {
             add(o.getClassName(), t.getClassName());
         }
+        public String getTargetProfile(String target) {
+            int i = target.lastIndexOf('.');
+            return (i > 0) ? Profiles.getProfileName(target.substring(0, i)) : "";
+        }
     }
 
     private class PackageVisitor extends ArchiveDeps {
@@ -221,19 +224,15 @@
         public void visit(Location o, Location t) {
             add(packageOf(o), packageOf(t));
         }
-
         public void visit(Location l) {
             add(packageOf(l));
         }
-
         private String packageOf(Location loc) {
             String pkg = loc.getPackageName();
             return pkg.isEmpty() ? "<unnamed>" : pkg;
         }
-    }
-
-    private static String packageOf(String cn) {
-        int i = cn.lastIndexOf('.');
-        return (i > 0) ? cn.substring(0, i) : "<unnamed>";
+        public String getTargetProfile(String target) {
+            return Profiles.getProfileName(target);
+        }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/jdeps/ClassFileReader.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/ClassFileReader.java	Fri Apr 05 14:51:24 2013 -0700
@@ -59,6 +59,13 @@
         }
     }
 
+    /**
+     * Returns a ClassFileReader instance of a given JarFile.
+     */
+    public static ClassFileReader newInstance(Path path, JarFile jf) throws IOException {
+        return new JarFileReader(path, jf);
+    }
+
     protected final Path path;
     protected final String baseFileName;
     private ClassFileReader(Path path) {
@@ -228,8 +235,11 @@
     private static class JarFileReader extends ClassFileReader {
         final JarFile jarfile;
         JarFileReader(Path path) throws IOException {
+            this(path, new JarFile(path.toFile()));
+        }
+        JarFileReader(Path path, JarFile jf) throws IOException {
             super(path);
-            this.jarfile = new JarFile(path.toFile());
+            this.jarfile = jf;
         }
 
         public ClassFile getClassFile(String name) throws IOException {
--- a/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -38,7 +38,7 @@
  * Implementation for the jdeps tool for static class dependency analysis.
  */
 class JdepsTask {
-    class BadArgs extends Exception {
+    static class BadArgs extends Exception {
         static final long serialVersionUID = 8765093759964640721L;
         BadArgs(String key, Object... args) {
             super(JdepsTask.getMessage(key, args));
@@ -119,7 +119,7 @@
                 } else if ("class".equals(arg)) {
                     task.options.verbose = Analyzer.Type.CLASS;
                 } else {
-                    throw task.new BadArgs("err.invalid.arg.for.option", opt);
+                    throw new BadArgs("err.invalid.arg.for.option", opt);
                 }
             }
         },
@@ -139,8 +139,11 @@
             }
         },
         new Option(false, "-P", "--profile") {
-            void process(JdepsTask task, String opt, String arg) {
+            void process(JdepsTask task, String opt, String arg) throws BadArgs {
                 task.options.showProfile = true;
+                if (Profiles.getProfileCount() == 0) {
+                    throw new BadArgs("err.option.unsupported", opt, getMessage("err.profiles.msg"));
+                }
             }
         },
         new Option(false, "-R", "--recursive") {
@@ -153,7 +156,7 @@
                 try {
                     task.options.depth = Integer.parseInt(arg);
                 } catch (NumberFormatException e) {
-                    throw task.new BadArgs("err.invalid.arg.for.option", opt);
+                    throw new BadArgs("err.invalid.arg.for.option", opt);
                 }
             }
         },
@@ -382,9 +385,9 @@
 
     private void printSummary(final PrintWriter out, final Analyzer analyzer) {
         Analyzer.Visitor visitor = new Analyzer.Visitor() {
-            public void visit(String origin, String profile) {
+            public void visit(String origin, String target, String profile) {
                 if (options.showProfile) {
-                    out.format("%-30s -> %s%n", origin, profile);
+                    out.format("%-30s -> %s%n", origin, target);
                 }
             }
             public void visit(Archive origin, Archive target) {
@@ -399,17 +402,15 @@
     private void printDependencies(final PrintWriter out, final Analyzer analyzer) {
         Analyzer.Visitor visitor = new Analyzer.Visitor() {
             private String pkg = "";
-            public void visit(String origin, String target) {
+            public void visit(String origin, String target, String profile) {
                 if (!origin.equals(pkg)) {
                     pkg = origin;
-                    out.format("   %s (%s)%n", origin, analyzer.getArchiveName(origin));
+                    out.format("   %s (%s)%n", origin, analyzer.getArchive(origin).getFileName());
                 }
-                Archive source = analyzer.getArchive(target);
-                String profile = options.showProfile ? analyzer.getProfile(target) : "";
                 out.format("      -> %-50s %s%n", target,
-                           PlatformClassPath.contains(source)
+                           (options.showProfile && !profile.isEmpty())
                                ? profile
-                               : analyzer.getArchiveName(target));
+                               : analyzer.getArchiveName(target, profile));
             }
             public void visit(Archive origin, Archive target) {
                 out.format("%s -> %s%n", origin, target);
@@ -514,7 +515,6 @@
         boolean help;
         boolean version;
         boolean fullVersion;
-        boolean showFlags;
         boolean showProfile;
         boolean showSummary;
         boolean wildcard;
--- a/langtools/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -37,34 +37,6 @@
  * ClassPath for Java SE and JDK
  */
 class PlatformClassPath {
-    /*
-     * Profiles for Java SE
-     *
-     * This is a temporary workaround until a common API is defined for langtools
-     * to determine which profile a given classname belongs to.  The list of
-     * packages and profile names are hardcoded in jdk.properties and
-     * split packages are not supported.
-     */
-    static class Profile {
-        final String name;
-        final Set<String> packages;
-
-        Profile(String name) {
-            this.name = name;
-            this.packages = new HashSet<String>();
-        }
-    }
-
-    private final static String JAVAFX = "javafx";
-    private final static Map<String,Profile> map = getProfilePackages();
-    static String getProfileName(String packageName) {
-        Profile profile = map.get(packageName);
-        if (packageName.startsWith(JAVAFX + ".")) {
-            profile = map.get(JAVAFX);
-        }
-        return profile != null ? profile.name : "";
-    }
-
     private final static List<Archive> javaHomeArchives = init();
     static List<Archive> getArchives() {
         return javaHomeArchives;
@@ -77,7 +49,6 @@
     private static List<Archive> init() {
         List<Archive> result = new ArrayList<Archive>();
         String javaHome = System.getProperty("java.home");
-        List<File> files = new ArrayList<File>();
         File jre = new File(javaHome, "jre");
         File lib = new File(javaHome, "lib");
 
@@ -100,13 +71,6 @@
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
-
-        // add a JavaFX profile if there is jfxrt.jar
-        for (Archive archive : result) {
-            if (archive.getFileName().equals("jfxrt.jar")) {
-                map.put(JAVAFX, new Profile("jfxrt.jar"));
-            }
-        }
         return result;
     }
 
@@ -140,30 +104,4 @@
         });
         return result;
     }
-
-    private static Map<String,Profile> getProfilePackages() {
-        Map<String,Profile> map = new HashMap<String,Profile>();
-
-        // read the properties as a ResourceBundle as the build compiles
-        // the properties file into Java class.  Another alternative is
-        // to load it as Properties and fix the build to exclude this file.
-        ResourceBundle profileBundle =
-            ResourceBundle.getBundle("com.sun.tools.jdeps.resources.jdk");
-
-        int i=1;
-        String key;
-        while (profileBundle.containsKey((key = "profile." + i + ".name"))) {
-            Profile profile = new Profile(profileBundle.getString(key));
-            String n = profileBundle.getString("profile." + i + ".packages");
-            String[] pkgs = n.split("\\s+");
-            for (String p : pkgs) {
-                if (p.isEmpty()) continue;
-                assert(map.containsKey(p) == false);
-                profile.packages.add(p);
-                map.put(p, profile);
-            }
-            i++;
-        }
-        return map;
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Profiles.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 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.
+ */
+package com.sun.tools.jdeps;
+
+import com.sun.tools.classfile.Annotation;
+import com.sun.tools.classfile.Annotation.*;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPool;
+import com.sun.tools.classfile.ConstantPool.*;
+import com.sun.tools.classfile.ConstantPoolException;
+import com.sun.tools.classfile.RuntimeAnnotations_attribute;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.jar.JarFile;
+
+/**
+ * Build the profile information from ct.sym if exists.
+ */
+class Profiles {
+    private static final Map<String,Profile> map = initProfiles();
+    /**
+     * Returns the name of the profile for the given package name.
+     * It returns an empty string if the given package is not in any profile.
+     */
+    public static String getProfileName(String pn) {
+        Profile profile = map.get(pn);
+        return (profile != null && profile.packages.contains(pn))
+                    ? profile.name : "";
+    }
+
+    public static int getProfileCount() {
+        return new HashSet<Profile>(map.values()).size();
+    }
+
+    private static Map<String,Profile> initProfiles() {
+        List<Profile> profiles = new ArrayList<Profile>();
+        try {
+            String profilesProps = System.getProperty("jdeps.profiles");
+            if (profilesProps != null) {
+                // for testing for JDK development build where ct.sym doesn't exist
+                initProfilesFromProperties(profiles, profilesProps);
+            } else {
+                Path home = Paths.get(System.getProperty("java.home"));
+                if (home.endsWith("jre")) {
+                    home = home.getParent();
+                }
+                Path ctsym = home.resolve("lib").resolve("ct.sym");
+                if (ctsym.toFile().exists()) {
+                    // add a default Full JRE
+                    profiles.add(0, new Profile("Full JRE", 0));
+                    // parse ct.sym and load information about profiles
+                    try (JarFile jf = new JarFile(ctsym.toFile())) {
+                        ClassFileReader reader = ClassFileReader.newInstance(ctsym, jf);
+                        for (ClassFile cf : reader.getClassFiles()) {
+                            findProfile(profiles, cf);
+                        }
+                    }
+
+                    // merge the last Profile with the "Full JRE"
+                    if (profiles.size() > 1) {
+                        Profile fullJRE = profiles.get(0);
+                        Profile p = profiles.remove(profiles.size() - 1);
+                        for (String pn : fullJRE.packages) {
+                            // The last profile contains the packages determined from ct.sym.
+                            // Move classes annotated profile==0 or no attribute that are
+                            // added in the fullJRE profile to either supported or proprietary
+                            // packages appropriately
+                            if (p.proprietaryPkgs.contains(pn)) {
+                                p.proprietaryPkgs.add(pn);
+                            } else {
+                                p.packages.add(pn);
+                            }
+                        }
+                        fullJRE.packages.clear();
+                        fullJRE.proprietaryPkgs.clear();
+                        fullJRE.packages.addAll(p.packages);
+                        fullJRE.proprietaryPkgs.addAll(p.proprietaryPkgs);
+                    }
+                }
+            }
+        } catch (IOException | ConstantPoolException e) {
+            throw new Error(e);
+        }
+        HashMap<String,Profile> map = new HashMap<String,Profile>();
+        for (Profile profile : profiles) {
+            // Inner classes are not annotated with the profile annotation
+            // packages may be in one profile but also appear in the Full JRE
+            // Full JRE is always the first element in profiles list and
+            // so the map will contain the appropriate Profile
+            for (String pn : profile.packages) {
+                map.put(pn, profile);
+            }
+            for (String pn : profile.proprietaryPkgs) {
+                map.put(pn, profile);
+            }
+        }
+        return map;
+    }
+
+    private static final String PROFILE_ANNOTATION = "Ljdk/Profile+Annotation;";
+    private static final String PROPRIETARY_ANNOTATION = "Lsun/Proprietary+Annotation;";
+    private static Profile findProfile(List<Profile> profiles, ClassFile cf)
+            throws ConstantPoolException
+    {
+        RuntimeAnnotations_attribute attr = (RuntimeAnnotations_attribute)
+            cf.attributes.get(Attribute.RuntimeInvisibleAnnotations);
+        int index = 0;
+        boolean proprietary = false;
+        if (attr != null) {
+            for (int i = 0; i < attr.annotations.length; i++) {
+                Annotation ann = attr.annotations[i];
+                String annType = cf.constant_pool.getUTF8Value(ann.type_index);
+                if (PROFILE_ANNOTATION.equals(annType)) {
+                    for (int j = 0; j < ann.num_element_value_pairs; j++) {
+                        Annotation.element_value_pair pair = ann.element_value_pairs[j];
+                        Primitive_element_value ev = (Primitive_element_value)pair.value;
+                        CONSTANT_Integer_info info = (CONSTANT_Integer_info)
+                             cf.constant_pool.get(ev.const_value_index);
+                        index = info.value;
+                        break;
+                    }
+                } else if (PROPRIETARY_ANNOTATION.equals(annType)) {
+                    proprietary = true;
+                }
+            }
+            if (index >= profiles.size()) {
+                Profile p = null;
+                for (int i = profiles.size(); i <= index; i++) {
+                    p = new Profile(i);
+                    profiles.add(p);
+                }
+            }
+        }
+
+        Profile p = profiles.get(index);
+        String name = cf.getName();
+        int i = name.lastIndexOf('/');
+        name = (i > 0) ? name.substring(0, i).replace('/','.') : "";
+        if (proprietary) {
+            p.proprietaryPkgs.add(name);
+        } else {
+            p.packages.add(name);
+        }
+        return p;
+    }
+
+    private static void initProfilesFromProperties(List<Profile> profiles, String path)
+            throws IOException
+    {
+        Properties props = new Properties();
+        try (FileReader reader = new FileReader(path)) {
+            props.load(reader);
+        }
+        int i=1;
+        String key;
+        while (props.containsKey((key = "profile." + i + ".name"))) {
+            Profile profile = new Profile(props.getProperty(key), i);
+            profiles.add(profile);
+            String n = props.getProperty("profile." + i + ".packages");
+            String[] pkgs = n.split("\\s+");
+            for (String p : pkgs) {
+                if (p.isEmpty()) continue;
+                profile.packages.add(p);
+            }
+            i++;
+        }
+    }
+
+    private static class Profile {
+        final String name;
+        final int profile;
+        final Set<String> packages;
+        final Set<String> proprietaryPkgs;
+        Profile(int profile) {
+            this("compact" + profile, profile);
+        }
+        Profile(String name, int profile) {
+            this.name = name;
+            this.profile = profile;
+            this.packages = new HashSet<String>();
+            this.proprietaryPkgs = new HashSet<String>();
+        }
+        public String toString() {
+            return name;
+        }
+    }
+
+    // for debugging
+    public static void main(String[] args) {
+        if (args.length == 0) {
+            Profile[] profiles = new Profile[getProfileCount()];
+            for (Profile p : map.values()) {
+                // move the zeroth profile to the last
+                int index = p.profile == 0 ? profiles.length-1 : p.profile-1;
+                profiles[index] = p;
+            }
+            for (Profile p : profiles) {
+                String profileName = p.name;
+                SortedSet<String> set = new TreeSet<String>(p.packages);
+                for (String s : set) {
+                    // filter out the inner classes that are not annotated with
+                    // the profile annotation
+                    if (map.get(s) == p) {
+                        System.out.format("%-10s  %s%n", profileName, s);
+                        profileName = "";
+                    }
+                }
+            }
+        }
+        for (String pn : args) {
+            System.out.format("%s in %s%n", pn, getProfileName(pn));
+        }
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -51,6 +51,8 @@
 err.internal.error=internal error: {0} {1} {2}
 err.invalid.arg.for.option=invalid argument for option: {0}
 err.option.after.class=option must be specified before classes: {0}
+err.option.unsupported={0} not supported: {1}
+err.profiles.msg=No profile information
 warn.invalid.arg=Invalid classname or pathname not exist: {0}
 warn.split.package=package {0} defined in {1} {2}
 
--- a/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdk.properties	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-# This properties file does not need localization.
-
-profile.1.name = compact1
-profile.1.packages = \
-    java.io \
-    java.lang \
-    java.lang.annotation \
-    java.lang.invoke \
-    java.lang.ref \
-    java.lang.reflect \
-    java.math \
-    java.net \
-    java.nio \
-    java.nio.channels \
-    java.nio.channels.spi \
-    java.nio.charset \
-    java.nio.charset.spi \
-    java.nio.file \
-    java.nio.file.attribute \
-    java.nio.file.spi \
-    java.security \
-    java.security.cert \
-    java.security.interfaces \
-    java.security.spec \
-    java.text \
-    java.text.spi \
-    java.util \
-    java.util.concurrent \
-    java.util.concurrent.atomic \
-    java.util.concurrent.locks \
-    java.util.jar \
-    java.util.logging \
-    java.util.regex \
-    java.util.spi \
-    java.util.zip \
-    javax.crypto \
-    javax.crypto.interfaces \
-    javax.crypto.spec \
-    javax.security.auth \
-    javax.security.auth.callback \
-    javax.security.auth.login \
-    javax.security.auth.spi \
-    javax.security.auth.x500 \
-    javax.net \
-    javax.net.ssl \
-    javax.security.cert \
-    \
-    com.sun.net.ssl \
-    com.sun.nio.file \
-    com.sun.nio.sctp \
-    com.sun.security.auth \
-    com.sun.security.auth.login
-
-profile.2.name = compact2
-profile.2.packages = \
-    java.sql \
-    javax.sql \
-    javax.xml \
-    javax.xml.datatype \
-    javax.xml.namespace \
-    javax.xml.parsers \
-    javax.xml.stream \
-    javax.xml.stream.events \
-    javax.xml.stream.util \
-    javax.xml.transform \
-    javax.xml.transform.dom \
-    javax.xml.transform.sax \
-    javax.xml.transform.stax \
-    javax.xml.transform.stream \
-    javax.xml.validation \
-    javax.xml.xpath \
-    org.w3c.dom \
-    org.w3c.dom.bootstrap \
-    org.w3c.dom.events \
-    org.w3c.dom.ls \
-    org.xml.sax \
-    org.xml.sax.ext \
-    org.xml.sax.helpers \
-    java.rmi \
-    java.rmi.activation \
-    java.rmi.dgc \
-    java.rmi.registry \
-    java.rmi.server \
-    javax.rmi.ssl \
-    javax.transaction \
-    javax.transaction.xa \
-    \
-    com.sun.net.httpserver \
-    com.sun.net.httpserver.spi
-
-profile.3.name = compact3
-profile.3.packages = \
-    java.lang.instrument \
-    java.lang.management \
-    java.security.acl \
-    java.util.prefs \
-    javax.management \
-    javax.management.loading \
-    javax.management.modelmbean \
-    javax.management.monitor \
-    javax.management.openmbean \
-    javax.management.relation \
-    javax.management.remote \
-    javax.management.remote.rmi \
-    javax.management.timer \
-    javax.naming \
-    javax.naming.directory \
-    javax.naming.event \
-    javax.naming.ldap \
-    javax.naming.spi \
-    javax.sql.rowset \
-    javax.sql.rowset.serial \
-    javax.sql.rowset.spi \
-    javax.security.auth.kerberos \
-    javax.security.sasl \
-    javax.script \
-    javax.smartcardio \
-    javax.xml.crypto \
-    javax.xml.crypto.dom \
-    javax.xml.crypto.dsig \
-    javax.xml.crypto.dsig.dom \
-    javax.xml.crypto.dsig.keyinfo \
-    javax.xml.crypto.dsig.spec \
-    javax.annotation.processing \
-    javax.lang.model \
-    javax.lang.model.element \
-    javax.lang.model.type \
-    javax.lang.model.util \
-    javax.tools \
-    javax.tools.annotation \
-    org.ietf.jgss \
-    \
-    com.sun.management \
-    com.sun.security.auth.callback \
-    com.sun.security.auth.module \
-    com.sun.security.jgss
-
-profile.4.name = Full JRE
-profile.4.packages = \
-    java.applet \
-    java.awt \
-    java.awt.color \
-    java.awt.datatransfer \
-    java.awt.dnd \
-    java.awt.dnd.peer \
-    java.awt.event \
-    java.awt.font \
-    java.awt.geom \
-    java.awt.im \
-    java.awt.im.spi \
-    java.awt.image \
-    java.awt.image.renderable \
-    java.awt.peer \
-    java.awt.print \
-    java.beans \
-    java.beans.beancontext \
-    javax.accessibility \
-    javax.imageio \
-    javax.imageio.event \
-    javax.imageio.metadata \
-    javax.imageio.plugins.bmp \
-    javax.imageio.plugins.jpeg \
-    javax.imageio.spi \
-    javax.imageio.stream \
-    javax.print \
-    javax.print.attribute \
-    javax.print.attribute.standard \
-    javax.print.event \
-    javax.sound.midi \
-    javax.sound.midi.spi \
-    javax.sound.sampled \
-    javax.sound.sampled.spi \
-    javax.swing \
-    javax.swing.border \
-    javax.swing.colorchooser \
-    javax.swing.event \
-    javax.swing.filechooser \
-    javax.swing.plaf \
-    javax.swing.plaf.basic \
-    javax.swing.plaf.metal \
-    javax.swing.plaf.multi \
-    javax.swing.plaf.nimbus \
-    javax.swing.plaf.synth \
-    javax.swing.table \
-    javax.swing.text \
-    javax.swing.text.html \
-    javax.swing.text.html.parser \
-    javax.swing.text.rtf \
-    javax.swing.tree \
-    javax.swing.undo \
-    javax.activation \
-    javax.jws \
-    javax.jws.soap \
-    javax.rmi \
-    javax.rmi.CORBA \
-    javax.xml.bind \
-    javax.xml.bind.annotation \
-    javax.xml.bind.annotation.adapters \
-    javax.xml.bind.attachment \
-    javax.xml.bind.helpers \
-    javax.xml.bind.util \
-    javax.xml.soap \
-    javax.xml.ws \
-    javax.xml.ws.handler \
-    javax.xml.ws.handler.soap \
-    javax.xml.ws.http \
-    javax.xml.ws.soap \
-    javax.xml.ws.spi \
-    javax.xml.ws.spi.http \
-    javax.xml.ws.wsaddressing \
-    javax.annotation \
-    org.omg.CORBA \
-    org.omg.CORBA.DynAnyPackage \
-    org.omg.CORBA.ORBPackage \
-    org.omg.CORBA.TypeCodePackage \
-    org.omg.CORBA.portable \
-    org.omg.CORBA_2_3 \
-    org.omg.CORBA_2_3.portable \
-    org.omg.CosNaming \
-    org.omg.CosNaming.NamingContextExtPackage \
-    org.omg.CosNaming.NamingContextPackage \
-    org.omg.Dynamic \
-    org.omg.DynamicAny \
-    org.omg.DynamicAny.DynAnyFactoryPackage \
-    org.omg.DynamicAny.DynAnyPackage \
-    org.omg.IOP \
-    org.omg.IOP.CodecFactoryPackage \
-    org.omg.IOP.CodecPackage \
-    org.omg.Messaging \
-    org.omg.PortableInterceptor \
-    org.omg.PortableInterceptor.ORBInitInfoPackage \
-    org.omg.PortableServer \
-    org.omg.PortableServer.CurrentPackage \
-    org.omg.PortableServer.POAManagerPackage \
-    org.omg.PortableServer.POAPackage \
-    org.omg.PortableServer.ServantLocatorPackage \
-    org.omg.PortableServer.portable \
-    org.omg.SendingContext \
-    org.omg.stub.java.rmi \
-    org.omg.stub.javax.management.remote.rmi
-
-# Remaining JDK supported API
-profile.5.name = JDK tools
-profile.5.packages = \
-    com.sun.jdi \
-    com.sun.jdi.connect \
-    com.sun.jdi.connect.spi \
-    com.sun.jdi.event \
-    com.sun.jdi.request \
-    com.sun.javadoc \
-    com.sun.tools.doclets \
-    com.sun.tools.doctree \
-    com.sun.source.tree \
-    com.sun.source.util \
-    com.sun.tools.attach \
-    com.sun.tools.attach.spi \
-    com.sun.tools.jconsole \
-    com.sun.tools.javac \
-    com.sun.tools.javah \
-    com.sun.tools.javap \
-    com.sun.tools.javadoc \
-    com.sun.servicetag
--- a/langtools/src/share/classes/com/sun/tools/sjavac/Main.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/Main.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,18 +26,13 @@
 package com.sun.tools.sjavac;
 
 import java.io.File;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import com.sun.tools.sjavac.server.JavacServer;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.sun.tools.sjavac.server.JavacServer;
 
 /**
  * The main class of the smart javac wrapper tool.
@@ -268,12 +263,12 @@
             // Find all class files allowable for linking.
             // And pickup knowledge of all modules found here.
             // This cannot currently filter classes inside jar files.
-            Map<String,Source> classes_to_link_to = new HashMap<String,Source>();
+//          Map<String,Source> classes_to_link_to = new HashMap<String,Source>();
 //          findFiles(args, "-classpath", Util.set(".class"), classes_to_link_to, modules, current_module, true);
 
             // Find all module sources allowable for linking.
-            Map<String,Source> modules_to_link_to = new HashMap<String,Source>();
- //         findFiles(args, "-modulepath", Util.set(".class"), modules_to_link_to, modules, current_module, true);
+//          Map<String,Source> modules_to_link_to = new HashMap<String,Source>();
+//          findFiles(args, "-modulepath", Util.set(".class"), modules_to_link_to, modules, current_module, true);
 
             // Add the set of sources to the build database.
             javac_state.now().collectPackagesSourcesAndArtifacts(modules);
@@ -935,13 +930,13 @@
                     if (roots.contains(root)) {
                         throw new ProblemException("\""+r+"\" has already been used for "+option);
                     }
-                    if (roots.equals(bin_dir)) {
+                    if (root.equals(bin_dir)) {
                         throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -d");
                     }
-                    if (roots.equals(gensrc_dir)) {
+                    if (root.equals(gensrc_dir)) {
                         throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -s");
                     }
-                    if (roots.equals(header_dir)) {
+                    if (root.equals(header_dir)) {
                         throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -h");
                     }
                     roots.add(root);
--- a/langtools/src/share/classes/com/sun/tools/sjavac/comp/Dependencies.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/comp/Dependencies.java	Fri Apr 05 14:51:24 2013 -0700
@@ -108,7 +108,7 @@
         return new_deps;
     }
 
-    class CompareNames implements Comparator<Name> {
+    static class CompareNames implements Comparator<Name> {
          public int compare(Name a, Name b) {
              return a.toString().compareTo(b.toString());
          }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/AnnotatedConstruct.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 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.
+ */
+
+package javax.lang.model;
+
+import java.lang.annotation.*;
+import java.util.List;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+
+/**
+ * Represents a construct that can be annotated.
+ *
+ * A construct is either an {@linkplain
+ * javax.lang.model.element.Element element} or a {@linkplain
+ * javax.lang.model.type.TypeMirror type}.  Annotations on an element
+ * are on a <em>declaration</em>, whereas annotations on a type are on
+ * a specific <em>use</em> of a type name.
+ *
+ * The terms <em>directly present</em> and <em>present</em> are used
+ * throughout this interface to describe precisely which annotations
+ * are returned by methods:
+ *
+ * <p>An annotation <i>A</i> is <em>directly present</em> on a
+ * construct <i>E</i> if <i>E</i> is annotated, and:
+ *
+ * <ul>
+ *
+ * <li> for an invocation of {@code getAnnotation(Class<T>)} or
+ * {@code getAnnotationMirrors()}, <i>E</i>'s annotations contain <i>A</i>.
+ *
+ * <li> for an invocation of getAnnotationsByType(Class<T>),
+ * <i>E</i>'s annotations either contain <i>A</i> or, if the type of
+ * <i>A</i> is repeatable, contain exactly one annotation whose value
+ * element contains <i>A</i> and whose type is the containing
+ * annotation type of <i>A</i>'s type.
+ *
+ * </ul>
+ *
+ * <p>An annotation A is <em>present</em> on a construct E if either:
+ *
+ * <ul>
+ *  <li> <i>A</i> is <em>directly present</em> on <i>E</i>; or
+ *
+ *  <li> <i>A</i> is not <em>directly present</em> on <i>E</i>, and
+ *  <i>E</i> is an element representing a class, and <i>A</i>'s type
+ *  is inheritable, and <i>A</i> is <em>present</em> on the element
+ *  representing the superclass of <i>E</i>.
+ *
+ * </ul>
+ *
+ * @since 1.8
+ * @jls 9.6 Annotation Types
+ * @jls 9.6.3.3 @Inherited
+ */
+public interface AnnotatedConstruct {
+    /**
+     * Returns the annotations that are <em>directly present</em> on
+     * this construct.
+     *
+     * @return the annotations <em>directly present</em> on this
+     * construct; an empty list if there are none
+     */
+    List<? extends AnnotationMirror> getAnnotationMirrors();
+
+    /**
+     * Returns this construct's annotation of the
+     * specified type if such an annotation is <em>present</em>, else {@code
+     * null}.
+     *
+     * <p> The annotation returned by this method could contain an element
+     * whose value is of type {@code Class}.
+     * This value cannot be returned directly:  information necessary to
+     * locate and load a class (such as the class loader to use) is
+     * not available, and the class might not be loadable at all.
+     * Attempting to read a {@code Class} object by invoking the relevant
+     * method on the returned annotation
+     * will result in a {@link MirroredTypeException},
+     * from which the corresponding {@link TypeMirror} may be extracted.
+     * Similarly, attempting to read a {@code Class[]}-valued element
+     * will result in a {@link MirroredTypesException}.
+     *
+     * <blockquote>
+     * <i>Note:</i> This method is unlike others in this and related
+     * interfaces.  It operates on runtime reflective information &mdash;
+     * representations of annotation types currently loaded into the
+     * VM &mdash; rather than on the representations defined by and used
+     * throughout these interfaces.  Consequently, calling methods on
+     * the returned annotation object can throw many of the exceptions
+     * that can be thrown when calling methods on an annotation object
+     * returned by core reflection.  This method is intended for
+     * callers that are written to operate on a known, fixed set of
+     * annotation types.
+     * </blockquote>
+     *
+     * @param <A>  the annotation type
+     * @param annotationType  the {@code Class} object corresponding to
+     *          the annotation type
+     * @return this element's or type use's annotation for the
+     * specified annotation type if present on this element, else
+     * {@code null}
+     *
+     * @see #getAnnotationMirrors()
+     * @see java.lang.reflect.AnnotatedElement#getAnnotation
+     * @see EnumConstantNotPresentException
+     * @see AnnotationTypeMismatchException
+     * @see IncompleteAnnotationException
+     * @see MirroredTypeException
+     * @see MirroredTypesException
+     * @jls 9.6.1 Annotation Type Elements
+     */
+    <A extends Annotation> A getAnnotation(Class<A> annotationType);
+
+    /**
+     * Returns annotations that are <em>present</em> on this construct.
+     *
+     * If there are no annotations <em>present</em> on this construct,
+     * the return value is an array of length 0.
+     *
+     * The difference between this method and {@link #getAnnotation(Class)}
+     * is that this method detects if its argument is a <em>repeatable
+     * annotation type</em>, and if so, attempts to find one or more
+     * annotations of that type by "looking through" a container annotation.
+     *
+     * <p> The annotations returned by this method could contain an element
+     * whose value is of type {@code Class}.
+     * This value cannot be returned directly:  information necessary to
+     * locate and load a class (such as the class loader to use) is
+     * not available, and the class might not be loadable at all.
+     * Attempting to read a {@code Class} object by invoking the relevant
+     * method on the returned annotation
+     * will result in a {@link MirroredTypeException},
+     * from which the corresponding {@link TypeMirror} may be extracted.
+     * Similarly, attempting to read a {@code Class[]}-valued element
+     * will result in a {@link MirroredTypesException}.
+     *
+     * <blockquote>
+     * <i>Note:</i> This method is unlike others in this and related
+     * interfaces.  It operates on runtime reflective information &mdash;
+     * representations of annotation types currently loaded into the
+     * VM &mdash; rather than on the representations defined by and used
+     * throughout these interfaces.  Consequently, calling methods on
+     * the returned annotation object can throw many of the exceptions
+     * that can be thrown when calling methods on an annotation object
+     * returned by core reflection.  This method is intended for
+     * callers that are written to operate on a known, fixed set of
+     * annotation types.
+     * </blockquote>
+     *
+     * @param <A>  the annotation type
+     * @param annotationType  the {@code Class} object corresponding to
+     *          the annotation type
+     * @return this element's annotations for the specified annotation
+     *         type if present on this element, else an empty array
+     *
+     * @see #getAnnotationMirrors()
+     * @see #getAnnotation(java.lang.Class)
+     * @see java.lang.reflect.AnnotatedElement#getAnnotationsByType
+     * @see EnumConstantNotPresentException
+     * @see AnnotationTypeMismatchException
+     * @see IncompleteAnnotationException
+     * @see MirroredTypeException
+     * @see MirroredTypesException
+     * @jls 9.6 Annotation Types
+     * @jls 9.6.1 Annotation Type Elements
+     */
+    <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType);
+}
--- a/langtools/src/share/classes/javax/lang/model/element/Element.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/element/Element.java	Fri Apr 05 14:51:24 2013 -0700
@@ -60,8 +60,7 @@
  * @see TypeMirror
  * @since 1.6
  */
-public interface Element {
-
+public interface Element extends javax.lang.model.AnnotatedConstruct {
     /**
      * Returns the type defined by this element.
      *
@@ -89,119 +88,6 @@
     ElementKind getKind();
 
     /**
-     * Returns the annotations that are directly present on this element.
-     *
-     * <p> To get inherited annotations as well, use
-     * {@link Elements#getAllAnnotationMirrors(Element) getAllAnnotationMirrors}.
-     *
-     * @see ElementFilter
-     *
-     * @return the annotations directly present on this element;
-     *          an empty list if there are none
-     */
-    List<? extends AnnotationMirror> getAnnotationMirrors();
-
-    /**
-     * Returns this element's annotation for the specified type if
-     * such an annotation is present, else {@code null}.  The
-     * annotation may be either inherited or directly present on this
-     * element.
-     *
-     * <p> The annotation returned by this method could contain an element
-     * whose value is of type {@code Class}.
-     * This value cannot be returned directly:  information necessary to
-     * locate and load a class (such as the class loader to use) is
-     * not available, and the class might not be loadable at all.
-     * Attempting to read a {@code Class} object by invoking the relevant
-     * method on the returned annotation
-     * will result in a {@link MirroredTypeException},
-     * from which the corresponding {@link TypeMirror} may be extracted.
-     * Similarly, attempting to read a {@code Class[]}-valued element
-     * will result in a {@link MirroredTypesException}.
-     *
-     * <blockquote>
-     * <i>Note:</i> This method is unlike others in this and related
-     * interfaces.  It operates on runtime reflective information &mdash;
-     * representations of annotation types currently loaded into the
-     * VM &mdash; rather than on the representations defined by and used
-     * throughout these interfaces.  Consequently, calling methods on
-     * the returned annotation object can throw many of the exceptions
-     * that can be thrown when calling methods on an annotation object
-     * returned by core reflection.  This method is intended for
-     * callers that are written to operate on a known, fixed set of
-     * annotation types.
-     * </blockquote>
-     *
-     * @param <A>  the annotation type
-     * @param annotationType  the {@code Class} object corresponding to
-     *          the annotation type
-     * @return this element's annotation for the specified annotation
-     *         type if present on this element, else {@code null}
-     *
-     * @see #getAnnotationMirrors()
-     * @see java.lang.reflect.AnnotatedElement#getAnnotation
-     * @see EnumConstantNotPresentException
-     * @see AnnotationTypeMismatchException
-     * @see IncompleteAnnotationException
-     * @see MirroredTypeException
-     * @see MirroredTypesException
-     */
-    <A extends Annotation> A getAnnotation(Class<A> annotationType);
-
-    /**
-     * Returns annotations that are <em>present</em> on this element.
-     *
-     * If there are no annotations <em>present</em> on this element, the return
-     * value is an array of length 0.
-     *
-     * The difference between this method and {@link #getAnnotation(Class)}
-     * is that this method detects if its argument is a <em>repeatable
-     * annotation type</em> (JLS 9.6), and if so, attempts to find one or more
-     * annotations of that type by "looking through" a container annotation.
-     *
-     * <p> The annotations returned by this method could contain an element
-     * whose value is of type {@code Class}.
-     * This value cannot be returned directly:  information necessary to
-     * locate and load a class (such as the class loader to use) is
-     * not available, and the class might not be loadable at all.
-     * Attempting to read a {@code Class} object by invoking the relevant
-     * method on the returned annotation
-     * will result in a {@link MirroredTypeException},
-     * from which the corresponding {@link TypeMirror} may be extracted.
-     * Similarly, attempting to read a {@code Class[]}-valued element
-     * will result in a {@link MirroredTypesException}.
-     *
-     * <blockquote>
-     * <i>Note:</i> This method is unlike others in this and related
-     * interfaces.  It operates on runtime reflective information &mdash;
-     * representations of annotation types currently loaded into the
-     * VM &mdash; rather than on the representations defined by and used
-     * throughout these interfaces.  Consequently, calling methods on
-     * the returned annotation object can throw many of the exceptions
-     * that can be thrown when calling methods on an annotation object
-     * returned by core reflection.  This method is intended for
-     * callers that are written to operate on a known, fixed set of
-     * annotation types.
-     * </blockquote>
-     *
-     * @param <A>  the annotation type
-     * @param annotationType  the {@code Class} object corresponding to
-     *          the annotation type
-     * @return this element's annotations for the specified annotation
-     *         type if present on this element, else an empty array
-     *
-     * @see #getAnnotationMirrors()
-     * @see #getAnnotation(java.lang.Class)
-     * @see java.lang.reflect.AnnotatedElement#getAnnotationsByType
-     * @see EnumConstantNotPresentException
-     * @see AnnotationTypeMismatchException
-     * @see IncompleteAnnotationException
-     * @see MirroredTypeException
-     * @see MirroredTypesException
-     */
-    <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType);
-
-    /**
      * Returns the modifiers of this element, excluding annotations.
      * Implicit modifiers, such as the {@code public} and {@code static}
      * modifiers of interface members, are included.
@@ -325,6 +211,19 @@
      */
     int hashCode();
 
+
+    /**
+     * {@inheritDoc}
+     *
+     * <p> To get inherited annotations as well, use {@link
+     * Elements#getAllAnnotationMirrors(Element)
+     * getAllAnnotationMirrors}.
+     *
+     * @see ElementFilter
+     * @since 1.6
+     */
+    @Override
+    List<? extends AnnotationMirror> getAnnotationMirrors();
     /**
      * Applies a visitor to this element.
      *
--- a/langtools/src/share/classes/javax/lang/model/element/ExecutableElement.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/element/ExecutableElement.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -69,6 +69,25 @@
     List<? extends VariableElement> getParameters();
 
     /**
+     * Returns the receiver type of this executable,
+     * or {@link javax.lang.model.type.NoType NoType} with
+     * kind {@link javax.lang.model.type.TypeKind#NONE NONE}
+     * if the executable has no receiver type.
+     *
+     * An executable which is an instance method, or a constructor of an
+     * inner class, has a receiver type derived from the {@linkplain
+     * #getEnclosingElement declaring type}.
+     *
+     * An executable which is a static method, or a constructor of a
+     * non-inner class, or an initializer (static or instance), has no
+     * receiver type.
+     *
+     * @return the receiver type of this executable
+     * @since 1.8
+     */
+    TypeMirror getReceiverType();
+
+    /**
      * Returns {@code true} if this method or constructor accepts a variable
      * number of arguments and returns {@code false} otherwise.
      *
--- a/langtools/src/share/classes/javax/lang/model/type/AnnotatedType.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2012, 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.
- */
-
-package javax.lang.model.type;
-
-import java.util.List;
-
-import javax.lang.model.element.AnnotationMirror;
-
-/**
- * Represents an annotated type.
- *
- * As of the {@link javax.lang.model.SourceVersion#RELEASE_8
- * RELEASE_8} source version, annotated types can appear for all
- * type uses.
- *
- * @author Werner Dietl
- * @since 1.8
- */
-public interface AnnotatedType extends TypeMirror,
-    DeclaredType, TypeVariable, WildcardType,
-    PrimitiveType, ArrayType {
-
-    List<? extends AnnotationMirror> getAnnotations();
-    TypeMirror getUnderlyingType();
-}
--- a/langtools/src/share/classes/javax/lang/model/type/ExecutableType.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/type/ExecutableType.java	Fri Apr 05 14:51:24 2013 -0700
@@ -30,7 +30,6 @@
 
 import javax.lang.model.element.ExecutableElement;
 
-
 /**
  * Represents the type of an executable.  An <i>executable</i>
  * is a method, constructor, or initializer.
@@ -78,10 +77,21 @@
     List<? extends TypeMirror> getParameterTypes();
 
     /**
-     * Returns the type of this executable's receiver parameter.
+     * Returns the receiver type of this executable,
+     * or {@link javax.lang.model.type.NoType NoType} with
+     * kind {@link javax.lang.model.type.TypeKind#NONE NONE}
+     * if the executable has no receiver type.
      *
-     * @return the type of this executable's receiver parameter
-     * TODO: null if none specified or always a valid value?
+     * An executable which is an instance method, or a constructor of an
+     * inner class, has a receiver type derived from the {@linkplain
+     * ExecutableElement#getEnclosingElement declaring type}.
+     *
+     * An executable which is a static method, or a constructor of a
+     * non-inner class, or an initializer (static or instance), has no
+     * receiver type.
+     *
+     * @return the receiver type of this executable
+     * @since 1.8
      */
     TypeMirror getReceiverType();
 
--- a/langtools/src/share/classes/javax/lang/model/type/TypeKind.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/type/TypeKind.java	Fri Apr 05 14:51:24 2013 -0700
@@ -151,14 +151,7 @@
       *
       * @since 1.8
       */
-    INTERSECTION,
-
-    /**
-     * An annotated type.
-     *
-     * @since 1.8
-     */
-    ANNOTATED;
+    INTERSECTION;
 
     /**
      * Returns {@code true} if this kind corresponds to a primitive
--- a/langtools/src/share/classes/javax/lang/model/type/TypeMirror.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/type/TypeMirror.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,6 +25,8 @@
 
 package javax.lang.model.type;
 
+import java.lang.annotation.Annotation;
+import java.util.List;
 import javax.lang.model.element.*;
 import javax.lang.model.util.Types;
 
@@ -55,7 +57,7 @@
  * @see Types
  * @since 1.6
  */
-public interface TypeMirror {
+public interface TypeMirror extends javax.lang.model.AnnotatedConstruct {
 
     /**
      * Returns the {@code kind} of this type.
--- a/langtools/src/share/classes/javax/lang/model/type/TypeVisitor.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/type/TypeVisitor.java	Fri Apr 05 14:51:24 2013 -0700
@@ -194,14 +194,4 @@
      * @since 1.8
      */
     R visitIntersection(IntersectionType t, P p);
-
-    /**
-     * Visits an annotated type.
-     *
-     * @param t the type to visit
-     * @param p a visitor-specified parameter
-     * @return  a visitor-specified result
-     * @since 1.8
-     */
-    R visitAnnotated(AnnotatedType t, P p);
 }
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java	Fri Apr 05 14:51:24 2013 -0700
@@ -134,23 +134,6 @@
     }
 
     /**
-     * Visits an {@code AnnotatedType} element by calling {@code
-     * visit} on the underlying type.
-
-     * @param t  {@inheritDoc}
-     * @param p  {@inheritDoc}
-     * @return the result of calling {@code visit} on the underlying type
-     *
-     * @since 1.8
-     *
-     * TODO: should xxxVisitor8 subclasses override this and call
-     *   the defaultAction?
-     */
-    public R visitAnnotated(AnnotatedType t, P p) {
-        return visit(t.getUnderlyingType(), p);
-    }
-
-    /**
      * {@inheritDoc}
      *
      * <p> The default implementation of this method in {@code
--- a/langtools/src/share/classes/javax/lang/model/util/Types.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/Types.java	Fri Apr 05 14:51:24 2013 -0700
@@ -59,6 +59,13 @@
     /**
      * Tests whether two {@code TypeMirror} objects represent the same type.
      *
+     * <p>Since annotations are only meta-data associated with a type,
+     * the set of annotations on either argument is <em>not</em> taken
+     * into account when computing whether or not two {@code
+     * TypeMirror} objects are the same type. In particular, two
+     * {@code TypeMirror} objects can have different annotations and
+     * still be considered the same.
+     *
      * <p>Caveat: if either of the arguments to this method represents a
      * wildcard, this method will return false.  As a consequence, a wildcard
      * is not the same type as itself.  This might be surprising at first,
@@ -301,116 +308,4 @@
      *          for the given type
      */
     TypeMirror asMemberOf(DeclaredType containing, Element element);
-
-    /**
-     * Returns the annotations targeting the type.
-     *
-     * @param type the targeted type
-     * @return the type annotations targeting the type
-     */
-    List<? extends AnnotationMirror> typeAnnotationsOf(TypeMirror type);
-
-    /**
-     * Returns the type's annotation for the specified type if
-     * such an annotation is present, else {@code null}.  The
-     * annotation has to be directly present on this
-     * element.
-     *
-     * <p> The annotation returned by this method could contain an element
-     * whose value is of type {@code Class}.
-     * This value cannot be returned directly:  information necessary to
-     * locate and load a class (such as the class loader to use) is
-     * not available, and the class might not be loadable at all.
-     * Attempting to read a {@code Class} object by invoking the relevant
-     * method on the returned annotation
-     * will result in a {@link MirroredTypeException},
-     * from which the corresponding {@link TypeMirror} may be extracted.
-     * Similarly, attempting to read a {@code Class[]}-valued element
-     * will result in a {@link MirroredTypesException}.
-     *
-     * <blockquote>
-     * <i>Note:</i> This method is unlike others in this and related
-     * interfaces.  It operates on runtime reflective information &mdash;
-     * representations of annotation types currently loaded into the
-     * VM &mdash; rather than on the representations defined by and used
-     * throughout these interfaces.  Consequently, calling methods on
-     * the returned annotation object can throw many of the exceptions
-     * that can be thrown when calling methods on an annotation object
-     * returned by core reflection.  This method is intended for
-     * callers that are written to operate on a known, fixed set of
-     * annotation types.
-     * </blockquote>
-     *
-     * @param <A>   the annotation type
-     * @param type  the targeted type
-     * @param annotationType  the {@code Class} object corresponding to
-     *          the annotation type
-     * @return the type's annotation for the specified annotation
-     *         type if present on the type, else {@code null}
-     *
-     * @see Element#getAnnotationMirrors()
-     * @see EnumConstantNotPresentException
-     * @see AnnotationTypeMismatchException
-     * @see IncompleteAnnotationException
-     * @see MirroredTypeException
-     * @see MirroredTypesException
-     */
-    <A extends Annotation> A typeAnnotationOf(TypeMirror type, Class<A> annotationType);
-
-    /**
-     * Returns the annotations targeting the method receiver type.
-     *
-     * @param type the targeted type
-     * @return the receiver type of the executable type
-     */
-    TypeMirror receiverTypeOf(ExecutableType type);
-
-    /**
-     * Returns the type's annotation for the specified executable type
-     * receiver if such an annotation is present, else {@code null}.  The
-     * annotation has to be directly present on this
-     * element.
-     *
-     * <p> The annotation returned by this method could contain an element
-     * whose value is of type {@code Class}.
-     * This value cannot be returned directly:  information necessary to
-     * locate and load a class (such as the class loader to use) is
-     * not available, and the class might not be loadable at all.
-     * Attempting to read a {@code Class} object by invoking the relevant
-     * method on the returned annotation
-     * will result in a {@link MirroredTypeException},
-     * from which the corresponding {@link TypeMirror} may be extracted.
-     * Similarly, attempting to read a {@code Class[]}-valued element
-     * will result in a {@link MirroredTypesException}.
-     *
-     * <blockquote>
-     * <i>Note:</i> This method is unlike others in this and related
-     * interfaces.  It operates on runtime reflective information &mdash;
-     * representations of annotation types currently loaded into the
-     * VM &mdash; rather than on the representations defined by and used
-     * throughout these interfaces.  Consequently, calling methods on
-     * the returned annotation object can throw many of the exceptions
-     * that can be thrown when calling methods on an annotation object
-     * returned by core reflection.  This method is intended for
-     * callers that are written to operate on a known, fixed set of
-     * annotation types.
-     * </blockquote>
-     *
-     * @param <A>   the annotation type
-     * @param type  the method type
-     * @param annotationType  the {@code Class} object corresponding to
-     *          the annotation type
-     * @return the type's annotation for the specified annotation
-     *         type if present on the type, else {@code null}
-     *
-     * @see Element#getAnnotationMirrors()
-     * @see EnumConstantNotPresentException
-     * @see AnnotationTypeMismatchException
-     * @see IncompleteAnnotationException
-     * @see MirroredTypeException
-     * @see MirroredTypesException
-     */
-    // TODO: no longer needed?
-    // <A extends Annotation> A receiverTypeAnnotationOf(ExecutableType type, Class<A> annotationType);
-
 }
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Fri Apr 05 14:51:24 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8006124
+ * @bug      8006124 8009684
  * @summary  Test javadoc support for profiles.
  * @author   Bhavesh Patel
  * @library  ../lib/
@@ -33,7 +33,7 @@
 public class TestProfiles extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8006124";
+    private static final String BUG_ID = "8006124-8009684";
     private static final String PROFILE_BUG_ID = BUG_ID + "-1";
     private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
     //Javadoc arguments.
@@ -49,17 +49,17 @@
         // Tests for profile-overview-frame.html listing all profiles.
         {PROFILE_BUG_ID + FS + "profile-overview-frame.html",
             "<span><a href=\"overview-frame.html\" "
-            + "target=\"profileListFrame\">All Packages</a></span>"
+            + "target=\"packageListFrame\">All Packages</a></span>"
         },
         {PROFILE_BUG_ID + FS + "profile-overview-frame.html",
-            "<li><a href=\"compact1-frame.html\" target=\"profileListFrame\">"
+            "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">"
             + "compact1</a></li>"
         },
         // Tests for profileName-frame.html listing all packages in a profile.
         {PROFILE_BUG_ID + FS + "compact2-frame.html",
-            "<span><a href=\"overview-frame.html\" target=\"profileListFrame\">"
+            "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
             + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
-            + "target=\"profileListFrame\">All Profiles</a></span>"
+            + "target=\"packageListFrame\">All Profiles</a></span>"
         },
         {PROFILE_BUG_ID + FS + "compact2-frame.html",
             "<li><a href=\"pkg4/compact2-package-frame.html\" "
@@ -96,11 +96,15 @@
         //Test for "overview-frame.html" showing the "All Profiles" link.
         {PROFILE_BUG_ID + FS + "overview-frame.html",
             "<span><a href=\"profile-overview-frame.html\" "
-            + "target=\"profileListFrame\">All Profiles</a></span>"
+            + "target=\"packageListFrame\">All Profiles</a></span>"
         },
         //Test for "className.html" showing the profile information for the type.
         {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
             "<div class=\"subTitle\">compact1, compact2, compact3</div>"
+        },
+        {PROFILE_BUG_ID + FS + "index.html",
+            "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
+            "title=\"All Packages\">"
         }
     };
     private static final String[][] PROFILES_NEGATED_TEST = {
@@ -131,12 +135,12 @@
     private static final String[][] PACKAGES_NEGATED_TEST = {
         {PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
             "<span><a href=\"overview-frame.html\" "
-            + "target=\"profileListFrame\">All Packages</a></span>"
+            + "target=\"packageListFrame\">All Packages</a></span>"
         },
         {PACKAGE_BUG_ID + FS + "compact2-frame.html",
-            "<span><a href=\"overview-frame.html\" target=\"profileListFrame\">"
+            "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
             + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
-            + "target=\"profileListFrame\">All Profiles</a></span>"
+            + "target=\"packageListFrame\">All Profiles</a></span>"
         },
         {PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
             "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
@@ -151,7 +155,7 @@
         },
         {PACKAGE_BUG_ID + FS + "overview-frame.html",
             "<span><a href=\"profile-overview-frame.html\" "
-            + "target=\"profileListFrame\">All Profiles</a></span>"
+            + "target=\"packageListFrame\">All Profiles</a></span>"
         },
         {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
             "<div class=\"subTitle\">compact1, compact2, compact3</div>"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyPreTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012, 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.
+ */
+
+/*
+ * @test
+ * @bug 8010317
+ * @summary DocLint incorrectly reports some <pre> tags as empty
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:html EmptyPreTest.java
+ */
+
+public class EmptyPreTest {
+    /** <pre> {@code xyzzy} </pre> */
+    public void m1() { }
+
+    /** <pre> {@docRoot} </pre> */
+    public void m2() { }
+
+    /** <pre> {@link java.lang.String} </pre> */
+    public void m3() { }
+
+    /** <pre> {@value} </pre> */
+    public static final int v1 = 1;
+}
--- a/langtools/test/tools/javac/4846262/CheckEBCDICLocaleTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/4846262/CheckEBCDICLocaleTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -34,9 +34,7 @@
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Arrays;
-import com.sun.tools.javac.util.ArrayUtils;
 
-//original test: test/tools/javac/4846262/Test.sh
 public class CheckEBCDICLocaleTest {
 
     private static final String TestSrc =
@@ -46,11 +44,11 @@
         "    }\n" +
         "}";
 
-    private static final String TestOut =
-        "output/Test.java:3: error: not a statement\n" +
+    private static final String TestOutTemplate =
+        "output%1$sTest.java:3: error: not a statement\n" +
         "        abcdefg\n" +
         "        ^\n" +
-        "output/Test.java:3: error: ';' expected\n" +
+        "output%1$sTest.java:3: error: ';' expected\n" +
         "        abcdefg\n" +
         "               ^\n" +
         "2 errors\n";
@@ -62,38 +60,37 @@
     public void test() throws Exception {
         String native2asciiBinary = Paths.get(
                 System.getProperty("test.jdk"),"bin", "native2ascii").toString();
-        String testVMOpts = System.getProperty("test.tool.vm.opts");
-        String[] mainArgs = ToolBox.getJavacBin();
 
         ToolBox.createJavaFileFromSource(TestSrc);
         Files.createDirectory(Paths.get("output"));
 
-//"${TESTJAVA}${FS}bin${FS}native2ascii" ${TESTTOOLVMOPTS} -reverse -encoding IBM1047 ${TESTSRC}${FS}Test.java Test.java
         ToolBox.AnyToolArgs nativeCmdParams =
                 new ToolBox.AnyToolArgs()
-                .setAllArgs(native2asciiBinary, testVMOpts,
-                    "-reverse", "-encoding", "IBM1047",
-                    "Test.java", "output/Test.java");
+                .appendArgs(native2asciiBinary)
+                .appendArgs(ToolBox.testToolVMOpts)
+                .appendArgs("-reverse", "-encoding", "IBM1047", "Test.java",
+                "output/Test.java");
         ToolBox.executeCommand(nativeCmdParams);
 
-//"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -J-Duser.language=en -J-Duser.region=US -J-Dfile.encoding=IBM1047 Test.java 2>Test.tmp
         ToolBox.AnyToolArgs javacParams =
                 new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
-                .setAllArgs(ArrayUtils.concatOpen(mainArgs, "-J-Duser.language=en",
+                .appendArgs(ToolBox.javacBinary)
+                .appendArgs(ToolBox.testToolVMOpts)
+                .appendArgs("-J-Duser.language=en",
                 "-J-Duser.region=US", "-J-Dfile.encoding=IBM1047",
-                "output/Test.java"))
+                "output/Test.java")
                 .setErrOutput(new File("Test.tmp"));
         ToolBox.executeCommand(javacParams);
 
-//"${TESTJAVA}${FS}bin${FS}native2ascii" ${TESTTOOLVMOPTS} -encoding IBM1047 Test.tmp Test.out
-        nativeCmdParams.setAllArgs(native2asciiBinary, "-encoding", "IBM1047",
-                    "Test.tmp", "Test.out");
+        nativeCmdParams = new ToolBox.AnyToolArgs()
+                .appendArgs(native2asciiBinary)
+                .appendArgs(ToolBox.testToolVMOpts)
+                .appendArgs("-encoding", "IBM1047", "Test.tmp", "Test.out");
         ToolBox.executeCommand(nativeCmdParams);
 
-//diff ${DIFFOPTS} -c "${TESTSRC}${FS}Test.out" Test.out
+        String goldenFile = String.format(TestOutTemplate, File.separator);
         ToolBox.compareLines(Paths.get("Test.out"),
-                Arrays.asList(TestOut.split("\n")), null);
-
+                Arrays.asList(goldenFile.split("\n")), null, true);
     }
 
 }
--- a/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,7 @@
  * @bug 4249112 4785453
  * @summary Verify that implicit member modifiers are set correctly.
  *
- * @compile/ref=MemberModifiers.out  -source 1.4 -target 1.4.2 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java
+ * @compile/ref=MemberModifiers.out  -source 1.4 -target 1.5 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java
  */
 
 // Currently, we check only that members of final classes are not final.
--- a/langtools/test/tools/javac/ClassPathTest/ClassPathTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/ClassPathTest/ClassPathTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -31,9 +31,11 @@
  */
 
 import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import com.sun.tools.javac.util.ArrayUtils;
 
 //original test: test/tools/javac/ClassPathTest/ClassPathTest.sh
 public class ClassPathTest {
@@ -92,24 +94,31 @@
     }
 
     void checkCompileCommands() throws Exception {
-        String[] mainArgs = ToolBox.getJavacBin();
-
 //        Without the -cp . parameter the command will fail seems like when called
 //        from the command line, the current dir is added to the classpath
 //        automatically but this is not happening when called using ProcessBuilder
 
 //        testJavac success ClassPathTest3.java
-        String[] commonArgs = ArrayUtils.concatOpen(mainArgs, "-cp", ".");
+        List<String> mainArgs = new ArrayList<>();
+        mainArgs.add(ToolBox.javacBinary.toString());
+        if (ToolBox.testToolVMOpts != null) {
+            mainArgs.addAll(ToolBox.testToolVMOpts);
+        }
 
-        ToolBox.AnyToolArgs successParams =
-                new ToolBox.AnyToolArgs()
-                .setAllArgs(ArrayUtils.concatOpen(commonArgs, "ClassPathTest3.java"));
+        List<String> commonArgs = new ArrayList<>();
+        commonArgs.addAll(mainArgs);
+        commonArgs.addAll(Arrays.asList("-cp", "."));
+
+        ToolBox.AnyToolArgs successParams = new ToolBox.AnyToolArgs()
+                .appendArgs(commonArgs)
+                .appendArgs("ClassPathTest3.java");
         ToolBox.executeCommand(successParams);
 
 //        testJavac failure ClassPathTest1.java
         ToolBox.AnyToolArgs failParams =
                 new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
-                .setAllArgs(ArrayUtils.concatOpen(commonArgs, "ClassPathTest1.java"));
+                .appendArgs(commonArgs)
+                .appendArgs("ClassPathTest1.java");
         ToolBox.executeCommand(failParams);
 
 //        This is done inside the executeCommand method
@@ -119,29 +128,50 @@
         extVars.put("CLASSPATH", "bar");
 
 //        testJavac success ClassPathTest2.java
-        successParams.setAllArgs(ArrayUtils.concatOpen(mainArgs, "ClassPathTest2.java")).set(extVars);
+        successParams = new ToolBox.AnyToolArgs()
+                .appendArgs(mainArgs)
+                .appendArgs("ClassPathTest2.java")
+                .set(extVars);
         ToolBox.executeCommand(successParams);
 
 //        testJavac failure ClassPathTest1.java
-        failParams.setAllArgs(ArrayUtils.concatOpen(mainArgs, "ClassPathTest1.java")).set(extVars);
+        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
+                .appendArgs(mainArgs)
+                .appendArgs("ClassPathTest1.java")
+                .set(extVars);
         ToolBox.executeCommand(failParams);
 
 //        testJavac failure ClassPathTest3.java
-        failParams.setAllArgs(ArrayUtils.concatOpen(mainArgs, "ClassPathTest3.java"));
+        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
+                .appendArgs(mainArgs)
+                .appendArgs("ClassPathTest3.java")
+                .set(extVars);
         ToolBox.executeCommand(failParams);
 
 //        testJavac success -classpath foo ClassPathTest1.java
 
-        commonArgs = ArrayUtils.concatOpen(mainArgs, "-cp", "foo");
-        successParams.setAllArgs(ArrayUtils.concatOpen(commonArgs, "ClassPathTest1.java"));
+        commonArgs.clear();
+        commonArgs.addAll(mainArgs);
+        commonArgs.addAll(Arrays.asList("-cp", "foo"));
+
+        successParams = new ToolBox.AnyToolArgs()
+                .appendArgs(commonArgs)
+                .appendArgs("ClassPathTest1.java")
+                .set(extVars);
         ToolBox.executeCommand(successParams);
 
 //        testJavac failure -classpath foo ClassPathTest2.java
-        failParams.setAllArgs(ArrayUtils.concatOpen(commonArgs, "ClassPathTest2.java"));
+        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
+                .appendArgs(commonArgs)
+                .appendArgs("ClassPathTest2.java")
+                .set(extVars);
         ToolBox.executeCommand(failParams);
 
 //        testJavac failure -classpath foo ClassPathTest3.java
-        failParams.setAllArgs(ArrayUtils.concatOpen(commonArgs, "ClassPathTest3.java"));
+        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
+                .appendArgs(commonArgs)
+                .appendArgs("ClassPathTest3.java")
+                .set(extVars);
         ToolBox.executeCommand(failParams);
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Diagnostics/8010387/T8010387.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,17 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug     8010387
+ * @summary rich diagnostic sometimes contain wrong type variable numbering
+ * @compile/fail/ref=T8010387.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T8010387.java
+ */
+abstract class T8010387<X> {
+
+    interface F<X> { }
+
+    <P> void test() {
+        m(new F<P>() { });
+    }
+
+
+    abstract <T> T8010387<?> m(F<? extends X> fx);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Diagnostics/8010387/T8010387.out	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,3 @@
+T8010387.java:12:9: compiler.err.cant.apply.symbol: kindname.method, m, T8010387.F<? extends X>, compiler.misc.anonymous.class: T8010387.F<P>, kindname.class, T8010387<X>, (compiler.misc.infer.no.conforming.assignment.exists: T, (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: T8010387.F<P>, T8010387.F<? extends X>))
+- compiler.misc.where.description.typevar.1: X,P,T,{(compiler.misc.where.typevar: X, java.lang.Object, kindname.class, T8010387),(compiler.misc.where.typevar: P, java.lang.Object, kindname.method, <P>test()),(compiler.misc.where.typevar: T, java.lang.Object, kindname.method, <T>m(T8010387.F<? extends X>))}
+1 error
--- a/langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClassesTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClassesTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -91,7 +91,9 @@
 //"${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} -classpath "${CLASSPATH}${PS}${TESTCLASSES}" p2.ProtectedInnerClass2
         ToolBox.AnyToolArgs javaParams =
                 new ToolBox.AnyToolArgs()
-                .setAllArgs(ToolBox.javaBinary, "-classpath", System.getProperty("user.dir"),
+                .appendArgs(ToolBox.javaBinary)
+                .appendArgs(ToolBox.testVMOpts)
+                .appendArgs("-classpath", System.getProperty("user.dir"),
                     "p2.ProtectedInnerClass2");
         ToolBox.executeCommand(javaParams);
     }
@@ -101,14 +103,15 @@
 //@run compile p1/ProtectedInnerClass1.java
         ToolBox.JavaToolArgs javacParams =
                 new ToolBox.JavaToolArgs()
-                .setOptions("-d", ".")
+                .appendArgs("-d", ".")
                 .setSources(protectedInnerClass1Src);
 
         ToolBox.javac(javacParams);
 
 //@run compile/fail p2/ProtectedInnerClass3.java
-        javacParams.setSources(protectedInnerClass3Src)
-                .set(ToolBox.Expect.FAIL);
+        javacParams = new ToolBox.JavaToolArgs(ToolBox.Expect.FAIL)
+                .appendArgs("-d", ".")
+                .setSources(protectedInnerClass3Src);
         ToolBox.javac(javacParams);
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 5053846
+ * @summary javac: MethodRef entries are duplicated in the constant pool
+ */
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Paths;
+import java.util.*;
+
+public class MethodRefDupInConstantPoolTest {
+
+    private static final String methodToLookFor =
+            "java/util/Vector.iterator:()Ljava/util/Iterator;";
+
+    public static void main(String[] args) {
+        new MethodRefDupInConstantPoolTest().run();
+    }
+
+    void run() {
+        check("-v", Paths.get(System.getProperty("test.classes"),
+                "TestHelper1.class").toString());
+        check("-v", Paths.get(System.getProperty("test.classes"),
+                "TestHelper2.class").toString());
+    }
+
+    void check(String... params) {
+        StringWriter s;
+        String out;
+        try (PrintWriter pw = new PrintWriter(s = new StringWriter())) {
+            com.sun.tools.javap.Main.run(params, pw);
+            out = s.toString();
+        }
+        String constantPool = getConstantPool(out);
+        if (constantPool.indexOf(methodToLookFor) !=
+                constantPool.lastIndexOf(methodToLookFor)) {
+            throw new AssertionError("There is more than one entry for the method seek "  +
+                    methodToLookFor);
+        }
+    }
+
+    String getConstantPool(String out) {
+        int start = out.indexOf("Constant pool:");
+        int end = out.indexOf("{");
+        return out.substring(start, end);
+    }
+}
+
+class TestHelper1 {
+    void m() {
+        Vector v = new Vector();
+        Iterator iter = v.iterator();
+        while (iter.hasNext()) {
+            Object o = iter.next();
+            Object o2 = o;
+        }
+        for (Object o: v) {
+            Object o2 = o;
+        }
+    }
+}
+
+class TestHelper2<X extends Number & Iterable<String>> {
+    void test(X x) {
+        for (String s : x) { }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DefaultTarget.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.lang.annotation.*;
+
+/**
+ * @test
+ * @bug 8006547
+ * @compile DefaultTarget.java
+ */
+
+@Target({
+    ElementType.CONSTRUCTOR,
+    ElementType.PARAMETER,
+    ElementType.TYPE,
+    ElementType.METHOD,
+    ElementType.LOCAL_VARIABLE,
+    ElementType.PACKAGE,
+    ElementType.ANNOTATION_TYPE,
+    ElementType.FIELD,
+})
+@interface Container {
+  DefaultTarget[] value();
+}
+
+@Repeatable(Container.class)
+public @interface DefaultTarget {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DefaultTargetTypeParameter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.lang.annotation.*;
+
+/**
+ * @test
+ * @bug 8006547
+ * @compile/fail/ref=DefaultTargetTypeParameter.out -XDrawDiagnostics DefaultTargetTypeParameter.java
+ */
+
+@Target({
+    ElementType.TYPE_PARAMETER,
+})
+@interface Container {
+  DefaultTargetTypeParameter[] value();
+}
+
+@Repeatable(Container.class)
+public @interface DefaultTargetTypeParameter {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DefaultTargetTypeParameter.out	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,2 @@
+DefaultTargetTypeParameter.java:39:1: compiler.err.invalid.repeatable.annotation.incompatible.target: Container, DefaultTargetTypeParameter
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DefaultTargetTypeUse.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.lang.annotation.*;
+
+/**
+ * @test
+ * @bug 8006547
+ * @compile/fail/ref=DefaultTargetTypeUse.out -XDrawDiagnostics DefaultTargetTypeUse.java
+ */
+
+@Target({
+    ElementType.TYPE_USE,
+})
+@interface Container {
+  DefaultTargetTypeUse[] value();
+}
+
+@Repeatable(Container.class)
+public @interface DefaultTargetTypeUse {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DefaultTargetTypeUse.out	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,2 @@
+DefaultTargetTypeUse.java:39:1: compiler.err.invalid.repeatable.annotation.incompatible.target: Container, DefaultTargetTypeUse
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/NoTargetOnContainer.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.lang.annotation.*;
+
+/**
+ * @test
+ * @bug 8006547
+ * @compile NoTargetOnContainer.java
+ */
+
+@interface FooContainer {
+  Foo[] value();
+}
+
+@Target({
+    ElementType.CONSTRUCTOR,
+    ElementType.PARAMETER,
+    ElementType.TYPE,
+    ElementType.METHOD,
+    ElementType.LOCAL_VARIABLE,
+    ElementType.PACKAGE,
+    ElementType.ANNOTATION_TYPE,
+    ElementType.FIELD,
+})
+@Repeatable(FooContainer.class)
+@interface Foo {}
+
+class NoTargetOnContainer {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/NoTargetOnContainer2.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.lang.annotation.*;
+
+/**
+ * @test
+ * @bug 8006547
+ * @compile NoTargetOnContainer2.java
+ */
+
+@interface FooContainer {
+  Foo[] value();
+}
+
+@Target({
+    ElementType.CONSTRUCTOR,
+    ElementType.PARAMETER,
+    ElementType.TYPE,
+    ElementType.METHOD,
+    ElementType.LOCAL_VARIABLE,
+    ElementType.PACKAGE,
+    ElementType.ANNOTATION_TYPE,
+    ElementType.FIELD,
+    ElementType.TYPE_USE,
+    ElementType.TYPE_PARAMETER})
+@Repeatable(FooContainer.class)
+@interface Foo {}
+
+class NoTargetOnContainer2 {}
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/Helper.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/Helper.java	Fri Apr 05 14:51:24 2013 -0700
@@ -146,6 +146,7 @@
     public static final String template =
             "/*PACKAGE*/\n"
             + "//pkg test;\n\n"
+            + "/*ANNODATA*/\n" // import statements, declaration of Foo/FooContainer
             + "/*TYPE*/ //class\n"
             + "class #ClassName {\n"
             + "  /*FIELD*/ //instance var\n"
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/TargetAnnoCombo.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/TargetAnnoCombo.java	Fri Apr 05 14:51:24 2013 -0700
@@ -21,245 +21,404 @@
  * questions.
  */
 
-/**
+/*
  * @test
- * @bug      7195131
- * @author   sogoel
- * @summary  Combo test for all possible combinations for Target values
- * @ignore   8008339 Test TargetAnnoCombo.java is broken
+ * @bug      7151010 8006547 8007766
+ * @summary  Default test cases for running combinations for Target values
  * @build    Helper
- * @compile  TargetAnnoCombo.java TestCaseGenerator.java
  * @run main TargetAnnoCombo
  */
 
+import java.util.Set;
+import java.util.List;
 import java.io.IOException;
+import java.lang.annotation.ElementType;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.EnumSet;
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticCollector;
 import javax.tools.JavaFileObject;
 
-/*
- * TargetAnnoCombo gets a list of test case numbers using TestCaseGenerator.
- * For each of the test case number, @Target sets for base and container annotations
- * are determined, source files are generated, compiled, and the result is verified
- * based on if the @Target set for base and container is a positive or negative combination.
- *
- * @Target sets for base and container annotations are determined using a bit mapping of
- * 10 ElementType enum constants defined in JDK8.
- *
- * Bit      Target value
- *  0  "ElementType.ANNOTATION_TYPE"
- *  1  "ElementType.CONSTRUCTOR"
- *  2  "ElementType.FIELD"
- *  3  "ElementType.LOCAL_VARIABLE"
- *  4  "ElementType.METHOD"
- *  5  "ElementType.TYPE"
- *  6  "ElementType.PARAMETER"
- *  7  "ElementType.PACKAGE"
- *  8  "ElementType.TYPE_USE"
- *  9  "ElementType.TYPE_PARAMETER"
- *
- * Group 1:
- * 20 bits mapping, representing a test case number, is used for all target set
- * combinations ( 0 to 1048575 ) including empty @Target sets => @Target({}).
- * From this 20 bits, 10 bits are for base followed by 10 bits for container
- * where each bit maps to an ElementType enum constant defined in JDK8.
- *
- * Examples:
- * Test case number: 4, binary: 100 => container=100, base=[], container=["ElementType.FIELD"]
- * Test case number: 1003575, binary: 11110101000000110111 => base=1111010100, container=0000110111;
- *                   base=["ElementType.PARAMETER", "ElementType.TYPE_USE", "ElementType.METHOD", "ElementType.FIELD", "ElementType.PACKAGE", "ElementType.TYPE_PARAMETER"],
- *                   container=["ElementType.TYPE", "ElementType.METHOD", "ElementType.ANNOTATION_TYPE", "ElementType.CONSTRUCTOR", "ElementType.FIELD"]
- *
- * In the following groups, no @Target set is represented by null.
- * Group 2:
- * @Target is not defined on base.
- * Target sets for container are determined using the 10-bit binary number
- * resulting in 1024 test cases, mapping them to test case numbers from
- * 1048576 to (1048576 + 1023) => 1048576 to 1049599.
- *
- * Example:
- * Test case number: 1048587 => 1048587 - 1048576 = test case 11 in Group 2, binary: 1011 =>
- *                   base = null,
- *                   container = ["ElementType.ANNOTATION_TYPE","ElementType.CONSTRUCTOR","ElementType.LOCAL_VARIABLE"]
- *
- * Group 3:
- * @Target is not defined on container
- * Target sets for base are determined using the 10-bit binary number
- * resulting in 1024 test cases, mapping them to test case numbers from
- * 1049600 to (1049600 + 1023) => 1049600 to 1050623.
- *
- * Example:
- * Test case number: 1049708 => 1049708 - 1049600 = test case 108 in Group 3, binary: 1101100 =>
- *                   base = ["ElementType.FIELD", "ElementType.LOCAL_VARIABLE", "ElementType.TYPE", "ElementType.PARAMETER"],
- *                   container = null
- *
- * For the above group, test case number: 1049855 gives compiler error, JDK-8006547 filed
- *
- * Group 4:
- * @Target not defined for both base and container annotations.
- *
- * This is the last test and corresponds to test case number 1050624. base=null, container=null
- *
- * Examples to run this test:
- * 1. Run a specific test case number:
- *    ${JTREG} -DTestCaseNum=10782 -samevm -jdk:${JAVA_TEST} -reportDir ${REPORT} -workDir ${WORK} TargetAnnoCombo.java
- * 2. Run specific number of tests:
- *    ${JTREG} -DNumberOfTests=4 -samevm -jdk:${JAVA_TEST} -reportDir ${REPORT} -workDir ${WORK} TargetAnnoCombo.java
- * 3. Run specific number of tests with a seed:
- *    ${JTREG} -DNumberOfTests=4 -DTestSeed=-972894659 -samevm -jdk:${JAVA_TEST} -reportDir ${REPORT} -workDir ${WORK} TargetAnnoCombo.java
- * 4. Run tests in default mode (number of tests = 1000):
- *    ${JTREG} -DTestMode=DEFAULT -samevm -jdk:${JAVA_TEST} -reportDir ${REPORT} -workDir ${WORK} TargetAnnoCombo.java
- * 5. Run all tests (FULL mode):
- *    ${JTREG} -DTestMode=FULL -samevm -jdk:${JAVA_TEST} -reportDir ${REPORT} -workDir ${WORK} TargetAnnoCombo.java
- *
- */
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.TYPE_USE;
+import static java.lang.annotation.ElementType.TYPE_PARAMETER;
 
 public class TargetAnnoCombo {
-    int errors = 0;
+
     static final String TESTPKG = "testpkg";
-    /*
-     *  Set it to true to get more debug information including base and
-     *  container target sets for a given test case number
-     */
+
+    // Set it to true to get more debug information including base and container
+    // target sets for a given test case.
     static final boolean DEBUG = false;
 
-    // JDK 5/6/7/8 Targets
-    static final String[] targetVals = {"ElementType.ANNOTATION_TYPE",
-      "ElementType.CONSTRUCTOR", "ElementType.FIELD",
-      "ElementType.LOCAL_VARIABLE", "ElementType.METHOD",
-      "ElementType.TYPE", "ElementType.PARAMETER",
-      "ElementType.PACKAGE", "ElementType.TYPE_USE",
-      "ElementType.TYPE_PARAMETER"};
+    // Define constant target sets to be used for the combination of the target values.
+    final static Set<ElementType> noSet = null;
+    final static Set<ElementType> empty = EnumSet.noneOf(ElementType.class);
+
+    // [TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE,
+    // PACKAGE, TYPE_PARAMETER, TYPE_USE]
+    final static Set<ElementType> allTargets = EnumSet.allOf(ElementType.class);
+
+    // [TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE,
+    // PACKAGE]
+    final static Set<ElementType> jdk7 = EnumSet.range(TYPE, PACKAGE);
+
+    // [TYPE_USE, TYPE_PARAMETER]
+    final static Set<ElementType> jdk8 = EnumSet.range(TYPE_PARAMETER, TYPE_USE);
+
+    // List of test cases to run. This list is created in generate().
+    // To run a specific test cases add case number in @run main line.
+    List<TestCase> testCases = new ArrayList<TestCase>();
+
+    int errors = 0;
+
+    // Identify test cases that fail.
+    enum IgnoreKind {
+        RUN,
+        IGNORE
+    };
+
+    private class TestCase {
+
+        private Set<ElementType> baseAnnotations;
+        private Set<ElementType> containerAnnotations;
+        private IgnoreKind ignore;
+
+        public TestCase(Set<ElementType> baseAnnotations, Set<ElementType> containerAnnotations) {
+            this(baseAnnotations, containerAnnotations, IgnoreKind.RUN);
+        }
+
+        public TestCase(Set<ElementType> baseAnnotations, Set<ElementType> containerAnnotations,
+                        IgnoreKind ignoreKind) {
+            this.baseAnnotations = baseAnnotations;
+            this.containerAnnotations = containerAnnotations;
+            this.ignore = ignoreKind;
+        }
+
+        public Set getBaseAnnotations() {
+            return baseAnnotations;
+        }
+
+        public Set getContainerAnnotations() {
+            return containerAnnotations;
+        }
+
+        public boolean isIgnored() {
+            return ignore == IgnoreKind.IGNORE;
+        }
 
-    // TYPE_USE and TYPE_PARAMETER (added in JDK8) are not part of default Target set
-    static final int DEFAULT_TARGET_CNT = 8;
+        // Determine if a testCase should compile or not.
+        private boolean isValidSubSet() {
+            /*
+             *  RULE 1: conAnnoTarget should be a subset of baseAnnoTarget
+             *  RULE 2: For empty @Target ({}) - annotation cannot be applied anywhere
+             *         - Empty sets for both is valid
+             *         - Empty baseTarget set is invalid with non-empty conTarget set
+             *         - Non-empty baseTarget set is valid with empty conTarget set
+             *  RULE 3: For no @Target specified - annotation can be applied to any JDK 7 targets
+             *         - No @Target for both is valid
+             *         - No @Target for baseTarget set with @Target conTarget set is valid
+             *         - @Target for baseTarget set with no @Target for conTarget is invalid
+             */
+
+
+            /* If baseAnno has no @Target, Foo can be either applied to @Target specified
+             * for container annotation else will be applicable for all default targets
+             * if no @Target is present for container annotation.
+             * In both cases, the set will be a valid set with no @Target for base annotation
+             */
+            if (baseAnnotations == null) {
+                if (containerAnnotations == null) {
+                    return true;
+                }
+                return !(containerAnnotations.contains(TYPE_USE) ||
+                         containerAnnotations.contains(TYPE_PARAMETER));
+            }
+
+            Set<ElementType> tempBaseSet = EnumSet.noneOf(ElementType.class);
+            tempBaseSet.addAll(baseAnnotations);
+            // If BaseAnno has TYPE, then ANNOTATION_TYPE is allowed by default.
+            if (baseAnnotations.contains(TYPE)) {
+                tempBaseSet.add(ANNOTATION_TYPE);
+            }
+
+            // If containerAnno has no @Target, only valid case if baseAnnoTarget has
+            // all targets defined else invalid set.
+            if (containerAnnotations == null) {
+                return tempBaseSet.containsAll(jdk7);
+            }
+
+            // At this point, neither conAnnoTarget or baseAnnoTarget are null.
+            if (containerAnnotations.isEmpty()) {
+                return true;
+            }
+
+            // At this point, conAnnoTarget is non-empty.
+            if (baseAnnotations.isEmpty()) {
+                return false;
+            }
+
+            // At this point, neither conAnnoTarget or baseAnnoTarget are empty.
+            return tempBaseSet.containsAll(containerAnnotations);
+        }
+    }
 
     public static void main(String args[]) throws Exception {
-
-        /* maxTestNum = (base and container combinations of targetVals elems [0 - 1048575 combos])
-         *              + (combinations where base or container has no Target [1024 combos])
-         *              + (no -1 even though 1st test is number 0 as last test is where both
-         *                 base and container have no target)
-         */
-
-        int maxTestNum = (int)Math.pow(2, 2*targetVals.length) + 2*(int)Math.pow(2, targetVals.length);
-        TestCaseGenerator tcg = new TestCaseGenerator(maxTestNum);
         TargetAnnoCombo tac = new TargetAnnoCombo();
-
-        int testCtr = 0;
-        int testCase = -1;
-        while ( (testCase=tcg.getNextTestCase()) != -1 ) {
-            tac.executeTestCase(testCase, maxTestNum);
-            testCtr++;
+        // Generates all test cases to be run.
+        tac.generate();
+        List<Integer> cases = new ArrayList<Integer>();
+        for (int i = 0; i < args.length; i++) {
+            cases.add(Integer.parseInt(args[i]));
         }
-
-        System.out.println("Total tests run: " + testCtr);
-        if (tac.errors > 0)
-            throw new Exception(tac.errors + " errors found");
+        if (cases.isEmpty()) {
+            tac.run();
+        } else {
+            for (int index : cases) {
+                tac.executeTestCase(tac.testCases.get(index), index);
+            }
+        }
     }
 
-    /*
-     * For given testCase, determine the base and container annotation Target sets,
-     * get if testCase should compile, get test source file(s), get compilation result and verify.
-     *
-     */
-    private void executeTestCase(int testCase, int maxTestNum) {
-
-        // Determine base and container annotation Target sets for the testCase
-        Set<String> baseAnnoTarget = null;
-        Set<String> conAnnoTarget = null;
-
-        //Number of base and container combinations [0 - 1048575 combos]
-        int baseContCombos = (int)Math.pow(2, 2*targetVals.length);
-        //Number of either base or container combinations when one of them has no @Target [1024 combos]
-        int targetValsCombos = (int)Math.pow(2, targetVals.length);
-
-        if (testCase >= baseContCombos) {
-            //Base annotation do not have @Target
-            if (testCase < baseContCombos + targetValsCombos) {
-                baseAnnoTarget = null;
-                conAnnoTarget = getSetFromBitVec(Integer.toBinaryString(testCase - baseContCombos));
-            } else if (testCase < baseContCombos + 2*targetValsCombos) {
-                //Container annotation do not have @Target
-                baseAnnoTarget = getSetFromBitVec(Integer.toBinaryString(testCase - baseContCombos - targetValsCombos));
-                conAnnoTarget = null;
-            } else {
-                //Both Base and Container annotation do not have @Target
-                baseAnnoTarget = null;
-                conAnnoTarget = null;
+    private void generate() {
+        // Adding test cases to run.
+        testCases.addAll(Arrays.asList(
+                // No base target against no container target.
+                new TestCase(noSet, noSet),
+                // No base target against empty container target.
+                new TestCase(noSet, empty),
+                // No base target against TYPE_USE only container target.
+                new TestCase(noSet, less(jdk8, TYPE_PARAMETER)),
+                // No base target against TYPE_PARAMETER only container target.
+                new TestCase(noSet, less(jdk8, TYPE_USE)),
+                // No base target against TYPE_USE + TYPE_PARAMETER only container target.
+                new TestCase(noSet, jdk8),
+                // No base target against TYPE_USE + some selection of jdk7 targets.
+                new TestCase(noSet,
+                plus(EnumSet.range(TYPE, LOCAL_VARIABLE), TYPE_USE)),
+                // No base target against TYPE_PARAMETER + some selection of jdk7 targets.
+                new TestCase(noSet,
+                plus(EnumSet.range(TYPE, LOCAL_VARIABLE), TYPE_PARAMETER)),
+                // No base target against each jdk7 target alone as container target.
+                new TestCase(noSet, plus(empty, TYPE)),
+                new TestCase(noSet, plus(empty, PARAMETER)),
+                new TestCase(noSet, plus(empty, PACKAGE)),
+                new TestCase(noSet, plus(empty, METHOD)),
+                new TestCase(noSet, plus(empty, LOCAL_VARIABLE)),
+                new TestCase(noSet, plus(empty, FIELD)),
+                new TestCase(noSet, plus(empty, CONSTRUCTOR)),
+                new TestCase(noSet, plus(empty, ANNOTATION_TYPE)),
+                // Empty base target against no container target.
+                new TestCase(empty, noSet),
+                // Empty base target against empty container target.
+                new TestCase(empty, empty),
+                // Empty base target against any lone container target.
+                new TestCase(empty, plus(empty, TYPE)),
+                new TestCase(empty, plus(empty, PARAMETER)),
+                new TestCase(empty, plus(empty, PACKAGE)),
+                new TestCase(empty, plus(empty, METHOD)),
+                new TestCase(empty, plus(empty, LOCAL_VARIABLE)),
+                new TestCase(empty, plus(empty, FIELD)),
+                new TestCase(empty, plus(empty, CONSTRUCTOR)),
+                new TestCase(empty, plus(empty, ANNOTATION_TYPE)),
+                new TestCase(empty, less(jdk8, TYPE_USE)),
+                new TestCase(empty, less(jdk8, TYPE_PARAMETER)),
+                // No container target against all all-but one jdk7 targets.
+                new TestCase(less(jdk7, TYPE), noSet),
+                new TestCase(less(jdk7, PARAMETER), noSet),
+                new TestCase(less(jdk7, PACKAGE), noSet),
+                new TestCase(less(jdk7, METHOD), noSet),
+                new TestCase(less(jdk7, LOCAL_VARIABLE), noSet),
+                new TestCase(less(jdk7, FIELD), noSet),
+                new TestCase(less(jdk7, CONSTRUCTOR), noSet),
+                new TestCase(less(jdk7, ANNOTATION_TYPE), noSet),
+                // No container against all but TYPE and ANNOTATION_TYPE
+                new TestCase(less(jdk7, TYPE, ANNOTATION_TYPE), noSet),
+                // No container against jdk7 targets.
+                new TestCase(jdk7, noSet),
+                // No container against jdk7 targets plus one or both of TYPE_USE, TYPE_PARAMETER
+                new TestCase(plus(jdk7, TYPE_USE), noSet),
+                new TestCase(plus(jdk7, TYPE_PARAMETER), noSet),
+                new TestCase(allTargets, noSet),
+                // Empty container target against any lone target.
+                new TestCase(plus(empty, TYPE), empty),
+                new TestCase(plus(empty, PARAMETER), empty),
+                new TestCase(plus(empty, PACKAGE), empty),
+                new TestCase(plus(empty, METHOD), empty),
+                new TestCase(plus(empty, LOCAL_VARIABLE), empty),
+                new TestCase(plus(empty, FIELD), empty),
+                new TestCase(plus(empty, CONSTRUCTOR), empty),
+                new TestCase(plus(empty, ANNOTATION_TYPE), empty),
+                new TestCase(plus(empty, TYPE_USE), empty),
+                new TestCase(plus(empty, TYPE_PARAMETER), empty),
+                // All base targets against all container targets.
+                new TestCase(allTargets, allTargets),
+                // All base targets against all but one container targets.
+                new TestCase(allTargets, less(allTargets, TYPE)),
+                new TestCase(allTargets, less(allTargets, PARAMETER)),
+                new TestCase(allTargets, less(allTargets, PACKAGE)),
+                new TestCase(allTargets, less(allTargets, METHOD)),
+                new TestCase(allTargets, less(allTargets, LOCAL_VARIABLE)),
+                new TestCase(allTargets, less(allTargets, FIELD)),
+                new TestCase(allTargets, less(allTargets, CONSTRUCTOR)),
+                new TestCase(allTargets, less(allTargets, ANNOTATION_TYPE)),
+                new TestCase(allTargets, less(allTargets, TYPE_USE)),
+                new TestCase(allTargets, less(allTargets, TYPE_PARAMETER)),
+                // All container targets against all but one base targets.
+                new TestCase(less(allTargets, TYPE), allTargets),
+                new TestCase(less(allTargets, PARAMETER), allTargets),
+                new TestCase(less(allTargets, PACKAGE), allTargets),
+                new TestCase(less(allTargets, METHOD), allTargets),
+                new TestCase(less(allTargets, LOCAL_VARIABLE), allTargets),
+                new TestCase(less(allTargets, FIELD), allTargets),
+                new TestCase(less(allTargets, CONSTRUCTOR), allTargets),
+                new TestCase(less(allTargets, ANNOTATION_TYPE), allTargets),
+                new TestCase(less(allTargets, TYPE_USE), allTargets),
+                new TestCase(less(allTargets, TYPE_PARAMETER), allTargets)));
+        // Generates 100 test cases for any lone base target contained in Set
+        // allTargets against any lone container target.
+        for (ElementType b : allTargets) {
+            for (ElementType c : allTargets) {
+                testCases.add(new TestCase(plus(empty, b), plus(empty, c)));
             }
-        } else {
-            //TestCase number is represented as 10-bits for base followed by container bits
-            String bin = Integer.toBinaryString(testCase);
-            String base="", cont=bin;
-            if (bin.length() > targetVals.length){
-                base = bin.substring(0, bin.length() - targetVals.length);
-                cont = bin.substring(bin.length() - targetVals.length,bin.length());
-            }
-            baseAnnoTarget = getSetFromBitVec(base);
-            conAnnoTarget = getSetFromBitVec(cont);
         }
-
-        debugPrint("Test case number = " + testCase + " => binary = " + Integer.toBinaryString(testCase));
-        debugPrint(" => baseAnnoTarget = " + baseAnnoTarget);
-        debugPrint(" => containerAnnoTarget = " + conAnnoTarget);
+    }
 
-        // Determine if a testCase should compile or not
-        String className = "TC" + testCase;
-        boolean shouldCompile = isValidSubSet(baseAnnoTarget, conAnnoTarget);
-
-        // Get test source file(s)
-        Iterable<? extends JavaFileObject> files = getFileList(className, baseAnnoTarget,
-                conAnnoTarget, shouldCompile);
+    void run() throws Exception {
+        int testCtr = 0;
+        for (TestCase tc : testCases) {
+            if (!tc.isIgnored()) {
+                executeTestCase(tc, testCases.indexOf(tc));
+                testCtr++;
+            }
+        }
+        System.out.println("Total tests run: " + testCtr);
+        if (errors > 0) {
+            throw new Exception(errors + " errors found");
+        }
+    }
 
-        // Get result of compiling test src file(s)
-        boolean result = getCompileResult(className, shouldCompile, files);
+    private void executeTestCase(TestCase testCase, int index) {
+        debugPrint("Test case number = " + index);
+        debugPrint(" => baseAnnoTarget = " + testCase.getBaseAnnotations());
+        debugPrint(" => containerAnnoTarget = " + testCase.getContainerAnnotations());
 
-        // List test src code if test fails
-        if(!result) {
-            System.out.println("FAIL: Test " + testCase);
+        String className = "TC" + index;
+        boolean shouldCompile = testCase.isValidSubSet();
+        Iterable<? extends JavaFileObject> files = getFileList(className, testCase, shouldCompile);
+        // Get result of compiling test src file(s).
+        boolean result = getCompileResult(className, shouldCompile, files);
+        // List test src code if test fails.
+        if (!result) {
+            System.out.println("FAIL: Test " + index);
             try {
-                for (JavaFileObject f: files) {
+                for (JavaFileObject f : files) {
                     System.out.println("File: " + f.getName() + "\n" + f.getCharContent(true));
                 }
             } catch (IOException ioe) {
                 System.out.println("Exception: " + ioe);
             }
         } else {
-            debugPrint("PASS: Test " + testCase);
+            debugPrint("PASS: Test " + index);
         }
+
     }
 
-    // Get a Set<String> based on bits that are set to 1
-    public Set<String> getSetFromBitVec(String bitVec) {
-        Set<String> ret = new HashSet<>();
-        char[] bit = bitVec.toCharArray();
-        for (int i=bit.length-1, j=0; i>=0; i--, j++){
-            if (bit[i] == '1') {
-                ret.add(targetVals[j]);
+    // Create src code and corresponding JavaFileObjects.
+    private Iterable<? extends JavaFileObject> getFileList(String className,
+            TestCase testCase, boolean shouldCompile) {
+        Set<ElementType> baseAnnoTarget = testCase.getBaseAnnotations();
+        Set<ElementType> conAnnoTarget = testCase.getContainerAnnotations();
+        String srcContent = "";
+        String pkgInfoContent = "";
+        String template = Helper.template;
+        String baseTarget = "", conTarget = "";
+
+        String target = Helper.ContentVars.TARGET.getVal();
+        if (baseAnnoTarget != null) {
+            String tmp = target.replace("#VAL", convertToString(baseAnnoTarget).toString());
+            baseTarget = tmp.replace("[", "{").replace("]", "}");
+        }
+        if (conAnnoTarget != null) {
+            String tmp = target.replace("#VAL", convertToString(conAnnoTarget).toString());
+            conTarget = tmp.replace("[", "{").replace("]", "}");
+        }
+
+        String annoData = Helper.ContentVars.IMPORTSTMTS.getVal()
+                + conTarget
+                + Helper.ContentVars.CONTAINER.getVal()
+                + baseTarget
+                + Helper.ContentVars.REPEATABLE.getVal()
+                + Helper.ContentVars.BASE.getVal();
+
+        JavaFileObject pkgInfoFile = null;
+
+        // If shouldCompile = true and no @Target is specified for container annotation,
+        // then all 8 ElementType enum constants are applicable as targets for
+        // container annotation.
+        if (shouldCompile && conAnnoTarget == null) {
+            Set<ElementType> copySet = EnumSet.noneOf(ElementType.class);
+            copySet.addAll(jdk7);
+            conAnnoTarget = copySet;
+        }
+
+        if (shouldCompile) {
+            boolean isPkgCasePresent = conAnnoTarget.contains(PACKAGE);
+            String repeatableAnno = Helper.ContentVars.BASEANNO.getVal()
+                    + " " + Helper.ContentVars.BASEANNO.getVal();
+            for (ElementType s : conAnnoTarget) {
+                String replaceStr = "/*" + s.name() + "*/";
+                if (s.name().equalsIgnoreCase("PACKAGE")) {
+                    //Create packageInfo file.
+                    String pkgInfoName = TESTPKG + "." + "package-info";
+                    pkgInfoContent = repeatableAnno + "\npackage " + TESTPKG + ";" + annoData;
+                    pkgInfoFile = Helper.getFile(pkgInfoName, pkgInfoContent);
+                } else {
+                    template = template.replace(replaceStr, repeatableAnno);
+                    if (!isPkgCasePresent) {
+                        srcContent = template.replace(
+                                "/*ANNODATA*/", annoData).replace("#ClassName", className);
+                    } else {
+                        replaceStr = "/*PACKAGE*/";
+                        String tmp = template.replace(replaceStr, "package " + TESTPKG + ";");
+                        srcContent = tmp.replace("#ClassName", className);
+                    }
+                }
             }
+        } else {
+            // For invalid cases, compilation should fail at declaration site.
+            template = "class #ClassName {}";
+            srcContent = annoData + template.replace("#ClassName", className);
         }
-        return ret;
+        JavaFileObject srcFile = Helper.getFile(className, srcContent);
+        Iterable<? extends JavaFileObject> files = null;
+        if (pkgInfoFile != null) {
+            files = Arrays.asList(pkgInfoFile, srcFile);
+        } else {
+            files = Arrays.asList(srcFile);
+        }
+        return files;
     }
 
-    // Compile the test source file(s) and return test result
+    // Compile the test source file(s) and return test result.
     private boolean getCompileResult(String className, boolean shouldCompile,
             Iterable<? extends JavaFileObject> files) {
 
         DiagnosticCollector<JavaFileObject> diagnostics =
                 new DiagnosticCollector<JavaFileObject>();
         Helper.compileCode(diagnostics, files);
-
-        // Test case pass or fail
+        // Test case pass or fail.
         boolean ok = false;
-
         String errMesg = "";
         int numDiags = diagnostics.getDiagnostics().size();
-
         if (numDiags == 0) {
             if (shouldCompile) {
                 debugPrint("Test passed, compiled as expected.");
@@ -270,201 +429,80 @@
             }
         } else {
             if (shouldCompile) {
-                // did not compile
+                // did not compile.
                 errMesg = "Test failed, did not compile.";
                 ok = false;
             } else {
-                // Error in compilation as expected
-                String expectedErrKey = "compiler.err.invalid.repeatable." +
-                        "annotation.incompatible.target";
+                // Error in compilation as expected.
+                String expectedErrKey = "compiler.err.invalid.repeatable."
+                        + "annotation.incompatible.target";
                 for (Diagnostic<?> d : diagnostics.getDiagnostics()) {
-                    if((d.getKind() == Diagnostic.Kind.ERROR) &&
-                        d.getCode().contains(expectedErrKey)) {
-                        // Error message as expected
+                    if ((d.getKind() == Diagnostic.Kind.ERROR)
+                            && d.getCode().contains(expectedErrKey)) {
+                        // Error message as expected.
                         debugPrint("Error message as expected.");
                         ok = true;
                         break;
                     } else {
-                        // error message is incorrect
+                        // error message is incorrect.
                         ok = false;
                     }
                 }
                 if (!ok) {
-                    errMesg = "Incorrect error received when compiling " +
-                        className + ", expected: " + expectedErrKey;
+                    errMesg = "Incorrect error received when compiling "
+                            + className + ", expected: " + expectedErrKey;
                 }
             }
         }
 
-        if(!ok) {
+        if (!ok) {
             error(errMesg);
-            for (Diagnostic<?> d : diagnostics.getDiagnostics())
+            for (Diagnostic<?> d : diagnostics.getDiagnostics()) {
                 System.out.println(" Diags: " + d);
+            }
         }
         return ok;
     }
 
-    private void debugPrint(String string) {
-        if(DEBUG)
-            System.out.println(string);
+    private Set<ElementType> less(Set<ElementType> base, ElementType... sub) {
+        Set<ElementType> res = EnumSet.noneOf(ElementType.class);
+        res.addAll(base);
+        for (ElementType t : sub) {
+            res.remove(t);
+        }
+        return res;
+    }
+
+    private Set<ElementType> plus(Set<ElementType> base, ElementType... add) {
+        Set<ElementType> res = EnumSet.noneOf(ElementType.class);
+        res.addAll(base);
+        for (ElementType t : add) {
+            res.add(t);
+        }
+        return res;
     }
 
-    // Create src code and corresponding JavaFileObjects
-    private Iterable<? extends JavaFileObject> getFileList(String className,
-            Set<String> baseAnnoTarget, Set<String> conAnnoTarget,
-            boolean shouldCompile) {
-
-        String srcContent = "";
-        String pkgInfoContent = "";
-        String template = Helper.template;
-        String baseTarget = "", conTarget = "";
-
-        String target = Helper.ContentVars.TARGET.getVal();
-        if(baseAnnoTarget != null) {
-            baseTarget = target.replace("#VAL", baseAnnoTarget.toString())
-                                  .replace("[", "{").replace("]", "}");
-        }
-        if(conAnnoTarget != null) {
-            conTarget = target.replace("#VAL", conAnnoTarget.toString())
-                                 .replace("[", "{").replace("]", "}");
+    // Iterate target set and add "ElementType." in front of every target type.
+    private List<String> convertToString(Set<ElementType> annoTarget) {
+        if (annoTarget == null) {
+            return null;
         }
-
-        String annoData = Helper.ContentVars.IMPORTSTMTS.getVal() +
-                          conTarget +
-                          Helper.ContentVars.CONTAINER.getVal() +
-                          baseTarget +
-                          Helper.ContentVars.REPEATABLE.getVal() +
-                          Helper.ContentVars.BASE.getVal();
-
-        JavaFileObject pkgInfoFile = null;
-
-        /*
-         *  If shouldCompile = true and no @Target is specified for container annotation,
-         *  then all 8 ElementType enum constants are applicable as targets for
-         *  container annotation.
-         */
-        if(shouldCompile && conAnnoTarget == null) {
-            //conAnnoTarget = new HashSet<String>(Arrays.asList(targetVals));
-            conAnnoTarget = getDefaultTargetSet();
+        List<String> annoTargets = new ArrayList<String>();
+        for (ElementType e : annoTarget) {
+            annoTargets.add("ElementType." + e.name());
         }
-
-        if(shouldCompile) {
-            boolean isPkgCasePresent = new ArrayList<String>(conAnnoTarget).contains("ElementType.PACKAGE");
-            String repeatableAnno = Helper.ContentVars.BASEANNO.getVal() + " " + Helper.ContentVars.BASEANNO.getVal();
-            for(String s: conAnnoTarget) {
-                s = s.replace("ElementType.","");
-                String replaceStr = "/*"+s+"*/";
-                if(s.equalsIgnoreCase("PACKAGE")) {
-                    //Create packageInfo file
-                    String pkgInfoName = TESTPKG + "." + "package-info";
-                    pkgInfoContent = repeatableAnno + "\npackage " + TESTPKG + ";" + annoData;
-                    pkgInfoFile = Helper.getFile(pkgInfoName, pkgInfoContent);
-                } else {
-                    template = template.replace(replaceStr, repeatableAnno);
-                    //srcContent = template.replace("#ClassName",className);
-                    if(!isPkgCasePresent) {
-                        srcContent = template.replace("/*ANNODATA*/", annoData).replace("#ClassName",className);
-                    } else {
-                        replaceStr = "/*PACKAGE*/";
-                        srcContent = template.replace(replaceStr, "package " + TESTPKG + ";")
-                                     .replace("#ClassName", className);
-                    }
-                }
-            }
-        } else {
-            // For invalid cases, compilation should fail at declaration site
-            template = "class #ClassName {}";
-            srcContent = annoData + template.replace("#ClassName",className);
-        }
-        JavaFileObject srcFile = Helper.getFile(className, srcContent);
-        Iterable<? extends JavaFileObject> files = null;
-        if(pkgInfoFile != null)
-            files = Arrays.asList(pkgInfoFile,srcFile);
-        else
-            files = Arrays.asList(srcFile);
-        return files;
+        return annoTargets;
     }
 
-    private Set<String> getDefaultTargetSet() {
-        Set<String> defaultSet = new HashSet<>();
-        int ctr = 0;
-        for(String s : targetVals) {
-            if(ctr++ < DEFAULT_TARGET_CNT) {
-                defaultSet.add(s);
-            }
+    private void debugPrint(String string) {
+        if (DEBUG) {
+            System.out.println(string);
         }
-        return defaultSet;
     }
 
-    private boolean isValidSubSet(Set<String> baseAnnoTarget, Set<String> conAnnoTarget) {
-        /*
-         *  RULE 1: conAnnoTarget should be a subset of baseAnnoTarget
-         *  RULE 2: For empty @Target ({}) - annotation cannot be applied anywhere
-         *         - Empty sets for both is valid
-         *         - Empty baseTarget set is invalid with non-empty conTarget set
-         *         - Non-empty baseTarget set is valid with empty conTarget set
-         *  RULE 3: For no @Target specified - annotation can be applied to any JDK 7 targets
-         *         - No @Target for both is valid
-         *         - No @Target for baseTarget set with @Target conTarget set is valid
-         *         - @Target for baseTarget set with no @Target for conTarget is invalid
-         */
-
-
-        /* If baseAnno has no @Target, Foo can be either applied to @Target specified for container annotation
-         * else will be applicable for all default targets if no @Target is present for container annotation.
-         * In both cases, the set will be a valid set with no @Target for base annotation
-         */
-        if(baseAnnoTarget == null) {
-            if(conAnnoTarget == null) return true;
-            return !(conAnnoTarget.contains("ElementType.TYPE_USE") || conAnnoTarget.contains("ElementType.TYPE_PARAMETER"));
-        }
-
-        Set<String> tempBaseSet = new HashSet<>(baseAnnoTarget);
-        // If BaseAnno has TYPE, then ANNOTATION_TYPE is allowed by default
-        if(baseAnnoTarget.contains("ElementType.TYPE")) {
-            tempBaseSet.add("ElementType.ANNOTATION_TYPE");
-        }
-
-        /*
-         * If containerAnno has no @Target, only valid case if baseAnnoTarget has all targets defined
-         * else invalid set
-         */
-        if(conAnnoTarget == null) {
-            return (tempBaseSet.containsAll(getDefaultTargetSet()));
-        }
-
-        // At this point, neither conAnnoTarget or baseAnnoTarget are null
-        if(conAnnoTarget.size() == 0) return true;
-
-        // At this point, conAnnoTarget is non-empty
-        if (baseAnnoTarget.size() == 0) return false;
-
-        // At this point, neither conAnnoTarget or baseAnnoTarget are empty
-        return tempBaseSet.containsAll(conAnnoTarget);
-    }
-
-    void error(String msg) {
+    private void error(String msg) {
         System.out.println("ERROR: " + msg);
         errors++;
     }
-
-    // Lists the start and end range for the given set of target vals
-    void showGroups() {
-        //Group 1: All target set combinations ( 0 to 1048575 ) including empty @Target sets => @Target({})
-        int grpEnd1 = (int)Math.pow(2, 2*targetVals.length) - 1;
-        System.out.println("[Group 1]: 0 - " + grpEnd1);
+}
 
-        //Group 2: @Target not defined for base annotation ( 1048576 - 1049599 ).
-        System.out.print("[Group 2]: " + (grpEnd1 + 1) + " - ");
-        int grpEnd2 = grpEnd1 + 1 + (int)Math.pow(2, targetVals.length) - 1;
-        System.out.println(grpEnd2);
-
-        //Group 3: @Target not defined for container annotation ( 1049600 - 1050623 ).
-        System.out.print("[Group 3]: " + (grpEnd2 + 1) + " - ");
-        int grpEnd3 = grpEnd2 + 1 + (int)Math.pow(2, targetVals.length) - 1;
-        System.out.println(grpEnd3);
-
-        //Group 4: @Target not defined for both base and container annotations ( 1050624 ).
-        System.out.println("[Group 4]: " + (grpEnd3 + 1));
-    }
-}
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/TestCaseGenerator.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Random;
-
-/* System properties:
- * NumberOfTests, TestMode, and TestCaseNum are mutually exclusive
- * TestSeed will be used only with NumberOfTests or TestMode, otherwise it will be ignored
- * -DNumberOfTests=[0 to 2^20+2^11+1]
- * -DTestMode=[FULL|DEFAULT]
- * -DTestSeed=[seedNumber]
- * -DTestCaseNum=[0 to 2^20+2^11+1]
- */
-public class TestCaseGenerator {
-    // Total number of tests to be run
-    int numberOfTests = -1;
-    //Single test case
-    int testCaseNum = -1;
-    //Seed used to generate test cases
-    int testSeed;
-
-    int maxTestNum;
-    Random randNum;
-
-    // used in getNextTestCase
-    int curTestNum;
-    int testCompletedCount;
-    HashSet<Integer> uniqueTestSet;
-
-    static final int DEFAULT_TEST_COUNT = 250;
-
-    /*
-     *  Get parameter values from command line to set numberOfTests, testCaseNum,
-     *  and testSeed
-     */
-    public TestCaseGenerator(int maxTestNum) {
-        this.maxTestNum = maxTestNum;
-
-        // Set values for variables based on input from command line
-
-        // TestMode system property
-        String testModeVal = System.getProperty("TestMode");
-        if(testModeVal != null && !testModeVal.isEmpty()) {
-            switch (testModeVal.toUpperCase()) {
-            case "FULL":
-                numberOfTests = maxTestNum;
-                break;
-            case "DEFAULT":
-                numberOfTests = DEFAULT_TEST_COUNT;
-                break;
-            default:
-                System.out.println("Invalid property value " + testModeVal +
-                        " for numberOfTests. Possible range: 0 to " +
-                        maxTestNum + ". Ignoring property");
-                numberOfTests = -1;
-            }
-        }
-
-        // NumberOfTests system property
-        String numTestsStr = System.getProperty("NumberOfTests");
-        if(numTestsStr != null && !numTestsStr.isEmpty()) {
-            int numTests = -1;
-            try {
-                numTests = Integer.parseInt(numTestsStr);
-                if (numTests < 0 || numTests > maxTestNum) {
-                    throw new NumberFormatException();
-                }
-            } catch(NumberFormatException nfe) {
-                System.out.println("Invalid NumberOfTests property value " +
-                        numTestsStr + ". Possible range: 0 to " + maxTestNum +
-                        "Reset to default: " + DEFAULT_TEST_COUNT);
-                numTests = DEFAULT_TEST_COUNT;
-            }
-
-            if (numberOfTests != -1 && numTests != -1) {
-                System.out.println("TestMode and NumberOfTests cannot be set together. Ignoring TestMode.");
-            }
-            numberOfTests = numTests;
-        }
-
-        // TestSeed system property
-        String seedVal = System.getProperty("TestSeed");
-        if(seedVal != null && !seedVal.isEmpty()) {
-            try {
-                testSeed = Integer.parseInt(seedVal);
-            } catch(NumberFormatException nfe) {
-                Random srand = new Random();
-                testSeed = srand.nextInt();
-            }
-        } else {
-            Random srand = new Random();
-            testSeed = srand.nextInt();
-        }
-
-        // TestCaseNum system property
-        String testNumStr = System.getProperty("TestCaseNum");
-        if(testNumStr != null && !testNumStr.isEmpty()) {
-            try {
-                testCaseNum = Integer.parseInt(testNumStr);
-                if (testCaseNum < 0 || testCaseNum > maxTestNum) {
-                    throw new NumberFormatException();
-                }
-            } catch(NumberFormatException nfe) {
-                System.out.println("Invalid TestCaseNumber property value " +
-                        testNumStr + ". Possible value in range: 0 to " +
-                        maxTestNum + ". Defaulting to last test case.");
-                testCaseNum = maxTestNum;
-            }
-
-            if ( numberOfTests != -1) {
-                System.out.println("TestMode or NumberOfTests cannot be set along with TestCaseNum. Ignoring TestCaseNumber.");
-                testCaseNum = -1;
-            }
-        }
-
-        if (numberOfTests == -1 && testCaseNum == -1) {
-            numberOfTests = DEFAULT_TEST_COUNT;
-            System.out.println("Setting TestMode to default, will run " + numberOfTests + "tests.");
-        }
-
-        /*
-         *  By this point in code, we will have:
-         *  - testSeed: as per TestSeed or a Random one
-         *  - numberOfTests to run or -1 to denote not set
-         *  - testCaseNum to run or -1 to denote not set
-         */
-
-        /*
-         * If numberOfTests = maxTestNum, all tests are to be run,
-         * so no randNum will be required
-         */
-        if (numberOfTests != -1 && numberOfTests < maxTestNum) {
-            System.out.println("Seed = " + testSeed);
-            randNum = new Random(testSeed);
-            uniqueTestSet = new HashSet<>();
-        }
-
-        testCompletedCount = 0;
-        // to be used to keep sequential count when running all tests
-        curTestNum = 0;
-    }
-
-    /*
-     * returns next test case number to run
-     * returns -1 when there are no more tests to run
-     */
-    public int getNextTestCase() {
-        if (testCaseNum != -1) {
-            int nextTC = testCaseNum;
-            testCaseNum = -1;
-            return nextTC;
-        }
-        if (++testCompletedCount <= numberOfTests) {
-            if (numberOfTests == maxTestNum) {
-                //all the tests need to be run, so just return
-                //next test case sequentially
-                return curTestNum++;
-            } else {
-                int nextTC = -1;
-                // Ensuring unique test are run
-                while(!uniqueTestSet.add(nextTC = randNum.nextInt(maxTestNum))) {
-                }
-                return nextTC;
-            }
-        }
-        return -1;
-    }
-}
--- a/langtools/test/tools/javac/api/TestJavacTaskScanner.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/api/TestJavacTaskScanner.java	Fri Apr 05 14:51:24 2013 -0700
@@ -179,7 +179,6 @@
 
         @Override
         public Scanner newScanner(CharSequence input, boolean keepDocComments) {
-            assert !keepDocComments;
             if (input instanceof CharBuffer) {
                 return new MyScanner(this, (CharBuffer)input, test);
             } else {
@@ -190,7 +189,6 @@
 
         @Override
         public Scanner newScanner(char[] input, int inputLength, boolean keepDocComments) {
-            assert !keepDocComments;
             return new MyScanner(this, input, inputLength, test);
         }
 
--- a/langtools/test/tools/javac/diags/MessageFile.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/diags/MessageFile.java	Fri Apr 05 14:51:24 2013 -0700
@@ -65,7 +65,7 @@
         }
 
         void insertAfter(Line l) {
-            assert prev == null && next == null;
+            assert l.prev == null && l.next == null;
             l.prev = this;
             l.next = next;
             if (next == null)
@@ -82,7 +82,7 @@
         }
 
         void insertBefore(Line l) {
-            assert prev == null && next == null;
+            assert l.prev == null && l.next == null;
             l.prev = prev;
             l.next = this;
             if (prev == null)
--- a/langtools/test/tools/javac/diags/MessageInfo.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/diags/MessageInfo.java	Fri Apr 05 14:51:24 2013 -0700
@@ -409,5 +409,3 @@
     }
 
 }
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/DoubleStaticImport.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011, 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.
+ */
+
+/*
+ * @test
+ * @bug 8009820
+ * @summary AssertionError when compiling java code with two identical static imports
+ * @compile DoubleStaticImport.java
+ */
+
+import static java.lang.Thread.holdsLock;
+import static java.lang.Thread.holdsLock; //dup
+
+class DoubleStaticImport {
+    public void test() {
+        holdsLock(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/Intersection02.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2012, 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.
+ */
+
+/*
+ * @test
+ * @bug 8010101
+ * @summary Intersection type cast issues redundant unchecked warning
+ * @compile/fail/ref=Intersection02.out -Werror -Xlint:unchecked -XDrawDiagnostics Intersection02.java
+ */
+import java.io.Serializable;
+import java.util.List;
+
+class Intersection02 {
+
+    interface P<X> { }
+
+    void test(List<String> ls) {
+        Object o1 = (List<String> & Serializable)ls;
+        Object o2 = (List<String> & Serializable & P<String>)ls;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/Intersection02.out	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,4 @@
+Intersection02.java:39:62: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.util.List<java.lang.String>, java.lang.Object&java.util.List<java.lang.String>&java.io.Serializable&Intersection02.P<java.lang.String>
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/LambdaLambdaSerialized.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+@test
+@bug 8010010
+@summary NPE generating serializedLambdaName for nested lambda
+*/
+
+import java.io.*;
+import java.util.Map;
+import java.util.HashMap;
+
+public class LambdaLambdaSerialized {
+
+    static int assertionCount = 0;
+
+    static void assertTrue(boolean cond) {
+        assertionCount++;
+        if (!cond)
+            throw new AssertionError();
+    }
+
+    public static void main(String[] args) throws Exception {
+        try {
+            // Write lambdas out
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            ObjectOutput out = new ObjectOutputStream(baos);
+            LSI<LSI<Map>> ssi = () -> (() -> new HashMap());
+            write(out, ssi );
+            out.flush();
+            out.close();
+
+            // Read them back
+            ByteArrayInputStream bais =
+                new ByteArrayInputStream(baos.toByteArray());
+            ObjectInputStream in = new ObjectInputStream(bais);
+            readAssert(in, "[X]");
+            in.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
+    static void write(ObjectOutput out, LSI<LSI<Map>> lamb) throws IOException {
+        out.writeObject(lamb);
+    }
+
+    static void readAssert(ObjectInputStream in, String expected)  throws IOException, ClassNotFoundException {
+        LSI<LSI<Map>> ls = (LSI<LSI<Map>>) in.readObject();
+        Map result = ls.get().get();
+        System.out.printf("Result: %s\n", result);
+    }
+}
+
+interface LSI<T> extends Serializable {
+    T get();
+}
--- a/langtools/test/tools/javac/lambda/TargetType28.out	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/lambda/TargetType28.out	Fri Apr 05 14:51:24 2013 -0700
@@ -1,2 +1,2 @@
-TargetType28.java:20:32: compiler.err.prob.found.req: (compiler.misc.incompatible.eq.upper.bounds: X, java.lang.String,R, java.lang.Object,java.lang.Number)
+TargetType28.java:20:32: compiler.err.prob.found.req: (compiler.misc.incompatible.eq.upper.bounds: X, R,java.lang.String, java.lang.Object,java.lang.Number)
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType67.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8010303
+ * @summary Graph inference: missing incorporation step causes spurious inference error
+ * @compile TargetType67.java
+ */
+class TargetType67 {
+
+    interface Func<A, B> {
+        B f(A a);
+    }
+
+    class List<X> {
+
+        <M> List<M> map(Func<X, M> f) {
+            return null;
+        }
+
+        <A> List<A> apply(final List<Func<X, A>> lf) {
+            return null;
+        }
+
+        <B, C> List<C> bind(final List<B> lb, final Func<X, Func<B, C>> f) {
+            return lb.apply(map(f));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType68.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8010303
+ * @summary Graph inference: missing incorporation step causes spurious inference error
+ * @compile TargetType68.java
+ */
+import java.util.*;
+
+class TargetType68 {
+
+    //derived from FX 2.2 API
+    static class XYChart<X,Y> {
+        static final class Series<X,Y> {
+            Series(java.lang.String name, ObservableList<XYChart.Data<X,Y>> data) { }
+        }
+
+        static final class Data<X,Y> { }
+
+        ObservableList<XYChart.Series<X,Y>> getData() { return null; }
+    }
+
+    //derived from FX 2.2 API
+    interface ObservableList<X> extends List<X> {
+        boolean setAll(Collection<? extends X> col);
+    }
+
+    //derived from FX 2.2 API
+    static class FXCollections {
+        static <E> ObservableList<E> observableList(List<E> l) { return null; }
+    }
+
+    private void testMethod() {
+            XYChart<Number, Number> numberChart = null;
+            List<XYChart.Data<Number, Number>> data_1 = new ArrayList<>();
+            List<XYChart.Data<Number, Number>> data_2 = new ArrayList<>();
+            numberChart.getData().setAll(
+                    Arrays.asList(new XYChart.Series<>("Data", FXCollections.observableList(data_1)),
+                    new XYChart.Series<>("Data", FXCollections.observableList(data_2))));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType69.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8010303
+ * @summary Graph inference: missing incorporation step causes spurious inference error
+ * @compile TargetType68.java
+ */
+import java.util.*;
+
+class TargetType68 {
+
+    interface Function<X,Y> {
+        Y m(X x);
+    }
+
+    abstract class TabulationAssertion<T, U> { }
+
+    class GroupedMapAssertion<K, M1 extends Map<K, ?>> extends TabulationAssertion<Integer, M1> {
+        GroupedMapAssertion(Function<Integer, K> classifier) { }
+    }
+
+
+    <T, M2 extends Map> void exerciseMapTabulation(Function<T, ? extends M2> collector,
+                                                             TabulationAssertion<T, M2> assertion)  { }
+
+    void test(Function<Integer, Integer> classifier, Function<Integer, Map<Integer, List<Integer>>> coll) {
+        exerciseMapTabulation(coll, new GroupedMapAssertion<>(classifier));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/bytecode/TestLambdaBytecode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8009649
+ * @summary Lambda back-end should generate invokespecial for method handles referring to private instance methods
+ * @library ../../lib
+ * @build JavacTestingAbstractThreadedTest
+ * @run main/othervm TestLambdaBytecode
+ */
+
+// use /othervm to avoid jtreg timeout issues (CODETOOLS-7900047)
+// see JDK-8006746
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.BootstrapMethods_attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ConstantPool.*;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Method;
+
+import com.sun.tools.javac.api.JavacTaskImpl;
+
+
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Locale;
+
+import javax.tools.Diagnostic;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+
+import static com.sun.tools.javac.jvm.ClassFile.*;
+
+public class TestLambdaBytecode
+    extends JavacTestingAbstractThreadedTest
+    implements Runnable {
+
+    enum ClassKind {
+        CLASS("class"),
+        INTERFACE("interface");
+
+        String classStr;
+
+        ClassKind(String classStr) {
+            this.classStr = classStr;
+        }
+    }
+
+    enum AccessKind {
+        PUBLIC("public"),
+        PRIVATE("private");
+
+        String accessStr;
+
+        AccessKind(String accessStr) {
+            this.accessStr = accessStr;
+        }
+    }
+
+    enum StaticKind {
+        STATIC("static"),
+        INSTANCE("");
+
+        String staticStr;
+
+        StaticKind(String staticStr) {
+            this.staticStr = staticStr;
+        }
+    }
+
+    enum DefaultKind {
+        DEFAULT("default"),
+        NO_DEFAULT("");
+
+        String defaultStr;
+
+        DefaultKind(String defaultStr) {
+            this.defaultStr = defaultStr;
+        }
+    }
+
+    enum ExprKind {
+        LAMBDA("Runnable r = ()->{ target(); };");
+
+        String exprString;
+
+        ExprKind(String exprString) {
+            this.exprString = exprString;
+        }
+    }
+
+    static class MethodKind {
+        ClassKind ck;
+        AccessKind ak;
+        StaticKind sk;
+        DefaultKind dk;
+
+        MethodKind(ClassKind ck, AccessKind ak, StaticKind sk, DefaultKind dk) {
+            this.ck = ck;
+            this.ak = ak;
+            this.sk = sk;
+            this.dk = dk;
+        }
+
+        boolean inInterface() {
+            return ck == ClassKind.INTERFACE;
+        }
+
+        boolean isPrivate() {
+            return ak == AccessKind.PRIVATE;
+        }
+
+        boolean isStatic() {
+            return sk == StaticKind.STATIC;
+        }
+
+        boolean isDefault() {
+            return dk == DefaultKind.DEFAULT;
+        }
+
+        boolean isOK() {
+            if (isDefault() && (!inInterface() || isStatic())) {
+                return false;
+            } else if (inInterface() &&
+                    ((!isStatic() && !isDefault()) || isPrivate())) {
+                return false;
+            } else {
+                return true;
+            }
+        }
+
+        String mods() {
+            StringBuilder buf = new StringBuilder();
+            buf.append(ak.accessStr);
+            buf.append(' ');
+            buf.append(sk.staticStr);
+            buf.append(' ');
+            buf.append(dk.defaultStr);
+            return buf.toString();
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        for (ClassKind ck : ClassKind.values()) {
+            for (AccessKind ak1 : AccessKind.values()) {
+                for (StaticKind sk1 : StaticKind.values()) {
+                    for (DefaultKind dk1 : DefaultKind.values()) {
+                        for (AccessKind ak2 : AccessKind.values()) {
+                            for (StaticKind sk2 : StaticKind.values()) {
+                                for (DefaultKind dk2 : DefaultKind.values()) {
+                                    for (ExprKind ek : ExprKind.values()) {
+                                        pool.execute(new TestLambdaBytecode(ck, ak1, ak2, sk1, sk2, dk1, dk2, ek));
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        checkAfterExec();
+    }
+
+    MethodKind mk1, mk2;
+    ExprKind ek;
+    DiagChecker dc;
+
+    TestLambdaBytecode(ClassKind ck, AccessKind ak1, AccessKind ak2, StaticKind sk1,
+            StaticKind sk2, DefaultKind dk1, DefaultKind dk2, ExprKind ek) {
+        mk1 = new MethodKind(ck, ak1, sk1, dk1);
+        mk2 = new MethodKind(ck, ak2, sk2, dk2);
+        this.ek = ek;
+        dc = new DiagChecker();
+    }
+
+    public void run() {
+        int id = checkCount.incrementAndGet();
+        JavaSource source = new JavaSource(id);
+        JavacTaskImpl ct = (JavacTaskImpl)comp.getTask(null, fm.get(), dc,
+                null, null, Arrays.asList(source));
+        try {
+            ct.generate();
+        } catch (Throwable t) {
+            t.printStackTrace();
+            throw new AssertionError(
+                    String.format("Error thrown when compiling following code\n%s",
+                    source.source));
+        }
+        if (dc.diagFound) {
+            boolean errorExpected = !mk1.isOK() || !mk2.isOK();
+            errorExpected |= mk1.isStatic() && !mk2.isStatic();
+
+            if (!errorExpected) {
+                throw new AssertionError(
+                        String.format("Diags found when compiling following code\n%s\n\n%s",
+                        source.source, dc.printDiags()));
+            }
+            return;
+        }
+        verifyBytecode(id, source);
+    }
+
+    void verifyBytecode(int id, JavaSource source) {
+        File compiledTest = new File(String.format("Test%d.class", id));
+        try {
+            ClassFile cf = ClassFile.read(compiledTest);
+            Method testMethod = null;
+            for (Method m : cf.methods) {
+                if (m.getName(cf.constant_pool).equals("test")) {
+                    testMethod = m;
+                    break;
+                }
+            }
+            if (testMethod == null) {
+                throw new Error("Test method not found");
+            }
+            Code_attribute ea =
+                    (Code_attribute)testMethod.attributes.get(Attribute.Code);
+            if (testMethod == null) {
+                throw new Error("Code attribute for test() method not found");
+            }
+
+            int bsmIdx = -1;
+
+            for (Instruction i : ea.getInstructions()) {
+                if (i.getMnemonic().equals("invokedynamic")) {
+                    CONSTANT_InvokeDynamic_info indyInfo =
+                         (CONSTANT_InvokeDynamic_info)cf
+                            .constant_pool.get(i.getShort(1));
+                    bsmIdx = indyInfo.bootstrap_method_attr_index;
+                    if (!indyInfo.getNameAndTypeInfo().getType().equals(makeIndyType(id))) {
+                        throw new
+                            AssertionError("type mismatch for CONSTANT_InvokeDynamic_info " + source.source + "\n" + indyInfo.getNameAndTypeInfo().getType() + "\n" + makeIndyType(id));
+                    }
+                }
+            }
+            if (bsmIdx == -1) {
+                throw new Error("Missing invokedynamic in generated code");
+            }
+
+            BootstrapMethods_attribute bsm_attr =
+                    (BootstrapMethods_attribute)cf
+                    .getAttribute(Attribute.BootstrapMethods);
+            if (bsm_attr.bootstrap_method_specifiers.length != 1) {
+                throw new Error("Bad number of method specifiers " +
+                        "in BootstrapMethods attribute");
+            }
+            BootstrapMethods_attribute.BootstrapMethodSpecifier bsm_spec =
+                    bsm_attr.bootstrap_method_specifiers[0];
+
+            if (bsm_spec.bootstrap_arguments.length != MF_ARITY) {
+                throw new Error("Bad number of static invokedynamic args " +
+                        "in BootstrapMethod attribute");
+            }
+
+            CONSTANT_MethodHandle_info mh =
+                    (CONSTANT_MethodHandle_info)cf.constant_pool.get(bsm_spec.bootstrap_arguments[1]);
+
+            boolean kindOK;
+            switch (mh.reference_kind) {
+                case REF_invokeStatic: kindOK = mk2.isStatic(); break;
+                case REF_invokeSpecial: kindOK = !mk2.isStatic(); break;
+                case REF_invokeInterface: kindOK = mk2.inInterface(); break;
+                default:
+                    kindOK = false;
+            }
+
+            if (!kindOK) {
+                throw new Error("Bad invoke kind in implementation method handle");
+            }
+
+            if (!mh.getCPRefInfo().getNameAndTypeInfo().getType().toString().equals(MH_SIG)) {
+                throw new Error("Type mismatch in implementation method handle");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + compiledTest +": " + e);
+        }
+    }
+    String makeIndyType(int id) {
+        StringBuilder buf = new StringBuilder();
+        buf.append("(");
+        if (!mk2.isStatic() || mk1.inInterface()) {
+            buf.append(String.format("LTest%d;", id));
+        }
+        buf.append(")Ljava/lang/Runnable;");
+        return buf.toString();
+    }
+
+    static final int MF_ARITY = 3;
+    static final String MH_SIG = "()V";
+
+    class JavaSource extends SimpleJavaFileObject {
+
+        static final String source_template =
+                "#CK Test#ID {\n" +
+                "   #MOD1 void test() { #EK }\n" +
+                "   #MOD2 void target() { }\n" +
+                "}\n";
+
+        String source;
+
+        JavaSource(int id) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            source = source_template.replace("#CK", mk1.ck.classStr)
+                    .replace("#MOD1", mk1.mods())
+                    .replace("#MOD2", mk2.mods())
+                    .replace("#EK", ek.exprString)
+                    .replace("#ID", String.valueOf(id));
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    static class DiagChecker
+        implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        boolean diagFound;
+        ArrayList<String> diags = new ArrayList<>();
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            diags.add(diagnostic.getMessage(Locale.getDefault()));
+            diagFound = true;
+        }
+
+        String printDiags() {
+            StringBuilder buf = new StringBuilder();
+            for (String s : diags) {
+                buf.append(s);
+                buf.append("\n");
+            }
+            return buf.toString();
+        }
+    }
+
+}
--- a/langtools/test/tools/javac/lib/ToolBox.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/lib/ToolBox.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,6 +38,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
@@ -65,15 +66,32 @@
 
     public static final String lineSeparator = System.getProperty("line.separator");
     public static final String jdkUnderTest = System.getProperty("test.jdk");
-    public static final String testVMOpts = System.getProperty("test.tool.vm.opts");
-    public static final String javaBinary = Paths.get(jdkUnderTest, "bin", "java").toString();
-    //why this one private. Because the function which provide also the test options should be used
-    private static final String javacBinary = Paths.get(jdkUnderTest, "bin", "javac").toString();
+    public static final Path javaBinary = Paths.get(jdkUnderTest, "bin", "java");
+    public static final Path javacBinary = Paths.get(jdkUnderTest, "bin", "javac");
+
+    public static final List<String> testToolVMOpts;
+    public static final List<String> testVMOpts;
 
     private static final Charset defaultCharset = Charset.defaultCharset();
 
     static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
 
+    static {
+        String sysProp = System.getProperty("test.tool.vm.opts");
+        if (sysProp != null && sysProp.length() > 0) {
+            testToolVMOpts = Arrays.asList(sysProp.split("\\s+"));
+        } else {
+            testToolVMOpts = Collections.<String>emptyList();
+        }
+
+        sysProp = System.getProperty("test.vm.opts");
+        if (sysProp != null && sysProp.length() > 0) {
+            testVMOpts = Arrays.asList(sysProp.split("\\s+"));
+        } else {
+            testVMOpts = Collections.<String>emptyList();
+        }
+    }
+
     /**
      * The expected result of command-like method execution.
      */
@@ -199,8 +217,8 @@
         protected Expect whatToExpect;
         protected WriterHelper stdOutput;
         protected WriterHelper errOutput;
-        protected List<String> options;
-        protected String[] optionsArr;
+        protected List<String> args = new ArrayList<>();
+        protected String[] argsArr;
 
         protected GenericArgs() {
             set(Expect.SUCCESS);
@@ -238,19 +256,50 @@
 
         public T setAllArgs(String... args) {
             currentParams.add(AcceptedParams.OPTIONS);
-            this.optionsArr = args;
+            this.argsArr = args;
+            return (T) this;
+        }
+
+
+        public T appendArgs(String... args) {
+            appendArgs(Arrays.asList(args));
+            return (T)this;
+        }
+
+        public T appendArgs(Path... args) {
+            if (args != null) {
+                List<String> list = new ArrayList<>();
+                for (int i = 0; i < args.length; i++) {
+                    if (args[i] != null) {
+                        list.add(args[i].toString());
+                    }
+                }
+                appendArgs(list);
+            }
+            return (T)this;
+        }
+
+        public T appendArgs(List<String> args) {
+            if (args != null && args.size() > 0) {
+                currentParams.add(AcceptedParams.OPTIONS);
+                for (int i = 0; i < args.size(); i++) {
+                    if (args.get(i) != null) {
+                        this.args.add(args.get(i));
+                    }
+                }
+            }
             return (T)this;
         }
 
         public T setOptions(List<String> options) {
             currentParams.add(AcceptedParams.OPTIONS);
-            this.options = options;
+            this.args = options;
             return (T)this;
         }
 
         public T setOptions(String... options) {
             currentParams.add(AcceptedParams.OPTIONS);
-            this.options = Arrays.asList(options);
+            this.args = Arrays.asList(options);
             return (T)this;
         }
 
@@ -365,8 +414,12 @@
      * Custom exception for not equal resources.
      */
     public static class ResourcesNotEqualException extends Exception {
-        public ResourcesNotEqualException() {
-            super("The resources provided for comparison are different");
+        public ResourcesNotEqualException(List<String> res1, List<String> res2) {
+            super(createMessage(res1, res2));
+        }
+
+        public ResourcesNotEqualException(String line1, String line2) {
+            super(createMessage(line1, line2));
         }
 
         public ResourcesNotEqualException(Path path1, Path path2) {
@@ -379,15 +432,20 @@
                     .append(path1.toString()).append(" and \n")
                     .append(path2.toString()).append("are different").toString();
         }
-    }
 
-    /**
-     * Method to get the a path to the javac command available at the jdk being
-     * tested along with the test vm options.
-     * @return a String[] with the two components mentioned.
-     */
-    public static String[] getJavacBin() {
-        return new String[]{javacBinary, testVMOpts};
+        private static String createMessage(String line1, String line2) {
+            return new StringBuilder()
+                    .append("The resources provided for comparison are different at lines: \n")
+                    .append(line1).append(" and \n")
+                    .append(line2).toString();
+        }
+
+        private static String createMessage(List<String> res1, List<String> res2) {
+            return new StringBuilder()
+                    .append("The resources provided for comparison are different: \n")
+                    .append("Resource 1 is: ").append(res1).append("\n and \n")
+                    .append("Resource 2 is: ").append(res2).append("\n").toString();
+        }
     }
 
     /**
@@ -396,7 +454,7 @@
     public static int javac(JavaToolArgs params)
             throws CommandExecutionException, IOException {
         if (params.hasMinParams()) {
-            if (params.optionsArr != null) {
+            if (params.argsArr != null) {
                 return genericJavaCMD(JavaCMD.JAVAC, params);
             } else {
                 return genericJavaCMD(JavaCMD.JAVAC_API, params);
@@ -437,14 +495,14 @@
         JAVAC {
             @Override
             int run(JavaToolArgs params, PrintWriter pw) {
-                return com.sun.tools.javac.Main.compile(params.optionsArr, pw);
+                return com.sun.tools.javac.Main.compile(params.argsArr, pw);
             }
         },
         JAVAC_API {
             @Override
             int run(JavaToolArgs params, PrintWriter pw) {
                 JavacTask ct = (JavacTask)comp.getTask(pw, null, null,
-                        params.options, null, params.sources);
+                        params.args, null, params.sources);
                 return ((JavacTaskImpl)ct).doCall().exitCode;
             }
 
@@ -467,13 +525,13 @@
         JAVAH {
             @Override
             int run(JavaToolArgs params, PrintWriter pw) {
-                return com.sun.tools.javah.Main.run(params.optionsArr, pw);
+                return com.sun.tools.javah.Main.run(params.argsArr, pw);
             }
         },
         JAVAP {
             @Override
             int run(JavaToolArgs params, PrintWriter pw) {
-                return com.sun.tools.javap.Main.run(params.optionsArr, pw);
+                return com.sun.tools.javap.Main.run(params.argsArr, pw);
             }
         };
 
@@ -486,9 +544,9 @@
         List<String> getExceptionMsgContent(JavaToolArgs params) {
             List<String> result = new ArrayList<>();
             result.add(getName());
-            result.addAll(params.optionsArr != null ?
-                    Arrays.asList(params.optionsArr) :
-                    params.options);
+            result.addAll(params.argsArr != null ?
+                    Arrays.asList(params.argsArr) :
+                    params.args);
             return result;
         }
     }
@@ -509,7 +567,7 @@
         String out = (sw == null) ? null : sw.toString();
 
         if (params.errOutput != null && (out != null) && !out.isEmpty()) {
-            params.errOutput.addAll(splitLines(out));
+            params.errOutput.addAll(splitLines(out, lineSeparator));
         }
 
         if ( (rc == 0 && params.whatToExpect == Expect.SUCCESS) ||
@@ -542,9 +600,9 @@
     public static int executeCommand(AnyToolArgs params)
             throws CommandExecutionException, IOException, InterruptedException {
         if (params.hasMinParams()) {
-            List<String> cmd = (params.options != null) ?
-                    params.options :
-                    Arrays.asList(params.optionsArr);
+            List<String> cmd = (params.args != null) ?
+                    params.args :
+                    Arrays.asList(params.argsArr);
             return executeCommand(cmd, params.extraEnv, params.stdOutput,
                     params.errOutput, params.whatToExpect);
         }
@@ -630,7 +688,7 @@
             List<String> list2, boolean trim) throws ResourcesNotEqualException {
         if ((list1 == list2) || (list1 == null && list2 == null)) return;
         if (list1.size() != list2.size())
-            throw new ResourcesNotEqualException();
+            throw new ResourcesNotEqualException(list1, list2);
         int i = 0;
         int j = 0;
         while (i < list1.size() &&
@@ -639,7 +697,7 @@
             i++; j++;
         }
         if (!(i == list1.size() && j == list2.size()))
-            throw new ResourcesNotEqualException();
+            throw new ResourcesNotEqualException(list1, list2);
     }
 
     private static boolean equals(String s1, String s2, boolean trim) {
@@ -652,8 +710,8 @@
      * and later the regExpr is seek in every split line. If a match is found,
      * the whole line is added to the result.
      */
-    public static List<String> grep(String regExpr, String text) {
-        return grep(regExpr, splitLines(text));
+    public static List<String> grep(String regExpr, String text, String sep) {
+        return grep(regExpr, splitLines(text, sep));
     }
 
     public static List<String> grep(String regExpr, List<String> text) {
@@ -865,8 +923,8 @@
     /**
      * Splits a String using the System's line separator character as splitting point.
      */
-    public static List<String> splitLines(String lines) {
-        return Arrays.asList(lines.split(lineSeparator));
+    public static List<String> splitLines(String lines, String sep) {
+        return Arrays.asList(lines.split(sep));
     }
 
     /**
@@ -882,6 +940,14 @@
     }
 
     /**
+     * Returns true if the OS is a Windows version.
+     */
+    public static boolean isWindows() {
+        String osName = System.getProperty("os.name");
+        return osName.toUpperCase().startsWith("WINDOWS");
+    }
+
+    /**
      * Class representing an in-memory java source file. It is able to extract
      * the file name from simple source codes using regular expressions.
      */
--- a/langtools/test/tools/javac/links/LinksTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/links/LinksTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -50,14 +50,17 @@
 //      cp ${TESTSRC}/b/B.java tmp
         ToolBox.writeFile(Paths.get("tmp", "B.java"), BSrc);
 
+        try {
 //        ln -s `pwd`/tmp "${TESTCLASSES}/a"
-        Files.createSymbolicLink(Paths.get("a"), Paths.get("tmp"));
-//
-////"${TESTJAVA}/bin/javac" ${TESTTOOLVMOPTS} -sourcepath "${TESTCLASSES}" -d "${TESTCLASSES}/classes" "${TESTSRC}/T.java" 2>&1
-        ToolBox.JavaToolArgs javacArgs =
-                new ToolBox.JavaToolArgs()
-                .setOptions("-sourcepath", ".", "-d", ".").setSources(TSrc);
-        ToolBox.javac(javacArgs);
+            Files.createSymbolicLink(Paths.get("a"), Paths.get("tmp"));
+            ////"${TESTJAVA}/bin/javac" ${TESTTOOLVMOPTS} -sourcepath "${TESTCLASSES}" -d "${TESTCLASSES}/classes" "${TESTSRC}/T.java" 2>&1
+            ToolBox.JavaToolArgs javacArgs =
+                    new ToolBox.JavaToolArgs()
+                    .setOptions("-sourcepath", ".", "-d", ".").setSources(TSrc);
+            ToolBox.javac(javacArgs);
+        } catch (UnsupportedOperationException e) {
+            System.err.println("Symbolic links not supported on this system. The test can't finish");
+        }
     }
 
 }
--- a/langtools/test/tools/javac/newlines/NewLineTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/newlines/NewLineTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -34,19 +34,18 @@
 import java.nio.charset.Charset;
 import java.nio.file.Files;
 import java.util.List;
-import com.sun.tools.javac.util.ArrayUtils;
 
 //original test: test/tools/javac/newlines/Newlines.sh
 public class NewLineTest {
 
     public static void main(String args[]) throws Exception {
-        String[] mainArgs = ToolBox.getJavacBin();
-
 //        "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -J-Dline.separator='@' > ${TMP1} 2>&1
         File javacErrOutput = new File("output.txt");
         ToolBox.AnyToolArgs cmdArgs =
                 new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
-                .setAllArgs(ArrayUtils.concatOpen(mainArgs, "-J-Dline.separator='@'"))
+                .appendArgs(ToolBox.javacBinary)
+                .appendArgs(ToolBox.testToolVMOpts)
+                .appendArgs("-J-Dline.separator='@'")
                 .setErrOutput(javacErrOutput);
         ToolBox.executeCommand(cmdArgs);
 
--- a/langtools/test/tools/javac/profiles/ProfileOptionTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javac/profiles/ProfileOptionTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -106,7 +106,6 @@
         for (Target t: Target.values()) {
             switch (t) {
                 case JDK1_1: case JDK1_2: // no equivalent -source
-                case JDK1_4_1: case JDK1_4_2: case JSR14: // transitional values
                     continue;
             }
 
--- a/langtools/test/tools/javah/6257087/T6257087.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javah/6257087/T6257087.java	Fri Apr 05 14:51:24 2013 -0700
@@ -32,7 +32,6 @@
 
 import java.nio.file.Paths;
 
-//original test: test/tools/javah/6257087/foo.sh
 public class T6257087 {
 
     private static final String fooBarGoldenFile =
@@ -59,17 +58,13 @@
         "#endif";
 
     public static void main(String[] args) throws Exception {
-//        "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TC}" "${TS}${FS}foo.java"
-
-//        "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} -classpath "${TC}" -d "${TC}" foo
         ToolBox.JavaToolArgs javahArgs =
                 new ToolBox.JavaToolArgs()
                 .setAllArgs("-cp", System.getProperty("test.classes"), "foo");
         ToolBox.javah(javahArgs);
 
-//        diff ${DIFFOPTS} -c "${TS}${FS}foo_bar.h" "${TC}${FS}foo_bar.h"
         ToolBox.compareLines(Paths.get("foo_bar.h"),
-                ToolBox.splitLines(fooBarGoldenFile), null);
+                ToolBox.splitLines(fooBarGoldenFile, "\n"), null, true);
     }
 
 }
--- a/langtools/test/tools/javah/constMacroTest/ConstMacroTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javah/constMacroTest/ConstMacroTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,7 +38,7 @@
 //original test: test/tools/javah/ConstMacroTest.sh
 public class ConstMacroTest {
 
-    private static final String SubClassConstsGoldenFile =
+    private static final String subClassConstsGoldenFileTemplate =
         "/* DO NOT EDIT THIS FILE - it is machine generated */\n" +
         "#include <jni.h>\n" +
         "/* Header for class SubClassConsts */\n" +
@@ -49,7 +49,7 @@
         "extern \"C\" {\n" +
         "#endif\n" +
         "#undef SubClassConsts_serialVersionUID\n" +
-        "#define SubClassConsts_serialVersionUID 6733861379283244755LL\n" +
+        "#define SubClassConsts_serialVersionUID 6733861379283244755%s\n" +
         "#undef SubClassConsts_SUPER_INT_CONSTANT\n" +
         "#define SubClassConsts_SUPER_INT_CONSTANT 3L\n" +
         "#undef SubClassConsts_SUPER_FLOAT_CONSTANT\n" +
@@ -71,6 +71,9 @@
         "#endif\n" +
         "#endif";
 
+    private static final String serialVersionUIDSuffix =
+            ToolBox.isWindows() ? "i64" : "LL"; ;
+
     public static void main(String[] args) throws Exception {
         //first steps are now done by jtreg
 //        cp "${TESTSRC}${FS}SuperClassConsts.java" .
@@ -85,8 +88,10 @@
         ToolBox.javah(successParams);
 
 //        diff ${DIFFOPTS} "${TESTSRC}${FS}${EXPECTED_JAVAH_OUT_FILE}" "${GENERATED_HEADER_FILE}"
+        String subClassConstGoldenFile = String.format(subClassConstsGoldenFileTemplate,
+                serialVersionUIDSuffix);
         ToolBox.compareLines(Paths.get("SubClassConsts.h"),
-                ToolBox.splitLines(SubClassConstsGoldenFile), null);
+                ToolBox.splitLines(subClassConstGoldenFile, "\n"), null, true);
     }
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javap/output/RepeatingTypeAnnotations.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,400 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8005220
+ * @summary javap must display repeating annotations
+ */
+import java.io.*;
+import java.util.*;
+
+/**
+ * This class extends the abstract {@link Tester} test-driver, and
+ * encapusulates a number of test-case classes (i.e. classes extending
+ * this class and annotated with {@code TestCase}).
+ * <p>
+ * By default (no argument), this test runs all test-cases, except
+ * if annotated with {@code ignore}.
+ * <p>
+ * Individual test cases can be executed using a run action.
+ * <p>
+ * Example: @run main RepeatingTypeAnnotations RepeatingTypeAnnotations$TC4
+ * <p>
+ * Note: when specific test-cases are run, additional debug output is
+ * produced to help debugging. Test annotated with {@code ignore}
+ * can be executed explicitly.
+ */
+public class RepeatingTypeAnnotations extends Tester {
+
+    /**
+     * Main method instantiates test and run test-cases.
+     */
+    public static void main(String... args) throws Exception {
+        Tester tester = new RepeatingTypeAnnotations();
+        tester.run(args);
+    }
+
+    /**
+     * Testcases are classes extending {@code RepeatingTypeAnnotations},
+     * and calling {@link setSrc}, followed by one or more invocations
+     * of {@link verify} in the body of the constructor.
+     */
+    public RepeatingTypeAnnotations() {
+        setSrc(new TestSource(template));
+    }
+
+    /**
+     * Common template for test cases. The line TESTCASE is
+     * replaced with the specific lines of individual tests.
+     */
+    private static final String[] template = {
+        "import java.lang.annotation.*;",
+        "class Test {",
+        "    @Repeatable(As.class)",
+        "    @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})",
+        "    @Retention(RetentionPolicy.CLASS)",
+        "    @interface A {",
+        "        Class f() default int.class;",
+        "    }",
+
+        "    @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})",
+        "    @Retention(RetentionPolicy.CLASS)",
+        "    @interface As { A[] value(); }",
+
+        "    @Repeatable(Bs.class)",
+        "    @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})",
+        "    @Retention(RetentionPolicy.CLASS)",
+        "    @interface B {",
+        "        Class f() default int.class;",
+        "    }",
+
+        "    @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})",
+        "    @Retention(RetentionPolicy.CLASS)",
+        "    @interface Bs { B[] value(); }",
+
+        "    @Repeatable(Cs.class)",
+        "    @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})",
+        "    @Retention(RetentionPolicy.RUNTIME)",
+        "    @interface C {",
+        "        Class f() default int.class;",
+        "    }",
+
+        "    @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})",
+        "    @Retention(RetentionPolicy.RUNTIME)",
+        "    @interface Cs { C[] value(); }",
+        "TESTCASE",
+        "}"
+    };
+
+    /*
+     * The test cases covers annotation in the following locations:
+     * - static and non-static fields
+     * - local variables
+     * - constructor and method return type and parameter types
+     * - casts in class and method contexts.
+     * For the above locations the test-cases covers:
+     * - single annotation type
+     * - two annotation types with same retention
+     * - two annotation types with different retention
+     * - three annotation types, two of same retention, one different.
+     */
+
+    @TestCase
+    @ignore // 8008082:missing type annotation for cast
+    public static class TC1 extends RepeatingTypeAnnotations {
+        public TC1() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public @A @A @A Object o = (@A @A @A String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #25(#26=[@#27(),@#27(),@#27()]): FIELD",
+                   "1: #25(#26=[@#27(),@#27(),@#27()]): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    public static class TC2 extends RepeatingTypeAnnotations {
+        public TC2() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public @A @B @A Object o = (@B @A @B String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #25(#26=[@#27(),@#27()]): FIELD",
+                   "1: #28(): FIELD",
+                   "2: #29(#26=[@#28(),@#28()]): CAST, offset=5",
+                   "3: #27(): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    public static class TC3 extends RepeatingTypeAnnotations {
+        public TC3() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public @A @A @C Object o = (@B @C @B String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #25(): FIELD",
+                   "1: #25(): CAST, offset=5",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #27(#28=[@#29(),@#29()]): FIELD",
+                   "1: #30(#28=[@#31(),@#31()]): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    public static class TC4 extends RepeatingTypeAnnotations {
+        public TC4() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public @A @B @C Object o = (@C @B @A String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #25(): FIELD",
+                   "1: #25(): CAST, offset=5",
+                   "0: #27(): FIELD",
+                   "1: #28(): FIELD",
+                   "2: #28(): CAST, offset=5",
+                   "3: #27(): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    @ignore // 8008082:missing type annotation for cast
+    public static class TC5 extends RepeatingTypeAnnotations {
+        public TC5() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public static @A @A @A Object o = (@B @B @B String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #25(#26=[@#27(),@#27(),@#27()]): FIELD",
+                   "1: #28(#26=[@#29(),@#29(),@#29()]): CAST, offset=5, type_index=0");
+        }
+    }
+
+    @TestCase
+    public static class TC6 extends RepeatingTypeAnnotations {
+        public TC6() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public static @A @B @A Object o = (@B @A @B String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #25(#26=[@#27(),@#27()]): FIELD",
+                   "1: #28(): FIELD",
+                   "2: #29(#26=[@#28(),@#28()]): CAST, offset=5",
+                   "3: #27(): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    public static class TC7 extends RepeatingTypeAnnotations {
+        public TC7() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public static @A @A @C Object o = (@B @C @B String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #25(): FIELD",
+                   "1: #25(): CAST, offset=5",
+                   "0: #27(#28=[@#29(),@#29()]): FIELD",
+                   "1: #30(#28=[@#31(),@#31()]): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    public static class TC8 extends RepeatingTypeAnnotations {
+        public TC8() {
+            setSrc("    static String so = \"hello world\";",
+                   "    public static @A @B @C Object o = (@C @B @A String) Test.so;");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #25(): FIELD",
+                   "1: #25(): CAST, offset=5",
+                   "0: #27(): FIELD",
+                   "1: #28(): FIELD",
+                   "2: #28(): CAST, offset=5",
+                   "3: #27(): CAST, offset=5");
+        }
+    }
+
+    @TestCase
+    @ignore // 8008082:missing type annotation for cast
+    public static class TC9 extends RepeatingTypeAnnotations {
+        public TC9() {
+            setSrc("    public Test(@A @A @A Object o, @A int i, long l) {",
+                   "        @A @A @A String ls = (@B @B @B String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #34(#35=[@#36(),@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #37(#35=[@#38(),@#38(),@#38()]): CAST, offset=4, type_index=0",
+                   "3: #34(#35=[@#36(),@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}");
+        }
+    }
+
+    @TestCase
+    public static class TC10 extends RepeatingTypeAnnotations {
+        public TC10() {
+            setSrc("    public Test(@A @A @B Object o, @A @B int i, long l) {",
+                   "        @A @A @B String ls = (@B @A @B String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations:",
+                   "0: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #37(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "3: #37(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "4: #38(#35=[@#37(),@#37()]): CAST, offset=4, type_index=0",
+                   "5: #36(): CAST, offset=4, type_index=0",
+                   "6: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "7: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}");
+        }
+    }
+
+    @TestCase
+    public static class TC11 extends RepeatingTypeAnnotations {
+        public TC11() {
+            setSrc("    public Test(@C @C @A Object o, @A @B int i, long l) {",
+                   "        @C @C @A String ls = (@A @A @C String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #36(): CAST, offset=4",
+                   "2: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "0: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "3: #40(#35=[@#38(),@#38()]): CAST, offset=4",
+                   "4: #38(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}");
+        }
+    }
+
+    @TestCase
+    public static class TC12 extends RepeatingTypeAnnotations {
+        public TC12() {
+            setSrc("    public Test(@A @B @C Object o, @A @C int i, long l) {",
+                   "        @A @B @C String ls = (@C @A @B String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #34(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #34(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #34(): CAST, offset=4",
+                   "3: #34(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "0: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #37(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "3: #36(): CAST, offset=4",
+                   "4: #37(): CAST, offset=4",
+                   "5: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "6: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}");
+        }
+    }
+
+    @TestCase
+    @ignore // 8008082:missing type annotation for cast
+    public static class TC13 extends RepeatingTypeAnnotations {
+        public TC13() {
+            setSrc("    public @A @A @A String foo(@A @A @A Object o, @A int i, long l) {",
+                   "        @A @A @A String ls = (@B @B @B String) o;",
+                   "        return (@A @A @A String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "0: #36(#37=[@#38(),@#38(),@#38()]): METHOD_RETURN",
+                   "1: #36(#37=[@#38(),@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "2: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "3: #39(#37=[@#40(),@#40(),@#40()]): CAST, offset=0, type_index=0",
+                   "4: #36(#37=[@#38(),@#38(),@#38()]): CAST, offset=6, type_index=0",
+                   "5: #36(#37=[@#38(),@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}");
+        }
+    }
+
+    @TestCase
+    public static class TC14 extends RepeatingTypeAnnotations {
+        public TC14() {
+            setSrc("    public @A @B @B String foo(@A @A @B Object o, @A @B int i, long l) {",
+                   "        @A @A @B String ls = (@B @A @B String) o;",
+                   "        return (@A @B @B String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                    "0: #36(): METHOD_RETURN",
+                    "1: #37(#38=[@#39(),@#39()]): METHOD_RETURN",
+                    "2: #40(#38=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                    "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
+                    "4: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                    "5: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
+                    "6: #37(#38=[@#39(),@#39()]): CAST, offset=0",
+                    "7: #36(): CAST, offset=0",
+                    "8: #36(): CAST, offset=6",
+                    "9: #37(#38=[@#39(),@#39()]): CAST, offset=6",
+                    "10: #40(#38=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                    "11: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}");
+        }
+    }
+
+    @TestCase
+    public static class TC15 extends RepeatingTypeAnnotations {
+        public TC15() {
+            setSrc("    public @A @A @C String foo(@C @C @A Object o, @A @B int i, long l) {",
+                   "        @C @C @A String ls = (@A @A @C String) o;",
+                   "        return (@C @B @B String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                    "RuntimeVisibleTypeAnnotations",
+                    "0: #36(): METHOD_RETURN",
+                    "1: #37(#38=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                    "2: #36(): CAST, offset=0",
+                    "3: #36(): CAST, offset=6",
+                    "4: #37(#38=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                    "0: #40(#38=[@#41(),@#41()]): METHOD_RETURN",
+                    "1: #41(): METHOD_FORMAL_PARAMETER, param_index=0",
+                    "2: #41(): METHOD_FORMAL_PARAMETER, param_index=1",
+                    "3: #42(): METHOD_FORMAL_PARAMETER, param_index=1",
+                    "4: #40(#38=[@#41(),@#41()]): CAST, offset=0",
+                    "5: #43(#38=[@#42(),@#42()]): CAST, offset=6",
+                    "6: #41(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}");
+        }
+    }
+
+    @TestCase
+    public static class TC16 extends RepeatingTypeAnnotations {
+        public TC16() {
+            setSrc("    public @A @B @C String foo(@A @B @C Object o, @A @C int i, long l) {",
+                   "        @A @B @C String ls = (@C @A @B String) o;",
+                   "        return (@B @A @C String) o;",
+                   "    }");
+            verify("RuntimeInvisibleTypeAnnotations",
+                   "RuntimeVisibleTypeAnnotations",
+                   "0: #36(): METHOD_RETURN",
+                   "1: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "3: #36(): CAST, offset=0",
+                   "4: #36(): CAST, offset=6",
+                   "5: #36(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "0: #38(): METHOD_RETURN",
+                   "1: #39(): METHOD_RETURN",
+                   "2: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "4: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "5: #38(): CAST, offset=0",
+                   "6: #39(): CAST, offset=0",
+                   "7: #39(): CAST, offset=6",
+                   "8: #38(): CAST, offset=6",
+                   "9: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "10: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javap/output/Tester.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,389 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * {@code Tester} is an abstract test-driver that provides the logic
+ * to execute test-cases, grouped by test classes.
+ * A test class is a main class extending this class, that instantiate
+ * itself, and calls the {@link run} method, passing any command line
+ * arguments.
+ * <p>
+ * The {@code run} method, expects arguments to identify test-case classes.
+ * A test-case class is a class extending the test class, and annotated
+ * with {@code TestCase}.
+ * <p>
+ * If no test-cases are specified, the test class directory is searched for
+ * co-located test-case classes (i.e. any class extending the test class,
+ * annotated with  {@code TestCase}).
+ * <p>
+ * Besides serving to group test-cases, extending the driver allow
+ * setting up a test-case template, and possibly overwrite default
+ * test-driver behaviour.
+ */
+public abstract class Tester {
+
+    private static boolean debug = false;
+    private static final PrintStream out = System.err;
+    private static final PrintStream err = System.err;
+
+
+    protected void run(String... args) throws Exception {
+
+        final File classesdir = new File(System.getProperty("test.classes", "."));
+
+        String[] classNames = args;
+
+        // If no test-cases are specified, we regard all co-located classes
+        // as potential test-cases.
+        if (args.length == 0) {
+            final String pattern =  ".*\\.class";
+            final File classFiles[] = classesdir.listFiles(new FileFilter() {
+                    public boolean accept(File f) {
+                        return f.getName().matches(pattern);
+                    }
+                });
+            ArrayList<String> names = new ArrayList<String>(classFiles.length);
+            for (File f : classFiles) {
+                String fname = f.getName();
+                names.add(fname.substring(0, fname.length() -6));
+            }
+            classNames = names.toArray(new String[names.size()]);
+        } else {
+            debug = true;
+        }
+        // Test-cases must extend the driver type, and be marked
+        // @TestCase. Other arguments (classes) are ignored.
+        // Test-cases are instantiated, and thereby executed.
+        for (String clname : classNames) {
+            try {
+                final Class tclass = Class.forName(clname);
+                if  (!getClass().isAssignableFrom(tclass)) continue;
+                TestCase anno = (TestCase) tclass.getAnnotation(TestCase.class);
+                if (anno == null) continue;
+                if (!debug) {
+                    ignore i = (ignore) tclass.getAnnotation(ignore.class);
+                    if (i != null) {
+                        out.println("Ignore: " + clname);
+                        ignored++;
+                        continue;
+                    }
+                }
+                out.println("TestCase: " + clname);
+                cases++;
+                Tester tc = (Tester) tclass.getConstructor().newInstance();
+                if (tc.errors > 0) {
+                    error("" + tc.errors + " test points failed in " + clname);
+                    errors += tc.errors - 1;
+                    fcases++;
+                }
+            } catch(ReflectiveOperationException roe) {
+                error("Warning: " + clname + " - ReflectiveOperationException");
+                roe.printStackTrace(err);
+            } catch(Exception unknown) {
+                error("Warning: " + clname + " - uncaught exception");
+                unknown.printStackTrace(err);
+            }
+        }
+
+        String imsg = ignored > 0 ? " (" +  ignored + " ignored)" : "";
+        if (errors > 0)
+            throw new Error(errors + " error, in " + fcases + " of " + cases + " test-cases" + imsg);
+        else
+            err.println("" + cases + " test-cases executed" + imsg + ", no errors");
+    }
+
+
+    /**
+     * Test-cases must be marked with the {@code TestCase} annotation,
+     * as well as extend {@code Tester} (or an driver extension
+     * specified as the first argument to the {@code main()} method.
+     */
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface TestCase { }
+
+    /**
+     * Individual test-cases failing due to product bugs, may temporarily
+     * be excluded by marking them like  this:
+     * @ignore // 1234567:bug synopsis
+     */
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface ignore { }
+
+    /**
+     * Test-cases are classes extending {@code Tester}, and
+     * calling {@link setSrc}, followed by one or more invocations
+     * of {@link verify} in the body of the constructor.
+     * <p>
+     * Sets a default test-case template, which is empty except
+     * for a key of {@code "TESTCASE"}.
+     * Subclasses will typically call {@code setSrc(TestSource)}
+     * to setup a useful test-case template.
+     */
+    public Tester() {
+        this.testCase = this.getClass().getName();
+        src = new TestSource("TESTCASE");
+    }
+
+    /**
+     * Set the top-level source template.
+     */
+    protected Tester setSrc(TestSource src) {
+        this.src = src;
+        return this;
+    }
+
+    /**
+     * Convenience method for calling {@code innerSrc("TESTCASE", ...)}.
+     */
+    protected Tester setSrc(String... lines) {
+        return innerSrc("TESTCASE", lines);
+    }
+
+    /**
+     * Convenience method for calling {@code innerSrc(key, new TestSource(...))}.
+     */
+    protected Tester innerSrc(String key, String... lines) {
+        return innerSrc(key, new TestSource(lines));
+    }
+
+    /**
+     * Specialize the testcase template, setting replacement content
+     * for the specified key.
+     */
+    protected Tester innerSrc(String key, TestSource content) {
+        if (src == null) {
+            src = new TestSource(key);
+        }
+        src.setInner(key, content);
+        return this;
+    }
+
+    /**
+     * On the first invocation, call {@code execute()} to compile
+     * the test-case source and process the resulting class(se)
+     * into verifiable output.
+     * <p>
+     * Verify that the output matches each of the regular expressions
+     * given as argument.
+     * <p>
+     * Any failure to match constitutes a test failure, but doesn't
+     * abort the test-case.
+     * <p>
+     * Any exception (e.g. bad regular expression syntax) results in
+     * a test failure, and aborts the test-case.
+     */
+    protected void verify(String... expect) {
+        if (!didExecute) {
+            try {
+                execute();
+            } catch(Exception ue) {
+                throw new Error(ue);
+            } finally {
+                didExecute = true;
+            }
+        }
+        if (output == null) {
+            error("output is null");
+            return;
+        }
+        for (String e: expect) {
+            // Escape regular expressions (to allow input to be literals).
+            // Notice, characters to be escaped are themselves identified
+            // using regular expressions
+            String rc[] = { "(", ")", "[", "]", "{", "}", "$" };
+            for (String c : rc) {
+                e = e.replace(c, "\\" + c);
+            }
+            // DEBUG: Uncomment this to test modulo constant pool index.
+            // e = e.replaceAll("#[0-9]{2}", "#[0-9]{2}");
+            if (!output.matches("(?s).*" + e + ".*")) {
+                if (!didPrint) {
+                    out.println(output);
+                    didPrint = true;
+                }
+                error("not matched: '" + e + "'");
+            } else if(debug) {
+                out.println("matched: '" + e + "'");
+            }
+        }
+    }
+
+    /**
+     * Calls {@code writeTestFile()} to write out the test-case source
+     * content to a file, then call {@code compileTestFile()} to
+     * compile it, and finally run the {@link process} method to produce
+     * verifiable output. The default {@code process} method runs javap.
+     * <p>
+     * If an exception occurs, it results in a test failure, and
+     * aborts the test-case.
+     */
+    protected void execute() throws IOException {
+        err.println("TestCase: " + testCase);
+        writeTestFile();
+        compileTestFile();
+        process();
+    }
+
+    /**
+     * Generate java source from test-case.
+     * TBD: change to use javaFileObject, possibly make
+     * this class extend JavaFileObject.
+     */
+    protected void writeTestFile() throws IOException {
+        javaFile = new File("Test.java");
+        FileWriter fw = new FileWriter(javaFile);
+        BufferedWriter bw = new BufferedWriter(fw);
+        PrintWriter pw = new PrintWriter(bw);
+        for (String line : src) {
+            pw.println(line);
+            if (debug) out.println(line);
+        }
+        pw.close();
+    }
+
+    /**
+     * Compile the Java source code.
+     */
+    protected void compileTestFile() {
+        String path = javaFile.getPath();
+        String params[] =  { "-source", "1.8", "-g", path };
+        int rc = com.sun.tools.javac.Main.compile(params);
+        if (rc != 0)
+            throw new Error("compilation failed. rc=" + rc);
+        classFile = new File(path.substring(0, path.length() - 5) + ".class");
+    }
+
+
+    /**
+     * Process class file to generate output for verification.
+     * The default implementation simply runs javap. This might be
+     * overwritten to generate output in a different manner.
+     */
+    protected void process() {
+        String testClasses = "."; //System.getProperty("test.classes", ".");
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        String[] args = { "-v", "-classpath", testClasses, "Test" };
+        int rc = com.sun.tools.javap.Main.run(args, pw);
+        if (rc != 0)
+            throw new Error("javap failed. rc=" + rc);
+        pw.close();
+        output = sw.toString();
+        if (debug) {
+            out.println(output);
+            didPrint = true;
+        }
+
+    }
+
+
+    private String testCase;
+    private TestSource src;
+    private File javaFile = null;
+    private File classFile = null;
+    private String output = null;
+    private boolean didExecute = false;
+    private boolean didPrint = false;
+
+
+    protected void error(String msg) {
+        err.println("Error: " + msg);
+        errors++;
+    }
+
+    private int cases;
+    private int fcases;
+    private int errors;
+    private int ignored;
+
+    /**
+     * The TestSource class provides a simple container for
+     * test cases. It contains an array of source code lines,
+     * where zero or more lines may be markers for nested lines.
+     * This allows representing templates, with specialization.
+     * <P>
+     * This may be generalized to support more advance combo
+     * tests, but presently it's only used with a static template,
+     * and one level of specialization.
+     */
+    public class TestSource implements Iterable<String> {
+
+        private String[] lines;
+        private Hashtable<String, TestSource> innerSrc;
+
+        public TestSource(String... lines) {
+            this.lines = lines;
+            innerSrc = new Hashtable<String, TestSource>();
+        }
+
+        public void setInner(String key, TestSource inner) {
+            innerSrc.put(key, inner);
+        }
+
+        public void setInner(String key, String... lines) {
+            innerSrc.put(key, new TestSource(lines));
+        }
+
+        public Iterator<String> iterator() {
+            return new LineIterator();
+        }
+
+        private class LineIterator implements Iterator<String> {
+
+            int nextLine = 0;
+            Iterator<String> innerIt = null;
+
+            public  boolean hasNext() {
+                return nextLine < lines.length;
+            }
+
+            public String next() {
+                if (!hasNext()) throw new NoSuchElementException();
+                String str = lines[nextLine];
+                TestSource inner = innerSrc.get(str);
+                if (inner == null) {
+                    nextLine++;
+                    return str;
+                }
+                if (innerIt == null) {
+                    innerIt = inner.iterator();
+                }
+                if (innerIt.hasNext()) {
+                    return innerIt.next();
+                }
+                innerIt = null;
+                nextLine++;
+                return next();
+            }
+
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        }
+    }
+}
--- a/langtools/test/tools/javap/stackmap/StackmapTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/javap/stackmap/StackmapTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -84,10 +84,11 @@
                 new ToolBox.JavaToolArgs()
                 .setAllArgs("-v", "Test.class");
         String out = ToolBox.javap(javapParams);
-        List<String> grepResult = ToolBox.grep("frame_type", out);
-        grepResult.addAll(ToolBox.grep("offset_delta", out));
-        grepResult.addAll(ToolBox.grep("stack = ", out));
-        grepResult.addAll(ToolBox.grep("locals = ", out));
+        List<String> grepResult = ToolBox.grep("frame_type", out,
+                ToolBox.lineSeparator);
+        grepResult.addAll(ToolBox.grep("offset_delta", out, ToolBox.lineSeparator));
+        grepResult.addAll(ToolBox.grep("stack = ", out, ToolBox.lineSeparator));
+        grepResult.addAll(ToolBox.grep("locals = ", out, ToolBox.lineSeparator));
         List<String> goldenList = Arrays.asList(goldenOut.split("\n"));
 
 //        diff -w "${OUTFILE}" "${TESTSRC}${FS}T6271292.out"
--- a/langtools/test/tools/jdeps/Basic.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/jdeps/Basic.java	Fri Apr 05 14:51:24 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8003562
+ * @bug 8003562 8005428
  * @summary Basic tests for jdeps tool
  * @build Test p.Foo
  * @run main Basic
@@ -33,13 +33,35 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.*;
 import java.util.regex.*;
 
 public class Basic {
+    private static boolean symbolFileExist = initProfiles();
+    private static boolean initProfiles() {
+        // check if ct.sym exists; if not use the profiles.properties file
+        Path home = Paths.get(System.getProperty("java.home"));
+        if (home.endsWith("jre")) {
+            home = home.getParent();
+        }
+        Path ctsym = home.resolve("lib").resolve("ct.sym");
+        boolean symbolExists = ctsym.toFile().exists();
+        if (!symbolExists) {
+            Path testSrcProfiles =
+                Paths.get(System.getProperty("test.src", "."), "profiles.properties");
+            if (!testSrcProfiles.toFile().exists())
+                throw new Error(testSrcProfiles + " does not exist");
+            System.out.format("%s doesn't exist.%nUse %s to initialize profiles info%n",
+                ctsym, testSrcProfiles);
+            System.setProperty("jdeps.profiles", testSrcProfiles.toString());
+        }
+        return symbolExists;
+    }
+
     public static void main(String... args) throws Exception {
         int errors = 0;
-
         errors += new Basic().run();
         if (errors > 0)
             throw new Exception(errors + " errors found");
@@ -49,54 +71,70 @@
         File testDir = new File(System.getProperty("test.classes", "."));
         // test a .class file
         test(new File(testDir, "Test.class"),
-             new String[] {"java.lang", "p"});
+             new String[] {"java.lang", "p"},
+             new String[] {"compact1", "not found"});
         // test a directory
         test(new File(testDir, "p"),
-             new String[] {"java.lang", "java.util"});
+             new String[] {"java.lang", "java.util", "java.lang.management"},
+             new String[] {"compact1", "compact1", "compact3"});
         // test class-level dependency output
         test(new File(testDir, "Test.class"),
              new String[] {"java.lang.Object", "p.Foo"},
+             new String[] {"compact1", "not found"},
              new String[] {"-V", "class"});
         // test -p option
         test(new File(testDir, "Test.class"),
              new String[] {"p.Foo"},
+             new String[] {"not found"},
              new String[] {"--verbose-level=class", "-p", "p"});
         // test -e option
         test(new File(testDir, "Test.class"),
              new String[] {"p.Foo"},
+             new String[] {"not found"},
              new String[] {"-V", "class", "-e", "p\\..*"});
         test(new File(testDir, "Test.class"),
              new String[] {"java.lang"},
+             new String[] {"compact1"},
              new String[] {"-V", "package", "-e", "java\\.lang\\..*"});
         // test -classpath and wildcard options
         test(null,
              new String[] {"com.sun.tools.jdeps", "java.lang", "java.util",
-                           "java.util.regex", "java.io"},
+                           "java.util.regex", "java.io", "java.nio.file",
+                           "java.lang.management"},
+             new String[] {(symbolFileExist? "not found" : "JDK internal API (classes)"),
+                           "compact1", "compact1", "compact1",
+                           "compact1", "compact1", "compact3"},
              new String[] {"--classpath", testDir.getPath(), "*"});
-        // -v shows intra-dependency
-        test(new File(testDir, "Test.class"),
-             new String[] {"java.lang.Object", "p.Foo"},
-             new String[] {"-v", "--classpath", testDir.getPath(), "Test.class"});
+        /* Temporary disable this test case.  Test.class has a dependency
+         * on java.lang.String on certain windows machine (8008479).
+         // -v shows intra-dependency
+         test(new File(testDir, "Test.class"),
+              new String[] {"java.lang.Object", "p.Foo"},
+              new String[] {"compact1", testDir.getName()},
+              new String[] {"-v", "--classpath", testDir.getPath(), "Test.class"});
+        */
         return errors;
     }
 
-    void test(File file, String[] expect) {
-        test(file, expect, new String[0]);
+    void test(File file, String[] expect, String[] profiles) {
+        test(file, expect, profiles, new String[0]);
     }
 
-    void test(File file, String[] expect, String[] options) {
-        String[] args;
+    void test(File file, String[] expect, String[] profiles, String[] options) {
+        List<String> args = new ArrayList<>(Arrays.asList(options));
         if (file != null) {
-            args = Arrays.copyOf(options, options.length+1);
-            args[options.length] = file.getPath();
-        } else {
-            args = options;
+            args.add(file.getPath());
         }
-        String[] deps = jdeps(args);
-        checkEqual("dependencies", expect, deps);
+        List<String> argsWithDashP = new ArrayList<>();
+        argsWithDashP.add("-P");
+        argsWithDashP.addAll(args);
+        // test without -P
+        checkResult("dependencies", expect, jdeps(args.toArray(new String[0])).keySet());
+        // test with -P
+        checkResult("profiles", expect, profiles, jdeps(argsWithDashP.toArray(new String[0])));
     }
 
-    String[] jdeps(String... args) {
+    Map<String,String> jdeps(String... args) {
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         System.err.println("jdeps " + Arrays.toString(args));
@@ -112,12 +150,12 @@
 
     // Pattern used to parse lines
     private static Pattern linePattern = Pattern.compile(".*\r?\n");
-    private static Pattern pattern = Pattern.compile("\\s+ -> (\\S+) +.*");
+    private static Pattern pattern = Pattern.compile("\\s+ -> (\\S+) +(.*)");
 
     // Use the linePattern to break the given String into lines, applying
     // the pattern to each line to see if we have a match
-    private static String[] findDeps(String out) {
-        List<String> result = new ArrayList<>();
+    private static Map<String,String> findDeps(String out) {
+        Map<String,String> result = new HashMap<>();
         Matcher lm = linePattern.matcher(out);  // Line matcher
         Matcher pm = null;                      // Pattern matcher
         int lines = 0;
@@ -129,19 +167,41 @@
             else
                 pm.reset(cs);
             if (pm.find())
-                result.add(pm.group(1));
+                result.put(pm.group(1), pm.group(2).trim());
             if (lm.end() == out.length())
                 break;
         }
-        return result.toArray(new String[0]);
+        return result;
+    }
+
+    void checkResult(String label, String[] expect, Collection<String> found) {
+        List<String> list = Arrays.asList(expect);
+        if (!isEqual(list, found))
+            error("Unexpected " + label + " found: '" + found + "', expected: '" + list + "'");
     }
 
-    void checkEqual(String label, String[] expect, String[] found) {
-        Set<String> s1 = new HashSet<>(Arrays.asList(expect));
-        Set<String> s2 = new HashSet<>(Arrays.asList(found));
+    void checkResult(String label, String[] expect, String[] profiles, Map<String,String> result) {
+        if (expect.length != profiles.length)
+            error("Invalid expected names and profiles");
 
-        if (!s1.equals(s2))
-            error("Unexpected " + label + " found: '" + s2 + "', expected: '" + s1 + "'");
+        // check the dependencies
+        checkResult(label, expect, result.keySet());
+        // check profile information
+        checkResult(label, profiles, result.values());
+        for (int i=0; i < expect.length; i++) {
+            String profile = result.get(expect[i]);
+            if (!profile.equals(profiles[i]))
+                error("Unexpected profile: '" + profile + "', expected: '" + profiles[i] + "'");
+        }
+    }
+
+    boolean isEqual(List<String> expected, Collection<String> found) {
+        if (expected.size() != found.size())
+            return false;
+
+        List<String> list = new ArrayList<>(found);
+        list.removeAll(expected);
+        return list.isEmpty();
     }
 
     void error(String msg) {
--- a/langtools/test/tools/jdeps/p/Foo.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/langtools/test/tools/jdeps/p/Foo.java	Fri Apr 05 14:51:24 2013 -0700
@@ -31,5 +31,7 @@
     }
 
     public Foo() {
+        // compact3
+        java.lang.management.ManagementFactory.getRuntimeMXBean();
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/jdeps/profiles.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,263 @@
+# This properties file is used for testing a JDK development build.
+# No need to keep this properties file up to date as long as it covers
+# the APIs used by the jdeps regression test.
+profile.1.name = compact1
+profile.1.packages = \
+    java.io \
+    java.lang \
+    java.lang.annotation \
+    java.lang.invoke \
+    java.lang.ref \
+    java.lang.reflect \
+    java.math \
+    java.net \
+    java.nio \
+    java.nio.channels \
+    java.nio.channels.spi \
+    java.nio.charset \
+    java.nio.charset.spi \
+    java.nio.file \
+    java.nio.file.attribute \
+    java.nio.file.spi \
+    java.security \
+    java.security.cert \
+    java.security.interfaces \
+    java.security.spec \
+    java.text \
+    java.text.spi \
+    java.util \
+    java.util.concurrent \
+    java.util.concurrent.atomic \
+    java.util.concurrent.locks \
+    java.util.jar \
+    java.util.logging \
+    java.util.regex \
+    java.util.spi \
+    java.util.zip \
+    javax.crypto \
+    javax.crypto.interfaces \
+    javax.crypto.spec \
+    javax.security.auth \
+    javax.security.auth.callback \
+    javax.security.auth.login \
+    javax.security.auth.spi \
+    javax.security.auth.x500 \
+    javax.net \
+    javax.net.ssl \
+    javax.security.cert \
+    \
+    com.sun.net.ssl \
+    com.sun.nio.file \
+    com.sun.nio.sctp \
+    com.sun.security.auth \
+    com.sun.security.auth.login
+
+profile.2.name = compact2
+profile.2.packages = \
+    java.sql \
+    javax.sql \
+    javax.xml \
+    javax.xml.datatype \
+    javax.xml.namespace \
+    javax.xml.parsers \
+    javax.xml.stream \
+    javax.xml.stream.events \
+    javax.xml.stream.util \
+    javax.xml.transform \
+    javax.xml.transform.dom \
+    javax.xml.transform.sax \
+    javax.xml.transform.stax \
+    javax.xml.transform.stream \
+    javax.xml.validation \
+    javax.xml.xpath \
+    org.w3c.dom \
+    org.w3c.dom.bootstrap \
+    org.w3c.dom.events \
+    org.w3c.dom.ls \
+    org.xml.sax \
+    org.xml.sax.ext \
+    org.xml.sax.helpers \
+    java.rmi \
+    java.rmi.activation \
+    java.rmi.dgc \
+    java.rmi.registry \
+    java.rmi.server \
+    javax.rmi.ssl \
+    javax.transaction \
+    javax.transaction.xa \
+    \
+    com.sun.net.httpserver \
+    com.sun.net.httpserver.spi
+
+profile.3.name = compact3
+profile.3.packages = \
+    java.lang.instrument \
+    java.lang.management \
+    java.security.acl \
+    java.util.prefs \
+    javax.management \
+    javax.management.loading \
+    javax.management.modelmbean \
+    javax.management.monitor \
+    javax.management.openmbean \
+    javax.management.relation \
+    javax.management.remote \
+    javax.management.remote.rmi \
+    javax.management.timer \
+    javax.naming \
+    javax.naming.directory \
+    javax.naming.event \
+    javax.naming.ldap \
+    javax.naming.spi \
+    javax.sql.rowset \
+    javax.sql.rowset.serial \
+    javax.sql.rowset.spi \
+    javax.security.auth.kerberos \
+    javax.security.sasl \
+    javax.script \
+    javax.smartcardio \
+    javax.xml.crypto \
+    javax.xml.crypto.dom \
+    javax.xml.crypto.dsig \
+    javax.xml.crypto.dsig.dom \
+    javax.xml.crypto.dsig.keyinfo \
+    javax.xml.crypto.dsig.spec \
+    javax.annotation.processing \
+    javax.lang.model \
+    javax.lang.model.element \
+    javax.lang.model.type \
+    javax.lang.model.util \
+    javax.tools \
+    javax.tools.annotation \
+    org.ietf.jgss \
+    \
+    com.sun.management \
+    com.sun.security.auth.callback \
+    com.sun.security.auth.module \
+    com.sun.security.jgss
+
+profile.4.name = Full JRE
+profile.4.packages = \
+    java.applet \
+    java.awt \
+    java.awt.color \
+    java.awt.datatransfer \
+    java.awt.dnd \
+    java.awt.dnd.peer \
+    java.awt.event \
+    java.awt.font \
+    java.awt.geom \
+    java.awt.im \
+    java.awt.im.spi \
+    java.awt.image \
+    java.awt.image.renderable \
+    java.awt.peer \
+    java.awt.print \
+    java.beans \
+    java.beans.beancontext \
+    javax.accessibility \
+    javax.imageio \
+    javax.imageio.event \
+    javax.imageio.metadata \
+    javax.imageio.plugins.bmp \
+    javax.imageio.plugins.jpeg \
+    javax.imageio.spi \
+    javax.imageio.stream \
+    javax.print \
+    javax.print.attribute \
+    javax.print.attribute.standard \
+    javax.print.event \
+    javax.sound.midi \
+    javax.sound.midi.spi \
+    javax.sound.sampled \
+    javax.sound.sampled.spi \
+    javax.swing \
+    javax.swing.border \
+    javax.swing.colorchooser \
+    javax.swing.event \
+    javax.swing.filechooser \
+    javax.swing.plaf \
+    javax.swing.plaf.basic \
+    javax.swing.plaf.metal \
+    javax.swing.plaf.multi \
+    javax.swing.plaf.nimbus \
+    javax.swing.plaf.synth \
+    javax.swing.table \
+    javax.swing.text \
+    javax.swing.text.html \
+    javax.swing.text.html.parser \
+    javax.swing.text.rtf \
+    javax.swing.tree \
+    javax.swing.undo \
+    javax.activation \
+    javax.jws \
+    javax.jws.soap \
+    javax.rmi \
+    javax.rmi.CORBA \
+    javax.xml.bind \
+    javax.xml.bind.annotation \
+    javax.xml.bind.annotation.adapters \
+    javax.xml.bind.attachment \
+    javax.xml.bind.helpers \
+    javax.xml.bind.util \
+    javax.xml.soap \
+    javax.xml.ws \
+    javax.xml.ws.handler \
+    javax.xml.ws.handler.soap \
+    javax.xml.ws.http \
+    javax.xml.ws.soap \
+    javax.xml.ws.spi \
+    javax.xml.ws.spi.http \
+    javax.xml.ws.wsaddressing \
+    javax.annotation \
+    org.omg.CORBA \
+    org.omg.CORBA.DynAnyPackage \
+    org.omg.CORBA.ORBPackage \
+    org.omg.CORBA.TypeCodePackage \
+    org.omg.CORBA.portable \
+    org.omg.CORBA_2_3 \
+    org.omg.CORBA_2_3.portable \
+    org.omg.CosNaming \
+    org.omg.CosNaming.NamingContextExtPackage \
+    org.omg.CosNaming.NamingContextPackage \
+    org.omg.Dynamic \
+    org.omg.DynamicAny \
+    org.omg.DynamicAny.DynAnyFactoryPackage \
+    org.omg.DynamicAny.DynAnyPackage \
+    org.omg.IOP \
+    org.omg.IOP.CodecFactoryPackage \
+    org.omg.IOP.CodecPackage \
+    org.omg.Messaging \
+    org.omg.PortableInterceptor \
+    org.omg.PortableInterceptor.ORBInitInfoPackage \
+    org.omg.PortableServer \
+    org.omg.PortableServer.CurrentPackage \
+    org.omg.PortableServer.POAManagerPackage \
+    org.omg.PortableServer.POAPackage \
+    org.omg.PortableServer.ServantLocatorPackage \
+    org.omg.PortableServer.portable \
+    org.omg.SendingContext \
+    org.omg.stub.java.rmi \
+    org.omg.stub.javax.management.remote.rmi
+
+# Remaining JDK supported API
+profile.5.name = JDK tools
+profile.5.packages = \
+    com.sun.jdi \
+    com.sun.jdi.connect \
+    com.sun.jdi.connect.spi \
+    com.sun.jdi.event \
+    com.sun.jdi.request \
+    com.sun.javadoc \
+    com.sun.tools.doclets \
+    com.sun.tools.doctree \
+    com.sun.source.tree \
+    com.sun.source.util \
+    com.sun.tools.attach \
+    com.sun.tools.attach.spi \
+    com.sun.tools.jconsole \
+    com.sun.tools.javac \
+    com.sun.tools.javah \
+    com.sun.tools.javap \
+    com.sun.tools.javadoc \
+    com.sun.servicetag
--- a/nashorn/.hgtags	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/.hgtags	Fri Apr 05 14:51:24 2013 -0700
@@ -192,3 +192,4 @@
 b8a1b238c77c7c00024daaa2cb7d10838e017b5f jdk8-b68
 b8a1b238c77c7c00024daaa2cb7d10838e017b5f jdk8-b69
 5759f600fcf7b51ccc6cc8229be980e2153f8675 jdk8-b82
+053d7c55dc8272b58b8bb870dc92a4acf896d52a jdk8-b83
--- a/nashorn/bin/jjs	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/bin/jjs	Fri Apr 05 14:51:24 2013 -0700
@@ -26,4 +26,4 @@
 
 [ -z "$JAVA_HOME" ] && echo "Please set JAVA_HOME" && exit 1;
 
-$JAVA_HOME/bin/java -server -XX:-TieredCompilation -Xms2G -Xmx2G -esa -ea -Djava.ext.dirs=$JAVA_HOME/jre/lib/ext:`dirname $0`/../dist -XX:+HeapDumpOnOutOfMemoryError -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -Dnashorn.debug=true jdk.nashorn.tools.Shell $*
+$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/nashorn/bin/jjssecure	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/bin/jjssecure	Fri Apr 05 14:51:24 2013 -0700
@@ -26,4 +26,4 @@
 
 [ -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=$JAVA_HOME/jre/lib/ext:`dirname $0`/../dist -XX:+HeapDumpOnOutOfMemoryError -Dnashorn.debug=true -Djava.lang.invoke.MethodHandle.DEBUG_NAMES=true -Dnashorn.home=`dirname $0`/.. -Djava.security.manager jdk.nashorn.tools.Shell $*
+$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/nashorn/bin/nashorn	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/bin/nashorn	Fri Apr 05 14:51:24 2013 -0700
@@ -26,4 +26,4 @@
 
 [ -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=$JAVA_HOME/jre/lib/ext:`dirname $0`/../dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $*
+$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/nashorn/bin/nashornsecure	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/bin/nashornsecure	Fri Apr 05 14:51:24 2013 -0700
@@ -26,4 +26,4 @@
 
 [ -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=$JAVA_HOME/jre/lib/ext:`dirname $0`/../dist -J-XX:+HeapDumpOnOutOfMemoryError -J-Djava.lang.invoke.MethodHandle.DEBUG_NAMES=false -J-Dnashorn.debug=true -l nashorn $*
+$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/nashorn/docs/DEVELOPER_README	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/docs/DEVELOPER_README	Fri Apr 05 14:51:24 2013 -0700
@@ -13,6 +13,17 @@
 This documentation of the system property flags assume that the
 default value of the flag is false, unless otherwise specified.
 
+SYSTEM PROPERTY: -Dnashorn.args=<string>
+
+This property takes as its value a space separated list of Nashorn
+command line options that should be passed to Nashorn. This might be useful 
+in environments where it is hard to tell how a nashorn.jar is launched.
+
+Example:
+
+> java -Dnashorn.args="--lazy-complation --log=compiler" large-java-app-with-nashorn.jar 
+> ant -Dnashorn.args="--log=codegen" antjob
+
 SYSTEM PROPERTY: -Dnashorn.unstable.relink.threshold=x
 
 This property controls how many call site misses are allowed before a 
--- a/nashorn/docs/JavaScriptingProgrammersGuide.html	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/docs/JavaScriptingProgrammersGuide.html	Fri Apr 05 14:51:24 2013 -0700
@@ -533,9 +533,8 @@
 <hr>
 <a name="jsarrays" id="jsarrays"></a>
 <h3>Creating, Converting and Using Java Arrays</h3>
-<p>While creating a Java object is the same as in Java, to create
-Java arrays in JavaScript we can use Java reflection
-explicitly. But once created the element access or length access is
+<p>
+Array element access or length access is
 the same as in Java. Also, a script array can be used when a Java
 method expects a Java array (auto conversion). So in most cases we
 don't have to create Java arrays explicitly.</p>
@@ -543,7 +542,8 @@
 // <a href="source/javaarray.js">javaarray.js</a>
 
 // create Java String array of 5 elements
-var a = java.lang.reflect.Array.newInstance(java.lang.String.class, 5);
+var StringArray = Java.type("java.lang.String[]");
+var a = new StringArray(5);
 
 // Accessing elements and length access is by usual Java syntax
 a[0] = "scripting is great!";
--- a/nashorn/docs/source/javaarray.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/docs/source/javaarray.js	Fri Apr 05 14:51:24 2013 -0700
@@ -30,7 +30,8 @@
  */
 
 // create Java String array of 5 elements
-var a = java.lang.reflect.Array.newInstance(java.lang.String.class, 5);
+var StringArray = Java.type("java.lang.String[]");
+var a = new StringArray(5);
 
 // Accessing elements and length access is by usual Java syntax
 a[0] = "scripting is great!";
--- a/nashorn/make/build.xml	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/make/build.xml	Fri Apr 05 14:51:24 2013 -0700
@@ -124,7 +124,7 @@
     <echo message="release=${nashorn.version}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
   </target>
 
-  <target name="jar" depends="compile, run-nasgen" description="Creates nashorn.jar">
+  <target name="jar" depends="compile, run-nasgen, generate-cc-template" description="Creates nashorn.jar">
     <jar jarfile="${dist.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
       <fileset dir="${build.classes.dir}"/>
       <manifest>
@@ -191,12 +191,12 @@
 
     <!-- tests that check nashorn internals and internal API -->
     <jar jarfile="${nashorn.internal.tests.jar}">
-      <fileset dir="${build.test.classes.dir}" excludes="**/api/*"/>
+      <fileset dir="${build.test.classes.dir}" excludes="**/api/**"/>
     </jar>
 
     <!-- tests that check nashorn script engine (jsr-223) API -->
     <jar jarfile="${nashorn.api.tests.jar}">
-      <fileset dir="${build.test.classes.dir}" includes="**/api/*"/>
+      <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
     </jar>
 
   </target>
--- a/nashorn/make/code_coverage.xml	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/make/code_coverage.xml	Fri Apr 05 14:51:24 2013 -0700
@@ -36,7 +36,12 @@
       <equals arg1="${jcov}" arg2="dynamic" trim="true"/>
     </condition>
 
+    <condition property="cc.generate.template" value="true">
+      <equals arg1="${cc.dynamic.genereate.template}" arg2="true" trim="true"/>
+    </condition>
+
     <mkdir dir="${cc.dir}"/>
+    <mkdir dir="${build.dir}/to_be_instrumented"/>
 
     <!-- info -->
     <echo message="jcov=${jcov}"/>
@@ -51,25 +56,66 @@
     <property name="run.test.cc.jvmargs" value=""/>
   </target>
 
+  <target name="prepare-to-be-instrumented" depends="compile" description="Prepares to_be_instrumented dir">
+    <copy todir="${build.dir}/to_be_instrumented">
+      <fileset dir="${build.classes.dir}">
+        <include name="**/*.class"/>
+        <include name="**/*.clazz"/>
+      </fileset>
+    </copy>
+
+    <move todir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
+      <fileset dir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
+        <include name="**/*.clazz"/>
+      </fileset>
+      <mapper type="glob" from="*.clazz" to="*.class"/>
+    </move>
+  </target>
+
+  <target name="generate-cc-template" depends="prepare-to-be-instrumented" description="Generates code coverage template for dynamic CC" if="cc.generate.template">
+    <property name="cc.instrumented.path" location="${build.dir}/to_be_instrumented"/>
+    <java classname="com.sun.tdk.jcov.TmplGen">
+      <arg value="-verbose"/>
+      <arg line="-include ${cc.include}"/>
+      <arg line="-type all"/>
+      <arg line="-template ${cc.template}"/>
+      <arg value="${cc.instrumented.path}"/>
+      <classpath>
+        <pathelement location="${jcov.jar}"/>
+      </classpath>
+    </java>
+
+    <java classname="com.sun.tdk.jcov.RepGen">
+      <arg value="-verbose"/>
+      <arg line="-output ${cc.dir}/CC_template_report"/>
+      <arg value="${cc.template}"/>
+      <classpath>
+        <pathelement location="${jcov.jar}"/>
+      </classpath>
+    </java>
+  </target>
+
   <target name="init-cc" depends="init-cc-disabled, init-cc-enabled">
     <property name="run.test.cc.jvmargs" value=""/>
   </target>
 
   <target name="init-cc-cleanup" if="${cc.enabled}">
     <delete dir="${cc.dir}" failonerror="false" />
+    <delete dir="${build.dir}/to_be_instrumented" failonerror="false" />
   </target>
 
   <target name="check-merging-files" depends="init">
-	<resourcecount property="cc.xmls">
-  		<filelist dir="${cc.dir}" files="*.xml" />
-	</resourcecount>	
+	<echo message="checking avalibility of ${cc.template}"/>
     <condition property="nothing-to-merge" value="true">
-      <equals arg1="${cc.xmls}" arg2="1" trim="true"/>
+		<not>
+	      <available file="${cc.template}"/>
+		</not>
     </condition>
+	<echo message="nothing-to-merge = ${nothing-to-merge}"/>
   </target>
 
   <target name="fix-merging-files" depends="check-merging-files" if="${nothing-to-merge}">
-	<echo message="making pre-merge workaround"/>
+	<echo message="making pre-merge workaround due to missed template"/>
 	<move todir="${cc.dir}" includeemptydirs="false">
 		<fileset dir="${cc.dir}">
 			<include name="*.xml"/>
@@ -81,12 +127,12 @@
   <target name="merge-code-coverage" depends="fix-merging-files" unless="${nothing-to-merge}">
 	<echo message="merging files"/>
     <fileset dir="${cc.dir}" id="cc.xmls">
-      <include name="**/*${jcov}*.xml"/>
+      <include name="**/*_${jcov}_*.xml"/>
       <include name="**/CC_template.xml"/>
     </fileset>
 
     <pathconvert pathsep=" " property="cc.all.xmls" refid="cc.xmls"/>
-
+	<echo message="merging files - ${cc.all.xmls}" />
     <java classname="com.sun.tdk.jcov.Merger">
       <arg value="-verbose"/>
       <arg value="-output"/>
--- a/nashorn/make/java.security.override	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/make/java.security.override	Fri Apr 05 14:51:24 2013 -0700
@@ -3,7 +3,7 @@
 # We ensure that by overriding "package.access" security property.
 
 # The following "package.access" value was copied from  default java.security 
-# of jre/lib/security and appended with nashorn IR, Codegen and Parser packages.
+# of jre/lib/security and appended with nashorn sensitive packages.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -11,4 +11,4 @@
 # passed to checkPackageAccess unless the
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,jdk.internal.,jdk.nashorn.internal.ir., jdk.nashorn.internal.codegen., jdk.nashorn.internal.lookup., jdk.nashorn.internal.parser.
+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,jdk.internal.,jdk.nashorn.internal.,jdk.nashorn.tools.
--- a/nashorn/make/project.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/make/project.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -210,7 +210,7 @@
 # add '-Dtest.js.outofprocess' to run each test in a new sub-process
 run.test.jvmargs.main=-server -Xmx${run.test.xmx} -XX:-TieredCompilation -esa -ea -Dnashorn.debug=true -Dfile.encoding=UTF-8
 #-XX:+HeapDumpOnOutOfMemoryError -XX:-UseCompressedKlassPointers -XX:+PrintHeapAtGC -XX:ClassMetaspaceSize=300M  
-run.test.jvmargs.octane.main=-Xms${run.test.xms} ${run.test.jvmargs}
+run.test.jvmargs.octane.main=-Xms${run.test.xms} ${run.test.jvmargs.main}
 
 run.test.jvmsecurityargs=-Xverify:all -Djava.security.properties=${basedir}/make/java.security.override -Djava.security.manager -Djava.security.policy=${basedir}/build/nashorn.policy
 
@@ -235,10 +235,12 @@
 	#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_nashorn.xml
+cc.result.file.name=CC_${jcov}_nashorn.xml
 	#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\.*
 cc.exclude=jdk\.nashorn\.internal\.scripts\.*
+cc.dynamic.genereate.template=true
+cc.template=${cc.dir}/CC_template.xml
 cc.dynamic.args=-javaagent:${jcov.jar}=include=${cc.include},exclude=${cc.exclude},type=all,verbose=0,file=${cc.dir}/${cc.result.file.name}
--- a/nashorn/src/jdk/nashorn/api/scripting/Formatter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/api/scripting/Formatter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -46,7 +46,7 @@
  * <p>Pattern and the logic for parameter position: java.util.Formatter
  *
  */
-public final class Formatter {
+final class Formatter {
 
     private Formatter() {
     }
@@ -59,8 +59,8 @@
      * @param args arguments referenced by the format specifiers in format
      * @return a formatted string
      */
-    public static String format(final String format, final Object[] args) {
-        Matcher m = FS_PATTERN.matcher(format);
+    static String format(final String format, final Object[] args) {
+        final Matcher m = FS_PATTERN.matcher(format);
         int positionalParameter = 1;
 
         while (m.find()) {
@@ -143,7 +143,7 @@
     /**
      * Method to parse the integer of the argument index.
      *
-     * @param s
+     * @param s string to parse
      * @return -1 if parsing failed, 0 if string is null, > 0 integer
      */
     private static int index(final String s) {
@@ -166,7 +166,7 @@
      * Method to check if a string contains '&lt;'. This is used to find out if
      * previous parameter is used.
      *
-     * @param s
+     * @param s string to check
      * @return true if '&lt;' is in the string, else false
      */
     private static boolean isPreviousArgument(final String s) {
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Apr 05 14:51:24 2013 -0700
@@ -32,6 +32,7 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
+import java.lang.reflect.Method;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -179,14 +180,14 @@
     }
 
     private <T> T getInterfaceInner(final Object self, final Class<T> clazz) {
-        final Object realSelf;
+        final ScriptObject realSelf;
         final ScriptObject ctxtGlobal = getNashornGlobalFrom(context);
         if(self == null) {
             realSelf = ctxtGlobal;
         } else if (!(self instanceof ScriptObject)) {
-            realSelf = ScriptObjectMirror.unwrap(self, ctxtGlobal);
+            realSelf = (ScriptObject)ScriptObjectMirror.unwrap(self, ctxtGlobal);
         } else {
-            realSelf = self;
+            realSelf = (ScriptObject)self;
         }
         try {
             final ScriptObject oldGlobal = getNashornGlobal();
@@ -194,6 +195,10 @@
                 if(oldGlobal != ctxtGlobal) {
                     setNashornGlobal(ctxtGlobal);
                 }
+
+                if (! isInterfaceImplemented(clazz, realSelf)) {
+                    return null;
+                }
                 return clazz.cast(JavaAdapterFactory.getConstructor(realSelf.getClass(), clazz).invoke(realSelf));
             } finally {
                 if(oldGlobal != ctxtGlobal) {
@@ -394,14 +399,6 @@
             setContextVariables(ctxt);
             final Object val = ctxt.getAttribute(ScriptEngine.FILENAME);
             final String fileName = (val != null) ? val.toString() : "<eval>";
-
-            // NOTE: FIXME: If this is jrunscript's init.js, we want to run the replacement.
-            // This should go away once we fix jrunscript's copy of init.js.
-            if ("<system-init>".equals(fileName)) {
-                evalSupportScript("resources/init.js", "nashorn:engine/resources/init.js");
-                return null;
-            }
-
             Object res = ScriptRuntime.apply(script, ctxtGlobal);
             return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(res, ctxtGlobal));
         } catch (final Exception e) {
@@ -471,6 +468,21 @@
         }
     }
 
+    private static boolean isInterfaceImplemented(final Class<?> iface, final ScriptObject sobj) {
+        for (final Method method : iface.getMethods()) {
+            // ignore methods of java.lang.Object class
+            if (method.getDeclaringClass() == Object.class) {
+                continue;
+            }
+
+            Object obj = sobj.get(method.getName());
+            if (! (obj instanceof ScriptFunction)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
     // don't make this public!!
     static ScriptObject getNashornGlobal() {
         return Context.getGlobal();
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java	Fri Apr 05 14:51:24 2013 -0700
@@ -147,6 +147,7 @@
      * @return newly created script engine.
      */
     public ScriptEngine getScriptEngine(final ClassLoader appLoader) {
+        checkConfigPermission();
         return new NashornScriptEngine(this, appLoader);
     }
 
@@ -157,6 +158,7 @@
      * @return newly created script engine.
      */
     public ScriptEngine getScriptEngine(final String[] args) {
+        checkConfigPermission();
         return new NashornScriptEngine(this, args, getAppClassLoader());
     }
 
@@ -168,11 +170,19 @@
      * @return newly created script engine.
      */
     public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader) {
+        checkConfigPermission();
         return new NashornScriptEngine(this, args, appLoader);
     }
 
     // -- Internals only below this point
 
+    private static void checkConfigPermission() {
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission("nashorn.setConfig"));
+        }
+    }
+
     private static final List<String> names;
     private static final List<String> mimeTypes;
     private static final List<String> extensions;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptUtils.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.api.scripting;
+
+import jdk.nashorn.internal.runtime.ScriptRuntime;
+
+/**
+ * Utilities that are to be called from script code
+ */
+public final class ScriptUtils {
+    private ScriptUtils() {}
+
+    /**
+     * Returns AST as JSON compatible string. This is used to
+     * implement "parse" function in resources/parse.js script.
+     *
+     * @param code code to be parsed
+     * @param name name of the code source (used for location)
+     * @param includeLoc tells whether to include location information for nodes or not
+     * @return JSON string representation of AST of the supplied code
+     */
+    public static String parse(final String code, final String name, final boolean includeLoc) {
+        return ScriptRuntime.parse(code, name, includeLoc);
+    }
+
+    /**
+     * Method which converts javascript types to java types for the
+     * String.format method (jrunscript function sprintf).
+     *
+     * @param format a format string
+     * @param args arguments referenced by the format specifiers in format
+     * @return a formatted string
+     */
+    public static String format(final String format, final Object[] args) {
+        return Formatter.format(format, args);
+    }
+}
--- a/nashorn/src/jdk/nashorn/api/scripting/resources/engine.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/api/scripting/resources/engine.js	Fri Apr 05 14:51:24 2013 -0700
@@ -46,3 +46,49 @@
     }
     writer.println(String(str));
 }
+
+/**
+ * This is C-like printf
+ *
+ * @param format string to format the rest of the print items
+ * @param args variadic argument list
+ */
+Object.defineProperty(this, "printf", {
+    configurable: true,
+    enumerable: false,
+    writable: true,
+    value: function (format, args/*, more args*/) {
+        print(sprintf.apply(this, arguments));
+    }
+});
+
+/**
+ * This is C-like sprintf
+ *
+ * @param format string to format the rest of the print items
+ * @param args variadic argument list
+ */
+Object.defineProperty(this, "sprintf", {
+    configurable: true,
+    enumerable: false,
+    writable: true,
+    value: function (format, args/*, more args*/) {
+        var len = arguments.length - 1;
+        var array = [];
+
+        if (len < 0) {
+            return "";
+        }
+
+        for (var i = 0; i < len; i++) {
+            if (arguments[i+1] instanceof Date) {
+                array[i] = arguments[i+1].getTime();
+            } else {
+                array[i] = arguments[i+1];
+            }
+        }
+
+        array = Java.toJavaArray(array);
+        return Packages.jdk.nashorn.api.scripting.ScriptUtils.format(format, array);
+    }
+});
--- a/nashorn/src/jdk/nashorn/api/scripting/resources/init.js	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,939 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- */
-
-/**
- * jrunscript JavaScript built-in functions and objects.
- */
-
-/**
- * Creates an object that delegates all method calls on
- * it to the 'invoke' method on the given delegate object.<br>
- *
- * Example:
- * <pre>
- * <code>
- *     var x  = { invoke: function(name, args) { //code...}
- *     var y = new JSInvoker(x);
- *     y.func(3, 3); // calls x.invoke('func', args); where args is array of arguments
- * </code>
- * </pre>
- * @param obj object to be wrapped by JSInvoker
- * @constructor
- */
-function JSInvoker(obj) {
-    return new JSAdapter({
-        __get__ : function(name) {
-            return function() {
-                return obj.invoke(name, arguments);
-            }
-        }
-    });
-}
-
-/**
- * This variable represents OS environment. Environment
- * variables can be accessed as fields of this object. For
- * example, env.PATH will return PATH value configured.
- */
-var env = new JSAdapter({
-    __get__ : function (name) {
-        return java.lang.System.getenv(name);
-    },
-    __has__ : function (name) {
-        return java.lang.System.getenv().containsKey(name);
-    },
-    __getIds__ : function() {
-        return java.lang.System.getenv().keySet().toArray();
-    },
-    __delete__ : function(name) {
-        println("can't delete env item");
-    },
-    __put__ : function (name, value) {
-        println("can't change env item");
-    },
-    toString: function() {
-        return java.lang.System.getenv().toString();
-    }
-});
-
-/**
- * Creates a convenient script object to deal with java.util.Map instances.
- * The result script object's field names are keys of the Map. For example,
- * scriptObj.keyName can be used to access value associated with given key.<br>
- * Example:
- * <pre>
- * <code>
- *     var x = java.lang.SystemProperties();
- *     var y = jmap(x);
- *     println(y['java.class.path']); // prints java.class.path System property
- *     delete y['java.class.path']; // remove java.class.path System property
- * </code>
- * </pre>
- *
- * @param map java.util.Map instance that will be wrapped
- * @constructor
- */
-function jmap(map) {
-    return new JSAdapter({
-        __get__ : function(name) {
-            if (map.containsKey(name)) {
-                return map.get(name);
-            } else {
-                return undefined;
-            }
-        },
-        __has__ :  function(name) {
-            return map.containsKey(name);
-        },
-
-        __delete__ : function (name) {
-            return map.remove(name);
-        },
-        __put__ : function(name, value) {
-            map.put(name, value);
-        },
-        __getIds__ : function() {
-            return map.keySet().toArray();
-        },
-        toString: function() {
-            return map.toString();
-        }
-    });
-}
-
-/**
- * Creates a convenient script object to deal with java.util.List instances.
- * The result script object behaves like an array. For example,
- * scriptObj[index] syntax can be used to access values in the List instance.
- * 'length' field gives size of the List. <br>
- *
- * Example:
- * <pre>
- * <code>
- *    var x = new java.util.ArrayList(4);
- *    x.add('Java');
- *    x.add('JavaScript');
- *    x.add('SQL');
- *    x.add('XML');
- *
- *    var y = jlist(x);
- *    println(y[2]); // prints third element of list
- *    println(y.length); // prints size of the list
- *
- * @param map java.util.List instance that will be wrapped
- * @constructor
- */
-function jlist(list) {
-    function isValid(index) {
-        return typeof(index) == 'number' &&
-            index > -1 && index < list.size();
-    }
-    return new JSAdapter({
-        __get__ :  function(name) {
-            if (isValid(name)) {
-                return list.get(name);
-            } else if (name == 'length') {
-                return list.size();
-            } else {
-                return undefined;
-            }
-        },
-        __has__ : function (name) {
-            return isValid(name) || name == 'length';
-        },
-        __delete__ : function(name) {
-            if (isValid(name)) {
-                list.remove(name);
-            }
-        },
-        __put__ : function(name, value) {
-            if (isValid(name)) {
-                list.set(name, value);
-            }
-        },
-        __getIds__: function() {
-            var res = new Array(list.size());
-            for (var i = 0; i < res.length; i++) {
-                res[i] = i;
-            }
-            return res;
-        },
-        toString: function() {
-            return list.toString();
-        }
-    });
-}
-
-/**
- * This is java.lang.System properties wrapped by JSAdapter.
- * For eg. to access java.class.path property, you can use
- * the syntax sysProps["java.class.path"]
- */
-var sysProps = new JSAdapter({
-    __get__ : function (name) {
-        return java.lang.System.getProperty(name);
-    },
-    __has__ : function (name) {
-        return java.lang.System.getProperty(name) != null;
-    },
-    __getIds__ : function() {
-        return java.lang.System.getProperties().keySet().toArray();
-    },
-    __delete__ : function(name) {
-        java.lang.System.clearProperty(name);
-        return true;
-    },
-    __put__ : function (name, value) {
-        java.lang.System.setProperty(name, value);
-    },
-    toString: function() {
-        return "<system properties>";
-    }
-});
-
-// stdout, stderr & stdin
-var out = java.lang.System.out;
-var err = java.lang.System.err;
-// can't use 'in' because it is a JavaScript keyword :-(
-var inp = java.lang.System["in"];
-
-var BufferedInputStream = java.io.BufferedInputStream;
-var BufferedOutputStream = java.io.BufferedOutputStream;
-var BufferedReader = java.io.BufferedReader;
-var DataInputStream = java.io.DataInputStream;
-var File = java.io.File;
-var FileInputStream = java.io.FileInputStream;
-var FileOutputStream = java.io.FileOutputStream;
-var InputStream = java.io.InputStream;
-var InputStreamReader = java.io.InputStreamReader;
-var OutputStream = java.io.OutputStream;
-var Reader = java.io.Reader;
-var URL = java.net.URL;
-
-/**
- * Generic any object to input stream mapper
- * @param str input file name, URL or InputStream
- * @return InputStream object
- * @private
- */
-function inStream(str) {
-    if (typeof(str) == "string") {
-        // '-' means standard input
-        if (str == '-') {
-            return java.lang.System["in"];
-        }
-        // try file first
-        var file = null;
-        try {
-            file = pathToFile(str);
-        } catch (e) {
-        }
-        if (file && file.exists()) {
-            return new FileInputStream(file);
-        } else {
-            try {
-                // treat the string as URL
-                return new URL(str).openStream();
-            } catch (e) {
-                throw 'file or URL ' + str + ' not found';
-            }
-        }
-    } else {
-        if (str instanceof InputStream) {
-            return str;
-        } else if (str instanceof URL) {
-            return str.openStream();
-        } else if (str instanceof File) {
-            return new FileInputStream(str);
-        }
-    }
-    // everything failed, just give input stream
-    return java.lang.System["in"];
-}
-
-/**
- * Generic any object to output stream mapper
- *
- * @param out output file name or stream
- * @return OutputStream object
- * @private
- */
-function outStream(out) {
-    if (typeof(out) == "string") {
-        if (out == '>') {
-            return java.lang.System.out;
-        } else {
-            // treat it as file
-            return new FileOutputStream(pathToFile(out));
-        }
-    } else {
-        if (out instanceof OutputStream) {
-            return out;
-        } else if (out instanceof File) {
-            return new FileOutputStream(out);
-        }
-    }
-
-    // everything failed, just return System.out
-    return java.lang.System.out;
-}
-
-/**
- * stream close takes care not to close stdin, out & err.
- * @private
- */
-function streamClose(stream) {
-    if (stream) {
-        if (stream != java.lang.System["in"] &&
-            stream != java.lang.System.out &&
-            stream != java.lang.System.err) {
-            try {
-                stream.close();
-            } catch (e) {
-                println(e);
-            }
-        }
-    }
-}
-
-/**
- * Loads and evaluates JavaScript code from a stream or file or URL<br>
- *
- * Examples:
- * <pre>
- * <code>
- *    load('test.js'); // load script file 'test.js'
- *    load('http://java.sun.com/foo.js'); // load from a URL
- * </code>
- * </pre>
- *
- * @param str input from which script is loaded and evaluated
- */
-if (typeof(load) == 'undefined') {
-    var load = function(str) {
-        var stream = inStream(str);
-        var bstream = new BufferedInputStream(stream);
-        var reader = new BufferedReader(new InputStreamReader(bstream));
-        var oldFilename = engine.get(engine.FILENAME);
-        engine.put(engine.FILENAME, str);
-        try {
-            engine.eval(reader);
-        } finally {
-            engine.put(engine.FILENAME, oldFilename);
-            streamClose(stream);
-        }
-    }
-}
-
-// file system utilities
-
-/**
- * Creates a Java byte[] of given length
- * @param len size of the array to create
- * @private
- */
-function javaByteArray(len) {
-    return java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, len);
-}
-
-var curDir = new File('.');
-
-/**
- * Print present working directory
- */
-function pwd() {
-    println(curDir.getAbsolutePath());
-}
-
-/**
- * Changes present working directory to given directory
- * @param target directory to change to. optional, defaults to user's HOME
- */
-function cd(target) {
-    if (target == undefined) {
-        target = sysProps["user.home"];
-    }
-    if (!(target instanceof File)) {
-        target = pathToFile(target);
-    }
-    if (target.exists() && target.isDirectory()) {
-        curDir = target;
-    } else {
-        println(target + " is not a directory");
-    }
-}
-
-/**
- * Converts path to java.io.File taking care of shell present working dir
- *
- * @param pathname file path to be converted
- * @private
- */
-function pathToFile(pathname) {
-    var tmp = pathname;
-    if (!(tmp instanceof File)) {
-        tmp = new File(tmp);
-    }
-    if (!tmp.isAbsolute()) {
-        return new File(curDir, pathname);
-    } else {
-        return tmp;
-    }
-}
-
-/**
- * Copies a file or URL or stream to another file or stream
- *
- * @param from input file or URL or stream
- * @param to output stream or file
- */
-function cp(from, to) {
-    if (from == to) {
-        println("file " + from + " cannot be copied onto itself!");
-        return;
-    }
-    var inp = inStream(from);
-    var out = outStream(to);
-    var binp = new BufferedInputStream(inp);
-    var bout = new BufferedOutputStream(out);
-    var buff = javaByteArray(1024);
-    var len;
-    while ((len = binp.read(buff)) > 0 )
-        bout.write(buff, 0, len);
-
-    bout.flush();
-    streamClose(inp);
-    streamClose(out);
-}
-
-/**
- * Shows the content of a file or URL or any InputStream<br>
- * Examples:
- * <pre>
- * <code>
- *    cat('test.txt'); // show test.txt file contents
- *    cat('http://java.net'); // show the contents from the URL http://java.net
- * </code>
- * </pre>
- * @param obj input to show
- * @param pattern optional. show only the lines matching the pattern
- */
-function cat(obj, pattern) {
-    if (obj instanceof File && obj.isDirectory()) {
-        ls(obj);
-        return;
-    }
-
-    var inp = null;
-    if (!(obj instanceof Reader)) {
-        inp = inStream(obj);
-        obj = new BufferedReader(new InputStreamReader(inp));
-    }
-    var line;
-    if (pattern) {
-        var count = 1;
-        while ((line=obj.readLine()) != null) {
-            if (line.match(pattern)) {
-                println(count + "\t: " + line);
-            }
-            count++;
-        }
-    } else {
-        while ((line=obj.readLine()) != null) {
-            println(line);
-        }
-    }
-}
-
-/**
- * Returns directory part of a filename
- *
- * @param pathname input path name
- * @return directory part of the given file name
- */
-function dirname(pathname) {
-    var dirName = ".";
-    // Normalize '/' to local file separator before work.
-    var i = pathname.replace('/', File.separatorChar ).lastIndexOf(
-        File.separator );
-    if ( i != -1 )
-        dirName = pathname.substring(0, i);
-    return dirName;
-}
-
-/**
- * Creates a new dir of given name
- *
- * @param dir name of the new directory
- */
-function mkdir(dir) {
-    dir = pathToFile(dir);
-    println(dir.mkdir()? "created" : "can not create dir");
-}
-
-/**
- * Creates the directory named by given pathname, including
- * any necessary but nonexistent parent directories.
- *
- * @param dir input path name
- */
-function mkdirs(dir) {
-    dir = pathToFile(dir);
-    println(dir.mkdirs()? "created" : "can not create dirs");
-}
-
-/**
- * Removes a given file
- *
- * @param pathname name of the file
- */
-function rm(pathname) {
-    var file = pathToFile(pathname);
-    if (!file.exists()) {
-        println("file not found: " + pathname);
-        return false;
-    }
-    // note that delete is a keyword in JavaScript!
-    println(file["delete"]()? "deleted" : "can not delete");
-}
-
-/**
- * Removes a given directory
- *
- * @param pathname name of the directory
- */
-function rmdir(pathname) {
-    rm(pathname);
-}
-
-/**
- * Synonym for 'rm'
- */
-function del(pathname) {
-    rm(pathname);
-}
-
-/**
- * Moves a file to another
- *
- * @param from original name of the file
- * @param to new name for the file
- */
-function mv(from, to) {
-    println(pathToFile(from).renameTo(pathToFile(to))?
-        "moved" : "can not move");
-}
-
-/**
- * Synonym for 'mv'.
- */
-function ren(from, to) {
-    mv(from, to);
-}
-
-var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
-
-/**
- * Helper function called by ls
- * @private
- */
-function printFile(f) {
-    var sb = new java.lang.StringBuffer();
-    sb.append(f.isDirectory()? "d" : "-");
-    sb.append(f.canRead() ? "r": "-" );
-    sb.append(f.canWrite() ? "w": "-" );
-    sb.append(" ");
-
-    var d = new java.util.Date(f.lastModified());
-    var c = new java.util.GregorianCalendar();
-    c.setTime(d);
-    var day    = c.get(java.util.Calendar.DAY_OF_MONTH);
-    sb.append(months[c.get(java.util.Calendar.MONTH)]
-         + " " + day );
-    if (day < 10) {
-        sb.append(" ");
-    }
-
-    // to get fixed length 'length' field
-    var fieldlen = 8;
-    var len = new java.lang.StringBuffer();
-    for(var j=0; j<fieldlen; j++)
-        len.append(" ");
-    len.insert(0, java.lang.Long.toString(f.length()));
-    len.setLength(fieldlen);
-    // move the spaces to the front
-    var si = len.toString().indexOf(" ");
-    if ( si != -1 ) {
-        var pad = len.toString().substring(si);
-        len.setLength(si);
-        len.insert(0, pad);
-    }
-    sb.append(len.toString());
-    sb.append(" ");
-    sb.append(f.getName());
-    if (f.isDirectory()) {
-        sb.append('/');
-    }
-    println(sb.toString());
-}
-
-/**
- * Lists the files in a directory
- *
- * @param dir directory from which to list the files. optional, default to pwd
- * @param filter pattern to filter the files listed. optional, default is '.'.
- */
-function ls(dir, filter) {
-    if (dir) {
-        dir = pathToFile(dir);
-    } else {
-        dir = curDir;
-    }
-    if (dir.isDirectory()) {
-        var files = dir.listFiles();
-        for (var i in files) {
-            var f = files[i];
-            if (filter) {
-                if(!f.getName().match(filter)) {
-                    continue;
-                }
-            }
-            printFile(f);
-        }
-    } else {
-        printFile(dir);
-    }
-}
-
-/**
- * Synonym for 'ls'.
- */
-function dir(d, filter) {
-    ls(d, filter);
-}
-
-/**
- * Unix-like grep, but accepts JavaScript regex patterns
- *
- * @param pattern to search in files
- * @param files one or more files
- */
-function grep(pattern, files /*, one or more files */) {
-    if (arguments.length < 2) return;
-    for (var i = 1; i < arguments.length; i++) {
-        println(arguments[i] + ":");
-        cat(arguments[i], pattern);
-    }
-}
-
-/**
- * Find in files. Calls arbitrary callback function
- * for each matching file.<br>
- *
- * Examples:
- * <pre>
- * <code>
- *    find('.')
- *    find('.', '.*\.class', rm);  // remove all .class files
- *    find('.', '.*\.java');       // print fullpath of each .java file
- *    find('.', '.*\.java', cat);  // print all .java files
- * </code>
- * </pre>
- *
- * @param dir directory to search files
- * @param pattern to search in the files
- * @param callback function to call for matching files
- */
-function find(dir, pattern, callback) {
-    dir = pathToFile(dir);
-    if (!callback) callback = print;
-    var files = dir.listFiles();
-    for (var f in files) {
-        var file = files[f];
-        if (file.isDirectory()) {
-            find(file, pattern, callback);
-        } else {
-            if (pattern) {
-                if (file.getName().match(pattern)) {
-                    callback(file);
-                }
-            } else {
-                callback(file);
-            }
-        }
-    }
-}
-
-// process utilities
-
-/**
- * Exec's a child process, waits for completion &amp; returns exit code
- *
- * @param cmd command to execute in child process
- */
-function exec(cmd) {
-    var process = java.lang.Runtime.getRuntime().exec(cmd);
-    var inp = new DataInputStream(process.getInputStream());
-    var line = null;
-    while ((line = inp.readLine()) != null) {
-        println(line);
-    }
-    process.waitFor();
-    $exit = process.exitValue();
-}
-
-// XML utilities
-
-/**
- * Converts input to DOM Document object
- *
- * @param inp file or reader. optional, without this param,
- * this function returns a new DOM Document.
- * @return returns a DOM Document object
- */
-function XMLDocument(inp) {
-    var factory = javax.xml.parsers.DocumentBuilderFactory.newInstance();
-    var builder = factory.newDocumentBuilder();
-    if (inp) {
-        if (typeof(inp) == "string") {
-            return builder.parse(pathToFile(inp));
-        } else {
-            return builder.parse(inp);
-        }
-    } else {
-        return builder.newDocument();
-    }
-}
-
-/**
- * Converts arbitrary stream, file, URL to XMLSource
- *
- * @param inp input stream or file or URL
- * @return XMLSource object
- */
-function XMLSource(inp) {
-    if (inp instanceof javax.xml.transform.Source) {
-        return inp;
-    } else if (inp instanceof Packages.org.w3c.dom.Document) {
-        return new javax.xml.transform.dom.DOMSource(inp);
-    } else {
-        inp = new BufferedInputStream(inStream(inp));
-        return new javax.xml.transform.stream.StreamSource(inp);
-    }
-}
-
-/**
- * Converts arbitrary stream, file to XMLResult
- *
- * @param inp output stream or file
- * @return XMLResult object
- */
-function XMLResult(out) {
-    if (out instanceof javax.xml.transform.Result) {
-        return out;
-    } else if (out instanceof Packages.org.w3c.dom.Document) {
-        return new javax.xml.transform.dom.DOMResult(out);
-    } else {
-        out = new BufferedOutputStream(outStream(out));
-        return new javax.xml.transform.stream.StreamResult(out);
-    }
-}
-
-/**
- * Perform XSLT transform
- *
- * @param inp Input XML to transform (URL, File or InputStream)
- * @param style XSL Stylesheet to be used (URL, File or InputStream). optional.
- * @param out Output XML (File or OutputStream
- */
-function XSLTransform(inp, style, out) {
-    switch (arguments.length) {
-    case 2:
-        inp = arguments[0];
-        out = arguments[1];
-        break;
-    case 3:
-        inp = arguments[0];
-        style = arguments[1];
-        out = arguments[2];
-        break;
-    default:
-        println("XSL tranform requires 2 or 3 arguments");
-        return;
-    }
-
-    var factory = javax.xml.transform.TransformerFactory.newInstance();
-    var transformer;
-    if (style) {
-        transformer = factory.newTransformer(XMLSource(style));
-    } else {
-        transformer = factory.newTransformer();
-    }
-    var source = XMLSource(inp);
-    var result = XMLResult(out);
-    transformer.transform(source, result);
-    if (source.getInputStream) {
-        streamClose(source.getInputStream());
-    }
-    if (result.getOutputStream) {
-        streamClose(result.getOutputStream());
-    }
-}
-
-// miscellaneous utilities
-
-/**
- * Prints which command is selected from PATH
- *
- * @param cmd name of the command searched from PATH
- */
-function which(cmd) {
-    var st = new java.util.StringTokenizer(env.PATH, File.pathSeparator);
-    while (st.hasMoreTokens()) {
-        var file = new File(st.nextToken(), cmd);
-        if (file.exists()) {
-            println(file.getAbsolutePath());
-            return;
-        }
-    }
-}
-
-/**
- * Prints IP addresses of given domain name
- *
- * @param name domain name
- */
-function ip(name) {
-    var addrs = InetAddress.getAllByName(name);
-    for (var i in addrs) {
-        println(addrs[i]);
-    }
-}
-
-/**
- * Prints current date in current locale
- */
-function date() {
-    println(new Date().toLocaleString());
-}
-
-/**
- * Echoes the given string arguments
- */
-function echo(x) {
-    for (var i = 0; i < arguments.length; i++) {
-        println(arguments[i]);
-    }
-}
-
-/**
- * Reads one or more lines from stdin after printing prompt
- *
- * @param prompt optional, default is '>'
- * @param multiline to tell whether to read single line or multiple lines
- */
-function read(prompt, multiline) {
-    if (!prompt) {
-        prompt = '>';
-    }
-    var inp = java.lang.System["in"];
-    var reader = new BufferedReader(new InputStreamReader(inp));
-    if (multiline) {
-        var line = '';
-        while (true) {
-            java.lang.System.err.print(prompt);
-            java.lang.System.err.flush();
-            var tmp = reader.readLine();
-            if (tmp == '' || tmp == null) break;
-            line += tmp + '\n';
-        }
-        return line;
-    } else {
-        java.lang.System.err.print(prompt);
-        java.lang.System.err.flush();
-        return reader.readLine();
-    }
-}
-
-if (typeof(println) == 'undefined') {
-    var print = function(str, newline) {
-        if (typeof(str) == 'undefined') {
-            str = 'undefined';
-        } else if (str == null) {
-            str = 'null';
-        }
-
-        if (!(out instanceof java.io.PrintWriter)) {
-            out = new java.io.PrintWriter(out);
-        }
-
-        out.print(String(str));
-        if (newline) {
-            out.print('\n');
-        }
-        out.flush();
-    }
-
-    var println = function(str) {
-        print(str, true);
-    };
-}
-
-/**
- * This is C-like printf
- *
- * @param format string to format the rest of the print items
- * @param args variadic argument list
- */
-function printf(format, args/*, more args*/) {
-    print(sprintf.apply(this, arguments));
-}
-
-/**
- * This is C-like sprintf
- *
- * @param format string to format the rest of the print items
- * @param args variadic argument list
- */
-function sprintf(format, args/*, more args*/) {
-    var len = arguments.length - 1;
-    var array = [];
-
-    if (len < 0) {
-        return "";
-    }
-
-    for (var i = 0; i < len; i++) {
-        if (arguments[i+1] instanceof Date) {
-            array[i] = arguments[i+1].getTime();
-        } else {
-            array[i] = arguments[i+1];
-        }
-    }
-
-    array = Java.toJavaArray(array);
-    return Packages.jdk.nashorn.api.scripting.Formatter.format(format, array);
-}
--- a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java	Fri Apr 05 14:51:24 2013 -0700
@@ -37,13 +37,16 @@
 import static jdk.nashorn.internal.ir.Symbol.IS_INTERNAL;
 import static jdk.nashorn.internal.ir.Symbol.IS_LET;
 import static jdk.nashorn.internal.ir.Symbol.IS_PARAM;
+import static jdk.nashorn.internal.ir.Symbol.IS_SCOPE;
 import static jdk.nashorn.internal.ir.Symbol.IS_THIS;
 import static jdk.nashorn.internal.ir.Symbol.IS_VAR;
+import static jdk.nashorn.internal.ir.Symbol.KINDMASK;
 
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.LinkedList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Set;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.AccessNode;
@@ -55,14 +58,15 @@
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IndexNode;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ObjectNode;
 import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
@@ -115,6 +119,8 @@
      */
     private Set<String> localUses;
 
+    private final LexicalContext lexicalContext = new LexicalContext();
+
     private static final DebugLogger LOG   = new DebugLogger("attr");
     private static final boolean     DEBUG = LOG.isEnabled();
 
@@ -135,14 +141,15 @@
     }
 
     @Override
-    public Node leave(final AccessNode accessNode) {
+    public Node leaveAccessNode(final AccessNode accessNode) {
         newTemporary(Type.OBJECT, accessNode);  //While Object type is assigned here, Access Specialization in FinalizeTypes may narrow this
         end(accessNode);
         return accessNode;
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
+        lexicalContext.push(block);
         start(block);
 
         final Set<String> savedLocalDefs = localDefs;
@@ -158,9 +165,7 @@
             localDefs = new HashSet<>(savedLocalDefs);
             localUses = new HashSet<>(savedLocalUses);
 
-            for (final Node statement : block.getStatements()) {
-                statement.accept(this);
-            }
+            block.visitStatements(this);
         } finally {
             localDefs = savedLocalDefs;
             localUses = savedLocalUses;
@@ -170,11 +175,12 @@
 
         end(block);
 
+        lexicalContext.pop(block);
         return null;
     }
 
     @Override
-    public Node enter(final CallNode callNode) {
+    public Node enterCallNode(final CallNode callNode) {
         start(callNode);
 
         callNode.getFunction().accept(this);
@@ -195,8 +201,7 @@
             evalArgs.setThis(thisNode);
         }
 
-        newTemporary(Type.OBJECT, callNode); // object type here, access specialization in FinalizeTypes may narrow it later
-        newType(callNode.getFunction().getSymbol(), Type.OBJECT);
+        newTemporary(callNode.getType(), callNode); // access specialization in FinalizeTypes may narrow it further later
 
         end(callNode);
 
@@ -204,29 +209,106 @@
     }
 
     @Override
-    public Node enter(final CatchNode catchNode) {
+    public Node enterCatchNode(final CatchNode catchNode) {
         final IdentNode exception = catchNode.getException();
         final Block     block     = getCurrentBlock();
 
         start(catchNode);
 
         // define block-local exception variable
-        final Symbol def = block.defineSymbol(exception.getName(), IS_VAR | IS_LET, exception);
+        final Symbol def = defineSymbol(block, exception.getName(), IS_VAR | IS_LET, exception);
         newType(def, Type.OBJECT);
         addLocalDef(exception.getName());
 
         return catchNode;
     }
 
+    /**
+     * Declare the definition of a new symbol.
+     *
+     * @param name         Name of symbol.
+     * @param symbolFlags  Symbol flags.
+     * @param node         Defining Node.
+     *
+     * @return Symbol for given name or null for redefinition.
+     */
+    private Symbol defineSymbol(final Block block, final String name, final int symbolFlags, final Node node) {
+        int    flags  = symbolFlags;
+        Symbol symbol = findSymbol(block, name); // Locate symbol.
+
+        if ((flags & KINDMASK) == IS_GLOBAL) {
+            flags |= IS_SCOPE;
+        }
+
+        final FunctionNode function = lexicalContext.getFunction(block);
+        if (symbol != null) {
+            // Symbol was already defined. Check if it needs to be redefined.
+            if ((flags & KINDMASK) == IS_PARAM) {
+                if (!isLocal(function, symbol)) {
+                    // Not defined in this function. Create a new definition.
+                    symbol = null;
+                } else if (symbol.isParam()) {
+                    // Duplicate parameter. Null return will force an error.
+                    assert false : "duplicate parameter";
+                    return null;
+                }
+            } else if ((flags & KINDMASK) == IS_VAR) {
+                if ((flags & IS_INTERNAL) == IS_INTERNAL || (flags & IS_LET) == IS_LET) {
+                    assert !((flags & IS_LET) == IS_LET && symbol.getBlock() == block) : "duplicate let variable in block";
+                    // Always create a new definition.
+                    symbol = null;
+                } else {
+                    // Not defined in this function. Create a new definition.
+                    if (!isLocal(function, symbol) || symbol.less(IS_VAR)) {
+                        symbol = null;
+                    }
+                }
+            }
+        }
+
+        if (symbol == null) {
+            // If not found, then create a new one.
+            Block symbolBlock;
+
+            // Determine where to create it.
+            if ((flags & Symbol.KINDMASK) == IS_VAR && ((flags & IS_INTERNAL) == IS_INTERNAL || (flags & IS_LET) == IS_LET)) {
+                symbolBlock = block;
+            } else {
+                symbolBlock = function;
+            }
+
+            // Create and add to appropriate block.
+            symbol = new Symbol(name, flags, node, symbolBlock);
+            symbolBlock.putSymbol(name, symbol);
+
+            if ((flags & Symbol.KINDMASK) != IS_GLOBAL) {
+                symbolBlock.getFrame().addSymbol(symbol);
+                symbol.setNeedsSlot(true);
+            }
+        } else if (symbol.less(flags)) {
+            symbol.setFlags(flags);
+        }
+
+        if (node != null) {
+            node.setSymbol(symbol);
+        }
+
+        return symbol;
+    }
+
     @Override
-    public Node enter(final FunctionNode functionNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
         start(functionNode, false);
         if (functionNode.isLazy()) {
-            LOG.info("LAZY: " + functionNode.getName());
+            LOG.info("LAZY: " + functionNode.getName() + " => Promoting to OBJECT");
+            newTemporary(lexicalContext.getCurrentFunction(), Type.OBJECT, functionNode);
+            functionNode.setReturnType(Type.OBJECT);
             end(functionNode);
             return null;
         }
 
+        lexicalContext.push(functionNode);
+
         clearLocalDefs();
         clearLocalUses();
 
@@ -242,24 +324,36 @@
         initScope(functionNode);
         initReturn(functionNode);
 
-        // Add all nested functions as symbols in this function
-        for (final FunctionNode nestedFunction : functionNode.getFunctions()) {
+        // Add all nested declared functions as symbols in this function
+        for (final FunctionNode nestedFunction : functionNode.getDeclaredFunctions()) {
             final IdentNode ident = nestedFunction.getIdent();
-            if (ident != null && nestedFunction.isStatement()) {
-                final Symbol functionSymbol = functionNode.defineSymbol(ident.getName(), IS_VAR, nestedFunction);
+            if (ident != null) {
+                assert nestedFunction.isDeclared();
+                final Symbol functionSymbol = defineSymbol(functionNode, ident.getName(), IS_VAR, nestedFunction);
                 newType(functionSymbol, Type.typeFor(ScriptFunction.class));
             }
         }
 
-        if (functionNode.isScript()) {
+        if (functionNode.isProgram()) {
             initFromPropertyMap(functionNode);
         }
 
         // Add function name as local symbol
-        if (!functionNode.isStatement() && !functionNode.isAnonymous() && !functionNode.isScript()) {
-            final Symbol selfSymbol = functionNode.defineSymbol(functionNode.getIdent().getName(), IS_VAR, functionNode);
-            newType(selfSymbol, Type.OBJECT);
-            selfSymbol.setNode(functionNode);
+        if (!functionNode.isDeclared() && !functionNode.isProgram()) {
+            if(functionNode.getSymbol() != null) {
+                // a temporary left over from an earlier pass when the function was lazy
+                assert functionNode.getSymbol().isTemp();
+                // remove it
+                functionNode.setSymbol(null);
+            }
+            final Symbol selfSymbol;
+            if(functionNode.isAnonymous()) {
+                selfSymbol = newTemporary(functionNode, Type.OBJECT, functionNode);
+            } else {
+                selfSymbol = defineSymbol(functionNode, functionNode.getIdent().getName(), IS_VAR, functionNode);
+                newType(selfSymbol, Type.OBJECT);
+                selfSymbol.setNode(functionNode);
+            }
         }
 
         /*
@@ -280,32 +374,26 @@
          */
 
         final List<Symbol> declaredSymbols = new ArrayList<>();
-        for (final VarNode decl : functionNode.getDeclarations()) {
-            final IdentNode ident = decl.getName();
-            // any declared symbols that aren't visited need to be typed as well, hence the list
-            declaredSymbols.add(functionNode.defineSymbol(ident.getName(), IS_VAR, new IdentNode(ident)));
-        }
-
-        // Every nested function needs a definition in the outer function with its name. Add these.
-        for (final FunctionNode nestedFunction : functionNode.getFunctions()) {
-            final VarNode varNode = nestedFunction.getFunctionVarNode();
-            if (varNode != null) {
-                varNode.accept(this);
-                assert varNode.isFunctionVarNode() : varNode + " should be function var node";
+        // This visitor will assign symbol to all declared variables, except function declarations (which are taken care
+        // in a separate step above) and "var" declarations in for loop initializers.
+        functionNode.accept(new NodeOperatorVisitor() {
+            @Override
+            public Node enterFunctionNode(FunctionNode nestedFn) {
+                // Don't descend into nested functions
+                return nestedFn == functionNode ? nestedFn : null;
             }
-        }
-
-        for (final Node statement : functionNode.getStatements()) {
-            if (statement instanceof VarNode && ((VarNode)statement).isFunctionVarNode()) {
-                continue; //var nodes have already been processed, skip or they will generate additional defs/uses and false "can be undefined"
+            @Override
+            public Node enterVarNode(VarNode varNode) {
+                if(varNode.isStatement() && !varNode.isFunctionDeclaration()) {
+                    final IdentNode ident = varNode.getName();
+                    // any declared symbols that aren't visited need to be typed as well, hence the list
+                    declaredSymbols.add(defineSymbol(functionNode, ident.getName(), IS_VAR, new IdentNode(ident)));
+                }
+                return null;
             }
-            statement.accept(this);
-        }
+        });
 
-        for (final FunctionNode nestedFunction : functionNode.getFunctions()) {
-            LOG.info("Going into nested function " + functionNode.getName() + " -> " + nestedFunction.getName());
-            nestedFunction.accept(this);
-        }
+        visitFunctionStatements(functionNode);
 
         //unknown parameters are promoted to object type.
         finalizeParameters(functionNode);
@@ -332,13 +420,28 @@
             functionNode.setNeedsSelfSymbol(functionNode.getSelfSymbolInit().accept(this));
         }
 
+        if (functionNode.hasLazyChildren()) {
+            objectifySymbols(functionNode);
+        }
+
         functionNode.popFrame();
 
+        functionNode.setState(CompilationState.ATTR);
+
         end(functionNode, false);
+        lexicalContext.pop(functionNode);
 
         return null;
     }
 
+    private void visitFunctionStatements(final FunctionNode functionNode) {
+        final List<Node> newStatements = new ArrayList<>(functionNode.getStatements());
+        for(ListIterator<Node> stmts = newStatements.listIterator(); stmts.hasNext();) {
+            stmts.set(stmts.next().accept(this));
+        }
+        functionNode.setStatements(newStatements);
+    }
+
     @Override
     public Node leaveCONVERT(final UnaryNode unaryNode) {
         assert false : "There should be no convert operators in IR during Attribution";
@@ -347,7 +450,7 @@
     }
 
     @Override
-    public Node enter(final IdentNode identNode) {
+    public Node enterIdentNode(final IdentNode identNode) {
         final String name = identNode.getName();
 
         start(identNode);
@@ -364,7 +467,7 @@
         final Block  block     = getCurrentBlock();
         final Symbol oldSymbol = identNode.getSymbol();
 
-        Symbol symbol = block.findSymbol(name);
+        Symbol symbol = findSymbol(block, name);
 
         //If an existing symbol with the name is found, use that otherwise, declare a new one
         if (symbol != null) {
@@ -388,22 +491,13 @@
             }
 
             identNode.setSymbol(symbol);
-            if (!getCurrentFunctionNode().isLocal(symbol)) {
-                // non-local: we need to put symbol in scope (if it isn't already)
-                if (!symbol.isScope()) {
-                    final List<Block> lookupBlocks = findLookupBlocksHelper(getCurrentFunctionNode(), symbol.findFunction());
-                    for (final Block lookupBlock : lookupBlocks) {
-                        final Symbol refSymbol = lookupBlock.findSymbol(name);
-                        if (refSymbol != null) { // See NASHORN-837, function declaration in lexical scope: try {} catch (x){ function f() { use(x) } } f()
-                            LOG.finest("Found a ref symbol that must be scope " + refSymbol);
-                            refSymbol.setIsScope();
-                        }
-                    }
-                }
+            // non-local: we need to put symbol in scope (if it isn't already)
+            if (!isLocal(getCurrentFunctionNode(), symbol) && !symbol.isScope()) {
+                symbol.setIsScope();
             }
         } else {
             LOG.info("No symbol exists. Declare undefined: " + symbol);
-            symbol = block.useSymbol(name, identNode);
+            symbol = useSymbol(block, name, identNode);
             // we have never seen this before, it can be undefined
             newType(symbol, Type.OBJECT); // TODO unknown -we have explicit casts anyway?
             symbol.setCanBeUndefined();
@@ -412,9 +506,10 @@
 
         assert symbol != null;
         if(symbol.isGlobal()) {
-            getCurrentFunctionNode().setUsesGlobalSymbol();
+            setUsesGlobalSymbol();
         } else if(symbol.isScope()) {
-            getCurrentFunctionNode().setUsesScopeSymbol(symbol);
+            final Iterator<Block> blocks = lexicalContext.getBlocks();
+            blocks.next().setUsesScopeSymbol(symbol, blocks);
         }
 
         if (symbol != oldSymbol && !identNode.isInitializedHere()) {
@@ -427,15 +522,68 @@
         return null;
     }
 
+    /**
+     * Marks the current function as one using any global symbol. The function and all its parent functions will all be
+     * marked as needing parent scope.
+     * @see #needsParentScope()
+     */
+    private void setUsesGlobalSymbol() {
+        for(final Iterator<FunctionNode> fns = lexicalContext.getFunctions(); fns.hasNext();) {
+            fns.next().setUsesAncestorScope();
+        }
+    }
+
+    /**
+     * Declare the use of a symbol in a block.
+     *
+     * @param block block in which the symbol is used
+     * @param name Name of symbol.
+     * @param node Using node
+     *
+     * @return Symbol for given name.
+     */
+    private Symbol useSymbol(final Block block, final String name, final Node node) {
+        Symbol symbol = findSymbol(block, name);
+
+        if (symbol == null) {
+            // If not found, declare as a free var.
+            symbol = defineSymbol(block, name, IS_GLOBAL, node);
+        } else {
+            node.setSymbol(symbol);
+        }
+
+        return symbol;
+    }
+
+
+    /**
+     * Search for symbol in the lexical context starting from the given block.
+     * @param name Symbol name.
+     * @return Found symbol or null if not found.
+     */
+    private Symbol findSymbol(final Block block, final String name) {
+        // Search up block chain to locate symbol.
+
+        for(final Iterator<Block> blocks = lexicalContext.getBlocks(block); blocks.hasNext();) {
+            // Find name.
+            final Symbol symbol = blocks.next().getExistingSymbol(name);
+            // If found then we are good.
+            if(symbol != null) {
+                return symbol;
+            }
+        }
+        return null;
+    }
+
     @Override
-    public Node leave(final IndexNode indexNode) {
-        newTemporary(Type.OBJECT, indexNode); //TORO
+    public Node leaveIndexNode(final IndexNode indexNode) {
+        newTemporary(Type.OBJECT, indexNode); //TODO
         return indexNode;
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    public Node enter(final LiteralNode literalNode) {
+    public Node enterLiteralNode(final LiteralNode literalNode) {
         try {
             start(literalNode);
             assert !literalNode.isTokenType(TokenType.THIS) : "tokentype for " + literalNode + " is this"; //guard against old dead code case. literal nodes should never inherit tokens
@@ -464,14 +612,14 @@
     }
 
     @Override
-    public Node leave(final ObjectNode objectNode) {
+    public Node leaveObjectNode(final ObjectNode objectNode) {
         newTemporary(Type.OBJECT, objectNode);
         end(objectNode);
         return objectNode;
     }
 
     @Override
-    public Node enter(final PropertyNode propertyNode) {
+    public Node enterPropertyNode(final PropertyNode propertyNode) {
         // assign a pseudo symbol to property name, see NASHORN-710
         propertyNode.setSymbol(new Symbol(propertyNode.getKeyName(), 0, Type.OBJECT));
         end(propertyNode);
@@ -479,31 +627,7 @@
     }
 
     @Override
-    public Node enter(final ReferenceNode referenceNode) {
-        final FunctionNode functionNode = referenceNode.getReference();
-        if (functionNode != null) {
-            functionNode.addReferencingParentBlock(getCurrentBlock());
-        }
-        return referenceNode;
-    }
-
-    @Override
-    public Node leave(final ReferenceNode referenceNode) {
-        newTemporary(Type.OBJECT, referenceNode); //reference node type is always an object, i.e. the scriptFunction. the function return type varies though
-
-        final FunctionNode functionNode = referenceNode.getReference();
-        //assert !functionNode.getType().isUnknown() || functionNode.isLazy() : functionNode.getType();
-        if (functionNode.isLazy()) {
-            LOG.info("Lazy function node call reference: " + functionNode.getName() + " => Promoting to OBJECT");
-            functionNode.setReturnType(Type.OBJECT);
-        }
-        end(referenceNode);
-
-        return referenceNode;
-    }
-
-    @Override
-    public Node leave(final ReturnNode returnNode) {
+    public Node leaveReturnNode(final ReturnNode returnNode) {
         final Node expr = returnNode.getExpression();
 
         if (expr != null) {
@@ -522,7 +646,7 @@
     }
 
     @Override
-    public Node leave(final SwitchNode switchNode) {
+    public Node leaveSwitchNode(final SwitchNode switchNode) {
         Type type = Type.UNKNOWN;
 
         for (final CaseNode caseNode : switchNode.getCases()) {
@@ -559,7 +683,7 @@
     }
 
     @Override
-    public Node leave(final TryNode tryNode) {
+    public Node leaveTryNode(final TryNode tryNode) {
         tryNode.setException(exceptionSymbol());
 
         if (tryNode.getFinallyBody() != null) {
@@ -572,13 +696,13 @@
     }
 
     @Override
-    public Node enter(final VarNode varNode) {
+    public Node enterVarNode(final VarNode varNode) {
         start(varNode);
 
         final IdentNode ident = varNode.getName();
         final String    name  = ident.getName();
 
-        final Symbol symbol = getCurrentBlock().defineSymbol(name, IS_VAR, ident);
+        final Symbol symbol = defineSymbol(getCurrentBlock(), name, IS_VAR, ident);
         assert symbol != null;
 
         LOG.info("VarNode " + varNode + " set symbol " + symbol);
@@ -590,23 +714,15 @@
             symbol.setCanBeUndefined();
         }
 
-        if (varNode.getInit() != null) {
-            varNode.getInit().accept(this);
-        }
-
         return varNode;
     }
 
     @Override
-    public Node leave(final VarNode varNode) {
+    public Node leaveVarNode(final VarNode varNode) {
         final Node      init  = varNode.getInit();
         final IdentNode ident = varNode.getName();
         final String    name  = ident.getName();
 
-        if (init != null) {
-            addLocalDef(name);
-        }
-
         if (init == null) {
             // var x; with no init will be treated like a use of x by
             // visit(IdentNode) unless we remove the name
@@ -615,8 +731,10 @@
             return varNode;
         }
 
+        addLocalDef(name);
+
         final Symbol  symbol   = varNode.getSymbol();
-        final boolean isScript = symbol.getBlock().getFunction().isScript(); //see NASHORN-56
+        final boolean isScript = lexicalContext.getFunction(symbol.getBlock()).isProgram(); //see NASHORN-56
         if ((init.getType().isNumeric() || init.getType().isBoolean()) && !isScript) {
             // Forbid integers as local vars for now as we have no way to treat them as undefined
             newType(symbol, init.getType());
@@ -710,11 +828,9 @@
         runtimeNode = new RuntimeNode(unaryNode, request, args);
         assert runtimeNode.getSymbol() == unaryNode.getSymbol(); //clone constructor should do this
 
-        runtimeNode.accept(this);
-        return runtimeNode;
+        return leaveRuntimeNode(runtimeNode);
     }
 
-
     @Override
     public Node leaveNEW(final UnaryNode unaryNode) {
         newTemporary(Type.OBJECT, unaryNode);
@@ -747,7 +863,7 @@
         runtimeNode = new RuntimeNode(unaryNode, Request.TYPEOF, args);
         assert runtimeNode.getSymbol() == unaryNode.getSymbol();
 
-        runtimeNode.accept(this);
+        runtimeNode = (RuntimeNode)leaveRuntimeNode(runtimeNode);
 
         end(unaryNode);
 
@@ -755,7 +871,7 @@
     }
 
     @Override
-    public Node leave(final RuntimeNode runtimeNode) {
+    public Node leaveRuntimeNode(final RuntimeNode runtimeNode) {
         newTemporary(runtimeNode.getRequest().getReturnType(), runtimeNode);
         return runtimeNode;
     }
@@ -815,12 +931,12 @@
             final IdentNode ident = (IdentNode)lhs;
             final String    name  = ident.getName();
 
-            Symbol symbol = getCurrentBlock().findSymbol(name);
+            Symbol symbol = findSymbol(getCurrentBlock(), name);
 
             if (symbol == null) {
-                symbol = block.defineSymbol(name, IS_GLOBAL, ident);
+                symbol = defineSymbol(block, name, IS_GLOBAL, ident);
                 binaryNode.setSymbol(symbol);
-            } else if (!getCurrentFunctionNode().isLocal(symbol)) {
+            } else if (!isLocal(getCurrentFunctionNode(), symbol)) {
                 symbol.setIsScope();
             }
 
@@ -830,6 +946,12 @@
         return binaryNode;
     }
 
+    private boolean isLocal(FunctionNode function, Symbol symbol) {
+        final Block block = symbol.getBlock();
+        // some temp symbols have no block, so can be assumed local
+        return block == null || lexicalContext.getFunction(block) == function;
+    }
+
     @Override
     public Node enterASSIGN(final BinaryNode binaryNode) {
         return enterAssignmentNode(binaryNode);
@@ -957,20 +1079,17 @@
 
     @Override
     public Node leaveBIT_AND(final BinaryNode binaryNode) {
-        newTemporary(Type.INT, binaryNode);
-        return binaryNode;
+        return end(coerce(binaryNode, Type.INT));
     }
 
     @Override
     public Node leaveBIT_OR(final BinaryNode binaryNode) {
-        newTemporary(Type.INT, binaryNode);
-        return binaryNode;
+        return end(coerce(binaryNode, Type.INT));
     }
 
     @Override
     public Node leaveBIT_XOR(final BinaryNode binaryNode) {
-        newTemporary(Type.INT, binaryNode);
-        return binaryNode;
+        return end(coerce(binaryNode, Type.INT));
     }
 
     @Override
@@ -990,7 +1109,7 @@
         return leaveBinaryArithmetic(binaryNode);
     }
 
-    private Node leaveCmp(final BinaryNode binaryNode, final RuntimeNode.Request request) {
+    private Node leaveCmp(final BinaryNode binaryNode) {
         final Node lhs = binaryNode.lhs();
         final Node rhs = binaryNode.rhs();
 
@@ -1002,49 +1121,64 @@
         return binaryNode;
     }
 
+    private Node coerce(final BinaryNode binaryNode, final Type operandType, final Type destType) {
+        // TODO we currently don't support changing inferred type based on uses, only on
+        // definitions. we would need some additional logic. We probably want to do that
+        // in the future, if e.g. a specialized method gets parameter that is only used
+        // as, say, an int : function(x) { return x & 4711 }, and x is not defined in
+        // the function. to make this work, uncomment the following two type inferences
+        // and debug.
+
+        //newType(binaryNode.lhs().getSymbol(), operandType);
+        //newType(binaryNode.rhs().getSymbol(), operandType);
+        newTemporary(destType, binaryNode);
+        return binaryNode;
+    }
+
+    private Node coerce(final BinaryNode binaryNode, final Type type) {
+        return coerce(binaryNode, type, type);
+    }
+
     //leave a binary node and inherit the widest type of lhs , rhs
     private Node leaveBinaryArithmetic(final BinaryNode binaryNode) {
-        if (!Compiler.shouldUseIntegerArithmetic()) {
-            newTemporary(Type.NUMBER, binaryNode);
-            return binaryNode;
-        }
-        newTemporary(Type.widest(binaryNode.lhs().getType(), binaryNode.rhs().getType(), Type.NUMBER), binaryNode);
-        return binaryNode;
+        assert !Compiler.shouldUseIntegerArithmetic();
+        return end(coerce(binaryNode, Type.NUMBER));
     }
 
     @Override
     public Node leaveEQ(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.EQ);
+        return leaveCmp(binaryNode);
     }
 
     @Override
     public Node leaveEQ_STRICT(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.EQ_STRICT);
+        return leaveCmp(binaryNode);
     }
 
     @Override
     public Node leaveGE(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.GE);
+        return leaveCmp(binaryNode);
     }
 
     @Override
     public Node leaveGT(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.GT);
+        return leaveCmp(binaryNode);
     }
 
     @Override
     public Node leaveIN(final BinaryNode binaryNode) {
-        try {
-            return new RuntimeNode(binaryNode, Request.IN).accept(this);
-        } finally {
-            end(binaryNode);
-        }
+        return leaveBinaryRuntimeOperator(binaryNode, Request.IN);
     }
 
     @Override
     public Node leaveINSTANCEOF(final BinaryNode binaryNode) {
+        return leaveBinaryRuntimeOperator(binaryNode, Request.INSTANCEOF);
+    }
+
+    private Node leaveBinaryRuntimeOperator(final BinaryNode binaryNode, final Request request) {
         try {
-            return new RuntimeNode(binaryNode, Request.INSTANCEOF).accept(this);
+            // Don't do a full RuntimeNode.accept, as we don't want to double-visit the binary node operands
+            return leaveRuntimeNode(new RuntimeNode(binaryNode, request));
         } finally {
             end(binaryNode);
         }
@@ -1052,12 +1186,12 @@
 
     @Override
     public Node leaveLE(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.LE);
+        return leaveCmp(binaryNode);
     }
 
     @Override
     public Node leaveLT(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.LT);
+        return leaveCmp(binaryNode);
     }
 
     @Override
@@ -1072,12 +1206,12 @@
 
     @Override
     public Node leaveNE(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.NE);
+        return leaveCmp(binaryNode);
     }
 
     @Override
     public Node leaveNE_STRICT(final BinaryNode binaryNode) {
-        return leaveCmp(binaryNode, Request.NE_STRICT);
+        return leaveCmp(binaryNode);
     }
 
     @Override
@@ -1089,23 +1223,17 @@
 
     @Override
     public Node leaveSAR(final BinaryNode binaryNode) {
-        newTemporary(Type.INT, binaryNode);
-        end(binaryNode);
-        return binaryNode;
+        return end(coerce(binaryNode, Type.INT));
     }
 
     @Override
     public Node leaveSHL(final BinaryNode binaryNode) {
-        newTemporary(Type.INT, binaryNode);
-        end(binaryNode);
-        return binaryNode;
+        return end(coerce(binaryNode, Type.INT));
     }
 
     @Override
     public Node leaveSHR(final BinaryNode binaryNode) {
-        newTemporary(Type.LONG, binaryNode);
-        end(binaryNode);
-        return binaryNode;
+        return end(coerce(binaryNode, Type.LONG));
     }
 
     @Override
@@ -1114,9 +1242,9 @@
     }
 
     @Override
-    public Node leave(final ForNode forNode) {
+    public Node leaveForNode(final ForNode forNode) {
         if (forNode.isForIn()) {
-            forNode.setIterator(newInternal(getCurrentFunctionNode(), getCurrentFunctionNode().uniqueName(ITERATOR_PREFIX.tag()), Type.OBJECT)); //NASHORN-73
+            forNode.setIterator(newInternal(getCurrentFunctionNode().uniqueName(ITERATOR_PREFIX.tag()), Type.OBJECT)); //NASHORN-73
             /*
              * Iterators return objects, so we need to widen the scope of the
              * init variable if it, for example, has been assigned double type
@@ -1131,7 +1259,7 @@
     }
 
     @Override
-    public Node leave(final TernaryNode ternaryNode) {
+    public Node leaveTernaryNode(final TernaryNode ternaryNode) {
         final Node lhs  = ternaryNode.rhs();
         final Node rhs  = ternaryNode.third();
 
@@ -1146,24 +1274,24 @@
         return ternaryNode;
     }
 
-    private static void initThis(final FunctionNode functionNode) {
-        final Symbol thisSymbol = functionNode.defineSymbol(THIS.tag(), IS_PARAM | IS_THIS, null);
+    private void initThis(final FunctionNode functionNode) {
+        final Symbol thisSymbol = defineSymbol(functionNode, THIS.tag(), IS_PARAM | IS_THIS, null);
         newType(thisSymbol, Type.OBJECT);
         thisSymbol.setNeedsSlot(true);
         functionNode.getThisNode().setSymbol(thisSymbol);
         LOG.info("Initialized scope symbol: " + thisSymbol);
     }
 
-    private static void initScope(final FunctionNode functionNode) {
-        final Symbol scopeSymbol = functionNode.defineSymbol(SCOPE.tag(), IS_VAR | IS_INTERNAL, null);
+    private void initScope(final FunctionNode functionNode) {
+        final Symbol scopeSymbol = defineSymbol(functionNode, SCOPE.tag(), IS_VAR | IS_INTERNAL, null);
         newType(scopeSymbol, Type.typeFor(ScriptObject.class));
         scopeSymbol.setNeedsSlot(true);
         functionNode.getScopeNode().setSymbol(scopeSymbol);
         LOG.info("Initialized scope symbol: " + scopeSymbol);
     }
 
-    private static void initReturn(final FunctionNode functionNode) {
-        final Symbol returnSymbol = functionNode.defineSymbol(SCRIPT_RETURN.tag(), IS_VAR | IS_INTERNAL, null);
+    private void initReturn(final FunctionNode functionNode) {
+        final Symbol returnSymbol = defineSymbol(functionNode, SCRIPT_RETURN.tag(), IS_VAR | IS_INTERNAL, null);
         newType(returnSymbol, Type.OBJECT);
         returnSymbol.setNeedsSlot(true);
         functionNode.getResultNode().setSymbol(returnSymbol);
@@ -1173,7 +1301,7 @@
 
     private void initVarArg(final FunctionNode functionNode) {
         if (functionNode.isVarArg()) {
-            final Symbol varArgsSymbol = functionNode.defineSymbol(VARARGS.tag(), IS_PARAM | IS_INTERNAL, null);
+            final Symbol varArgsSymbol = defineSymbol(functionNode, VARARGS.tag(), IS_PARAM | IS_INTERNAL, null);
             varArgsSymbol.setTypeOverride(Type.OBJECT_ARRAY);
             varArgsSymbol.setNeedsSlot(true);
             functionNode.getVarArgsNode().setSymbol(varArgsSymbol);
@@ -1181,7 +1309,7 @@
 
             if (functionNode.needsArguments()) {
                 final String    argumentsName   = functionNode.getArgumentsNode().getName();
-                final Symbol    argumentsSymbol = functionNode.defineSymbol(argumentsName, IS_VAR | IS_INTERNAL, null);
+                final Symbol    argumentsSymbol = defineSymbol(functionNode, argumentsName, IS_VAR | IS_INTERNAL, null);
                 newType(argumentsSymbol, Type.typeFor(ScriptObject.class));
                 argumentsSymbol.setNeedsSlot(true);
                 functionNode.getArgumentsNode().setSymbol(argumentsSymbol);
@@ -1191,9 +1319,9 @@
         }
     }
 
-    private static void initCallee(final FunctionNode functionNode) {
+    private void initCallee(final FunctionNode functionNode) {
         assert functionNode.getCalleeNode() != null : functionNode + " has no callee";
-        final Symbol calleeSymbol = functionNode.defineSymbol(CALLEE.tag(), IS_PARAM | IS_INTERNAL, null);
+        final Symbol calleeSymbol = defineSymbol(functionNode, CALLEE.tag(), IS_PARAM | IS_INTERNAL, null);
         newType(calleeSymbol, Type.typeFor(ScriptFunction.class));
         calleeSymbol.setNeedsSlot(true);
         functionNode.getCalleeNode().setSymbol(calleeSymbol);
@@ -1211,11 +1339,17 @@
         // type or its parameters with the widest (OBJECT) type for safety.
         functionNode.setReturnType(Type.UNKNOWN);
 
-        for (final IdentNode ident : functionNode.getParameters()) {
-            addLocalDef(ident.getName());
-            final Symbol paramSymbol = functionNode.defineSymbol(ident.getName(), IS_PARAM, ident);
+        for (final IdentNode param : functionNode.getParameters()) {
+            addLocalDef(param.getName());
+            final Symbol paramSymbol = defineSymbol(functionNode, param.getName(), IS_PARAM, param);
             if (paramSymbol != null) {
-                newType(paramSymbol, Type.UNKNOWN);
+                final Type callSiteParamType = functionNode.getSpecializedType(param);
+                if (callSiteParamType != null) {
+                    LOG.info("Param " + paramSymbol + " has a callsite type " + callSiteParamType + ". Using that.");
+
+                    System.err.println("Param " + param + " has a callsite type " + callSiteParamType + ". Using that.");
+                }
+                newType(paramSymbol, callSiteParamType == null ? Type.UNKNOWN : callSiteParamType);
             }
 
             LOG.info("Initialized param " + paramSymbol);
@@ -1229,36 +1363,29 @@
      * @param functionNode functionNode
      */
     private static void finalizeParameters(final FunctionNode functionNode) {
-        boolean nonObjectParams = false;
-        List<Type> paramSpecializations = new ArrayList<>();
+        final boolean isVarArg = functionNode.isVarArg();
 
         for (final IdentNode ident : functionNode.getParameters()) {
             final Symbol paramSymbol = ident.getSymbol();
-            if (paramSymbol != null) {
-                Type type = paramSymbol.getSymbolType();
-                if (type.isUnknown()) {
-                    type = Type.OBJECT;
-                }
-                paramSpecializations.add(type);
-                if (!type.isObject()) {
-                    nonObjectParams = true;
-                }
-                newType(paramSymbol, Type.OBJECT);
+
+            assert paramSymbol != null;
+            Type type = functionNode.getSpecializedType(ident);
+            if (type == null) {
+                type = Type.OBJECT;
             }
-        }
 
-        if (!nonObjectParams) {
-            paramSpecializations = null;
-            // Later, when resolving a call to this method, the linker can say "I have a double, an int and an object" as parameters
-            // here. If the callee has parameter specializations, we can regenerate it with those particular types for speed.
-        } else {
-            LOG.info("parameter specialization possible: " + functionNode.getName() + " " + paramSpecializations);
-        }
+            // if we know that a parameter is only used as a certain type throughout
+            // this function, we can tell the runtime system that no matter what the
+            // call site is, use this information. TODO
+            if (!paramSymbol.getSymbolType().isObject()) {
+                LOG.finest("Parameter " + ident + " could profit from specialization to " + paramSymbol.getSymbolType());
+            }
 
-        // parameters should not be slots for a function that uses variable arity signature
-        if (functionNode.isVarArg()) {
-            for (final IdentNode param : functionNode.getParameters()) {
-                param.getSymbol().setNeedsSlot(false);
+            newType(paramSymbol, Type.widest(type, paramSymbol.getSymbolType()));
+
+            // parameters should not be slots for a function that uses variable arity signature
+            if (isVarArg) {
+                paramSymbol.setNeedsSlot(false);
             }
         }
     }
@@ -1267,15 +1394,15 @@
      * Move any properties from a global map into the scope of this method
      * @param functionNode the function node for which to init scope vars
      */
-    private static void initFromPropertyMap(final FunctionNode functionNode) {
+    private void initFromPropertyMap(final FunctionNode functionNode) {
         // For a script, add scope symbols as defined in the property map
-        assert functionNode.isScript();
+        assert functionNode.isProgram();
 
         final PropertyMap map = Context.getGlobalMap();
 
         for (final Property property : map.getProperties()) {
             final String key    = property.getKey();
-            final Symbol symbol = functionNode.defineSymbol(key, IS_GLOBAL, null);
+            final Symbol symbol = defineSymbol(functionNode, key, IS_GLOBAL, null);
             newType(symbol, Type.OBJECT);
             LOG.info("Added global symbol from property map " + symbol);
         }
@@ -1342,9 +1469,14 @@
     private static void ensureAssignmentSlots(final FunctionNode functionNode, final Node assignmentDest) {
         assignmentDest.accept(new NodeVisitor() {
             @Override
-            public Node leave(final IndexNode indexNode) {
+            public Node leaveIndexNode(final IndexNode indexNode) {
+                assert indexNode.getSymbol().isTemp();
                 final Node index = indexNode.getIndex();
-                index.getSymbol().setNeedsSlot(!index.getSymbol().isConstant());
+                //only temps can be set as needing slots. the others will self resolve
+                //it is illegal to take a scope var and force it to be a slot, that breaks
+                if (index.getSymbol().isTemp() && !index.getSymbol().isConstant()) {
+                     index.getSymbol().setNeedsSlot(true);
+                }
                 return indexNode;
             }
         });
@@ -1387,7 +1519,7 @@
                 }
 
                 @Override
-                public Node enter(final FunctionNode node) {
+                public Node enterFunctionNode(final FunctionNode node) {
                     return node.isLazy() ? null : node;
                 }
 
@@ -1407,7 +1539,7 @@
                  */
                 @SuppressWarnings("fallthrough")
                 @Override
-                public Node leave(final BinaryNode binaryNode) {
+                public Node leaveBinaryNode(final BinaryNode binaryNode) {
                     final Type widest = Type.widest(binaryNode.lhs().getType(), binaryNode.rhs().getType());
                     switch (binaryNode.tokenType()) {
                     default:
@@ -1465,22 +1597,6 @@
         return binaryNode;
     }
 
-    private static List<Block> findLookupBlocksHelper(final FunctionNode currentFunction, final FunctionNode topFunction) {
-        if (currentFunction.findParentFunction() == topFunction) {
-            final List<Block> blocks = new LinkedList<>();
-
-            blocks.add(currentFunction.getParent());
-            blocks.addAll(currentFunction.getReferencingParentBlocks());
-            return blocks;
-        }
-        /*
-         * assumption: all parent blocks of an inner function will always be in the same outer function;
-         * therefore we can simply skip through intermediate functions.
-         * @see FunctionNode#addReferencingParentBlock(Block)
-         */
-        return findLookupBlocksHelper(currentFunction.findParentFunction(), topFunction);
-    }
-
     private static boolean isFunctionExpressionSelfReference(final Symbol symbol) {
         if (symbol.isVar() && symbol.getNode() == symbol.getBlock() && symbol.getNode() instanceof FunctionNode) {
             return ((FunctionNode)symbol.getNode()).getIdent().getName().equals(symbol.getName());
@@ -1497,16 +1613,12 @@
         return newTemporary(getCurrentFunctionNode(), type, node);
     }
 
-    private Symbol newInternal(final FunctionNode functionNode, final String name, final Type type) {
-        final Symbol iter = getCurrentFunctionNode().defineSymbol(name, IS_VAR | IS_INTERNAL, null);
+    private Symbol newInternal(final String name, final Type type) {
+        final Symbol iter = defineSymbol(getCurrentFunctionNode(), name, IS_VAR | IS_INTERNAL, null);
         iter.setType(type); // NASHORN-73
         return iter;
     }
 
-    private Symbol newInternal(final String name, final Type type) {
-        return newInternal(getCurrentFunctionNode(), name, type);
-    }
-
     private static void newType(final Symbol symbol, final Type type) {
         final Type oldType = symbol.getSymbolType();
         symbol.setType(type);
@@ -1548,6 +1660,39 @@
         localUses.add(name);
     }
 
+    /**
+     * Pessimistically promote all symbols in current function node to Object types
+     * This is done when the function contains unevaluated black boxes such as
+     * lazy sub-function nodes that have not been compiled.
+     *
+     * @param functionNode function node in whose scope symbols should conservatively be made objects
+     */
+    private static void objectifySymbols(final FunctionNode functionNode) {
+        functionNode.accept(new NodeVisitor() {
+            private void toObject(final Block block) {
+                for (final Iterator<Symbol> iter = block.symbolIterator(); iter.hasNext();) {
+                    final Symbol symbol = iter.next();
+                    newType(symbol, Type.OBJECT);
+                }
+            }
+
+            @Override
+            public Node enterBlock(final Block block) {
+                toObject(block);
+                return block;
+            }
+
+            @Override
+            public Node enterFunctionNode(final FunctionNode node) {
+                toObject(node);
+                if (node.isLazy()) {
+                    return null;
+                }
+                return node;
+            }
+        });
+    }
+
     private static String name(final Node node) {
         final String cn = node.getClass().getName();
         int lastDot = cn.lastIndexOf('.');
--- a/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java	Fri Apr 05 14:51:24 2013 -0700
@@ -32,7 +32,6 @@
 import static jdk.nashorn.internal.codegen.Condition.LT;
 import static jdk.nashorn.internal.codegen.Condition.NE;
 
-import jdk.nashorn.internal.codegen.Label;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Node;
--- a/nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -195,6 +195,14 @@
     }
 
     /**
+     * Returns the name of the compile unit class name.
+     * @return the name of the compile unit class name.
+     */
+    String getUnitClassName() {
+        return unitClassName;
+    }
+
+    /**
      * Convert a binary name to a package/class name.
      *
      * @param name Binary name.
@@ -244,7 +252,7 @@
             // $getMap - get the ith entry from the constants table and cast to PropertyMap.
             final MethodEmitter getMapMethod = method(EnumSet.of(Flag.PUBLIC, Flag.STATIC), GET_MAP.tag(), PropertyMap.class, int.class);
             getMapMethod.begin();
-            getMapMethod.loadConstants(unitClassName)
+            getMapMethod.loadConstants()
                         .load(Type.INT, 0)
                         .arrayload()
                         .checkcast(PropertyMap.class)
@@ -254,7 +262,7 @@
             // $setMap - overwrite an existing map.
             final MethodEmitter setMapMethod = method(EnumSet.of(Flag.PUBLIC, Flag.STATIC), SET_MAP.tag(), void.class, int.class, PropertyMap.class);
             setMapMethod.begin();
-            setMapMethod.loadConstants(unitClassName)
+            setMapMethod.loadConstants()
                         .load(Type.INT, 0)
                         .load(Type.OBJECT, 1)
                         .arraystore();
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,10 +25,8 @@
 
 package jdk.nashorn.internal.codegen;
 
-import static jdk.nashorn.internal.codegen.ClassEmitter.Flag.HANDLE_STATIC;
 import static jdk.nashorn.internal.codegen.ClassEmitter.Flag.PRIVATE;
 import static jdk.nashorn.internal.codegen.ClassEmitter.Flag.STATIC;
-import static jdk.nashorn.internal.codegen.CompilerConstants.ALLOCATE;
 import static jdk.nashorn.internal.codegen.CompilerConstants.GET_MAP;
 import static jdk.nashorn.internal.codegen.CompilerConstants.GET_STRING;
 import static jdk.nashorn.internal.codegen.CompilerConstants.LEAF;
@@ -50,7 +48,6 @@
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_STRICT;
 
 import java.io.PrintWriter;
-import java.lang.invoke.MethodHandle;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.EnumSet;
@@ -79,9 +76,11 @@
 import jdk.nashorn.internal.ir.ExecuteNode;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IfNode;
 import jdk.nashorn.internal.ir.IndexNode;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LineNumberNode;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
@@ -89,7 +88,6 @@
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ObjectNode;
 import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
@@ -108,14 +106,14 @@
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.parser.Lexer.RegexToken;
 import jdk.nashorn.internal.parser.TokenType;
-import jdk.nashorn.internal.runtime.CodeInstaller;
 import jdk.nashorn.internal.runtime.Context;
+import jdk.nashorn.internal.runtime.DebugLogger;
 import jdk.nashorn.internal.runtime.ECMAException;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
+import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
 import jdk.nashorn.internal.runtime.Scope;
 import jdk.nashorn.internal.runtime.ScriptFunction;
-import jdk.nashorn.internal.runtime.ScriptFunctionData;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.ScriptRuntime;
 import jdk.nashorn.internal.runtime.Source;
@@ -149,8 +147,6 @@
     /** Name of the ScriptFunctionImpl, cannot be referred to as .class @see FunctionObjectCreator */
     private static final String SCRIPTFUNCTION_IMPL_OBJECT = Compiler.OBJECTS_PACKAGE + '/' + "ScriptFunctionImpl";
 
-    private static final String SCRIPTFUNCTION_TRAMPOLINE_OBJECT = Compiler.OBJECTS_PACKAGE + '/' + "ScriptFunctionTrampolineImpl";
-
     /** Constant data & installation. The only reason the compiler keeps this is because it is assigned
      *  by reflection in class installation */
     private final Compiler compiler;
@@ -161,12 +157,20 @@
     /** How many regexp fields have been emitted */
     private int regexFieldCount;
 
+    /** Used for temporary signaling between enterCallNode and enterFunctionNode to handle the special case of calling
+     * a just-defined anonymous function expression. */
+    private boolean functionNodeIsCallee;
+
     /** Map of shared scope call sites */
     private final Map<SharedScopeCall, SharedScopeCall> scopeCalls = new HashMap<>();
 
+    private final LexicalContext lexicalContext = new LexicalContext();
+
     /** When should we stop caching regexp expressions in fields to limit bytecode size? */
     private static final int MAX_REGEX_FIELDS = 2 * 1024;
 
+    private static final DebugLogger LOG   = new DebugLogger("codegen", "nashorn.codegen.debug");
+
     /**
      * Constructor.
      *
@@ -215,7 +219,7 @@
             final int flags = CALLSITE_SCOPE | getCallSiteFlags();
             method.loadScope();
 
-            if (symbol.isFastScope(getCurrentFunctionNode())) {
+            if (isFastScope(symbol)) {
                 // Only generate shared scope getter for fast-scope symbols so we know we can dial in correct scope.
                 if (symbol.getUseCount() > SharedScopeCall.FAST_SCOPE_GET_THRESHOLD) {
                     return loadSharedScopeVar(identNode.getType(), symbol, flags);
@@ -226,8 +230,28 @@
         }
     }
 
+    /**
+     * Check if this symbol can be accessed directly with a putfield or getfield or dynamic load
+     *
+     * @param function function to check for fast scope
+     * @return true if fast scope
+     */
+    private boolean isFastScope(final Symbol symbol) {
+        if (!symbol.isScope() || !symbol.getBlock().needsScope()) {
+            return false;
+        }
+        // Allow fast scope access if no function contains with or eval
+        for(final Iterator<FunctionNode> it = lexicalContext.getFunctions(getCurrentFunctionNode()); it.hasNext();) {
+            final FunctionNode func = it.next();
+            if (func.hasWith() || func.hasEval()) {
+                return false;
+            }
+        }
+        return true;
+    }
+
     private MethodEmitter loadSharedScopeVar(final Type valueType, final Symbol symbol, final int flags) {
-        method.load(symbol.isFastScope(getCurrentFunctionNode()) ? getScopeProtoDepth(getCurrentBlock(), symbol) : -1);
+        method.load(isFastScope(symbol) ? getScopeProtoDepth(getCurrentBlock(), symbol) : -1);
         final SharedScopeCall scopeCall = getScopeGet(valueType, symbol, flags | CALLSITE_FAST_SCOPE);
         scopeCall.generateInvoke(method);
         return method;
@@ -245,30 +269,18 @@
         return method;
     }
 
-    private static int getScopeProtoDepth(final Block currentBlock, final Symbol symbol) {
-        if (currentBlock == symbol.getBlock()) {
-            return 0;
-        }
-
-        final int   delta       = currentBlock.needsScope() ? 1 : 0;
-        final Block parentBlock = currentBlock.getParent();
-
-        if (parentBlock != null) {
-            final int result = getScopeProtoDepth(parentBlock, symbol);
-            if (result != -1) {
-                return delta + result;
+    private int getScopeProtoDepth(final Block startingBlock, final Symbol symbol) {
+        int depth = 0;
+        final Block definingBlock = symbol.getBlock();
+        for(final Iterator<Block> blocks = lexicalContext.getBlocks(startingBlock); blocks.hasNext();) {
+            final Block currentBlock = blocks.next();
+            if (currentBlock == definingBlock) {
+                return depth;
+            }
+            if (currentBlock.needsScope()) {
+                ++depth;
             }
         }
-
-        if (currentBlock instanceof FunctionNode) {
-            for (final Block lookupBlock : ((FunctionNode)currentBlock).getReferencingParentBlocks()) {
-                final int result = getScopeProtoDepth(lookupBlock, symbol);
-                if (result != -1) {
-                    return delta + result;
-                }
-            }
-        }
-
         return -1;
     }
 
@@ -318,13 +330,13 @@
 
         node.accept(new NodeVisitor(getCurrentCompileUnit(), method) {
             @Override
-            public Node enter(final IdentNode identNode) {
+            public Node enterIdentNode(final IdentNode identNode) {
                 loadIdent(identNode);
                 return null;
             }
 
             @Override
-            public Node enter(final AccessNode accessNode) {
+            public Node enterAccessNode(final AccessNode accessNode) {
                 if (!baseAlreadyOnStack) {
                     load(accessNode.getBase()).convert(Type.OBJECT);
                 }
@@ -334,7 +346,7 @@
             }
 
             @Override
-            public Node enter(final IndexNode indexNode) {
+            public Node enterIndexNode(final IndexNode indexNode) {
                 if (!baseAlreadyOnStack) {
                     load(indexNode.getBase()).convert(Type.OBJECT);
                     load(indexNode.getIndex());
@@ -344,6 +356,14 @@
             }
 
             @Override
+            public Node enterFunctionNode(FunctionNode functionNode) {
+                // function nodes will always leave a constructed function object on stack, no need to load the symbol
+                // separately as in enterDefault()
+                functionNode.accept(codegen);
+                return null;
+            }
+
+            @Override
             public Node enterDefault(final Node otherNode) {
                 otherNode.accept(codegen); // generate code for whatever we are looking at.
                 method.load(symbol); // load the final symbol to the stack (or nop if no slot, then result is already there)
@@ -355,7 +375,7 @@
     }
 
     @Override
-    public Node enter(final AccessNode accessNode) {
+    public Node enterAccessNode(final AccessNode accessNode) {
         if (accessNode.testResolved()) {
             return null;
         }
@@ -427,10 +447,11 @@
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         if (block.testResolved()) {
             return null;
         }
+        lexicalContext.push(block);
 
         method.label(block.getEntryLabel());
         initLocals(block);
@@ -439,14 +460,14 @@
     }
 
     @Override
-    public Node leave(final Block block) {
+    public Node leaveBlock(final Block block) {
         method.label(block.getBreakLabel());
         symbolInfo(block);
 
         if (block.needsScope()) {
             popBlockScope(block);
         }
-
+        lexicalContext.pop(block);
         return block;
     }
 
@@ -472,7 +493,7 @@
     }
 
     @Override
-    public Node enter(final BreakNode breakNode) {
+    public Node enterBreakNode(final BreakNode breakNode) {
         if (breakNode.testResolved()) {
             return null;
         }
@@ -520,14 +541,13 @@
     }
 
     @Override
-    public Node enter(final CallNode callNode) {
+    public Node enterCallNode(final CallNode callNode) {
         if (callNode.testResolved()) {
             return null;
         }
 
         final List<Node>   args            = callNode.getArgs();
         final Node         function        = callNode.getFunction();
-        final FunctionNode currentFunction = getCurrentFunctionNode();
         final Block        currentBlock    = getCurrentBlock();
 
         function.accept(new NodeVisitor(getCurrentCompileUnit(), method) {
@@ -536,7 +556,7 @@
                 final Symbol symbol = identNode.getSymbol();
                 int    scopeCallFlags = flags;
                 method.loadScope();
-                if (symbol.isFastScope(currentFunction)) {
+                if (isFastScope(symbol)) {
                     method.load(getScopeProtoDepth(currentBlock, symbol));
                     scopeCallFlags |= CALLSITE_FAST_SCOPE;
                 } else {
@@ -598,7 +618,7 @@
             }
 
             @Override
-            public Node enter(final IdentNode node) {
+            public Node enterIdentNode(final IdentNode node) {
                 final Symbol symbol = node.getSymbol();
 
                 if (symbol.isScope()) {
@@ -611,7 +631,7 @@
                     if (callNode.isEval()) {
                         evalCall(node, flags);
                     } else if (useCount <= SharedScopeCall.FAST_SCOPE_CALL_THRESHOLD
-                            || (!symbol.isFastScope(currentFunction) && useCount <= SharedScopeCall.SLOW_SCOPE_CALL_THRESHOLD)
+                            || (!isFastScope(symbol) && useCount <= SharedScopeCall.SLOW_SCOPE_CALL_THRESHOLD)
                             || callNode.inWithBlock()) {
                         scopeCall(node, flags);
                     } else {
@@ -626,7 +646,7 @@
             }
 
             @Override
-            public Node enter(final AccessNode node) {
+            public Node enterAccessNode(final AccessNode node) {
                 load(node.getBase());
                 method.convert(Type.OBJECT);
                 method.dup();
@@ -639,8 +659,7 @@
             }
 
             @Override
-            public Node enter(final ReferenceNode node) {
-                final FunctionNode callee   = node.getReference();
+            public Node enterFunctionNode(final FunctionNode callee) {
                 final boolean      isVarArg = callee.isVarArg();
                 final int          argCount = isVarArg ? -1 : callee.getParameters().size();
 
@@ -658,12 +677,13 @@
                 loadArgs(args, signature, isVarArg, argCount);
                 method.invokestatic(callee.getCompileUnit().getUnitClassName(), callee.getName(), signature);
                 assert method.peekType().equals(callee.getReturnType()) : method.peekType() + " != " + callee.getReturnType();
-
+                functionNodeIsCallee = true;
+                callee.accept(CodeGenerator.this);
                 return null;
             }
 
             @Override
-            public Node enter(final IndexNode node) {
+            public Node enterIndexNode(final IndexNode node) {
                 load(node.getBase());
                 method.convert(Type.OBJECT);
                 method.dup();
@@ -699,7 +719,7 @@
     }
 
     @Override
-    public Node enter(final ContinueNode continueNode) {
+    public Node enterContinueNode(final ContinueNode continueNode) {
         if (continueNode.testResolved()) {
             return null;
         }
@@ -714,17 +734,17 @@
     }
 
     @Override
-    public Node enter(final DoWhileNode doWhileNode) {
-        return enter((WhileNode)doWhileNode);
+    public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
+        return enterWhileNode(doWhileNode);
     }
 
     @Override
-    public Node enter(final EmptyNode emptyNode) {
+    public Node enterEmptyNode(final EmptyNode emptyNode) {
         return null;
     }
 
     @Override
-    public Node enter(final ExecuteNode executeNode) {
+    public Node enterExecuteNode(final ExecuteNode executeNode) {
         if (executeNode.testResolved()) {
             return null;
         }
@@ -736,7 +756,7 @@
     }
 
     @Override
-    public Node enter(final ForNode forNode) {
+    public Node enterForNode(final ForNode forNode) {
         if (forNode.testResolved()) {
             return null;
         }
@@ -818,7 +838,7 @@
      * @param block block with local vars.
      */
     private void initLocals(final Block block) {
-        final FunctionNode function       = block.getFunction();
+        final FunctionNode function       = lexicalContext.getFunction(block);
         final boolean      isFunctionNode = block == function;
 
         /*
@@ -920,7 +940,7 @@
             foc.makeObject(method);
 
             // runScript(): merge scope into global
-            if (isFunctionNode && function.isScript()) {
+            if (isFunctionNode && function.isProgram()) {
                 method.invoke(ScriptRuntime.MERGE_SCOPE);
             }
 
@@ -963,31 +983,42 @@
     }
 
     @Override
-    public Node enter(final FunctionNode functionNode) {
-        if (functionNode.isLazy()) {
-            return null;
-        }
+    public Node enterFunctionNode(final FunctionNode functionNode) {
+        final boolean isCallee = functionNodeIsCallee;
+        functionNodeIsCallee = false;
 
         if (functionNode.testResolved()) {
             return null;
         }
 
+        if(!(isCallee || functionNode == compiler.getFunctionNode())) {
+            newFunctionObject(functionNode);
+        }
+
+        if (functionNode.isLazy()) {
+            return null;
+        }
+
+        LOG.info("=== BEGIN " + functionNode.getName());
+        lexicalContext.push(functionNode);
+
         setCurrentCompileUnit(functionNode.getCompileUnit());
         assert getCurrentCompileUnit() != null;
 
-        method = getCurrentCompileUnit().getClassEmitter().method(functionNode);
+        setCurrentMethodEmitter(getCurrentCompileUnit().getClassEmitter().method(functionNode));
         functionNode.setMethodEmitter(method);
         // Mark end for variable tables.
         method.begin();
         method.label(functionNode.getEntryLabel());
 
         initLocals(functionNode);
+        functionNode.setState(CompilationState.EMITTED);
 
         return functionNode;
     }
 
     @Override
-    public Node leave(final FunctionNode functionNode) {
+    public Node leaveFunctionNode(final FunctionNode functionNode) {
         // Mark end for variable tables.
         method.label(functionNode.getBreakLabel());
 
@@ -1005,16 +1036,18 @@
             throw e;
         }
 
+        lexicalContext.pop(functionNode);
+        LOG.info("=== END " + functionNode.getName());
         return functionNode;
     }
 
     @Override
-    public Node enter(final IdentNode identNode) {
+    public Node enterIdentNode(final IdentNode identNode) {
         return null;
     }
 
     @Override
-    public Node enter(final IfNode ifNode) {
+    public Node enterIfNode(final IfNode ifNode) {
         if (ifNode.testResolved()) {
             return null;
         }
@@ -1053,7 +1086,7 @@
     }
 
     @Override
-    public Node enter(final IndexNode indexNode) {
+    public Node enterIndexNode(final IndexNode indexNode) {
         if (indexNode.testResolved()) {
             return null;
         }
@@ -1064,7 +1097,7 @@
     }
 
     @Override
-    public Node enter(final LineNumberNode lineNumberNode) {
+    public Node enterLineNumberNode(final LineNumberNode lineNumberNode) {
         if (lineNumberNode.testResolved()) {
             return null;
         }
@@ -1072,7 +1105,6 @@
         final Label label = new Label("line:" + lineNumberNode.getLineNumber() + " (" + getCurrentFunctionNode().getName() + ")");
         method.label(label);
         method.lineNumber(lineNumberNode.getLineNumber(), label);
-
         return null;
     }
 
@@ -1110,7 +1142,7 @@
                     final String name      = getCurrentFunctionNode().uniqueName(SPLIT_PREFIX.tag());
                     final String signature = methodDescriptor(type, Object.class, ScriptFunction.class, ScriptObject.class, type);
 
-                    method = getCurrentCompileUnit().getClassEmitter().method(EnumSet.of(Flag.PUBLIC, Flag.STATIC), name, signature);
+                    setCurrentMethodEmitter(getCurrentCompileUnit().getClassEmitter().method(EnumSet.of(Flag.PUBLIC, Flag.STATIC), name, signature));
                     method.setFunctionNode(getCurrentFunctionNode());
                     method.begin();
 
@@ -1216,7 +1248,7 @@
             method.invokestatic(unitClassName, methodName, methodDescriptor(cls, int.class));
             classEmitter.needGetConstantMethod(cls);
         } else {
-            method.loadConstants(unitClassName).load(index).arrayload();
+            method.loadConstants().load(index).arrayload();
             if (cls != Object.class) {
                 method.checkcast(cls);
             }
@@ -1296,14 +1328,14 @@
 
     @SuppressWarnings("rawtypes")
     @Override
-    public Node enter(final LiteralNode literalNode) {
+    public Node enterLiteralNode(final LiteralNode literalNode) {
         assert literalNode.getSymbol() != null : literalNode + " has no symbol";
         load(literalNode).store(literalNode.getSymbol());
         return null;
     }
 
     @Override
-    public Node enter(final ObjectNode objectNode) {
+    public Node enterObjectNode(final ObjectNode objectNode) {
         if (objectNode.testResolved()) {
             return null;
         }
@@ -1376,10 +1408,10 @@
         }
 
         for (final Node element : elements) {
-            final PropertyNode  propertyNode = (PropertyNode)element;
-            final Object        key          = propertyNode.getKey();
-            final ReferenceNode getter       = (ReferenceNode)propertyNode.getGetter();
-            final ReferenceNode setter       = (ReferenceNode)propertyNode.getSetter();
+            final PropertyNode propertyNode = (PropertyNode)element;
+            final Object       key          = propertyNode.getKey();
+            final FunctionNode getter       = (FunctionNode)propertyNode.getGetter();
+            final FunctionNode setter       = (FunctionNode)propertyNode.getSetter();
 
             if (getter == null && setter == null) {
                 continue;
@@ -1408,18 +1440,7 @@
     }
 
     @Override
-    public Node enter(final ReferenceNode referenceNode) {
-        if (referenceNode.testResolved()) {
-            return null;
-        }
-
-        newFunctionObject(referenceNode.getReference());
-
-        return null;
-    }
-
-    @Override
-    public Node enter(final ReturnNode returnNode) {
+    public Node enterReturnNode(final ReturnNode returnNode) {
         if (returnNode.testResolved()) {
             return null;
         }
@@ -1560,7 +1581,7 @@
     }
 
     @Override
-    public Node enter(final RuntimeNode runtimeNode) {
+    public Node enterRuntimeNode(final RuntimeNode runtimeNode) {
         if (runtimeNode.testResolved()) {
             return null;
         }
@@ -1641,7 +1662,7 @@
     }
 
     @Override
-    public Node enter(final SplitNode splitNode) {
+    public Node enterSplitNode(final SplitNode splitNode) {
         if (splitNode.testResolved()) {
             return null;
         }
@@ -1710,7 +1731,7 @@
     }
 
     @Override
-    public Node leave(final SplitNode splitNode) {
+    public Node leaveSplitNode(final SplitNode splitNode) {
         try {
             // Wrap up this method.
             method.loadResult();
@@ -1767,7 +1788,7 @@
     }
 
     @Override
-    public Node enter(final SwitchNode switchNode) {
+    public Node enterSwitchNode(final SwitchNode switchNode) {
         if (switchNode.testResolved()) {
             return null;
         }
@@ -1899,7 +1920,7 @@
     }
 
     @Override
-    public Node enter(final ThrowNode throwNode) {
+    public Node enterThrowNode(final ThrowNode throwNode) {
         if (throwNode.testResolved()) {
             return null;
         }
@@ -1926,7 +1947,7 @@
     }
 
     @Override
-    public Node enter(final TryNode tryNode) {
+    public Node enterTryNode(final TryNode tryNode) {
         if (tryNode.testResolved()) {
             return null;
         }
@@ -1959,7 +1980,7 @@
             setCurrentBlock(catchBlock);
 
             try {
-                enter(catchBlock);
+                enterBlock(catchBlock);
 
                 final CatchNode catchNode          = (CatchNode)catchBlocks.get(i).getStatements().get(0);
                 final IdentNode exception          = catchNode.getException();
@@ -1970,6 +1991,7 @@
                     // Generate catch body (inlined finally) and rethrow exception
                     catchBody.accept(this);
                     method.load(symbol).athrow();
+                    lexicalContext.pop(catchBlock);
                     continue;
                 }
 
@@ -2016,7 +2038,7 @@
                     }
                 }
 
-                leave(catchBlock);
+                leaveBlock(catchBlock);
             } finally {
                 setCurrentBlock(saveBlock);
             }
@@ -2031,7 +2053,7 @@
     }
 
     @Override
-    public Node enter(final VarNode varNode) {
+    public Node enterVarNode(final VarNode varNode) {
         final Node init = varNode.getInit();
 
         if (varNode.testResolved() || init == null) {
@@ -2053,7 +2075,7 @@
             int flags = CALLSITE_SCOPE | getCallSiteFlags();
             final IdentNode identNode = varNode.getName();
             final Type type = identNode.getType();
-            if (varSymbol.isFastScope(getCurrentFunctionNode())) {
+            if (isFastScope(varSymbol)) {
                 storeFastScopeVar(type, varSymbol, flags);
             } else {
                 method.dynamicSet(type, identNode.getName(), flags);
@@ -2069,7 +2091,7 @@
     }
 
     @Override
-    public Node enter(final WhileNode whileNode) {
+    public Node enterWhileNode(final WhileNode whileNode) {
         if (whileNode.testResolved()) {
             return null;
         }
@@ -2102,7 +2124,7 @@
     }
 
     @Override
-    public Node enter(final WithNode withNode) {
+    public Node enterWithNode(final WithNode withNode) {
         if (withNode.testResolved()) {
             return null;
         }
@@ -2868,7 +2890,7 @@
      * Ternary visits.
      */
     @Override
-    public Node enter(final TernaryNode ternaryNode) {
+    public Node enterTernaryNode(final TernaryNode ternaryNode) {
         if (ternaryNode.testResolved()) {
             return null;
         }
@@ -3064,7 +3086,7 @@
 
             target.accept(new NodeVisitor(getCurrentCompileUnit(), method) {
                 @Override
-                public Node enter(final IdentNode node) {
+                public Node enterIdentNode(final IdentNode node) {
                     if (targetSymbol.isScope()) {
                         method.load(scopeSymbol);
                         depth++;
@@ -3087,13 +3109,13 @@
                 }
 
                 @Override
-                public Node enter(final AccessNode node) {
+                public Node enterAccessNode(final AccessNode node) {
                     enterBaseNode();
                     return null;
                 }
 
                 @Override
-                public Node enter(final IndexNode node) {
+                public Node enterIndexNode(final IndexNode node) {
                     enterBaseNode();
 
                     final Node index = node.getIndex();
@@ -3159,8 +3181,6 @@
         }
 
         private void epilogue() {
-            final FunctionNode currentFunction = getCurrentFunctionNode();
-
             /**
              * Take the original target args from the stack and use them
              * together with the value to be stored to emit the store code
@@ -3178,7 +3198,7 @@
                 }
 
                 @Override
-                public Node enter(final UnaryNode node) {
+                public Node enterUnaryNode(final UnaryNode node) {
                     if(node.tokenType() == TokenType.CONVERT && node.getSymbol() != null) {
                         method.convert(node.rhs().getType());
                     }
@@ -3186,11 +3206,11 @@
                 }
 
                 @Override
-                public Node enter(final IdentNode node) {
+                public Node enterIdentNode(final IdentNode node) {
                     final Symbol symbol = node.getSymbol();
                     assert symbol != null;
                     if (symbol.isScope()) {
-                        if (symbol.isFastScope(currentFunction)) {
+                        if (isFastScope(symbol)) {
                             storeFastScopeVar(node.getType(), symbol, CALLSITE_SCOPE | getCallSiteFlags());
                         } else {
                             method.dynamicSet(node.getType(), node.getName(), CALLSITE_SCOPE | getCallSiteFlags());
@@ -3203,13 +3223,13 @@
                 }
 
                 @Override
-                public Node enter(final AccessNode node) {
+                public Node enterAccessNode(final AccessNode node) {
                     method.dynamicSet(node.getProperty().getType(), node.getProperty().getName(), getCallSiteFlags());
                     return null;
                 }
 
                 @Override
-                public Node enter(final IndexNode node) {
+                public Node enterIndexNode(final IndexNode node) {
                     method.dynamicSetIndex(getCallSiteFlags());
                     return null;
                 }
@@ -3234,42 +3254,22 @@
     }
 
     private void newFunctionObject(final FunctionNode functionNode) {
-        final boolean isLazy = functionNode.isLazy();
-        final Class<?>[] cparams = new Class<?>[] { ScriptFunctionData.class, ScriptObject.class, MethodHandle.class };
+        final boolean isLazy  = functionNode.isLazy();
 
         new ObjectCreator(this, new ArrayList<String>(), new ArrayList<Symbol>(), false, false) {
             @Override
-            protected void makeObject(final MethodEmitter method) {
-                final String className = isLazy ? SCRIPTFUNCTION_TRAMPOLINE_OBJECT : SCRIPTFUNCTION_IMPL_OBJECT;
-
-                method._new(className).dup();
-                if (isLazy) {
-                    loadConstant(compiler.getCodeInstaller());
-                    loadConstant(functionNode);
-                } else {
-                    final String signature = new FunctionSignature(true, functionNode.needsCallee(), functionNode.getReturnType(), functionNode.isVarArg() ? null : functionNode.getParameters()).toString();
-                    method.loadHandle(functionNode.getCompileUnit().getUnitClassName(), functionNode.getName(), signature, EnumSet.of(HANDLE_STATIC)); // function
-                }
-                loadConstant(new ScriptFunctionData(functionNode, makeMap()));
+            protected void makeObject(final MethodEmitter m) {
+                final String className = SCRIPTFUNCTION_IMPL_OBJECT;
+
+                m._new(className).dup();
+                loadConstant(new RecompilableScriptFunctionData(functionNode, compiler.getCodeInstaller(), Compiler.binaryName(getClassName()), makeMap()));
 
                 if (isLazy || functionNode.needsParentScope()) {
-                    method.loadScope();
+                    m.loadScope();
                 } else {
-                    method.loadNull();
+                    m.loadNull();
                 }
-
-                method.loadHandle(getClassName(), ALLOCATE.tag(), methodDescriptor(ScriptObject.class, PropertyMap.class), EnumSet.of(HANDLE_STATIC));
-
-                final List<Class<?>> cparamList = new ArrayList<>();
-                if (isLazy) {
-                    cparamList.add(CodeInstaller.class);
-                    cparamList.add(FunctionNode.class);
-                } else {
-                    cparamList.add(MethodHandle.class);
-                }
-                cparamList.addAll(Arrays.asList(cparams));
-
-                method.invoke(constructorNoLookup(className, cparamList.toArray(new Class<?>[cparamList.size()])));
+                m.invoke(constructorNoLookup(className, RecompilableScriptFunctionData.class, ScriptObject.class));
             }
         }.makeObject(method);
     }
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Fri Apr 05 14:51:24 2013 -0700
@@ -2,10 +2,10 @@
 
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.ATTR;
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.CONSTANT_FOLDED;
-import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.EMITTED;
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.FINALIZED;
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.INITIALIZED;
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.LOWERED;
+import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.PARSED;
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SPLIT;
 
 import java.io.File;
@@ -14,16 +14,16 @@
 import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Set;
-
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.Node;
-import jdk.nashorn.internal.ir.ReferenceNode;
-import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.ir.debug.ASTWriter;
 import jdk.nashorn.internal.ir.debug.PrintVisitor;
+import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.runtime.ECMAErrors;
 import jdk.nashorn.internal.runtime.ScriptEnvironment;
 import jdk.nashorn.internal.runtime.Timing;
@@ -39,7 +39,7 @@
      * default policy. The will get trampolines and only be generated when
      * called
      */
-    LAZY_INITIALIZATION_PHASE(EnumSet.of(FunctionNode.CompilationState.INITIALIZED)) {
+    LAZY_INITIALIZATION_PHASE(EnumSet.of(INITIALIZED, PARSED)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
 
@@ -65,23 +65,25 @@
             outermostFunctionNode.accept(new NodeVisitor() {
                 // self references are done with invokestatic and thus cannot have trampolines - never lazy
                 @Override
-                public Node enter(final CallNode node) {
+                public Node enterCallNode(final CallNode node) {
                     final Node callee = node.getFunction();
-                    if (callee instanceof ReferenceNode) {
-                        neverLazy.add(((ReferenceNode)callee).getReference());
+                    if (callee instanceof FunctionNode) {
+                        neverLazy.add(((FunctionNode)callee));
                         return null;
                     }
                     return node;
                 }
 
                 @Override
-                public Node enter(final FunctionNode node) {
+                public Node enterFunctionNode(final FunctionNode node) {
                     if (node == outermostFunctionNode) {
                         return node;
                     }
-                    assert Compiler.LAZY_JIT;
+                    assert compiler.isLazy();
                     lazy.add(node);
 
+                    //also needs scope, potentially needs arguments etc etc
+
                     return node;
                 }
             });
@@ -92,15 +94,24 @@
                 lazy.remove(node);
             }
 
-            for (final FunctionNode node : lazy) {
-                Compiler.LOG.fine("Marking " + node.getName() + " as lazy");
-                node.setIsLazy(true);
-                final FunctionNode parent = node.findParentFunction();
-                if (parent != null) {
-                    Compiler.LOG.fine("Marking " + parent.getName() + " as having lazy children - it needs scope for all variables");
-                    parent.setHasLazyChildren();
+            outermostFunctionNode.accept(new NodeOperatorVisitor() {
+                private final LexicalContext lexicalContext = new LexicalContext();
+                @Override
+                public Node enterFunctionNode(FunctionNode functionNode) {
+                    lexicalContext.push(functionNode);
+                    if(lazy.contains(functionNode)) {
+                        Compiler.LOG.fine("Marking " + functionNode.getName() + " as lazy");
+                        functionNode.setIsLazy(true);
+                        lexicalContext.getParentFunction(functionNode).setHasLazyChildren();
+                    }
+                    return functionNode;
                 }
-            }
+                @Override
+                public Node leaveFunctionNode(FunctionNode functionNode) {
+                    lexicalContext.pop(functionNode);
+                    return functionNode;
+                }
+            });
         }
 
         @Override
@@ -113,7 +124,7 @@
      * Constant folding pass
      *   Simple constant folding that will make elementary constructs go away
      */
-    CONSTANT_FOLDING_PHASE(EnumSet.of(INITIALIZED), CONSTANT_FOLDED) {
+    CONSTANT_FOLDING_PHASE(EnumSet.of(INITIALIZED, PARSED)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
             fn.accept(new FoldConstants());
@@ -134,7 +145,7 @@
      *   as runtime nodes where applicable.
      *
      */
-    LOWERING_PHASE(EnumSet.of(INITIALIZED, CONSTANT_FOLDED), LOWERED) {
+    LOWERING_PHASE(EnumSet.of(INITIALIZED, PARSED, CONSTANT_FOLDED)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
             fn.accept(new Lower());
@@ -150,19 +161,10 @@
      * Attribution
      *   Assign symbols and types to all nodes.
      */
-    ATTRIBUTION_PHASE(EnumSet.of(INITIALIZED, CONSTANT_FOLDED, LOWERED), ATTR) {
+    ATTRIBUTION_PHASE(EnumSet.of(INITIALIZED, PARSED, CONSTANT_FOLDED, LOWERED)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
-            final ScriptEnvironment env = compiler.getEnv();
-
             fn.accept(new Attr());
-            if (env._print_lower_ast) {
-                env.getErr().println(new ASTWriter(fn));
-            }
-
-            if (env._print_lower_parse) {
-                env.getErr().println(new PrintVisitor(fn));
-           }
         }
 
         @Override
@@ -178,7 +180,7 @@
      *   a + b a ScriptRuntime.ADD with call overhead or a dadd with much
      *   less). Split IR can lead to scope information being changed.
      */
-    SPLITTING_PHASE(EnumSet.of(INITIALIZED, CONSTANT_FOLDED, LOWERED, ATTR), SPLIT) {
+    SPLITTING_PHASE(EnumSet.of(INITIALIZED, PARSED, CONSTANT_FOLDED, LOWERED, ATTR)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
             final CompileUnit outermostCompileUnit = compiler.addCompileUnit(compiler.firstCompileUnitName());
@@ -212,10 +214,20 @@
      * Contract: all variables must have slot assignments and scope assignments
      * before type finalization.
      */
-    TYPE_FINALIZATION_PHASE(EnumSet.of(INITIALIZED, CONSTANT_FOLDED, LOWERED, ATTR, SPLIT), FINALIZED) {
+    TYPE_FINALIZATION_PHASE(EnumSet.of(INITIALIZED, PARSED, CONSTANT_FOLDED, LOWERED, ATTR, SPLIT)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
+            final ScriptEnvironment env = compiler.getEnv();
+
             fn.accept(new FinalizeTypes());
+
+            if (env._print_lower_ast) {
+                env.getErr().println(new ASTWriter(fn));
+            }
+
+            if (env._print_lower_parse) {
+                env.getErr().println(new PrintVisitor(fn));
+           }
         }
 
         @Override
@@ -229,7 +241,7 @@
      *
      *   Generate the byte code class(es) resulting from the compiled FunctionNode
      */
-    BYTECODE_GENERATION_PHASE(EnumSet.of(INITIALIZED, CONSTANT_FOLDED, LOWERED, ATTR, SPLIT, FINALIZED), EMITTED) {
+    BYTECODE_GENERATION_PHASE(EnumSet.of(INITIALIZED, PARSED, CONSTANT_FOLDED, LOWERED, ATTR, SPLIT, FINALIZED)) {
         @Override
         void transform(final Compiler compiler, final FunctionNode fn) {
             final ScriptEnvironment env = compiler.getEnv();
@@ -238,6 +250,16 @@
                 final CodeGenerator codegen = new CodeGenerator(compiler);
                 fn.accept(codegen);
                 codegen.generateScopeCalls();
+                fn.accept(new NodeOperatorVisitor() {
+                    @Override
+                    public Node enterFunctionNode(FunctionNode functionNode) {
+                        if(functionNode.isLazy()) {
+                            functionNode.resetResolved();
+                            return null;
+                        }
+                        return fn;
+                    }
+                });
 
             } catch (final VerifyError e) {
                 if (env._verify_code || env._print_code) {
@@ -306,18 +328,12 @@
     };
 
     private final EnumSet<CompilationState> pre;
-    private final CompilationState post;
     private long startTime;
     private long endTime;
     private boolean isFinished;
 
     private CompilationPhase(final EnumSet<CompilationState> pre) {
-        this(pre, null);
-    }
-
-    private CompilationPhase(final EnumSet<CompilationState> pre, final CompilationState post) {
-        this.pre  = pre;
-        this.post = post;
+        this.pre = pre;
     }
 
     boolean isApplicable(final FunctionNode functionNode) {
@@ -343,10 +359,6 @@
         endTime = System.currentTimeMillis();
         Timing.accumulateTime(toString(), endTime - startTime);
 
-        if (post != null) {
-            functionNode.setState(post);
-        }
-
         isFinished = true;
     }
 
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompileUnit.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompileUnit.java	Fri Apr 05 14:51:24 2013 -0700
@@ -37,6 +37,8 @@
 
     private long weight;
 
+    private Class<?> clazz;
+
     CompileUnit(final String className, final ClassEmitter classEmitter) {
         this(className, classEmitter, 0L);
     }
@@ -48,6 +50,24 @@
     }
 
     /**
+     * Return the class that contains the code for this unit, null if not
+     * generated yet
+     *
+     * @return class with compile unit code
+     */
+    public Class<?> getCode() {
+        return clazz;
+    }
+
+    /**
+     * Set class when it exists. Only accessible from compiler
+     * @param clazz class with code for this compile unit
+     */
+    void setCode(final Class<?> clazz) {
+        this.clazz = clazz;
+    }
+
+    /**
      * Add weight to this compile unit
      * @param w weight to add
      */
--- a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Fri Apr 05 14:51:24 2013 -0700
@@ -45,11 +45,14 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.logging.Level;
 import jdk.internal.dynalink.support.NameCodec;
 import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.runtime.CodeInstaller;
 import jdk.nashorn.internal.runtime.DebugLogger;
 import jdk.nashorn.internal.runtime.ScriptEnvironment;
@@ -71,8 +74,6 @@
     /** Name of the objects package */
     public static final String OBJECTS_PACKAGE = "jdk/nashorn/internal/objects";
 
-    static final boolean LAZY_JIT = Options.getBooleanProperty("nashorn.compiler.lazy");
-
     private final Map<String, byte[]> bytecode;
 
     private final Set<CompileUnit> compileUnits;
@@ -164,7 +165,7 @@
      * and JIT it at once. This can lead to long startup time and fewer type
      * specializations
      */
-    final static CompilationSequence SEQUENCE_NORMAL = new CompilationSequence(
+    final static CompilationSequence SEQUENCE_EAGER = new CompilationSequence(
         CompilationPhase.CONSTANT_FOLDING_PHASE,
         CompilationPhase.LOWERING_PHASE,
         CompilationPhase.ATTRIBUTION_PHASE,
@@ -173,12 +174,15 @@
         CompilationPhase.BYTECODE_GENERATION_PHASE);
 
     final static CompilationSequence SEQUENCE_LAZY =
-        SEQUENCE_NORMAL.insertFirst(CompilationPhase.LAZY_INITIALIZATION_PHASE);
+        SEQUENCE_EAGER.insertFirst(CompilationPhase.LAZY_INITIALIZATION_PHASE);
 
-    final static CompilationSequence SEQUENCE_DEFAULT =
-        LAZY_JIT ?
-            SEQUENCE_LAZY :
-            SEQUENCE_NORMAL;
+    private static CompilationSequence sequence(final boolean lazy) {
+        return lazy ? SEQUENCE_LAZY : SEQUENCE_EAGER;
+    }
+
+    boolean isLazy() {
+        return sequence == SEQUENCE_LAZY;
+    }
 
     private static String lazyTag(final FunctionNode functionNode) {
         if (functionNode.isLazy()) {
@@ -212,11 +216,6 @@
                 append(safeSourceName(functionNode.getSource()));
 
         this.scriptName = sb.toString();
-
-        LOG.info("Initializing compiler for '" + functionNode.getName() + "' scriptName = " + scriptName + ", root function: '" + functionNode.getName() + "'");
-        if (functionNode.isLazy()) {
-            LOG.info(">>> This is a lazy recompilation triggered by a trampoline");
-        }
     }
 
     /**
@@ -227,7 +226,7 @@
      * @param strict       should this compilation use strict mode semantics
      */
     public Compiler(final CodeInstaller<ScriptEnvironment> installer, final FunctionNode functionNode, final boolean strict) {
-        this(installer.getOwner(), installer, functionNode, SEQUENCE_DEFAULT, strict);
+        this(installer.getOwner(), installer, functionNode, sequence(installer.getOwner()._lazy_compilation), strict);
     }
 
     /**
@@ -237,7 +236,7 @@
      * @param functionNode function node (in any available {@link CompilationState}) to compile
      */
     public Compiler(final CodeInstaller<ScriptEnvironment> installer, final FunctionNode functionNode) {
-        this(installer.getOwner(), installer, functionNode, SEQUENCE_DEFAULT, installer.getOwner()._strict);
+        this(installer.getOwner(), installer, functionNode, sequence(installer.getOwner()._lazy_compilation), installer.getOwner()._strict);
     }
 
     /**
@@ -247,28 +246,104 @@
      * @param functionNode functionNode to compile
      */
     public Compiler(final ScriptEnvironment env, final FunctionNode functionNode) {
-        this(env, null, functionNode, SEQUENCE_DEFAULT, env._strict);
+        this(env, null, functionNode, sequence(env._lazy_compilation), env._strict);
+    }
+
+    /**
+     * Execute the compilation this Compiler was created with
+     * @params param types if known, for specialization
+     * @throws CompilationException if something goes wrong
+     * @return this compiler, for possible chaining
+     */
+    public Compiler compile() throws CompilationException {
+        return compile(null);
     }
 
     /**
      * Execute the compilation this Compiler was created with
+     * @param paramTypes param types if known, for specialization
      * @throws CompilationException if something goes wrong
+     * @return this compiler, for possible chaining
      */
-    public void compile() throws CompilationException {
+    public Compiler compile(final Class<?> paramTypes) throws CompilationException {
         for (final String reservedName : RESERVED_NAMES) {
             functionNode.uniqueName(reservedName);
         }
 
+        final boolean fine = !LOG.levelAbove(Level.FINE);
+        final boolean info = !LOG.levelAbove(Level.INFO);
+
+        long time = 0L;
+
         for (final CompilationPhase phase : sequence) {
             phase.apply(this, functionNode);
-            final String end = phase.toString() + " done for function '" + functionNode.getName() + "'";
-            if (Timing.isEnabled()) {
-                final long duration = phase.getEndTime() - phase.getStartTime();
-                LOG.info(end + " in " + duration + " ms");
-            } else {
-                LOG.info(end);
+
+            final long duration = Timing.isEnabled() ? (phase.getEndTime() - phase.getStartTime()) : 0L;
+            time += duration;
+
+            if (fine) {
+                final StringBuilder sb = new StringBuilder();
+
+                sb.append(phase.toString()).
+                    append(" done for function '").
+                    append(functionNode.getName()).
+                    append('\'');
+
+                if (duration > 0L) {
+                    sb.append(" in ").
+                        append(duration).
+                        append(" ms ");
+                }
+
+                LOG.fine(sb.toString());
             }
         }
+
+        if (info) {
+            final StringBuilder sb = new StringBuilder();
+            sb.append("Compile job for '").
+                append(functionNode.getName()).
+                append("' finished");
+
+            if (time > 0L) {
+                sb.append(" in ").
+                    append(time).
+                    append(" ms");
+            }
+
+            LOG.info(sb.toString());
+        }
+
+        return this;
+    }
+
+    private Class<?> install(final String className, final byte[] code) {
+        LOG.fine("Installing class " + className);
+
+        final Class<?> clazz = installer.install(Compiler.binaryName(className), code);
+
+        try {
+            final Source   source    = getSource();
+            final Object[] constants = getConstantData().toArray();
+            // Need doPrivileged because these fields are private
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+                @Override
+                public Void run() throws Exception {
+                    //use reflection to write source and constants table to installed classes
+                    final Field sourceField    = clazz.getDeclaredField(SOURCE.tag());
+                    final Field constantsField = clazz.getDeclaredField(CONSTANTS.tag());
+                    sourceField.setAccessible(true);
+                    constantsField.setAccessible(true);
+                    sourceField.set(null, source);
+                    constantsField.set(null, constants);
+                    return null;
+                }
+            });
+        } catch (final PrivilegedActionException e) {
+            throw new RuntimeException(e);
+        }
+
+        return clazz;
     }
 
     /**
@@ -280,46 +355,68 @@
 
         assert functionNode.hasState(CompilationState.EMITTED) : functionNode.getName() + " has no bytecode and cannot be installed";
 
-        Class<?> rootClass = null;
+        final Map<String, Class<?>> installedClasses = new HashMap<>();
+
+        final String   rootClassName = firstCompileUnitName();
+        final byte[]   rootByteCode  = bytecode.get(rootClassName);
+        final Class<?> rootClass     = install(rootClassName, rootByteCode);
+
+        int length = rootByteCode.length;
+
+        installedClasses.put(rootClassName, rootClass);
 
         for (final Entry<String, byte[]> entry : bytecode.entrySet()) {
-            final String     className = entry.getKey();
-            LOG.fine("Installing class " + className);
+            final String className = entry.getKey();
+            if (className.equals(rootClassName)) {
+                continue;
+            }
+            final byte[] code = entry.getValue();
+            length += code.length;
 
-            final byte[]     code  = entry.getValue();
-            final Class<?>   clazz = installer.install(Compiler.binaryName(className), code);
+            installedClasses.put(className, install(className, code));
+        }
 
-            if (rootClass == null && firstCompileUnitName().equals(className)) {
-                rootClass = clazz;
-            }
+        for (final CompileUnit unit : compileUnits) {
+            unit.setCode(installedClasses.get(unit.getUnitClassName()));
+        }
 
-            try {
-                final Source source = getSource();
-                final Object[] constants = getConstantData().toArray();
-                // Need doPrivileged because these fields are private
-                AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
-                    @Override
-                    public Void run() throws Exception {
-                        //use reflection to write source and constants table to installed classes
-                        final Field sourceField = clazz.getDeclaredField(SOURCE.tag());
-                        final Field constantsField = clazz.getDeclaredField(CONSTANTS.tag());
-                        sourceField.setAccessible(true);
-                        constantsField.setAccessible(true);
-                        sourceField.set(null, source);
-                        constantsField.set(null, constants);
-                        return null;
-                    }
-                });
-            } catch (final PrivilegedActionException e) {
-                throw new RuntimeException(e);
+        functionNode.accept(new NodeVisitor() {
+            @Override
+            public Node enterFunctionNode(final FunctionNode node) {
+                if (node.isLazy()) {
+                    return null;
+                }
+                node.setState(CompilationState.INSTALLED);
+                return node;
+            }
+        });
+
+        final StringBuilder sb;
+        if (LOG.isEnabled()) {
+            sb = new StringBuilder();
+            sb.append("Installed class '").
+                append(rootClass.getSimpleName()).
+                append('\'').
+                append(" bytes=").
+                append(length).
+                append('.');
+            if (bytecode.size() > 1) {
+                sb.append(' ').append(bytecode.size()).append(" compile units.");
+            }
+        } else {
+            sb = null;
+        }
+
+        if (Timing.isEnabled()) {
+            final long duration = System.currentTimeMillis() - t0;
+            Timing.accumulateTime("[Code Installation]", duration);
+            if (sb != null) {
+                sb.append(" Install time: ").append(duration).append(" ms");
             }
         }
 
-        LOG.info("Installed root class: " + rootClass + " and " + bytecode.size() + " compile unit classes");
-        if (Timing.isEnabled()) {
-            final long duration = System.currentTimeMillis() - t0;
-            Timing.accumulateTime("[Code Installation]", duration);
-            LOG.info("Installation time: " + duration + " ms");
+        if (sb != null) {
+            LOG.info(sb.toString());
         }
 
         return rootClass;
@@ -444,8 +541,6 @@
      * TODO: We currently generate no overflow checks so this is
      * disabled
      *
-     * @see #shouldUseIntegers()
-     *
      * @return true if arithmetic operations should not widen integer
      *   operands by default.
      */
@@ -460,4 +555,5 @@
         assert !USE_INT_ARITH : "Integer arithmetic is not enabled";
     }
 
+
 }
--- a/nashorn/src/jdk/nashorn/internal/codegen/FinalizeTypes.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FinalizeTypes.java	Fri Apr 05 14:51:24 2013 -0700
@@ -40,13 +40,14 @@
 import jdk.nashorn.internal.ir.ExecuteNode;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IfNode;
 import jdk.nashorn.internal.ir.IndexNode;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
 import jdk.nashorn.internal.ir.Node;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
@@ -84,11 +85,13 @@
 
     private static final DebugLogger LOG = new DebugLogger("finalize");
 
+    private final LexicalContext lexicalContext = new LexicalContext();
+
     FinalizeTypes() {
     }
 
     @Override
-    public Node leave(final CallNode callNode) {
+    public Node leaveCallNode(final CallNode callNode) {
         final EvalArgs evalArgs = callNode.getEvalArgs();
         if (evalArgs != null) {
             evalArgs.setCode(evalArgs.getCode().accept(this));
@@ -96,15 +99,14 @@
 
         // AccessSpecializer - call return type may change the access for this location
         final Node function = callNode.getFunction();
-        if (function instanceof ReferenceNode) {
-            setTypeOverride(callNode, ((ReferenceNode)function).getReference().getType());
+        if (function instanceof FunctionNode) {
+            return setTypeOverride(callNode, ((FunctionNode)function).getReturnType());
         }
         return callNode;
     }
 
     private Node leaveUnary(final UnaryNode unaryNode) {
-        unaryNode.setRHS(convert(unaryNode.rhs(), unaryNode.getType()));
-        return unaryNode;
+        return unaryNode.setRHS(convert(unaryNode.rhs(), unaryNode.getType()));
     }
 
     @Override
@@ -125,8 +127,7 @@
 
     @Override
     public Node leaveDECINC(final UnaryNode unaryNode) {
-        specialize(unaryNode);
-        return unaryNode;
+        return specialize(unaryNode).node;
     }
 
     @Override
@@ -158,9 +159,7 @@
             }
         }
 
-        binaryNode.setLHS(convert(lhs, type));
-        binaryNode.setRHS(convert(rhs, type));
-        return binaryNode;
+        return binaryNode.setLHS(convert(lhs, type)).setRHS(convert(rhs, type));
     }
 
     @Override
@@ -170,12 +169,13 @@
 
     @Override
     public Node leaveASSIGN(final BinaryNode binaryNode) {
-        Type destType = specialize(binaryNode);
+        final SpecializedNode specialized = specialize(binaryNode);
+        final BinaryNode specBinaryNode = (BinaryNode)specialized.node;
+        Type destType = specialized.type;
         if (destType == null) {
-            destType = binaryNode.getType();
+            destType = specBinaryNode.getType();
         }
-        binaryNode.setRHS(convert(binaryNode.rhs(), destType));
-        return binaryNode;
+        return specBinaryNode.setRHS(convert(specBinaryNode.rhs(), destType));
     }
 
     @Override
@@ -235,40 +235,40 @@
 
     @Override
     public Node leaveBIT_AND(BinaryNode binaryNode) {
-        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isInteger() : binaryNode.getSymbol();
+        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isInteger() : "int coercion expected: " + binaryNode.getSymbol();
         return leaveBinary(binaryNode, Type.INT, Type.INT);
     }
 
     @Override
     public Node leaveBIT_OR(BinaryNode binaryNode) {
-        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isInteger();
+        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isInteger() : "int coercion expected: " + binaryNode.getSymbol();
         return leaveBinary(binaryNode, Type.INT, Type.INT);
     }
 
     @Override
     public Node leaveBIT_XOR(BinaryNode binaryNode) {
-        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isInteger();
+        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isInteger() : "int coercion expected: " + binaryNode.getSymbol();
         return leaveBinary(binaryNode, Type.INT, Type.INT);
     }
 
     @Override
     public Node leaveCOMMALEFT(final BinaryNode binaryNode) {
         assert binaryNode.getSymbol() != null;
-        binaryNode.setRHS(discard(binaryNode.rhs()));
-        // AccessSpecializer - the type of rhs, which is the remaining value of this node may have changed
+        final BinaryNode newBinaryNode = (BinaryNode)binaryNode.setRHS(discard(binaryNode.rhs()));
+        // AccessSpecializer - the type of lhs, which is the remaining value of this node may have changed
         // in that case, update the node type as well
-        propagateType(binaryNode, binaryNode.lhs().getType());
-        return binaryNode;
+        propagateType(newBinaryNode, newBinaryNode.lhs().getType());
+        return newBinaryNode;
     }
 
     @Override
     public Node leaveCOMMARIGHT(final BinaryNode binaryNode) {
         assert binaryNode.getSymbol() != null;
-        binaryNode.setLHS(discard(binaryNode.lhs()));
+        final BinaryNode newBinaryNode = binaryNode.setLHS(discard(binaryNode.lhs()));
         // AccessSpecializer - the type of rhs, which is the remaining value of this node may have changed
         // in that case, update the node type as well
-        propagateType(binaryNode, binaryNode.rhs().getType());
-        return binaryNode;
+        propagateType(newBinaryNode, newBinaryNode.rhs().getType());
+        return newBinaryNode;
     }
 
     @Override
@@ -344,7 +344,7 @@
 
     @Override
     public Node leaveSHR(final BinaryNode binaryNode) {
-        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isLong();
+        assert binaryNode.getSymbol() != null && binaryNode.getSymbol().getSymbolType().isLong() : "long coercion expected: " + binaryNode.getSymbol();
         return leaveBinary(binaryNode, Type.INT, Type.INT);
     }
 
@@ -354,13 +354,20 @@
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
+        lexicalContext.push(block);
         updateSymbols(block);
         return block;
     }
 
     @Override
-    public Node leave(final CatchNode catchNode) {
+    public Node leaveBlock(Block block) {
+        lexicalContext.pop(block);
+        return super.leaveBlock(block);
+    }
+
+    @Override
+    public Node leaveCatchNode(final CatchNode catchNode) {
         final Node exceptionCondition = catchNode.getExceptionCondition();
         if (exceptionCondition != null) {
             catchNode.setExceptionCondition(convert(exceptionCondition, Type.BOOLEAN));
@@ -369,23 +376,23 @@
     }
 
     @Override
-    public Node enter(final DoWhileNode doWhileNode) {
-        return enter((WhileNode)doWhileNode);
+    public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
+        return enterWhileNode(doWhileNode);
     }
 
     @Override
-    public Node leave(final DoWhileNode doWhileNode) {
-        return leave((WhileNode)doWhileNode);
+    public Node leaveDoWhileNode(final DoWhileNode doWhileNode) {
+        return leaveWhileNode(doWhileNode);
     }
 
     @Override
-    public Node leave(final ExecuteNode executeNode) {
+    public Node leaveExecuteNode(final ExecuteNode executeNode) {
         executeNode.setExpression(discard(executeNode.getExpression()));
         return executeNode;
     }
 
     @Override
-    public Node leave(final ForNode forNode) {
+    public Node leaveForNode(final ForNode forNode) {
         final Node init   = forNode.getInit();
         final Node test   = forNode.getTest();
         final Node modify = forNode.getModify();
@@ -413,11 +420,12 @@
     }
 
     @Override
-    public Node enter(final FunctionNode functionNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
         if (functionNode.isLazy()) {
             return null;
         }
 
+        lexicalContext.push(functionNode);
         // If the function doesn't need a callee, we ensure its __callee__ symbol doesn't get a slot. We can't do
         // this earlier, as access to scoped variables, self symbol, etc. in previous phases can all trigger the
         // need for the callee.
@@ -432,18 +440,26 @@
         }
 
         updateSymbols(functionNode);
+        functionNode.setState(CompilationState.FINALIZED);
+
         return functionNode;
     }
 
     @Override
-    public Node leave(final IfNode ifNode) {
+    public Node leaveFunctionNode(FunctionNode functionNode) {
+        lexicalContext.pop(functionNode);
+        return super.leaveFunctionNode(functionNode);
+    }
+
+    @Override
+    public Node leaveIfNode(final IfNode ifNode) {
         ifNode.setTest(convert(ifNode.getTest(), Type.BOOLEAN));
         return ifNode;
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    public Node enter(final LiteralNode literalNode) {
+    public Node enterLiteralNode(final LiteralNode literalNode) {
         if (literalNode instanceof ArrayLiteralNode) {
             final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
             final Node[]           array            = arrayLiteralNode.getValue();
@@ -461,7 +477,7 @@
     }
 
     @Override
-    public Node leave(final ReturnNode returnNode) {
+    public Node leaveReturnNode(final ReturnNode returnNode) {
         final Node expr = returnNode.getExpression();
         if (expr != null) {
             returnNode.setExpression(convert(expr, getCurrentFunctionNode().getReturnType()));
@@ -470,7 +486,7 @@
     }
 
     @Override
-    public Node leave(final RuntimeNode runtimeNode) {
+    public Node leaveRuntimeNode(final RuntimeNode runtimeNode) {
         final List<Node> args = runtimeNode.getArgs();
         for (final Node arg : args) {
             assert !arg.getType().isUnknown();
@@ -479,7 +495,7 @@
     }
 
     @Override
-    public Node leave(final SwitchNode switchNode) {
+    public Node leaveSwitchNode(final SwitchNode switchNode) {
         final Node           expression  = switchNode.getExpression();
         final List<CaseNode> cases       = switchNode.getCases();
         final boolean        allInteger  = switchNode.getTag().getSymbolType().isInteger();
@@ -498,34 +514,34 @@
     }
 
     @Override
-    public Node leave(final TernaryNode ternaryNode) {
-        ternaryNode.setLHS(convert(ternaryNode.lhs(), Type.BOOLEAN));
-        return ternaryNode;
+    public Node leaveTernaryNode(final TernaryNode ternaryNode) {
+        return ternaryNode.setLHS(convert(ternaryNode.lhs(), Type.BOOLEAN));
     }
 
     @Override
-    public Node leave(final ThrowNode throwNode) {
+    public Node leaveThrowNode(final ThrowNode throwNode) {
         throwNode.setExpression(convert(throwNode.getExpression(), Type.OBJECT));
         return throwNode;
     }
 
     @Override
-    public Node leave(final VarNode varNode) {
-
+    public Node leaveVarNode(final VarNode varNode) {
         final Node rhs = varNode.getInit();
         if (rhs != null) {
-            Type destType = specialize(varNode);
+            final SpecializedNode specialized = specialize(varNode);
+            final VarNode specVarNode = (VarNode)specialized.node;
+            Type destType = specialized.type;
             if (destType == null) {
-                destType = varNode.getType();
+                destType = specVarNode.getType();
             }
-            assert varNode.hasType() : varNode + " doesn't have a type";
-            varNode.setInit(convert(rhs, destType));
+            assert specVarNode.hasType() : specVarNode + " doesn't have a type";
+            return specVarNode.setInit(convert(rhs, destType));
         }
         return varNode;
     }
 
     @Override
-    public Node leave(final WhileNode whileNode) {
+    public Node leaveWhileNode(final WhileNode whileNode) {
         final Node test = whileNode.getTest();
         if (test != null) {
             whileNode.setTest(convert(test, Type.BOOLEAN));
@@ -534,7 +550,7 @@
     }
 
     @Override
-    public Node leave(final WithNode withNode) {
+    public Node leaveWithNode(final WithNode withNode) {
         withNode.setExpression(convert(withNode.getExpression(), Type.OBJECT));
         return withNode;
     }
@@ -553,14 +569,14 @@
      * that scope and slot information is correct for every symbol
      * @param block block for which to to finalize type info.
      */
-    private static void updateSymbols(final Block block) {
+    private void updateSymbols(final Block block) {
         if (!block.needsScope()) {
             return; // nothing to do
         }
 
-        assert !(block instanceof FunctionNode) || block.getFunction() == block;
+        final FunctionNode functionNode = lexicalContext.getFunction(block);
+        assert !(block instanceof FunctionNode) || functionNode == block;
 
-        final FunctionNode functionNode   = block.getFunction();
         final List<Symbol> symbols        = block.getFrame().getSymbols();
         final boolean      allVarsInScope = functionNode.allVarsInScope();
         final boolean      isVarArg       = functionNode.isVarArg();
@@ -629,10 +645,7 @@
             break;
         }
 
-        binaryNode.setLHS(convert(lhs, widest));
-        binaryNode.setRHS(convert(rhs, widest));
-
-        return binaryNode;
+        return binaryNode.setLHS(convert(lhs, widest)).setRHS(convert(rhs, widest));
     }
 
     /**
@@ -654,9 +667,7 @@
     }
 
     private Node leaveBinary(final BinaryNode binaryNode, final Type lhsType, final Type rhsType) {
-        binaryNode.setLHS(convert(binaryNode.lhs(), lhsType));
-        binaryNode.setRHS(convert(binaryNode.rhs(), rhsType));
-        return binaryNode;
+        return binaryNode.setLHS(convert(binaryNode.lhs(), lhsType)).setRHS(convert(binaryNode.rhs(), rhsType));
     }
 
     /**
@@ -677,7 +688,7 @@
             }
 
             @Override
-            public Node enter(final IdentNode identNode) {
+            public Node enterIdentNode(final IdentNode identNode) {
                 if (!exclude.contains(identNode)) {
                     setCanBePrimitive(identNode.getSymbol());
                 }
@@ -685,26 +696,36 @@
             }
 
             @Override
-            public Node enter(final AccessNode accessNode) {
+            public Node enterAccessNode(final AccessNode accessNode) {
                 setCanBePrimitive(accessNode.getProperty().getSymbol());
                 return null;
             }
 
             @Override
-            public Node enter(final IndexNode indexNode) {
+            public Node enterIndexNode(final IndexNode indexNode) {
                 exclude.add(indexNode.getBase()); //prevent array base node to be flagged as primitive, but k in a[k++] is fine
                 return indexNode;
             }
         });
     }
 
-    private static Type specialize(final Assignment<?> assignment) {
+    private static class SpecializedNode {
+        final Node node;
+        final Type type;
+
+        SpecializedNode(Node node, Type type) {
+            this.node = node;
+            this.type = type;
+        }
+    }
+
+    private static <T extends Node> SpecializedNode specialize(final Assignment<T> assignment) {
         final Node node = ((Node)assignment);
-        final Node lhs = assignment.getAssignmentDest();
+        final T lhs = assignment.getAssignmentDest();
         final Node rhs = assignment.getAssignmentSource();
 
         if (!canHaveCallSiteType(lhs)) {
-            return null;
+            return new SpecializedNode(node, null);
         }
 
         final Type to;
@@ -716,13 +737,13 @@
 
         if (!isSupportedCallSiteType(to)) {
             //meaningless to specialize to boolean or object
-            return null;
+            return new SpecializedNode(node, null);
         }
 
-        setTypeOverride(lhs, to);
-        propagateType(node, to);
+        final Node newNode = assignment.setAssignmentDest(setTypeOverride(lhs, to));
+        propagateType(newNode, to);
 
-        return to;
+        return new SpecializedNode(newNode, to);
     }
 
 
@@ -734,7 +755,7 @@
      * @return true if node can have a callsite type
      */
     private static boolean canHaveCallSiteType(final Node node) {
-        return node instanceof TypeOverride && ((TypeOverride)node).canHaveCallSiteType();
+        return node instanceof TypeOverride && ((TypeOverride<?>)node).canHaveCallSiteType();
     }
 
     /**
@@ -760,7 +781,8 @@
      * @param node    node for which to change type
      * @param to      new type
      */
-    private static void setTypeOverride(final Node node, final Type to) {
+    @SuppressWarnings("unchecked")
+    private static <T extends Node> T setTypeOverride(final T node, final Type to) {
         final Type from = node.getType();
         if (!node.getType().equals(to)) {
             LOG.info("Changing call override type for '" + node + "' from " + node.getType() + " to " + to);
@@ -769,7 +791,7 @@
             }
         }
         LOG.info("Type override for lhs in '" + node + "' => " + to);
-        ((TypeOverride)node).setType(to);
+        return ((TypeOverride<T>)node).setType(to);
     }
 
     /**
@@ -814,8 +836,8 @@
             }
         } else {
             if (canHaveCallSiteType(node) && isSupportedCallSiteType(to)) {
-                setTypeOverride(node, to);
-                return resultNode;
+                assert node instanceof TypeOverride;
+                return setTypeOverride(node, to);
             }
             resultNode = new UnaryNode(node.getSource(), Token.recast(node.getToken(), TokenType.CONVERT), node);
         }
--- a/nashorn/src/jdk/nashorn/internal/codegen/FoldConstants.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FoldConstants.java	Fri Apr 05 14:51:24 2013 -0700
@@ -30,6 +30,8 @@
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.EmptyNode;
 import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IfNode;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.Node;
@@ -52,7 +54,7 @@
     }
 
     @Override
-    public Node leave(final UnaryNode unaryNode) {
+    public Node leaveUnaryNode(final UnaryNode unaryNode) {
         final LiteralNode<?> literalNode = new UnaryNodeConstantEvaluator(unaryNode).eval();
         if (literalNode != null) {
             LOG.info("Unary constant folded " + unaryNode + " to " + literalNode);
@@ -62,7 +64,7 @@
     }
 
     @Override
-    public Node leave(final BinaryNode binaryNode) {
+    public Node leaveBinaryNode(final BinaryNode binaryNode) {
         final LiteralNode<?> literalNode = new BinaryNodeConstantEvaluator(binaryNode).eval();
         if (literalNode != null) {
             LOG.info("Binary constant folded " + binaryNode + " to " + literalNode);
@@ -72,7 +74,21 @@
     }
 
     @Override
-    public Node leave(final IfNode ifNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
+        if (functionNode.isLazy()) {
+            return null;
+        }
+        return functionNode;
+    }
+
+    @Override
+    public Node leaveFunctionNode(final FunctionNode functionNode) {
+        functionNode.setState(CompilationState.CONSTANT_FOLDED);
+        return functionNode;
+    }
+
+    @Override
+    public Node leaveIfNode(final IfNode ifNode) {
         final Node test = ifNode.getTest();
         if (test instanceof LiteralNode) {
             final Block shortCut = ((LiteralNode<?>)test).isTrue() ? ifNode.getPass() : ifNode.getFail();
@@ -85,7 +101,7 @@
     }
 
     @Override
-    public Node leave(final TernaryNode ternaryNode) {
+    public Node leaveTernaryNode(final TernaryNode ternaryNode) {
         final Node test = ternaryNode.lhs();
         if (test instanceof LiteralNode) {
             return ((LiteralNode<?>)test).isTrue() ? ternaryNode.rhs() : ternaryNode.third();
--- a/nashorn/src/jdk/nashorn/internal/codegen/FunctionSignature.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FunctionSignature.java	Fri Apr 05 14:51:24 2013 -0700
@@ -146,7 +146,7 @@
 
     /**
      * Create a function signature given a function node, using as much
-     * type information for parameters and return types that is availabe
+     * type information for parameters and return types that is available
      *
      * @param functionNode the function node
      */
@@ -155,7 +155,7 @@
             true,
             functionNode.needsCallee(),
             functionNode.getReturnType(),
-            (functionNode.isVarArg() && !functionNode.isScript()) ?
+            (functionNode.isVarArg() && !functionNode.isProgram()) ?
                 null :
                 functionNode.getParameters());
     }
@@ -202,6 +202,14 @@
         return methodType;
     }
 
+    /**
+     * Return the return type for this function signature
+     * @return the return type
+     */
+    public Type getReturnType() {
+        return returnType;
+    }
+
     private static Type[] objectArgs(final int nArgs) {
         final Type[] array = new Type[nArgs];
         for (int i = 0; i < nArgs; i++) {
--- a/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Fri Apr 05 14:51:24 2013 -0700
@@ -37,8 +37,8 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Deque;
+import java.util.Iterator;
 import java.util.List;
-import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
@@ -52,11 +52,12 @@
 import jdk.nashorn.internal.ir.ExecuteNode;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IfNode;
-import jdk.nashorn.internal.ir.IndexNode;
 import jdk.nashorn.internal.ir.LabelNode;
 import jdk.nashorn.internal.ir.LabeledNode;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LineNumberNode;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.Node;
@@ -102,6 +103,8 @@
 
     private List<Node> statements;
 
+    private LexicalContext lexicalContext = new LexicalContext();
+
     /**
      * Constructor.
      *
@@ -113,14 +116,15 @@
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         final Node       savedLastStatement = lastStatement;
         final List<Node> savedStatements    = statements;
-
+        lexicalContext.push(block);
         try {
             this.statements = new ArrayList<>();
+            NodeVisitor visitor = this;
             for (final Node statement : block.getStatements()) {
-                statement.accept(this);
+                statement.accept(visitor);
                 /*
                  * This is slightly unsound, for example if we have a loop with
                  * a guarded statement like if (x) continue in the body and the
@@ -132,7 +136,7 @@
                  */
                 if (lastStatement != null && lastStatement.isTerminal()) {
                     copyTerminal(block, lastStatement);
-                    break;
+                    visitor = new DeadCodeVarDeclarationVisitor();
                 }
             }
             block.setStatements(statements);
@@ -140,18 +144,19 @@
         } finally {
             this.statements = savedStatements;
             this.lastStatement = savedLastStatement;
+            lexicalContext.pop(block);
         }
 
         return null;
     }
 
     @Override
-    public Node enter(final BreakNode breakNode) {
+    public Node enterBreakNode(final BreakNode breakNode) {
         return enterBreakOrContinue(breakNode);
     }
 
     @Override
-    public Node enter(final CallNode callNode) {
+    public Node enterCallNode(final CallNode callNode) {
         final Node function = markerFunction(callNode.getFunction());
         callNode.setFunction(function);
         checkEval(callNode); //check if this is an eval call and store the information
@@ -159,44 +164,44 @@
     }
 
     @Override
-    public Node leave(final CaseNode caseNode) {
+    public Node leaveCaseNode(final CaseNode caseNode) {
         caseNode.copyTerminalFlags(caseNode.getBody());
         return caseNode;
     }
 
     @Override
-    public Node leave(final CatchNode catchNode) {
+    public Node leaveCatchNode(final CatchNode catchNode) {
         catchNode.copyTerminalFlags(catchNode.getBody());
         addStatement(catchNode);
         return catchNode;
     }
 
     @Override
-    public Node enter(final ContinueNode continueNode) {
+    public Node enterContinueNode(final ContinueNode continueNode) {
         return enterBreakOrContinue(continueNode);
     }
 
     @Override
-    public Node enter(final DoWhileNode doWhileNode) {
-        return enter((WhileNode)doWhileNode);
+    public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
+        return enterWhileNode(doWhileNode);
     }
 
     @Override
-    public Node leave(final DoWhileNode doWhileNode) {
-        return leave((WhileNode)doWhileNode);
+    public Node leaveDoWhileNode(final DoWhileNode doWhileNode) {
+        return leaveWhileNode(doWhileNode);
     }
 
     @Override
-    public Node enter(final EmptyNode emptyNode) {
+    public Node enterEmptyNode(final EmptyNode emptyNode) {
         return null;
     }
 
     @Override
-    public Node leave(final ExecuteNode executeNode) {
+    public Node leaveExecuteNode(final ExecuteNode executeNode) {
         final Node expr = executeNode.getExpression();
 
-        if (getCurrentFunctionNode().isScript()) {
-            if (!(expr instanceof Block)) {
+        if (getCurrentFunctionNode().isProgram()) {
+            if (!(expr instanceof Block) || expr instanceof FunctionNode) { // it's not a block, but can be a function
                 if (!isInternalExpression(expr) && !isEvalResultAssignment(expr)) {
                     executeNode.setExpression(new BinaryNode(executeNode.getSource(), Token.recast(executeNode.getToken(), TokenType.ASSIGN),
                             getCurrentFunctionNode().getResultNode(),
@@ -212,13 +217,13 @@
     }
 
     @Override
-    public Node enter(final ForNode forNode) {
+    public Node enterForNode(final ForNode forNode) {
         nest(forNode);
         return forNode;
     }
 
     @Override
-    public Node leave(final ForNode forNode) {
+    public Node leaveForNode(final ForNode forNode) {
         final Node  test = forNode.getTest();
         final Block body = forNode.getBody();
 
@@ -236,6 +241,7 @@
 
         if (!forNode.isForIn() && conservativeAlwaysTrue(test)) {
             forNode.setTest(null);
+            setHasGoto(forNode);
             setTerminal(forNode, !escapes);
         }
 
@@ -245,18 +251,16 @@
     }
 
     @Override
-    public Node enter(final FunctionNode functionNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
         LOG.info("START FunctionNode: " + functionNode.getName());
 
         if (functionNode.isLazy()) {
             LOG.info("LAZY: " + functionNode.getName());
             return null;
         }
-
+        lexicalContext.push(functionNode);
         initFunctionNode(functionNode);
 
-        Node initialEvalResult = LiteralNode.newInstance(functionNode, ScriptRuntime.UNDEFINED);
-
         nest(functionNode);
 
         /*
@@ -270,60 +274,40 @@
         statements    = new ArrayList<>();
         lastStatement = null;
 
-        // for initial eval result is the last declared function
-        for (final FunctionNode nestedFunction : functionNode.getFunctions()) {
-            final IdentNode ident = nestedFunction.getIdent();
-            if (ident != null && nestedFunction.isStatement()) {
-                initialEvalResult = new IdentNode(ident);
-            }
-        }
-
         if (functionNode.needsSelfSymbol()) {
             //function needs to start with var funcIdent = __callee_;
             statements.add(functionNode.getSelfSymbolInit().accept(this));
         }
 
+        NodeVisitor visitor = this;
         try {
-            // Every nested function needs a definition in the outer function with its name. Add these.
-            for (final FunctionNode nestedFunction : functionNode.getFunctions()) {
-                final VarNode varNode = nestedFunction.getFunctionVarNode();
-                if (varNode != null) {
-                    final LineNumberNode lineNumberNode = nestedFunction.getFunctionVarLineNumberNode();
-                    if (lineNumberNode != null) {
-                        lineNumberNode.accept(this);
-                    }
-                    varNode.accept(this);
-                    varNode.setIsFunctionVarNode();
+            //do the statements - this fills the block with code
+            boolean needsInitialEvalResult = functionNode.isProgram();
+            for (final Node statement : functionNode.getStatements()) {
+                // If this function is a program, then insert an assignment to the initial eval result after all
+                // function declarations.
+                if(needsInitialEvalResult && !(statement instanceof LineNumberNode || (statement instanceof VarNode && ((VarNode)statement).isFunctionDeclaration()))) {
+                    addInitialEvalResult(functionNode);
+                    needsInitialEvalResult = false;
                 }
-            }
-
-            if (functionNode.isScript()) {
-                new ExecuteNode(functionNode.getSource(), functionNode.getFirstToken(), functionNode.getFinish(), initialEvalResult).accept(this);
-            }
-
-            //do the statements - this fills the block with code
-            for (final Node statement : functionNode.getStatements()) {
-                statement.accept(this);
+                statement.accept(visitor);
                 //If there are unused terminated endpoints in the function, we need
                 // to add a "return undefined" in those places for correct semantics
                 LOG.info("Checking lastStatement="+lastStatement+" for terminal flags");
                 if (lastStatement != null && lastStatement.hasTerminalFlags()) {
                     copyTerminal(functionNode, lastStatement);
-                    break;
+                    assert !needsInitialEvalResult;
+                    visitor = new DeadCodeVarDeclarationVisitor();
                 }
             }
-
+            if(needsInitialEvalResult) {
+                addInitialEvalResult(functionNode);
+            }
             functionNode.setStatements(statements);
 
             if (!functionNode.isTerminal()) {
                 guaranteeReturn(functionNode);
             }
-
-            //lower all nested functions
-            for (final FunctionNode nestedFunction : functionNode.getFunctions()) {
-                nestedFunction.accept(this);
-            }
-
         } finally {
             statements    = savedStatements;
             lastStatement = savedLastStatement;
@@ -331,17 +315,67 @@
 
         LOG.info("END FunctionNode: " + functionNode.getName());
         unnest(functionNode);
+        lexicalContext.pop(functionNode);
+
+        functionNode.setState(CompilationState.LOWERED);
 
         return null;
     }
 
+    /**
+     * This visitor is used to go over statements after a terminal statement. Those statements are dead code, but the
+     * var declarations in them still have the effect of declaring a local variable on the function level. Therefore,
+     * they aren't really dead code and must be preserved. Note that they're only preserved as no-op declarations; their
+     * initializers are wiped out as those are, in fact, dead code.
+     */
+    private class DeadCodeVarDeclarationVisitor extends NodeOperatorVisitor {
+        DeadCodeVarDeclarationVisitor() {
+        }
+
+        @Override
+        public Node enterVarNode(VarNode varNode) {
+            // Can't ever see a function declaration, as this visitor is only ever used after a terminal statement was
+            // encountered, and all function declarations precede any terminal statements.
+            assert !varNode.isFunctionDeclaration();
+            if(varNode.getInit() == null) {
+                // No initializer, just pass it to Lower.
+                return varNode.accept(Lower.this);
+            }
+            // Wipe out the initializer and then pass it to Lower.
+            return varNode.setInit(null).accept(Lower.this);
+        }
+    }
+
+    private void addInitialEvalResult(final FunctionNode functionNode) {
+        new ExecuteNode(functionNode.getSource(), functionNode.getFirstToken(), functionNode.getFinish(),
+                getInitialEvalResult(functionNode)).accept(this);
+    }
+
+    /**
+     * Result of initial result of evaluating a particular program, which is either the last function it declares, or
+     * undefined if it doesn't declare any functions.
+     * @param program
+     * @return the initial result of evaluating the program
+     */
+    private static Node getInitialEvalResult(final FunctionNode program) {
+        IdentNode lastFnName = null;
+        for (final FunctionNode fn : program.getDeclaredFunctions()) {
+            assert fn.isDeclared();
+            final IdentNode fnName = fn.getIdent();
+            if(fnName != null) {
+                lastFnName = fnName;
+            }
+        }
+        return lastFnName != null ? new IdentNode(lastFnName) : LiteralNode.newInstance(program, ScriptRuntime.UNDEFINED);
+    }
+
     @Override
-    public Node enter(final IfNode ifNode) {
+    public Node enterIfNode(final IfNode ifNode) {
         return nest(ifNode);
     }
 
     @Override
-    public Node leave(final IfNode ifNode) {
+    public Node leaveIfNode(final IfNode ifNode) {
         final Node pass = ifNode.getPass();
         final Node fail = ifNode.getFail();
 
@@ -356,7 +390,7 @@
     }
 
     @Override
-    public Node enter(LabelNode labelNode) {
+    public Node enterLabelNode(LabelNode labelNode) {
         final Block body = labelNode.getBody();
         body.accept(this);
         copyTerminal(labelNode, body);
@@ -365,13 +399,13 @@
     }
 
     @Override
-    public Node enter(final LineNumberNode lineNumberNode) {
+    public Node enterLineNumberNode(final LineNumberNode lineNumberNode) {
         addStatement(lineNumberNode, false); // don't put it in lastStatement cache
         return null;
     }
 
     @Override
-    public Node enter(final ReturnNode returnNode) {
+    public Node enterReturnNode(final ReturnNode returnNode) {
         final TryNode tryNode = returnNode.getTryChain();
         final Node    expr    = returnNode.getExpression();
 
@@ -409,19 +443,19 @@
     }
 
     @Override
-    public Node leave(final ReturnNode returnNode) {
+    public Node leaveReturnNode(final ReturnNode returnNode) {
         addStatement(returnNode); //ReturnNodes are always terminal, marked as such in constructor
         return returnNode;
     }
 
     @Override
-    public Node enter(final SwitchNode switchNode) {
+    public Node enterSwitchNode(final SwitchNode switchNode) {
         nest(switchNode);
         return switchNode;
     }
 
     @Override
-    public Node leave(final SwitchNode switchNode) {
+    public Node leaveSwitchNode(final SwitchNode switchNode) {
         unnest(switchNode);
 
         final List<CaseNode> cases       = switchNode.getCases();
@@ -442,13 +476,13 @@
     }
 
     @Override
-    public Node leave(final ThrowNode throwNode) {
+    public Node leaveThrowNode(final ThrowNode throwNode) {
         addStatement(throwNode); //ThrowNodes are always terminal, marked as such in constructor
         return throwNode;
     }
 
     @Override
-    public Node enter(final TryNode tryNode) {
+    public Node enterTryNode(final TryNode tryNode) {
         final Block  finallyBody = tryNode.getFinallyBody();
         final long   token       = tryNode.getToken();
         final int    finish      = tryNode.getFinish();
@@ -534,26 +568,19 @@
 
             // set outer tryNode's body to innerTryNode
             final Block outerBody;
-            outerBody = new Block(source, token, finish, tryNode.getBody().getParent(), getCurrentFunctionNode());
+            outerBody = new Block(source, token, finish);
             outerBody.setStatements(new ArrayList<Node>(Arrays.asList(innerTryNode)));
             tryNode.setBody(outerBody);
             tryNode.setCatchBlocks(null);
-
-            // now before we go on, we have to fix the block parents
-            // (we repair the block tree after the insertion so that all references are intact)
-            innerTryNode.getBody().setParent(tryNode.getBody());
-            for (final Block block : innerTryNode.getCatchBlocks()) {
-                block.setParent(tryNode.getBody());
-            }
         }
 
         // create a catch-all that inlines finally and rethrows
 
-        final Block catchBlock      = new Block(source, token, finish, getCurrentBlock(), getCurrentFunctionNode());
+        final Block catchBlock      = new Block(source, token, finish);
         //this catch block should get define symbol
 
-        final Block catchBody       = new Block(source, token, finish, catchBlock, getCurrentFunctionNode());
-        final Node  catchAllFinally = finallyBody.clone();
+        final Block catchBody       = new Block(source, token, finish);
+        final Node  catchAllFinally = finallyBody.copy();
 
         catchBody.addStatement(new ExecuteNode(source, finallyBody.getToken(), finallyBody.getFinish(), catchAllFinally));
         setTerminal(catchBody, true);
@@ -580,7 +607,7 @@
     }
 
     @Override
-    public Node leave(final TryNode tryNode) {
+    public Node leaveTryNode(final TryNode tryNode) {
         final Block finallyBody   = tryNode.getFinallyBody();
 
         boolean allTerminal = tryNode.getBody().isTerminal() && (finallyBody == null || finallyBody.isTerminal());
@@ -604,18 +631,18 @@
     }
 
     @Override
-    public Node leave(final VarNode varNode) {
+    public Node leaveVarNode(final VarNode varNode) {
         addStatement(varNode);
         return varNode;
     }
 
     @Override
-    public Node enter(final WhileNode whileNode) {
+    public Node enterWhileNode(final WhileNode whileNode) {
         return nest(whileNode);
     }
 
     @Override
-    public Node leave(final WhileNode whileNode) {
+    public Node leaveWhileNode(final WhileNode whileNode) {
         final Node test = whileNode.getTest();
 
         if (test == null) {
@@ -636,7 +663,7 @@
             } else if (conservativeAlwaysTrue(test)) {
                 node = new ForNode(whileNode.getSource(), whileNode.getToken(), whileNode.getFinish());
                 ((ForNode)node).setBody(body);
-                ((ForNode)node).accept(this);
+                node.accept(this);
                 setTerminal(node, !escapes);
             }
         }
@@ -649,7 +676,7 @@
     }
 
     @Override
-    public Node leave(final WithNode withNode) {
+    public Node leaveWithNode(final WithNode withNode) {
         if (withNode.getBody().isTerminal()) {
             setTerminal(withNode,  true);
         }
@@ -678,28 +705,10 @@
      */
     private static Node markerFunction(final Node function) {
         if (function instanceof IdentNode) {
-            return new IdentNode((IdentNode)function) {
-                @Override
-                public boolean isFunction() {
-                    return true;
-                }
-            };
-        } else if (function instanceof AccessNode) {
-            return new AccessNode((AccessNode)function) {
-                @Override
-                public boolean isFunction() {
-                    return true;
-                }
-            };
-        } else if (function instanceof IndexNode) {
-            return new IndexNode((IndexNode)function) {
-                @Override
-                public boolean isFunction() {
-                    return true;
-                }
-            };
+            return ((IdentNode)function).setIsFunction();
+        } else if (function instanceof BaseNode) {
+            return ((BaseNode)function).setIsFunction();
         }
-
         return function;
     }
 
@@ -742,7 +751,7 @@
             if (args.size() >= 1 && EVAL.tag().equals(callee.getName())) {
                 final CallNode.EvalArgs evalArgs =
                     new CallNode.EvalArgs(
-                        args.get(0).clone().accept(this), //clone as we use this for the "is eval case". original evaluated separately for "is not eval case"
+                        args.get(0).copy().accept(this), //clone as we use this for the "is eval case". original evaluated separately for "is not eval case"
                         getCurrentFunctionNode().getThisNode(),
                         evalLocation(callee),
                         getCurrentFunctionNode().isStrictMode());
@@ -769,13 +778,13 @@
 
         loopBody.accept(new NodeVisitor() {
             @Override
-            public Node leave(final BreakNode node) {
+            public Node leaveBreakNode(final BreakNode node) {
                 escapes.add(node);
                 return node;
             }
 
             @Override
-            public Node leave(final ContinueNode node) {
+            public Node leaveContinueNode(final ContinueNode node) {
                 // all inner loops have been popped.
                 if (nesting.contains(node.getTargetNode())) {
                     escapes.add(node);
@@ -790,7 +799,7 @@
     private void guaranteeReturn(final FunctionNode functionNode) {
         Node resultNode;
 
-        if (functionNode.isScript()) {
+        if (functionNode.isProgram()) {
             resultNode = functionNode.getResultNode(); // the eval result, symbol assigned in Attr
         } else {
             if (lastStatement != null && lastStatement.isTerminal() || lastStatement instanceof ReturnNode) {
@@ -855,18 +864,15 @@
      * @return true if try block is inside the target, false otherwise.
      */
     private boolean isNestedTry(final TryNode tryNode, final Block target) {
-        for (Block current = getCurrentBlock(); current != target; current = current.getParent()) {
-            if (tryNode.getBody() == current) {
+        for(Iterator<Block> blocks = lexicalContext.getBlocks(getCurrentBlock()); blocks.hasNext();) {
+            final Block block = blocks.next();
+            if(block == target) {
+                return false;
+            }
+            if(tryNode.isChildBlock(block)) {
                 return true;
             }
-
-            for (final Block catchBlock : tryNode.getCatchBlocks()) {
-                if (catchBlock == current) {
-                    return true;
-                }
-            }
         }
-
         return false;
     }
 
@@ -895,7 +901,7 @@
                 continue;
             }
 
-            finallyBody = (Block)finallyBody.clone();
+            finallyBody = (Block)finallyBody.copy();
             final boolean hasTerminalFlags = finallyBody.hasTerminalFlags();
 
             new ExecuteNode(finallyBody.getSource(), finallyBody.getToken(), finallyBody.getFinish(), finallyBody).accept(this);
@@ -970,6 +976,3 @@
     }
 
 }
-
-
-
--- a/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -651,11 +651,10 @@
 
     /**
      * Load the constants array
-     * @param unitClassName name of the compile unit from which to load constants
      * @return this method emitter
      */
-    MethodEmitter loadConstants(final String unitClassName) {
-        getStatic(unitClassName, CONSTANTS.tag(), CONSTANTS.descriptor());
+    MethodEmitter loadConstants() {
+        getStatic(classEmitter.getUnitClassName(), CONSTANTS.tag(), CONSTANTS.descriptor());
         assert peekType().isArray() : peekType();
         return this;
     }
--- a/nashorn/src/jdk/nashorn/internal/codegen/Splitter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Splitter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -39,7 +39,9 @@
 import jdk.nashorn.internal.ir.DoWhileNode;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.LabelNode;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit;
@@ -48,6 +50,7 @@
 import jdk.nashorn.internal.ir.SplitNode;
 import jdk.nashorn.internal.ir.SwitchNode;
 import jdk.nashorn.internal.ir.WhileNode;
+import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.runtime.DebugLogger;
 import jdk.nashorn.internal.runtime.Source;
@@ -69,6 +72,8 @@
     /** Cache for calculated block weights. */
     private final Map<Node, Long> weightCache = new HashMap<>();
 
+    private final LexicalContext lexicalContext = new LexicalContext();
+
     /** Weight threshold for when to start a split. */
     public static final long SPLIT_THRESHOLD = Options.getIntProperty("nashorn.compiler.splitter.threshold", 32 * 1024);
 
@@ -92,15 +97,16 @@
      */
     void split() {
         if (functionNode.isLazy()) {
-            LOG.fine("Postponing split of '" + functionNode.getName() + "' as it's lazy");
+            LOG.finest("Postponing split of '" + functionNode.getName() + "' as it's lazy");
             return;
         }
-        LOG.fine("Initiating split of '" + functionNode.getName() + "'");
+
+        LOG.finest("Initiating split of '" + functionNode.getName() + "'");
 
         long weight = WeighNodes.weigh(functionNode);
 
         if (weight >= SPLIT_THRESHOLD) {
-            LOG.fine("Splitting '" + functionNode.getName() + "' as its weight " + weight + " exceeds split threshold " + SPLIT_THRESHOLD);
+            LOG.finest("Splitting '" + functionNode.getName() + "' as its weight " + weight + " exceeds split threshold " + SPLIT_THRESHOLD);
 
             functionNode.accept(this);
 
@@ -110,7 +116,7 @@
             }
 
             if (weight >= SPLIT_THRESHOLD) {
-                weight = splitBlock(functionNode);
+                weight = splitBlock(functionNode, functionNode);
             }
 
             if (functionNode.isSplit()) {
@@ -130,9 +136,22 @@
         }
 
         // Recursively split nested functions
-        for (final FunctionNode function : functionNode.getFunctions()) {
-            new Splitter(compiler, function, outermostCompileUnit).split();
-        }
+        functionNode.accept(new NodeOperatorVisitor() {
+            @Override
+            public Node enterFunctionNode(FunctionNode function) {
+                if(function == functionNode) {
+                    // Don't process outermost function (it was already processed) but descend into it to find nested
+                    // functions.
+                    return function;
+                }
+                // Process a nested function
+                new Splitter(compiler, function, outermostCompileUnit).split();
+                // Don't descend into a a nested function; Splitter.split() has taken care of nested-in-nested functions.
+                return null;
+            }
+        });
+
+        functionNode.setState(CompilationState.SPLIT);
     }
 
     /**
@@ -151,7 +170,7 @@
      *
      * @return new weight for the resulting block.
      */
-    private long splitBlock(final Block block) {
+    private long splitBlock(final Block block, final FunctionNode function) {
         functionNode.setIsSplit();
 
         final List<Node> splits = new ArrayList<>();
@@ -163,7 +182,7 @@
 
             if (statementsWeight + weight >= SPLIT_THRESHOLD || statement.isTerminal()) {
                 if (!statements.isEmpty()) {
-                    splits.add(createBlockSplitNode(block, statements, statementsWeight));
+                    splits.add(createBlockSplitNode(block, function, statements, statementsWeight));
                     statements = new ArrayList<>();
                     statementsWeight = 0;
                 }
@@ -179,7 +198,7 @@
         }
 
         if (!statements.isEmpty()) {
-            splits.add(createBlockSplitNode(block, statements, statementsWeight));
+            splits.add(createBlockSplitNode(block, function, statements, statementsWeight));
         }
 
         block.setStatements(splits);
@@ -195,13 +214,13 @@
      *
      * @return New split node.
      */
-    private SplitNode createBlockSplitNode(final Block parent, final List<Node> statements, final long weight) {
+    private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Node> statements, final long weight) {
         final Source source = parent.getSource();
         final long   token  = parent.getToken();
         final int    finish = parent.getFinish();
-        final String name   = parent.getFunction().uniqueName(SPLIT_PREFIX.tag());
+        final String name   = function.uniqueName(SPLIT_PREFIX.tag());
 
-        final Block newBlock = new Block(source, token, finish, parent, functionNode);
+        final Block newBlock = new Block(source, token, finish);
         newBlock.setFrame(new Frame(parent.getFrame()));
         newBlock.setStatements(statements);
 
@@ -213,15 +232,17 @@
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         if (block.isCatchBlock()) {
             return null;
         }
+        lexicalContext.push(block);
 
         final long weight = WeighNodes.weigh(block, weightCache);
 
         if (weight < SPLIT_THRESHOLD) {
             weightCache.put(block, weight);
+            lexicalContext.pop(block);
             return null;
         }
 
@@ -229,23 +250,24 @@
     }
 
     @Override
-    public Node leave(final Block block) {
+    public Node leaveBlock(final Block block) {
         assert !block.isCatchBlock();
 
         // Block was heavier than SLIT_THRESHOLD in enter, but a sub-block may have
         // been split already, so weigh again before splitting.
         long weight = WeighNodes.weigh(block, weightCache);
         if (weight >= SPLIT_THRESHOLD) {
-            weight = splitBlock(block);
+            weight = splitBlock(block, lexicalContext.getFunction(block));
         }
         weightCache.put(block, weight);
 
+        lexicalContext.pop(block);
         return block;
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    public Node leave(final LiteralNode literal) {
+    public Node leaveLiteralNode(final LiteralNode literal) {
         long weight = WeighNodes.weigh(literal);
 
         if (weight < SPLIT_THRESHOLD) {
@@ -290,17 +312,12 @@
     }
 
     @Override
-    public Node enter(final FunctionNode node) {
-        if (node.isLazy()) {
-            return null;
+    public Node enterFunctionNode(final FunctionNode node) {
+        if(node == functionNode && !node.isLazy()) {
+            lexicalContext.push(node);
+            node.visitStatements(this);
+            lexicalContext.pop(node);
         }
-
-        final List<Node> statements = node.getStatements();
-
-        for (final Node statement : statements) {
-            statement.accept(this);
-        }
-
         return null;
     }
 
@@ -317,38 +334,38 @@
         }
 
         @Override
-        public Node enter(final LabelNode labelNode) {
+        public Node enterLabelNode(final LabelNode labelNode) {
             registerJumpTarget(labelNode.getBreakNode());
             registerJumpTarget(labelNode.getContinueNode());
             return labelNode;
         }
 
         @Override
-        public Node enter(final WhileNode whileNode) {
+        public Node enterWhileNode(final WhileNode whileNode) {
             registerJumpTarget(whileNode);
             return whileNode;
         }
 
         @Override
-        public Node enter(final DoWhileNode doWhileNode) {
+        public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
             registerJumpTarget(doWhileNode);
             return doWhileNode;
         }
 
         @Override
-        public Node enter(final ForNode forNode) {
+        public Node enterForNode(final ForNode forNode) {
             registerJumpTarget(forNode);
             return forNode;
         }
 
         @Override
-        public Node enter(final SwitchNode switchNode) {
+        public Node enterSwitchNode(final SwitchNode switchNode) {
             registerJumpTarget(switchNode);
             return switchNode;
         }
 
         @Override
-        public Node enter(final ReturnNode returnNode) {
+        public Node enterReturnNode(final ReturnNode returnNode) {
             for (final SplitNode split : splitStack) {
                 split.setHasReturn(true);
             }
@@ -356,25 +373,25 @@
         }
 
         @Override
-        public Node enter(final ContinueNode continueNode) {
+        public Node enterContinueNode(final ContinueNode continueNode) {
             searchJumpTarget(continueNode.getTargetNode(), continueNode.getTargetLabel());
             return continueNode;
         }
 
         @Override
-        public Node enter(final BreakNode breakNode) {
+        public Node enterBreakNode(final BreakNode breakNode) {
             searchJumpTarget(breakNode.getTargetNode(), breakNode.getTargetLabel());
             return breakNode;
         }
 
         @Override
-        public Node enter(final SplitNode splitNode) {
+        public Node enterSplitNode(final SplitNode splitNode) {
             splitStack.addFirst(splitNode);
             return splitNode;
         }
 
         @Override
-        public Node leave(final SplitNode splitNode) {
+        public Node leaveSplitNode(final SplitNode splitNode) {
             assert splitNode == splitStack.peekFirst();
             splitStack.removeFirst();
             return splitNode;
--- a/nashorn/src/jdk/nashorn/internal/codegen/WeighNodes.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/WeighNodes.java	Fri Apr 05 14:51:24 2013 -0700
@@ -47,7 +47,6 @@
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit;
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.SplitNode;
@@ -80,7 +79,7 @@
     private static final long LITERAL_WEIGHT   = 10;
     private static final long LOOP_WEIGHT      = 4;
     private static final long NEW_WEIGHT       = 6;
-    private static final long REFERENCE_WEIGHT = 20;
+    private static final long FUNC_EXPR_WEIGHT = 20;
     private static final long RETURN_WEIGHT    = 2;
     private static final long SPLIT_WEIGHT     = 40;
     private static final long SWITCH_WEIGHT    = 8;
@@ -94,36 +93,37 @@
     /** Optional cache for weight of block nodes. */
     private final Map<Node, Long> weightCache;
 
-    /*
+    private final FunctionNode topFunction;
+
+    /**
      * Constructor
      *
      * @param weightCache cache of already calculated block weights
      */
-    private WeighNodes(final Map<Node, Long> weightCache) {
+    private WeighNodes(FunctionNode topFunction, final Map<Node, Long> weightCache) {
         super(null, null);
+        this.topFunction = topFunction;
         this.weightCache = weightCache;
     }
 
     static long weigh(final Node node) {
-        final WeighNodes weighNodes = new WeighNodes(null);
-        node.accept(weighNodes);
-        return weighNodes.weight;
+        return weigh(node, null);
     }
 
     static long weigh(final Node node, final Map<Node, Long> weightCache) {
-        final WeighNodes weighNodes = new WeighNodes(weightCache);
+        final WeighNodes weighNodes = new WeighNodes(node instanceof FunctionNode ? (FunctionNode)node : null, weightCache);
         node.accept(weighNodes);
         return weighNodes.weight;
     }
 
     @Override
-    public Node leave(final AccessNode accessNode) {
+    public Node leaveAccessNode(final AccessNode accessNode) {
         weight += ACCESS_WEIGHT;
         return accessNode;
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         if (weightCache != null && weightCache.containsKey(block)) {
             weight += weightCache.get(block);
             return null;
@@ -133,78 +133,79 @@
     }
 
     @Override
-    public Node leave(final BreakNode breakNode) {
+    public Node leaveBreakNode(final BreakNode breakNode) {
         weight += BREAK_WEIGHT;
         return breakNode;
     }
 
     @Override
-    public Node leave(final CallNode callNode) {
+    public Node leaveCallNode(final CallNode callNode) {
         weight += CALL_WEIGHT;
         return callNode;
     }
 
     @Override
-    public Node leave(final CatchNode catchNode) {
+    public Node leaveCatchNode(final CatchNode catchNode) {
         weight += CATCH_WEIGHT;
         return catchNode;
     }
 
     @Override
-    public Node leave(final ContinueNode continueNode) {
+    public Node leaveContinueNode(final ContinueNode continueNode) {
         weight += CONTINUE_WEIGHT;
         return continueNode;
     }
 
     @Override
-    public Node leave(final DoWhileNode doWhileNode) {
+    public Node leaveDoWhileNode(final DoWhileNode doWhileNode) {
         weight += LOOP_WEIGHT;
         return doWhileNode;
     }
 
     @Override
-    public Node leave(final ExecuteNode executeNode) {
+    public Node leaveExecuteNode(final ExecuteNode executeNode) {
         return executeNode;
     }
 
     @Override
-    public Node leave(final ForNode forNode) {
+    public Node leaveForNode(final ForNode forNode) {
         weight += LOOP_WEIGHT;
         return forNode;
     }
 
     @Override
-    public Node enter(final FunctionNode functionNode) {
-        final List<Node> statements = functionNode.getStatements();
-
-        for (final Node statement : statements) {
-            statement.accept(this);
+    public Node enterFunctionNode(final FunctionNode functionNode) {
+        if(functionNode == topFunction) {
+            // the function being weighted; descend into its statements
+            functionNode.visitStatements(this);
+        } else {
+            // just a reference to inner function from outer function
+            weight += FUNC_EXPR_WEIGHT;
         }
-
         return null;
     }
 
     @Override
-    public Node leave(final IdentNode identNode) {
+    public Node leaveIdentNode(final IdentNode identNode) {
         weight += ACCESS_WEIGHT + identNode.getName().length() * 2;
         return identNode;
     }
 
     @Override
-    public Node leave(final IfNode ifNode) {
+    public Node leaveIfNode(final IfNode ifNode) {
         weight += IF_WEIGHT;
         return ifNode;
     }
 
     @Override
-    public Node leave(final IndexNode indexNode) {
+    public Node leaveIndexNode(final IndexNode indexNode) {
         weight += ACCESS_WEIGHT;
         return indexNode;
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    public Node enter(final LiteralNode literalNode) {
+    public Node enterLiteralNode(final LiteralNode literalNode) {
         weight += LITERAL_WEIGHT;
 
         if (literalNode instanceof ArrayLiteralNode) {
@@ -230,67 +231,61 @@
     }
 
     @Override
-    public Node leave(final PropertyNode propertyNode) {
+    public Node leavePropertyNode(final PropertyNode propertyNode) {
         weight += LITERAL_WEIGHT;
         return propertyNode;
     }
 
     @Override
-    public Node leave(final ReferenceNode referenceNode) {
-        weight += REFERENCE_WEIGHT;
-        return referenceNode;
-    }
-
-    @Override
-    public Node leave(final ReturnNode returnNode) {
+    public Node leaveReturnNode(final ReturnNode returnNode) {
         weight += RETURN_WEIGHT;
         return returnNode;
     }
 
     @Override
-    public Node leave(final RuntimeNode runtimeNode) {
+    public Node leaveRuntimeNode(final RuntimeNode runtimeNode) {
         weight += CALL_WEIGHT;
         return runtimeNode;
     }
 
     @Override
-    public Node enter(final SplitNode splitNode) {
+    public Node enterSplitNode(final SplitNode splitNode) {
         weight += SPLIT_WEIGHT;
         return null;
     }
 
     @Override
-    public Node leave(final SwitchNode switchNode) {
+    public Node leaveSwitchNode(final SwitchNode switchNode) {
         weight += SWITCH_WEIGHT;
         return switchNode;
     }
 
     @Override
-    public Node leave(final ThrowNode throwNode) {
+    public Node leaveThrowNode(final ThrowNode throwNode) {
         weight += THROW_WEIGHT;
         return throwNode;
     }
 
     @Override
-    public Node leave(final TryNode tryNode) {
+    public Node leaveTryNode(final TryNode tryNode) {
         weight += THROW_WEIGHT;
         return tryNode;
     }
 
     @Override
-    public Node leave(final VarNode varNode) {
+    public Node leaveVarNode(final VarNode varNode) {
         weight += VAR_WEIGHT;
         return varNode;
     }
 
     @Override
-    public Node leave(final WhileNode whileNode) {
+    public Node leaveWhileNode(final WhileNode whileNode) {
         weight += LOOP_WEIGHT;
         return whileNode;
     }
 
     @Override
-    public Node leave(final WithNode withNode) {
+    public Node leaveWithNode(final WithNode withNode) {
         weight += WITH_WEIGHT;
         return withNode;
     }
--- a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java	Fri Apr 05 14:51:24 2013 -0700
@@ -647,21 +647,20 @@
     }
 
     private static void swap(final MethodVisitor method, final Type above, final Type below) {
-        final MethodVisitor mv = method;
         if (below.isCategory2()) {
             if (above.isCategory2()) {
-                mv.visitInsn(DUP2_X2);
-                mv.visitInsn(POP2);
+                method.visitInsn(DUP2_X2);
+                method.visitInsn(POP2);
             } else {
-                mv.visitInsn(DUP_X2);
-                mv.visitInsn(POP);
+                method.visitInsn(DUP_X2);
+                method.visitInsn(POP);
             }
         } else {
             if (above.isCategory2()) {
-                mv.visitInsn(DUP2_X1);
-                mv.visitInsn(POP2);
+                method.visitInsn(DUP2_X1);
+                method.visitInsn(POP2);
             } else {
-                mv.visitInsn(SWAP);
+                method.visitInsn(SWAP);
             }
         }
 
--- a/nashorn/src/jdk/nashorn/internal/ir/AccessNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/AccessNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -36,7 +36,7 @@
  * IR representation of a property access (period operator.)
  *
  */
-public class AccessNode extends BaseNode implements TypeOverride {
+public class AccessNode extends BaseNode implements TypeOverride<AccessNode> {
     /** Property ident. */
     private IdentNode property;
 
@@ -56,9 +56,7 @@
         super(source, token, finish, base);
 
         this.start    = base.getStart();
-        this.property = property;
-
-        this.property.setIsPropertyName();
+        this.property = property.setIsPropertyName();
     }
 
     /**
@@ -106,10 +104,10 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterAccessNode(this) != null) {
             base = base.accept(visitor);
             property = (IdentNode)property.accept(visitor);
-            return visitor.leave(this);
+            return visitor.leaveAccessNode(this);
         }
 
         return this;
@@ -150,13 +148,14 @@
     }
 
     @Override
-    public void setType(final Type type) {
+    public AccessNode setType(final Type type) {
         if (DEBUG_FIELDS && !Type.areEquivalent(getSymbol().getSymbolType(), type)) {
             ObjectClassGenerator.LOG.info(getClass().getName() + " " + this + " => " + type + " instead of " + getType());
         }
-        property.setType(type);
+        property = property.setType(type);
         getSymbol().setTypeOverride(type); //always a temp so this is fine.
         hasCallSiteType = true;
+        return this;
     }
 
     @Override
--- a/nashorn/src/jdk/nashorn/internal/ir/Assignment.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/Assignment.java	Fri Apr 05 14:51:24 2013 -0700
@@ -46,4 +46,11 @@
      * @return get the assignment source node
      */
     public Node getAssignmentSource();
+
+    /**
+     * Set assignment destination node.
+     * @param n the assignment destination node.
+     * @return a node equivalent to this one except for the requested change.
+     */
+    public Node setAssignmentDest(D n);
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/BaseNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/BaseNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,6 +38,8 @@
     /** Base Node. */
     protected Node base;
 
+    private boolean function;
+
     /**
      * Constructor
      *
@@ -96,6 +98,15 @@
 
     @Override
     public boolean isFunction() {
-        return false;
+        return function;
+    }
+
+    /**
+     * Mark this node as being the callee operand of a {@link CallNode}.
+     * @return a base node identical to this one in all aspects except with its function flag set.
+     */
+    public BaseNode setIsFunction() {
+        function = true;
+        return this;
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -35,7 +35,7 @@
  */
 public class BinaryNode extends UnaryNode {
     /** Left hand side argument. */
-    protected Node lhs;
+    private Node lhs;
 
     /**
      * Constructor
@@ -140,6 +140,11 @@
     }
 
     @Override
+    public Node setAssignmentDest(Node n) {
+        return setLHS(n);
+    }
+
+    @Override
     public Node getAssignmentSource() {
         return rhs();
     }
@@ -163,10 +168,9 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            lhs = lhs.accept(visitor);
-            rhs = rhs.accept(visitor);
-            return visitor.leave(this);
+        if (visitor.enterBinaryNode(this) != null) {
+            // TODO: good cause for a separate visitMembers: we could delegate to UnaryNode.visitMembers
+            return visitor.leaveBinaryNode((BinaryNode)setLHS(lhs.accept(visitor)).setRHS(rhs().accept(visitor)));
         }
 
         return this;
@@ -229,8 +233,12 @@
     /**
      * Set the left hand side expression for this node
      * @param lhs new left hand side expression
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setLHS(final Node lhs) {
-        this.lhs = lhs;
+    public BinaryNode setLHS(final Node lhs) {
+        if(this.lhs == lhs) return this;
+        final BinaryNode n = (BinaryNode)clone();
+        n.lhs = lhs;
+        return n;
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/Block.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/Block.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,41 +25,24 @@
 
 package jdk.nashorn.internal.ir;
 
-import static jdk.nashorn.internal.ir.Symbol.IS_GLOBAL;
-import static jdk.nashorn.internal.ir.Symbol.IS_INTERNAL;
-import static jdk.nashorn.internal.ir.Symbol.IS_LET;
-import static jdk.nashorn.internal.ir.Symbol.IS_PARAM;
-import static jdk.nashorn.internal.ir.Symbol.IS_SCOPE;
-import static jdk.nashorn.internal.ir.Symbol.IS_VAR;
-import static jdk.nashorn.internal.ir.Symbol.KINDMASK;
-
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 import jdk.nashorn.internal.codegen.Frame;
 import jdk.nashorn.internal.codegen.Label;
-import jdk.nashorn.internal.ir.annotations.Ignore;
-import jdk.nashorn.internal.ir.annotations.ParentNode;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.runtime.Source;
 
 /**
  * IR representation for a list of statements and functions. All provides the
  * basis for script body.
- *
  */
 public class Block extends Node {
-    /** Parent context */
-    @ParentNode @Ignore
-    private Block parent;
-
-    /** Owning function. */
-    @Ignore //don't print it, it is apparent in the tree
-    protected FunctionNode function;
-
     /** List of statements */
     protected List<Node> statements;
 
@@ -84,14 +67,10 @@
      * @param source   source code
      * @param token    token
      * @param finish   finish
-     * @param parent   reference to parent block
-     * @param function function node this block is in
      */
-    public Block(final Source source, final long token, final int finish, final Block parent, final FunctionNode function) {
+    public Block(final Source source, final long token, final int finish) {
         super(source, token, finish);
 
-        this.parent     = parent;
-        this.function   = function;
         this.statements = new ArrayList<>();
         this.symbols    = new HashMap<>();
         this.entryLabel = new Label("block_entry");
@@ -107,8 +86,6 @@
     protected Block(final Block block, final CopyState cs) {
         super(block);
 
-        this.parent     = block.parent;
-        this.function   = block.function;
         this.statements = new ArrayList<>();
         for (final Node statement : block.getStatements()) {
             statements.add(cs.existingOrCopy(statement));
@@ -123,55 +100,7 @@
 
     @Override
     protected Node copy(final CopyState cs) {
-        return fixBlockChain(new Block(this, cs));
-    }
-
-    /**
-     * Whenever a clone that contains a hierarchy of blocks is created,
-     * this function has to be called to ensure that the parents point
-     * to the correct parent blocks or two different ASTs would not
-     * be completely separated.
-     *
-     * @return the argument
-     */
-    static Block fixBlockChain(final Block root) {
-        root.accept(new NodeVisitor() {
-            private Block        parent   = root.getParent();
-            private final FunctionNode function = root.getFunction();
-
-            @Override
-            public Node enter(final Block block) {
-                assert block.getFunction() == function;
-                block.setParent(parent);
-                parent = block;
-
-                return block;
-            }
-
-            @Override
-            public Node leave(final Block block) {
-                parent = block.getParent();
-
-                return block;
-            }
-
-            @Override
-            public Node enter(final FunctionNode functionNode) {
-                assert functionNode.getFunction() == function;
-
-                return enter((Block)functionNode);
-            }
-
-            @Override
-            public Node leave(final FunctionNode functionNode) {
-                assert functionNode.getFunction() == function;
-
-                return leave((Block)functionNode);
-            }
-
-        });
-
-        return root;
+        return new Block(this, cs);
     }
 
     /**
@@ -189,17 +118,12 @@
     }
 
     /**
-     * Prepend a statement to the statement list
+     * Prepend statements to the statement list
      *
-     * @param statement Statement node to add
+     * @param prepended statement to add
      */
-    public void prependStatement(final Node statement) {
-        if (statement != null) {
-            final List<Node> newStatements = new ArrayList<>();
-            newStatements.add(statement);
-            newStatements.addAll(statements);
-            setStatements(newStatements);
-        }
+    public void prependStatements(final List<Node> prepended) {
+        statements.addAll(0, prepended);
     }
 
     /**
@@ -212,39 +136,6 @@
     }
 
     /**
-     * Add a new function to the function list.
-     *
-     * @param functionNode Function node to add.
-     */
-    public void addFunction(final FunctionNode functionNode) {
-        assert parent != null : "Parent context missing.";
-
-        parent.addFunction(functionNode);
-    }
-
-    /**
-     * Add a list of functions to the function list.
-     *
-     * @param functionNodes Function nodes to add.
-     */
-    public void addFunctions(final List<FunctionNode> functionNodes) {
-        assert parent != null : "Parent context missing.";
-
-        parent.addFunctions(functionNodes);
-    }
-
-    /**
-     * Set the function list to a new one
-     *
-     * @param functionNodes the nodes to set
-     */
-    public void setFunctions(final List<FunctionNode> functionNodes) {
-        assert parent != null : "Parent context missing.";
-
-        parent.setFunctions(functionNodes);
-    }
-
-    /**
      * Assist in IR navigation.
      *
      * @param visitor IR navigating visitor.
@@ -258,13 +149,9 @@
         try {
             // Ignore parent to avoid recursion.
 
-            if (visitor.enter(this) != null) {
-                for (int i = 0, count = statements.size(); i < count; i++) {
-                    final Node statement = statements.get(i);
-                    statements.set(i, statement.accept(visitor));
-                }
-
-                return visitor.leave(this);
+            if (visitor.enterBlock(this) != null) {
+                visitStatements(visitor);
+                return visitor.leaveBlock(this);
             }
         } finally {
             visitor.setCurrentBlock(saveBlock);
@@ -274,51 +161,21 @@
     }
 
     /**
-     * Search for symbol.
-     *
-     * @param name Symbol name.
-     *
-     * @return Found symbol or null if not found.
+     * Get an iterator for all the symbols defined in this block
+     * @return symbol iterator
      */
-    public Symbol findSymbol(final String name) {
-        // Search up block chain to locate symbol.
-
-        for (Block block = this; block != null; block = block.getParent()) {
-            // Find name.
-            final Symbol symbol = block.symbols.get(name);
-            // If found then we are good.
-            if (symbol != null) {
-                return symbol;
-            }
-        }
-        return null;
+    public Iterator<Symbol> symbolIterator() {
+        return symbols.values().iterator();
     }
 
     /**
-     * Search for symbol in current function.
-     *
-     * @param name Symbol name.
-     *
-     * @return Found symbol or null if not found.
+     * Retrieves an existing symbol defined in the current block.
+     * @param name the name of the symbol
+     * @return an existing symbol with the specified name defined in the current block, or null if this block doesn't
+     * define a symbol with this name.
      */
-    public Symbol findLocalSymbol(final String name) {
-        // Search up block chain to locate symbol.
-        for (Block block = this; block != null; block = block.getParent()) {
-            // Find name.
-            final Symbol symbol = block.symbols.get(name);
-            // If found then we are good.
-            if (symbol != null) {
-                return symbol;
-            }
-
-            // If searched function then we are done.
-            if (block == block.function) {
-                break;
-            }
-        }
-
-        // Not found.
-        return null;
+    public Symbol getExistingSymbol(final String name) {
+        return symbols.get(name);
     }
 
     /**
@@ -331,122 +188,6 @@
         return statements.size() == 1 && statements.get(0) instanceof CatchNode;
     }
 
-    /**
-     * Test to see if a symbol is local to the function.
-     *
-     * @param symbol Symbol to test.
-     * @return True if a local symbol.
-     */
-    public boolean isLocal(final Symbol symbol) {
-        // some temp symbols have no block, so can be assumed local
-        final Block block = symbol.getBlock();
-        return block == null || block.getFunction() == function;
-    }
-
-    /**
-     * Declare the definition of a new symbol.
-     *
-     * @param name         Name of symbol.
-     * @param symbolFlags  Symbol flags.
-     * @param node         Defining Node.
-     *
-     * @return Symbol for given name or null for redefinition.
-     */
-    public Symbol defineSymbol(final String name, final int symbolFlags, final Node node) {
-        int    flags  = symbolFlags;
-        Symbol symbol = findSymbol(name); // Locate symbol.
-
-        if ((flags & KINDMASK) == IS_GLOBAL) {
-            flags |= IS_SCOPE;
-        }
-
-        if (symbol != null) {
-            // Symbol was already defined. Check if it needs to be redefined.
-            if ((flags & KINDMASK) == IS_PARAM) {
-                if (!function.isLocal(symbol)) {
-                    // Not defined in this function. Create a new definition.
-                    symbol = null;
-                } else if (symbol.isParam()) {
-                    // Duplicate parameter. Null return will force an error.
-                    assert false : "duplicate parameter";
-                    return null;
-                }
-            } else if ((flags & KINDMASK) == IS_VAR) {
-                if ((flags & IS_INTERNAL) == IS_INTERNAL || (flags & Symbol.IS_LET) == Symbol.IS_LET) {
-                    assert !((flags & IS_LET) == IS_LET && symbol.getBlock() == this) : "duplicate let variable in block";
-                    // Always create a new definition.
-                    symbol = null;
-                } else {
-                    // Not defined in this function. Create a new definition.
-                    if (!function.isLocal(symbol) || symbol.less(IS_VAR)) {
-                        symbol = null;
-                    }
-                }
-            }
-        }
-
-        if (symbol == null) {
-            // If not found, then create a new one.
-            Block symbolBlock;
-
-            // Determine where to create it.
-            if ((flags & Symbol.KINDMASK) == IS_VAR && ((flags & IS_INTERNAL) == IS_INTERNAL || (flags & IS_LET) == IS_LET)) {
-                symbolBlock = this;
-            } else {
-                symbolBlock = getFunction();
-            }
-
-            // Create and add to appropriate block.
-            symbol = new Symbol(name, flags, node, symbolBlock);
-            symbolBlock.putSymbol(name, symbol);
-
-            if ((flags & Symbol.KINDMASK) != IS_GLOBAL) {
-                symbolBlock.getFrame().addSymbol(symbol);
-                symbol.setNeedsSlot(true);
-            }
-        } else if (symbol.less(flags)) {
-            symbol.setFlags(flags);
-        }
-
-        if (node != null) {
-            node.setSymbol(symbol);
-        }
-
-        return symbol;
-    }
-
-    /**
-     * Declare the use of a symbol.
-     *
-     * @param name Name of symbol.
-     * @param node Using node
-     *
-     * @return Symbol for given name.
-     */
-    public Symbol useSymbol(final String name, final Node node) {
-        Symbol symbol = findSymbol(name);
-
-        if (symbol == null) {
-            // If not found, declare as a free var.
-            symbol = defineSymbol(name, IS_GLOBAL, node);
-        } else {
-            node.setSymbol(symbol);
-        }
-
-        return symbol;
-    }
-
-    /**
-     * Add parent name to the builder.
-     *
-     * @param sb String bulder.
-     */
-    public void addParentName(final StringBuilder sb) {
-        if (parent != null) {
-            parent.addParentName(sb);
-        }
-    }
-
     @Override
     public void toString(final StringBuilder sb) {
         for (final Node statement : statements) {
@@ -505,16 +246,6 @@
     }
 
     /**
-     * Get the FunctionNode for this block, i.e. the function it
-     * belongs to
-     *
-     * @return the function node
-     */
-    public FunctionNode getFunction() {
-        return function;
-    }
-
-    /**
      * Reset the frame for this block
      *
      * @param frame  the new frame
@@ -524,24 +255,6 @@
     }
 
     /**
-     * Get the parent block
-     *
-     * @return parent block, or null if none exists
-     */
-    public Block getParent() {
-        return parent;
-    }
-
-    /**
-     * Set the parent block
-     *
-     * @param parent the new parent block
-     */
-    public void setParent(final Block parent) {
-        this.parent = parent;
-    }
-
-    /**
      * Get the list of statements in this block
      *
      * @return a list of statements
@@ -551,6 +264,15 @@
     }
 
     /**
+     * Applies the specified visitor to all statements in the block.
+     * @param visitor the visitor.
+     */
+    public void visitStatements(NodeVisitor visitor) {
+        for (ListIterator<Node> stmts = statements.listIterator(); stmts.hasNext();) {
+            stmts.set(stmts.next().accept(visitor));
+        }
+    }
+    /**
      * Reset the statement list for this block
      *
      * @param statements  new statement list
@@ -585,4 +307,29 @@
         needsScope = true;
     }
 
+    /**
+     * Marks this block as using a specified scoped symbol. The block and its parent blocks up to but not
+     * including the block defining the symbol will be marked as needing parent scope. The block defining the symbol
+     * will be marked as one that needs to have its own scope.
+     * @param symbol the symbol being used.
+     * @param ancestors the iterator over block's containing lexical context
+     */
+    public void setUsesScopeSymbol(final Symbol symbol, Iterator<Block> ancestors) {
+        if(symbol.getBlock() == this) {
+            setNeedsScope();
+        } else {
+            setUsesParentScopeSymbol(symbol, ancestors);
+        }
+    }
+
+    /**
+     * Invoked when this block uses a scope symbol defined in one of its ancestors.
+     * @param symbol the scope symbol being used
+     * @param ancestors iterator over ancestor blocks
+     */
+    void setUsesParentScopeSymbol(final Symbol symbol, Iterator<Block> ancestors) {
+        if(ancestors.hasNext()) {
+            ancestors.next().setUsesScopeSymbol(symbol, ancestors);
+        }
+    }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/BreakNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/BreakNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -64,8 +64,8 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
+        if (visitor.enterBreakNode(this) != null) {
+            return visitor.leaveBreakNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/CallNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/CallNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -37,7 +37,7 @@
  * IR representation for a function call.
  *
  */
-public class CallNode extends Node implements TypeOverride {
+public class CallNode extends Node implements TypeOverride<CallNode> {
 
     private Type type;
 
@@ -176,13 +176,13 @@
         if (hasCallSiteType()) {
             return type;
         }
-        assert !function.getType().isUnknown();
-        return function.getType();
+        return function instanceof FunctionNode ? ((FunctionNode)function).getReturnType() : Type.OBJECT;
     }
 
     @Override
-    public void setType(final Type type) {
+    public CallNode setType(final Type type) {
         this.type = type;
+        return this;
     }
 
     private boolean hasCallSiteType() {
@@ -208,14 +208,14 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterCallNode(this) != null) {
             function = function.accept(visitor);
 
             for (int i = 0, count = args.size(); i < count; i++) {
                 args.set(i, args.get(i).accept(visitor));
             }
 
-            return visitor.leave(this);
+            return visitor.leaveCallNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/CaseNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/CaseNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -79,7 +79,7 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterCaseNode(this) != null) {
             if (test != null) {
                 test = test.accept(visitor);
             }
@@ -87,7 +87,7 @@
                 body = (Block)body.accept(visitor);
             }
 
-            return visitor.leave(this);
+            return visitor.leaveCaseNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/CatchNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/CatchNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -84,7 +84,7 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterCatchNode(this) != null) {
             exception = (IdentNode)exception.accept(visitor);
 
             if (exceptionCondition != null) {
@@ -92,7 +92,7 @@
             }
 
             body = (Block)body.accept(visitor);
-            return visitor.leave(this);
+            return visitor.leaveCatchNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/ContinueNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/ContinueNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -61,8 +61,8 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
+        if (visitor.enterContinueNode(this) != null) {
+            return visitor.leaveContinueNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/DoWhileNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/DoWhileNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -63,11 +63,11 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterDoWhileNode(this) != null) {
             body = (Block)body.accept(visitor);
             test = test.accept(visitor);
 
-            return visitor.leave(this);
+            return visitor.leaveDoWhileNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/EmptyNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/EmptyNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -57,8 +57,8 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
+        if (visitor.enterEmptyNode(this) != null) {
+            return visitor.leaveEmptyNode(this);
         }
         return this;
     }
--- a/nashorn/src/jdk/nashorn/internal/ir/ExecuteNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/ExecuteNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -85,9 +85,9 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterExecuteNode(this) != null) {
             setExpression(expression.accept(visitor));
-            return visitor.leave(this);
+            return visitor.leaveExecuteNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/ForNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/ForNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -76,7 +76,7 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterForNode(this) != null) {
             if (init != null) {
                 init = init.accept(visitor);
             }
@@ -91,7 +91,7 @@
 
             body = (Block)body.accept(visitor);
 
-            return visitor.leave(this);
+            return visitor.leaveForNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -33,8 +33,10 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.LinkedList;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Stack;
 import jdk.nashorn.internal.codegen.CompileUnit;
 import jdk.nashorn.internal.codegen.Compiler;
@@ -45,16 +47,18 @@
 import jdk.nashorn.internal.ir.annotations.Ignore;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.parser.Parser;
+import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.Source;
 import jdk.nashorn.internal.runtime.UserAccessorProperty;
 import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
 
 /**
  * IR representation for function (or script.)
- *
  */
 public class FunctionNode extends Block {
 
+    private static final Type FUNCTION_TYPE = Type.typeFor(ScriptFunction.class);
+
     /** Function kinds */
     public enum Kind {
         /** a normal function - nothing special */
@@ -86,7 +90,9 @@
         /** method has had its types finalized */
         FINALIZED,
         /** method has been emitted to bytecode */
-        EMITTED
+        EMITTED,
+        /** code installed in a class loader */
+        INSTALLED
     }
 
     /** External function identifier. */
@@ -108,9 +114,6 @@
     /** List of parameters. */
     private List<IdentNode> parameters;
 
-    /** List of nested functions. */
-    private List<FunctionNode> functions;
-
     /** First token of function. **/
     private long firstToken;
 
@@ -153,10 +156,6 @@
     /** Pending control list. */
     private final Stack<Node> controlStack;
 
-    /** Variable declarations in the function's scope */
-    @Ignore
-    private final List<VarNode> declarations;
-
     /** VarNode for this function statement */
     @Ignore //this is explicit code anyway and should not be traversed after lower
     private VarNode funcVarNode;
@@ -173,37 +172,42 @@
     @Ignore
     private final EnumSet<CompilationState> compilationState;
 
+    /** Type hints, e.g based on parameters at call site */
+    private final Map<IdentNode, Type> specializedTypes;
+
     /** Function flags. */
     private int flags;
 
     /** Is anonymous function flag. */
-    private static final int IS_ANONYMOUS                = 0b0000_0000_0000_0001;
-    /** Is statement flag */
-    private static final int IS_STATEMENT                = 0b0000_0000_0000_0010;
+    private static final int IS_ANONYMOUS                = 1 << 0;
+    /** Is the function created in a function declaration (as opposed to a function expression) */
+    private static final int IS_DECLARED                 = 1 << 1;
     /** is this a strict mode function? */
-    private static final int IS_STRICT_MODE              = 0b0000_0000_0000_0100;
+    private static final int IS_STRICT_MODE              = 1 << 2;
     /** Does the function use the "arguments" identifier ? */
-    private static final int USES_ARGUMENTS              = 0b0000_0000_0000_1000;
+    private static final int USES_ARGUMENTS              = 1 << 3;
     /** Are we lowered ? */
-    private static final int IS_LOWERED                  = 0b0000_0000_0001_0000;
+    private static final int IS_LOWERED                  = 1 << 4;
     /** Has this node been split because it was too large? */
-    private static final int IS_SPLIT                    = 0b0000_0000_0010_0000;
+    private static final int IS_SPLIT                    = 1 << 5;
     /** Does the function call eval? */
-    private static final int HAS_EVAL                    = 0b0000_0000_0100_0000;
+    private static final int HAS_EVAL                    = 1 << 6;
     /** Does the function contain a with block ? */
-    private static final int HAS_WITH                    = 0b0000_0000_1000_0000;
+    private static final int HAS_WITH                    = 1 << 7;
     /** Does a descendant function contain a with or eval? */
-    private static final int HAS_DESCENDANT_WITH_OR_EVAL = 0b0000_0001_0000_0000;
+    private static final int HAS_DESCENDANT_WITH_OR_EVAL = 1 << 8;
     /** Does the function define "arguments" identifier as a parameter of nested function name? */
-    private static final int DEFINES_ARGUMENTS           = 0b0000_0010_0000_0000;
+    private static final int DEFINES_ARGUMENTS           = 1 << 9;
     /** Does the function need a self symbol? */
-    private static final int NEEDS_SELF_SYMBOL           = 0b0000_0100_0000_0000;
+    private static final int NEEDS_SELF_SYMBOL           = 1 << 10;
     /** Does this function or any of its descendants use variables from an ancestor function's scope (incl. globals)? */
-    private static final int USES_ANCESTOR_SCOPE         = 0b0000_1000_0000_0000;
+    private static final int USES_ANCESTOR_SCOPE         = 1 << 11;
     /** Is this function lazily compiled? */
-    private static final int IS_LAZY                     = 0b0001_0000_0000_0000;
+    private static final int IS_LAZY                     = 1 << 12;
     /** Does this function have lazy, yet uncompiled children */
-    private static final int HAS_LAZY_CHILDREN           = 0b0010_0000_0000_0000;
+    private static final int HAS_LAZY_CHILDREN           = 1 << 13;
+    /** Does this function have lazy, yet uncompiled children */
+    private static final int IS_PROGRAM                   = 1 << 14;
 
     /** Does this function or any nested functions contain a with or an eval? */
     private static final int HAS_DEEP_WITH_OR_EVAL = HAS_EVAL | HAS_WITH | HAS_DESCENDANT_WITH_OR_EVAL;
@@ -211,54 +215,39 @@
     private static final int HAS_ALL_VARS_IN_SCOPE = HAS_DEEP_WITH_OR_EVAL | IS_SPLIT | HAS_LAZY_CHILDREN;
     /** Does this function potentially need "arguments"? Note that this is not a full test, as further negative check of REDEFINES_ARGS is needed. */
     private static final int MAYBE_NEEDS_ARGUMENTS = USES_ARGUMENTS | HAS_EVAL;
-    /** Does this function need the parent scope? It needs it if either it or its descendants use variables from it, or have a deep with or eval. */
-    private static final int NEEDS_PARENT_SCOPE = USES_ANCESTOR_SCOPE | HAS_DEEP_WITH_OR_EVAL;
+    /** Does this function need the parent scope? It needs it if either it or its descendants use variables from it, or have a deep with or eval.
+     *  We also pessimistically need a parent scope if we have lazy children that have not yet been compiled */
+    private static final int NEEDS_PARENT_SCOPE = USES_ANCESTOR_SCOPE | HAS_DEEP_WITH_OR_EVAL | HAS_LAZY_CHILDREN;
 
     /** What is the return type of this function? */
     private Type returnType = Type.UNKNOWN;
 
     /**
-     * Used to keep track of a function's parent blocks.
-     * This is needed when a (finally body) block is cloned than contains inner functions.
-     * Does not include function.getParent().
-     */
-    @Ignore
-    private List<Block> referencingParentBlocks;
-
-    /**
      * Constructor
      *
      * @param source    the source
      * @param token     token
      * @param finish    finish
      * @param namespace the namespace
-     * @param parent    the parent block
      * @param ident     the identifier
      * @param name      the name of the function
      */
-    @SuppressWarnings("LeakingThisInConstructor")
-    public FunctionNode(final Source source, final long token, final int finish, final Namespace namespace, final Block parent, final IdentNode ident, final String name) {
-        super(source, token, finish, parent, null);
+    public FunctionNode(final Source source, final long token, final int finish, final Namespace namespace, final IdentNode ident, final String name) {
+        super(source, token, finish);
 
         this.ident             = ident;
         this.name              = name;
         this.kind              = Kind.NORMAL;
         this.parameters        = new ArrayList<>();
-        this.functions         = new ArrayList<>();
         this.firstToken        = token;
         this.lastToken         = token;
         this.namespace         = namespace;
         this.labelStack        = new Stack<>();
         this.controlStack      = new Stack<>();
-        this.declarations      = new ArrayList<>();
-        // my block -> function is this. We added @SuppressWarnings("LeakingThisInConstructor") as NetBeans identifies
-        // it as such a leak - this is a false positive as we're setting this into a field of the object being
-        // constructed, so it can't be seen from other threads.
-        this.function          = this;
         this.compilationState  = EnumSet.of(CompilationState.INITIALIZED);
+        this.specializedTypes  = new HashMap<>();
     }
 
-    @SuppressWarnings("LeakingThisInConstructor")
     private FunctionNode(final FunctionNode functionNode, final CopyState cs) {
         super(functionNode, cs);
 
@@ -268,10 +257,9 @@
 
         this.parameters = new ArrayList<>();
         for (final IdentNode param : functionNode.getParameters()) {
-            this.parameters.add((IdentNode) cs.existingOrCopy(param));
+            this.parameters.add((IdentNode)cs.existingOrCopy(param));
         }
 
-        this.functions         = new ArrayList<>();
         this.firstToken        = functionNode.firstToken;
         this.lastToken         = functionNode.lastToken;
         this.namespace         = functionNode.getNamespace();
@@ -283,43 +271,34 @@
         this.calleeNode        = (IdentNode)cs.existingOrCopy(functionNode.calleeNode);
         this.labelStack        = new Stack<>();
         this.controlStack      = new Stack<>();
-        this.declarations      = new ArrayList<>();
-
-        for (final VarNode decl : functionNode.getDeclarations()) {
-            declarations.add((VarNode) cs.existingOrCopy(decl)); //TODO same?
-        }
 
         this.flags = functionNode.flags;
 
         this.funcVarNode = (VarNode)cs.existingOrCopy(functionNode.funcVarNode);
         /** VarNode for this function statement */
 
-        // my block -> function is this. We added @SuppressWarnings("LeakingThisInConstructor") as NetBeans identifies
-        // it as such a leak - this is a false positive as we're setting this into a field of the object being
-        // constructed, so it can't be seen from other threads.
-        this.function = this;
-
         this.compilationState = EnumSet.copyOf(functionNode.compilationState);
+        this.specializedTypes = new HashMap<>();
     }
 
     @Override
     protected Node copy(final CopyState cs) {
         // deep clone all parent blocks
-        return fixBlockChain(new FunctionNode(this, cs));
+        return new FunctionNode(this, cs);
     }
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        final FunctionNode saveFunctionNode = visitor.getCurrentFunctionNode();
-        final Block        saveBlock        = visitor.getCurrentBlock();
+        final FunctionNode  saveFunctionNode  = visitor.getCurrentFunctionNode();
+        final Block         saveBlock         = visitor.getCurrentBlock();
+        final MethodEmitter saveMethodEmitter = visitor.getCurrentMethodEmitter();
+        final CompileUnit   saveCompileUnit   = visitor.getCurrentCompileUnit();
 
         visitor.setCurrentFunctionNode(this);
-        visitor.setCurrentCompileUnit(getCompileUnit());
-        visitor.setCurrentMethodEmitter(getMethodEmitter());
         visitor.setCurrentBlock(this);
 
         try {
-            if (visitor.enter(this) != null) {
+            if (visitor.enterFunctionNode(this) != null) {
                 if (ident != null) {
                     ident = (IdentNode)ident.accept(visitor);
                 }
@@ -328,51 +307,25 @@
                     parameters.set(i, (IdentNode)parameters.get(i).accept(visitor));
                 }
 
-                for (int i = 0, count = functions.size(); i < count; i++) {
-                    functions.set(i, (FunctionNode)functions.get(i).accept(visitor));
-                }
-
                 for (int i = 0, count = statements.size(); i < count; i++) {
                     statements.set(i, statements.get(i).accept(visitor));
                 }
 
-                return visitor.leave(this);
+                return visitor.leaveFunctionNode(this);
             }
         } finally {
             visitor.setCurrentBlock(saveBlock);
             visitor.setCurrentFunctionNode(saveFunctionNode);
-            visitor.setCurrentCompileUnit(saveFunctionNode != null ? saveFunctionNode.getCompileUnit() : null);
-            visitor.setCurrentMethodEmitter(saveFunctionNode != null ? saveFunctionNode.getMethodEmitter() : null);
+            visitor.setCurrentCompileUnit(saveCompileUnit);
+            visitor.setCurrentMethodEmitter(saveMethodEmitter);
         }
 
         return this;
     }
 
-    /**
-     * Locate the parent function.
-     *
-     * @return Parent function.
-     */
-    public FunctionNode findParentFunction() {
-        return getParent() != null ? getParent().getFunction() : null;
-    }
-
-    /**
-     * Add parent name to the builder.
-     *
-     * @param sb String builder.
-     */
-    @Override
-    public void addParentName(final StringBuilder sb) {
-        if (!isScript()) {
-            sb.append(getName());
-            sb.append("$");
-        }
-    }
-
     @Override
     public boolean needsScope() {
-        return super.needsScope() || isScript();
+        return super.needsScope() || isProgram();
     }
 
     /**
@@ -530,12 +483,18 @@
     }
 
     /**
-     * Determine if script function.
-     *
-     * @return True if script function.
+     * Returns true if the function is the top-level program.
+     * @return True if this function node represents the top-level program.
      */
-    public boolean isScript() {
-        return getParent() == null;
+    public boolean isProgram() {
+        return (flags & IS_PROGRAM) != 0;
+    }
+
+    /**
+     * Marks the function as representing the top-level program.
+     */
+    public void setProgram() {
+        flags |= IS_PROGRAM;
     }
 
     /**
@@ -575,31 +534,31 @@
 
     /**
      * Flag this function as using the {@code with} keyword
+     * @param ancestors the iterator over functions in this functions's containing lexical context
      */
-    public void setHasWith() {
+    public void setHasWith(final Iterator<FunctionNode> ancestors) {
         if(!hasWith()) {
             this.flags |= HAS_WITH;
             // with requires scope in parents.
             // TODO: refine this. with should not force all variables in parents to be in scope, only those that are
             // actually referenced as identifiers by name
-            markParentForWithOrEval();
+            markParentForWithOrEval(ancestors);
         }
     }
 
-    private void markParentForWithOrEval() {
+    private void markParentForWithOrEval(final Iterator<FunctionNode> ancestors) {
         // If this is invoked, then either us or a descendant uses with or eval, meaning we must have our own scope.
         setNeedsScope();
 
-        final FunctionNode parentFunction = findParentFunction();
-        if(parentFunction != null) {
-            parentFunction.setDescendantHasWithOrEval();
+        if(ancestors.hasNext()) {
+            ancestors.next().setDescendantHasWithOrEval(ancestors);
         }
     }
 
-    private void setDescendantHasWithOrEval() {
+    private void setDescendantHasWithOrEval(final Iterator<FunctionNode> ancestors) {
         if((flags & HAS_DESCENDANT_WITH_OR_EVAL) == 0) {
             flags |= HAS_DESCENDANT_WITH_OR_EVAL;
-            markParentForWithOrEval();
+            markParentForWithOrEval(ancestors);
         }
     }
 
@@ -614,11 +573,12 @@
 
     /**
      * Flag this function as calling the {@code eval} function
+     * @param ancestors the iterator over functions in this functions's containing lexical context
      */
-    public void setHasEval() {
+    public void setHasEval(final Iterator<FunctionNode> ancestors) {
         if(!hasEval()) {
             this.flags |= HAS_EVAL;
-            markParentForWithOrEval();
+            markParentForWithOrEval(ancestors);
         }
     }
 
@@ -651,11 +611,34 @@
     }
 
     /**
-     * Get all nested functions
-     * @return list of nested functions in this function
+     * Returns a list of functions declared by this function. Only includes declared functions, and does not include any
+     * function expressions that might occur in its body.
+     * @return a list of functions declared by this function.
      */
-    public List<FunctionNode> getFunctions() {
-        return Collections.unmodifiableList(functions);
+    public List<FunctionNode> getDeclaredFunctions() {
+        // Note that the function does not have a dedicated list of declared functions, but rather relies on the
+        // invariant that all function declarations are at the beginning of the statement list as VarNode with a
+        // FunctionNode marked as statement with its variable initializer. Every VarNode is also preceded by a
+        // LineNumberNode. This invariant is established by the parser and has to be preserved in visitors.
+        final List<FunctionNode> fns = new ArrayList<>();
+        for (final Node stmt : statements) {
+            if(stmt instanceof LineNumberNode) {
+                continue;
+            } else if(stmt instanceof VarNode) {
+                final Node init = ((VarNode)stmt).getInit();
+                if(init instanceof FunctionNode) {
+                    final FunctionNode fn = (FunctionNode)init;
+                    if(fn.isDeclared()) {
+                        fns.add(fn);
+                        continue;
+                    }
+                }
+            }
+            // Node is neither a LineNumberNode, nor a function declaration VarNode. Since all function declarations are
+            // at the start of the function, we've reached the end of function declarations.
+            break;
+        }
+        return fns;
     }
 
     /**
@@ -710,6 +693,7 @@
      * Check if this function's generated Java method needs a {@code callee} parameter. Functions that need access to
      * their parent scope, functions that reference themselves, and non-strict functions that need an Arguments object
      * (since it exposes {@code arguments.callee} property) will need to have a callee parameter.
+     *
      * @return true if the function's generated Java method needs a {@code callee} parameter.
      */
     public boolean needsCallee() {
@@ -786,7 +770,7 @@
     public boolean needsArguments() {
         // uses "arguments" or calls eval, but it does not redefine "arguments", and finally, it's not a script, since
         // for top-level script, "arguments" is picked up from Context by Global.init() instead.
-        return (flags & MAYBE_NEEDS_ARGUMENTS) != 0 && (flags & DEFINES_ARGUMENTS) == 0 && !isScript();
+        return (flags & MAYBE_NEEDS_ARGUMENTS) != 0 && (flags & DEFINES_ARGUMENTS) == 0 && !isProgram();
     }
 
     /**
@@ -805,7 +789,7 @@
      * @return true if the function needs parent scope.
      */
     public boolean needsParentScope() {
-        return (flags & NEEDS_PARENT_SCOPE) != 0 || isScript();
+        return (flags & NEEDS_PARENT_SCOPE) != 0 || isProgram();
     }
 
     /**
@@ -865,7 +849,7 @@
      * @return true if all variables should be in scope
      */
     public boolean allVarsInScope() {
-        return isScript() || (flags & HAS_ALL_VARS_IN_SCOPE) != 0;
+        return isProgram() || (flags & HAS_ALL_VARS_IN_SCOPE) != 0;
     }
 
     /**
@@ -919,6 +903,27 @@
     }
 
     /**
+     * Get a specialized type for an identity, if one exists
+     * @param node node to check specialized type for
+     * @return null if no specialization exists, otherwise type
+     */
+    public Type getSpecializedType(final IdentNode node) {
+        return specializedTypes.get(node);
+    }
+
+    /**
+     * Set parameter type hints for specialization.
+     * @param types types array of length equal to parameter list size
+     */
+    public void setParameterTypes(final Class<?>[] types) {
+        assert types.length == parameters.size() : "Type vector length doesn't correspond to parameter types";
+        //diff - skip the callee and this etc, they are not explicit params in the parse tree
+        for (int i = 0; i < types.length ; i++) {
+            specializedTypes.put(parameters.get(i), Type.typeFor(types[i]));
+        }
+    }
+
+    /**
      * Get the identifier for the variable in which the function return value
      * should be stored
      * @return an IdentNode representing the return value
@@ -953,19 +958,19 @@
     }
 
     /**
-     * Check if this function is a statement
-     * @return true if function is a statement
+     * Check if this function is created as a function declaration (as opposed to function expression)
+     * @return true if function is declared.
      */
-    public boolean isStatement() {
-        return (flags & IS_STATEMENT) != 0;
+    public boolean isDeclared() {
+        return (flags & IS_DECLARED) != 0;
     }
 
     /**
-     * Flag this function as a statement
+     * Flag this function as being created as a function declaration (as opposed to a function expression).
      * @see Parser
      */
-    public void setIsStatement() {
-        this.flags |= IS_STATEMENT;
+    public void setIsDeclared() {
+        this.flags |= IS_DECLARED;
     }
 
     /**
@@ -1013,35 +1018,16 @@
     }
 
     /**
-     * Marks this function as one using any global symbol. The function and all its parent functions will all be marked
-     * as needing parent scope.
-     * @see #needsParentScope()
+     * Marks this function as using any of its ancestors' scopes.
      */
-    public void setUsesGlobalSymbol() {
+    public void setUsesAncestorScope() {
         this.flags |= USES_ANCESTOR_SCOPE;
-        final FunctionNode parentFn = findParentFunction();
-        if(parentFn != null) {
-            parentFn.setUsesGlobalSymbol();
-        }
     }
 
-    /**
-     * Marks this function as using a specified scoped symbol. The function and its parent functions up to but not
-     * including the function defining the symbol will be marked as needing parent scope. The function defining the
-     * symbol will be marked as one that needs to have its own scope.
-     * @param symbol the symbol being used.
-     * @see #needsParentScope()
-     */
-    public void setUsesScopeSymbol(final Symbol symbol) {
-        if(symbol.getBlock() == this) {
-            setNeedsScope();
-        } else {
-            this.flags |= USES_ANCESTOR_SCOPE;
-            final FunctionNode parentFn = findParentFunction();
-            if(parentFn != null) {
-                parentFn.setUsesScopeSymbol(symbol);
-            }
-        }
+    @Override
+    void setUsesParentScopeSymbol(Symbol symbol, Iterator<Block> ancestors) {
+        setUsesAncestorScope();
+        super.setUsesParentScopeSymbol(symbol, ancestors);
     }
 
     /**
@@ -1116,7 +1102,7 @@
 
     @Override
     public Type getType() {
-        return getReturnType();
+        return FUNCTION_TYPE;
     }
 
     /**
@@ -1176,56 +1162,6 @@
     }
 
     /**
-     * Add a new function to the function list.
-     *
-     * @param functionNode Function node to add.
-     */
-    @Override
-    public void addFunction(final FunctionNode functionNode) {
-        assert functionNode != null;
-        functions.add(functionNode);
-    }
-
-    /**
-     * Add a list of functions to the function list.
-     *
-     * @param functionNodes  Function nodes to add.
-     */
-    @Override
-    public void addFunctions(final List<FunctionNode> functionNodes) {
-        functions.addAll(functionNodes);
-    }
-
-    /**
-     * Set a function list
-     *
-     * @param functionNodes to set
-     */
-    @Override
-    public void setFunctions(final List<FunctionNode> functionNodes) {
-        this.functions = functionNodes;
-    }
-
-    /**
-     * Add a variable declaration that should be visible to the entire function
-     * scope. Parser does this.
-     *
-     * @param varNode a var node
-     */
-    public void addDeclaration(final VarNode varNode) {
-        declarations.add(varNode);
-    }
-
-    /**
-     * Return all variable declarations from this function scope
-     *
-     * @return all VarNodes in scope
-     */
-    public List<VarNode> getDeclarations() {
-        return Collections.unmodifiableList(declarations);
-    }
-
-    /**
      * Get the compile unit used to compile this function
      * @see Compiler
      * @return the compile unit
@@ -1258,32 +1194,4 @@
     public void setMethodEmitter(final MethodEmitter method) {
         this.method = method;
     }
-
-    /**
-     * Each FunctionNode maintains a list of reference to its parent blocks.
-     * Add a parent block to this function.
-     *
-     * @param parentBlock  a block to remember as parent
-     */
-    public void addReferencingParentBlock(final Block parentBlock) {
-        assert parentBlock.getFunction() == function.findParentFunction(); // all parent blocks must be in the same function
-        if (parentBlock != function.getParent()) {
-            if (referencingParentBlocks == null) {
-                referencingParentBlocks = new LinkedList<>();
-            }
-            referencingParentBlocks.add(parentBlock);
-        }
-    }
-
-    /**
-     * Get the known parent blocks to this function
-     *
-     * @return list of parent blocks
-     */
-    public List<Block> getReferencingParentBlocks() {
-        if (referencingParentBlocks == null) {
-            return Collections.emptyList();
-        }
-        return Collections.unmodifiableList(referencingParentBlocks);
-    }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,18 +38,18 @@
 /**
  * IR representation for an identifier.
  */
-public class IdentNode extends Node implements PropertyKey, TypeOverride, FunctionCall {
+public class IdentNode extends Node implements PropertyKey, TypeOverride<IdentNode>, FunctionCall {
+    private static final int PROPERTY_NAME    = 1 << 0;
+    private static final int INITIALIZED_HERE = 1 << 1;
+    private static final int FUNCTION         = 1 << 2;
+
     /** Identifier. */
     private final String name;
 
     /** Type for a callsite, e.g. X in a get()X or a set(X)V */
     private Type callSiteType;
 
-    /** flag for an ident that is the property name of an AccessNode. */
-    private boolean isPropertyName;
-
-    /** flag for an ident on the left hand side of <code>var lhs = rhs;</code>. */
-    private boolean isInitializedHere;
+    private byte flags;
 
     /**
      * Constructor
@@ -71,9 +71,8 @@
      */
     public IdentNode(final IdentNode identNode) {
         super(identNode);
-        this.name              = identNode.getName();
-        this.isPropertyName    = identNode.isPropertyName;
-        this.isInitializedHere = identNode.isInitializedHere;
+        this.name  = identNode.getName();
+        this.flags = identNode.flags;
     }
 
     @Override
@@ -92,12 +91,17 @@
     }
 
     @Override
-    public void setType(final Type type) {
+    public IdentNode setType(final Type type) {
         if (DEBUG_FIELDS && getSymbol() != null && !Type.areEquivalent(getSymbol().getSymbolType(), type)) {
             ObjectClassGenerator.LOG.info(getClass().getName() + " " + this + " => " + type + " instead of " + getType());
         }
-        this.callSiteType = type;
         // do NOT, repeat NOT touch the symbol here. it might be a local variable or whatever. This is the override if it isn't
+        if(this.callSiteType == type) {
+            return this;
+        }
+        final IdentNode n = (IdentNode)clone();
+        n.callSiteType = type;
+        return n;
     }
 
     @Override
@@ -131,8 +135,8 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
+        if (visitor.enterIdentNode(this) != null) {
+            return visitor.leaveIdentNode(this);
         }
 
         return this;
@@ -179,14 +183,18 @@
      * @return true if this is a property name
      */
     public boolean isPropertyName() {
-        return isPropertyName;
+        return (flags & PROPERTY_NAME) != 0;
     }
 
     /**
      * Flag this IdentNode as a property name
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setIsPropertyName() {
-        isPropertyName = true;
+    public IdentNode setIsPropertyName() {
+        if(isPropertyName()) return this;
+        final IdentNode n = (IdentNode)clone();
+        n.flags |= PROPERTY_NAME;
+        return n;
     }
 
     /**
@@ -194,14 +202,18 @@
      * @return true if IdentNode is initialized on creation
      */
     public boolean isInitializedHere() {
-        return isInitializedHere;
+        return (flags & INITIALIZED_HERE) != 0;
     }
 
     /**
      * Flag IdentNode to be initialized on creation
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setIsInitializedHere() {
-        isInitializedHere = true;
+    public IdentNode setIsInitializedHere() {
+        if(isInitializedHere()) return this;
+        final IdentNode n = (IdentNode)clone();
+        n.flags |= INITIALIZED_HERE;
+        return n;
     }
 
     /**
@@ -216,6 +228,17 @@
 
     @Override
     public boolean isFunction() {
-        return false;
+        return (flags & FUNCTION) != 0;
+    }
+
+    /**
+     * Mark this node as being the callee operand of a {@link CallNode}.
+     * @return an ident node identical to this one in all aspects except with its function flag set.
+     */
+    public IdentNode setIsFunction() {
+        if(isFunction()) return this;
+        final IdentNode n = (IdentNode)clone();
+        n.flags |= FUNCTION;
+        return n;
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/IfNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/IfNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -75,7 +75,7 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterIfNode(this) != null) {
             test = test.accept(visitor);
 
             pass = (Block)pass.accept(visitor);
@@ -84,7 +84,7 @@
                 fail = (Block)fail.accept(visitor);
             }
 
-            return visitor.leave(this);
+            return visitor.leaveIfNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/IndexNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/IndexNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -36,7 +36,7 @@
  * IR representation of an indexed access (brackets operator.)
  *
  */
-public class IndexNode extends BaseNode implements TypeOverride {
+public class IndexNode extends BaseNode implements TypeOverride<IndexNode> {
     /** Property ident. */
     private Node index;
 
@@ -92,10 +92,10 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterIndexNode(this) != null) {
             base = base.accept(visitor);
             index = index.accept(visitor);
-            return visitor.leave(this);
+            return visitor.leaveIndexNode(this);
         }
 
         return this;
@@ -144,12 +144,13 @@
     }
 
     @Override
-    public void setType(final Type type) {
+    public IndexNode setType(final Type type) {
         if (DEBUG_FIELDS && !Type.areEquivalent(getSymbol().getSymbolType(), type)) {
             ObjectClassGenerator.LOG.info(getClass().getName() + " " + this + " => " + type + " instead of " + getType());
         }
         hasCallSiteType = true;
         getSymbol().setTypeOverride(type);
+        return this;
     }
 
     @Override
--- a/nashorn/src/jdk/nashorn/internal/ir/LabelNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/LabelNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -81,10 +81,10 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterLabelNode(this) != null) {
             label = (IdentNode)label.accept(visitor);
             body  = (Block)body.accept(visitor);
-            return visitor.leave(this);
+            return visitor.leaveLabelNode(this);
         }
 
         return this;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,198 @@
+package jdk.nashorn.internal.ir;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A class that tracks the current lexical context of node visitation as a stack of {@link Block} nodes. Has special
+ * methods to retrieve useful subsets of the context.
+ */
+public class LexicalContext implements Cloneable {
+    private final Deque<Block> lexicalContext;
+
+    /**
+     * Creates a new empty lexical context.
+     */
+    public LexicalContext() {
+        lexicalContext = new ArrayDeque<>();
+    }
+
+    /**
+     * Pushes a new block on top of the context, making it the innermost open block.
+     * @param block the new block
+     */
+    public void push(Block block) {
+        //new Exception(block.toString()).printStackTrace();
+        lexicalContext.push(block);
+    }
+
+    /**
+     * Pops the innermost block off the context.
+     * @param the block expected to be popped, used to detect unbalanced pushes/pops
+     */
+    public void pop(Block block) {
+        final Block popped = lexicalContext.pop();
+        assert popped == block;
+    }
+
+    /**
+     * Returns an iterator over all blocks in the context, with the top block (innermost lexical context) first.
+     * @return an iterator over all blocks in the context.
+     */
+    public Iterator<Block> getBlocks() {
+        return lexicalContext.iterator();
+    }
+
+    /**
+     * Returns an iterator over all functions in the context, with the top (innermost open) function first.
+     * @return an iterator over all functions in the context.
+     */
+    public Iterator<FunctionNode> getFunctions() {
+        return new FunctionIterator(getBlocks());
+    }
+
+    private static final class FunctionIterator implements Iterator<FunctionNode> {
+        private final Iterator<Block> it;
+        private FunctionNode next;
+
+        FunctionIterator(Iterator<Block> it) {
+            this.it = it;
+            next = findNext();
+        }
+
+        @Override
+        public boolean hasNext() {
+            return next != null;
+        }
+
+        @Override
+        public FunctionNode next() {
+            if(next == null) {
+                throw new NoSuchElementException();
+            }
+            FunctionNode lnext = next;
+            next = findNext();
+            return lnext;
+        }
+
+        private FunctionNode findNext() {
+            while(it.hasNext()) {
+                final Block block = it.next();
+                if(block instanceof FunctionNode) {
+                    return ((FunctionNode)block);
+                }
+            }
+            return null;
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     * Returns an iterator over all ancestors block of the given block, with its parent block first.
+     * @param block the block whose ancestors are returned
+     * @return an iterator over all ancestors block of the given block.
+     */
+    public Iterator<Block> getAncestorBlocks(Block block) {
+        final Iterator<Block> it = getBlocks();
+        while(it.hasNext()) {
+            final Block b = it.next();
+            if(block == b) {
+                return it;
+            }
+        }
+        throw new AssertionError("Block is not on the current lexical context stack");
+    }
+
+    /**
+     * Returns an iterator over a block and all its ancestors blocks, with the block first.
+     * @param block the block that is the starting point of the iteration.
+     * @return an iterator over a block and all its ancestors.
+     */
+    public Iterator<Block> getBlocks(final Block block) {
+        final Iterator<Block> it = getAncestorBlocks(block);
+        return new Iterator<Block>() {
+            boolean blockReturned = false;
+            @Override
+            public boolean hasNext() {
+                return it.hasNext() || !blockReturned;
+            }
+            @Override
+            public Block next() {
+                if(blockReturned) {
+                    return it.next();
+                }
+                blockReturned = true;
+                return block;
+            }
+            @Override
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /**
+     * Returns the closest function node to the block. If the block is itself a function, it is returned.
+     * @param block the block
+     * @return the function closest to the block.
+     * @see #getParentFunction(Block)
+     */
+    public FunctionNode getFunction(Block block) {
+        if(block instanceof FunctionNode) {
+            return (FunctionNode)block;
+        }
+        return getParentFunction(block);
+    }
+
+    /**
+     * Returns the closest function node to the block and all its ancestor functions. If the block is itself a function,
+     * it is returned too.
+     * @param block the block
+     * @return the closest function node to the block and all its ancestor functions.
+     */
+    public Iterator<FunctionNode> getFunctions(final Block block) {
+        return new FunctionIterator(getBlocks(block));
+    }
+
+    /**
+     * Returns the containing function of the block. If the block is itself a function, its parent function is returned.
+     * @param block the block
+     * @return the containing function of the block.
+     * @see #getFunction(Block)
+     */
+    public FunctionNode getParentFunction(Block block) {
+        return getFirstFunction(getAncestorBlocks(block));
+    }
+
+    private static FunctionNode getFirstFunction(Iterator<Block> it) {
+        while(it.hasNext()) {
+            final Block ancestor = it.next();
+            if(ancestor instanceof FunctionNode) {
+                return (FunctionNode)ancestor;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the innermost block in the context.
+     * @return the innermost block in the context.
+     */
+    public Block getCurrentBlock() {
+        return lexicalContext.element();
+    }
+
+    /**
+     * Returns the innermost function in the context.
+     * @return the innermost function in the context.
+     */
+    public FunctionNode getCurrentFunction() {
+        return getFirstFunction(getBlocks());
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/ir/LineNumberNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/LineNumberNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -63,8 +63,8 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
+        if (visitor.enterLineNumberNode(this) != null) {
+            return visitor.leaveLineNumberNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -46,7 +46,7 @@
  */
 public abstract class LiteralNode<T> extends Node implements PropertyKey {
     /** Literal value */
-    protected T value;
+    protected final T value;
 
      /**
      * Constructor
@@ -67,8 +67,17 @@
      * @param literalNode source node
      */
     protected LiteralNode(final LiteralNode<T> literalNode) {
+        this(literalNode, literalNode.value);
+    }
+
+    /**
+     * A copy constructor with value change.
+     * @param literalNode the original literal node
+     * @param newValue new value for this node
+     */
+    protected LiteralNode(final LiteralNode<T> literalNode, final T newValue) {
         super(literalNode);
-        this.value = literalNode.value;
+        this.value = newValue;
     }
 
     @Override
@@ -217,8 +226,8 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
+        if (visitor.enterLiteralNode(this) != null) {
+            return visitor.leaveLiteralNode(this);
         }
 
         return this;
@@ -544,6 +553,10 @@
             super(literalNode);
         }
 
+        private NodeLiteralNode(final LiteralNode<Node> literalNode, final Node value) {
+            super(literalNode, value);
+        }
+
         @Override
         protected Node copy(final CopyState cs) {
             return new NodeLiteralNode(this);
@@ -551,11 +564,14 @@
 
         @Override
         public Node accept(final NodeVisitor visitor) {
-            if (visitor.enter(this) != null) {
+            if (visitor.enterLiteralNode(this) != null) {
                 if (value != null) {
-                    value = value.accept(visitor);
+                    final Node newValue = value.accept(visitor);
+                    if(value != newValue) {
+                        return visitor.leaveLiteralNode(new NodeLiteralNode(this, newValue));
+                    }
                 }
-                return visitor.leave(this);
+                return visitor.leaveLiteralNode(this);
             }
 
             return this;
@@ -878,14 +894,14 @@
 
         @Override
         public Node accept(final NodeVisitor visitor) {
-            if (visitor.enter(this) != null) {
+            if (visitor.enterLiteralNode(this) != null) {
                 for (int i = 0; i < value.length; i++) {
                     final Node element = value[i];
                     if (element != null) {
                         value[i] = element.accept(visitor);
                     }
                 }
-                return visitor.leave(this);
+                return visitor.leaveLiteralNode(this);
             }
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/Location.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/Location.java	Fri Apr 05 14:51:24 2013 -0700
@@ -65,7 +65,11 @@
 
     @Override
     protected Object clone() {
-        return new Location(this);
+        try {
+            return super.clone();
+        } catch(CloneNotSupportedException e) {
+            throw new AssertionError(e);
+        }
     }
 
     @Override
--- a/nashorn/src/jdk/nashorn/internal/ir/Node.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/Node.java	Fri Apr 05 14:51:24 2013 -0700
@@ -165,12 +165,19 @@
             return true;
         }
 
-        setIsResolved();
+        setIsResolved(true);
 
         return false;
     }
 
     /**
+     * Reset the resolved flag.
+     */
+    public void resetResolved() {
+        setIsResolved(false);
+    }
+
+    /**
      * Is this a debug info node like LineNumberNode etc?
      *
      * @return true if this is a debug node
@@ -234,8 +241,7 @@
      *
      * @return Deep copy of the  Node.
      */
-    @Override
-    public final Node clone() {
+    public final Node copy() {
         return copy(new CopyState());
     }
 
@@ -349,10 +355,10 @@
     }
 
     /**
-     * Flag this node as resolved, i.e. code has been generated for it
+     * Flag this node as resolved or not, i.e. code has been generated for it
      */
-    public void setIsResolved() {
-        this.isResolved = true;
+    private void setIsResolved(boolean isResolved) {
+        this.isResolved = isResolved;
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -28,7 +28,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import jdk.nashorn.internal.ir.annotations.Ignore;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.runtime.Source;
 
@@ -36,9 +35,6 @@
  * IR representation of an object literal.
  */
 public class ObjectNode extends Node {
-    /** Literal context. */
-    @Ignore
-    private Block context;
 
     /** Literal elements. */
     private final List<Node> elements;
@@ -49,13 +45,11 @@
      * @param source   the source
      * @param token    token
      * @param finish   finish
-     * @param context  the block for this ObjectNode
      * @param elements the elements used to initialize this ObjectNode
      */
-    public ObjectNode(final Source source, final long token, final int finish, final Block context, final List<Node> elements) {
+    public ObjectNode(final Source source, final long token, final int finish, final List<Node> elements) {
         super(source, token, finish);
 
-        this.context  = context;
         this.elements = elements;
     }
 
@@ -68,7 +62,6 @@
             newElements.add(cs.existingOrCopy(element));
         }
 
-        this.context  = (Block)cs.existingOrCopy(objectNode.context);
         this.elements = newElements;
     }
 
@@ -79,16 +72,12 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            if (context != null) {
-                context = (Block)context.accept(visitor);
-            }
-
+        if (visitor.enterObjectNode(this) != null) {
             for (int i = 0, count = elements.size(); i < count; i++) {
                 elements.set(i, elements.get(i).accept(visitor));
             }
 
-            return visitor.leave(this);
+            return visitor.leaveObjectNode(this);
         }
 
         return this;
@@ -117,14 +106,6 @@
     }
 
     /**
-     * Get the block that is this ObjectNode's literal context
-     * @return the block
-     */
-    public Block getContext() {
-        return context;
-    }
-
-    /**
      * Get the elements of this literal node
      * @return a list of elements
      */
--- a/nashorn/src/jdk/nashorn/internal/ir/PropertyNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/PropertyNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -88,7 +88,7 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterPropertyNode(this) != null) {
             key = (PropertyKey)((Node)key).accept(visitor);
 
             if (value != null) {
@@ -103,7 +103,7 @@
                 setter = setter.accept(visitor);
             }
 
-            return visitor.leave(this);
+            return visitor.leavePropertyNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/ReferenceNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.ir;
-
-import jdk.nashorn.internal.ir.annotations.Reference;
-import jdk.nashorn.internal.ir.visitor.NodeVisitor;
-import jdk.nashorn.internal.runtime.Source;
-
-/**
- * IR representation of a reference to another entity (function.)
- */
-public class ReferenceNode extends Node {
-    /** Node referenced. */
-    @Reference
-    private final FunctionNode reference;
-
-    /**
-     * Constructor
-     *
-     * @param source the source
-     * @param token  token
-     * @param finish finish
-     * @param reference the function node to reference
-     */
-    public ReferenceNode(final Source source, final long token, final int finish, final FunctionNode reference) {
-        super(source, token, finish);
-
-        this.reference = reference;
-    }
-
-    private ReferenceNode(final ReferenceNode referenceNode) {
-        super(referenceNode);
-
-        this.reference = referenceNode.reference;
-    }
-
-    @Override
-    protected Node copy(final CopyState cs) {
-        return new ReferenceNode(this);
-    }
-
-    @Override
-    public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            return visitor.leave(this);
-        }
-
-        return this;
-    }
-
-    @Override
-    public void toString(final StringBuilder sb) {
-        if (reference == null) {
-            sb.append("null");
-        } else {
-            reference.toString(sb);
-        }
-    }
-
-    /**
-     * Get there function node reference that this node points tp
-     * @return a function node reference
-     */
-    public FunctionNode getReference() {
-        return reference;
-    }
-
-}
--- a/nashorn/src/jdk/nashorn/internal/ir/ReturnNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/ReturnNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -100,12 +100,12 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterReturnNode(this) != null) {
             if (expression != null) {
                 expression = expression.accept(visitor);
             }
 
-            return visitor.leave(this);
+            return visitor.leaveReturnNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/RuntimeNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/RuntimeNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,7 +38,7 @@
  * IR representation for a runtime call.
  *
  */
-public class RuntimeNode extends Node implements TypeOverride {
+public class RuntimeNode extends Node implements TypeOverride<RuntimeNode> {
 
     /**
      * Request enum used for meta-information about the runtime request
@@ -393,8 +393,9 @@
     }
 
     @Override
-    public void setType(final Type type) {
+    public RuntimeNode setType(final Type type) {
         this.callSiteType = type;
+        return this;
     }
 
     @Override
@@ -408,12 +409,12 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterRuntimeNode(this) != null) {
             for (int i = 0, count = args.size(); i < count; i++) {
                 args.set(i, args.get(i).accept(visitor));
             }
 
-            return visitor.leave(this);
+            return visitor.leaveRuntimeNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/SplitNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/SplitNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -108,10 +108,10 @@
         visitor.setCurrentMethodEmitter(getMethodEmitter());
 
         try {
-            if (visitor.enter(this) != null) {
+            if (visitor.enterSplitNode(this) != null) {
                 body = body.accept(visitor);
 
-                return visitor.leave(this);
+                return visitor.leaveSplitNode(this);
             }
         } finally {
             visitor.setCurrentCompileUnit(saveCompileUnit);
--- a/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -85,7 +85,7 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterSwitchNode(this) != null) {
             expression = expression.accept(visitor);
 
             for (int i = 0, count = cases.size(); i < count; i++) {
@@ -94,7 +94,7 @@
 
             //the default case is in the cases list and should not be explicitly traversed!
 
-            return visitor.leave(this);
+            return visitor.leaveSwitchNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/Symbol.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/Symbol.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,31 +38,31 @@
  */
 
 public final class Symbol implements Comparable<Symbol> {
-    /** Symbol flags. Kind ordered by precedence. */
-    public static final int IS_TEMP     = 0b0000_0001;
+    /** Symbol kinds. Kind ordered by precedence. */
+    public static final int IS_TEMP     = 1;
     /** Is this Global */
-    public static final int IS_GLOBAL   = 0b0000_0010;
+    public static final int IS_GLOBAL   = 2;
     /** Is this a variable */
-    public static final int IS_VAR      = 0b0000_0011;
+    public static final int IS_VAR      = 3;
     /** Is this a parameter */
-    public static final int IS_PARAM    = 0b0000_0100;
+    public static final int IS_PARAM    = 4;
     /** Is this a constant */
-    public static final int IS_CONSTANT = 0b0000_0101;
-
-    static final int KINDMASK = 0b0000_1111;
+    public static final int IS_CONSTANT = 5;
+    /** Mask for kind flags */
+    public static final int KINDMASK = (1 << 3) - 1; // Kinds are represented by lower three bits
 
     /** Is this scope */
-    public static final int IS_SCOPE         = 0b0000_0001_0000;
+    public static final int IS_SCOPE         = 1 << 4;
     /** Is this a this symbol */
-    public static final int IS_THIS          = 0b0000_0010_0000;
+    public static final int IS_THIS          = 1 << 5;
     /** Can this symbol ever be undefined */
-    public static final int CAN_BE_UNDEFINED = 0b0000_0100_0000;
+    public static final int CAN_BE_UNDEFINED = 1 << 6;
     /** Can this symbol ever have primitive types */
-    public static final int CAN_BE_PRIMITIVE = 0b0000_1000_0000;
+    public static final int CAN_BE_PRIMITIVE = 1 << 7;
     /** Is this a let */
-    public static final int IS_LET           = 0b0001_0000_0000;
+    public static final int IS_LET           = 1 << 8;
     /** Is this an internal symbol, never represented explicitly in source code */
-    public static final int IS_INTERNAL      = 0b0010_0000_0000;
+    public static final int IS_INTERNAL      = 1 << 9;
 
     /** Null or name identifying symbol. */
     private final String name;
@@ -269,15 +269,6 @@
         return type.isCategory2() ? 2 : 1;
     }
 
-    /**
-     * Return the defining function (scope.)
-     *
-     * @return Defining function.
-     */
-    public FunctionNode findFunction() {
-        return block != null ? block.getFunction() : null;
-    }
-
     @Override
     public boolean equals(final Object other) {
         if (!(other instanceof Symbol)) {
@@ -487,27 +478,6 @@
     }
 
     /**
-     * Check if this symbol can be accessed directly with a putfield or getfield or dynamic load
-     *
-     * @param currentFunction function to check for fast scope
-     * @return true if fast scope
-     */
-    public boolean isFastScope(final FunctionNode currentFunction) {
-        if (!isScope() || !block.needsScope()) {
-            return false;
-        }
-        // Allow fast scope access if no parent function contains with or eval
-        FunctionNode func = currentFunction;
-        while (func != null) {
-            if (func.hasWith() || func.hasEval()) {
-                return false;
-            }
-            func = func.findParentFunction();
-        }
-        return true;
-    }
-
-    /**
      * Get the block in which the symbol is defined
      * @return a block
      */
@@ -651,7 +621,7 @@
      * @return true if this this is a global scope symbol
      */
     public boolean isTopLevel() {
-        return block instanceof FunctionNode && ((FunctionNode) block).isScript();
+        return block instanceof FunctionNode && ((FunctionNode) block).isProgram();
     }
 
 
--- a/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -77,11 +77,11 @@
 
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            lhs = lhs.accept(visitor);
-            rhs = rhs.accept(visitor);
-            third = third.accept(visitor);
-            return visitor.leave(this);
+        if (visitor.enterTernaryNode(this) != null) {
+            final Node newLhs = lhs().accept(visitor);
+            final Node newRhs = rhs().accept(visitor);
+            final Node newThird = third.accept(visitor);
+            return visitor.leaveTernaryNode((TernaryNode)setThird(newThird).setLHS(newLhs).setRHS(newRhs));
         }
 
         return this;
@@ -133,8 +133,12 @@
     /**
      * Reset the "third" node for this ternary expression, i.e. "z" in x ? y : z
      * @param third a node
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setThird(final Node third) {
-        this.third = third;
+    public TernaryNode setThird(final Node third) {
+        if(this.third == third) return this;
+        final TernaryNode n = (TernaryNode)clone();
+        n.third = third;
+        return n;
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/ThrowNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/ThrowNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -75,9 +75,9 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterThrowNode(this) != null) {
             setExpression(expression.accept(visitor));
-            return visitor.leave(this);
+            return visitor.leaveThrowNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/TryNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/TryNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -101,7 +101,7 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterTryNode(this) != null) {
             // Need to do first for termination analysis.
             if (finallyBody != null) {
                 finallyBody = (Block)finallyBody.accept(visitor);
@@ -115,7 +115,7 @@
             }
             this.catchBlocks = newCatchBlocks;
 
-            return visitor.leave(this);
+            return visitor.leaveTryNode(this);
         }
 
         return this;
@@ -155,6 +155,15 @@
     }
 
     /**
+     * Returns true if the specified block is the body of this try block, or any of its catch blocks.
+     * @param block the block
+     * @return true if the specified block is the body of this try block, or any of its catch blocks.
+     */
+    public boolean isChildBlock(Block block) {
+        return body == block || catchBlocks.contains(block);
+    }
+
+    /**
      * Get the catch blocks for this try block
      * @return a list of blocks
      */
--- a/nashorn/src/jdk/nashorn/internal/ir/TypeOverride.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/TypeOverride.java	Fri Apr 05 14:51:24 2013 -0700
@@ -36,15 +36,17 @@
  * by using JSType.toInt32. Especially in scenarios where the field is already stored
  * as a primitive, this will be much faster than the "object is all I see" scope
  * available in the method
+ * @param <T> the type of the node implementing the interface
  */
 
-public interface TypeOverride {
+public interface TypeOverride<T extends Node> {
     /**
      * Set the override type
      *
      * @param type  the type
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setType(final Type type);
+    public T setType(final Type type);
 
     /**
      * Returns true if this node can have a callsite override, e.g. all scope ident nodes
--- a/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -41,7 +41,7 @@
  */
 public class UnaryNode extends Node implements Assignment<Node> {
     /** Right hand side argument. */
-    protected Node rhs;
+    private Node rhs;
 
     /**
      * Constructor
@@ -104,6 +104,11 @@
     }
 
     @Override
+    public Node setAssignmentDest(Node n) {
+        return setRHS(n);
+    }
+
+    @Override
     public Node getAssignmentSource() {
         return getAssignmentDest();
     }
@@ -132,9 +137,8 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            rhs = rhs.accept(visitor);
-            return visitor.leave(this);
+        if (visitor.enterUnaryNode(this) != null) {
+            return visitor.leaveUnaryNode(setRHS(rhs.accept(visitor)));
         }
 
         return this;
@@ -152,9 +156,9 @@
 
         if (isConvert) {
             convertPos = sb.length();
-            sb.append("((");
+            sb.append("(");
             sb.append(getType());
-            sb.append(")");
+            sb.append(")(");
         }
 
         if (!isPostfix && !isConvert) {
@@ -191,8 +195,6 @@
                 sb.setCharAt(convertPos, ' ');
             }
         }
-
-        //TODO - conversions still have too many parenthesis - makes --print-lower-parse hard to read
     }
 
     /**
@@ -214,10 +216,12 @@
      * @see BinaryNode
      *
      * @param rhs right hand side or expression node
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setRHS(final Node rhs) {
-        this.rhs = rhs;
+    public UnaryNode setRHS(final Node rhs) {
+        if(this.rhs == rhs) return this;
+        final UnaryNode n = (UnaryNode)clone();
+        n.rhs = rhs;
+        return n;
     }
-
-
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/VarNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/VarNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,8 +38,8 @@
     /** Initialization expression. */
     private Node init;
 
-    /** Is this a function var node */
-    private boolean isFunctionVarNode;
+    /** Is this a var statement (as opposed to a "var" in a for loop statement) */
+    private final boolean isStatement;
 
     /**
      * Constructor
@@ -51,20 +51,34 @@
      * @param init   init node or null if just a declaration
      */
     public VarNode(final Source source, final long token, final int finish, final IdentNode name, final Node init) {
+        this(source, token, finish, name, init, true);
+    }
+
+    /**
+     * Constructor
+     *
+     * @param source the source
+     * @param token  token
+     * @param finish finish
+     * @param name   name of variable
+     * @param init   init node or null if just a declaration
+     * @param isStatement if this is a var statement (true), or a for-loop initializer (false)
+     */
+    public VarNode(final Source source, final long token, final int finish, final IdentNode name, final Node init, boolean isStatement) {
         super(source, token, finish);
 
-        this.name  = name;
+        this.name  = init == null ? name : name.setIsInitializedHere();
         this.init  = init;
-        if (init != null) {
-            this.name.setIsInitializedHere();
-        }
+        this.isStatement = isStatement;
     }
 
+
     private VarNode(final VarNode varNode, final CopyState cs) {
         super(varNode);
 
         this.name = (IdentNode)cs.existingOrCopy(varNode.name);
         this.init = cs.existingOrCopy(varNode.init);
+        this.isStatement = varNode.isStatement;
     }
 
     @Override
@@ -83,6 +97,11 @@
     }
 
     @Override
+    public Node setAssignmentDest(IdentNode n) {
+        return setName(n);
+    }
+
+    @Override
     public Node getAssignmentSource() {
         return isAssignment() ? getInit() : null;
     }
@@ -127,16 +146,19 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
-            name = (IdentNode)name.accept(visitor);
-
-            if (init != null) {
-                init = init.accept(visitor);
+        if (visitor.enterVarNode(this) != null) {
+            final IdentNode newName = (IdentNode)name.accept(visitor);
+            final Node newInit = init == null ? null : init.accept(visitor);
+            final VarNode newThis;
+            if(name != newName || init != newInit) {
+                newThis = (VarNode)clone();
+                newThis.init = newInit;
+                newThis.name = newInit == null ? newName : newName.setIsInitializedHere();
+            } else {
+                newThis = this;
             }
-
-            return visitor.leave(this);
+            return visitor.leaveVarNode(newThis);
         }
-
         return this;
     }
 
@@ -162,9 +184,13 @@
     /**
      * Reset the initialization expression
      * @param init new initialization expression
+     * @return a node equivalent to this one except for the requested change.
      */
-    public void setInit(final Node init) {
-        this.init = init;
+    public VarNode setInit(final Node init) {
+        if(this.init == init) return this;
+        final VarNode n = (VarNode)clone();
+        n.init = init;
+        return n;
     }
 
     /**
@@ -179,30 +205,26 @@
      * Reset the identifier for this VarNode
      * @param name new IdentNode representing the variable being set or declared
      */
-    public void setName(final IdentNode name) {
-        this.name = name;
+    private VarNode setName(final IdentNode name) {
+        if(this.name == name) return this;
+        final VarNode n = (VarNode)clone();
+        n.name = name;
+        return n;
     }
 
     /**
-     * Check if this is a virtual assignment of a function node. Function nodes declared
-     * with a name are hoisted to the top of the scope and appear as symbols too. This is
-     * implemented by representing them as virtual VarNode assignments added to the code
-     * during lowering
-     *
-     * @see FunctionNode
-     *
-     * @return true if this is a virtual function declaration
+     * Returns true if this is a var statement (as opposed to a var initializer in a for loop).
+     * @return true if this is a var statement (as opposed to a var initializer in a for loop).
      */
-    public boolean isFunctionVarNode() {
-        return isFunctionVarNode;
+    public boolean isStatement() {
+        return isStatement;
     }
 
     /**
-     * Flag this var node as a virtual function var node assignment as described in
-     * {@link VarNode#isFunctionVarNode()}
+     * Returns true if this is a function declaration.
+     * @return true if this is a function declaration.
      */
-    public void setIsFunctionVarNode() {
-        this.isFunctionVarNode = true;
+    public boolean isFunctionDeclaration() {
+        return init instanceof FunctionNode && ((FunctionNode)init).isDeclared();
     }
-
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/WhileNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/WhileNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -88,11 +88,11 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterWhileNode(this) != null) {
             test = test.accept(visitor);
             body = (Block)body.accept(visitor);
 
-            return visitor.leave(this);
+            return visitor.leaveWhileNode(this);
         }
         return this;
     }
--- a/nashorn/src/jdk/nashorn/internal/ir/WithNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/WithNode.java	Fri Apr 05 14:51:24 2013 -0700
@@ -73,10 +73,10 @@
      */
     @Override
     public Node accept(final NodeVisitor visitor) {
-        if (visitor.enter(this) != null) {
+        if (visitor.enterWithNode(this) != null) {
             expression = expression.accept(visitor);
             body = (Block)body.accept(visitor);
-            return visitor.leave(this);
+            return visitor.leaveWithNode(this);
         }
 
         return this;
--- a/nashorn/src/jdk/nashorn/internal/ir/annotations/ChildNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.ir.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * This is a child node, a real node, not a reference, to an IR node that should
- * be traversed.
- * <p>
- * TODO Currently not in use.  Would make e.g. accept methods simple and unified
- * @see jdk.nashorn.internal.ir.Node
- */
-@Retention(value=RetentionPolicy.RUNTIME)
-public @interface ChildNode {
-    /** order of traversal compared to other children */
-    public int order() default -1;
-}
--- a/nashorn/src/jdk/nashorn/internal/ir/annotations/ParentNode.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.ir.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Signifies a parent of a node, i.e. node that should not be traversed if we
- * go down the AST. In automatic parsing this can be handled by @Reference
- * annotations instead, as all parents are references.
- * <p>
- * TODO The use case is automating and creating one implementation of something like
- * Node.getParent()
- *
- * @see jdk.nashorn.internal.ir.Node
- */
-@Retention(value=RetentionPolicy.RUNTIME)
-public @interface ParentNode {
-    // EMPTY
-}
--- a/nashorn/src/jdk/nashorn/internal/ir/annotations/Reference.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/annotations/Reference.java	Fri Apr 05 14:51:24 2013 -0700
@@ -33,7 +33,6 @@
  * AST traversal and cloning. Cloning currently as a rule uses
  * existingOrSame for references and otherwise existingOrCopy
  * <p>
- * TODO this could probably be automated using the @Reference annotation.
  */
 
 @Retention(value=RetentionPolicy.RUNTIME)
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ASTWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ASTWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -27,6 +27,7 @@
 
 import java.lang.reflect.Field;
 import java.util.ArrayDeque;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Deque;
 import java.util.Iterator;
@@ -36,10 +37,10 @@
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.TernaryNode;
 import jdk.nashorn.internal.ir.annotations.Ignore;
-import jdk.nashorn.internal.ir.annotations.ParentNode;
 import jdk.nashorn.internal.ir.annotations.Reference;
 import jdk.nashorn.internal.parser.Token;
 import jdk.nashorn.internal.runtime.Context;
+import jdk.nashorn.internal.runtime.Debug;
 
 /**
  * AST-as-text visualizer. Sometimes you want tree form and not source
@@ -47,7 +48,6 @@
  *
  * see the flags --print-ast and --print-ast-lower
  */
-
 public final class ASTWriter {
     /** Root node from which to start the traversal */
     private final Node root;
@@ -71,12 +71,22 @@
     @Override
     public String toString() {
         final StringBuilder sb = new StringBuilder();
-        printAST(sb, null, "root", root, 0);
+        printAST(sb, null, null, "root", root, 0);
         return sb.toString();
     }
 
+    /**
+     * Return the visited nodes in an ordered list
+     * @return the list of nodes in order
+     */
+    public Node[] toArray() {
+        final List<Node> preorder = new ArrayList<>();
+        printAST(new StringBuilder(), preorder, null, "root", root, 0);
+        return preorder.toArray(new Node[preorder.size()]);
+    }
+
     @SuppressWarnings("unchecked")
-    private void printAST(final StringBuilder sb, final Field field, final String name, final Node node, final int indent) {
+    private void printAST(final StringBuilder sb, final List<Node> preorder, final Field field, final String name, final Node node, final int indent) {
         ASTWriter.indent(sb, indent);
         if (node == null) {
             sb.append("[Object ");
@@ -85,13 +95,23 @@
             return;
         }
 
+        if (preorder != null) {
+            preorder.add(node);
+        }
+
         final boolean isReference = field != null && field.getAnnotation(Reference.class) != null;
 
         Class<?> clazz = node.getClass();
         String   type  = clazz.getName();
 
         type = type.substring(type.lastIndexOf('.') + 1, type.length());
-//        type += "@" + Debug.id(node) + "#" + node.getSymbol();
+        if (isReference) {
+            type = "ref: " + type;
+        }
+        type += "@" + Debug.id(node);
+        if (node.getSymbol() != null) {
+            type += "#" + node.getSymbol();
+        }
 
         final List<Field> children = new LinkedList<>();
 
@@ -153,9 +173,7 @@
                 append('\n');
 
             for (final Field child : children) {
-                if (child.getAnnotation(ParentNode.class) != null) {
-                    continue;
-                } else if (child.getAnnotation(Ignore.class) != null) {
+                if (child.getAnnotation(Ignore.class) != null) {
                     continue;
                 }
 
@@ -168,7 +186,7 @@
                 }
 
                 if (value instanceof Node) {
-                    printAST(sb, child, child.getName(), (Node)value, indent + 1);
+                    printAST(sb, preorder, child, child.getName(), (Node)value, indent + 1);
                 } else if (value instanceof Collection) {
                     int pos = 0;
                     ASTWriter.indent(sb, indent + 1);
@@ -180,7 +198,7 @@
                         append('\n');
 
                     for (final Node member : (Collection<Node>)value) {
-                        printAST(sb, child, child.getName() + "[" + pos++ + "]", member, indent + 2);
+                        printAST(sb, preorder, child, child.getName() + "[" + pos++ + "]", member, indent + 2);
                     }
                 }
             }
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/JSONWriter.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/JSONWriter.java	Fri Apr 05 14:51:24 2013 -0700
@@ -112,7 +112,7 @@
     }
 
     @Override
-    public Node enter(final AccessNode accessNode) {
+    public Node enterAccessNode(final AccessNode accessNode) {
         enterDefault(accessNode);
 
         type("MemberExpression");
@@ -132,7 +132,7 @@
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         enterDefault(block);
 
         type("BlockStatement");
@@ -154,7 +154,7 @@
     }
 
     @Override
-    public Node enter(final BinaryNode binaryNode) {
+    public Node enterBinaryNode(final BinaryNode binaryNode) {
         enterDefault(binaryNode);
 
         final String name;
@@ -183,7 +183,7 @@
     }
 
     @Override
-    public Node enter(final BreakNode breakNode) {
+    public Node enterBreakNode(final BreakNode breakNode) {
         enterDefault(breakNode);
 
         type("BreakStatement");
@@ -201,7 +201,7 @@
     }
 
     @Override
-    public Node enter(final CallNode callNode) {
+    public Node enterCallNode(final CallNode callNode) {
         enterDefault(callNode);
 
         type("CallExpression");
@@ -217,7 +217,7 @@
     }
 
     @Override
-    public Node enter(final CaseNode caseNode) {
+    public Node enterCaseNode(final CaseNode caseNode) {
         enterDefault(caseNode);
 
         type("SwitchCase");
@@ -238,7 +238,7 @@
     }
 
     @Override
-    public Node enter(final CatchNode catchNode) {
+    public Node enterCatchNode(final CatchNode catchNode) {
         enterDefault(catchNode);
 
         type("CatchClause");
@@ -264,7 +264,7 @@
     }
 
     @Override
-    public Node enter(final ContinueNode continueNode) {
+    public Node enterContinueNode(final ContinueNode continueNode) {
         enterDefault(continueNode);
 
         type("ContinueStatement");
@@ -282,7 +282,7 @@
     }
 
     @Override
-    public Node enter(final DoWhileNode doWhileNode) {
+    public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
         enterDefault(doWhileNode);
 
         type("DoWhileStatement");
@@ -299,7 +299,7 @@
     }
 
     @Override
-    public Node enter(final EmptyNode emptyNode) {
+    public Node enterEmptyNode(final EmptyNode emptyNode) {
         enterDefault(emptyNode);
 
         type("EmptyStatement");
@@ -308,7 +308,7 @@
     }
 
     @Override
-    public Node enter(final ExecuteNode executeNode) {
+    public Node enterExecuteNode(final ExecuteNode executeNode) {
         enterDefault(executeNode);
 
         type("ExpressionStatement");
@@ -321,7 +321,7 @@
     }
 
     @Override
-    public Node enter(final ForNode forNode) {
+    public Node enterForNode(final ForNode forNode) {
         enterDefault(forNode);
 
         if (forNode.isForIn() || (forNode.isForEach() && forNode.getInit() != null)) {
@@ -384,14 +384,14 @@
     }
 
     @Override
-    public Node enter(final FunctionNode functionNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
         enterDefault(functionNode);
 
-        final boolean program = functionNode.isScript();
+        final boolean program = functionNode.isProgram();
         final String name;
         if (program) {
             name = "Program";
-        } else if (functionNode.isStatement()) {
+        } else if (functionNode.isDeclared()) {
             name = "FunctionDeclaration";
         } else {
             name = "FunctionExpression";
@@ -419,20 +419,11 @@
         }
 
         // body consists of nested functions and statements
-        final List<FunctionNode> funcs = functionNode.getFunctions();
         final List<Node> stats = functionNode.getStatements();
-        final int size = stats.size() + funcs.size();
+        final int size = stats.size();
         int idx = 0;
         arrayStart("body");
 
-        for (final Node func : funcs) {
-            func.accept(this);
-            if (idx != (size - 1)) {
-                comma();
-            }
-            idx++;
-        }
-
         for (final Node stat : stats) {
             if (! stat.isDebug()) {
                 stat.accept(this);
@@ -448,7 +439,7 @@
     }
 
     @Override
-    public Node enter(final IdentNode identNode) {
+    public Node enterIdentNode(final IdentNode identNode) {
         enterDefault(identNode);
 
         final String name = identNode.getName();
@@ -464,7 +455,7 @@
     }
 
     @Override
-    public Node enter(final IfNode ifNode) {
+    public Node enterIfNode(final IfNode ifNode) {
         enterDefault(ifNode);
 
         type("IfStatement");
@@ -490,7 +481,7 @@
     }
 
     @Override
-    public Node enter(final IndexNode indexNode) {
+    public Node enterIndexNode(final IndexNode indexNode) {
         enterDefault(indexNode);
 
         type("MemberExpression");
@@ -510,7 +501,7 @@
     }
 
     @Override
-    public Node enter(final LabelNode labelNode) {
+    public Node enterLabelNode(final LabelNode labelNode) {
         enterDefault(labelNode);
 
         type("LabeledStatement");
@@ -527,13 +518,13 @@
     }
 
     @Override
-    public Node enter(final LineNumberNode lineNumberNode) {
+    public Node enterLineNumberNode(final LineNumberNode lineNumberNode) {
         return null;
     }
 
     @SuppressWarnings("rawtypes")
     @Override
-    public Node enter(final LiteralNode literalNode) {
+    public Node enterLiteralNode(final LiteralNode literalNode) {
         enterDefault(literalNode);
 
         if (literalNode instanceof LiteralNode.ArrayLiteralNode) {
@@ -569,7 +560,7 @@
     }
 
     @Override
-    public Node enter(final ObjectNode objectNode) {
+    public Node enterObjectNode(final ObjectNode objectNode) {
         enterDefault(objectNode);
 
         type("ObjectExpression");
@@ -581,7 +572,7 @@
     }
 
     @Override
-    public Node enter(final PropertyNode propertyNode) {
+    public Node enterPropertyNode(final PropertyNode propertyNode) {
         final Node key = propertyNode.getKey();
 
         final Node value = propertyNode.getValue();
@@ -647,7 +638,7 @@
     }
 
     @Override
-    public Node enter(final ReturnNode returnNode) {
+    public Node enterReturnNode(final ReturnNode returnNode) {
         enterDefault(returnNode);
 
         type("ReturnStatement");
@@ -665,7 +656,7 @@
     }
 
     @Override
-    public Node enter(final RuntimeNode runtimeNode) {
+    public Node enterRuntimeNode(final RuntimeNode runtimeNode) {
         final RuntimeNode.Request req = runtimeNode.getRequest();
 
         if (req == RuntimeNode.Request.DEBUGGER) {
@@ -680,12 +671,12 @@
     }
 
     @Override
-    public Node enter(final SplitNode splitNode) {
+    public Node enterSplitNode(final SplitNode splitNode) {
         return null;
     }
 
     @Override
-    public Node enter(final SwitchNode switchNode) {
+    public Node enterSwitchNode(final SwitchNode switchNode) {
         enterDefault(switchNode);
 
         type("SwitchStatement");
@@ -701,7 +692,7 @@
     }
 
     @Override
-    public Node enter(final TernaryNode ternaryNode) {
+    public Node enterTernaryNode(final TernaryNode ternaryNode) {
         enterDefault(ternaryNode);
 
         type("ConditionalExpression");
@@ -722,7 +713,7 @@
     }
 
     @Override
-    public Node enter(final ThrowNode throwNode) {
+    public Node enterThrowNode(final ThrowNode throwNode) {
         enterDefault(throwNode);
 
         type("ThrowStatement");
@@ -735,7 +726,7 @@
     }
 
     @Override
-    public Node enter(final TryNode tryNode) {
+    public Node enterTryNode(final TryNode tryNode) {
         enterDefault(tryNode);
 
         type("TryStatement");
@@ -760,7 +751,7 @@
     }
 
     @Override
-    public Node enter(final UnaryNode unaryNode) {
+    public Node enterUnaryNode(final UnaryNode unaryNode) {
         enterDefault(unaryNode);
 
         final TokenType tokenType = unaryNode.tokenType();
@@ -816,7 +807,7 @@
     }
 
     @Override
-    public Node enter(final VarNode varNode) {
+    public Node enterVarNode(final VarNode varNode) {
         enterDefault(varNode);
 
         type("VariableDeclaration");
@@ -852,7 +843,7 @@
     }
 
     @Override
-    public Node enter(final WhileNode whileNode) {
+    public Node enterWhileNode(final WhileNode whileNode) {
         enterDefault(whileNode);
 
         type("WhileStatement");
@@ -869,7 +860,7 @@
     }
 
     @Override
-    public Node enter(final WithNode withNode) {
+    public Node enterWithNode(final WithNode withNode) {
         enterDefault(withNode);
 
         type("WithStatement");
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/PrintVisitor.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/PrintVisitor.java	Fri Apr 05 14:51:24 2013 -0700
@@ -42,7 +42,6 @@
 import jdk.nashorn.internal.ir.LabelNode;
 import jdk.nashorn.internal.ir.LineNumberNode;
 import jdk.nashorn.internal.ir.Node;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.SplitNode;
@@ -138,13 +137,13 @@
      * Visits.
      */
     @Override
-    public Node enter(final AccessNode accessNode) {
+    public Node enterAccessNode(final AccessNode accessNode) {
         accessNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         sb.append(' ');
         sb.append('{');
 
@@ -152,21 +151,6 @@
 
         final boolean isFunction = block instanceof FunctionNode;
 
-        if (isFunction) {
-            final FunctionNode       function  = (FunctionNode)block;
-            final List<FunctionNode> functions = function.getFunctions();
-
-            for (final FunctionNode f : functions) {
-                sb.append(EOLN);
-                indent();
-                f.accept(this);
-            }
-
-            if (!functions.isEmpty()) {
-                sb.append(EOLN);
-            }
-        }
-
         final List<Node> statements = block.getStatements();
 
         boolean lastLineNumber = false;
@@ -224,25 +208,25 @@
     }
 
     @Override
-    public Node enter(final BreakNode breakNode) {
+    public Node enterBreakNode(final BreakNode breakNode) {
         breakNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final CallNode callNode) {
+    public Node enterCallNode(final CallNode callNode) {
         callNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final ContinueNode continueNode) {
+    public Node enterContinueNode(final ContinueNode continueNode) {
         continueNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final DoWhileNode doWhileNode) {
+    public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
         sb.append("do");
         doWhileNode.getBody().accept(this);
         sb.append(' ');
@@ -252,7 +236,7 @@
     }
 
     @Override
-    public Node enter(final ExecuteNode executeNode) {
+    public Node enterExecuteNode(final ExecuteNode executeNode) {
         final Node expression = executeNode.getExpression();
 
         if (expression instanceof UnaryNode) {
@@ -265,7 +249,7 @@
     }
 
     @Override
-    public Node enter(final ForNode forNode) {
+    public Node enterForNode(final ForNode forNode) {
         forNode.toString(sb);
         forNode.getBody().accept(this);
 
@@ -273,15 +257,15 @@
     }
 
     @Override
-    public Node enter(final FunctionNode functionNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
         functionNode.toString(sb);
-        enter((Block)functionNode);
+        enterBlock(functionNode);
 
         return null;
     }
 
     @Override
-    public Node enter(final IfNode ifNode) {
+    public Node enterIfNode(final IfNode ifNode) {
         ifNode.toString(sb);
         ifNode.getPass().accept(this);
 
@@ -296,13 +280,13 @@
     }
 
     @Override
-    public Node enter(final IndexNode indexNode) {
+    public Node enterIndexNode(final IndexNode indexNode) {
         indexNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final LabelNode labeledNode) {
+    public Node enterLabelNode(final LabelNode labeledNode) {
         indent -= TABWIDTH;
         indent();
         indent += TABWIDTH;
@@ -313,7 +297,7 @@
     }
 
     @Override
-    public Node enter(final LineNumberNode lineNumberNode) {
+    public Node enterLineNumberNode(final LineNumberNode lineNumberNode) {
         if (printLineNumbers) {
             lineNumberNode.toString(sb);
         }
@@ -323,25 +307,19 @@
 
 
     @Override
-    public Node enter(final ReferenceNode referenceNode) {
-        referenceNode.toString(sb);
-        return null;
-    }
-
-    @Override
-    public Node enter(final ReturnNode returnNode) {
+    public Node enterReturnNode(final ReturnNode returnNode) {
         returnNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final RuntimeNode runtimeNode) {
+    public Node enterRuntimeNode(final RuntimeNode runtimeNode) {
         runtimeNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final SplitNode splitNode) {
+    public Node enterSplitNode(final SplitNode splitNode) {
         splitNode.toString(sb);
         sb.append(EOLN);
         indent += TABWIDTH;
@@ -350,7 +328,7 @@
     }
 
     @Override
-    public Node leave(final SplitNode splitNode) {
+    public Node leaveSplitNode(final SplitNode splitNode) {
         sb.append("</split>");
         sb.append(EOLN);
         indent -= TABWIDTH;
@@ -359,7 +337,7 @@
     }
 
     @Override
-    public Node enter(final SwitchNode switchNode) {
+    public Node enterSwitchNode(final SwitchNode switchNode) {
         switchNode.toString(sb);
         sb.append(" {");
 
@@ -383,13 +361,13 @@
    }
 
     @Override
-    public Node enter(final ThrowNode throwNode) {
+    public Node enterThrowNode(final ThrowNode throwNode) {
         throwNode.toString(sb);
         return null;
     }
 
     @Override
-    public Node enter(final TryNode tryNode) {
+    public Node enterTryNode(final TryNode tryNode) {
         tryNode.toString(sb);
         tryNode.getBody().accept(this);
 
@@ -412,13 +390,19 @@
     }
 
     @Override
-    public Node enter(final VarNode varNode) {
-        varNode.toString(sb);
+    public Node enterVarNode(final VarNode varNode) {
+        sb.append("var ");
+        varNode.getName().toString(sb);
+        final Node init = varNode.getInit();
+        if(init != null) {
+            sb.append(" = ");
+            init.accept(this);
+        }
         return null;
     }
 
     @Override
-    public Node enter(final WhileNode whileNode) {
+    public Node enterWhileNode(final WhileNode whileNode) {
         whileNode.toString(sb);
         whileNode.getBody().accept(this);
 
@@ -426,7 +410,7 @@
     }
 
     @Override
-    public Node enter(final WithNode withNode) {
+    public Node enterWithNode(final WithNode withNode) {
         withNode.toString(sb);
         withNode.getBody().accept(this);
 
--- a/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java	Fri Apr 05 14:51:24 2013 -0700
@@ -53,7 +53,7 @@
     }
 
     @Override
-    public final Node enter(final UnaryNode unaryNode) {
+    public final Node enterUnaryNode(final UnaryNode unaryNode) {
         switch (unaryNode.tokenType()) {
         case ADD:
             return enterADD(unaryNode);
@@ -81,12 +81,12 @@
         case INCPOSTFIX:
             return enterDECINC(unaryNode);
         default:
-            return super.enter(unaryNode);
+            return super.enterUnaryNode(unaryNode);
         }
     }
 
     @Override
-    public final Node leave(final UnaryNode unaryNode) {
+    public final Node leaveUnaryNode(final UnaryNode unaryNode) {
         switch (unaryNode.tokenType()) {
         case ADD:
             return leaveADD(unaryNode);
@@ -114,12 +114,12 @@
         case INCPOSTFIX:
             return leaveDECINC(unaryNode);
         default:
-            return super.leave(unaryNode);
+            return super.leaveUnaryNode(unaryNode);
         }
     }
 
     @Override
-    public final Node enter(final BinaryNode binaryNode) {
+    public final Node enterBinaryNode(final BinaryNode binaryNode) {
         switch (binaryNode.tokenType()) {
         case ADD:
             return enterADD(binaryNode);
@@ -198,12 +198,12 @@
         case SUB:
             return enterSUB(binaryNode);
         default:
-            return super.enter(binaryNode);
+            return super.enterBinaryNode(binaryNode);
         }
     }
 
     @Override
-    public final Node leave(final BinaryNode binaryNode) {
+    public final Node leaveBinaryNode(final BinaryNode binaryNode) {
         switch (binaryNode.tokenType()) {
         case ADD:
             return leaveADD(binaryNode);
@@ -282,7 +282,7 @@
         case SUB:
             return leaveSUB(binaryNode);
         default:
-            return super.leave(binaryNode);
+            return super.leaveBinaryNode(binaryNode);
         }
     }
 
--- a/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java	Fri Apr 05 14:51:24 2013 -0700
@@ -49,7 +49,6 @@
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ObjectNode;
 import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.SplitNode;
@@ -153,7 +152,7 @@
      * @param  accessNode the node
      * @return processed node, null if traversal should end, null if traversal should end
      */
-    public Node enter(final AccessNode accessNode) {
+    public Node enterAccessNode(final AccessNode accessNode) {
         return enterDefault(accessNode);
     }
 
@@ -163,7 +162,7 @@
      * @param  accessNode the node
      * @return processed node, null if traversal should end
      */
-    public Node leave(final AccessNode accessNode) {
+    public Node leaveAccessNode(final AccessNode accessNode) {
         return leaveDefault(accessNode);
     }
 
@@ -173,7 +172,7 @@
      * @param  block     the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final Block block) {
+    public Node enterBlock(final Block block) {
         return enterDefault(block);
     }
 
@@ -183,7 +182,7 @@
      * @param  block the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final Block block) {
+    public Node leaveBlock(final Block block) {
         return leaveDefault(block);
     }
 
@@ -193,7 +192,7 @@
      * @param  binaryNode  the node
      * @return processed   node
      */
-    public Node enter(final BinaryNode binaryNode) {
+    public Node enterBinaryNode(final BinaryNode binaryNode) {
         return enterDefault(binaryNode);
     }
 
@@ -203,7 +202,7 @@
      * @param  binaryNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final BinaryNode binaryNode) {
+    public Node leaveBinaryNode(final BinaryNode binaryNode) {
         return leaveDefault(binaryNode);
     }
 
@@ -213,7 +212,7 @@
      * @param  breakNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final BreakNode breakNode) {
+    public Node enterBreakNode(final BreakNode breakNode) {
         return enterDefault(breakNode);
     }
 
@@ -223,7 +222,7 @@
      * @param  breakNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final BreakNode breakNode) {
+    public Node leaveBreakNode(final BreakNode breakNode) {
         return leaveDefault(breakNode);
     }
 
@@ -233,7 +232,7 @@
      * @param  callNode  the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final CallNode callNode) {
+    public Node enterCallNode(final CallNode callNode) {
         return enterDefault(callNode);
     }
 
@@ -243,7 +242,7 @@
      * @param  callNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final CallNode callNode) {
+    public Node leaveCallNode(final CallNode callNode) {
         return leaveDefault(callNode);
     }
 
@@ -253,7 +252,7 @@
      * @param  caseNode  the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final CaseNode caseNode) {
+    public Node enterCaseNode(final CaseNode caseNode) {
         return enterDefault(caseNode);
     }
 
@@ -263,7 +262,7 @@
      * @param  caseNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final CaseNode caseNode) {
+    public Node leaveCaseNode(final CaseNode caseNode) {
         return leaveDefault(caseNode);
     }
 
@@ -273,7 +272,7 @@
      * @param  catchNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final CatchNode catchNode) {
+    public Node enterCatchNode(final CatchNode catchNode) {
         return enterDefault(catchNode);
     }
 
@@ -283,7 +282,7 @@
      * @param  catchNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final CatchNode catchNode) {
+    public Node leaveCatchNode(final CatchNode catchNode) {
         return leaveDefault(catchNode);
     }
 
@@ -293,7 +292,7 @@
      * @param  continueNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final ContinueNode continueNode) {
+    public Node enterContinueNode(final ContinueNode continueNode) {
         return enterDefault(continueNode);
     }
 
@@ -303,7 +302,7 @@
      * @param  continueNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final ContinueNode continueNode) {
+    public Node leaveContinueNode(final ContinueNode continueNode) {
         return leaveDefault(continueNode);
     }
 
@@ -313,7 +312,7 @@
      * @param  doWhileNode the node
      * @return processed   node
      */
-    public Node enter(final DoWhileNode doWhileNode) {
+    public Node enterDoWhileNode(final DoWhileNode doWhileNode) {
         return enterDefault(doWhileNode);
     }
 
@@ -323,7 +322,7 @@
      * @param  doWhileNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final DoWhileNode doWhileNode) {
+    public Node leaveDoWhileNode(final DoWhileNode doWhileNode) {
         return leaveDefault(doWhileNode);
     }
 
@@ -333,7 +332,7 @@
      * @param  emptyNode   the node
      * @return processed   node
      */
-    public Node enter(final EmptyNode emptyNode) {
+    public Node enterEmptyNode(final EmptyNode emptyNode) {
         return enterDefault(emptyNode);
     }
 
@@ -343,7 +342,7 @@
      * @param  emptyNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final EmptyNode emptyNode) {
+    public Node leaveEmptyNode(final EmptyNode emptyNode) {
         return leaveDefault(emptyNode);
     }
 
@@ -353,7 +352,7 @@
      * @param  executeNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final ExecuteNode executeNode) {
+    public Node enterExecuteNode(final ExecuteNode executeNode) {
         return enterDefault(executeNode);
     }
 
@@ -363,7 +362,7 @@
      * @param  executeNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final ExecuteNode executeNode) {
+    public Node leaveExecuteNode(final ExecuteNode executeNode) {
         return leaveDefault(executeNode);
     }
 
@@ -373,7 +372,7 @@
      * @param  forNode   the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final ForNode forNode) {
+    public Node enterForNode(final ForNode forNode) {
         return enterDefault(forNode);
     }
 
@@ -383,7 +382,7 @@
      * @param  forNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final ForNode forNode) {
+    public Node leaveForNode(final ForNode forNode) {
         return leaveDefault(forNode);
     }
 
@@ -393,7 +392,7 @@
      * @param  functionNode the node
      * @return processed    node
      */
-    public Node enter(final FunctionNode functionNode) {
+    public Node enterFunctionNode(final FunctionNode functionNode) {
         return enterDefault(functionNode);
     }
 
@@ -403,7 +402,7 @@
      * @param  functionNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final FunctionNode functionNode) {
+    public Node leaveFunctionNode(final FunctionNode functionNode) {
         return leaveDefault(functionNode);
     }
 
@@ -413,7 +412,7 @@
      * @param  identNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final IdentNode identNode) {
+    public Node enterIdentNode(final IdentNode identNode) {
         return enterDefault(identNode);
     }
 
@@ -423,7 +422,7 @@
      * @param  identNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final IdentNode identNode) {
+    public Node leaveIdentNode(final IdentNode identNode) {
         return leaveDefault(identNode);
     }
 
@@ -433,7 +432,7 @@
      * @param  ifNode    the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final IfNode ifNode) {
+    public Node enterIfNode(final IfNode ifNode) {
         return enterDefault(ifNode);
     }
 
@@ -443,7 +442,7 @@
      * @param  ifNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final IfNode ifNode) {
+    public Node leaveIfNode(final IfNode ifNode) {
         return leaveDefault(ifNode);
     }
 
@@ -453,7 +452,7 @@
      * @param  indexNode  the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final IndexNode indexNode) {
+    public Node enterIndexNode(final IndexNode indexNode) {
         return enterDefault(indexNode);
     }
 
@@ -463,7 +462,7 @@
      * @param  indexNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final IndexNode indexNode) {
+    public Node leaveIndexNode(final IndexNode indexNode) {
         return leaveDefault(indexNode);
     }
 
@@ -473,7 +472,7 @@
      * @param  labelNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final LabelNode labelNode) {
+    public Node enterLabelNode(final LabelNode labelNode) {
         return enterDefault(labelNode);
     }
 
@@ -483,7 +482,7 @@
      * @param  labelNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final LabelNode labelNode) {
+    public Node leaveLabelNode(final LabelNode labelNode) {
         return leaveDefault(labelNode);
     }
 
@@ -493,7 +492,7 @@
      * @param  lineNumberNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final LineNumberNode lineNumberNode) {
+    public Node enterLineNumberNode(final LineNumberNode lineNumberNode) {
         return enterDefault(lineNumberNode);
     }
 
@@ -503,7 +502,7 @@
      * @param  lineNumberNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final LineNumberNode lineNumberNode) {
+    public Node leaveLineNumberNode(final LineNumberNode lineNumberNode) {
         return leaveDefault(lineNumberNode);
     }
 
@@ -513,8 +512,7 @@
      * @param  literalNode the node
      * @return processed   node
      */
-    @SuppressWarnings("rawtypes")
-    public Node enter(final LiteralNode literalNode) {
+    public Node enterLiteralNode(final LiteralNode<?> literalNode) {
         return enterDefault(literalNode);
     }
 
@@ -524,8 +522,7 @@
      * @param  literalNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    @SuppressWarnings("rawtypes")
-    public Node leave(final LiteralNode literalNode) {
+    public Node leaveLiteralNode(final LiteralNode<?> literalNode) {
         return leaveDefault(literalNode);
     }
 
@@ -535,7 +532,7 @@
      * @param  objectNode the node
      * @return processed  node
      */
-    public Node enter(final ObjectNode objectNode) {
+    public Node enterObjectNode(final ObjectNode objectNode) {
         return enterDefault(objectNode);
     }
 
@@ -545,7 +542,7 @@
      * @param  objectNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final ObjectNode objectNode) {
+    public Node leaveObjectNode(final ObjectNode objectNode) {
         return leaveDefault(objectNode);
     }
 
@@ -555,7 +552,7 @@
      * @param  propertyNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final PropertyNode propertyNode) {
+    public Node enterPropertyNode(final PropertyNode propertyNode) {
         return enterDefault(propertyNode);
     }
 
@@ -565,37 +562,17 @@
      * @param  propertyNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final PropertyNode propertyNode) {
+    public Node leavePropertyNode(final PropertyNode propertyNode) {
         return leaveDefault(propertyNode);
     }
 
     /**
-     * Callback for entering a ReferenceNode
-     *
-     * @param  referenceNode the node
-     * @return processed node, null if traversal should end
-     */
-    public Node enter(final ReferenceNode referenceNode) {
-        return enterDefault(referenceNode);
-    }
-
-    /**
-     * Callback for leaving a ReferenceNode
-     *
-     * @param  referenceNode the node
-     * @return processed node, which will replace the original one, or the original node
-     */
-    public Node leave(final ReferenceNode referenceNode) {
-        return leaveDefault(referenceNode);
-    }
-
-    /**
      * Callback for entering a ReturnNode
      *
      * @param  returnNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final ReturnNode returnNode) {
+    public Node enterReturnNode(final ReturnNode returnNode) {
         return enterDefault(returnNode);
     }
 
@@ -605,7 +582,7 @@
      * @param  returnNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final ReturnNode returnNode) {
+    public Node leaveReturnNode(final ReturnNode returnNode) {
         return leaveDefault(returnNode);
     }
 
@@ -615,7 +592,7 @@
      * @param  runtimeNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final RuntimeNode runtimeNode) {
+    public Node enterRuntimeNode(final RuntimeNode runtimeNode) {
         return enterDefault(runtimeNode);
     }
 
@@ -625,7 +602,7 @@
      * @param  runtimeNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final RuntimeNode runtimeNode) {
+    public Node leaveRuntimeNode(final RuntimeNode runtimeNode) {
         return leaveDefault(runtimeNode);
     }
 
@@ -635,7 +612,7 @@
      * @param  splitNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final SplitNode splitNode) {
+    public Node enterSplitNode(final SplitNode splitNode) {
         return enterDefault(splitNode);
     }
 
@@ -645,7 +622,7 @@
      * @param  splitNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final SplitNode splitNode) {
+    public Node leaveSplitNode(final SplitNode splitNode) {
         return leaveDefault(splitNode);
     }
 
@@ -655,7 +632,7 @@
      * @param  switchNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final SwitchNode switchNode) {
+    public Node enterSwitchNode(final SwitchNode switchNode) {
         return enterDefault(switchNode);
     }
 
@@ -665,7 +642,7 @@
      * @param  switchNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final SwitchNode switchNode) {
+    public Node leaveSwitchNode(final SwitchNode switchNode) {
         return leaveDefault(switchNode);
     }
 
@@ -675,7 +652,7 @@
      * @param  ternaryNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final TernaryNode ternaryNode) {
+    public Node enterTernaryNode(final TernaryNode ternaryNode) {
         return enterDefault(ternaryNode);
     }
 
@@ -685,7 +662,7 @@
      * @param  ternaryNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final TernaryNode ternaryNode) {
+    public Node leaveTernaryNode(final TernaryNode ternaryNode) {
         return leaveDefault(ternaryNode);
     }
 
@@ -695,7 +672,7 @@
      * @param  throwNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final ThrowNode throwNode) {
+    public Node enterThrowNode(final ThrowNode throwNode) {
         return enterDefault(throwNode);
     }
 
@@ -705,7 +682,7 @@
      * @param  throwNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final ThrowNode throwNode) {
+    public Node leaveThrowNode(final ThrowNode throwNode) {
         return leaveDefault(throwNode);
     }
 
@@ -715,7 +692,7 @@
      * @param  tryNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final TryNode tryNode) {
+    public Node enterTryNode(final TryNode tryNode) {
         return enterDefault(tryNode);
     }
 
@@ -725,7 +702,7 @@
      * @param  tryNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final TryNode tryNode) {
+    public Node leaveTryNode(final TryNode tryNode) {
         return leaveDefault(tryNode);
     }
 
@@ -735,7 +712,7 @@
      * @param  unaryNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final UnaryNode unaryNode) {
+    public Node enterUnaryNode(final UnaryNode unaryNode) {
         return enterDefault(unaryNode);
     }
 
@@ -745,7 +722,7 @@
      * @param  unaryNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final UnaryNode unaryNode) {
+    public Node leaveUnaryNode(final UnaryNode unaryNode) {
         return leaveDefault(unaryNode);
     }
 
@@ -755,7 +732,7 @@
      * @param  varNode   the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final VarNode varNode) {
+    public Node enterVarNode(final VarNode varNode) {
         return enterDefault(varNode);
     }
 
@@ -765,7 +742,7 @@
      * @param  varNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final VarNode varNode) {
+    public Node leaveVarNode(final VarNode varNode) {
         return leaveDefault(varNode);
     }
 
@@ -775,7 +752,7 @@
      * @param  whileNode the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final WhileNode whileNode) {
+    public Node enterWhileNode(final WhileNode whileNode) {
         return enterDefault(whileNode);
     }
 
@@ -785,7 +762,7 @@
      * @param  whileNode the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final WhileNode whileNode) {
+    public Node leaveWhileNode(final WhileNode whileNode) {
         return leaveDefault(whileNode);
     }
 
@@ -795,7 +772,7 @@
      * @param  withNode  the node
      * @return processed node, null if traversal should end
      */
-    public Node enter(final WithNode withNode) {
+    public Node enterWithNode(final WithNode withNode) {
         return enterDefault(withNode);
     }
 
@@ -805,7 +782,7 @@
      * @param  withNode  the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leave(final WithNode withNode) {
+    public Node leaveWithNode(final WithNode withNode) {
         return leaveDefault(withNode);
     }
 
--- a/nashorn/src/jdk/nashorn/internal/objects/Global.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java	Fri Apr 05 14:51:24 2013 -0700
@@ -34,6 +34,9 @@
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.ref.SoftReference;
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -256,13 +259,29 @@
     @Property(name = "Packages", attributes = Attribute.NOT_ENUMERABLE)
     public volatile Object packages;
 
+    /** Nashorn extension: Java access - global.com */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public volatile Object com;
+
+    /** Nashorn extension: Java access - global.edu */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public volatile Object edu;
+
     /** Nashorn extension: Java access - global.java */
     @Property(attributes = Attribute.NOT_ENUMERABLE)
     public volatile Object java;
 
+    /** Nashorn extension: Java access - global.javafx */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public volatile Object javafx;
+
     /** Nashorn extension: Java access - global.javax */
     @Property(attributes = Attribute.NOT_ENUMERABLE)
-    public Object javax;
+    public volatile Object javax;
+
+    /** Nashorn extension: Java access - global.org */
+    @Property(attributes = Attribute.NOT_ENUMERABLE)
+    public volatile Object org;
 
     /** Nashorn extension: Java access - global.javaImporter */
     @Property(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE)
@@ -317,8 +336,12 @@
     private ScriptFunction builtinTypeError;
     private ScriptFunction builtinURIError;
     private ScriptObject   builtinPackages;
+    private ScriptObject   builtinCom;
+    private ScriptObject   builtinEdu;
     private ScriptObject   builtinJava;
+    private ScriptObject   builtinJavafx;
     private ScriptObject   builtinJavax;
+    private ScriptObject   builtinOrg;
     private ScriptObject   builtinJavaImporter;
     private ScriptObject   builtinJavaApi;
     private ScriptObject   builtinArrayBuffer;
@@ -1479,8 +1502,12 @@
     private void initJavaAccess() {
         final ScriptObject objectProto = getObjectPrototype();
         this.builtinPackages = new NativeJavaPackage("", objectProto);
+        this.builtinCom = new NativeJavaPackage("com", objectProto);
+        this.builtinEdu = new NativeJavaPackage("edu", objectProto);
         this.builtinJava = new NativeJavaPackage("java", objectProto);
+        this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
         this.builtinJavax = new NativeJavaPackage("javax", objectProto);
+        this.builtinOrg = new NativeJavaPackage("org", objectProto);
         this.builtinJavaImporter = initConstructor("JavaImporter");
         this.builtinJavaApi = initConstructor("Java");
     }
@@ -1503,8 +1530,10 @@
         addOwnProperty("echo", Attribute.NOT_ENUMERABLE, value);
 
         // Nashorn extension: global.$OPTIONS (scripting-mode-only)
-        value = context.getEnv();
-        addOwnProperty("$OPTIONS", Attribute.NOT_ENUMERABLE, value);
+        final ScriptObject options = newEmptyInstance();
+        final ScriptEnvironment scriptEnv = context.getEnv();
+        copyOptions(options, scriptEnv);
+        addOwnProperty("$OPTIONS", Attribute.NOT_ENUMERABLE, options);
 
         // Nashorn extension: global.$ENV (scripting-mode-only)
         if (System.getSecurityManager() == null) {
@@ -1523,6 +1552,22 @@
         addOwnProperty(ScriptingFunctions.EXIT_NAME, Attribute.NOT_ENUMERABLE, UNDEFINED);
     }
 
+    private static void copyOptions(final ScriptObject options, final ScriptEnvironment scriptEnv) {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            @Override
+            public Void run() {
+                for (Field f : scriptEnv.getClass().getFields()) {
+                    try {
+                        options.set(f.getName(), f.get(scriptEnv), false);
+                    } catch (final IllegalArgumentException | IllegalAccessException exp) {
+                        throw new RuntimeException(exp);
+                    }
+                }
+                return null;
+            }
+        });
+    }
+
     private void initTypedArray() {
         this.builtinArrayBuffer       = initConstructor("ArrayBuffer");
         this.builtinInt8Array         = initConstructor("Int8Array");
@@ -1545,8 +1590,12 @@
         this.function          = this.builtinFunction;
         this.jsadapter         = this.builtinJSAdapter;
         this.json              = this.builtinJSON;
+        this.com               = this.builtinCom;
+        this.edu               = this.builtinEdu;
         this.java              = this.builtinJava;
+        this.javafx            = this.builtinJavafx;
         this.javax             = this.builtinJavax;
+        this.org               = this.builtinOrg;
         this.javaImporter      = this.builtinJavaImporter;
         this.javaApi           = this.builtinJavaApi;
         this.math              = this.builtinMath;
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Apr 05 14:51:24 2013 -0700
@@ -605,7 +605,7 @@
             final boolean strict    = sobj.isStrictContext();
 
             if (bulkable(sobj)) {
-                return ((NativeArray)sobj).getArray().pop();
+                return sobj.getArray().pop();
             }
 
             final long len = JSType.toUint32(sobj.getLength());
@@ -725,7 +725,7 @@
             first = sobj.get(0);
 
             if (bulkable(sobj)) {
-                ((NativeArray) sobj).getArray().shiftLeft(1);
+                sobj.getArray().shiftLeft(1);
             } else {
                 for (long k = 1; k < len; k++) {
                     sobj.set(k - 1, sobj.get(k), strict);
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Fri Apr 05 14:51:24 2013 -0700
@@ -66,7 +66,7 @@
     public static Object getContext(final Object self) {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkPermission(new RuntimePermission("getNashornContext"));
+            sm.checkPermission(new RuntimePermission("nashorn.getContext"));
         }
         return Global.getThisContext();
     }
@@ -162,21 +162,6 @@
     }
 
     /**
-     * Nashorn extension: get invocation handle from {@link ScriptFunction}
-     *
-     * @param self self reference
-     * @param obj script function
-     * @return the invocation handle for the given ScriptFunction
-     */
-    @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
-    public static Object methodHandle(final Object self, final Object obj) {
-        if (obj instanceof ScriptFunction) {
-            return ((ScriptFunction)obj).getInvokeHandle();
-        }
-        return UNDEFINED;
-    }
-
-    /**
      * Check object identity comparison regardless of type
      *
      * @param self self reference
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeError.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeError.java	Fri Apr 05 14:51:24 2013 -0700
@@ -317,7 +317,7 @@
             return name;
         }
         // Step 10 : return name + ": " + msg
-        return (String)name + ": " + (String)msg;
+        return name + ": " + msg;
     }
 
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java	Fri Apr 05 14:51:24 2013 -0700
@@ -223,6 +223,23 @@
     }
 
     /**
+     * Returns name of a java type {@link StaticClass}.
+     * @param self not used
+     * @param type the type whose name is returned
+     * @return name of the given type
+     */
+    @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
+    public static Object typeName(final Object self, final Object type) {
+        if (type instanceof StaticClass) {
+            return ((StaticClass)type).getRepresentedClass().getName();
+        } else if (type instanceof Class) {
+            return ((Class<?>)type).getName();
+        } else {
+            return UNDEFINED;
+        }
+    }
+
+    /**
      * Given a JavaScript array and a Java type, returns a Java array with the same initial contents, and with the
      * specified component type. Example:
      * <pre>
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeString.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeString.java	Fri Apr 05 14:51:24 2013 -0700
@@ -122,6 +122,19 @@
         return value.length();
     }
 
+    // This is to support length as method call as well.
+    @Override
+    protected GuardedInvocation findGetMethod(final CallSiteDescriptor desc, final LinkRequest request, final String operator) {
+        final String name = desc.getNameToken(2);
+
+        // if str.length(), then let the bean linker handle it
+        if ("length".equals(name) && "getMethod".equals(operator)) {
+            return null;
+        }
+
+        return super.findGetMethod(desc, request, operator);
+    }
+
     // This is to provide array-like access to string characters without creating a NativeString wrapper.
     @Override
     protected GuardedInvocation findGetIndexMethod(final CallSiteDescriptor desc, final LinkRequest request) {
--- a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Fri Apr 05 14:51:24 2013 -0700
@@ -31,6 +31,7 @@
 import jdk.nashorn.internal.runtime.GlobalFunctions;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
+import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptFunctionData;
 import jdk.nashorn.internal.runtime.ScriptObject;
@@ -86,8 +87,8 @@
      * @param builtin is this a built-in function
      * @param isConstructor can the function be used as a constructor (most can; some built-ins are restricted).
      */
-    ScriptFunctionImpl(final String name, final MethodHandle methodHandle, final ScriptObject scope, final MethodHandle[] specs, final boolean strict, final boolean builtin, final boolean isConstructor) {
-        super(name, methodHandle, getMap(strict), scope, specs, strict, builtin, isConstructor);
+    ScriptFunctionImpl(final String name, final MethodHandle methodHandle, final ScriptObject scope, final MethodHandle[] specs, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor) {
+        super(name, methodHandle, getMap(isStrict), scope, specs, isStrict, isBuiltin, isConstructor);
         init();
     }
 
@@ -95,14 +96,10 @@
      * Constructor called by (compiler) generated code for {@link ScriptObject}s.
      *
      * @param data static function data
-     * @param methodHandle handle for invocation
      * @param scope scope object
-     * @param allocator instance constructor for function
      */
-    public ScriptFunctionImpl(final MethodHandle methodHandle, final ScriptFunctionData data, final ScriptObject scope, final MethodHandle allocator) {
+    public ScriptFunctionImpl(final RecompilableScriptFunctionData data, final ScriptObject scope) {
         super(data, getMap(data.isStrict()), scope);
-        // Set method handles in script data
-        data.setMethodHandles(methodHandle, allocator);
         init();
     }
 
--- a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionTrampolineImpl.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-package jdk.nashorn.internal.objects;
-
-import static jdk.nashorn.internal.lookup.Lookup.MH;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-import jdk.nashorn.internal.codegen.CompilationException;
-import jdk.nashorn.internal.codegen.Compiler;
-import jdk.nashorn.internal.codegen.FunctionSignature;
-import jdk.nashorn.internal.codegen.types.Type;
-import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.runtime.CodeInstaller;
-import jdk.nashorn.internal.runtime.Context;
-import jdk.nashorn.internal.runtime.ScriptEnvironment;
-import jdk.nashorn.internal.runtime.ScriptFunction;
-import jdk.nashorn.internal.runtime.ScriptFunctionData;
-import jdk.nashorn.internal.runtime.ScriptObject;
-
-/**
- * A trampoline is a promise to compile a {@link ScriptFunction} later. It just looks like
- * the call to the script function, but when invoked it will compile the script function
- * (in a new compile unit) and invoke it
- */
-public final class ScriptFunctionTrampolineImpl extends ScriptFunctionImpl {
-
-    private CodeInstaller<ScriptEnvironment> installer;
-
-    /** Function node to lazily recompile when trampoline is hit */
-    private FunctionNode functionNode;
-
-    /**
-     * Constructor
-     *
-     * @param installer    opaque code installer from context
-     * @param functionNode function node to lazily compile when trampoline is hit
-     * @param data         {@link ScriptFunctionData} for function
-     * @param scope        scope
-     * @param allocator    allocator
-     */
-    public ScriptFunctionTrampolineImpl(final CodeInstaller<ScriptEnvironment> installer, final FunctionNode functionNode, final ScriptFunctionData data, final ScriptObject scope, final MethodHandle allocator) {
-        super(null, data, scope, allocator);
-
-        this.installer    = installer;
-        this.functionNode = functionNode;
-
-        data.setMethodHandles(makeTrampoline(), allocator);
-    }
-
-    private final MethodHandle makeTrampoline() {
-        final MethodType mt =
-            new FunctionSignature(
-                true,
-                functionNode.needsCallee(),
-                Type.OBJECT,
-                functionNode.getParameters().size()).
-            getMethodType();
-
-        return
-            MH.bindTo(
-                MH.asCollector(
-                    findOwnMH(
-                        "trampoline",
-                        Object.class,
-                        Object[].class),
-                    Object[].class,
-                    mt.parameterCount()),
-                this);
-    }
-
-    private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        return MH.findVirtual(MethodHandles.lookup(), ScriptFunctionTrampolineImpl.class, name, MH.type(rtype, types));
-    }
-
-    @Override
-    protected ScriptFunction makeBoundFunction(final ScriptFunctionData data) {
-        //prevent trampoline recompilation cycle if a function is bound before use
-        compile();
-        return super.makeBoundFunction(data);
-    }
-
-    private MethodHandle compile() throws CompilationException {
-        final Compiler compiler = new Compiler(installer, functionNode);
-
-        compiler.compile();
-
-        final Class<?> clazz = compiler.install();
-        /* compute function signature for lazy method. this can be done first after compilation, as only then do we know
-         * the final state about callees, scopes and specialized parameter types */
-        final FunctionSignature signature = new FunctionSignature(true, functionNode.needsCallee(), Type.OBJECT, functionNode.getParameters().size());
-        final MethodType        mt        = signature.getMethodType();
-
-        MethodHandle mh = MH.findStatic(MethodHandles.publicLookup(), clazz, functionNode.getName(), mt);
-        if (functionNode.needsCallee()) {
-            mh = MH.bindTo(mh, this);
-        }
-
-        // now the invoker method looks like the one our superclass is expecting
-        resetInvoker(mh);
-
-        return mh;
-    }
-
-    @SuppressWarnings("unused")
-    private Object trampoline(final Object... args) throws CompilationException {
-        Compiler.LOG.info(">>> TRAMPOLINE: Hitting trampoline for '" + functionNode.getName() + "'");
-        MethodHandle mh = compile();
-
-        Compiler.LOG.info("<<< COMPILED TO: " + mh);
-        // spread the array to invididual args of the correct type
-        mh = MH.asSpreader(mh, Object[].class, mh.type().parameterCount());
-
-        try {
-            //invoke the real method the trampoline points to. this only happens once
-            return mh.invoke(args);
-        } catch (final RuntimeException | Error e) {
-            throw e;
-        } catch (final Throwable t) {
-            throw new RuntimeException(t);
-        }
-    }
-}
--- a/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java	Fri Apr 05 14:51:24 2013 -0700
@@ -313,7 +313,7 @@
         }
 
         // Construct new object literal.
-        return new ObjectNode(source, objectToken, finish, null, elements);
+        return new ObjectNode(source, objectToken, finish, elements);
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/parser/Parser.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/parser/Parser.java	Fri Apr 05 14:51:24 2013 -0700
@@ -56,6 +56,7 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Stack;
@@ -75,17 +76,18 @@
 import jdk.nashorn.internal.ir.ExecuteNode;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IfNode;
 import jdk.nashorn.internal.ir.IndexNode;
 import jdk.nashorn.internal.ir.LabelNode;
+import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LineNumberNode;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ObjectNode;
 import jdk.nashorn.internal.ir.PropertyKey;
 import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.ReferenceNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.SwitchNode;
@@ -96,7 +98,6 @@
 import jdk.nashorn.internal.ir.VarNode;
 import jdk.nashorn.internal.ir.WhileNode;
 import jdk.nashorn.internal.ir.WithNode;
-import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.DebugLogger;
 import jdk.nashorn.internal.runtime.ErrorManager;
 import jdk.nashorn.internal.runtime.JSErrorType;
@@ -116,19 +117,13 @@
     /** Is scripting mode. */
     private final boolean scripting;
 
-    /** Top level script being parsed. */
-    private FunctionNode script;
-
-    /** Current function being parsed. */
-    private FunctionNode function;
-
-    /** Current parsing block. */
-    private Block block;
+    private final LexicalContext lexicalContext = new LexicalContext();
+    private List<Node> functionDeclarations;
 
     /** Namespace for function names where not explicitly given */
     private final Namespace namespace;
 
-    private static DebugLogger LOG = new DebugLogger("parser");
+    private static final DebugLogger LOG = new DebugLogger("parser");
 
     /**
      * Constructor
@@ -279,7 +274,9 @@
      * @return New block.
      */
     private Block newBlock() {
-        return block = new Block(source, token, Token.descPosition(token), block, function);
+        final Block block = new Block(source, token, Token.descPosition(token));
+        lexicalContext.push(block);
+        return block;
     }
 
     /**
@@ -292,18 +289,23 @@
         // Build function name.
         final StringBuilder sb = new StringBuilder();
 
-        if (block != null) {
-            block.addParentName(sb);
+        final FunctionNode parentFunction = getFunction();
+        if(parentFunction != null && !parentFunction.isProgram()) {
+            sb.append(parentFunction.getName()).append('$');
         }
 
         sb.append(ident != null ? ident.getName() : FUNCTION_PREFIX.tag());
         final String name = namespace.uniqueName(sb.toString());
-        assert function != null || name.equals(RUN_SCRIPT.tag())  : "name = " + name;// must not rename runScript().
+        assert parentFunction != null || name.equals(RUN_SCRIPT.tag())  : "name = " + name;// must not rename runScript().
 
         // Start new block.
-        final FunctionNode functionBlock = new FunctionNode(source, token, Token.descPosition(token), namespace, block, ident, name);
-        block = function = functionBlock;
-        function.setStrictMode(isStrictMode);
+        final FunctionNode functionBlock = new FunctionNode(source, token, Token.descPosition(token), namespace, ident, name);
+        if(parentFunction == null) {
+            functionBlock.setProgram();
+        }
+        functionBlock.setStrictMode(isStrictMode);
+        functionBlock.setState(errors.hasErrors() ? CompilationState.PARSE_ERROR : CompilationState.PARSED);
+        lexicalContext.push(functionBlock);
 
         return functionBlock;
     }
@@ -311,9 +313,8 @@
     /**
      * Restore the current block.
      */
-    private void restoreBlock() {
-        block = block.getParent();
-        function = block.getFunction();
+    private void restoreBlock(Block block) {
+        lexicalContext.pop(block);
     }
 
     /**
@@ -323,22 +324,25 @@
     private Block getBlock(final boolean needsBraces) {
         // Set up new block. Captures LBRACE.
         final Block newBlock = newBlock();
-        pushControlNode(newBlock);
-
-        // Block opening brace.
-        if (needsBraces) {
-            expect(LBRACE);
+        try {
+            pushControlNode(newBlock);
+
+            // Block opening brace.
+            if (needsBraces) {
+                expect(LBRACE);
+            }
+
+            try {
+                // Accumulate block statements.
+                statementList();
+            } finally {
+                popControlNode();
+            }
+        } finally {
+            restoreBlock(newBlock);
         }
 
-        try {
-            // Accumulate block statements.
-            statementList();
-        } finally {
-            restoreBlock();
-            popControlNode();
-        }
-
-    final int possibleEnd = Token.descPosition(token) + Token.descLength(token);
+        final int possibleEnd = Token.descPosition(token) + Token.descLength(token);
 
         // Block closing brace.
         if (needsBraces) {
@@ -365,7 +369,7 @@
             // Accumulate statements.
             statement();
         } finally {
-            restoreBlock();
+            restoreBlock(newBlock);
         }
 
         return newBlock;
@@ -379,7 +383,10 @@
         final String name = ident.getName();
 
         if (EVAL.tag().equals(name)) {
-            function.setHasEval();
+            final Iterator<FunctionNode> it = lexicalContext.getFunctions();
+            if(it.hasNext()) {
+                it.next().setHasEval(it);
+            }
         }
     }
 
@@ -391,7 +398,7 @@
         final String name = ident.getName();
 
         if (ARGUMENTS.tag().equals(name)) {
-            function.setUsesArguments();
+            getFunction().setUsesArguments();
         }
     }
 
@@ -438,7 +445,7 @@
             }
 
             if (lhs instanceof IdentNode) {
-                if (! checkIdentLValue((IdentNode)lhs)) {
+                if (!checkIdentLValue((IdentNode)lhs)) {
                     return referenceError(lhs, rhs);
                 }
                 verifyStrictIdent((IdentNode)lhs, "assignment");
@@ -482,7 +489,7 @@
      * @return null or the found label node.
      */
     private LabelNode findLabel(final IdentNode ident) {
-        for (final LabelNode labelNode : function.getLabelStack()) {
+        for (final LabelNode labelNode : getFunction().getLabelStack()) {
             if (labelNode.getLabel().equals(ident)) {
                 return labelNode;
             }
@@ -496,14 +503,14 @@
      * @param labelNode Label to add.
      */
     private void pushLabel(final LabelNode labelNode) {
-        function.getLabelStack().push(labelNode);
+        getFunction().getLabelStack().push(labelNode);
     }
 
     /**
       * Remove a label from the label stack.
       */
     private void popLabel() {
-        function.getLabelStack().pop();
+        getFunction().getLabelStack().pop();
     }
 
     /**
@@ -513,6 +520,7 @@
     private void pushControlNode(final Node node) {
         final boolean isLoop = node instanceof WhileNode;
         final boolean isBreakable = node instanceof BreakableNode || node instanceof Block;
+        final FunctionNode function = getFunction();
         function.getControlStack().push(node);
 
         for (final LabelNode labelNode : function.getLabelStack()) {
@@ -531,7 +539,7 @@
      */
     private void popControlNode() {
         // Get control stack.
-        final Stack<Node> controlStack = function.getControlStack();
+        final Stack<Node> controlStack = getFunction().getControlStack();
 
         // Can be empty if missing brace.
         if (!controlStack.isEmpty()) {
@@ -541,7 +549,7 @@
 
     private void popControlNode(final Node node) {
         // Get control stack.
-        final Stack<Node> controlStack = function.getControlStack();
+        final Stack<Node> controlStack = getFunction().getControlStack();
 
         // Can be empty if missing brace.
         if (!controlStack.isEmpty() && controlStack.peek() == node) {
@@ -550,7 +558,7 @@
     }
 
     private boolean isInWithBlock() {
-        final Stack<Node> controlStack = function.getControlStack();
+        final Stack<Node> controlStack = getFunction().getControlStack();
         for (int i = controlStack.size() - 1; i >= 0; i--) {
             final Node node = controlStack.get(i);
 
@@ -563,7 +571,7 @@
     }
 
     private <T extends Node> T findControl(final Class<T> ctype) {
-        final Stack<Node> controlStack = function.getControlStack();
+        final Stack<Node> controlStack = getFunction().getControlStack();
         for (int i = controlStack.size() - 1; i >= 0; i--) {
             final Node node = controlStack.get(i);
 
@@ -577,7 +585,7 @@
 
     private <T extends Node> List<T> findControls(final Class<T> ctype, final Node to) {
         final List<T> nodes = new ArrayList<>();
-        final Stack<Node> controlStack = function.getControlStack();
+        final Stack<Node> controlStack = getFunction().getControlStack();
         for (int i = controlStack.size() - 1; i >= 0; i--) {
             final Node node = controlStack.get(i);
 
@@ -621,15 +629,16 @@
         // Make a fake token for the script.
         final long functionToken = Token.toDesc(FUNCTION, 0, source.getLength());
         // Set up the script to append elements.
-        script = newFunctionBlock(new IdentNode(source, functionToken, Token.descPosition(functionToken), scriptName));
-        // set kind to be SCRIPT
+
+        final FunctionNode script = newFunctionBlock(new IdentNode(source, functionToken, Token.descPosition(functionToken), scriptName));
+
         script.setKind(FunctionNode.Kind.SCRIPT);
-        // Set the first token of the script.
         script.setFirstToken(functionToken);
-        // Gather source elements.
+        functionDeclarations = new ArrayList<>();
         sourceElements();
+        script.prependStatements(functionDeclarations);
+        functionDeclarations = null;
         expect(EOF);
-        // Set the last token of the script.
         script.setLastToken(token);
         script.setFinish(source.getLength() - 1);
 
@@ -707,7 +716,7 @@
                     // check for directive prologues
                     if (checkDirective) {
                         // skip any debug statement like line number to get actual first line
-                        final Node lastStatement = lastStatement(block.getStatements());
+                        final Node lastStatement = lastStatement(getBlock().getStatements());
 
                         // get directive prologue, if any
                         final String directive = getDirective(lastStatement);
@@ -727,6 +736,7 @@
                             // handle use strict directive
                             if ("use strict".equals(directive)) {
                                 isStrictMode = true;
+                                final FunctionNode function = getFunction();
                                 function.setStrictMode(true);
 
                                 // We don't need to check these, if lexical environment is already strict
@@ -799,11 +809,11 @@
             if (isStrictMode && !topLevel) {
                 error(AbstractParser.message("strict.no.func.here"), token);
             }
-            functionExpression(true);
+            functionExpression(true, topLevel);
             return;
         }
 
-        block.addStatement(lineNumberNode);
+        getBlock().addStatement(lineNumberNode);
 
         switch (type) {
         case LBRACE:
@@ -889,7 +899,7 @@
         // Force block execution.
         final ExecuteNode executeNode = new ExecuteNode(source, newBlock.getToken(), finish, newBlock);
 
-        block.addStatement(executeNode);
+        getBlock().addStatement(executeNode);
     }
 
     /**
@@ -984,13 +994,9 @@
 
             // Allocate var node.
             final VarNode var = new VarNode(source, varToken, finish, name, init);
-            if (isStatement) {
-                function.addDeclaration(var);
-            }
-
             vars.add(var);
             // Add to current block.
-            block.addStatement(var);
+            getBlock().addStatement(var);
 
             if (type != COMMARIGHT) {
                 break;
@@ -1003,7 +1009,7 @@
             boolean semicolon = type == SEMICOLON;
             endOfLine();
             if (semicolon) {
-                block.setFinish(finish);
+                getBlock().setFinish(finish);
             }
         }
 
@@ -1020,7 +1026,7 @@
      */
     private void emptyStatement() {
         if (env._empty_statements) {
-            block.addStatement(new EmptyNode(source, token,
+            getBlock().addStatement(new EmptyNode(source, token,
                     Token.descPosition(token) + Token.descLength(token)));
         }
 
@@ -1046,7 +1052,7 @@
         ExecuteNode executeNode = null;
         if (expression != null) {
             executeNode = new ExecuteNode(source, expressionToken, finish, expression);
-            block.addStatement(executeNode);
+            getBlock().addStatement(executeNode);
         } else {
             expect(null);
         }
@@ -1055,7 +1061,7 @@
 
         if (executeNode != null) {
             executeNode.setFinish(finish);
-            block.setFinish(finish);
+            getBlock().setFinish(finish);
         }
     }
 
@@ -1097,7 +1103,7 @@
         // Construct and add new if node.
         final IfNode ifNode = new IfNode(source, ifToken, fail != null ? fail.getFinish() : pass.getFinish(), test, pass, fail);
 
-        block.addStatement(ifNode);
+        getBlock().addStatement(ifNode);
     }
 
     /**
@@ -1146,13 +1152,13 @@
             outer.setFinish(body.getFinish());
 
             // Add for to current block.
-            block.addStatement(forNode);
+            getBlock().addStatement(forNode);
         } finally {
-            restoreBlock();
+            restoreBlock(outer);
             popControlNode();
         }
 
-        block.addStatement(new ExecuteNode(source, outer.getToken(), outer.getFinish(), outer));
+        getBlock().addStatement(new ExecuteNode(source, outer.getToken(), outer.getFinish(), outer));
      }
 
     /**
@@ -1231,7 +1237,7 @@
                 }
 
                 if (init instanceof IdentNode) {
-                    if (! checkIdentLValue((IdentNode)init)) {
+                    if (!checkIdentLValue((IdentNode)init)) {
                         error(AbstractParser.message("not.lvalue.for.in.loop"), init.getToken());
                     }
                     verifyStrictIdent((IdentNode)init, "for-in iterator");
@@ -1286,7 +1292,7 @@
             whileNode.setFinish(statements.getFinish());
 
             // Add WHILE node.
-            block.addStatement(whileNode);
+            getBlock().addStatement(whileNode);
         } finally {
             popControlNode();
         }
@@ -1333,7 +1339,7 @@
             doWhileNode.setFinish(finish);
 
             // Add DO node.
-            block.addStatement(doWhileNode);
+            getBlock().addStatement(doWhileNode);
         } finally {
             popControlNode();
         }
@@ -1385,7 +1391,7 @@
         final ContinueNode continueNode = new ContinueNode(source, continueToken, finish, labelNode, targetNode, findControl(TryNode.class));
         continueNode.setScopeNestingLevel(countControls(WithNode.class, targetNode));
 
-        block.addStatement(continueNode);
+        getBlock().addStatement(continueNode);
     }
 
     /**
@@ -1433,7 +1439,7 @@
         final BreakNode breakNode = new BreakNode(source, breakToken, finish, labelNode, targetNode, findControl(TryNode.class));
         breakNode.setScopeNestingLevel(countControls(WithNode.class, targetNode));
 
-        block.addStatement(breakNode);
+        getBlock().addStatement(breakNode);
     }
 
     /**
@@ -1446,7 +1452,7 @@
      */
     private void returnStatement() {
         // check for return outside function
-        if (function.getKind() == FunctionNode.Kind.SCRIPT) {
+        if (getFunction().getKind() == FunctionNode.Kind.SCRIPT) {
             error(AbstractParser.message("invalid.return"));
         }
 
@@ -1473,7 +1479,7 @@
 
         // Construct and add RETURN node.
         final ReturnNode returnNode = new ReturnNode(source, returnToken, finish, expression, findControl(TryNode.class));
-        block.addStatement(returnNode);
+        getBlock().addStatement(returnNode);
     }
 
     /**
@@ -1508,7 +1514,7 @@
 
         // Construct and add YIELD node.
         final ReturnNode yieldNode = new ReturnNode(source, yieldToken, finish, expression, findControl(TryNode.class));
-        block.addStatement(yieldNode);
+        getBlock().addStatement(yieldNode);
     }
 
     /**
@@ -1532,7 +1538,10 @@
 
         // Get WITH expression.
         final WithNode withNode = new WithNode(source, withToken, finish, null, null);
-        function.setHasWith();
+        final Iterator<FunctionNode> it = lexicalContext.getFunctions();
+        if(it.hasNext()) {
+            it.next().setHasWith(it);
+        }
 
         try {
             pushControlNode(withNode);
@@ -1552,7 +1561,7 @@
             popControlNode(withNode);
         }
 
-        block.addStatement(withNode);
+        getBlock().addStatement(withNode);
     }
 
     /**
@@ -1652,7 +1661,7 @@
 
             switchNode.setFinish(finish);
 
-            block.addStatement(switchNode);
+            getBlock().addStatement(switchNode);
         } finally {
             popControlNode();
         }
@@ -1687,7 +1696,7 @@
             labelNode.setBody(statements);
             labelNode.setFinish(finish);
 
-            block.addStatement(labelNode);
+            getBlock().addStatement(labelNode);
         } finally {
             // Remove label.
             popLabel();
@@ -1730,7 +1739,7 @@
 
         // Construct and add THROW node.
         final ThrowNode throwNode = new ThrowNode(source, throwToken, finish, expression, findControl(TryNode.class));
-        block.addStatement(throwNode);
+        getBlock().addStatement(throwNode);
     }
 
     /**
@@ -1796,18 +1805,18 @@
 
                 expect(RPAREN);
 
+                final Block catchBlock = newBlock();
                 try {
-                    final Block catchBlock = newBlock();
 
                     // Get CATCH body.
                     final Block catchBody = getBlock(true);
 
                     // Create and add catch.
                     final CatchNode catchNode = new CatchNode(source, catchToken, finish, exception, ifExpression, catchBody);
-                    block.addStatement(catchNode);
+                    getBlock().addStatement(catchNode);
                     catchBlocks.add(catchBlock);
                 } finally {
-                    restoreBlock();
+                    restoreBlock(catchBlock);
                 }
 
                 // If unconditional catch then should to be the end.
@@ -1843,11 +1852,11 @@
             outer.addStatement(tryNode);
         } finally {
             popControlNode(tryNode);
-            restoreBlock();
+            restoreBlock(outer);
             popControlNode(outer);
         }
 
-        block.addStatement(new ExecuteNode(source, outer.getToken(), outer.getFinish(), outer));
+        getBlock().addStatement(new ExecuteNode(source, outer.getToken(), outer.getFinish(), outer));
     }
 
     /**
@@ -1867,7 +1876,7 @@
         endOfLine();
 
         final RuntimeNode runtimeNode = new RuntimeNode(source, debuggerToken, finish, RuntimeNode.Request.DEBUGGER, new ArrayList<Node>());
-        block.addStatement(runtimeNode);
+        getBlock().addStatement(runtimeNode);
     }
 
     /**
@@ -2026,7 +2035,7 @@
                 break;
 
             default:
-                if (! elision) {
+                if (!elision) {
                     error(AbstractParser.message("expected.comma", type.getNameOrType()));
                 }
                 // Add expression element.
@@ -2067,15 +2076,11 @@
         next();
 
         // Object context.
-        Block objectContext = null;
         // Prepare to accumulate elements.
         final List<Node> elements = new ArrayList<>();
         final Map<Object, PropertyNode> map = new HashMap<>();
 
-        try {
-            // Create a block for the object literal.
-            objectContext = newBlock();
-
+        // Create a block for the object literal.
             boolean commaSeen = true;
 loop:
             while (true) {
@@ -2090,97 +2095,90 @@
                     break;
 
                 default:
-                    if (! commaSeen) {
+                    if (!commaSeen) {
                         error(AbstractParser.message("expected.comma", type.getNameOrType()));
-                    }
-
-                    commaSeen = false;
-                    // Get and add the next property.
-                    final PropertyNode property = propertyAssignment();
-                    final Object key = property.getKeyName();
-                    final PropertyNode existingProperty = map.get(key);
-
-                    if (existingProperty != null) {
-                        // ECMA section 11.1.5 Object Initialiser
-                        // point # 4 on property assignment production
-                        final Node value  = property.getValue();
-                        final Node getter = property.getGetter();
-                        final Node setter = property.getSetter();
-
-                        final Node prevValue  = existingProperty.getValue();
-                        final Node prevGetter = existingProperty.getGetter();
-                        final Node prevSetter = existingProperty.getSetter();
-
-                        boolean redefinitionOk = true;
-                        // ECMA 11.1.5 strict mode restrictions
-                        if (isStrictMode) {
-                            if (value != null && prevValue != null) {
-                                redefinitionOk = false;
-                            }
-                        }
-
-                        final boolean isPrevAccessor = prevGetter != null || prevSetter != null;
-                        final boolean isAccessor = getter != null || setter != null;
-
-                        // data property redefined as accessor property
-                        if (prevValue != null && isAccessor) {
-                            redefinitionOk = false;
-                        }
-
-                        // accessor property redefined as data
-                        if (isPrevAccessor && value != null) {
+                }
+
+                commaSeen = false;
+                // Get and add the next property.
+                final PropertyNode property = propertyAssignment();
+                final Object key = property.getKeyName();
+                final PropertyNode existingProperty = map.get(key);
+
+                if (existingProperty != null) {
+                    // ECMA section 11.1.5 Object Initialiser
+                    // point # 4 on property assignment production
+                    final Node value  = property.getValue();
+                    final Node getter = property.getGetter();
+                    final Node setter = property.getSetter();
+
+                    final Node prevValue  = existingProperty.getValue();
+                    final Node prevGetter = existingProperty.getGetter();
+                    final Node prevSetter = existingProperty.getSetter();
+
+                    boolean redefinitionOk = true;
+                    // ECMA 11.1.5 strict mode restrictions
+                    if (isStrictMode) {
+                        if (value != null && prevValue != null) {
                             redefinitionOk = false;
                         }
-
-                        if (isAccessor && isPrevAccessor) {
-                            if (getter != null && prevGetter != null ||
-                                setter != null && prevSetter != null) {
-                                redefinitionOk = false;
-                            }
-                        }
-
-                        if (! redefinitionOk) {
-                            error(AbstractParser.message("property.redefinition", key.toString()), property.getToken());
-                        }
-
-                        if (value != null) {
-                            final Node existingValue = existingProperty.getValue();
-
-                            if (existingValue == null) {
-                                existingProperty.setValue(value);
-                            } else {
-                                final long propertyToken = Token.recast(existingProperty.getToken(), COMMARIGHT);
-                                existingProperty.setValue(new BinaryNode(source, propertyToken, existingValue, value));
-                            }
-
-                            existingProperty.setGetter(null);
-                            existingProperty.setSetter(null);
+                    }
+
+                    final boolean isPrevAccessor = prevGetter != null || prevSetter != null;
+                    final boolean isAccessor = getter != null || setter != null;
+
+                    // data property redefined as accessor property
+                    if (prevValue != null && isAccessor) {
+                        redefinitionOk = false;
+                    }
+
+                    // accessor property redefined as data
+                    if (isPrevAccessor && value != null) {
+                        redefinitionOk = false;
+                    }
+
+                    if (isAccessor && isPrevAccessor) {
+                        if (getter != null && prevGetter != null ||
+                            setter != null && prevSetter != null) {
+                            redefinitionOk = false;
                         }
-
-                        if (getter != null) {
-                            existingProperty.setGetter(getter);
+                    }
+
+                    if (!redefinitionOk) {
+                        error(AbstractParser.message("property.redefinition", key.toString()), property.getToken());
+                    }
+
+                    if (value != null) {
+                        final Node existingValue = existingProperty.getValue();
+
+                        if (existingValue == null) {
+                            existingProperty.setValue(value);
+                        } else {
+                            final long propertyToken = Token.recast(existingProperty.getToken(), COMMARIGHT);
+                            existingProperty.setValue(new BinaryNode(source, propertyToken, existingValue, value));
                         }
 
-                        if (setter != null) {
-                            existingProperty.setSetter(setter);
-                        }
-                    } else {
-                        map.put(key, property);
-                        elements.add(property);
+                        existingProperty.setGetter(null);
+                        existingProperty.setSetter(null);
                     }
 
-                    break;
+                    if (getter != null) {
+                        existingProperty.setGetter(getter);
+                    }
+
+                    if (setter != null) {
+                        existingProperty.setSetter(setter);
+                    }
+                } else {
+                    map.put(key, property);
+                    elements.add(property);
                 }
+
+                break;
             }
-        } finally {
-            restoreBlock();
         }
 
-        // Construct new object literal.
-        objectContext.setFinish(finish);
-        objectContext.setStart(Token.descPosition(objectToken));
-
-        return new ObjectNode(source, objectToken, finish, objectContext, elements);
+        return new ObjectNode(source, objectToken, finish, elements);
     }
 
     /**
@@ -2258,7 +2256,7 @@
                     parameters = new ArrayList<>();
                     functionNode = functionBody(getSetToken, getNameNode, parameters, FunctionNode.Kind.GETTER);
                     propertyNode = new PropertyNode(source, propertyToken, finish, getIdent, null);
-                    propertyNode.setGetter(new ReferenceNode(source, propertyToken, finish, functionNode));
+                    propertyNode.setGetter(functionNode);
                     return propertyNode;
 
                 case "set":
@@ -2273,7 +2271,7 @@
                     parameters.add(argIdent);
                     functionNode = functionBody(getSetToken, setNameNode, parameters, FunctionNode.Kind.SETTER);
                     propertyNode = new PropertyNode(source, propertyToken, finish, setIdent, null);
-                    propertyNode.setSetter(new ReferenceNode(source, propertyToken, finish, functionNode));
+                    propertyNode.setSetter(functionNode);
                     return propertyNode;
 
                 default:
@@ -2454,7 +2452,7 @@
 
         case FUNCTION:
             // Get function expression.
-            lhs = functionExpression(false);
+            lhs = functionExpression(false, false);
             break;
 
         default:
@@ -2559,7 +2557,7 @@
      *
      * @return Expression node.
      */
-    private Node functionExpression(final boolean isStatement) {
+    private Node functionExpression(final boolean isStatement, final boolean topLevel) {
         final LineNumberNode lineNumber = lineNumber();
 
         final long functionToken = token;
@@ -2594,10 +2592,12 @@
 
         final FunctionNode functionNode = functionBody(functionToken, name, parameters, FunctionNode.Kind.NORMAL);
 
-        if (isStatement && !isInWithBlock()) {
-            functionNode.setIsStatement();
+        if (isStatement) {
+            if(topLevel) {
+                functionNode.setIsDeclared();
+            }
             if(ARGUMENTS.tag().equals(name.getName())) {
-                functionNode.findParentFunction().setDefinesArguments();
+                getFunction().setDefinesArguments();
             }
         }
 
@@ -2605,8 +2605,6 @@
             functionNode.setIsAnonymous();
         }
 
-        final ReferenceNode referenceNode = new ReferenceNode(source, functionToken, finish, functionNode);
-
         final int arity = parameters.size();
 
         final boolean strict = functionNode.isStrictMode();
@@ -2642,17 +2640,18 @@
         }
 
         if (isStatement) {
-            final VarNode var = new VarNode(source, functionToken, finish, name, referenceNode);
-            if (isInWithBlock()) {
-                function.addDeclaration(var);
-                // Add to current block.
-                block.addStatement(var);
+            final VarNode varNode = new VarNode(source, functionToken, finish, name, functionNode, true);
+            if(topLevel) {
+                functionDeclarations.add(lineNumber);
+                functionDeclarations.add(varNode);
             } else {
-                functionNode.setFunctionVarNode(var, lineNumber);
+                final Block block = getBlock();
+                block.addStatement(lineNumber);
+                block.addStatement(varNode);
             }
         }
 
-        return referenceNode;
+        return functionNode;
     }
 
     /**
@@ -2735,7 +2734,14 @@
                 expect(LBRACE);
 
                 // Gather the function elements.
-                sourceElements();
+                final List<Node> prevFunctionDecls = functionDeclarations;
+                functionDeclarations = new ArrayList<>();
+                try {
+                    sourceElements();
+                    functionNode.prependStatements(functionDeclarations);
+                } finally {
+                    functionDeclarations = prevFunctionDecls;
+                }
 
                 functionNode.setLastToken(token);
                 expect(RBRACE);
@@ -2743,12 +2749,9 @@
 
             }
         } finally {
-            restoreBlock();
+            restoreBlock(functionNode);
         }
 
-        // Add the body of the function to the current block.
-        block.addFunction(functionNode);
-
         return functionNode;
     }
 
@@ -2845,7 +2848,7 @@
             }
 
             if (lhs instanceof IdentNode) {
-                if (! checkIdentLValue((IdentNode)lhs)) {
+                if (!checkIdentLValue((IdentNode)lhs)) {
                     return referenceError(lhs, null);
                 }
                 verifyStrictIdent((IdentNode)lhs, "operand for " + opType.getName() + " operator");
@@ -2872,7 +2875,7 @@
                     return referenceError(lhs, null);
                 }
                 if (lhs instanceof IdentNode) {
-                    if (! checkIdentLValue((IdentNode)lhs)) {
+                    if (!checkIdentLValue((IdentNode)lhs)) {
                         next();
                         return referenceError(lhs, null);
                     }
@@ -3083,4 +3086,12 @@
     public String toString() {
         return "[JavaScript Parsing]";
     }
+
+    private Block getBlock() {
+        return lexicalContext.getCurrentBlock();
+    }
+
+    private FunctionNode getFunction() {
+        return lexicalContext.getCurrentFunction();
+    }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Fri Apr 05 14:51:24 2013 -0700
@@ -164,7 +164,6 @@
         super(key, flags, slot);
 
         /*
-         *
          * primitiveGetter and primitiveSetter are only used in dual fields mode. Setting them to null also
          * works in dual field mode, it only means that the property never has a primitive
          * representation.
@@ -348,11 +347,10 @@
 
     private MethodHandle debug(final MethodHandle mh, final Class<?> forType, final Class<?> type, final String tag) {
         if (DEBUG_FIELDS) {
-           final MethodHandle mhd = MethodHandleFactory.addDebugPrintout(
+           return MethodHandleFactory.addDebugPrintout(
                LOG,
                mh,
                tag + " '" + getKey() + "' (property="+ Debug.id(this) + ", forType=" + stripName(forType) + ", type=" + stripName(type) + ')');
-           return mhd;
         }
         return mh;
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/CodeInstaller.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CodeInstaller.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,6 +25,8 @@
 
 package jdk.nashorn.internal.runtime;
 
+import jdk.nashorn.internal.codegen.ClassEmitter;
+
 /**
  * Interface for installing classes passed to the compiler.
  * As only the code generating package (i.e. Context) knows about
@@ -52,12 +54,12 @@
      */
     public Class<?> install(final String className, final byte[] bytecode);
 
-    /*
+    /**
      * Verify generated bytecode before emission. This is called back from the
      * {@link ClassEmitter} or the {@link Compiler}. If the "--verify-code" parameter
      * hasn't been given, this is a nop
      *
-     * @param bytecode bytecode to verify
+     * @param code bytecode to verify
      */
     public void verify(final byte[] code);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunction.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ */
+package jdk.nashorn.internal.runtime;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodType;
+
+import jdk.nashorn.internal.codegen.types.Type;
+
+/**
+ * An version of a JavaScript function, native or JavaScript.
+ * Supports lazily generating a constructor version of the invocation.
+ */
+final class CompiledFunction implements Comparable<CompiledFunction> {
+
+    private final MethodHandle invoker;
+    private MethodHandle constructor;
+
+    CompiledFunction(final MethodHandle invoker) {
+        this(invoker, null);
+    }
+
+    CompiledFunction(final MethodHandle invoker, final MethodHandle constructor) {
+        this.invoker = invoker;
+        this.constructor = constructor; //isConstructor
+    }
+
+    @Override
+    public String toString() {
+        return "<invoker=" + invoker + " ctor=" + constructor + ">";
+    }
+
+    MethodHandle getInvoker() {
+        return invoker;
+    }
+
+    MethodHandle getConstructor() {
+        return constructor;
+    }
+
+    void setConstructor(final MethodHandle constructor) {
+        this.constructor = constructor;
+    }
+
+    boolean hasConstructor() {
+        return constructor != null;
+    }
+
+    MethodType type() {
+        return invoker.type();
+    }
+
+    @Override
+    public int compareTo(final CompiledFunction o) {
+        return weight() - o.weight();
+    }
+
+    private int weight() {
+        return weight(type());
+    }
+
+    private static int weight(final MethodType type) {
+        if (isVarArgsType(type)) {
+            return Integer.MAX_VALUE; //if there is a varargs it should be the heavist and last fallback
+        }
+
+        int weight = Type.typeFor(type.returnType()).getWeight();
+        for (final Class<?> paramType : type.parameterArray()) {
+            final int pweight = Type.typeFor(paramType).getWeight();
+            weight += pweight;
+        }
+        return weight;
+    }
+
+    private static boolean isVarArgsType(final MethodType type) {
+        assert type.parameterCount() >= 1 : type;
+        return type.parameterType(type.parameterCount() - 1) == Object[].class;
+    }
+
+    boolean moreGenericThan(final CompiledFunction o) {
+        return weight() > o.weight();
+    }
+
+    boolean moreGenericThan(final MethodType type) {
+        return weight() > weight(type);
+    }
+
+    /**
+     * Check whether a given method descriptor is compatible with this invocation.
+     * It is compatible if the types are narrower than the invocation type so that
+     * a semantically equivalent linkage can be performed.
+     *
+     * @param typesc
+     * @return
+     */
+    boolean typeCompatible(final MethodType type) {
+        final Class<?>[] wantedParams   = type.parameterArray();
+        final Class<?>[] existingParams = type().parameterArray();
+
+        //if we are not examining a varargs type, the number of parameters must be the same
+        if (wantedParams.length != existingParams.length && !isVarArgsType(type)) {
+            return false;
+        }
+
+        //we only go as far as the shortest array. the only chance to make this work if
+        //parameters lengths do not match is if our type ends with a varargs argument.
+        //then every trailing parameter in the given callsite can be folded into it, making
+        //us compatible (albeit slower than a direct specialization)
+        final int lastParamIndex = Math.min(wantedParams.length, existingParams.length);
+        for (int i = 0; i < lastParamIndex; i++) {
+            final Type w = Type.typeFor(wantedParams[i]);
+            final Type e = Type.typeFor(existingParams[i]);
+
+            //don't specialize on booleans, we have the "true" vs int 1 ambiguity in resolution
+            //we also currently don't support boolean as a javascript function callsite type.
+            //it will always box.
+            if (w.isBoolean()) {
+                return false;
+            }
+
+            //This callsite type has a vararg here. it will swallow all remaining args.
+            //for consistency, check that it's the last argument
+            if (e.isArray()) {
+                return true;
+            }
+
+            //Our arguments must be at least as wide as the wanted one, if not wider
+            if (Type.widest(w, e) != e) {
+                //e.g. this invocation takes double and callsite says "object". reject. won't fit
+                //but if invocation takes a double and callsite says "int" or "long" or "double", that's fine
+                return false;
+            }
+        }
+
+        return true; // anything goes for return type, take the convenient one and it will be upcasted thru dynalink magic.
+    }
+
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunctions.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+package jdk.nashorn.internal.runtime;
+
+import java.lang.invoke.MethodType;
+import java.util.Iterator;
+import java.util.TreeSet;
+
+/**
+ * This is a list of code versions of a function.
+ * The list is sorted in ascending order of generic descriptors
+ */
+@SuppressWarnings("serial")
+final class CompiledFunctions extends TreeSet<CompiledFunction> {
+
+    CompiledFunction best(final MethodType type) {
+        final Iterator<CompiledFunction> iter = iterator();
+        while (iter.hasNext()) {
+            final CompiledFunction next = iter.next();
+            if (next.typeCompatible(type)) {
+                return next;
+            }
+        }
+        return mostGeneric();
+    }
+
+    boolean needsCallee() {
+        for (final CompiledFunction inv : this) {
+            assert ScriptFunctionData.needsCallee(inv.getInvoker()) == ScriptFunctionData.needsCallee(mostGeneric().getInvoker());
+        }
+        return ScriptFunctionData.needsCallee(mostGeneric().getInvoker());
+    }
+
+    CompiledFunction mostGeneric() {
+        return last();
+    }
+
+    /**
+     * Is the given type even more specific than this entire list? That means
+     * we have an opportunity for more specific versions of the method
+     * through lazy code generation
+     *
+     * @param type type to check against
+     * @return true if the given type is more specific than all invocations available
+     */
+    boolean isLessSpecificThan(final MethodType type) {
+        return best(type).moreGenericThan(type);
+    }
+
+
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Apr 05 14:51:24 2013 -0700
@@ -27,9 +27,9 @@
 
 import static jdk.nashorn.internal.codegen.CompilerConstants.RUN_SCRIPT;
 import static jdk.nashorn.internal.codegen.CompilerConstants.STRICT_MODE;
+import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
-import static jdk.nashorn.internal.lookup.Lookup.MH;
 
 import java.io.File;
 import java.io.IOException;
@@ -39,10 +39,13 @@
 import java.lang.reflect.Constructor;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.CodeSigner;
 import java.security.CodeSource;
+import java.security.Permissions;
 import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
 import jdk.nashorn.internal.codegen.Compiler;
@@ -77,7 +80,7 @@
 
         /**
          * Return the context for this installer
-         * @return context
+         * @return ScriptEnvironment
          */
         @Override
         public ScriptEnvironment getOwner() {
@@ -123,7 +126,7 @@
             if (callerLoader != myLoader &&
                 !(callerLoader instanceof StructureLoader) &&
                 !(JavaAdapterFactory.isAdapterClass(caller))) {
-                sm.checkPermission(new RuntimePermission("getNashornGlobal"));
+                sm.checkPermission(new RuntimePermission("nashorn.getGlobal"));
             }
         }
 
@@ -137,7 +140,7 @@
     public static void setGlobal(final ScriptObject global) {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkPermission(new RuntimePermission("setNashornGlobal"));
+            sm.checkPermission(new RuntimePermission("nashorn.setGlobal"));
         }
 
         if (global != null && !(global instanceof GlobalObject)) {
@@ -154,7 +157,7 @@
     public static Context getContext() {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkPermission(new RuntimePermission("getNashornContext"));
+            sm.checkPermission(new RuntimePermission("nashorn.getContext"));
         }
         return getContextTrusted();
     }
@@ -267,7 +270,7 @@
     public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader) {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkPermission(new RuntimePermission("createNashornContext"));
+            sm.checkPermission(new RuntimePermission("nashorn.createContext"));
         }
 
         this.env       = new ScriptEnvironment(options, out, err);
@@ -533,7 +536,13 @@
         if (index != -1) {
             final SecurityManager sm = System.getSecurityManager();
             if (sm != null) {
-                sm.checkPackageAccess(fullName.substring(0, index));
+                AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                    @Override
+                    public Void run() {
+                        sm.checkPackageAccess(fullName.substring(0, index));
+                        return null;
+                    }
+                }, createNoPermissionsContext());
             }
         }
 
@@ -599,7 +608,7 @@
     public ScriptObject newGlobal() {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkPermission(new RuntimePermission("createNashornGlobal"));
+            sm.checkPermission(new RuntimePermission("nashorn.newGlobal"));
         }
 
         return newGlobalTrusted();
@@ -676,6 +685,10 @@
         return (context != null) ? context : Context.getContextTrusted();
     }
 
+    private static AccessControlContext createNoPermissionsContext() {
+        return new AccessControlContext(new ProtectionDomain[] { new ProtectionDomain(null, new Permissions()) });
+    }
+
     private Object evaluateSource(final Source source, final ScriptObject scope, final ScriptObject thiz) {
         ScriptFunction script = null;
 
@@ -731,6 +744,7 @@
             global = (GlobalObject)Context.getGlobalTrusted();
             script = global.findCachedClass(source);
             if (script != null) {
+                Compiler.LOG.fine("Code cache hit for " + source + " avoiding recompile.");
                 return script;
             }
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java	Fri Apr 05 14:51:24 2013 -0700
@@ -237,7 +237,7 @@
             return (String)name;
         }
 
-        return (String)name + ": " + (String)msg;
+        return name + ": " + msg;
     }
 
     private static Throwable asThrowable(final Object obj) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.internal.runtime;
+
+import static jdk.nashorn.internal.lookup.Lookup.MH;
+
+import java.lang.invoke.MethodHandle;
+
+/**
+ * This is a subclass that represents a script function that may not be regenerated.
+ * This is used for example for bound functions and builtins.
+ */
+public final class FinalScriptFunctionData extends ScriptFunctionData {
+
+    /**
+     * Constructor - used for bind
+     *
+     * @param name          name
+     * @param arity         arity
+     * @param list          precompiled code
+     * @param isStrict      strict
+     * @param isBuiltin     builtin
+     * @param isConstructor constructor
+     */
+    FinalScriptFunctionData(final String name, int arity, CompiledFunctions functions, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor) {
+        super(name, arity, isStrict, isBuiltin, isConstructor);
+        code.addAll(functions);
+    }
+
+    /**
+     * Constructor - used from ScriptFunction. This assumes that we have code alraedy for the
+     * method (typically a native method) and possibly specializations.
+     *
+     * @param name           name
+     * @param mh             method handle for generic version of method
+     * @param specs          specializations
+     * @param isStrict       strict
+     * @param isBuiltin      builtin
+     * @param isConstructor  constructor
+     */
+    FinalScriptFunctionData(final String name, final MethodHandle mh, final MethodHandle[] specs, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor) {
+        super(name, arity(mh), isStrict, isBuiltin, isConstructor);
+
+        addInvoker(mh);
+        if (specs != null) {
+            for (final MethodHandle spec : specs) {
+                addInvoker(spec);
+            }
+        }
+    }
+
+    private void addInvoker(final MethodHandle mh) {
+        boolean needsCallee = needsCallee(mh);
+        if (isConstructor(mh)) {
+            //only nasgen constructors: (boolean, self, args) are subject to binding a boolean newObj. isConstructor
+            //is too conservative a check. However, isConstructor(mh) always implies isConstructor param
+            assert isConstructor();
+            code.add(new CompiledFunction(MH.insertArguments(mh, 0, false), composeConstructor(MH.insertArguments(mh, 0, true), needsCallee))); //make sure callee state can be determined when we reach constructor
+        } else {
+            code.add(new CompiledFunction(mh));
+        }
+    }
+
+    private static int arity(final MethodHandle mh) {
+        if (isVarArg(mh)) {
+            return -1;
+        }
+
+        //drop self, callee and boolean constructor flag to get real arity
+        return mh.type().parameterCount() - 1 - (needsCallee(mh) ? 1 : 0) - (isConstructor(mh) ? 1 : 0);
+    }
+
+    private static boolean isConstructor(final MethodHandle mh) {
+        return mh.type().parameterCount() >= 1 && mh.type().parameterType(0) == boolean.class;
+    }
+
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/NashornLoader.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/NashornLoader.java	Fri Apr 05 14:51:24 2013 -0700
@@ -30,6 +30,10 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
 import java.security.SecureClassLoader;
 import jdk.nashorn.tools.Shell;
 
@@ -40,6 +44,28 @@
  *
  */
 abstract class NashornLoader extends SecureClassLoader {
+    private static final String OBJECTS_PKG = "jdk.nashorn.internal.objects";
+    private static final String RUNTIME_PKG = "jdk.nashorn.internal.runtime";
+    private static final String RUNTIME_LINKER_PKG = "jdk.nashorn.internal.runtime.linker";
+    private static final String SCRIPTS_PKG = "jdk.nashorn.internal.scripts";
+
+    private static final Permission[] SCRIPT_PERMISSIONS;
+    static {
+        SCRIPT_PERMISSIONS = new Permission[4];
+
+        /*
+         * Generated classes get access to runtime, runtime.linker, objects, scripts packages.
+         * Note that the actual scripts can not access these because Java.type, Packages
+         * prevent these restricted packages. And Java reflection and JSR292 access is prevented
+         * for scripts. In other words, nashorn generated portions of script classes can access
+         * clases in these implementation packages.
+         */
+        SCRIPT_PERMISSIONS[0] = new RuntimePermission("accessClassInPackage." + RUNTIME_PKG);
+        SCRIPT_PERMISSIONS[1] = new RuntimePermission("accessClassInPackage." + RUNTIME_LINKER_PKG);
+        SCRIPT_PERMISSIONS[2] = new RuntimePermission("accessClassInPackage." + OBJECTS_PKG);
+        SCRIPT_PERMISSIONS[3] = new RuntimePermission("accessClassInPackage." + SCRIPTS_PKG);
+    }
+
     private final Context context;
 
     final Context getContext() {
@@ -68,11 +94,30 @@
         if (i != -1) {
             final SecurityManager sm = System.getSecurityManager();
             if (sm != null) {
-                sm.checkPackageAccess(name.substring(0, i));
+                final String pkgName = name.substring(0, i);
+                switch (pkgName) {
+                    case RUNTIME_PKG:
+                    case RUNTIME_LINKER_PKG:
+                    case OBJECTS_PKG:
+                    case SCRIPTS_PKG:
+                        // allow it.
+                        break;
+                    default:
+                        sm.checkPackageAccess(pkgName);
+                }
             }
         }
     }
 
+    @Override
+    protected PermissionCollection getPermissions(CodeSource codesource) {
+        final Permissions permCollection = new Permissions();
+        for (final Permission perm : SCRIPT_PERMISSIONS) {
+            permCollection.add(perm);
+        }
+        return permCollection;
+    }
+
     /**
      * Create a secure URL class loader for the given classpath
      * @param classPath classpath for the loader to search from
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,185 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.internal.runtime;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+import jdk.nashorn.internal.codegen.Compiler;
+import jdk.nashorn.internal.codegen.CompilerConstants;
+import jdk.nashorn.internal.codegen.FunctionSignature;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+import jdk.nashorn.internal.parser.Token;
+import jdk.nashorn.internal.parser.TokenType;
+
+import static jdk.nashorn.internal.lookup.Lookup.MH;
+
+/**
+ * This is a subclass that represents a script function that may be regenerated,
+ * for example with specialization based on call site types, or lazily generated.
+ * The common denominator is that it can get new invokers during its lifespan,
+ * unlike {@link FinalScriptFunctionData}
+ */
+public final class RecompilableScriptFunctionData extends ScriptFunctionData {
+
+    private final FunctionNode functionNode;
+    private final PropertyMap  allocatorMap;
+    private final CodeInstaller<ScriptEnvironment> installer;
+    private final String allocatorClassName;
+
+    /** lazily generated allocator */
+    private MethodHandle allocator;
+
+    private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
+
+    /**
+     * Constructor - public as scripts use it
+     *
+     * @param functionNode       functionNode that represents this function code
+     * @param installer          installer for code regeneration versions of this function
+     * @param allocatorClassName name of our allocator class, will be looked up dynamically if used as a constructor
+     * @param allocatorMap       allocator map to seed instances with, when constructing
+     */
+    public RecompilableScriptFunctionData(final FunctionNode functionNode, final CodeInstaller<ScriptEnvironment> installer, final String allocatorClassName, final PropertyMap allocatorMap) {
+        super(functionNode.isAnonymous() ?
+                "" :
+                functionNode.getIdent().getName(),
+              functionNode.getParameters().size(),
+              functionNode.isStrictMode(),
+              false,
+              true);
+
+        this.functionNode       = functionNode;
+        this.installer          = installer;
+        this.allocatorClassName = allocatorClassName;
+        this.allocatorMap       = allocatorMap;
+    }
+
+    @Override
+    String toSource() {
+        final Source source = functionNode.getSource();
+        final long   token  = tokenFor(functionNode);
+
+        if (source != null && token != 0) {
+            return source.getString(Token.descPosition(token), Token.descLength(token));
+        }
+
+        return "function " + (name == null ? "" : name) + "() { [native code] }";
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+        final Source source = functionNode.getSource();
+        final long   token  = tokenFor(functionNode);
+
+        if (source != null) {
+            sb.append(source.getName())
+                .append(':')
+                .append(source.getLine(Token.descPosition(token)))
+                .append(' ');
+        }
+
+        return sb.toString() + super.toString();
+    }
+
+    private static long tokenFor(final FunctionNode fn) {
+        final int  position   = Token.descPosition(fn.getFirstToken());
+        final int  length     = Token.descPosition(fn.getLastToken()) - position + Token.descLength(fn.getLastToken());
+
+        return Token.toDesc(TokenType.FUNCTION, position, length);
+    }
+
+    @Override
+    ScriptObject allocate() {
+        try {
+            ensureHasAllocator(); //if allocatorClass name is set to null (e.g. for bound functions) we don't even try
+            return allocator == null ? null : (ScriptObject)allocator.invokeExact(allocatorMap);
+        } catch (final RuntimeException | Error e) {
+            throw e;
+        } catch (final Throwable t) {
+            throw new RuntimeException(t);
+        }
+    }
+
+    private void ensureHasAllocator() throws ClassNotFoundException {
+        if (allocator == null && allocatorClassName != null) {
+            this.allocator = MH.findStatic(LOOKUP, Context.forStructureClass(allocatorClassName), CompilerConstants.ALLOCATE.tag(), MH.type(ScriptObject.class, PropertyMap.class));
+        }
+    }
+
+    @Override
+    protected void ensureCodeGenerated() {
+         if (!code.isEmpty()) {
+             return; // nothing to do, we have code, at least some.
+         }
+
+         // check if function node is lazy, need to compile it.
+         // note that currently function cloning is not working completely, which
+         // means that the compiler will mutate the function node it has been given
+         // once it has been compiled, it cannot be recompiled. This means that
+         // lazy compilation works (not compiled yet) but e.g. specializations won't
+         // until the copy-on-write changes for IR are in, making cloning meaningless.
+         // therefore, currently method specialization is disabled. TODO
+
+         if (functionNode.isLazy()) {
+             Compiler.LOG.info("Trampoline hit: need to do lazy compilation of '" + functionNode.getName() + "'");
+             new Compiler(installer, functionNode).compile().install();
+
+             // we don't need to update any flags - varArgs and needsCallee are instrincic
+             // in the function world we need to get a destination node from the compile instead
+             // and replace it with our function node. TODO
+         }
+
+         // we can't get here unless we have bytecode, either from eager compilation or from
+         // running a lazy compile on the lines above
+
+         assert functionNode.hasState(CompilationState.INSTALLED);
+
+         // code exists - look it up and add it into the automatically sorted invoker list
+         code.add(
+            new CompiledFunction(
+                MH.findStatic(
+                    LOOKUP,
+                    functionNode.getCompileUnit().getCode(),
+                    functionNode.getName(),
+                    new FunctionSignature(functionNode).
+                        getMethodType())));
+    }
+
+    @Override
+    MethodHandle getBestInvoker(final MethodType callSiteType, final Object[] args) {
+        final MethodHandle mh = super.getBestInvoker(callSiteType, args);
+        if (code.isLessSpecificThan(callSiteType)) {
+            // opportunity for code specialization - we can regenerate a better version of this method
+        }
+        return mh;
+    }
+
+}
+
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java	Fri Apr 05 14:51:24 2013 -0700
@@ -82,6 +82,9 @@
     /** Show full Nashorn version */
     public final boolean _fullversion;
 
+    /** Should lazy compilation take place */
+    public final boolean _lazy_compilation;
+
     /** Create a new class loaded for each compilation */
     public final boolean _loader_per_compile;
 
@@ -155,6 +158,7 @@
         _early_lvalue_error   = options.getBoolean("early.lvalue.error");
         _empty_statements     = options.getBoolean("empty.statements");
         _fullversion          = options.getBoolean("fullversion");
+        _lazy_compilation     = options.getBoolean("lazy.compilation");
         _loader_per_compile   = options.getBoolean("loader.per.compile");
         _no_syntax_extensions = options.getBoolean("no.syntax.extensions");
         _package              = options.getString("package");
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java	Fri Apr 05 14:51:24 2013 -0700
@@ -33,11 +33,11 @@
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.nashorn.internal.codegen.CompilerConstants.Call;
-import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
 import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
 import jdk.nashorn.internal.runtime.linker.NashornGuards;
@@ -48,16 +48,16 @@
 public abstract class ScriptFunction extends ScriptObject {
 
     /** Method handle for prototype getter for this ScriptFunction */
-    public static final MethodHandle G$PROTOTYPE  = findOwnMH("G$prototype",  Object.class, Object.class);
+    public static final MethodHandle G$PROTOTYPE = findOwnMH("G$prototype", Object.class, Object.class);
 
     /** Method handle for prototype setter for this ScriptFunction */
-    public static final MethodHandle S$PROTOTYPE  = findOwnMH("S$prototype",  void.class, Object.class, Object.class);
+    public static final MethodHandle S$PROTOTYPE = findOwnMH("S$prototype", void.class, Object.class, Object.class);
 
     /** Method handle for length getter for this ScriptFunction */
-    public static final MethodHandle G$LENGTH     = findOwnMH("G$length",     int.class, Object.class);
+    public static final MethodHandle G$LENGTH = findOwnMH("G$length", int.class, Object.class);
 
     /** Method handle for name getter for this ScriptFunction */
-    public static final MethodHandle G$NAME       = findOwnMH("G$name",       Object.class, Object.class);
+    public static final MethodHandle G$NAME = findOwnMH("G$name", Object.class, Object.class);
 
     /** Method handle for allocate function for this ScriptFunction */
     static final MethodHandle ALLOCATE = findOwnMH("allocate", Object.class);
@@ -67,7 +67,9 @@
     /** method handle to scope getter for this ScriptFunction */
     public static final Call GET_SCOPE = virtualCallNoLookup(ScriptFunction.class, "getScope", ScriptObject.class);
 
-    private final ScriptFunctionData data;
+    private static final MethodHandle IS_FUNCTION_MH  = findOwnMH("isFunctionMH", boolean.class, Object.class, ScriptFunctionData.class);
+
+    private static final MethodHandle IS_NONSTRICT_FUNCTION = findOwnMH("isNonStrictFunction", boolean.class, Object.class, Object.class, ScriptFunctionData.class);
 
     /** Reference to constructor prototype. */
     protected Object prototype;
@@ -75,6 +77,8 @@
     /** The parent scope. */
     private final ScriptObject scope;
 
+    private final ScriptFunctionData data;
+
     /**
      * Constructor
      *
@@ -97,7 +101,7 @@
             final boolean builtin,
             final boolean isConstructor) {
 
-        this (new ScriptFunctionData(name, methodHandle, specs, strict, builtin, isConstructor), map, scope);
+        this(new FinalScriptFunctionData(name, methodHandle, specs, strict, builtin, isConstructor), map, scope);
     }
 
     /**
@@ -118,8 +122,8 @@
             constructorCount++;
         }
 
-        this.data = data;
-        this.scope  = scope;
+        this.data  = data;
+        this.scope = scope;
     }
 
     @Override
@@ -295,20 +299,20 @@
     /**
      * Return the most appropriate invoke handle if there are specializations
      * @param type most specific method type to look for invocation with
+     * @param callsite args for trampoline invocation
      * @return invoke method handle
      */
-    private final MethodHandle getBestInvoker(final MethodType type) {
-        return data.getBestInvoker(type);
+    private MethodHandle getBestInvoker(final MethodType type, final Object[] args) {
+        return data.getBestInvoker(type, args);
     }
 
     /**
-     * Get the invoke handle - the most generic (and if no specializations are in place, only) invocation
-     * method handle for this ScriptFunction
-     * @see SpecializedFunction
-     * @return invokeHandle
+     * Return the most appropriate invoke handle if there are specializations
+     * @param type most specific method type to look for invocation with
+     * @return invoke method handle
      */
-    public final MethodHandle getInvokeHandle() {
-        return data.getInvoker();
+    public MethodHandle getBestInvoker(final MethodType type) {
+        return getBestInvoker(type, null);
     }
 
     /**
@@ -319,7 +323,7 @@
      * @return bound invoke handle
      */
     public final MethodHandle getBoundInvokeHandle(final ScriptObject self) {
-        return MH.bindTo(bindToCalleeIfNeeded(getInvokeHandle()), self);
+        return MH.bindTo(bindToCalleeIfNeeded(data.getGenericInvoker()), self);
     }
 
     /**
@@ -329,7 +333,8 @@
      * @return the potentially bound method handle
      */
     private MethodHandle bindToCalleeIfNeeded(final MethodHandle methodHandle) {
-        return data.needsCallee() ? MH.bindTo(methodHandle, this) : methodHandle;
+        return ScriptFunctionData.needsCallee(methodHandle) ? MH.bindTo(methodHandle, this) : methodHandle;
+
     }
 
     /**
@@ -340,15 +345,6 @@
         return data.getName();
     }
 
-    /**
-     * Does this script function need to be compiled. This determined by
-     * null checking invokeHandle
-     *
-     * @return true if this needs compilation
-     */
-    public final boolean needsCompilation() {
-        return data.getInvoker() == null;
-    }
 
     /**
      * Get the scope for this function
@@ -359,15 +355,6 @@
     }
 
     /**
-     * Reset the invoker handle. This is used by trampolines for
-     * lazy code generation
-     * @param invoker new invoker
-     */
-    protected void resetInvoker(final MethodHandle invoker) {
-        data.resetInvoker(invoker);
-    }
-
-    /**
      * Prototype getter for this ScriptFunction - follows the naming convention
      * used by Nasgen and the code generator
      *
@@ -464,7 +451,7 @@
     @Override
     protected GuardedInvocation findNewMethod(final CallSiteDescriptor desc) {
         final MethodType type = desc.getMethodType();
-        return new GuardedInvocation(pairArguments(data.getBestConstructor(type), type), null, NashornGuards.getFunctionGuard(this));
+        return new GuardedInvocation(pairArguments(data.getBestConstructor(type.changeParameterType(0, ScriptFunction.class), null), type), null, getFunctionGuard(this));
     }
 
     @SuppressWarnings("unused")
@@ -472,7 +459,7 @@
         if (obj instanceof ScriptObject || !ScriptFunctionData.isPrimitiveThis(obj)) {
             return obj;
         }
-        return ((GlobalObject) Context.getGlobalTrusted()).wrapAsObject(obj);
+        return ((GlobalObject)Context.getGlobalTrusted()).wrapAsObject(obj);
     }
 
     /**
@@ -506,8 +493,7 @@
         MethodHandle guard = null;
 
         if (data.needsCallee()) {
-            final MethodHandle callHandle = getBestInvoker(type);
-
+            final MethodHandle callHandle = getBestInvoker(type, request.getArguments());
             if (NashornCallSiteDescriptor.isScope(desc)) {
                 // Make a handle that drops the passed "this" argument and substitutes either Global or Undefined
                 // (callee, this, args...) => (callee, args...)
@@ -525,13 +511,12 @@
                     if (ScriptFunctionData.isPrimitiveThis(request.getArguments()[1])) {
                         boundHandle = MH.filterArguments(boundHandle, 1, WRAPFILTER);
                     } else {
-                        guard = NashornGuards.getNonStrictFunctionGuard(this);
+                        guard = getNonStrictFunctionGuard(this);
                     }
                 }
             }
         } else {
-            final MethodHandle callHandle = getBestInvoker(type.dropParameterTypes(0, 1));
-
+            final MethodHandle callHandle = getBestInvoker(type.dropParameterTypes(0, 1), request.getArguments());
             if (NashornCallSiteDescriptor.isScope(desc)) {
                 // Make a handle that drops the passed "this" argument and substitutes either Global or Undefined
                 // (this, args...) => (args...)
@@ -545,7 +530,8 @@
         }
 
         boundHandle = pairArguments(boundHandle, type);
-        return new GuardedInvocation(boundHandle, guard == null ? NashornGuards.getFunctionGuard(this) : guard);
+
+        return new GuardedInvocation(boundHandle, guard == null ? getFunctionGuard(this) : guard);
    }
 
     /**
@@ -554,13 +540,50 @@
      * These don't want a callee parameter, so bind that. Name binding is optional.
      */
     MethodHandle getCallMethodHandle(final MethodType type, final String bindName) {
-        return pairArguments(bindToNameIfNeeded(bindToCalleeIfNeeded(getBestInvoker(type)), bindName), type);
+        return pairArguments(bindToNameIfNeeded(bindToCalleeIfNeeded(getBestInvoker(type, null)), bindName), type);
     }
 
     private static MethodHandle bindToNameIfNeeded(final MethodHandle methodHandle, final String bindName) {
         return bindName == null ? methodHandle : MH.insertArguments(methodHandle, 1, bindName);
     }
 
+    /**
+     * Get the guard that checks if a {@link ScriptFunction} is equal to
+     * a known ScriptFunction, using reference comparison
+     *
+     * @param function The ScriptFunction to check against. This will be bound to the guard method handle
+     *
+     * @return method handle for guard
+     */
+    private static MethodHandle getFunctionGuard(final ScriptFunction function) {
+        assert function.data != null;
+        return MH.insertArguments(IS_FUNCTION_MH, 1, function.data);
+    }
+
+    /**
+     * Get a guard that checks if a {@link ScriptFunction} is equal to
+     * a known ScriptFunction using reference comparison, and whether the type of
+     * the second argument (this-object) is not a JavaScript primitive type.
+     *
+     * @param function The ScriptFunction to check against. This will be bound to the guard method handle
+     *
+     * @return method handle for guard
+     */
+    private static MethodHandle getNonStrictFunctionGuard(final ScriptFunction function) {
+        assert function.data != null;
+        return MH.insertArguments(IS_NONSTRICT_FUNCTION, 2, function.data);
+    }
+
+    @SuppressWarnings("unused")
+    private static boolean isFunctionMH(final Object self, final ScriptFunctionData data) {
+        return self instanceof ScriptFunction && ((ScriptFunction)self).data == data;
+    }
+
+    @SuppressWarnings("unused")
+    private static boolean isNonStrictFunction(final Object self, final Object arg, final ScriptFunctionData data) {
+        return self instanceof ScriptFunction && ((ScriptFunction)self).data == data && arg instanceof ScriptObject;
+    }
+
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
         final Class<?>   own = ScriptFunction.class;
         final MethodType mt  = MH.type(rtype, types);
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java	Fri Apr 05 14:51:24 2013 -0700
@@ -32,227 +32,94 @@
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
-import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.parser.Token;
-import jdk.nashorn.internal.parser.TokenType;
+
+import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
 
 /**
  * A container for data needed to instantiate a specific {@link ScriptFunction} at runtime.
  * Instances of this class are created during codegen and stored in script classes'
  * constants array to reduce function instantiation overhead during runtime.
  */
-public final class ScriptFunctionData {
-    private static final MethodHandle BIND_VAR_ARGS = findOwnMH("bindVarArgs", Object[].class, Object[].class, Object[].class);
-    private static final MethodHandle NEWFILTER     = findOwnMH("newFilter", Object.class, Object.class, Object.class);
-
-    // per-function object flags
-    private static final int IS_STRICT      = 0b0000_0001;
-    private static final int IS_BUILTIN     = 0b0000_0010;
-    private static final int HAS_CALLEE     = 0b0000_0100;
-    private static final int IS_VARARGS     = 0b0000_1000;
-    private static final int IS_CONSTRUCTOR = 0b0001_0000;
+public abstract class ScriptFunctionData {
 
-    /** Name of the function or "" */
-    private final String name;
-    /** Source of this function, or null */
-    private final Source source;
-    /** Map for new instance constructor */
-    private PropertyMap  allocatorMap;
-    /** Start position and length in source */
-    private final long   token;
-    /** Number of expected arguments, either taken from FunctionNode or calculated from method handle signature*/
-    private int          arity;
-    private final int    flags;
+    /** Name of the function or "" for anonynous functions */
+    protected final String name;
+
+    /** All versions of this function that have been generated to code */
+    protected final CompiledFunctions code;
 
-    /** Reference to code for this method. */
-    private MethodHandle invoker;
-    /** Reference to code for this method when called to create "new" object. This must always be populated with a
-     * result of calling {@link #composeConstructor(MethodHandle)} on the value of the {@link #invoker} field. */
-    private MethodHandle constructor;
-    /** Constructor to create a new instance. */
-    private MethodHandle allocator;
-    /** Generic invoker to used in {@link ScriptFunction#invoke(Object, Object...)}. */
-    private MethodHandle genericInvoker;
-    /** Specializations - see @SpecializedFunction */
-    private MethodHandle[] invokeSpecializations;
-    /** Specializations - see @SpecializedFunction. Same restrictions as for {@link #constructor} apply; only populate
-     * with method handles returned from {@link #composeConstructor(MethodHandle)}. */
-    private MethodHandle[] constructSpecializations;
+    private int arity;
+
+    private final boolean isStrict;
 
-    /**
-     * Constructor
-     * @param fn the function node
-     * @param allocatorMap the allocator property map
-     */
-    public ScriptFunctionData(final FunctionNode fn, final PropertyMap allocatorMap) {
+    private final boolean isBuiltin;
 
-        final long firstToken = fn.getFirstToken();
-        final long lastToken  = fn.getLastToken();
-        final int  position   = Token.descPosition(firstToken);
-        final int  length     = Token.descPosition(lastToken) - position + Token.descLength(lastToken);
+    private final boolean isConstructor;
 
-        this.name         = fn.isAnonymous() ? "" : fn.getIdent().getName();
-        this.source       = fn.getSource();
-        this.allocatorMap = allocatorMap;
-        this.token        = Token.toDesc(TokenType.FUNCTION, position, length);
-        this.arity        = fn.getParameters().size();
-        this.flags        = makeFlags(fn.needsCallee(), fn.isVarArg(), fn.isStrictMode(), false, true);
-    }
+    private static final MethodHandle NEWFILTER     = findOwnMH("newFilter", Object.class, Object.class, Object.class);
+    private static final MethodHandle BIND_VAR_ARGS = findOwnMH("bindVarArgs", Object[].class, Object[].class, Object[].class);
 
     /**
      * Constructor
      *
-     * @param name the function name
-     * @param methodHandle the method handle
-     * @param specs array of specialized method handles
-     * @param strict strict flag
-     * @param builtin builtin flag
-     * @param isConstructor constructor flags
+     * @param name          script function name
+     * @param arity         arity
+     * @param isStrict      is the function strict
+     * @param isBuiltin     is the function built in
+     * @param isConstructor is the function a constructor
      */
-    public ScriptFunctionData(final String name, final MethodHandle methodHandle, final MethodHandle[] specs, final boolean strict, final boolean builtin, final boolean isConstructor) {
-        this(name, null, 0L, methodHandle, specs, strict, builtin, isConstructor);
+    protected ScriptFunctionData(final String name, final int arity, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor) {
+        this.name          = name;
+        this.arity         = arity;
+        this.code          = new CompiledFunctions();
+        this.isStrict      = isStrict;
+        this.isBuiltin     = isBuiltin;
+        this.isConstructor = isConstructor;
     }
 
-    private ScriptFunctionData(final String name, final Source source, final long token, final MethodHandle methodHandle, final MethodHandle[] specs, final boolean strict, final boolean builtin, final boolean isConstructor) {
-        this.name   = name;
-        this.source = source;
-        this.token  = token;
-
-        final boolean isVarArg = isVarArg(methodHandle);
-        final boolean needsCallee = needsCallee(methodHandle);
-
-        this.flags = makeFlags(needsCallee, isVarArg, strict, builtin, isConstructor);
-        int lArity = isVarArg ? -1 : methodHandle.type().parameterCount() - 1; //drop the self param for arity
-
-        if (needsCallee && !isVarArg) {
-            lArity--;
-        }
-
-        if (isConstructor(methodHandle)) {
-            assert isConstructor;
-            if (!isVarArg) {
-                lArity--;    // drop the boolean flag for arity
-            }
-            /*
-             * We insert a boolean argument to tell if the method was invoked as constructor or not if the method
-             * handle's first argument is boolean.
-             */
-            this.invoker     = MH.insertArguments(methodHandle, 0, false);
-            this.constructor = composeConstructor(MH.insertArguments(methodHandle, 0, true));
-
-            if (specs != null) {
-                this.invokeSpecializations    = new MethodHandle[specs.length];
-                this.constructSpecializations = new MethodHandle[specs.length];
-                for (int i = 0; i < specs.length; i++) {
-                    this.invokeSpecializations[i]    = MH.insertArguments(specs[i], 0, false);
-                    this.constructSpecializations[i] = composeConstructor(MH.insertArguments(specs[i], 0, true));
-                }
-            }
-        } else {
-            this.invoker                  = methodHandle;
-            this.constructor              = null; // delay composition of the constructor
-            this.invokeSpecializations    = specs;
-            this.constructSpecializations = null; // delay composition of the constructors
-        }
-        this.arity = lArity;
-    }
-
-    /**
-     * Get the arity of the function.
-     * @return the arity
-     */
-    int getArity() {
+    final int getArity() {
         return arity;
     }
 
     /**
-     * Set the arity of the function.
-     * @param arity the arity
+     * Used from e.g. Native*$Constructors as an explicit call. TODO - make arity immutable and final
+     * @param arity new arity
      */
-    void setArity(int arity) {
+    void setArity(final int arity) {
         this.arity = arity;
     }
 
-    /**
-     * Get the function name.
-     * @return function name
-     */
-    String getName() {
-        return name;
+    CompiledFunction bind(final CompiledFunction originalInv, final ScriptFunction fn, final Object self, final Object[] args) {
+        final MethodHandle boundInvoker = bindInvokeHandle(originalInv.getInvoker(), fn, self, args);
+
+        if (isConstructor()) {
+            ensureConstructor(originalInv);
+            return new CompiledFunction(boundInvoker, bindConstructHandle(originalInv.getConstructor(), fn, args));
+        }
+
+        return new CompiledFunction(boundInvoker);
     }
 
     /**
-     * Get this function as a String containing its source code. If no source code
-     * exists in this ScriptFunction, its contents will be displayed as {@code [native code]}
-     * @return string representation of this function's source
+     * Is this a ScriptFunction generated with strict semantics?
+     * @return true if strict, false otherwise
      */
-    String toSource() {
-        if (source != null && token != 0) {
-            return source.getString(Token.descPosition(token), Token.descLength(token));
-        }
-
-        return "function " + (name == null ? "" : name) + "() { [native code] }";
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder();
-
-        sb.append(super.toString())
-                .append(" [ ")
-                .append(invoker)
-                .append(", ")
-                .append((name == null || name.isEmpty()) ? "<anonymous>" : name);
-
-        if (source != null) {
-            sb.append(" @ ")
-                    .append(source.getName())
-                    .append(':')
-                    .append(source.getLine(Token.descPosition(token)));
-        }
-        sb.append(" ]");
-
-        return sb.toString();
+    public boolean isStrict() {
+        return isStrict;
     }
 
-    /**
-     * Returns true if the function needs a callee argument.
-     * @return the needsCallee flag
-     */
-    boolean needsCallee() {
-        return (flags & HAS_CALLEE) != 0;
-    }
-
-    /**
-     * Returns true if this is a strict-mode function.
-     * @return the strict flag
-     */
-    public boolean isStrict() {
-        return (flags & IS_STRICT) != 0;
+    boolean isBuiltin() {
+        return isBuiltin;
     }
 
-    /**
-     * Returns true if this is a built-in function.
-     * @return the built-in flag
-     */
-    private boolean isBuiltin() {
-        return (flags & IS_BUILTIN) != 0;
+    boolean isConstructor() {
+        return isConstructor;
     }
 
-    /**
-     * Returns true if this function can be used as a constructor.
-     * @return the constructor flag
-     */
-    private boolean isConstructor() {
-        return (flags & IS_CONSTRUCTOR) != 0;
-    }
-
-    /**
-     * Returns true if this is a var-arg function.
-     * @return the var-arg flag
-     */
-    private boolean isVarArg() {
-        return (flags & IS_VARARGS) != 0;
+    boolean needsCallee() {
+        // we don't know if we need a callee or not unless we are generated
+        ensureCodeGenerated();
+        return code.needsCallee();
     }
 
     /**
@@ -261,127 +128,408 @@
      * @return true if this argument must be an object
      */
     boolean needsWrappedThis() {
-        return (flags & (IS_STRICT | IS_BUILTIN)) == 0;
+        return !isStrict && !isBuiltin;
+    }
+
+    String toSource() {
+        return "function " + (name == null ? "" : name) + "() { [native code] }";
+    }
+
+    String getName() {
+        return name;
+    }
+
+    /**
+     * Get this function as a String containing its source code. If no source code
+     * exists in this ScriptFunction, its contents will be displayed as {@code [native code]}
+     *
+     * @return string representation of this function
+     */
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+
+        sb.append("name='").
+                append(name.isEmpty() ? "<anonymous>" : name).
+                append("' ").
+                append(code.size()).
+                append(" invokers=").
+                append(code);
+
+        return sb.toString();
     }
 
     /**
-     * Get the method handle used to invoke this function.
-     * @return the invoke handle
+     * Pick the best invoker, i.e. the one version of this method with as narrow and specific
+     * types as possible. If the call site arguments are objects, but boxed primitives we can
+     * also try to get a primitive version of the method and do an unboxing filter, but then
+     * we need to insert a guard that checks the argument is really always a boxed primitive
+     * and not suddenly a "real" object
+     *
+     * @param callSiteType callsite type
+     * @param args         arguments at callsite on first trampoline invocation
+     * @return method handle to best invoker
      */
-    MethodHandle getInvoker() {
-        return invoker;
+    MethodHandle getBestInvoker(final MethodType callSiteType, final Object[] args) {
+        return getBest(callSiteType).getInvoker();
     }
 
-    MethodHandle getBestInvoker(final MethodType type) {
-        return SpecializedMethodChooser.candidateWithLowestWeight(type, invoker, invokeSpecializations);
+    MethodHandle getBestInvoker(final MethodType callSiteType) {
+        return getBestInvoker(callSiteType, null);
+    }
+
+    MethodHandle getBestConstructor(final MethodType callSiteType, final Object[] args) {
+        if (!isConstructor()) {
+            throw typeError("not.a.constructor", toSource());
+        }
+        ensureCodeGenerated();
+
+        final CompiledFunction best = getBest(callSiteType);
+        ensureConstructor(best);
+        return best.getConstructor();
+    }
+
+    MethodHandle getBestConstructor(final MethodType callSiteType) {
+        return getBestConstructor(callSiteType, null);
     }
 
     /**
-     * Get the method handle used to invoke this function as a constructor.
-     * @return the constructor handle
+     * Subclass responsibility. If we can have lazy code generation, this is a hook to ensure that
+     * code exists before performing an operation.
      */
-    private MethodHandle getConstructor() {
-        if (constructor == null) {
-            constructor = composeConstructor(invoker);
-        }
+    protected void ensureCodeGenerated() {
+        //empty
+    }
 
-        return constructor;
+    /**
+     * Return a generic Object/Object invoker for this method. It will ensure code
+     * is generated, get the most generic of all versions of this function and adapt it
+     * to Objects.
+     *
+     * TODO this is only public because {@link JavaAdapterFactory} can't supply us with
+     * a MethodType that we can use for lookup due to boostrapping problems. Can be fixed
+     *
+     * @return generic invoker of this script function
+     */
+    public final MethodHandle getGenericInvoker() {
+        ensureCodeGenerated();
+        return composeGenericMethod(code.mostGeneric().getInvoker());
+    }
+
+    private CompiledFunction getBest(final MethodType callSiteType) {
+        ensureCodeGenerated();
+        return code.best(callSiteType);
     }
 
-    MethodHandle getBestConstructor(MethodType descType) {
-        if (!isConstructor()) {
-            throw typeError("not.a.constructor", toSource());
-        }
-        return SpecializedMethodChooser.candidateWithLowestWeight(descType, getConstructor(), getConstructSpecializations());
+    /**
+     * Allocates an object using this function's allocator.
+     * @return the object allocated using this function's allocator, or null if the function doesn't have an allocator.
+     */
+    ScriptObject allocate() {
+        return null;
     }
 
-    private MethodHandle composeConstructor(MethodHandle ctor) {
+    /**
+     * This method is used to create the immutable portion of a bound function.
+     * See {@link ScriptFunction#makeBoundFunction(Object, Object[])}
+     *
+     * @param fn the original function being bound
+     * @param self this reference to bind. Can be null.
+     * @param args additional arguments to bind. Can be null.
+     */
+    ScriptFunctionData makeBoundFunctionData(final ScriptFunction fn, final Object self, final Object[] args) {
+        ensureCodeGenerated();
+
+        final Object[] allArgs = args == null ? ScriptRuntime.EMPTY_ARRAY : args;
+        final int length = args == null ? 0 : args.length;
+
+        CompiledFunctions boundList = new CompiledFunctions();
+        for (final CompiledFunction inv : code) {
+            boundList.add(bind(inv, fn, self, allArgs));
+        }
+        ScriptFunctionData boundData = new FinalScriptFunctionData(name, arity == -1 ? -1 : Math.max(0, arity - length), boundList, isStrict(), isBuiltin(), isConstructor());
+        return boundData;
+    }
+
+    /**
+     * Compose a constructor given a primordial constructor handle
+     *
+     * @param ctor         primordial constructor handle
+     * @param needsCallee  do we need to pass a callee
+     *
+     * @return the composed constructor
+     */
+    protected MethodHandle composeConstructor(final MethodHandle ctor, final boolean needsCallee) {
         // If it was (callee, this, args...), permute it to (this, callee, args...). We're doing this because having
         // "this" in the first argument position is what allows the elegant folded composition of
         // (newFilter x constructor x allocator) further down below in the code. Also, ensure the composite constructor
         // always returns Object.
-        MethodHandle composedCtor = changeReturnTypeToObject(swapCalleeAndThis(ctor));
+        MethodHandle composedCtor = needsCallee ? swapCalleeAndThis(ctor) : ctor;
+
+        composedCtor = changeReturnTypeToObject(composedCtor);
 
         final MethodType ctorType = composedCtor.type();
+
         // Construct a dropping type list for NEWFILTER, but don't include constructor "this" into it, so it's actually
         // captured as "allocation" parameter of NEWFILTER after we fold the constructor into it.
         // (this, [callee, ]args...) => ([callee, ]args...)
         final Class<?>[] ctorArgs = ctorType.dropParameterTypes(0, 1).parameterArray();
+
         // Fold constructor into newFilter that replaces the return value from the constructor with the originally
         // allocated value when the originally allocated value is a primitive.
         // (result, this, [callee, ]args...) x (this, [callee, ]args...) => (this, [callee, ]args...)
         composedCtor = MH.foldArguments(MH.dropArguments(NEWFILTER, 2, ctorArgs), composedCtor);
 
         // allocate() takes a ScriptFunction and returns a newly allocated ScriptObject...
-        if (needsCallee()) {
+        if (needsCallee) {
             // ...we either fold it into the previous composition, if we need both the ScriptFunction callee object and
             // the newly allocated object in the arguments, so (this, callee, args...) x (callee) => (callee, args...),
             // or...
             return MH.foldArguments(composedCtor, ScriptFunction.ALLOCATE);
         }
+
         // ...replace the ScriptFunction argument with the newly allocated object, if it doesn't need the callee
         // (this, args...) filter (callee) => (callee, args...)
         return MH.filterArguments(composedCtor, 0, ScriptFunction.ALLOCATE);
     }
 
     /**
-     * Get an adapted version of the invoker handle that only uses {@code Object} as parameter and return types.
-     * @return the generic invoke handle
+     * If this function's method handles need a callee parameter, swap the order of first two arguments for the passed
+     * method handle. If this function's method handles don't need a callee parameter, returns the original method
+     * handle unchanged.
+     *
+     * @param mh a method handle with order of arguments {@code (callee, this, args...)}
+     *
+     * @return a method handle with order of arguments {@code (this, callee, args...)}
+     */
+    private static MethodHandle swapCalleeAndThis(final MethodHandle mh) {
+        final MethodType type = mh.type();
+        assert type.parameterType(0) == ScriptFunction.class : type;
+        assert type.parameterType(1) == Object.class : type;
+        final MethodType newType = type.changeParameterType(0, Object.class).changeParameterType(1, ScriptFunction.class);
+        final int[] reorder = new int[type.parameterCount()];
+        reorder[0] = 1;
+        assert reorder[1] == 0;
+        for (int i = 2; i < reorder.length; ++i) {
+            reorder[i] = i;
+        }
+        return MethodHandles.permuteArguments(mh, newType, reorder);
+    }
+
+    /**
+     * Convert this argument for non-strict functions according to ES 10.4.3
+     *
+     * @param thiz the this argument
+     *
+     * @return the converted this object
+     */
+    private Object convertThisObject(final Object thiz) {
+        if (!(thiz instanceof ScriptObject) && needsWrappedThis()) {
+            if (JSType.nullOrUndefined(thiz)) {
+                return Context.getGlobalTrusted();
+            }
+
+            if (isPrimitiveThis(thiz)) {
+                return ((GlobalObject)Context.getGlobalTrusted()).wrapAsObject(thiz);
+            }
+        }
+
+        return thiz;
+    }
+
+    static boolean isPrimitiveThis(final Object obj) {
+        return obj instanceof String || obj instanceof ConsString ||
+               obj instanceof Number || obj instanceof Boolean;
+    }
+
+    /**
+     * Creates an invoker method handle for a bound function.
+     *
+     * @param targetFn the function being bound
+     * @param originalInvoker an original invoker method handle for the function. This can be its generic invoker or
+     * any of its specializations.
+     * @param self the "this" value being bound
+     * @param args additional arguments being bound
+     *
+     * @return a bound invoker method handle that will bind the self value and the specified arguments. The resulting
+     * invoker never needs a callee; if the original invoker needed it, it will be bound to {@code fn}. The resulting
+     * invoker still takes an initial {@code this} parameter, but it is always dropped and the bound {@code self} passed
+     * to the original invoker on invocation.
      */
-    private MethodHandle getGenericInvoker() {
-        if (genericInvoker == null) {
-            assert invoker != null : "invoker is null";
-            genericInvoker = makeGenericMethod(invoker);
+    private MethodHandle bindInvokeHandle(final MethodHandle originalInvoker, final ScriptFunction targetFn, final Object self, final Object[] args) {
+        // Is the target already bound? If it is, we won't bother binding either callee or self as they're already bound
+        // in the target and will be ignored anyway.
+        final boolean isTargetBound = targetFn.isBoundFunction();
+
+        final boolean needsCallee = needsCallee(originalInvoker);
+        assert needsCallee == needsCallee() : "callee contract violation 2";
+        assert !(isTargetBound && needsCallee); // already bound functions don't need a callee
+
+        final Object boundSelf = isTargetBound ? null : convertThisObject(self);
+        final MethodHandle boundInvoker;
+
+        if (isVarArg(originalInvoker)) {
+            // First, bind callee and this without arguments
+            final MethodHandle noArgBoundInvoker;
+
+            if (isTargetBound) {
+                // Don't bind either callee or this
+                noArgBoundInvoker = originalInvoker;
+            } else if (needsCallee) {
+                // Bind callee and this
+                noArgBoundInvoker = MH.insertArguments(originalInvoker, 0, targetFn, boundSelf);
+            } else {
+                // Only bind this
+                noArgBoundInvoker = MH.bindTo(originalInvoker, boundSelf);
+            }
+            // Now bind arguments
+            if (args.length > 0) {
+                boundInvoker = varArgBinder(noArgBoundInvoker, args);
+            } else {
+                boundInvoker = noArgBoundInvoker;
+            }
+        } else {
+            final Object[] boundArgs = new Object[Math.min(originalInvoker.type().parameterCount(), args.length + (isTargetBound ? 0 : (needsCallee  ? 2 : 1)))];
+            int next = 0;
+            if (!isTargetBound) {
+                if (needsCallee) {
+                    boundArgs[next++] = targetFn;
+                }
+                boundArgs[next++] = boundSelf;
+            }
+            // If more bound args were specified than the function can take, we'll just drop those.
+            System.arraycopy(args, 0, boundArgs, next, boundArgs.length - next);
+            // If target is already bound, insert additional bound arguments after "this" argument, at position 1;
+            // "this" will get dropped anyway by the target invoker. We previously asserted that already bound functions
+            // don't take a callee parameter, so we can know that the signature is (this[, args...]) therefore args
+            // start at position 1. If the function is not bound, we start inserting arguments at position 0.
+            boundInvoker = MH.insertArguments(originalInvoker, isTargetBound ? 1 : 0, boundArgs);
+        }
+
+        if (isTargetBound) {
+            return boundInvoker;
         }
-        return genericInvoker;
+
+        // If the target is not already bound, add a dropArguments that'll throw away the passed this
+        return MH.dropArguments(boundInvoker, 0, Object.class);
+    }
+
+    /**
+     * Creates a constructor method handle for a bound function using the passed constructor handle.
+     *
+     * @param originalConstructor the constructor handle to bind. It must be a composed constructor.
+     * @param fn the function being bound
+     * @param args arguments being bound
+     *
+     * @return a bound constructor method handle that will bind the specified arguments. The resulting constructor never
+     * needs a callee; if the original constructor needed it, it will be bound to {@code fn}. The resulting constructor
+     * still takes an initial {@code this} parameter and passes it to the underlying original constructor. Finally, if
+     * this script function data object has no constructor handle, null is returned.
+     */
+    private static MethodHandle bindConstructHandle(final MethodHandle originalConstructor, final ScriptFunction fn, final Object[] args) {
+        assert originalConstructor != null;
+
+        // If target function is already bound, don't bother binding the callee.
+        final MethodHandle calleeBoundConstructor = fn.isBoundFunction() ? originalConstructor :
+            MH.dropArguments(MH.bindTo(originalConstructor, fn), 0, ScriptFunction.class);
+
+        if (args.length == 0) {
+            return calleeBoundConstructor;
+        }
+
+        if (isVarArg(calleeBoundConstructor)) {
+            return varArgBinder(calleeBoundConstructor, args);
+        }
+
+        final Object[] boundArgs;
+
+        final int maxArgCount = calleeBoundConstructor.type().parameterCount() - 1;
+        if (args.length <= maxArgCount) {
+            boundArgs = args;
+        } else {
+            boundArgs = new Object[maxArgCount];
+            System.arraycopy(args, 0, boundArgs, 0, maxArgCount);
+        }
+
+        return MH.insertArguments(calleeBoundConstructor, 1, boundArgs);
+    }
+
+    /**
+     * Takes a method handle, and returns a potentially different method handle that can be used in
+     * {@code ScriptFunction#invoke(Object, Object...)} or {code ScriptFunction#construct(Object, Object...)}.
+     * The returned method handle will be sure to return {@code Object}, and will have all its parameters turned into
+     * {@code Object} as well, except for the following ones:
+     * <ul>
+     *   <li>a last parameter of type {@code Object[]} which is used for vararg functions,</li>
+     *   <li>the first argument, which is forced to be {@link ScriptFunction}, in case the function receives itself
+     *   (callee) as an argument.</li>
+     * </ul>
+     *
+     * @param mh the original method handle
+     *
+     * @return the new handle, conforming to the rules above.
+     */
+    protected MethodHandle composeGenericMethod(final MethodHandle mh) {
+        final MethodType type = mh.type();
+        MethodType newType = type.generic();
+        if (isVarArg(mh)) {
+            newType = newType.changeParameterType(type.parameterCount() - 1, Object[].class);
+        }
+        if (needsCallee(mh)) {
+            newType = newType.changeParameterType(0, ScriptFunction.class);
+        }
+        return type.equals(newType) ? mh : mh.asType(newType);
     }
 
     /**
      * Execute this script function.
+     *
      * @param self  Target object.
      * @param arguments  Call arguments.
      * @return ScriptFunction result.
+     *
      * @throws Throwable if there is an exception/error with the invocation or thrown from it
      */
     Object invoke(final ScriptFunction fn, final Object self, final Object... arguments) throws Throwable {
-        final MethodHandle genInvoker = getGenericInvoker();
-        final Object selfObj = convertThisObject(self);
-        final Object[] args = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
+        final MethodHandle mh = getGenericInvoker();
+
+        final Object       selfObj    = convertThisObject(self);
+        final Object[]     args       = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
 
-        if (isVarArg()) {
-            if (needsCallee()) {
-                return genInvoker.invokeExact(fn, selfObj, args);
+        if (isVarArg(mh)) {
+            if (needsCallee(mh)) {
+                return mh.invokeExact(fn, selfObj, args);
             }
-            return genInvoker.invokeExact(selfObj, args);
+            return mh.invokeExact(selfObj, args);
         }
 
-        final int paramCount = genInvoker.type().parameterCount();
-        if (needsCallee()) {
+        final int paramCount = mh.type().parameterCount();
+        if (needsCallee(mh)) {
             switch (paramCount) {
             case 2:
-                return genInvoker.invokeExact(fn, selfObj);
+                return mh.invokeExact(fn, selfObj);
             case 3:
-                return genInvoker.invokeExact(fn, selfObj, getArg(args, 0));
+                return mh.invokeExact(fn, selfObj, getArg(args, 0));
             case 4:
-                return genInvoker.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1));
+                return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1));
             case 5:
-                return genInvoker.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2));
+                return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2));
             default:
-                return genInvoker.invokeWithArguments(withArguments(fn, selfObj, paramCount, args));
+                return mh.invokeWithArguments(withArguments(fn, selfObj, paramCount, args));
             }
         }
 
         switch (paramCount) {
         case 1:
-            return genInvoker.invokeExact(selfObj);
+            return mh.invokeExact(selfObj);
         case 2:
-            return genInvoker.invokeExact(selfObj, getArg(args, 0));
+            return mh.invokeExact(selfObj, getArg(args, 0));
         case 3:
-            return genInvoker.invokeExact(selfObj, getArg(args, 0), getArg(args, 1));
+            return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1));
         case 4:
-            return genInvoker.invokeExact(selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2));
+            return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2));
         default:
-            return genInvoker.invokeWithArguments(withArguments(null, selfObj, paramCount, args));
+            return mh.invokeWithArguments(withArguments(null, selfObj, paramCount, args));
         }
     }
 
@@ -389,15 +537,13 @@
         return i < args.length ? args[i] : UNDEFINED;
     }
 
-    private Object[] withArguments(final ScriptFunction fn, final Object self, final int argCount, final Object[] args) {
+    private static Object[] withArguments(final ScriptFunction fn, final Object self, final int argCount, final Object[] args) {
         final Object[] finalArgs = new Object[argCount];
 
         int nextArg = 0;
-        if (needsCallee()) {
-            assert fn != null;
+        if (fn != null) {
+            //needs callee
             finalArgs[nextArg++] = fn;
-        } else {
-            assert fn == null;
         }
         finalArgs[nextArg++] = self;
 
@@ -413,255 +559,14 @@
 
         return finalArgs;
     }
-
-    /**
-     * Get the specialized construct handles for this function.
-     * @return array of specialized construct handles
-     */
-    private MethodHandle[] getConstructSpecializations() {
-        if(constructSpecializations == null && invokeSpecializations != null) {
-            final MethodHandle[] ctors = new MethodHandle[invokeSpecializations.length];
-            for(int i = 0; i < ctors.length; ++i) {
-                ctors[i] = composeConstructor(invokeSpecializations[i]);
-            }
-            constructSpecializations = ctors;
-        }
-        return constructSpecializations;
-    }
-
-    /**
-     * Set the method handles for this function.
-     * @param invoker the invoker handle
-     * @param allocator the allocator handle
-     */
-    public void setMethodHandles(final MethodHandle invoker, final MethodHandle allocator) {
-        // We can't make method handle fields final because they're not available during codegen
-        // and they're set when first called, so we enforce set-once here.
-        if (this.invoker == null) {
-            this.invoker     = invoker;
-            this.constructor = null; // delay constructor composition
-            this.allocator   = allocator;
-        }
-    }
-
-    /**
-     * Used by the trampoline. Must not be any wider than package
-     * private
-     * @param invoker new invoker
-     */
-    void resetInvoker(final MethodHandle invoker) {
-        this.invoker     = invoker;
-        this.constructor = null; //delay constructor composition
-    }
-
-    /**
-     * Allocates an object using this function's allocator.
-     * @return the object allocated using this function's allocator, or null if the function doesn't have an allocator.
-     */
-    ScriptObject allocate() {
-        if (allocator == null) {
-            return null;
-        }
-
-        try {
-            return (ScriptObject)allocator.invokeExact(allocatorMap);
-        } catch (final RuntimeException | Error e) {
-            throw e;
-        } catch (final Throwable t) {
-            throw new RuntimeException(t);
-        }
-    }
-
-    /**
-     * This method is used to create the immutable portion of a bound function.
-     * See {@link ScriptFunction#makeBoundFunction(Object, Object[])}
-     *
-     * @param fn the original function being bound
-     * @param self this reference to bind. Can be null.
-     * @param args additional arguments to bind. Can be null.
-     */
-    ScriptFunctionData makeBoundFunctionData(final ScriptFunction fn, final Object self, final Object[] args) {
-        final Object[] allArgs = args == null ? ScriptRuntime.EMPTY_ARRAY : args;
-
-        final boolean isConstructor = isConstructor();
-        // Note that the new ScriptFunctionData's method handle will not need a callee regardless of whether the
-        // original did.
-        final ScriptFunctionData boundData = new ScriptFunctionData(name, source, token,
-                bindInvokeHandle(invoker, fn, self, allArgs), bindInvokeSpecializations(fn, self, allArgs), isStrict(), isBuiltin(), isConstructor);
-        if(isConstructor) {
-            // Can't just rely on bound invoke as a basis for constructor, as it ignores the passed "this" in favor of the
-            // bound "this"; constructor on the other hand must see the actual "this" received from the allocator.
-
-            // Binding a function will force constructor composition in getConstructor(); not really any way around that
-            // as it's the composed constructor that has to be bound to the function.
-            boundData.constructor = bindConstructHandle(getConstructor(), fn, allArgs);
-            boundData.constructSpecializations = bindConstructorSpecializations(fn, allArgs);
-        }
-        assert boundData.allocator == null;
-        final int thisArity = getArity();
-        if(thisArity != -1) {
-            boundData.setArity(Math.max(0, thisArity - args.length));
-        } else {
-            assert boundData.getArity() == -1;
-        }
-        return boundData;
-    }
-
-    /**
-     * Convert this argument for non-strict functions according to ES 10.4.3
-     *
-     * @param thiz the this argument
-     *
-     * @return the converted this object
-     */
-    Object convertThisObject(final Object thiz) {
-        if (!(thiz instanceof ScriptObject) && needsWrappedThis()) {
-            if (JSType.nullOrUndefined(thiz)) {
-                return Context.getGlobalTrusted();
-            }
-
-            if (isPrimitiveThis(thiz)) {
-                return ((GlobalObject)Context.getGlobalTrusted()).wrapAsObject(thiz);
-            }
-        }
-
-        return thiz;
-    }
-
-    static boolean isPrimitiveThis(Object obj) {
-        return obj instanceof String || obj instanceof ConsString ||
-               obj instanceof Number || obj instanceof Boolean;
-    }
-
-    /**
-     * Creates an invoker method handle for a bound function.
-     * @param targetFn the function being bound
-     * @param originalInvoker an original invoker method handle for the function. This can be its generic invoker or
-     * any of its specializations.
-     * @param self the "this" value being bound
-     * @param args additional arguments being bound
-     * @return a bound invoker method handle that will bind the self value and the specified arguments. The resulting
-     * invoker never needs a callee; if the original invoker needed it, it will be bound to {@code fn}. The resulting
-     * invoker still takes an initial {@code this} parameter, but it is always dropped and the bound {@code self} passed
-     * to the original invoker on invocation.
-     */
-    private MethodHandle bindInvokeHandle(final MethodHandle originalInvoker, final ScriptFunction targetFn, final Object self, final Object[] args) {
-        // Is the target already bound? If it is, we won't bother binding either callee or self as they're already bound
-        // in the target and will be ignored anyway.
-        final boolean isTargetBound = targetFn.isBoundFunction();
-        assert !(isTargetBound && needsCallee()); // already bound functions don't need a callee
-        final Object boundSelf = isTargetBound ? null : convertThisObject(self);
-        final MethodHandle boundInvoker;
-        if(isVarArg(originalInvoker)) {
-            // First, bind callee and this without arguments
-            final MethodHandle noArgBoundInvoker;
-            if(isTargetBound) {
-                // Don't bind either callee or this
-                noArgBoundInvoker = originalInvoker;
-            } else if(needsCallee()) {
-                // Bind callee and this
-                noArgBoundInvoker = MH.insertArguments(originalInvoker, 0, targetFn, boundSelf);
-            } else {
-                // Only bind this
-                noArgBoundInvoker = MH.bindTo(originalInvoker, boundSelf);
-            }
-            // Now bind arguments
-            if(args.length > 0) {
-                boundInvoker = varArgBinder(noArgBoundInvoker, args);
-            } else {
-                boundInvoker = noArgBoundInvoker;
-            }
-        } else {
-            final Object[] boundArgs = new Object[Math.min(originalInvoker.type().parameterCount(),
-                    args.length + (isTargetBound ? 0 : (needsCallee() ? 2 : 1)))];
-            int next = 0;
-            if(!isTargetBound) {
-                if(needsCallee()) {
-                    boundArgs[next++] = targetFn;
-                }
-                boundArgs[next++] = boundSelf;
-            }
-            // If more bound args were specified than the function can take, we'll just drop those.
-            System.arraycopy(args, 0, boundArgs, next, boundArgs.length - next);
-            // If target is already bound, insert additional bound arguments after "this" argument, at position 1;
-            // "this" will get dropped anyway by the target invoker. We previously asserted that already bound functions
-            // don't take a callee parameter, so we can know that the signature is (this[, args...]) therefore args
-            // start at position 1. If the function is not bound, we start inserting arguments at position 0.
-            boundInvoker = MH.insertArguments(originalInvoker, isTargetBound ? 1 : 0, boundArgs);
-        }
-        if(isTargetBound) {
-            return boundInvoker;
-        }
-        // If the target is not already bound, add a dropArguments that'll throw away the passed this
-        return MH.dropArguments(boundInvoker, 0, Object.class);
-    }
-
-    private MethodHandle[] bindInvokeSpecializations(final ScriptFunction fn, final Object self, final Object[] args) {
-        if(invokeSpecializations == null) {
-            return null;
-        }
-        final MethodHandle[] boundSpecializations = new MethodHandle[invokeSpecializations.length];
-        for(int i = 0; i < invokeSpecializations.length; ++i) {
-            boundSpecializations[i] = bindInvokeHandle(invokeSpecializations[i], fn, self, args);
-        }
-        return boundSpecializations;
-    }
-
-    /**
-     * Creates a constructor method handle for a bound function using the passed constructor handle.
-     * @param originalConstructor the constructor handle to bind. It must be a composed constructor.
-     * @param fn the function being bound
-     * @param args arguments being bound
-     * @return a bound constructor method handle that will bind the specified arguments. The resulting constructor never
-     * needs a callee; if the original constructor needed it, it will be bound to {@code fn}. The resulting constructor
-     * still takes an initial {@code this} parameter and passes it to the underlying original constructor. Finally, if
-     * this script function data object has no constructor handle, null is returned.
-     */
-    private static MethodHandle bindConstructHandle(final MethodHandle originalConstructor, final ScriptFunction fn, final Object[] args) {
-        if(originalConstructor == null) {
-            return null;
-        }
-
-        // If target function is already bound, don't bother binding the callee.
-        final MethodHandle calleeBoundConstructor = fn.isBoundFunction() ? originalConstructor :
-            MH.dropArguments(MH.bindTo(originalConstructor, fn), 0, ScriptFunction.class);
-        if(args.length == 0) {
-            return calleeBoundConstructor;
-        }
-
-        if(isVarArg(calleeBoundConstructor)) {
-            return varArgBinder(calleeBoundConstructor, args);
-        }
-
-        final Object[] boundArgs;
-        final int maxArgCount = calleeBoundConstructor.type().parameterCount() - 1;
-        if (args.length <= maxArgCount) {
-            boundArgs = args;
-        } else {
-            boundArgs = new Object[maxArgCount];
-            System.arraycopy(args, 0, boundArgs, 0, maxArgCount);
-        }
-        return MH.insertArguments(calleeBoundConstructor, 1, boundArgs);
-    }
-
-    private MethodHandle[] bindConstructorSpecializations(final ScriptFunction fn, final Object[] args) {
-        final MethodHandle[] ctorSpecs = getConstructSpecializations();
-        if(ctorSpecs == null) {
-            return null;
-        }
-        final MethodHandle[] boundSpecializations = new MethodHandle[ctorSpecs.length];
-        for(int i = 0; i < ctorSpecs.length; ++i) {
-            boundSpecializations[i] = bindConstructHandle(ctorSpecs[i], fn, args);
-        }
-        return boundSpecializations;
-    }
-
     /**
      * Takes a variable-arity method and binds a variable number of arguments in it. The returned method will filter the
      * vararg array and pass a different array that prepends the bound arguments in front of the arguments passed on
      * invocation
+     *
      * @param mh the handle
      * @param args the bound arguments
+     *
      * @return the bound method handle
      */
     private static MethodHandle varArgBinder(final MethodHandle mh, final Object[] args) {
@@ -671,41 +576,20 @@
     }
 
     /**
-     * Convert boolean flags to int.
-     * @param needsCallee needs-callee flag
-     * @param isVarArg var-arg flag
-     * @param isStrict strict flag
-     * @param isBuiltin builtin flag
-     * @return int flags
+     * Adapts the method handle so its return type is {@code Object}. If the handle's return type is already
+     * {@code Object}, the handle is returned unchanged.
+     *
+     * @param mh the handle to adapt
+     * @return the adapted handle
      */
-    private static int makeFlags(final boolean needsCallee, final boolean isVarArg, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor) {
-        int flags = 0;
-        if (needsCallee) {
-            flags |= HAS_CALLEE;
-        }
-        if (isVarArg) {
-            flags |= IS_VARARGS;
-        }
-        if (isStrict) {
-            flags |= IS_STRICT;
-        }
-        if (isBuiltin) {
-            flags |= IS_BUILTIN;
-        }
-        if (isConstructor) {
-            flags |= IS_CONSTRUCTOR;
-        }
-
-        return flags;
+    private static MethodHandle changeReturnTypeToObject(final MethodHandle mh) {
+        return MH.asType(mh, mh.type().changeReturnType(Object.class));
     }
 
-    /**
-     * Test if a methodHandle refers to a constructor.
-     * @param methodHandle MethodHandle to test.
-     * @return True if method is a constructor.
-     */
-    private static boolean isConstructor(final MethodHandle methodHandle) {
-        return methodHandle.type().parameterCount() >= 1 && methodHandle.type().parameterType(0) == boolean.class;
+    private void ensureConstructor(final CompiledFunction inv) {
+        if (!inv.hasConstructor()) {
+            inv.setConstructor(composeConstructor(inv.getInvoker(), needsCallee(inv.getInvoker())));
+        }
     }
 
     /**
@@ -713,102 +597,56 @@
      * {@code (boolean, Object, ScriptFunction, ...)} or {@code (Object, ScriptFunction, ...)}, then we'll assume it has
      * a callee argument. We need this as the constructor above is not passed this information, and can't just blindly
      * assume it's false (notably, it's being invoked for creation of new scripts, and scripts have scopes, therefore
-     * they also always receive a callee.
-     * @param methodHandle the examined method handle
+     * they also always receive a callee).
+     *
+     * @param mh the examined method handle
+     *
      * @return true if the method handle expects a callee, false otherwise
      */
-    private static boolean needsCallee(MethodHandle methodHandle) {
-        final MethodType type = methodHandle.type();
-        final int len = type.parameterCount();
-        if(len == 0) {
+    protected static boolean needsCallee(final MethodHandle mh) {
+        final MethodType type   = mh.type();
+        final int        length = type.parameterCount();
+
+        if (length == 0) {
             return false;
         }
-        if(type.parameterType(0) == boolean.class) {
-            return len > 1 && type.parameterType(1) == ScriptFunction.class;
+
+        if (type.parameterType(0) == boolean.class) {
+            return length > 1 && type.parameterType(1) == ScriptFunction.class;
         }
+
         return type.parameterType(0) == ScriptFunction.class;
     }
 
-    private static boolean isVarArg(MethodHandle methodHandle) {
-        final MethodType type = methodHandle.type();
-        return type.parameterType(type.parameterCount() - 1).isArray();
-    }
-
     /**
-     * Takes a method handle, and returns a potentially different method handle that can be used in
-     * {@link ScriptFunction#invoke(Object, Object...)} or {@link ScriptFunction#construct(Object, Object...)}.
-     * The returned method handle will be sure to return {@code Object}, and will have all its parameters turned into
-     * {@code Object} as well, except for the following ones:
-     * <ul>
-     *   <li>a last parameter of type {@code Object[]} which is used for vararg functions,</li>
-     *   <li>the first argument, which is forced to be {@link ScriptFunction}, in case the function receives itself
-     *   (callee) as an argument.</li>
-     * </ul>
+     * Check if a javascript function methodhandle is a vararg handle
      *
-     * @param handle the original method handle
-     * @return the new handle, conforming to the rules above.
+     * @param mh method handle to check
+     *
+     * @return true if vararg
      */
-    private MethodHandle makeGenericMethod(final MethodHandle handle) {
-        final MethodType type = handle.type();
-        MethodType newType = type.generic();
-        if (isVarArg()) {
-            newType = newType.changeParameterType(type.parameterCount() - 1, Object[].class);
-        }
-        if (needsCallee()) {
-            newType = newType.changeParameterType(0, ScriptFunction.class);
-        }
-        return type.equals(newType) ? handle : handle.asType(newType);
-    }
-
-    /**
-     * Adapts the method handle so its return type is {@code Object}. If the handle's return type is already
-     * {@code Object}, the handle is returned unchanged.
-     * @param mh the handle to adapt
-     * @return the adapted handle
-     */
-    private static MethodHandle changeReturnTypeToObject(final MethodHandle mh) {
-        return MH.asType(mh, mh.type().changeReturnType(Object.class));
-    }
-
-
-    /**
-     * If this function's method handles need a callee parameter, swap the order of first two arguments for the passed
-     * method handle. If this function's method handles don't need a callee parameter, returns the original method
-     * handle unchanged.
-     * @param mh a method handle with order of arguments {@code (callee, this, args...)}
-     * @return a method handle with order of arguments {@code (this, callee, args...)}
-     */
-    private MethodHandle swapCalleeAndThis(final MethodHandle mh) {
-        if (!needsCallee()) {
-            return mh;
-        }
+    protected static boolean isVarArg(final MethodHandle mh) {
         final MethodType type = mh.type();
-        assert type.parameterType(0) == ScriptFunction.class;
-        assert type.parameterType(1) == Object.class;
-        final MethodType newType = type.changeParameterType(0, Object.class).changeParameterType(1, ScriptFunction.class);
-        final int[] reorder = new int[type.parameterCount()];
-        reorder[0] = 1;
-        assert reorder[1] == 0;
-        for (int i = 2; i < reorder.length; ++i) {
-            reorder[i] = i;
-        }
-        return MethodHandles.permuteArguments(mh, newType, reorder);
+        return type.parameterType(type.parameterCount() - 1).isArray();
     }
 
     @SuppressWarnings("unused")
     private static Object[] bindVarArgs(final Object[] array1, final Object[] array2) {
-        if(array2 == null) {
+        if (array2 == null) {
             // Must clone it, as we can't allow the receiving method to alter the array
             return array1.clone();
         }
+
         final int l2 = array2.length;
-        if(l2 == 0) {
+        if (l2 == 0) {
             return array1.clone();
         }
+
         final int l1 = array1.length;
         final Object[] concat = new Object[l1 + l2];
         System.arraycopy(array1, 0, concat, 0, l1);
         System.arraycopy(array2, 0, concat, l1, l2);
+
         return concat;
     }
 
@@ -820,5 +658,4 @@
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
         return MH.findStatic(MethodHandles.lookup(), ScriptFunctionData.class, name, MH.type(rtype, types));
     }
-
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Fri Apr 05 14:51:24 2013 -0700
@@ -26,6 +26,7 @@
 package jdk.nashorn.internal.runtime;
 
 import java.security.CodeSource;
+import java.security.ProtectionDomain;
 
 /**
  * Responsible for loading script generated classes.
@@ -57,6 +58,9 @@
      * @return Installed class.
      */
     synchronized Class<?> installClass(final String name, final byte[] data, final CodeSource cs) {
+        if (cs == null) {
+            return defineClass(name, data, 0, data.length, new ProtectionDomain(null, getPermissions(null)));
+        }
         return defineClass(name, data, 0, data.length, cs);
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/SpecializedMethodChooser.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.runtime;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodType;
-import jdk.nashorn.internal.codegen.types.Type;
-import jdk.nashorn.internal.runtime.options.Options;
-
-class SpecializedMethodChooser {
-    /** Should specialized function and specialized constructors for the builtin be used if available? */
-    private static final boolean DISABLE_SPECIALIZATION = Options.getBooleanProperty("nashorn.scriptfunction.specialization.disable");
-
-    static MethodHandle candidateWithLowestWeight(final MethodType descType, final MethodHandle initialCandidate, final MethodHandle[] specs) {
-        if (DISABLE_SPECIALIZATION || specs == null) {
-            return initialCandidate;
-        }
-
-        int          minimumWeight = Integer.MAX_VALUE;
-        MethodHandle candidate     = initialCandidate;
-
-        for (final MethodHandle spec : specs) {
-            final MethodType specType = spec.type();
-
-            if (!typeCompatible(descType, specType)) {
-                continue;
-            }
-
-            //return type is ok. we want a wider or equal one for our callsite.
-            final int specWeight = weigh(specType);
-            if (specWeight < minimumWeight) {
-                candidate = spec;
-                minimumWeight = specWeight;
-            }
-        }
-
-        return candidate;
-    }
-
-    private static boolean typeCompatible(final MethodType desc, final MethodType spec) {
-        //spec must fit in desc
-        final Class<?>[] dparray = desc.parameterArray();
-        final Class<?>[] sparray = spec.parameterArray();
-
-        if (dparray.length != sparray.length) {
-            return false;
-        }
-
-        for (int i = 0; i < dparray.length; i++) {
-            final Type dp = Type.typeFor(dparray[i]);
-            final Type sp = Type.typeFor(sparray[i]);
-
-            if (dp.isBoolean()) {
-                return false; //don't specialize on booleans, we have the "true" vs int 1 ambiguity in resolution
-            }
-
-            //specialization arguments must be at least as wide as dp, if not wider
-            if (Type.widest(dp, sp) != sp) {
-                //e.g. specialization takes double and callsite says "object". reject.
-                //but if specialization says double and callsite says "int" or "long" or "double", that's fine
-                return false;
-            }
-        }
-
-        return true; // anything goes for return type, take the convenient one and it will be upcasted thru dynalink magic.
-    }
-
-    private static int weigh(final MethodType t) {
-        int weight = Type.typeFor(t.returnType()).getWeight();
-        for (final Class<?> paramType : t.parameterArray()) {
-            final int pweight = Type.typeFor(paramType).getWeight();
-            weight += pweight;
-        }
-        return weight;
-    }
-}
--- a/nashorn/src/jdk/nashorn/internal/runtime/StructureLoader.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/StructureLoader.java	Fri Apr 05 14:51:24 2013 -0700
@@ -38,6 +38,7 @@
 import java.security.CodeSource;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 import jdk.nashorn.internal.codegen.ObjectClassGenerator;
 
 /**
@@ -129,6 +130,6 @@
         }
 
         final byte[] code = new ObjectClassGenerator(context).generate(descriptor);
-        return defineClass(name, code, 0, code.length);
+        return defineClass(name, code, 0, code.length, new ProtectionDomain(null, getPermissions(null)));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Fri Apr 05 14:51:24 2013 -0700
@@ -57,7 +57,7 @@
     static {
         final DynamicLinkerFactory factory = new DynamicLinkerFactory();
         factory.setPrioritizedLinkers(new NashornLinker(), new NashornPrimitiveLinker(), new NashornStaticClassLinker(),
-                new JSObjectLinker());
+                new JSObjectLinker(), new ReflectionCheckLinker());
         factory.setFallbackLinkers(new BeansLinker(), new NashornBottomLinker());
         factory.setSyncOnRelink(true);
         final int relinkThreshold = Options.getIntProperty("nashorn.unstable.relink.threshold", -1);
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java	Fri Apr 05 14:51:24 2013 -0700
@@ -54,6 +54,7 @@
 import java.security.CodeSource;
 import java.security.Permissions;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
 import java.security.ProtectionDomain;
 import java.security.SecureClassLoader;
 import java.security.SecureRandom;
@@ -410,9 +411,14 @@
      */
     public static MethodHandle getConstructor(final Class<?> sourceType, final Class<?> targetType) throws Exception {
         final StaticClass adapterClass = getAdapterClassFor(new Class<?>[] { targetType });
-        return MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get(
-                "dyn:new", MethodType.methodType(targetType, StaticClass.class, sourceType), 0), false,
-                adapterClass, null)).getInvocation(), adapterClass);
+        return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>() {
+            @Override
+            public MethodHandle run() throws Exception {
+                return  MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get(
+                    "dyn:new", MethodType.methodType(targetType, StaticClass.class, sourceType), 0), false,
+                    adapterClass, null)).getInvocation(), adapterClass);
+            }
+        });
     }
 
     /**
@@ -456,9 +462,26 @@
     private static ClassLoader createClassLoader(final ClassLoader parentLoader, final String className,
             final byte[] classBytes, final String privilegedActionClassName) {
         return new AdapterLoader(parentLoader) {
+            private final ClassLoader myLoader = getClass().getClassLoader();
             private final ProtectionDomain myProtectionDomain = getClass().getProtectionDomain();
 
             @Override
+            public Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
+                try {
+                    return super.loadClass(name, resolve);
+                } catch (final SecurityException se) {
+                    // we may be implementing an interface or extending a class that was
+                    // loaded by a loader that prevents package.access. If so, it'd throw
+                    // SecurityException for nashorn's classes!. For adapter's to work, we
+                    // should be able to refer to nashorn classes.
+                    if (name.startsWith("jdk.nashorn.internal.")) {
+                        return myLoader.loadClass(name);
+                    }
+                    throw se;
+                }
+            }
+
+            @Override
             protected Class<?> findClass(final String name) throws ClassNotFoundException {
                 if(name.equals(className)) {
                     final byte[] bytes = classBytes;
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaArgumentConverters.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaArgumentConverters.java	Fri Apr 05 14:51:24 2013 -0700
@@ -39,7 +39,7 @@
 import jdk.nashorn.internal.runtime.ScriptObject;
 
 /**
- * Utility class shared by {@link NashornLinker} and {@code NashornPrimitiveLinker} for converting JS values to Java
+ * Utility class shared by {@code NashornLinker} and {@code NashornPrimitiveLinker} for converting JS values to Java
  * types.
  */
 public class JavaArgumentConverters {
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornGuards.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornGuards.java	Fri Apr 05 14:51:24 2013 -0700
@@ -40,8 +40,6 @@
     private static final MethodHandle IS_SCRIPTOBJECT          = findOwnMH("isScriptObject", boolean.class, Object.class);
     private static final MethodHandle IS_SCRIPTFUNCTION        = findOwnMH("isScriptFunction", boolean.class, Object.class);
     private static final MethodHandle IS_MAP                   = findOwnMH("isMap", boolean.class, Object.class, PropertyMap.class);
-    private static final MethodHandle IS_FUNCTION_MH           = findOwnMH("isFunctionMH", boolean.class, Object.class, MethodHandle.class);
-    private static final MethodHandle IS_NONSTRICT_FUNCTION    = findOwnMH("isNonStrictFunction", boolean.class, Object.class, Object.class, MethodHandle.class);
     private static final MethodHandle IS_INSTANCEOF_2          = findOwnMH("isInstanceOf2", boolean.class, Object.class, Class.class, Class.class);
 
     // don't create me!
@@ -87,33 +85,6 @@
         return MH.insertArguments(IS_INSTANCEOF_2, 1, class1, class2);
     }
 
-    /**
-     * Get the guard that checks if a {@link ScriptFunction} is equal to
-     * a known ScriptFunction, using reference comparison
-     *
-     * @param function The ScriptFunction to check against. This will be bound to the guard method handle
-     *
-     * @return method handle for guard
-     */
-    public static MethodHandle getFunctionGuard(final ScriptFunction function) {
-        assert function.getInvokeHandle() != null;
-        return MH.insertArguments(IS_FUNCTION_MH, 1, function.getInvokeHandle());
-    }
-
-    /**
-     * Get a guard that checks if a {@link ScriptFunction} is equal to
-     * a known ScriptFunction using reference comparison, and whether the type of
-     * the second argument (this-object) is not a JavaScript primitive type.
-     *
-     * @param function The ScriptFunction to check against. This will be bound to the guard method handle
-     *
-     * @return method handle for guard
-     */
-    public static MethodHandle getNonStrictFunctionGuard(final ScriptFunction function) {
-        assert function.getInvokeHandle() != null;
-        return MH.insertArguments(IS_NONSTRICT_FUNCTION, 2, function.getInvokeHandle());
-    }
-
     @SuppressWarnings("unused")
     private static boolean isScriptObject(final Object self) {
         return self instanceof ScriptObject;
@@ -130,16 +101,6 @@
     }
 
     @SuppressWarnings("unused")
-    private static boolean isFunctionMH(final Object self, final MethodHandle mh) {
-        return self instanceof ScriptFunction && ((ScriptFunction)self).getInvokeHandle() == mh;
-    }
-
-    @SuppressWarnings("unused")
-    private static boolean isNonStrictFunction(final Object self, final Object arg, final MethodHandle mh) {
-        return self instanceof ScriptFunction && ((ScriptFunction)self).getInvokeHandle() == mh && arg instanceof ScriptObject;
-    }
-
-    @SuppressWarnings("unused")
     private static boolean isInstanceOf2(final Object self, final Class<?> class1, final Class<?> class2) {
         return class1.isInstance(self) || class2.isInstance(self);
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/PrimitiveLookup.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/PrimitiveLookup.java	Fri Apr 05 14:51:24 2013 -0700
@@ -109,7 +109,6 @@
             }
             return new GuardedInvocation(method, guard, link.getSwitchPoint());
         }
-        assert desc.getNameTokenCount() <= 2; // Named operations would hit the return null after findProperty
         return null;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.internal.runtime.linker;
+
+import jdk.internal.dynalink.linker.GuardedInvocation;
+import jdk.internal.dynalink.linker.LinkRequest;
+import jdk.internal.dynalink.linker.LinkerServices;
+import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
+
+/**
+ * Check java reflection permission for java reflective and java.lang.invoke access from scripts
+ */
+final class ReflectionCheckLinker implements TypeBasedGuardingDynamicLinker{
+    @Override
+    public boolean canLinkType(final Class<?> type) {
+        return canLinkTypeStatic(type);
+    }
+
+    private static boolean canLinkTypeStatic(final Class<?> type) {
+        if (type == Class.class || ClassLoader.class.isAssignableFrom(type)) {
+            return true;
+        }
+        final String name = type.getName();
+        return name.startsWith("java.lang.reflect.") || name.startsWith("java.lang.invoke.");
+    }
+
+    @Override
+    public GuardedInvocation getGuardedInvocation(final LinkRequest origRequest, final LinkerServices linkerServices)
+            throws Exception {
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission("nashorn.JavaReflection"));
+        }
+        // let the next linker deal with actual linking
+        return null;
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/options/OptionTemplate.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/options/OptionTemplate.java	Fri Apr 05 14:51:24 2013 -0700
@@ -278,7 +278,7 @@
                     this.valueNextArg = Boolean.parseBoolean(arg);
                     break;
                 default:
-                    throw new IllegalArgumentException();
+                    throw new IllegalArgumentException(keyToken);
                 }
             }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java	Fri Apr 05 14:51:24 2013 -0700
@@ -66,6 +66,9 @@
     /** The options map of enabled options */
     private final TreeMap<String, Option<?>> options;
 
+    /** System property that can be used for command line option propagation */
+    private static final String NASHORN_ARGS_PROPERTY = "nashorn.args";
+
     /**
      * Constructor
      *
@@ -386,6 +389,14 @@
         final LinkedList<String> argList = new LinkedList<>();
         Collections.addAll(argList, args);
 
+    final String extra = getStringProperty(NASHORN_ARGS_PROPERTY, null);
+    if (extra != null) {
+        final StringTokenizer st = new StringTokenizer(extra);
+        while (st.hasMoreTokens()) {
+        argList.add(st.nextToken());
+        }
+    }
+
         while (!argList.isEmpty()) {
             final String arg = argList.remove(0);
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/DefaultRegExp.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/DefaultRegExp.java	Fri Apr 05 14:51:24 2013 -0700
@@ -95,14 +95,14 @@
             return null; // never matches or similar, e.g. a[]
         }
 
-        RegExpMatcher matcher = this.matcher;
+        RegExpMatcher currentMatcher = this.matcher;
 
-        if (matcher == null || matcher.getInput() != str) {
-            matcher = new DefaultMatcher(str);
-            this.matcher = matcher;
+        if (currentMatcher == null || matcher.getInput() != str) {
+            currentMatcher = new DefaultMatcher(str);
+            this.matcher  = currentMatcher;
         }
 
-        return matcher;
+        return currentMatcher;
     }
 
     class DefaultMatcher implements RegExpMatcher {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java	Fri Apr 05 14:51:24 2013 -0700
@@ -97,14 +97,14 @@
             return null;
         }
 
-        RegExpMatcher matcher = this.matcher;
+        RegExpMatcher currentMatcher = this.matcher;
 
-        if (matcher == null || input != matcher.getInput()) {
-            matcher = new JoniMatcher(input);
-            this.matcher = matcher;
+        if (currentMatcher == null || input != currentMatcher.getInput()) {
+            currentMatcher = new JoniMatcher(input);
+            this.matcher   = currentMatcher;
         }
 
-        return matcher;
+        return currentMatcher;
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExp.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExp.java	Fri Apr 05 14:51:24 2013 -0700
@@ -156,7 +156,7 @@
      *
      * @param key the message key
      * @param str string argument
-     * @throws jdk.nashorn.internal.runtime.ParserException
+     * @throws jdk.nashorn.internal.runtime.ParserException unconditionally
      */
     protected static void throwParserException(final String key, final String str) throws ParserException {
         throw new ParserException(ECMAErrors.getMessage("parser.error.regex." + key, str));
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,7 +25,6 @@
 
 package jdk.nashorn.internal.runtime.regexp;
 
-import jdk.nashorn.internal.parser.Lexer;
 import jdk.nashorn.internal.runtime.ParserException;
 import jdk.nashorn.internal.runtime.options.Options;
 
@@ -35,7 +34,6 @@
  */
 public class RegExpFactory {
 
-
     private final static RegExpFactory instance;
 
     private final static String JDK  = "jdk";
@@ -60,7 +58,8 @@
      * Creates a Regular expression from the given {@code pattern} and {@code flags} strings.
      *
      * @param pattern RegExp pattern string
-     * @param flags RegExp flags string
+     * @param flags   RegExp flags string
+     * @return new RegExp
      * @throws ParserException if flags is invalid or pattern string has syntax error.
      */
     protected RegExp compile(final String pattern, final String flags) throws ParserException {
@@ -71,8 +70,8 @@
      * Compile a regexp with the given {@code source} and {@code flags}.
      *
      * @param pattern RegExp pattern string
-     * @param flags  flag string
-     *
+     * @param flags   flag string
+     * @return new RegExp
      * @throws ParserException if invalid source or flags
      */
     public static RegExp create(final String pattern, final String flags) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpResult.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpResult.java	Fri Apr 05 14:51:24 2013 -0700
@@ -80,11 +80,11 @@
 
     /**
      * Get the group with the given index or the empty string if group index is not valid.
-     * @param index the group index
+     * @param groupIndex the group index
      * @return the group or ""
      */
-    public Object getGroup(int index) {
-        return index >= 0 && index < groups.length ? groups[index] : "";
+    public Object getGroup(final int groupIndex) {
+        return groupIndex >= 0 && groupIndex < groups.length ? groups[groupIndex] : "";
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java	Fri Apr 05 14:51:24 2013 -0700
@@ -182,8 +182,6 @@
      * @return Committed token
      */
     private boolean commit(final int n) {
-        final int startIn = position;
-
         switch (n) {
         case 1:
             sb.append(ch0);
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Fri Apr 05 14:51:24 2013 -0700
@@ -1459,4 +1459,4 @@
     private int finish() {
         return bestLen;
     }
-}
\ No newline at end of file
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/encoding/AsciiTables.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/encoding/AsciiTables.java	Fri Apr 05 14:51:24 2013 -0700
@@ -154,4 +154,4 @@
             {0x59, 0x79},
             {0x5a, 0x7a}
     };
-}
\ No newline at end of file
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -42,6 +42,8 @@
 parser.error.expected.comma=Expected comma but found {0}
 parser.error.expected=Expected {0} but found {1}
 parser.error.invalid.return=Invalid return statement
+parser.error.no.func.decl.here=Function declarations can only occur at program or function body level. You should use a function expression here instead.
+parser.error.no.func.decl.here.warn=Function declarations should only occur at program or function body level. Function declaration in nested block was converted to a function expression.
 parser.error.property.redefinition=Property "{0}" already defined
 parser.error.unexpected.token=Unexpected token: {0}
 parser.error.many.vars.in.for.in.loop=Only one variable allowed in for..in loop
@@ -57,7 +59,7 @@
 parser.error.strict.cant.delete.ident=cannot delete identifier "{0}" in strict mode
 parser.error.strict.param.redefinition=strict mode function cannot have duplicate parameter name "{0}"
 parser.error.strict.no.octal=cannot use octal value in strict mode
-parser.error.strict.no.func.here=In strict mode, functions can only be declared at top-level or immediately within a function
+parser.error.strict.no.func.decl.here=In strict mode, function declarations can only occur at program or function body level. You should use a function expression here instead.
 type.error.strict.getter.setter.poison=In strict mode, "caller", "callee", and "arguments" properties can not be accessed on functions or the arguments object
 
 # not the expected type in a given context
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties	Fri Apr 05 14:51:24 2013 -0700
@@ -165,6 +165,12 @@
     desc="Generate local variable table in .class files." \
 }
 
+nashorn.option.lazy.compilation = {                                                                      \
+    name="--lazy-compilation",                                                                           \
+    is_undocumented=true,                                                                                \
+    desc="EXPERIMENTAL: Use lazy code generation strategies - do not compile the entire script at once." \
+}
+
 nashorn.option.loader.per.compile = {              \
     name="--loader-per-compile",                   \
     is_undocumented=true,                          \
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js	Fri Apr 05 14:51:24 2013 -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.
@@ -34,7 +34,7 @@
         if (arguments.length < 2) {
             throw new TypeError("JavaAdapter requires atleast two arguments");
         }
-            
+
         var types = Array.prototype.slice.call(arguments, 0, arguments.length - 1);
         var NewType = Java.extend.apply(Java, types);
         return new NewType(arguments[arguments.length - 1]);
@@ -56,10 +56,10 @@
                     return type;
                 } catch (e) {}
             }
-            
+
             return oldNoSuchProperty? oldNoSuchProperty(name) : undefined;
         }
-        
+
         var prefix = "[JavaPackage ";
         return function() {
             for (var i in arguments) {
@@ -343,7 +343,9 @@
     configurable: true, enumerable: false, writable: true,
     value: function(clazz) {
         if (Java.isType(clazz)) {
-            this[clazz.class.getSimpleName()] = clazz;
+            var className = Java.typeName(clazz);
+            var simpleName = className.substring(className.lastIndexOf('.') + 1);
+            this[simpleName] = clazz;
         } else {
             throw new TypeError(clazz + " is not a Java class");
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/parser.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/parser.js	Fri Apr 05 14:51:24 2013 -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.
@@ -47,7 +47,7 @@
             code = arguments[0];
     }
 
-    var jsonStr = Packages.jdk.nashorn.internal.runtime.ScriptRuntime.parse(code, name, location);
+    var jsonStr = Packages.jdk.nashorn.api.scripting.ScriptUtils.parse(code, name, location);
     return JSON.parse(jsonStr,
         function (prop, value) {
             if (typeof(value) == 'string' && prop == "value") {
--- a/nashorn/test/script/basic/JDK-8006755.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/JDK-8006755.js	Fri Apr 05 14:51:24 2013 -0700
@@ -31,7 +31,7 @@
 var scope = { x: "hello" };
 
 with (scope) {
-    function main() {
+    var main = function() {
         if (x != "hello") {
             fail("x != 'hello'");
         }
--- a/nashorn/test/script/basic/JDK-8008448.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/JDK-8008448.js	Fri Apr 05 14:51:24 2013 -0700
@@ -32,7 +32,7 @@
 
 var File = Java.type("java.io.File");
 var FilenameFilter = Java.type("java.io.FilenameFilter");
-var Source = Java.type("jdk.nashorn.internal.runtime.Source")
+var SourceHelper = Java.type("jdk.nashorn.test.models.SourceHelper")
 
 // Filter out non .js files
 var files = new File(__DIR__).listFiles(new FilenameFilter() {
@@ -44,5 +44,5 @@
 
 // parse each file to make sure it does not result in exception
 for each (var f in files) {
-    parse(new Source(f.toString(), f).getString());
+    parse(SourceHelper.readFully(f));
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8009868.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+
+/**
+ * JDK-8009868: For loop with "true" as condition results in AssertionError in codegen
+ *
+ * @test
+ * @run
+ */
+
+// This used to crash with AssertionError in codegen
+for(; true;) {
+    break;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010199.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8010199: javax.script.Invocable implementation for nashorn does not return null when matching functions are missing
+ *
+ * @test
+ * @run
+ */
+
+var m = new javax.script.ScriptEngineManager();
+var e = m.getEngineByName("nashorn");
+
+var iface = e.getInterface(java.lang.Runnable.class);
+
+if (iface != null) {
+    fail("Expected interface object to be null");
+}
+
+e.eval("var runcalled = false; function run() { runcalled = true }");
+
+iface = e.getInterface(java.lang.Runnable.class);
+if (iface == null) {
+    fail("Expected interface object to be non-null");
+}
+
+iface.run();
+
+if (e.get("runcalled") != true) {
+    fail("runcalled is not true");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010709.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8010709  org on the top level doesn't resolve 
+ *
+ * @test
+ * @run
+ */
+
+function check(pkgName) {
+    if (typeof this[pkgName] != 'object') {
+        fail(pkgName + " not defined");
+    }
+
+    if (String(this[pkgName]) != '[JavaPackage ' + pkgName + ']') {
+        fail(pkgName + " is not a JavaPackage");
+    }
+}
+
+check("com");
+check("edu");
+check("java");
+check("javafx");
+check("javax");
+check("org");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010720.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8010720:  Linkage problem with java.lang.String.length()
+ *
+ * @test
+ * @run
+ */
+
+var s = new java.lang.String("nashorn");
+
+if (s.length() != 7) {
+    fail("s.length() does not return expected value");
+}
+
+if (s.length != 7) {
+    fail("s.length does not return expected value");
+}
+
+
+if ('hello'.length() != 5) {
+    fail("'hello'.length() does not return expected value");
+}
+
+if ('hello'.length != 5) {
+    fail("'hello'.length does not return expected value");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8017010.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8010710 - slot/scope problem with temporary expressions
+ * as array index in self modifying assigns
+ *
+ * @test
+ * @run 
+ */
+function zero() {
+    return 0;
+}
+
+//try complex self modifying assignment and force slots to temporary value index operators
+var a = [1, 2, 3, 4, 5];
+var b = [a, a];
+print(b[zero() + 1][2 + a[0]] += 10);
+
+//repro for NASHORN-258 that never made it
+function AddRoundKey() {        
+    var r=0;  
+    state[r][1] &= 17;    
+}
+
+var srcFiles = [];
+for(i=0;i<100;i++) {
+    srcFiles.push('dummy');
+}
+var added = '';
+
+//this broke the javafx build system. verify it works
+function bouncingBall() {
+    for (j=0; j<100; j++) {
+	added += srcFiles[j];
+    }
+}
+bouncingBall();
+print(added);
+
+//this is how they should have done it for speed, that works always, verify this too
+function bouncingBall2() {
+    for (var k=0; k<100; k++) {
+	added += srcFiles[k];
+    }
+}
+bouncingBall2();
+print(added);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8017010.js.EXPECTED	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,3 @@
+14
+dummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummy
+dummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummydummy
--- a/nashorn/test/script/basic/NASHORN-258.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/NASHORN-258.js	Fri Apr 05 14:51:24 2013 -0700
@@ -29,6 +29,16 @@
  */
 
 function test3(a) {
+    for (i = 0; i < a.length ; i++) {
+	for (j = 0; j < a[i].length ; j++) {
+	    for (k = 0; k < a[i][j].length ; k++) {
+		a[i][j][k] *= 8;
+	    }
+	}
+    }
+}
+
+function test3local(a) {
     for (var i = 0; i < a.length ; i++) {
 	for (var j = 0; j < a[i].length ; j++) {
 	    for (var k = 0; k < a[i][j].length ; k++) {
@@ -45,6 +55,8 @@
 test3(array);
 print(array);
 
+test3local(array);
+print(array);
 
 function outer() {
     
--- a/nashorn/test/script/basic/NASHORN-258.js.EXPECTED	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/NASHORN-258.js.EXPECTED	Fri Apr 05 14:51:24 2013 -0700
@@ -1,2 +1,3 @@
 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
+64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64
 1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8
--- a/nashorn/test/script/basic/NASHORN-401.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/NASHORN-401.js	Fri Apr 05 14:51:24 2013 -0700
@@ -28,7 +28,7 @@
  * @run
  */
 
-var t = new Packages.jdk.nashorn.internal.runtime.Nashorn401TestSubject();
+var t = new Packages.jdk.nashorn.test.models.Nashorn401TestSubject();
 
 print(t.method2(10));
 print(t.method2(10.2));
--- a/nashorn/test/script/basic/NASHORN-837.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/NASHORN-837.js	Fri Apr 05 14:51:24 2013 -0700
@@ -28,23 +28,13 @@
  * @run
  */
 
-var failed = false;
-
 try {
-    try {
-	throw new TypeError('error');
-    } catch (iox) {
-	function f() {
-	    print(iox.message);
-	}
+    throw new TypeError('error');
+} catch (iox) {
+    var f = function() {
+        if(iox.message != 'error') {
+            print("Failure! iox did not throw correct exception");
+        }
     }
-    f();
-} catch (e) {
-    failed = (e instanceof ReferenceError);
-    //iox not defined should be thrown
 }
-
-if (!failed) {
-    print("Failure! iox did not throw correct exception");
-}
-
+f();
--- a/nashorn/test/script/basic/compile-octane.js.EXPECTED	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/compile-octane.js.EXPECTED	Fri Apr 05 14:51:24 2013 -0700
@@ -16,6 +16,9 @@
 Compiling... gbemu.js
 Compiled OK: gbemu.js
 
+Compiling... mandreel.js
+Compiled OK: mandreel.js
+
 Compiling... navier-stokes.js
 Compiled OK: navier-stokes.js
 
--- a/nashorn/test/script/basic/consstring.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/consstring.js	Fri Apr 05 14:51:24 2013 -0700
@@ -37,4 +37,4 @@
 list.add((str + "3").toString());            // toString() called on primitive string
 list.add(new String(str + "4").toString());  // toString() called on String object
 
-Packages.jdk.nashorn.internal.test.models.StringArgs.checkString(list);
+Packages.jdk.nashorn.test.models.StringArgs.checkString(list);
--- a/nashorn/test/script/basic/fileline.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/fileline.js	Fri Apr 05 14:51:24 2013 -0700
@@ -41,8 +41,8 @@
 load(__DIR__ + "loadedfile.js");
 
 // Add check for base part of a URL. We can't test __DIR__ inside
-// a script that is downloaded from a URL. check for Source.baseURL
+// a script that is downloaded from a URL. check for SourceHelper.baseURL
 // which is exposed as __DIR__ for URL case.
 
 var url = new java.net.URL("http://www.acme.com:8080/foo/bar.js");
-print(Packages.jdk.nashorn.internal.runtime.Source.baseURL(url));
+print(Packages.jdk.nashorn.test.models.SourceHelper.baseURL(url));
--- a/nashorn/test/script/basic/javainnerclasses.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/javainnerclasses.js	Fri Apr 05 14:51:24 2013 -0700
@@ -29,25 +29,25 @@
  */
  
 // Do it with Java.type()
-var outer = new (Java.type("jdk.nashorn.internal.test.models.OuterClass"))("apple")
+var outer = new (Java.type("jdk.nashorn.test.models.OuterClass"))("apple")
 print(outer)
-var innerStatic = new (Java.type("jdk.nashorn.internal.test.models.OuterClass$InnerStaticClass"))("orange")
+var innerStatic = new (Java.type("jdk.nashorn.test.models.OuterClass$InnerStaticClass"))("orange")
 print(innerStatic)
-var innerNonStatic = new (Java.type("jdk.nashorn.internal.test.models.OuterClass$InnerNonStaticClass"))(outer, "pear")
+var innerNonStatic = new (Java.type("jdk.nashorn.test.models.OuterClass$InnerNonStaticClass"))(outer, "pear")
 print(innerNonStatic)
 
 // Now do it with Packages and explicit $ names
-var outer = new Packages.jdk.nashorn.internal.test.models.OuterClass("red")
+var outer = new Packages.jdk.nashorn.test.models.OuterClass("red")
 print(outer)
-var innerStatic = new Packages.jdk.nashorn.internal.test.models.OuterClass$InnerStaticClass("green")
+var innerStatic = new Packages.jdk.nashorn.test.models.OuterClass$InnerStaticClass("green")
 print(innerStatic)
-var innerNonStatic = new Packages.jdk.nashorn.internal.test.models.OuterClass$InnerNonStaticClass(outer, "blue")
+var innerNonStatic = new Packages.jdk.nashorn.test.models.OuterClass$InnerNonStaticClass(outer, "blue")
 print(innerNonStatic)
 
 // Now do it with Packages and nested properties
-var outer = new Packages.jdk.nashorn.internal.test.models.OuterClass("sweet")
+var outer = new Packages.jdk.nashorn.test.models.OuterClass("sweet")
 print(outer)
-var innerStatic = new Packages.jdk.nashorn.internal.test.models.OuterClass.InnerStaticClass("sour")
+var innerStatic = new Packages.jdk.nashorn.test.models.OuterClass.InnerStaticClass("sour")
 print(innerStatic)
-var innerNonStatic = new Packages.jdk.nashorn.internal.test.models.OuterClass.InnerNonStaticClass(outer, "bitter")
+var innerNonStatic = new Packages.jdk.nashorn.test.models.OuterClass.InnerNonStaticClass(outer, "bitter")
 print(innerNonStatic)
--- a/nashorn/test/script/basic/list.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/list.js	Fri Apr 05 14:51:24 2013 -0700
@@ -28,7 +28,7 @@
  * @run
  */
 var l = new java.util.ArrayList();
-print("l.class.name=" + l.class.name) // Has "class" property like any POJO
+print("l.class.name=" + Java.typeName(l.class)) // Has "class" property like any POJO
 
 l.add("foo")
 l.add("bar")
--- a/nashorn/test/script/basic/map.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/map.js	Fri Apr 05 14:51:24 2013 -0700
@@ -28,7 +28,7 @@
  * @run
  */
 var m = new (Java.type("java.util.LinkedHashMap"));
-print("m.class.name=" + m.class.name) // Has "class" property like any POJO
+print("m.class.name=" + Java.typeName(m.class)) // Has "class" property like any POJO
 
 var empty_key = "empty"
 
--- a/nashorn/test/script/basic/run-octane.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/run-octane.js	Fri Apr 05 14:51:24 2013 -0700
@@ -31,7 +31,8 @@
     "crypto.js", 
     "deltablue.js", 
     "earley-boyer.js", 
-    "gbemu.js",	     
+    "gbemu.js",
+    "mandreel.js",
     "navier-stokes.js", 
     "pdfjs.js",
     "raytrace.js",
@@ -49,6 +50,12 @@
     { name: "gbemu.js" },
 ];
 
+
+//TODO mandreel can be compiled as a test, but not run multiple times unless modified to not have global state
+var compileOnly = {
+    "mandreel.js" : true
+};
+
 var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
 
 // TODO: why is this path hard coded when it's defined in project properties?
@@ -63,6 +70,10 @@
     return str.indexOf(suffix, str.length - suffix.length) !== -1;
 }
 
+function should_compile_only(name) {
+    return (typeof compile_only !== 'undefined') || compileOnly[name] === true;
+}
+
 function run_one_benchmark(arg, iters) {
 
     var file_name;
@@ -77,14 +88,18 @@
     }
     file_name = file[file.length - 1];
 
-    if (typeof compile_only !== 'undefined') {
+    var compile_and_return = should_compile_only(file_name);
+    if (compile_and_return) {
+	if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them
+	    return;
+	}
 	print("Compiling... " + file_name);
     }
 
     load(path + 'base.js');
     load(arg);
     
-    if (typeof compile_only !== 'undefined') {
+    if (compile_and_return) {
 	print("Compiled OK: " + file_name);
 	print("");
 	return;
@@ -164,7 +179,7 @@
 
 function run_suite(tests, iters) {
     for (var idx = 0; idx < tests.length; idx++) {
-	run_one_benchmark(tests[idx], iters, false);
+	run_one_benchmark(tests[idx], iters);
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/runsunspider-eager.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+/**
+ * runsunspider : runs the sunspider tests and checks for compliance
+ *
+ * @test
+ * @option -timezone=PST
+ * @runif external.sunspider
+ */
+
+load(__DIR__ + "runsunspider.js");
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/runsunspider-eager.js.EXPECTED	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,1 @@
+Sunspider finished!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/runsunspider-lazy.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+/**
+ * runsunspider : runs the sunspider tests and checks for compliance
+ *
+ * @test
+ * @option -timezone=PST
+ * @option --lazy-compilation
+ * @runif external.sunspider
+ */
+
+load(__DIR__ + "runsunspider.js");
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/runsunspider-lazy.js.EXPECTED	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,1 @@
+Sunspider finished!
--- a/nashorn/test/script/basic/runsunspider.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/runsunspider.js	Fri Apr 05 14:51:24 2013 -0700
@@ -24,39 +24,11 @@
 /**
  * runsunspider : runs the sunspider tests and checks for compliance
  *
- * @test
- * @option -timezone=PST
- * @runif external.sunspider
- */
-
-/*
- * Copyright (c) 2010-2011, 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.
+ * @subtest
  */
 
 /**
  * This is not a test, but a test "framework" for running sunspider tests.
- *
  */
 
 function assertEq(a, b) {
--- a/nashorn/test/script/basic/runsunspider.js.EXPECTED	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Sunspider finished!
--- a/nashorn/test/script/basic/stdin.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/basic/stdin.js	Fri Apr 05 14:51:24 2013 -0700
@@ -28,8 +28,8 @@
  * @run
  */
 
-print(java.lang.System.in.class.name);
+print(Java.typeName(java.lang.System.in.class));
 var prop = "in";
-print(java.lang.System[prop].class.name);
-print(java.lang.System["in"].class.name);
+print(Java.typeName(java.lang.System[prop].class));
+print(Java.typeName(java.lang.System["in"].class));
 
--- a/nashorn/test/script/currently-failing/JDK-8006529.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/currently-failing/JDK-8006529.js	Fri Apr 05 14:51:24 2013 -0700
@@ -39,12 +39,13 @@
  * and FunctionNode because of package-access check and so reflective calls.
  */
 
-var Parser         = Java.type("jdk.nashorn.internal.parser.Parser")
-var Compiler       = Java.type("jdk.nashorn.internal.codegen.Compiler")
-var Context        = Java.type("jdk.nashorn.internal.runtime.Context")
+var Parser            = Java.type("jdk.nashorn.internal.parser.Parser")
+var Compiler          = Java.type("jdk.nashorn.internal.codegen.Compiler")
+var Context           = Java.type("jdk.nashorn.internal.runtime.Context")
 var ScriptEnvironment = Java.type("jdk.nashorn.internal.runtime.ScriptEnvironment")
-var Source         = Java.type("jdk.nashorn.internal.runtime.Source")
-var FunctionNode   = Java.type("jdk.nashorn.internal.ir.FunctionNode")
+var Source            = Java.type("jdk.nashorn.internal.runtime.Source")
+var FunctionNode      = Java.type("jdk.nashorn.internal.ir.FunctionNode")
+var ThrowErrorManager = Java.type("jdk.nashorn.internal.runtime.Context$ThrowErrorManager");
 
 // Compiler class methods and fields
 var parseMethod = Parser.class.getMethod("parse");
@@ -90,7 +91,7 @@
 // representing it.
 function compile(source) {
     var source   = new Source("<no name>", source);
-    var parser   = new Parser(Context.getContext().getEnv(), source, null);
+    var parser   = new Parser(Context.getContext().getEnv(), source, new ThrowErrorManager());
     var func     = parseMethod.invoke(parser);
     var compiler = new Compiler(Context.getContext().getEnv(), func);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/currently-failing/clone_ir.js	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+
+/**
+ * clone_ir : Check that functionNode.clone copies all nodes and that they
+ * are not the same references
+ *
+ * @test
+ * @run
+ */
+
+var js1 = "var tuple = { func : function f(x) { if (x) { print('true'); { print('block_under-true'); } } else { print('false'); } } }";
+
+var Parser            = Java.type("jdk.nashorn.internal.parser.Parser");
+var ASTWriter         = Java.type("jdk.nashorn.internal.ir.debug.ASTWriter");
+var Context           = Java.type("jdk.nashorn.internal.runtime.Context");
+var ScriptEnvironment = Java.type("jdk.nashorn.internal.runtime.ScriptEnvironment");
+var Source            = Java.type("jdk.nashorn.internal.runtime.Source");
+var FunctionNode      = Java.type("jdk.nashorn.internal.ir.FunctionNode");
+var ThrowErrorManager = Java.type("jdk.nashorn.internal.runtime.Context$ThrowErrorManager");
+var System            = Java.type("java.lang.System");
+
+var toArrayMethod = ASTWriter.class.getMethod("toArray");
+var parseMethod  = Parser.class.getMethod("parse");    
+
+function toString(obj) {
+    var output = "{ ";
+    for (property in obj) {
+	output += property + ': ' + obj[property]+'; ';
+    }
+    return output + '}'
+}
+
+function flatten(func) {
+    var writer   = new ASTWriter(func);
+    var funcList = toArrayMethod.invoke(writer);
+    
+    var res = [];
+    for each (x in funcList) {
+	    res.push({ name: x.getClass().getName(), id: System.identityHashCode(x) });
+	}
+    return res;
+}
+
+function check(contents) {
+    return check_src(new Source("<no name>", contents));
+}
+
+function check_src(src) {
+    var parser  = new Parser(Context.getContext().getEnv(), src, new ThrowErrorManager());
+
+    var func = parseMethod.invoke(parser);
+    print(func);
+    var func2 = func.clone();
+
+    var f1 = flatten(func);
+    var f2 = flatten(func2);
+
+    print(f1.map(toString));
+    print(f2.map(toString));
+
+    if (f1.length != f2.length) {
+	print("length difference between original and clone " + f1.length + " != " + f2.length);
+	return false;
+    }
+
+    for (var i = 0; i < f1.length; i++) {
+	if (f1[i].name !== f2[i].name) {
+	    print("name conflict at " + i + " " + f1[i].name + " != " + f2[i].name);
+	    return false;
+	} else if (f1[i].id === f2[i].id) {
+	    print("id problem at " + i + " " + toString(f1[i]) + " was not deep copied to " + toString(f2[i]) + " became " + f1[i].id + " != " + f2[i].id);
+	    return false;
+	}
+    }
+    
+    return true;
+}
+
+print(check(js1));
--- a/nashorn/test/script/sandbox/javaextend.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/sandbox/javaextend.js	Fri Apr 05 14:51:24 2013 -0700
@@ -27,7 +27,7 @@
  */
 
 function model(n) {
-  return Java.type("jdk.nashorn.internal.test.models." + n)
+  return Java.type("jdk.nashorn.test.models." + n)
 }
 
 // Can't extend a final class  
--- a/nashorn/test/script/sandbox/javaextend.js.EXPECTED	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/sandbox/javaextend.js.EXPECTED	Fri Apr 05 14:51:24 2013 -0700
@@ -1,6 +1,6 @@
-TypeError: Can not extend final class jdk.nashorn.internal.test.models.FinalClass.
-TypeError: Can not extend class jdk.nashorn.internal.test.models.NoAccessibleConstructorClass as it has no public or protected constructors.
-TypeError: Can not extend/implement non-public class/interface jdk.nashorn.internal.test.models.NonPublicClass.
+TypeError: Can not extend final class jdk.nashorn.test.models.FinalClass.
+TypeError: Can not extend class jdk.nashorn.test.models.NoAccessibleConstructorClass as it has no public or protected constructors.
+TypeError: Can not extend/implement non-public class/interface jdk.nashorn.test.models.NonPublicClass.
 TypeError: Can not extend multiple classes java.lang.Number and java.lang.Thread. At most one of the specified types can be a class, the rest must all be interfaces.
 abcdabcd
 run-object
--- a/nashorn/test/script/sandbox/reflection.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/sandbox/reflection.js	Fri Apr 05 14:51:24 2013 -0700
@@ -30,9 +30,7 @@
  */
 
 function check(e) {
-    if (e instanceof java.lang.SecurityException) {
-        print(e);
-    } else {
+    if (! (e instanceof java.lang.SecurityException)) {
         fail("expected SecurityException, got " + e);
     }
 }
--- a/nashorn/test/script/sandbox/reflection.js.EXPECTED	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
--- a/nashorn/test/script/sandbox/unsafe.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/sandbox/unsafe.js	Fri Apr 05 14:51:24 2013 -0700
@@ -30,9 +30,7 @@
  */
 
 function check(e) {
-   if (e instanceof java.lang.SecurityException) {
-       print(e);
-   } else {
+   if (! (e instanceof java.lang.SecurityException)) {
        fail("expected SecurityException, got " + e);
    }
 }
--- a/nashorn/test/script/sandbox/unsafe.js.EXPECTED	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
-java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
-java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun")
-java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
--- a/nashorn/test/script/trusted/urlreader.js	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/script/trusted/urlreader.js	Fri Apr 05 14:51:24 2013 -0700
@@ -9,7 +9,7 @@
 var URL = Java.type("java.net.URL");
 var File = Java.type("java.io.File");
 var JString = Java.type("java.lang.String");
-var Source = Java.type("jdk.nashorn.internal.runtime.Source");
+var SourceHelper = Java.type("jdk.nashorn.test.models.SourceHelper");
 
 var url = new File(__FILE__).toURI().toURL();
 var reader = new URLReader(url);
@@ -19,9 +19,9 @@
 
 // check URL read
 // read URL content by directly reading from URL
-var str = new Source(url.toString(), url).getString();
+var str = SourceHelper.readFully(url);
 // read URL content via URLReader
-var content = new JString(Source.readFully(reader));
+var content = new JString(SourceHelper.readFully(reader));
 
 // assert that the content is same
 Assert.assertEquals(str, content);
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -47,7 +47,6 @@
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
 import javax.script.SimpleScriptContext;
-import jdk.nashorn.internal.runtime.Version;
 import netscape.javascript.JSObject;
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -129,7 +128,6 @@
         assertEquals(fac.getParameter(ScriptEngine.NAME), "javascript");
         assertEquals(fac.getLanguageVersion(), "ECMA - 262 Edition 5.1");
         assertEquals(fac.getEngineName(), "Oracle Nashorn");
-        assertEquals(fac.getEngineVersion(), Version.version());
         assertEquals(fac.getOutputStatement("context"), "print(context)");
         assertEquals(fac.getProgram("print('hello')", "print('world')"), "print('hello');print('world');");
         assertEquals(fac.getParameter(ScriptEngine.NAME), "javascript");
@@ -285,6 +283,68 @@
         }
     }
 
+    public interface Foo {
+        public void bar();
+    }
+
+    public interface Foo2 extends Foo {
+        public void bar2();
+    }
+
+    @Test
+    public void getInterfaceMissingTest() {
+        final ScriptEngineManager manager = new ScriptEngineManager();
+        final ScriptEngine engine = manager.getEngineByName("nashorn");
+
+        // don't define any function.
+        try {
+            engine.eval("");
+        } catch (final Exception exp) {
+            exp.printStackTrace();
+            fail(exp.getMessage());
+        }
+
+        Runnable runnable = ((Invocable)engine).getInterface(Runnable.class);
+        if (runnable != null) {
+            fail("runnable is not null!");
+        }
+
+        // now define "run"
+        try {
+            engine.eval("function run() { print('this is run function'); }");
+        } catch (final Exception exp) {
+            exp.printStackTrace();
+            fail(exp.getMessage());
+        }
+        runnable = ((Invocable)engine).getInterface(Runnable.class);
+        // should not return null now!
+        runnable.run();
+
+        // define only one method of "Foo2"
+        try {
+            engine.eval("function bar() { print('bar function'); }");
+        } catch (final Exception exp) {
+            exp.printStackTrace();
+            fail(exp.getMessage());
+        }
+
+        Foo2 foo2 = ((Invocable)engine).getInterface(Foo2.class);
+        if (foo2 != null) {
+            throw new RuntimeException("foo2 is not null!");
+        }
+
+        // now define other method of "Foo2"
+        try {
+            engine.eval("function bar2() { print('bar2 function'); }");
+        } catch (final Exception exp) {
+            exp.printStackTrace();
+            fail(exp.getMessage());
+        }
+        foo2 = ((Invocable)engine).getInterface(Foo2.class);
+        foo2.bar();
+        foo2.bar2();
+    }
+
     @Test
     public void accessGlobalTest() {
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -313,27 +373,6 @@
         }
     }
 
-    public static void alert(final Object msg) {
-        System.out.println(msg);
-    }
-
-    @Test
-    public void exposeMethodTest() {
-        final ScriptEngineManager m = new ScriptEngineManager();
-        final ScriptEngine e = m.getEngineByName("nashorn");
-
-        try {
-            final Method alert = ScriptEngineTest.class.getMethod("alert", Object.class);
-            // expose a Method object as global var.
-            e.put("alert", alert);
-            // call the global var.
-            e.eval("alert.invoke(null, 'alert! alert!!')");
-        } catch (final NoSuchMethodException | SecurityException | ScriptException exp) {
-            exp.printStackTrace();
-            fail(exp.getMessage());
-        }
-    }
-
     @Test
     public void putGlobalFunctionTest() {
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -593,13 +632,6 @@
     }
 
     @Test
-    public void versionTest() {
-        final ScriptEngineManager m = new ScriptEngineManager();
-        final ScriptEngine e = m.getEngineByName("nashorn");
-        assertEquals(e.getFactory().getEngineVersion(), Version.version());
-    }
-
-    @Test
     public void noEnumerablePropertiesTest() {
         final ScriptEngineManager m = new ScriptEngineManager();
         final ScriptEngine e = m.getEngineByName("nashorn");
@@ -874,26 +906,4 @@
             fail(se.getMessage());
         }
     }
-
-    @Test
-    public void factoryOptionsTest() {
-        final ScriptEngineManager sm = new ScriptEngineManager();
-        for (ScriptEngineFactory fac : sm.getEngineFactories()) {
-            if (fac instanceof NashornScriptEngineFactory) {
-                final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
-                // specify --no-syntax-extensions flag
-                final String[] options = new String[] { "--no-syntax-extensions" };
-                final ScriptEngine e = nfac.getScriptEngine(options);
-                try {
-                    // try nashorn specific extension
-                    e.eval("var f = funtion(x) 2*x;");
-                    fail("should have thrown exception!");
-                } catch (final ScriptException se) {
-                }
-                return;
-            }
-        }
-
-        fail("Cannot find nashorn factory!");
-    }
 }
--- a/nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -44,6 +44,7 @@
     private static final boolean VERBOSE  = Boolean.valueOf(System.getProperty("compilertest.verbose"));
     private static final boolean TEST262  = Boolean.valueOf(System.getProperty("compilertest.test262"));
     private static final String TEST_BASIC_DIR  = System.getProperty("test.basic.dir");
+    private static final String TEST_NODE_DIR  = System.getProperty("test.node.dir");
     private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir");
 
     interface TestFilter {
@@ -81,21 +82,22 @@
     @Test
     public void compileAllTests() {
         if (TEST262) {
-            compileTestSet(TEST262_SUITE_DIR, new TestFilter() {
+            compileTestSet(new File(TEST262_SUITE_DIR), new TestFilter() {
                 @Override
                 public boolean exclude(final File file, final String content) {
                     return content.indexOf("@negative") != -1;
                 }
             });
         }
-        compileTestSet(TEST_BASIC_DIR, null);
+        compileTestSet(new File(TEST_BASIC_DIR), null);
+        compileTestSet(new File(TEST_NODE_DIR, "node"), null);
+        compileTestSet(new File(TEST_NODE_DIR, "src"), null);
     }
 
-    private void compileTestSet(final String testSet, final TestFilter filter) {
+    private void compileTestSet(final File testSetDir, final TestFilter filter) {
         passed = 0;
         failed = 0;
         skipped = 0;
-        final File testSetDir = new File(testSet);
         if (! testSetDir.isDirectory()) {
             log("WARNING: " + testSetDir + " not found or not a directory");
             return;
@@ -103,7 +105,7 @@
         log(testSetDir.getAbsolutePath());
         compileJSDirectory(testSetDir, filter);
 
-        log(testSet + " compile done!");
+        log(testSetDir + " compile done!");
         log("compile ok: " + passed);
         log("compile failed: " + failed);
         log("compile skipped: " + skipped);
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/Nashorn401TestSubject.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.runtime;
-
-public class Nashorn401TestSubject {
-    public String method2(int arg) {
-        return "int method 2";
-    }
-
-    public String method2(double arg) {
-        return "double method 2";
-    }
-
-    public String method2(String arg) {
-        return "string method 2";
-    }
-
-    public String method3(double arg) {
-        return "double method 3: " + arg;
-    }
-
-    public String method3(int arg) {
-        return "int method 3: " + arg;
-    }
-
-    public String method4(Double arg) {
-        return "double method 4: " + arg;
-    }
-
-    public String method4(int arg) {
-        return "int method 4: " + arg;
-    }
-
-}
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java	Fri Apr 05 12:12:34 2013 -0700
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java	Fri Apr 05 14:51:24 2013 -0700
@@ -25,7 +25,7 @@
 
 package jdk.nashorn.internal.runtime;
 
-
+import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -40,6 +40,13 @@
  * Tests for trusted client usage of nashorn script engine factory extension API
  */
 public class TrustedScriptEngineTest {
+    @Test
+    public void versionTest() {
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        assertEquals(e.getFactory().getEngineVersion(), Version.version());
+    }
+
     private static class MyClassLoader extends ClassLoader {
         // to check if script engine uses the specified class loader
         private final boolean[] reached = new boolean[1];
@@ -116,4 +123,26 @@
 
         fail("Cannot find nashorn factory!");
     }
+
+    @Test
+    public void factoryOptionsTest() {
+        final ScriptEngineManager sm = new ScriptEngineManager();
+        for (ScriptEngineFactory fac : sm.getEngineFactories()) {
+            if (fac instanceof NashornScriptEngineFactory) {
+                final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+                // specify --no-syntax-extensions flag
+                final String[] options = new String[] { "--no-syntax-extensions" };
+                final ScriptEngine e = nfac.getScriptEngine(options);
+                try {
+                    // try nashorn specific extension
+                    e.eval("var f = funtion(x) 2*x;");
+                    fail("should have thrown exception!");
+                } catch (final ScriptException se) {
+                }
+                return;
+            }
+        }
+
+        fail("Cannot find nashorn factory!");
+    }
 }
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/ConstructorWithArgument.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public abstract class ConstructorWithArgument {
-    private final String token;
-
-    protected ConstructorWithArgument(String token) {
-        this.token = token;
-    }
-
-    public String getToken() {
-        return token;
-    }
-
-    protected abstract void doSomething();
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/DessertTopping.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public interface DessertTopping {
-    public String pourOnDessert();
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/DessertToppingFloorWaxDriver.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public class DessertToppingFloorWaxDriver {
-    public void decorateDessert(DessertTopping dt) {
-        dt.pourOnDessert();
-    }
-
-    public void waxFloor(FloorWax fw) {
-        fw.shineUpTheFloor();
-    }
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/FinalClass.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public final class FinalClass {
-    //empty
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/FloorWax.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public interface FloorWax {
-    public String shineUpTheFloor();
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/NoAccessibleConstructorClass.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public class NoAccessibleConstructorClass {
-    NoAccessibleConstructorClass() { }
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/NonPublicClass.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-class NonPublicClass {
-    public NonPublicClass() { }
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/OuterClass.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public class OuterClass {
-    private final String value;
-
-    public OuterClass(String value) {
-        this.value = value;
-    }
-
-    public static class InnerStaticClass {
-        private final String value;
-
-        public InnerStaticClass(String value) {
-            this.value = value;
-        }
-
-        @Override
-        public String toString() {
-            return "InnerStaticClass[value=" + value + "]";
-        }
-    }
-
-    public class InnerNonStaticClass {
-        private final String value;
-
-        public InnerNonStaticClass(String value) {
-            this.value = value;
-        }
-
-        @Override
-        public String toString() {
-            return "InnerNonStaticClass[value=" + value + ", outer=" + OuterClass.this + "]";
-        }
-    }
-
-    @Override
-    public String toString() {
-        return "OuterClass[value=" + value + "]";
-    }
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/OverloadedSam.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public interface OverloadedSam {
-    public void sam(String s);
-    public void sam(String s1, String s2);
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/OverrideObject.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public class OverrideObject {
-    @Override
-    public int hashCode() {
-        return 5;
-    }
-
-    @Override
-    public String toString() {
-        return "override-object";
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        // TODO: add a FindBugs annotation to ignore EQ_ALWAYS_FALSE here. This is just a test.
-        return false;
-    }
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/StringArgs.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-import java.util.List;
-
-public class StringArgs {
-
-    public static void checkString(List<?> list) {
-        for (Object s : list) {
-            if (!(s instanceof String)) {
-                throw new AssertionError("Not a String: " + s);
-            }
-        }
-    }
-}
--- a/nashorn/test/src/jdk/nashorn/internal/test/models/Toothpaste.java	Fri Apr 05 12:12:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * 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.
- */
-
-package jdk.nashorn.internal.test.models;
-
-public abstract class Toothpaste {
-    public void applyToBrush() {
-        applyToBrushImpl();
-    }
-
-    protected abstract void applyToBrushImpl();
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/ConstructorWithArgument.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public abstract class ConstructorWithArgument {
+    private final String token;
+
+    protected ConstructorWithArgument(String token) {
+        this.token = token;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    protected abstract void doSomething();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/DessertTopping.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public interface DessertTopping {
+    public String pourOnDessert();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/DessertToppingFloorWaxDriver.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public class DessertToppingFloorWaxDriver {
+    public void decorateDessert(DessertTopping dt) {
+        dt.pourOnDessert();
+    }
+
+    public void waxFloor(FloorWax fw) {
+        fw.shineUpTheFloor();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/FinalClass.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public final class FinalClass {
+    //empty
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/FloorWax.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public interface FloorWax {
+    public String shineUpTheFloor();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/Nashorn401TestSubject.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public class Nashorn401TestSubject {
+    public String method2(int arg) {
+        return "int method 2";
+    }
+
+    public String method2(double arg) {
+        return "double method 2";
+    }
+
+    public String method2(String arg) {
+        return "string method 2";
+    }
+
+    public String method3(double arg) {
+        return "double method 3: " + arg;
+    }
+
+    public String method3(int arg) {
+        return "int method 3: " + arg;
+    }
+
+    public String method4(Double arg) {
+        return "double method 4: " + arg;
+    }
+
+    public String method4(int arg) {
+        return "int method 4: " + arg;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/NoAccessibleConstructorClass.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public class NoAccessibleConstructorClass {
+    NoAccessibleConstructorClass() { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/NonPublicClass.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+class NonPublicClass {
+    public NonPublicClass() { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/OuterClass.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public class OuterClass {
+    private final String value;
+
+    public OuterClass(String value) {
+        this.value = value;
+    }
+
+    public static class InnerStaticClass {
+        private final String value;
+
+        public InnerStaticClass(String value) {
+            this.value = value;
+        }
+
+        @Override
+        public String toString() {
+            return "InnerStaticClass[value=" + value + "]";
+        }
+    }
+
+    public class InnerNonStaticClass {
+        private final String value;
+
+        public InnerNonStaticClass(String value) {
+            this.value = value;
+        }
+
+        @Override
+        public String toString() {
+            return "InnerNonStaticClass[value=" + value + ", outer=" + OuterClass.this + "]";
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "OuterClass[value=" + value + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/OverloadedSam.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public interface OverloadedSam {
+    public void sam(String s);
+    public void sam(String s1, String s2);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/OverrideObject.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public class OverrideObject {
+    @Override
+    public int hashCode() {
+        return 5;
+    }
+
+    @Override
+    public String toString() {
+        return "override-object";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        // TODO: add a FindBugs annotation to ignore EQ_ALWAYS_FALSE here. This is just a test.
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/SourceHelper.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URL;
+import jdk.nashorn.internal.runtime.Source;
+
+/**
+ * Helper class to facilitate script access of nashorn Source class.
+ */
+public final class SourceHelper {
+    private SourceHelper() {}
+
+    public static String baseURL(final URL url) {
+        return Source.baseURL(url);
+    }
+
+    public static String readFully(final File file) throws IOException {
+        return new String(Source.readFully(file));
+    }
+
+    public static String readFully(final URL url) throws IOException {
+        return new Source(url.toString(), url).getString();
+    }
+
+    public static String readFully(final Reader reader) throws IOException {
+        return new String(Source.readFully(reader));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/StringArgs.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+import java.util.List;
+
+public class StringArgs {
+
+    public static void checkString(List<?> list) {
+        for (Object s : list) {
+            if (!(s instanceof String)) {
+                throw new AssertionError("Not a String: " + s);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/Toothpaste.java	Fri Apr 05 14:51:24 2013 -0700
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package jdk.nashorn.test.models;
+
+public abstract class Toothpaste {
+    public void applyToBrush() {
+        applyToBrushImpl();
+    }
+
+    protected abstract void applyToBrushImpl();
+}