--- a/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -296,3 +296,4 @@
6efe265424e3f1ea596408a1f71baf2de316c772 jdk9-b51
d6224d6021459ac8b3832e822f5acc849fa944af jdk9-b52
874d76e4699dfcd61ae1826c9fe0ddc1610ad598 jdk9-b53
+82cd31c5d6ca8d4c1653f4eb1c09eb2d9a3b2813 jdk9-b54
--- a/.hgtags-top-repo Wed Mar 11 08:30:40 2015 -0700
+++ b/.hgtags-top-repo Tue Mar 17 12:30:53 2015 -0700
@@ -296,3 +296,4 @@
6207b4b8731ca75c51b031c47daa813ab92ef558 jdk9-b51
1822e59f17121b09e7899cf338cfb6e37fe5fceb jdk9-b52
d6ed47125a76cd1cf8a100568507bfb5e9669d9f jdk9-b53
+cb7367141e910e265b8344a8facee740bd1e5467 jdk9-b54
--- a/common/autoconf/configure.ac Wed Mar 11 08:30:40 2015 -0700
+++ b/common/autoconf/configure.ac Tue Mar 17 12:30:53 2015 -0700
@@ -195,6 +195,7 @@
# Setup debug symbols (need objcopy from the toolchain for that)
JDKOPT_SETUP_DEBUG_SYMBOLS
+JDKOPT_SETUP_CODE_COVERAGE
###############################################################################
#
--- a/common/autoconf/flags.m4 Wed Mar 11 08:30:40 2015 -0700
+++ b/common/autoconf/flags.m4 Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -478,6 +478,8 @@
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
fi
+ CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
+ CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
@@ -529,7 +531,7 @@
# CXXFLAGS_JDK - C++ Compiler flags
# COMMON_CCXXFLAGS_JDK - common to C and C++
if test "x$TOOLCHAIN_TYPE" = xgcc; then
- COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
arm )
@@ -549,7 +551,6 @@
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
- CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
fi
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
@@ -676,7 +677,7 @@
# The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
- CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
+ CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
# Executable flags
CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
@@ -687,6 +688,19 @@
AC_SUBST(CXXFLAGS_JDKLIB)
AC_SUBST(CXXFLAGS_JDKEXE)
+ # Flags for compiling test libraries
+ CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
+ CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
+
+ # Flags for compiling test executables
+ CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
+ CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
+
+ AC_SUBST(CFLAGS_TESTLIB)
+ AC_SUBST(CFLAGS_TESTEXE)
+ AC_SUBST(CXXFLAGS_TESTLIB)
+ AC_SUBST(CXXFLAGS_TESTEXE)
+
# Setup LDFLAGS et al.
#
@@ -800,6 +814,16 @@
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
AC_SUBST(LDFLAGS_CXX_JDK)
+
+ LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
+ LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
+ LDFLAGS_TESTLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX"
+ LDFLAGS_TESTEXE_SUFFIX="$LDFLAGS_JDKEXE_SUFFIX"
+
+ AC_SUBST(LDFLAGS_TESTLIB)
+ AC_SUBST(LDFLAGS_TESTEXE)
+ AC_SUBST(LDFLAGS_TESTLIB_SUFFIX)
+ AC_SUBST(LDFLAGS_TESTEXE_SUFFIX)
])
# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
@@ -883,17 +907,31 @@
case "${TOOLCHAIN_TYPE}" in
microsoft)
+ DISABLE_WARNING_PREFIX="-wd"
CFLAGS_WARNINGS_ARE_ERRORS="-WX"
;;
solstudio)
+ DISABLE_WARNING_PREFIX="-erroff="
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
;;
gcc)
+ # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
+ FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist],
+ [GCC_CAN_DISABLE_WARNINGS=true],
+ [GCC_CAN_DISABLE_WARNINGS=false]
+ )
+ if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
+ DISABLE_WARNING_PREFIX="-Wno-"
+ else
+ DISABLE_WARNING_PREFIX=
+ fi
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
;;
clang)
+ DISABLE_WARNING_PREFIX="-Wno-"
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
;;
esac
+ AC_SUBST(DISABLE_WARNING_PREFIX)
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
])
--- a/common/autoconf/generated-configure.sh Wed Mar 11 08:30:40 2015 -0700
+++ b/common/autoconf/generated-configure.sh Tue Mar 17 12:30:53 2015 -0700
@@ -680,16 +680,26 @@
X_CFLAGS
XMKMF
FIXPATH
+GCOV_ENABLED
ZIP_DEBUGINFO_FILES
ENABLE_DEBUG_SYMBOLS
CFLAGS_WARNINGS_ARE_ERRORS
+DISABLE_WARNING_PREFIX
COMPILER_SUPPORTS_TARGET_BITS_FLAG
ZERO_ARCHFLAG
+LDFLAGS_TESTEXE_SUFFIX
+LDFLAGS_TESTLIB_SUFFIX
+LDFLAGS_TESTEXE
+LDFLAGS_TESTLIB
LDFLAGS_CXX_JDK
LDFLAGS_JDKEXE_SUFFIX
LDFLAGS_JDKLIB_SUFFIX
LDFLAGS_JDKEXE
LDFLAGS_JDKLIB
+CXXFLAGS_TESTEXE
+CXXFLAGS_TESTLIB
+CFLAGS_TESTEXE
+CFLAGS_TESTLIB
CXXFLAGS_JDKEXE
CXXFLAGS_JDKLIB
CFLAGS_JDKEXE
@@ -1084,6 +1094,7 @@
with_extra_ldflags
enable_debug_symbols
enable_zip_debug_info
+enable_native_coverage
with_x
with_cups
with_cups_include
@@ -1852,6 +1863,9 @@
--disable-debug-symbols disable generation of debug symbols [enabled]
--disable-zip-debug-info
disable zipping of debug-info files [enabled]
+ --enable-native-coverage
+ enable native compilation with code coverage
+ data[disabled]
--disable-freetype-bundling
disable bundling of the freetype library with the
build result [enabled on Windows or when using
@@ -3736,7 +3750,7 @@
#
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -3993,6 +4007,12 @@
+################################################################################
+#
+# Gcov coverage data for hotspot
+#
+
+
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4348,7 +4368,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1425490712
+DATE_WHEN_GENERATED=1425994551
###############################################################################
#
@@ -42349,6 +42369,8 @@
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
fi
+ CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
+ CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
@@ -42415,7 +42437,7 @@
# CXXFLAGS_JDK - C++ Compiler flags
# COMMON_CCXXFLAGS_JDK - common to C and C++
if test "x$TOOLCHAIN_TYPE" = xgcc; then
- COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
arm )
@@ -42435,7 +42457,6 @@
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
- CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
fi
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
@@ -42562,7 +42583,7 @@
# The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
- CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
+ CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
# Executable flags
CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
@@ -42573,6 +42594,19 @@
+ # Flags for compiling test libraries
+ CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
+ CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
+
+ # Flags for compiling test executables
+ CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
+ CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
+
+
+
+
+
+
# Setup LDFLAGS et al.
#
@@ -42687,6 +42721,16 @@
+ LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
+ LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
+ LDFLAGS_TESTLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX"
+ LDFLAGS_TESTEXE_SUFFIX="$LDFLAGS_JDKEXE_SUFFIX"
+
+
+
+
+
+
# Some Zero and Shark settings.
# ZERO_ARCHFLAG tells the compiler which mode to build for
@@ -42835,21 +42879,97 @@
case "${TOOLCHAIN_TYPE}" in
microsoft)
+ DISABLE_WARNING_PREFIX="-wd"
CFLAGS_WARNINGS_ARE_ERRORS="-WX"
;;
solstudio)
+ DISABLE_WARNING_PREFIX="-erroff="
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
;;
gcc)
+ # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
+$as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
+ supports=yes
+
+ saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CFLAGS="$saved_cflags"
+
+ saved_cxxflags="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAG -Wno-this-is-a-warning-that-do-not-exist"
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CXXFLAGS="$saved_cxxflags"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+ if test "x$supports" = "xyes" ; then
+ GCC_CAN_DISABLE_WARNINGS=true
+ else
+ GCC_CAN_DISABLE_WARNINGS=false
+
+ fi
+
+ if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
+ DISABLE_WARNING_PREFIX="-Wno-"
+ else
+ DISABLE_WARNING_PREFIX=
+ fi
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
;;
clang)
+ DISABLE_WARNING_PREFIX="-Wno-"
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
;;
esac
+
# Setup debug symbols (need objcopy from the toolchain for that)
#
@@ -42915,6 +43035,45 @@
+ # Check whether --enable-native-coverage was given.
+if test "${enable_native_coverage+set}" = set; then :
+ enableval=$enable_native_coverage;
+fi
+
+ GCOV_ENABLED="false"
+ if test "x$enable_native_coverage" = "xyes"; then
+ if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native coverage is enabled" >&5
+$as_echo_n "checking if native coverage is enabled... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
+ GCOV_LDFLAGS="-fprofile-arcs"
+ LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $GCOV_CFLAGS"
+ LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $GCOV_CFLAGS"
+ LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $GCOV_LDFLAGS"
+ CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
+ CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
+ CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
+ CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
+ LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
+ GCOV_ENABLED="true"
+ else
+ as_fn_error $? "--enable-native-coverage only works with toolchain type gcc" "$LINENO" 5
+ fi
+ elif test "x$enable_native_coverage" = "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native coverage is enabled" >&5
+$as_echo_n "checking if native coverage is enabled... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ elif test "x$enable_native_coverage" != "x"; then
+ as_fn_error $? "--enable-native-coverage can only be assigned \"yes\" or \"no\"" "$LINENO" 5
+ fi
+
+
+
+
###############################################################################
#
# Check dependencies for external and internal libraries.
--- a/common/autoconf/jdk-options.m4 Wed Mar 11 08:30:40 2015 -0700
+++ b/common/autoconf/jdk-options.m4 Tue Mar 17 12:30:53 2015 -0700
@@ -640,3 +640,41 @@
AC_SUBST(ENABLE_DEBUG_SYMBOLS)
AC_SUBST(ZIP_DEBUGINFO_FILES)
])
+
+################################################################################
+#
+# Gcov coverage data for hotspot
+#
+AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
+[
+ AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
+ [enable native compilation with code coverage data@<:@disabled@:>@])])
+ GCOV_ENABLED="false"
+ if test "x$enable_native_coverage" = "xyes"; then
+ if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
+ AC_MSG_CHECKING([if native coverage is enabled])
+ AC_MSG_RESULT([yes])
+ GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
+ GCOV_LDFLAGS="-fprofile-arcs"
+ LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $GCOV_CFLAGS"
+ LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $GCOV_CFLAGS"
+ LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $GCOV_LDFLAGS"
+ CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
+ CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
+ CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
+ CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
+ LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
+ GCOV_ENABLED="true"
+ else
+ AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
+ fi
+ elif test "x$enable_native_coverage" = "xno"; then
+ AC_MSG_CHECKING([if native coverage is enabled])
+ AC_MSG_RESULT([no])
+ elif test "x$enable_native_coverage" != "x"; then
+ AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
+ fi
+
+ AC_SUBST(GCOV_ENABLED)
+])
--- a/common/autoconf/spec.gmk.in Wed Mar 11 08:30:40 2015 -0700
+++ b/common/autoconf/spec.gmk.in Tue Mar 17 12:30:53 2015 -0700
@@ -292,6 +292,8 @@
# Enable RMIConnector IIOP transport
RMICONNECTOR_IIOP=@RMICONNECTOR_IIOP@
+GCOV_ENABLED=@GCOV_ENABLED@
+
# Necessary additional compiler flags to compile X11
X_CFLAGS:=@X_CFLAGS@
X_LIBS:=@X_LIBS@
@@ -324,6 +326,7 @@
C_FLAG_DEPS:=@C_FLAG_DEPS@
CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
+DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
@@ -379,6 +382,16 @@
# Sometimes a different linker is needed for c++ executables
LDEXECXX:=@FIXPATH@ @LDEXECXX@
+# Compiler and linker flags used when building native tests
+CFLAGS_TESTLIB:=@CFLAGS_TESTLIB@
+CXXFLAGS_TESTLIB:=@CXXFLAGS_TESTLIB@
+CFLAGS_TESTEXE:=@CFLAGS_TESTEXE@
+CXXFLAGS_TESTEXE:=@CXXFLAGS_TESTEXE@
+LDFLAGS_TESTLIB:=@LDFLAGS_TESTLIB@
+LDFLAGS_TESTLIB_SUFFIX:=@LDFLAGS_TESTLIB_SUFFIX@
+LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@
+LDFLAGS_TESTEXE_SUFFIX:=@LDFLAGS_TESTEXE_SUFFIX@
+
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
# build platform.
BUILD_CC:=@FIXPATH@ @BUILD_CC@
@@ -701,6 +714,10 @@
TEST_IMAGE_SUBDIR:=test
TEST_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR)
+# Symbols image
+SYMBOLS_IMAGE_SUBDIR:=symbols
+SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)
+
# Macosx bundles directory definitions
JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
--- a/common/bin/hgforest.sh Wed Mar 11 08:30:40 2015 -0700
+++ b/common/bin/hgforest.sh Tue Mar 17 12:30:53 2015 -0700
@@ -26,6 +26,9 @@
usage() {
echo "usage: $0 [-h|--help] [-q|--quiet] [-v|--verbose] [-s|--sequential] [--] <command> [commands...]" > ${status_output}
+ echo "command format : mercurial-command [ "jdk" ] [ extra-url ]"
+ echo "command option: jdk : used only with clone command to request just the extra repos for JDK-only builds"
+ echo "command option : extra-url : server hosting the extra repositories"
echo "Environment variables which modify behaviour:"
echo " HGFOREST_QUIET : (boolean) If 'true' then standard output is redirected to /dev/null"
echo " HGFOREST_VERBOSE : (boolean) If 'true' then Mercurial asked to produce verbose output"
@@ -179,7 +182,8 @@
trap 'nice_exit' EXIT
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
-subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
+jdk_subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed"
+subrepos_extra="$jdk_subrepos_extra deploy install sponsors pubs"
# Only look in specific locations for possible forests (avoids long searches)
pull_default=""
@@ -209,6 +213,11 @@
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
if [ $# -gt 0 ] ; then
+ if [ "x${1}" = "xjdk" ] ; then
+ subrepos_extra=$jdk_subrepos_extra
+ echo "subrepos being cloned are $subrepos_extra"
+ shift
+ fi
# if there is an "extra sources" path then reparent "extra" repos to that path
if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
echo "ERROR: Need initial clone from non-local source" > ${status_output}
--- a/common/bin/unshuffle_list.txt Wed Mar 11 08:30:40 2015 -0700
+++ b/common/bin/unshuffle_list.txt Tue Mar 17 12:30:53 2015 -0700
@@ -1299,15 +1299,14 @@
jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
-jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
-jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
-jdk/src/jdk.dev/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool
-jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar
jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii
jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof
jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver : jdk/src/share/classes/com/sun/net/httpserver
jdk/src/jdk.httpserver/share/classes/sun/net/httpserver : jdk/src/share/classes/sun/net/httpserver
+jdk/src/jdk.jartool/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
+jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
+jdk/src/jdk.jartool/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar
jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd : jdk/src/share/classes/sun/tools/jcmd
jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo : jdk/src/share/classes/sun/tools/jinfo
jdk/src/jdk.jcmd/share/classes/sun/tools/jmap : jdk/src/share/classes/sun/tools/jmap
@@ -1433,6 +1432,27 @@
jdk/src/jdk.naming.dns/share/classes/sun/net/spi/nameservice/dns : jdk/src/share/classes/sun/net/spi/nameservice/dns
jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry : jdk/src/share/classes/com/sun/jndi/rmi/registry
jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/url/rmi : jdk/src/share/classes/com/sun/jndi/url/rmi
+jdk/src/jdk.pack200/share/native/common-unpack/bands.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp
+jdk/src/jdk.pack200/share/native/common-unpack/bands.h : jdk/src/share/native/com/sun/java/util/jar/pack/bands.h
+jdk/src/jdk.pack200/share/native/common-unpack/bytes.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp
+jdk/src/jdk.pack200/share/native/common-unpack/bytes.h : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
+jdk/src/jdk.pack200/share/native/common-unpack/coding.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp
+jdk/src/jdk.pack200/share/native/common-unpack/coding.h : jdk/src/share/native/com/sun/java/util/jar/pack/coding.h
+jdk/src/jdk.pack200/share/native/common-unpack/constants.h : jdk/src/share/native/com/sun/java/util/jar/pack/constants.h
+jdk/src/jdk.pack200/share/native/common-unpack/defines.h : jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
+jdk/src/jdk.pack200/share/native/common-unpack/unpack.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
+jdk/src/jdk.pack200/share/native/common-unpack/unpack.h : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
+jdk/src/jdk.pack200/share/native/common-unpack/utils.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
+jdk/src/jdk.pack200/share/native/common-unpack/utils.h : jdk/src/share/native/com/sun/java/util/jar/pack/utils.h
+jdk/src/jdk.pack200/share/native/common-unpack/zip.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
+jdk/src/jdk.pack200/share/native/common-unpack/zip.h : jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
+jdk/src/jdk.pack200/share/native/libjsdt : jdk/src/share/native/sun/tracing/dtrace
+jdk/src/jdk.pack200/share/native/libunpack/jni.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
+jdk/src/jdk.pack200/share/native/unpack200/main.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
+jdk/src/jdk.pack200/unix/native/libjsdt/jvm_symbols_md.c : jdk/src/solaris/native/sun/tracing/dtrace/jvm_symbols_md.c
+jdk/src/jdk.pack200/windows/native/libjsdt/jvm_symbols_md.c : jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c
+jdk/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest : jdk/src/windows/resource/unpack200_proto.exe.manifest
+jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool
jdk/src/jdk.rmic/share/classes/sun/rmi/rmic : jdk/src/share/classes/sun/rmi/rmic
jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/newrmic : jdk/src/share/classes/sun/rmi/rmic/newrmic
jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/newrmic/jrmp : jdk/src/share/classes/sun/rmi/rmic/newrmic/jrmp
@@ -1442,28 +1462,6 @@
jdk/src/jdk.rmic/share/classes/sun/tools/java : jdk/src/share/classes/sun/tools/java
jdk/src/jdk.rmic/share/classes/sun/tools/tree : jdk/src/share/classes/sun/tools/tree
jdk/src/jdk.rmic/share/classes/sun/tools/util : jdk/src/share/classes/sun/tools/util
-jdk/src/jdk.runtime/share/classes/com/sun/tracing : jdk/src/share/classes/com/sun/tracing
-jdk/src/jdk.runtime/share/classes/sun/tracing : jdk/src/share/classes/sun/tracing
-jdk/src/jdk.runtime/share/native/common-unpack/bands.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp
-jdk/src/jdk.runtime/share/native/common-unpack/bands.h : jdk/src/share/native/com/sun/java/util/jar/pack/bands.h
-jdk/src/jdk.runtime/share/native/common-unpack/bytes.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp
-jdk/src/jdk.runtime/share/native/common-unpack/bytes.h : jdk/src/share/native/com/sun/java/util/jar/pack/bytes.h
-jdk/src/jdk.runtime/share/native/common-unpack/coding.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp
-jdk/src/jdk.runtime/share/native/common-unpack/coding.h : jdk/src/share/native/com/sun/java/util/jar/pack/coding.h
-jdk/src/jdk.runtime/share/native/common-unpack/constants.h : jdk/src/share/native/com/sun/java/util/jar/pack/constants.h
-jdk/src/jdk.runtime/share/native/common-unpack/defines.h : jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
-jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
-jdk/src/jdk.runtime/share/native/common-unpack/unpack.h : jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
-jdk/src/jdk.runtime/share/native/common-unpack/utils.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
-jdk/src/jdk.runtime/share/native/common-unpack/utils.h : jdk/src/share/native/com/sun/java/util/jar/pack/utils.h
-jdk/src/jdk.runtime/share/native/common-unpack/zip.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
-jdk/src/jdk.runtime/share/native/common-unpack/zip.h : jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
-jdk/src/jdk.runtime/share/native/libjsdt : jdk/src/share/native/sun/tracing/dtrace
-jdk/src/jdk.runtime/share/native/libunpack/jni.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp
-jdk/src/jdk.runtime/share/native/unpack200/main.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
-jdk/src/jdk.runtime/unix/native/libjsdt/jvm_symbols_md.c : jdk/src/solaris/native/sun/tracing/dtrace/jvm_symbols_md.c
-jdk/src/jdk.runtime/windows/native/libjsdt/jvm_symbols_md.c : jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c
-jdk/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest : jdk/src/windows/resource/unpack200_proto.exe.manifest
jdk/src/jdk.sctp/macosx/classes/sun/nio/ch/sctp : jdk/src/macosx/classes/sun/nio/ch/sctp
jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp : jdk/src/share/classes/com/sun/nio/sctp
jdk/src/jdk.sctp/share/classes/sun/nio/ch/sctp : jdk/src/share/classes/sun/nio/ch/sctp
--- a/corba/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/corba/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -296,3 +296,4 @@
2309c02386d1fa4ced5051873ffb9e04874f7a44 jdk9-b51
b8538bbb6f224ab1dabba579137099c166ad4724 jdk9-b52
aadc16ca5ab7d56f92ef9dbfa443595a939241b4 jdk9-b53
+d469c5ad0c763e325a78e0af3016878a57dfc5cc jdk9-b54
--- a/hotspot/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -456,3 +456,4 @@
403b9cbadb04d3d1201823591cf931dc93b38e3a jdk9-b51
9fb7fdc554db5be5c5b10f88f529ec3b870c44e3 jdk9-b52
effd5ef0c3eb4bb85aa975c489d6761dbf13ad6a jdk9-b53
+c3b117fa5bdedfafd9ed236403e6d406911195b1 jdk9-b54
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -2204,7 +2204,8 @@
// Write the card table byte if needed.
void MacroAssembler::card_write_barrier_post(Register Rstore_addr, Register Rnew_val, Register Rtmp) {
- CardTableModRefBS* bs = (CardTableModRefBS*) Universe::heap()->barrier_set();
+ CardTableModRefBS* bs =
+ barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
assert(bs->kind() == BarrierSet::CardTableModRef ||
bs->kind() == BarrierSet::CardTableExtension, "wrong barrier");
#ifdef ASSERT
@@ -2310,9 +2311,8 @@
Label& filtered = (filtered_ext != NULL) ? *filtered_ext : filtered_int;
assert_different_registers(Rstore_addr, Rnew_val, Rtmp1, Rtmp2);
- G1SATBCardTableModRefBS* bs = (G1SATBCardTableModRefBS*) Universe::heap()->barrier_set();
- assert(bs->kind() == BarrierSet::G1SATBCT ||
- bs->kind() == BarrierSet::G1SATBCTLogging, "wrong barrier");
+ G1SATBCardTableLoggingModRefBS* bs =
+ barrier_set_cast<G1SATBCardTableLoggingModRefBS>(Universe::heap()->barrier_set());
// Does store cross heap regions?
if (G1RSBarrierRegionFilter) {
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -694,7 +694,7 @@
__ release();
}
- CardTableModRefBS* const ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* const ct = barrier_set_cast<CardTableModRefBS>(bs);
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
assert_different_registers(addr, count, tmp);
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -916,7 +916,7 @@
Register cardtable = G5;
Register tmp = G1_scratch;
Register tmp2 = G3_scratch;
- jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base;
+ jbyte* byte_map_base = barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base;
Label not_already_dirty, restart, refill, young_card;
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -3858,9 +3858,8 @@
if (new_val == G0) return;
- G1SATBCardTableModRefBS* bs = (G1SATBCardTableModRefBS*) Universe::heap()->barrier_set();
- assert(bs->kind() == BarrierSet::G1SATBCT ||
- bs->kind() == BarrierSet::G1SATBCTLogging, "wrong barrier");
+ G1SATBCardTableLoggingModRefBS* bs =
+ barrier_set_cast<G1SATBCardTableLoggingModRefBS>(Universe::heap()->barrier_set());
if (G1RSBarrierRegionFilter) {
xor3(store_addr, new_val, tmp);
@@ -3904,7 +3903,8 @@
void MacroAssembler::card_write_barrier_post(Register store_addr, Register new_val, Register tmp) {
// If we're writing constant NULL, we can skip the write barrier.
if (new_val == G0) return;
- CardTableModRefBS* bs = (CardTableModRefBS*) Universe::heap()->barrier_set();
+ CardTableModRefBS* bs =
+ barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
assert(bs->kind() == BarrierSet::CardTableModRef ||
bs->kind() == BarrierSet::CardTableExtension, "wrong barrier");
card_table_write(bs->byte_map_base, tmp, store_addr);
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -1019,7 +1019,7 @@
case BarrierSet::CardTableModRef:
case BarrierSet::CardTableExtension:
{
- CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
assert_different_registers(addr, count, tmp);
--- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -1718,8 +1718,8 @@
// arg0: store_address
Address store_addr(rbp, 2*BytesPerWord);
- BarrierSet* bs = Universe::heap()->barrier_set();
- CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* ct =
+ barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
Label done;
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -4204,8 +4204,8 @@
Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
PtrQueue::byte_offset_of_buf()));
- BarrierSet* bs = Universe::heap()->barrier_set();
- CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* ct =
+ barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
Label done;
@@ -4305,7 +4305,7 @@
void MacroAssembler::store_check_part_2(Register obj) {
BarrierSet* bs = Universe::heap()->barrier_set();
assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
- CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
// The calculation for byte_map_base is as follows:
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -752,7 +752,7 @@
case BarrierSet::CardTableModRef:
case BarrierSet::CardTableExtension:
{
- CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
Label L_loop;
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -1272,7 +1272,7 @@
case BarrierSet::CardTableModRef:
case BarrierSet::CardTableExtension:
{
- CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+ CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
Label L_loop;
--- a/hotspot/src/os/windows/vm/attachListener_windows.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/os/windows/vm/attachListener_windows.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -62,7 +62,7 @@
class Win32AttachListener: AllStatic {
private:
enum {
- preallocate_count = 4 // number of preallocated operations
+ max_enqueued_operations = 4
};
// protects the preallocated list and the operation list
@@ -83,9 +83,12 @@
static void set_tail(Win32AttachOperation* tail) { _tail = tail; }
- // used to wakeup the listener
- static HANDLE _wakeup;
- static HANDLE wakeup() { return _wakeup; }
+ // A semaphore is used for communication about enqueued operations.
+ // The maximum count for the semaphore object will be set to "max_enqueued_operations".
+ // The state of a semaphore is signaled when its count is greater than
+ // zero (there are operations enqueued), and nonsignaled when it is zero.
+ static HANDLE _enqueued_ops_semaphore;
+ static HANDLE enqueued_ops_semaphore() { return _enqueued_ops_semaphore; }
public:
enum {
@@ -110,7 +113,7 @@
// statics
HANDLE Win32AttachListener::_mutex;
-HANDLE Win32AttachListener::_wakeup;
+HANDLE Win32AttachListener::_enqueued_ops_semaphore;
Win32AttachOperation* Win32AttachListener::_avail;
Win32AttachOperation* Win32AttachListener::_head;
Win32AttachOperation* Win32AttachListener::_tail;
@@ -155,20 +158,19 @@
};
-// preallocate the required number of operations
+// Preallocate the maximum number of operations that can be enqueued.
int Win32AttachListener::init() {
_mutex = (void*)::CreateMutex(NULL, FALSE, NULL);
guarantee(_mutex != (HANDLE)NULL, "mutex creation failed");
- _wakeup = ::CreateSemaphore(NULL, 0, 1, NULL);
- guarantee(_wakeup != (HANDLE)NULL, "semaphore creation failed");
+ _enqueued_ops_semaphore = ::CreateSemaphore(NULL, 0, max_enqueued_operations, NULL);
+ guarantee(_enqueued_ops_semaphore != (HANDLE)NULL, "semaphore creation failed");
set_head(NULL);
set_tail(NULL);
+ set_available(NULL);
- // preallocate a few operations
- set_available(NULL);
- for (int i=0; i<preallocate_count; i++) {
+ for (int i=0; i<max_enqueued_operations; i++) {
Win32AttachOperation* op = new Win32AttachOperation();
op->set_next(available());
set_available(op);
@@ -221,8 +223,12 @@
op->set_arg(2, arg2);
op->set_pipe(pipename);
- // wakeup the thread waiting for operations
- ::ReleaseSemaphore(wakeup(), 1, NULL);
+ // Increment number of enqueued operations.
+ // Side effect: Semaphore will be signaled and will release
+ // any blocking waiters (i.e. the AttachListener thread).
+ BOOL not_exceeding_semaphore_maximum_count =
+ ::ReleaseSemaphore(enqueued_ops_semaphore(), 1, NULL);
+ guarantee(not_exceeding_semaphore_maximum_count, "invariant");
}
::ReleaseMutex(mutex());
@@ -230,10 +236,12 @@
}
-// dequeue the operation from the head of the operation list. If
+// dequeue the operation from the head of the operation list.
Win32AttachOperation* Win32AttachListener::dequeue() {
for (;;) {
- DWORD res = ::WaitForSingleObject(wakeup(), INFINITE);
+ DWORD res = ::WaitForSingleObject(enqueued_ops_semaphore(), INFINITE);
+ // returning from WaitForSingleObject will have decreased
+ // the current count of the semaphore by 1.
guarantee(res == WAIT_OBJECT_0, "wait failed");
res = ::WaitForSingleObject(mutex(), INFINITE);
--- a/hotspot/src/share/vm/c1/c1_LIR.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIR.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -2105,8 +2105,14 @@
// LIR_OpProfileType
void LIR_OpProfileType::print_instr(outputStream* out) const {
- out->print("exact = "); exact_klass()->print_name_on(out);
- out->print("current = "); ciTypeEntries::print_ciklass(out, current_klass());
+ out->print("exact = ");
+ if (exact_klass() == NULL) {
+ out->print("unknown");
+ } else {
+ exact_klass()->print_name_on(out);
+ }
+ out->print(" current = "); ciTypeEntries::print_ciklass(out, current_klass());
+ out->print(" ");
mdp()->print(out); out->print(" ");
obj()->print(out); out->print(" ");
tmp()->print(out); out->print(" ");
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1582,9 +1582,9 @@
////////////////////////////////////////////////////////////////////////
void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
-
- assert(sizeof(*((CardTableModRefBS*)_bs)->byte_map_base) == sizeof(jbyte), "adjust this code");
- LIR_Const* card_table_base = new LIR_Const(((CardTableModRefBS*)_bs)->byte_map_base);
+ CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(_bs);
+ assert(sizeof(*(ct->byte_map_base)) == sizeof(jbyte), "adjust this code");
+ LIR_Const* card_table_base = new LIR_Const(ct->byte_map_base);
if (addr->is_address()) {
LIR_Address* address = addr->as_address_ptr();
// ptr cannot be an object because we use this barrier for array card marks
@@ -1609,7 +1609,6 @@
__ move(new LIR_Address(FrameMap::Rthread_opr, in_bytes(JavaThread::card_table_base_offset()), T_ADDRESS), tmp);
}
- CardTableModRefBS* ct = (CardTableModRefBS*)_bs;
LIR_Address *card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTableModRefBS::card_shift, 0, T_BYTE);
if(((int)ct->byte_map_base & 0xff) == 0) {
__ move(tmp, card_addr);
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -43,7 +43,7 @@
#define TRACE_BCEA(level, code)
#endif
-// Maintain a map of which aguments a local variable or
+// Maintain a map of which arguments a local variable or
// stack slot may contain. In addition to tracking
// arguments, it tracks two special values, "allocated"
// which represents any object allocated in the current
@@ -319,14 +319,16 @@
bool must_record_dependencies = false;
for (i = arg_size - 1; i >= 0; i--) {
ArgumentMap arg = state.raw_pop();
- if (!is_argument(arg))
+ // Check if callee arg is a caller arg or an allocated object
+ bool allocated = arg.contains_allocated();
+ if (!(is_argument(arg) || allocated))
continue;
for (int j = 0; j < _arg_size; j++) {
if (arg.contains(j)) {
_arg_modified[j] |= analyzer._arg_modified[i];
}
}
- if (!is_arg_stack(arg)) {
+ if (!(is_arg_stack(arg) || allocated)) {
// arguments have already been recognized as escaping
} else if (analyzer.is_arg_stack(i) && !analyzer.is_arg_returned(i)) {
set_method_escape(arg);
@@ -1392,12 +1394,12 @@
method()->print_short_name();
tty->print_cr(has_dependencies() ? " (not stored)" : "");
tty->print(" non-escaping args: ");
- _arg_local.print_on(tty);
+ _arg_local.print();
tty->print(" stack-allocatable args: ");
- _arg_stack.print_on(tty);
+ _arg_stack.print();
if (_return_local) {
tty->print(" returned args: ");
- _arg_returned.print_on(tty);
+ _arg_returned.print();
} else if (is_return_allocated()) {
tty->print_cr(" return allocated value");
} else {
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -1091,6 +1091,7 @@
}
// update idnum for new location
merged_methods->at(i)->set_method_idnum(i);
+ merged_methods->at(i)->set_orig_method_idnum(i);
}
// Verify correct order
--- a/hotspot/src/share/vm/code/codeCache.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/code/codeCache.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -360,7 +360,7 @@
* run the constructor for the CodeBlob subclass he is busy
* instantiating.
*/
-CodeBlob* CodeCache::allocate(int size, int code_blob_type) {
+CodeBlob* CodeCache::allocate(int size, int code_blob_type, bool strict) {
// Possibly wakes up the sweeper thread.
NMethodSweeper::notify(code_blob_type);
assert_locked_or_safepoint(CodeCache_lock);
@@ -379,11 +379,28 @@
if (cb != NULL) break;
if (!heap->expand_by(CodeCacheExpansionSize)) {
// Expansion failed
- if (SegmentedCodeCache && (code_blob_type == CodeBlobType::NonNMethod)) {
- // Fallback solution: Store non-nmethod code in the non-profiled code heap.
- // Note that at in the sweeper, we check the reverse_free_ratio of the non-profiled
- // code heap and force stack scanning if less than 10% if the code heap are free.
- return allocate(size, CodeBlobType::MethodNonProfiled);
+ if (SegmentedCodeCache && !strict) {
+ // Fallback solution: Try to store code in another code heap.
+ // Note that in the sweeper, we check the reverse_free_ratio of the code heap
+ // and force stack scanning if less than 10% of the code heap are free.
+ int type = code_blob_type;
+ switch (type) {
+ case CodeBlobType::NonNMethod:
+ type = CodeBlobType::MethodNonProfiled;
+ strict = false; // Allow recursive search for other heaps
+ break;
+ case CodeBlobType::MethodProfiled:
+ type = CodeBlobType::MethodNonProfiled;
+ strict = true;
+ break;
+ case CodeBlobType::MethodNonProfiled:
+ type = CodeBlobType::MethodProfiled;
+ strict = true;
+ break;
+ }
+ if (heap_available(type)) {
+ return allocate(size, type, strict);
+ }
}
MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CompileBroker::handle_full_code_cache(code_blob_type);
--- a/hotspot/src/share/vm/code/codeCache.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/code/codeCache.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -122,7 +122,7 @@
static void initialize();
// Allocation/administration
- static CodeBlob* allocate(int size, int code_blob_type); // allocates a new CodeBlob
+ static CodeBlob* allocate(int size, int code_blob_type, bool strict = false); // allocates a new CodeBlob
static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled
static int alignment_unit(); // guaranteed alignment of all CodeBlobs
static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
--- a/hotspot/src/share/vm/compiler/disassembler.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -343,8 +343,8 @@
}
BarrierSet* bs = Universe::heap()->barrier_set();
- if (bs->kind() == BarrierSet::CardTableModRef &&
- adr == (address)((CardTableModRefBS*)(bs))->byte_map_base) {
+ if (bs->is_a(BarrierSet::CardTableModRef) &&
+ adr == (address)(barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base)) {
st->print("word_map_base");
if (WizardMode) st->print(" " INTPTR_FORMAT, (intptr_t)adr);
return;
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -97,9 +97,7 @@
void ConcurrentMarkSweepThread::run() {
assert(this == cmst(), "just checking");
- this->record_stack_base_and_size();
- this->initialize_thread_local_storage();
- this->set_active_handles(JNIHandleBlock::allocate_block());
+ initialize_in_thread();
// From this time Thread::current() should be working.
assert(this == Thread::current(), "just checking");
if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -1440,7 +1440,7 @@
CMCountDataClosureBase(G1CollectedHeap* g1h,
BitMap* region_bm, BitMap* card_bm):
_g1h(g1h), _cm(g1h->concurrent_mark()),
- _ct_bs((CardTableModRefBS*) (g1h->barrier_set())),
+ _ct_bs(barrier_set_cast<CardTableModRefBS>(g1h->barrier_set())),
_region_bm(region_bm), _card_bm(card_bm) { }
};
@@ -3111,7 +3111,7 @@
BitMap* cm_card_bm,
uint max_worker_id) :
_g1h(g1h), _cm(g1h->concurrent_mark()),
- _ct_bs((CardTableModRefBS*) (g1h->barrier_set())),
+ _ct_bs(barrier_set_cast<CardTableModRefBS>(g1h->barrier_set())),
_cm_card_bm(cm_card_bm), _max_worker_id(max_worker_id) { }
bool doHeapRegion(HeapRegion* hr) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -120,7 +120,7 @@
if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) {
G1ParGCAllocBuffer* alloc_buf = alloc_buffer(dest, context);
add_to_alloc_buffer_waste(alloc_buf->words_remaining());
- alloc_buf->retire(false /* end_of_gc */, false /* retain */);
+ alloc_buf->retire();
HeapWord* buf = _g1h->par_allocate_during_gc(dest, gclab_word_size, context);
if (buf == NULL) {
@@ -154,9 +154,7 @@
G1ParGCAllocBuffer* const buf = _alloc_buffers[state];
if (buf != NULL) {
add_to_alloc_buffer_waste(buf->words_remaining());
- buf->flush_stats_and_retire(_g1h->alloc_buffer_stats(state),
- true /* end_of_gc */,
- false /* retain */);
+ buf->flush_and_retire_stats(_g1h->alloc_buffer_stats(state));
}
}
}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -159,11 +159,11 @@
_retired = false;
}
- virtual void retire(bool end_of_gc, bool retain) {
+ virtual void retire() {
if (_retired) {
return;
}
- ParGCAllocBuffer::retire(end_of_gc, retain);
+ ParGCAllocBuffer::retire();
_retired = true;
}
};
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1274,7 +1274,7 @@
virtual bool is_in_closed_subset(const void* p) const;
G1SATBCardTableLoggingModRefBS* g1_barrier_set() {
- return (G1SATBCardTableLoggingModRefBS*) barrier_set();
+ return barrier_set_cast<G1SATBCardTableLoggingModRefBS>(barrier_set());
}
// This resets the card table to all zeros. It is used after
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -33,8 +33,11 @@
#include "runtime/orderAccess.inline.hpp"
#include "runtime/thread.inline.hpp"
-G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
- CardTableModRefBS(whole_heap, kind) { }
+G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(
+ MemRegion whole_heap,
+ const BarrierSet::FakeRtti& fake_rtti) :
+ CardTableModRefBS(whole_heap, fake_rtti.add_tag(BarrierSet::G1SATBCT))
+{ }
void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
// Nulls should have been already filtered.
@@ -130,7 +133,7 @@
G1SATBCardTableLoggingModRefBS::
G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
- G1SATBCardTableModRefBS(whole_heap, BarrierSet::G1SATBCTLogging),
+ G1SATBCardTableModRefBS(whole_heap, BarrierSet::FakeRtti(G1SATBCTLogging)),
_dcqs(JavaThread::dirty_card_queue_set()),
_listener()
{
@@ -203,7 +206,7 @@
if (new_val == NULL) return;
// Otherwise, log it.
G1SATBCardTableLoggingModRefBS* g1_bs =
- (G1SATBCardTableLoggingModRefBS*)Universe::heap()->barrier_set();
+ barrier_set_cast<G1SATBCardTableLoggingModRefBS>(Universe::heap()->barrier_set());
g1_bs->write_ref_field_work(field, new_val);
}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -43,7 +43,7 @@
g1_young_gen = CT_MR_BS_last_reserved << 1
};
- G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
+ G1SATBCardTableModRefBS(MemRegion whole_heap, const BarrierSet::FakeRtti& fake_rtti);
~G1SATBCardTableModRefBS() { }
public:
@@ -53,10 +53,6 @@
// pre-marking object graph.
static void enqueue(oop pre_val);
- bool is_a(BarrierSet::Name bsn) {
- return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
- }
-
virtual bool has_write_ref_pre_barrier() { return true; }
// This notes that we don't need to access any BarrierSet data
@@ -128,6 +124,11 @@
}
};
+template<>
+struct BarrierSet::GetName<G1SATBCardTableModRefBS> {
+ static const BarrierSet::Name value = BarrierSet::G1SATBCT;
+};
+
class G1SATBCardTableLoggingModRefBSChangedListener : public G1MappingChangedListener {
private:
G1SATBCardTableLoggingModRefBS* _card_table;
@@ -159,11 +160,6 @@
virtual void resize_covered_region(MemRegion new_region) { ShouldNotReachHere(); }
- bool is_a(BarrierSet::Name bsn) {
- return bsn == BarrierSet::G1SATBCTLogging ||
- G1SATBCardTableModRefBS::is_a(bsn);
- }
-
void write_ref_field_work(void* field, oop new_val, bool release = false);
// Can be called from static contexts.
@@ -177,4 +173,9 @@
void write_ref_array_work(MemRegion mr) { invalidate(mr); }
};
+template<>
+struct BarrierSet::GetName<G1SATBCardTableLoggingModRefBS> {
+ static const BarrierSet::Name value = BarrierSet::G1SATBCTLogging;
+};
+
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -193,7 +193,7 @@
HeapRegionRemSet* hrrs = rem_set();
hrrs->clear();
CardTableModRefBS* ct_bs =
- (CardTableModRefBS*)G1CollectedHeap::heap()->barrier_set();
+ barrier_set_cast<CardTableModRefBS>(G1CollectedHeap::heap()->barrier_set());
ct_bs->clear(MemRegion(bottom(), end()));
}
@@ -643,13 +643,9 @@
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseMarkWord -> use mark word from object header.
VerifyLiveClosure(G1CollectedHeap* g1h, VerifyOption vo) :
- _g1h(g1h), _bs(NULL), _containing_obj(NULL),
- _failures(false), _n_failures(0), _vo(vo)
- {
- BarrierSet* bs = _g1h->barrier_set();
- if (bs->is_a(BarrierSet::CardTableModRef))
- _bs = (CardTableModRefBS*)bs;
- }
+ _g1h(g1h), _bs(barrier_set_cast<CardTableModRefBS>(g1h->barrier_set())),
+ _containing_obj(NULL), _failures(false), _n_failures(0), _vo(vo)
+ { }
void set_containing_obj(oop obj) {
_containing_obj = obj;
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -232,7 +232,7 @@
if (word_sz * 100 <
ParallelGCBufferWastePct * plab->word_sz()) {
// Is small enough; abandon this buffer and start a new one.
- plab->retire(false, false);
+ plab->retire();
size_t buf_size = plab->word_sz();
HeapWord* buf_space = sp->par_allocate(buf_size);
if (buf_space == NULL) {
@@ -463,10 +463,7 @@
// Flush stats related to To-space PLAB activity and
// retire the last buffer.
- par_scan_state.to_space_alloc_buffer()->
- flush_stats_and_retire(_gen.plab_stats(),
- true /* end_of_gc */,
- false /* retain */);
+ par_scan_state.to_space_alloc_buffer()->flush_and_retire_stats(_gen.plab_stats());
// Every thread has its own age table. We need to merge
// them all into one.
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -81,7 +81,7 @@
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
_young_gen = heap->young_gen();
- _card_table = (CardTableExtension*)heap->barrier_set();
+ _card_table = barrier_set_cast<CardTableExtension>(heap->barrier_set());
// No point in asserting barrier set type here. Need to make CardTableExtension
// a unique barrier set type.
}
@@ -341,7 +341,9 @@
PSOldGen* old_gen = heap->old_gen();
- CheckForPreciseMarks check(heap->young_gen(), (CardTableExtension*)heap->barrier_set());
+ CheckForPreciseMarks check(
+ heap->young_gen(),
+ barrier_set_cast<CardTableExtension>(heap->barrier_set()));
old_gen->oop_iterate_no_header(&check);
@@ -349,8 +351,8 @@
}
void CardTableExtension::verify_all_young_refs_precise_helper(MemRegion mr) {
- CardTableExtension* card_table = (CardTableExtension*)Universe::heap()->barrier_set();
- // FIX ME ASSERT HERE
+ CardTableExtension* card_table =
+ barrier_set_cast<CardTableExtension>(Universe::heap()->barrier_set());
jbyte* bot = card_table->byte_for(mr.start());
jbyte* top = card_table->byte_for(mr.end());
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -54,10 +54,16 @@
};
CardTableExtension(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) { }
-
- // Too risky for the 4/10/02 putback
- // BarrierSet::Name kind() { return BarrierSet::CardTableExtension; }
+ CardTableModRefBS(
+ whole_heap,
+ // Concrete tag should be BarrierSet::CardTableExtension.
+ // That will presently break things in a bunch of places though.
+ // The concrete tag is used as a dispatch key in many places, and
+ // CardTableExtension does not correctly dispatch in some of those
+ // uses. This will be addressed as part of a reorganization of the
+ // BarrierSet hierarchy.
+ BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableExtension))
+ { }
// Scavenge support
void scavenge_contents_parallel(ObjectStartArray* start_array,
@@ -110,4 +116,9 @@
#endif // ASSERT
};
+template<>
+struct BarrierSet::GetName<CardTableExtension> {
+ static const BarrierSet::Name value = BarrierSet::CardTableExtension;
+};
+
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -98,6 +98,7 @@
// Set up the thread for stack overflow support
this->record_stack_base_and_size();
this->initialize_thread_local_storage();
+ this->initialize_named_thread();
// Bind yourself to your processor.
if (processor_id() != GCTaskManager::sentinel_worker()) {
if (TraceGCTaskThread) {
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,6 +1,5 @@
-
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -233,15 +232,12 @@
young_gen->to_space()->is_empty();
young_gen_empty = eden_empty && survivors_empty;
- BarrierSet* bs = heap->barrier_set();
- if (bs->is_a(BarrierSet::ModRef)) {
- ModRefBarrierSet* modBS = (ModRefBarrierSet*)bs;
- MemRegion old_mr = heap->old_gen()->reserved();
- if (young_gen_empty) {
- modBS->clear(MemRegion(old_mr.start(), old_mr.end()));
- } else {
- modBS->invalidate(MemRegion(old_mr.start(), old_mr.end()));
- }
+ ModRefBarrierSet* modBS = barrier_set_cast<ModRefBarrierSet>(heap->barrier_set());
+ MemRegion old_mr = heap->old_gen()->reserved();
+ if (young_gen_empty) {
+ modBS->clear(MemRegion(old_mr.start(), old_mr.end()));
+ } else {
+ modBS->invalidate(MemRegion(old_mr.start(), old_mr.end()));
}
// Delete metaspaces for unloaded class loaders and clean up loader_data graph
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -111,8 +111,8 @@
Universe::heap()->barrier_set()->resize_covered_region(cmr);
- CardTableModRefBS* _ct = (CardTableModRefBS*)Universe::heap()->barrier_set();
- assert (_ct->kind() == BarrierSet::CardTableModRef, "Sanity");
+ CardTableModRefBS* _ct =
+ barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
// Verify that the start and end of this generation is the start of a card.
// If this wasn't true, a single card could span more than one generation,
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -1050,16 +1050,12 @@
bool young_gen_empty = eden_empty && from_space->is_empty() &&
to_space->is_empty();
- BarrierSet* bs = heap->barrier_set();
- if (bs->is_a(BarrierSet::ModRef)) {
- ModRefBarrierSet* modBS = (ModRefBarrierSet*)bs;
- MemRegion old_mr = heap->old_gen()->reserved();
-
- if (young_gen_empty) {
- modBS->clear(MemRegion(old_mr.start(), old_mr.end()));
- } else {
- modBS->invalidate(MemRegion(old_mr.start(), old_mr.end()));
- }
+ ModRefBarrierSet* modBS = barrier_set_cast<ModRefBarrierSet>(heap->barrier_set());
+ MemRegion old_mr = heap->old_gen()->reserved();
+ if (young_gen_empty) {
+ modBS->clear(MemRegion(old_mr.start(), old_mr.end()));
+ } else {
+ modBS->invalidate(MemRegion(old_mr.start(), old_mr.end()));
}
// Delete metaspaces for unloaded class loaders and clean up loader_data graph
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,6 +1,5 @@
-
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -866,9 +865,7 @@
NULL); // header provides liveness info
// Cache the cardtable
- BarrierSet* bs = Universe::heap()->barrier_set();
- assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
- _card_table = (CardTableExtension*)bs;
+ _card_table = barrier_set_cast<CardTableExtension>(heap->barrier_set());
_counters = new CollectorCounters("PSScavenge", 0);
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -183,8 +183,8 @@
PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
- CardTableExtension* card_table = (CardTableExtension *)Universe::heap()->barrier_set();
- // FIX ME! Assert that card_table is the type we believe it to be.
+ CardTableExtension* card_table =
+ barrier_set_cast<CardTableExtension>(Universe::heap()->barrier_set());
card_table->scavenge_contents_parallel(_gen->start_array(),
_gen->object_space(),
--- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -56,6 +56,7 @@
void ConcurrentGCThread::initialize_in_thread() {
this->record_stack_base_and_size();
this->initialize_thread_local_storage();
+ this->initialize_named_thread();
this->set_active_handles(JNIHandleBlock::allocate_block());
// From this time Thread::current() should be working.
assert(this == Thread::current(), "just checking");
--- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -24,27 +24,30 @@
#include "precompiled.hpp"
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
-#include "memory/sharedHeap.hpp"
+#include "memory/threadLocalAllocBuffer.hpp"
#include "oops/arrayOop.hpp"
#include "oops/oop.inline.hpp"
-#include "utilities/globalDefinitions.hpp"
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+size_t ParGCAllocBuffer::min_size() {
+ // Make sure that we return something that is larger than AlignmentReserve
+ return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
+}
+
+size_t ParGCAllocBuffer::max_size() {
+ return ThreadLocalAllocBuffer::max_size();
+}
ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) :
_word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
- _end(NULL), _hard_end(NULL),
- _retained(false), _retained_filler(),
- _allocated(0), _wasted(0)
+ _end(NULL), _hard_end(NULL), _allocated(0), _wasted(0)
{
- assert (min_size() > AlignmentReserve, "Inconsistency!");
- // arrayOopDesc::header_size depends on command line initialization.
- FillerHeaderSize = align_object_size(arrayOopDesc::header_size(T_INT));
- AlignmentReserve = oopDesc::header_size() > MinObjAlignment ? FillerHeaderSize : 0;
+ // ArrayOopDesc::header_size depends on command line initialization.
+ AlignmentReserve = oopDesc::header_size() > MinObjAlignment ? align_object_size(arrayOopDesc::header_size(T_INT)) : 0;
+ assert(min_size() > AlignmentReserve,
+ err_msg("Minimum PLAB size " SIZE_FORMAT" must be larger than alignment reserve " SIZE_FORMAT" "
+ "to be able to contain objects", min_size(), AlignmentReserve));
}
-size_t ParGCAllocBuffer::FillerHeaderSize;
-
// If the minimum object size is greater than MinObjAlignment, we can
// end up with a shard at the end of the buffer that's smaller than
// the smallest object. We can't allow that because the buffer must
@@ -52,39 +55,33 @@
// sure we have enough space for a filler int array object.
size_t ParGCAllocBuffer::AlignmentReserve;
-void ParGCAllocBuffer::retire(bool end_of_gc, bool retain) {
- assert(!retain || end_of_gc, "Can only retain at GC end.");
- if (_retained) {
- // If the buffer had been retained shorten the previous filler object.
- assert(_retained_filler.end() <= _top, "INVARIANT");
- CollectedHeap::fill_with_object(_retained_filler);
- // Wasted space book-keeping, otherwise (normally) done in invalidate()
- _wasted += _retained_filler.word_size();
- _retained = false;
- }
- assert(!end_of_gc || !_retained, "At this point, end_of_gc ==> !_retained.");
+void ParGCAllocBuffer::flush_and_retire_stats(PLABStats* stats) {
+ // Retire the last allocation buffer.
+ size_t unused = retire_internal();
+
+ // Now flush the statistics.
+ stats->add_allocated(_allocated);
+ stats->add_wasted(_wasted);
+ stats->add_unused(unused);
+
+ // Since we have flushed the stats we need to clear the _allocated and _wasted
+ // fields in case somebody retains an instance of this over GCs. Not doing so
+ // will artifically inflate the values in the statistics.
+ _allocated = 0;
+ _wasted = 0;
+}
+
+void ParGCAllocBuffer::retire() {
+ _wasted += retire_internal();
+}
+
+size_t ParGCAllocBuffer::retire_internal() {
+ size_t result = 0;
if (_top < _hard_end) {
CollectedHeap::fill_with_object(_top, _hard_end);
- if (!retain) {
- invalidate();
- } else {
- // Is there wasted space we'd like to retain for the next GC?
- if (pointer_delta(_end, _top) > FillerHeaderSize) {
- _retained = true;
- _retained_filler = MemRegion(_top, FillerHeaderSize);
- _top = _top + FillerHeaderSize;
- } else {
- invalidate();
- }
- }
+ result += invalidate();
}
-}
-
-void ParGCAllocBuffer::flush_stats(PLABStats* stats) {
- assert(ResizePLAB, "Wasted work");
- stats->add_allocated(_allocated);
- stats->add_wasted(_wasted);
- stats->add_unused(pointer_delta(_end, _top));
+ return result;
}
// Compute desired plab size and latch result for later
@@ -101,44 +98,37 @@
err_msg("Inconsistency in PLAB stats: "
"_allocated: "SIZE_FORMAT", "
"_wasted: "SIZE_FORMAT", "
- "_unused: "SIZE_FORMAT", "
- "_used : "SIZE_FORMAT,
- _allocated, _wasted, _unused, _used));
+ "_unused: "SIZE_FORMAT,
+ _allocated, _wasted, _unused));
_allocated = 1;
}
- double wasted_frac = (double)_unused/(double)_allocated;
- size_t target_refills = (size_t)((wasted_frac*TargetSurvivorRatio)/
- TargetPLABWastePct);
+ double wasted_frac = (double)_unused / (double)_allocated;
+ size_t target_refills = (size_t)((wasted_frac * TargetSurvivorRatio) / TargetPLABWastePct);
if (target_refills == 0) {
target_refills = 1;
}
- _used = _allocated - _wasted - _unused;
- size_t plab_sz = _used/(target_refills*no_of_gc_workers);
- if (PrintPLAB) gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT " ", plab_sz);
+ size_t used = _allocated - _wasted - _unused;
+ size_t recent_plab_sz = used / (target_refills * no_of_gc_workers);
// Take historical weighted average
- _filter.sample(plab_sz);
+ _filter.sample(recent_plab_sz);
// Clip from above and below, and align to object boundary
- plab_sz = MAX2(min_size(), (size_t)_filter.average());
- plab_sz = MIN2(max_size(), plab_sz);
- plab_sz = align_object_size(plab_sz);
+ size_t new_plab_sz = MAX2(min_size(), (size_t)_filter.average());
+ new_plab_sz = MIN2(max_size(), new_plab_sz);
+ new_plab_sz = align_object_size(new_plab_sz);
// Latch the result
- if (PrintPLAB) gclog_or_tty->print(" desired_plab_sz = " SIZE_FORMAT ") ", plab_sz);
- _desired_plab_sz = plab_sz;
- // Now clear the accumulators for next round:
- // note this needs to be fixed in the case where we
- // are retaining across scavenges. FIX ME !!! XXX
- _allocated = 0;
- _wasted = 0;
- _unused = 0;
+ if (PrintPLAB) {
+ gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT" desired_plab_sz = " SIZE_FORMAT") ", recent_plab_sz, new_plab_sz);
+ }
+ _desired_plab_sz = new_plab_sz;
+
+ reset();
}
#ifndef PRODUCT
void ParGCAllocBuffer::print() {
- gclog_or_tty->print("parGCAllocBuffer: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT
- " _end: " PTR_FORMAT " _hard_end: " PTR_FORMAT " _retained: %c"
- " _retained_filler: [" PTR_FORMAT "," PTR_FORMAT ")\n",
- _bottom, _top, _end, _hard_end,
- "FT"[_retained], _retained_filler.start(), _retained_filler.end());
+ gclog_or_tty->print_cr("parGCAllocBuffer: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT
+ " _end: " PTR_FORMAT " _hard_end: " PTR_FORMAT ")",
+ p2i(_bottom), p2i(_top), p2i(_end), p2i(_hard_end));
}
#endif // !PRODUCT
--- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -24,37 +24,43 @@
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
-#include "gc_interface/collectedHeap.hpp"
+
+#include "gc_implementation/shared/gcUtil.hpp"
#include "memory/allocation.hpp"
-#include "memory/blockOffsetTable.hpp"
-#include "memory/threadLocalAllocBuffer.hpp"
+#include "runtime/atomic.hpp"
#include "utilities/globalDefinitions.hpp"
-// Forward decl.
-
+// Forward declarations.
class PLABStats;
// A per-thread allocation buffer used during GC.
class ParGCAllocBuffer: public CHeapObj<mtGC> {
protected:
- char head[32];
- size_t _word_sz; // in HeapWord units
+ char head[32];
+ size_t _word_sz; // In HeapWord units
HeapWord* _bottom;
HeapWord* _top;
- HeapWord* _end; // last allocatable address + 1
- HeapWord* _hard_end; // _end + AlignmentReserve
- bool _retained; // whether we hold a _retained_filler
- MemRegion _retained_filler;
+ HeapWord* _end; // Last allocatable address + 1
+ HeapWord* _hard_end; // _end + AlignmentReserve
// In support of ergonomic sizing of PLAB's
size_t _allocated; // in HeapWord units
size_t _wasted; // in HeapWord units
- char tail[32];
- static size_t FillerHeaderSize;
+ char tail[32];
static size_t AlignmentReserve;
- // Flush the stats supporting ergonomic sizing of PLAB's
- // Should not be called directly
- void flush_stats(PLABStats* stats);
+ // Force future allocations to fail and queries for contains()
+ // to return false. Returns the amount of unused space in this PLAB.
+ size_t invalidate() {
+ _end = _hard_end;
+ size_t remaining = pointer_delta(_end, _top); // Calculate remaining space.
+ _top = _end; // Force future allocations to fail.
+ _bottom = _end; // Force future contains() queries to return false.
+ return remaining;
+ }
+
+ // Fill in remaining space with a dummy object and invalidate the PLAB. Returns
+ // the amount of remaining space.
+ size_t retire_internal();
public:
// Initializes the buffer to be empty, but with the given "word_sz".
@@ -62,14 +68,10 @@
ParGCAllocBuffer(size_t word_sz);
virtual ~ParGCAllocBuffer() {}
- static const size_t min_size() {
- // Make sure that we return something that is larger than AlignmentReserve
- return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
- }
-
- static const size_t max_size() {
- return ThreadLocalAllocBuffer::max_size();
- }
+ // Minimum PLAB size.
+ static size_t min_size();
+ // Maximum PLAB size.
+ static size_t max_size();
// If an allocation of the given "word_sz" can be satisfied within the
// buffer, do the allocation, returning a pointer to the start of the
@@ -128,62 +130,37 @@
_allocated += word_sz();
}
- // Flush the stats supporting ergonomic sizing of PLAB's
- // and retire the current buffer.
- void flush_stats_and_retire(PLABStats* stats, bool end_of_gc, bool retain) {
- // We flush the stats first in order to get a reading of
- // unused space in the last buffer.
- if (ResizePLAB) {
- flush_stats(stats);
+ // Flush allocation statistics into the given PLABStats supporting ergonomic
+ // sizing of PLAB's and retire the current buffer. To be called at the end of
+ // GC.
+ void flush_and_retire_stats(PLABStats* stats);
- // Since we have flushed the stats we need to clear
- // the _allocated and _wasted fields. Not doing so
- // will artifically inflate the values in the stats
- // to which we add them.
- // The next time we flush these values, we will add
- // what we have just flushed in addition to the size
- // of the buffers allocated between now and then.
- _allocated = 0;
- _wasted = 0;
- }
- // Retire the last allocation buffer.
- retire(end_of_gc, retain);
- }
-
- // Force future allocations to fail and queries for contains()
- // to return false
- void invalidate() {
- assert(!_retained, "Shouldn't retain an invalidated buffer.");
- _end = _hard_end;
- _wasted += pointer_delta(_end, _top); // unused space
- _top = _end; // force future allocations to fail
- _bottom = _end; // force future contains() queries to return false
- }
-
- // Fills in the unallocated portion of the buffer with a garbage object.
- // If "end_of_gc" is TRUE, is after the last use in the GC. IF "retain"
- // is true, attempt to re-use the unused portion in the next GC.
- virtual void retire(bool end_of_gc, bool retain);
+ // Fills in the unallocated portion of the buffer with a garbage object and updates
+ // statistics. To be called during GC.
+ virtual void retire();
void print() PRODUCT_RETURN;
};
-// PLAB stats book-keeping
+// PLAB book-keeping.
class PLABStats VALUE_OBJ_CLASS_SPEC {
- size_t _allocated; // total allocated
+ size_t _allocated; // Total allocated
size_t _wasted; // of which wasted (internal fragmentation)
size_t _unused; // Unused in last buffer
- size_t _used; // derived = allocated - wasted - unused
- size_t _desired_plab_sz;// output of filter (below), suitably trimmed and quantized
+ size_t _desired_plab_sz;// Output of filter (below), suitably trimmed and quantized
AdaptiveWeightedAverage
- _filter; // integrator with decay
+ _filter; // Integrator with decay
+ void reset() {
+ _allocated = 0;
+ _wasted = 0;
+ _unused = 0;
+ }
public:
PLABStats(size_t desired_plab_sz_, unsigned wt) :
_allocated(0),
_wasted(0),
_unused(0),
- _used(0),
_desired_plab_sz(desired_plab_sz_),
_filter(wt)
{ }
@@ -200,9 +177,9 @@
return _desired_plab_sz;
}
+ // Updates the current desired PLAB size. Computes the new desired PLAB size,
+ // updates _desired_plab_sz and clears sensor accumulators.
void adjust_desired_plab_sz(uint no_of_gc_workers);
- // filter computation, latches output to
- // _desired_plab_sz, clears sensor accumulators
void add_allocated(size_t v) {
Atomic::add_ptr(v, &_allocated);
--- a/hotspot/src/share/vm/memory/barrierSet.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -27,6 +27,7 @@
#include "memory/memRegion.hpp"
#include "oops/oopsHierarchy.hpp"
+#include "utilities/fakeRttiSupport.hpp"
// This class provides the interface between a barrier implementation and
// the rest of the system.
@@ -34,18 +35,57 @@
class BarrierSet: public CHeapObj<mtGC> {
friend class VMStructs;
public:
- enum Name {
- ModRef,
- CardTableModRef,
- CardTableExtension,
- G1SATBCT,
- G1SATBCTLogging
+ // Fake RTTI support. For a derived class T to participate
+ // - T must have a corresponding Name entry.
+ // - GetName<T> must be specialized to return the corresponding Name
+ // entry.
+ // - If T is a base class, the constructor must have a FakeRtti
+ // parameter and pass it up to its base class, with the tag set
+ // augmented with the corresponding Name entry.
+ // - If T is a concrete class, the constructor must create a
+ // FakeRtti object whose tag set includes the corresponding Name
+ // entry, and pass it up to its base class.
+
+ enum Name { // associated class
+ ModRef, // ModRefBarrierSet
+ CardTableModRef, // CardTableModRefBS
+ CardTableForRS, // CardTableModRefBSForCTRS
+ CardTableExtension, // CardTableExtension
+ G1SATBCT, // G1SATBCardTableModRefBS
+ G1SATBCTLogging // G1SATBCardTableLoggingModRefBS
};
+protected:
+ typedef FakeRttiSupport<BarrierSet, Name> FakeRtti;
+
+private:
+ FakeRtti _fake_rtti;
+
+ // Metafunction mapping a class derived from BarrierSet to the
+ // corresponding Name enum tag.
+ template<typename T> struct GetName;
+
+ // Downcast argument to a derived barrier set type.
+ // The cast is checked in a debug build.
+ // T must have a specialization for BarrierSet::GetName<T>.
+ template<typename T> friend T* barrier_set_cast(BarrierSet* bs);
+
+public:
+ // Note: This is not presently the Name corresponding to the
+ // concrete class of this object.
+ BarrierSet::Name kind() const { return _fake_rtti.concrete_tag(); }
+
+ // Test whether this object is of the type corresponding to bsn.
+ bool is_a(BarrierSet::Name bsn) const { return _fake_rtti.has_tag(bsn); }
+
+ // End of fake RTTI support.
+
+public:
enum Flags {
None = 0,
TargetUninitialized = 1
};
+
protected:
// Some barrier sets create tables whose elements correspond to parts of
// the heap; the CardTableModRefBS is an example. Such barrier sets will
@@ -53,17 +93,12 @@
// "covering" parts of the heap that are committed. At most one covered
// region per generation is needed.
static const int _max_covered_regions = 2;
- Name _kind;
- BarrierSet(Name kind) : _kind(kind) { }
+ BarrierSet(const FakeRtti& fake_rtti) : _fake_rtti(fake_rtti) { }
~BarrierSet() { }
public:
- // To get around prohibition on RTTI.
- BarrierSet::Name kind() { return _kind; }
- virtual bool is_a(BarrierSet::Name bsn) = 0;
-
// These operations indicate what kind of barriers the BarrierSet has.
virtual bool has_read_ref_barrier() = 0;
virtual bool has_read_prim_barrier() = 0;
@@ -177,4 +212,10 @@
virtual void print_on(outputStream* st) const = 0;
};
+template<typename T>
+inline T* barrier_set_cast(BarrierSet* bs) {
+ assert(bs->is_a(BarrierSet::GetName<T>::value), "wrong type of barrier set");
+ return static_cast<T*>(bs);
+}
+
#endif // SHARE_VM_MEMORY_BARRIERSET_HPP
--- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -34,7 +34,7 @@
template <class T> void BarrierSet::write_ref_field_pre(T* field, oop new_val) {
if (kind() == CardTableModRef) {
- ((CardTableModRefBS*)this)->inline_write_ref_field_pre(field, new_val);
+ barrier_set_cast<CardTableModRefBS>(this)->inline_write_ref_field_pre(field, new_val);
} else {
write_ref_field_pre_work(field, new_val);
}
@@ -42,7 +42,7 @@
void BarrierSet::write_ref_field(void* field, oop new_val, bool release) {
if (kind() == CardTableModRef) {
- ((CardTableModRefBS*)this)->inline_write_ref_field(field, new_val, release);
+ barrier_set_cast<CardTableModRefBS>(this)->inline_write_ref_field(field, new_val, release);
} else {
write_ref_field_work(field, new_val, release);
}
@@ -78,7 +78,7 @@
inline void BarrierSet::write_region(MemRegion mr) {
if (kind() == CardTableModRef) {
- ((CardTableModRefBS*)this)->inline_write_region(mr);
+ barrier_set_cast<CardTableModRefBS>(this)->inline_write_region(mr);
} else {
write_region_work(mr);
}
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -53,8 +53,10 @@
return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
}
-CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
- ModRefBarrierSet(kind),
+CardTableModRefBS::CardTableModRefBS(
+ MemRegion whole_heap,
+ const BarrierSet::FakeRtti& fake_rtti) :
+ ModRefBarrierSet(fake_rtti.add_tag(BarrierSet::CardTableModRef)),
_whole_heap(whole_heap),
_guard_index(0),
_guard_region(),
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -279,11 +279,6 @@
static int precleaned_card_val() { return precleaned_card; }
static int deferred_card_val() { return deferred_card; }
- // For RTTI simulation.
- bool is_a(BarrierSet::Name bsn) {
- return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
- }
-
virtual void initialize();
// *** Barrier set functions.
@@ -292,7 +287,7 @@
protected:
- CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
+ CardTableModRefBS(MemRegion whole_heap, const BarrierSet::FakeRtti& fake_rtti);
~CardTableModRefBS();
// Record a reference update. Note that these versions are precise!
@@ -462,6 +457,11 @@
void verify_dirty_region(MemRegion mr) PRODUCT_RETURN;
};
+template<>
+struct BarrierSet::GetName<CardTableModRefBS> {
+ static const BarrierSet::Name value = BarrierSet::CardTableModRef;
+};
+
class CardTableRS;
// A specialization for the CardTableRS gen rem set.
@@ -472,10 +472,24 @@
bool card_may_have_been_dirty(jbyte cv);
public:
CardTableModRefBSForCTRS(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) {}
+ CardTableModRefBS(
+ whole_heap,
+ // Concrete tag should be BarrierSet::CardTableForRS.
+ // That will presently break things in a bunch of places though.
+ // The concrete tag is used as a dispatch key in many places, and
+ // CardTableForRS does not correctly dispatch in some of those
+ // uses. This will be addressed as part of a reorganization of the
+ // BarrierSet hierarchy.
+ BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS))
+ {}
void set_CTRS(CardTableRS* rs) { _rs = rs; }
};
+template<>
+struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
+ static const BarrierSet::Name value = BarrierSet::CardTableForRS;
+};
+
#endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
--- a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -37,10 +37,6 @@
class ModRefBarrierSet: public BarrierSet {
public:
- bool is_a(BarrierSet::Name bsn) {
- return bsn == BarrierSet::ModRef;
- }
-
// Barriers only on ref writes.
bool has_read_ref_barrier() { return false; }
bool has_read_prim_barrier() { return false; }
@@ -60,7 +56,8 @@
protected:
- ModRefBarrierSet(BarrierSet::Name kind) : BarrierSet(kind) { }
+ ModRefBarrierSet(const BarrierSet::FakeRtti& fake_rtti)
+ : BarrierSet(fake_rtti.add_tag(BarrierSet::ModRef)) { }
~ModRefBarrierSet() { }
virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
@@ -100,4 +97,9 @@
virtual void clear(MemRegion mr) = 0;
};
+template<>
+struct BarrierSet::GetName<ModRefBarrierSet> {
+ static const BarrierSet::Name value = BarrierSet::ModRef;
+};
+
#endif // SHARE_VM_MEMORY_MODREFBARRIERSET_HPP
--- a/hotspot/src/share/vm/oops/constMethod.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/constMethod.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -215,6 +215,7 @@
u2 _max_stack; // Maximum number of entries on the expression stack
u2 _max_locals; // Number of local variables used by this method
u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
+ u2 _orig_method_idnum; // Original unique identification number for the method
// Constructor
ConstMethod(int byte_code_size,
@@ -473,6 +474,9 @@
u2 method_idnum() const { return _method_idnum; }
void set_method_idnum(u2 idnum) { _method_idnum = idnum; }
+ u2 orig_method_idnum() const { return _orig_method_idnum; }
+ void set_orig_method_idnum(u2 idnum) { _orig_method_idnum = idnum; }
+
// max stack
int max_stack() const { return _max_stack; }
void set_max_stack(int size) { _max_stack = size; }
--- a/hotspot/src/share/vm/oops/cpCache.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/cpCache.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -454,7 +454,6 @@
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
}
-
return true;
}
@@ -482,7 +481,6 @@
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
}
-
return true;
}
@@ -509,36 +507,33 @@
(!f1_as_method()->is_old() && !f1_as_method()->is_obsolete())));
}
-bool ConstantPoolCacheEntry::is_interesting_method_entry(Klass* k) {
+Method* ConstantPoolCacheEntry::get_interesting_method_entry(Klass* k) {
if (!is_method_entry()) {
// not a method entry so not interesting by default
- return false;
+ return NULL;
}
-
Method* m = NULL;
if (is_vfinal()) {
// virtual and final so _f2 contains method ptr instead of vtable index
m = f2_as_vfinal_method();
} else if (is_f1_null()) {
// NULL _f1 means this is a virtual entry so also not interesting
- return false;
+ return NULL;
} else {
if (!(_f1->is_method())) {
// _f1 can also contain a Klass* for an interface
- return false;
+ return NULL;
}
m = f1_as_method();
}
-
assert(m != NULL && m->is_method(), "sanity check");
if (m == NULL || !m->is_method() || (k != NULL && m->method_holder() != k)) {
// robustness for above sanity checks or method is not in
// the interesting class
- return false;
+ return NULL;
}
-
// the method is in the interesting class so the entry is interesting
- return true;
+ return m;
}
#endif // INCLUDE_JVMTI
@@ -615,7 +610,7 @@
// If any entry of this ConstantPoolCache points to any of
// old_methods, replace it with the corresponding new_method.
void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new_methods,
- int methods_length, bool * trace_name_printed) {
+ int methods_length, bool * trace_name_printed) {
if (methods_length == 0) {
// nothing to do if there are no methods
@@ -626,7 +621,7 @@
Klass* old_holder = old_methods[0]->method_holder();
for (int i = 0; i < length(); i++) {
- if (!entry_at(i)->is_interesting_method_entry(old_holder)) {
+ if (entry_at(i)->get_interesting_method_entry(old_holder) == NULL) {
// skip uninteresting methods
continue;
}
@@ -650,10 +645,33 @@
}
}
+// If any entry of this ConstantPoolCache points to any of
+// old_methods, replace it with the corresponding new_method.
+void ConstantPoolCache::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
+ for (int i = 0; i < length(); i++) {
+ ConstantPoolCacheEntry* entry = entry_at(i);
+ Method* old_method = entry->get_interesting_method_entry(holder);
+ if (old_method == NULL || !old_method->is_old()) {
+ continue; // skip uninteresting entries
+ }
+ if (old_method->is_deleted()) {
+ // clean up entries with deleted methods
+ entry->initialize_entry(entry->constant_pool_index());
+ continue;
+ }
+ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
+
+ assert(new_method != NULL, "method_with_idnum() should not be NULL");
+ assert(old_method != new_method, "sanity check");
+
+ entry_at(i)->adjust_method_entry(old_method, new_method, trace_name_printed);
+ }
+}
+
// the constant pool cache should never contain old or obsolete methods
bool ConstantPoolCache::check_no_old_or_obsolete_entries() {
for (int i = 1; i < length(); i++) {
- if (entry_at(i)->is_interesting_method_entry(NULL) &&
+ if (entry_at(i)->get_interesting_method_entry(NULL) != NULL &&
!entry_at(i)->check_no_old_or_obsolete_entries()) {
return false;
}
@@ -663,7 +681,7 @@
void ConstantPoolCache::dump_cache() {
for (int i = 1; i < length(); i++) {
- if (entry_at(i)->is_interesting_method_entry(NULL)) {
+ if (entry_at(i)->get_interesting_method_entry(NULL) != NULL) {
entry_at(i)->print(tty, i);
}
}
--- a/hotspot/src/share/vm/oops/cpCache.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/cpCache.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -379,9 +379,9 @@
// printed the klass name so that other routines in the adjust_*
// group don't print the klass name.
bool adjust_method_entry(Method* old_method, Method* new_method,
- bool * trace_name_printed);
+ bool* trace_name_printed);
bool check_no_old_or_obsolete_entries();
- bool is_interesting_method_entry(Klass* k);
+ Method* get_interesting_method_entry(Klass* k);
#endif // INCLUDE_JVMTI
// Debugging & Printing
@@ -478,7 +478,8 @@
// printed the klass name so that other routines in the adjust_*
// group don't print the klass name.
void adjust_method_entries(Method** old_methods, Method** new_methods,
- int methods_length, bool * trace_name_printed);
+ int methods_length, bool* trace_name_printed);
+ void adjust_method_entries(InstanceKlass* holder, bool* trace_name_printed);
bool check_no_old_or_obsolete_entries();
void dump_cache();
#endif // INCLUDE_JVMTI
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -2793,30 +2793,33 @@
// not yet in the vtable due to concurrent subclass define and superinterface
// redefinition
// Note: those in the vtable, should have been updated via adjust_method_entries
-void InstanceKlass::adjust_default_methods(Method** old_methods, Method** new_methods,
- int methods_length, bool* trace_name_printed) {
+void InstanceKlass::adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed) {
// search the default_methods for uses of either obsolete or EMCP methods
if (default_methods() != NULL) {
- for (int j = 0; j < methods_length; j++) {
- Method* old_method = old_methods[j];
- Method* new_method = new_methods[j];
-
- for (int index = 0; index < default_methods()->length(); index ++) {
- if (default_methods()->at(index) == old_method) {
- default_methods()->at_put(index, new_method);
- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
- if (!(*trace_name_printed)) {
- // RC_TRACE_MESG macro has an embedded ResourceMark
- RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
- external_name(),
- old_method->method_holder()->external_name()));
- *trace_name_printed = true;
- }
- RC_TRACE(0x00100000, ("default method update: %s(%s) ",
- new_method->name()->as_C_string(),
- new_method->signature()->as_C_string()));
- }
+ for (int index = 0; index < default_methods()->length(); index ++) {
+ Method* old_method = default_methods()->at(index);
+ if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
+ continue; // skip uninteresting entries
+ }
+ assert(!old_method->is_deleted(), "default methods may not be deleted");
+
+ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
+
+ assert(new_method != NULL, "method_with_idnum() should not be NULL");
+ assert(old_method != new_method, "sanity check");
+
+ default_methods()->at_put(index, new_method);
+ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+ if (!(*trace_name_printed)) {
+ // RC_TRACE_MESG macro has an embedded ResourceMark
+ RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
+ external_name(),
+ old_method->method_holder()->external_name()));
+ *trace_name_printed = true;
}
+ RC_TRACE(0x00100000, ("default method update: %s(%s) ",
+ new_method->name()->as_C_string(),
+ new_method->signature()->as_C_string()));
}
}
}
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -937,8 +937,7 @@
Method* method_at_itable(Klass* holder, int index, TRAPS);
#if INCLUDE_JVMTI
- void adjust_default_methods(Method** old_methods, Method** new_methods,
- int methods_length, bool* trace_name_printed);
+ void adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed);
#endif // INCLUDE_JVMTI
// Garbage collection
--- a/hotspot/src/share/vm/oops/klassVtable.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -863,44 +863,43 @@
}
return updated;
}
-void klassVtable::adjust_method_entries(Method** old_methods, Method** new_methods,
- int methods_length, bool * trace_name_printed) {
- // search the vtable for uses of either obsolete or EMCP methods
- for (int j = 0; j < methods_length; j++) {
- Method* old_method = old_methods[j];
- Method* new_method = new_methods[j];
+
+// search the vtable for uses of either obsolete or EMCP methods
+void klassVtable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
+ int prn_enabled = 0;
+ for (int index = 0; index < length(); index++) {
+ Method* old_method = unchecked_method_at(index);
+ if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
+ continue; // skip uninteresting entries
+ }
+ assert(!old_method->is_deleted(), "vtable methods may not be deleted");
+
+ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
+
+ assert(new_method != NULL, "method_with_idnum() should not be NULL");
+ assert(old_method != new_method, "sanity check");
- // In the vast majority of cases we could get the vtable index
- // by using: old_method->vtable_index()
- // However, there are rare cases, eg. sun.awt.X11.XDecoratedPeer.getX()
- // in sun.awt.X11.XFramePeer where methods occur more than once in the
- // vtable, so, alas, we must do an exhaustive search.
- for (int index = 0; index < length(); index++) {
- if (unchecked_method_at(index) == old_method) {
- put_method_at(new_method, index);
- // For default methods, need to update the _default_methods array
- // which can only have one method entry for a given signature
- bool updated_default = false;
- if (old_method->is_default_method()) {
- updated_default = adjust_default_method(index, old_method, new_method);
- }
+ put_method_at(new_method, index);
+ // For default methods, need to update the _default_methods array
+ // which can only have one method entry for a given signature
+ bool updated_default = false;
+ if (old_method->is_default_method()) {
+ updated_default = adjust_default_method(index, old_method, new_method);
+ }
- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
- if (!(*trace_name_printed)) {
- // RC_TRACE_MESG macro has an embedded ResourceMark
- RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
- klass()->external_name(),
- old_method->method_holder()->external_name()));
- *trace_name_printed = true;
- }
- // RC_TRACE macro has an embedded ResourceMark
- RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
- new_method->name()->as_C_string(),
- new_method->signature()->as_C_string(),
- updated_default ? "true" : "false"));
- }
- // cannot 'break' here; see for-loop comment above.
+ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+ if (!(*trace_name_printed)) {
+ // RC_TRACE_MESG macro has an embedded ResourceMark
+ RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
+ klass()->external_name(),
+ old_method->method_holder()->external_name()));
+ *trace_name_printed = true;
}
+ // RC_TRACE macro has an embedded ResourceMark
+ RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
+ new_method->name()->as_C_string(),
+ new_method->signature()->as_C_string(),
+ updated_default ? "true" : "false"));
}
}
}
@@ -1193,37 +1192,35 @@
}
#if INCLUDE_JVMTI
-void klassItable::adjust_method_entries(Method** old_methods, Method** new_methods,
- int methods_length, bool * trace_name_printed) {
- // search the itable for uses of either obsolete or EMCP methods
- for (int j = 0; j < methods_length; j++) {
- Method* old_method = old_methods[j];
- Method* new_method = new_methods[j];
- itableMethodEntry* ime = method_entry(0);
+// search the itable for uses of either obsolete or EMCP methods
+void klassItable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
- // The itable can describe more than one interface and the same
- // method signature can be specified by more than one interface.
- // This means we have to do an exhaustive search to find all the
- // old_method references.
- for (int i = 0; i < _size_method_table; i++) {
- if (ime->method() == old_method) {
- ime->initialize(new_method);
+ itableMethodEntry* ime = method_entry(0);
+ for (int i = 0; i < _size_method_table; i++, ime++) {
+ Method* old_method = ime->method();
+ if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
+ continue; // skip uninteresting entries
+ }
+ assert(!old_method->is_deleted(), "itable methods may not be deleted");
+
+ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
- if (!(*trace_name_printed)) {
- // RC_TRACE_MESG macro has an embedded ResourceMark
- RC_TRACE_MESG(("adjust: name=%s",
- old_method->method_holder()->external_name()));
- *trace_name_printed = true;
- }
- // RC_TRACE macro has an embedded ResourceMark
- RC_TRACE(0x00200000, ("itable method update: %s(%s)",
- new_method->name()->as_C_string(),
- new_method->signature()->as_C_string()));
- }
- // cannot 'break' here; see for-loop comment above.
+ assert(new_method != NULL, "method_with_idnum() should not be NULL");
+ assert(old_method != new_method, "sanity check");
+
+ ime->initialize(new_method);
+
+ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+ if (!(*trace_name_printed)) {
+ // RC_TRACE_MESG macro has an embedded ResourceMark
+ RC_TRACE_MESG(("adjust: name=%s",
+ old_method->method_holder()->external_name()));
+ *trace_name_printed = true;
}
- ime++;
+ // RC_TRACE macro has an embedded ResourceMark
+ RC_TRACE(0x00200000, ("itable method update: %s(%s)",
+ new_method->name()->as_C_string(),
+ new_method->signature()->as_C_string()));
}
}
}
--- a/hotspot/src/share/vm/oops/klassVtable.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/klassVtable.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -98,8 +98,7 @@
// printed the klass name so that other routines in the adjust_*
// group don't print the klass name.
bool adjust_default_method(int vtable_index, Method* old_method, Method* new_method);
- void adjust_method_entries(Method** old_methods, Method** new_methods,
- int methods_length, bool * trace_name_printed);
+ void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
bool check_no_old_or_obsolete_entries();
void dump_vtable();
#endif // INCLUDE_JVMTI
@@ -288,8 +287,7 @@
// trace_name_printed is set to true if the current call has
// printed the klass name so that other routines in the adjust_*
// group don't print the klass name.
- void adjust_method_entries(Method** old_methods, Method** new_methods,
- int methods_length, bool * trace_name_printed);
+ void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
bool check_no_old_or_obsolete_entries();
void dump_itable();
#endif // INCLUDE_JVMTI
--- a/hotspot/src/share/vm/oops/method.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/method.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1450,6 +1450,7 @@
for (int i = 0; i < length; i++) {
Method* m = methods->at(i);
m->set_method_idnum(i);
+ m->set_orig_method_idnum(i);
}
}
}
--- a/hotspot/src/share/vm/oops/method.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/oops/method.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -233,6 +233,9 @@
u2 method_idnum() const { return constMethod()->method_idnum(); }
void set_method_idnum(u2 idnum) { constMethod()->set_method_idnum(idnum); }
+ u2 orig_method_idnum() const { return constMethod()->orig_method_idnum(); }
+ void set_orig_method_idnum(u2 idnum) { constMethod()->set_orig_method_idnum(idnum); }
+
// code size
int code_size() const { return constMethod()->code_size(); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/opto/arraycopynode.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,597 @@
+/*
+ * Copyright (c) 2015, 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 "precompiled.hpp"
+#include "opto/arraycopynode.hpp"
+#include "opto/graphKit.hpp"
+
+ArrayCopyNode::ArrayCopyNode(Compile* C, bool alloc_tightly_coupled)
+ : CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
+ _alloc_tightly_coupled(alloc_tightly_coupled),
+ _kind(None),
+ _arguments_validated(false) {
+ init_class_id(Class_ArrayCopy);
+ init_flags(Flag_is_macro);
+ C->add_macro_node(this);
+}
+
+uint ArrayCopyNode::size_of() const { return sizeof(*this); }
+
+ArrayCopyNode* ArrayCopyNode::make(GraphKit* kit, bool may_throw,
+ Node* src, Node* src_offset,
+ Node* dest, Node* dest_offset,
+ Node* length,
+ bool alloc_tightly_coupled,
+ Node* src_klass, Node* dest_klass,
+ Node* src_length, Node* dest_length) {
+
+ ArrayCopyNode* ac = new ArrayCopyNode(kit->C, alloc_tightly_coupled);
+ Node* prev_mem = kit->set_predefined_input_for_runtime_call(ac);
+
+ ac->init_req(ArrayCopyNode::Src, src);
+ ac->init_req(ArrayCopyNode::SrcPos, src_offset);
+ ac->init_req(ArrayCopyNode::Dest, dest);
+ ac->init_req(ArrayCopyNode::DestPos, dest_offset);
+ ac->init_req(ArrayCopyNode::Length, length);
+ ac->init_req(ArrayCopyNode::SrcLen, src_length);
+ ac->init_req(ArrayCopyNode::DestLen, dest_length);
+ ac->init_req(ArrayCopyNode::SrcKlass, src_klass);
+ ac->init_req(ArrayCopyNode::DestKlass, dest_klass);
+
+ if (may_throw) {
+ ac->set_req(TypeFunc::I_O , kit->i_o());
+ kit->add_safepoint_edges(ac, false);
+ }
+
+ return ac;
+}
+
+void ArrayCopyNode::connect_outputs(GraphKit* kit) {
+ kit->set_all_memory_call(this, true);
+ kit->set_control(kit->gvn().transform(new ProjNode(this,TypeFunc::Control)));
+ kit->set_i_o(kit->gvn().transform(new ProjNode(this, TypeFunc::I_O)));
+ kit->make_slow_call_ex(this, kit->env()->Throwable_klass(), true);
+ kit->set_all_memory_call(this);
+}
+
+#ifndef PRODUCT
+const char* ArrayCopyNode::_kind_names[] = {"arraycopy", "arraycopy, validated arguments", "clone", "oop array clone", "CopyOf", "CopyOfRange"};
+void ArrayCopyNode::dump_spec(outputStream *st) const {
+ CallNode::dump_spec(st);
+ st->print(" (%s%s)", _kind_names[_kind], _alloc_tightly_coupled ? ", tightly coupled allocation" : "");
+}
+#endif
+
+intptr_t ArrayCopyNode::get_length_if_constant(PhaseGVN *phase) const {
+ // check that length is constant
+ Node* length = in(ArrayCopyNode::Length);
+ const Type* length_type = phase->type(length);
+
+ if (length_type == Type::TOP) {
+ return -1;
+ }
+
+ assert(is_clonebasic() || is_arraycopy() || is_copyof() || is_copyofrange(), "unexpected array copy type");
+
+ return is_clonebasic() ? length->find_intptr_t_con(-1) : length->find_int_con(-1);
+}
+
+int ArrayCopyNode::get_count(PhaseGVN *phase) const {
+ Node* src = in(ArrayCopyNode::Src);
+ const Type* src_type = phase->type(src);
+
+ if (is_clonebasic()) {
+ if (src_type->isa_instptr()) {
+ const TypeInstPtr* inst_src = src_type->is_instptr();
+ ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
+ // ciInstanceKlass::nof_nonstatic_fields() doesn't take injected
+ // fields into account. They are rare anyway so easier to simply
+ // skip instances with injected fields.
+ if ((!inst_src->klass_is_exact() && (ik->is_interface() || ik->has_subklass())) || ik->has_injected_fields()) {
+ return -1;
+ }
+ int nb_fields = ik->nof_nonstatic_fields();
+ return nb_fields;
+ } else {
+ const TypeAryPtr* ary_src = src_type->isa_aryptr();
+ assert (ary_src != NULL, "not an array or instance?");
+ // clone passes a length as a rounded number of longs. If we're
+ // cloning an array we'll do it element by element. If the
+ // length input to ArrayCopyNode is constant, length of input
+ // array must be too.
+
+ assert((get_length_if_constant(phase) == -1) == !ary_src->size()->is_con() ||
+ phase->is_IterGVN(), "inconsistent");
+
+ if (ary_src->size()->is_con()) {
+ return ary_src->size()->get_con();
+ }
+ return -1;
+ }
+ }
+
+ return get_length_if_constant(phase);
+}
+
+Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int count) {
+ if (!is_clonebasic()) {
+ return NULL;
+ }
+
+ Node* src = in(ArrayCopyNode::Src);
+ Node* dest = in(ArrayCopyNode::Dest);
+ Node* ctl = in(TypeFunc::Control);
+ Node* in_mem = in(TypeFunc::Memory);
+
+ const Type* src_type = phase->type(src);
+
+ assert(src->is_AddP(), "should be base + off");
+ assert(dest->is_AddP(), "should be base + off");
+ Node* base_src = src->in(AddPNode::Base);
+ Node* base_dest = dest->in(AddPNode::Base);
+
+ MergeMemNode* mem = MergeMemNode::make(in_mem);
+
+ const TypeInstPtr* inst_src = src_type->isa_instptr();
+
+ if (inst_src == NULL) {
+ return NULL;
+ }
+
+ if (!inst_src->klass_is_exact()) {
+ ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
+ assert(!ik->is_interface() && !ik->has_subklass(), "inconsistent klass hierarchy");
+ phase->C->dependencies()->assert_leaf_type(ik);
+ }
+
+ ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
+ assert(ik->nof_nonstatic_fields() <= ArrayCopyLoadStoreMaxElem, "too many fields");
+
+ for (int i = 0; i < count; i++) {
+ ciField* field = ik->nonstatic_field_at(i);
+ int fieldidx = phase->C->alias_type(field)->index();
+ const TypePtr* adr_type = phase->C->alias_type(field)->adr_type();
+ Node* off = phase->MakeConX(field->offset());
+ Node* next_src = phase->transform(new AddPNode(base_src,base_src,off));
+ Node* next_dest = phase->transform(new AddPNode(base_dest,base_dest,off));
+ BasicType bt = field->layout_type();
+
+ const Type *type;
+ if (bt == T_OBJECT) {
+ if (!field->type()->is_loaded()) {
+ type = TypeInstPtr::BOTTOM;
+ } else {
+ ciType* field_klass = field->type();
+ type = TypeOopPtr::make_from_klass(field_klass->as_klass());
+ }
+ } else {
+ type = Type::get_const_basic_type(bt);
+ }
+
+ Node* v = LoadNode::make(*phase, ctl, mem->memory_at(fieldidx), next_src, adr_type, type, bt, MemNode::unordered);
+ v = phase->transform(v);
+ Node* s = StoreNode::make(*phase, ctl, mem->memory_at(fieldidx), next_dest, adr_type, v, bt, MemNode::unordered);
+ s = phase->transform(s);
+ mem->set_memory_at(fieldidx, s);
+ }
+
+ if (!finish_transform(phase, can_reshape, ctl, mem)) {
+ return NULL;
+ }
+
+ return mem;
+}
+
+bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
+ Node*& adr_src,
+ Node*& base_src,
+ Node*& adr_dest,
+ Node*& base_dest,
+ BasicType& copy_type,
+ const Type*& value_type,
+ bool& disjoint_bases) {
+ Node* src = in(ArrayCopyNode::Src);
+ Node* dest = in(ArrayCopyNode::Dest);
+ const Type* src_type = phase->type(src);
+ const TypeAryPtr* ary_src = src_type->isa_aryptr();
+
+ if (is_arraycopy() || is_copyofrange() || is_copyof()) {
+ const Type* dest_type = phase->type(dest);
+ const TypeAryPtr* ary_dest = dest_type->isa_aryptr();
+ Node* src_offset = in(ArrayCopyNode::SrcPos);
+ Node* dest_offset = in(ArrayCopyNode::DestPos);
+
+ // newly allocated object is guaranteed to not overlap with source object
+ disjoint_bases = is_alloc_tightly_coupled();
+
+ if (ary_src == NULL || ary_src->klass() == NULL ||
+ ary_dest == NULL || ary_dest->klass() == NULL) {
+ // We don't know if arguments are arrays
+ return false;
+ }
+
+ BasicType src_elem = ary_src->klass()->as_array_klass()->element_type()->basic_type();
+ BasicType dest_elem = ary_dest->klass()->as_array_klass()->element_type()->basic_type();
+ if (src_elem == T_ARRAY) src_elem = T_OBJECT;
+ if (dest_elem == T_ARRAY) dest_elem = T_OBJECT;
+
+ if (src_elem != dest_elem || dest_elem == T_VOID) {
+ // We don't know if arguments are arrays of the same type
+ return false;
+ }
+
+ if (dest_elem == T_OBJECT && (!is_alloc_tightly_coupled() || !GraphKit::use_ReduceInitialCardMarks())) {
+ // It's an object array copy but we can't emit the card marking
+ // that is needed
+ return false;
+ }
+
+ value_type = ary_src->elem();
+
+ base_src = src;
+ base_dest = dest;
+
+ uint shift = exact_log2(type2aelembytes(dest_elem));
+ uint header = arrayOopDesc::base_offset_in_bytes(dest_elem);
+
+ adr_src = src;
+ adr_dest = dest;
+
+ src_offset = Compile::conv_I2X_index(phase, src_offset, ary_src->size());
+ dest_offset = Compile::conv_I2X_index(phase, dest_offset, ary_dest->size());
+
+ Node* src_scale = phase->transform(new LShiftXNode(src_offset, phase->intcon(shift)));
+ Node* dest_scale = phase->transform(new LShiftXNode(dest_offset, phase->intcon(shift)));
+
+ adr_src = phase->transform(new AddPNode(base_src, adr_src, src_scale));
+ adr_dest = phase->transform(new AddPNode(base_dest, adr_dest, dest_scale));
+
+ adr_src = new AddPNode(base_src, adr_src, phase->MakeConX(header));
+ adr_dest = new AddPNode(base_dest, adr_dest, phase->MakeConX(header));
+
+ adr_src = phase->transform(adr_src);
+ adr_dest = phase->transform(adr_dest);
+
+ copy_type = dest_elem;
+ } else {
+ assert (is_clonebasic(), "should be");
+
+ disjoint_bases = true;
+ assert(src->is_AddP(), "should be base + off");
+ assert(dest->is_AddP(), "should be base + off");
+ adr_src = src;
+ base_src = src->in(AddPNode::Base);
+ adr_dest = dest;
+ base_dest = dest->in(AddPNode::Base);
+
+ assert(phase->type(src->in(AddPNode::Offset))->is_intptr_t()->get_con() == phase->type(dest->in(AddPNode::Offset))->is_intptr_t()->get_con(), "same start offset?");
+ BasicType elem = ary_src->klass()->as_array_klass()->element_type()->basic_type();
+ if (elem == T_ARRAY) elem = T_OBJECT;
+
+ int diff = arrayOopDesc::base_offset_in_bytes(elem) - phase->type(src->in(AddPNode::Offset))->is_intptr_t()->get_con();
+ assert(diff >= 0, "clone should not start after 1st array element");
+ if (diff > 0) {
+ adr_src = phase->transform(new AddPNode(base_src, adr_src, phase->MakeConX(diff)));
+ adr_dest = phase->transform(new AddPNode(base_dest, adr_dest, phase->MakeConX(diff)));
+ }
+
+ copy_type = elem;
+ value_type = ary_src->elem();
+ }
+ return true;
+}
+
+const TypePtr* ArrayCopyNode::get_address_type(PhaseGVN *phase, Node* n) {
+ const Type* at = phase->type(n);
+ assert(at != Type::TOP, "unexpected type");
+ const TypePtr* atp = at->isa_ptr();
+ // adjust atp to be the correct array element address type
+ atp = atp->add_offset(Type::OffsetBot);
+ return atp;
+}
+
+void ArrayCopyNode::array_copy_test_overlap(PhaseGVN *phase, bool can_reshape, bool disjoint_bases, int count, Node*& forward_ctl, Node*& backward_ctl) {
+ Node* ctl = in(TypeFunc::Control);
+ if (!disjoint_bases && count > 1) {
+ Node* src_offset = in(ArrayCopyNode::SrcPos);
+ Node* dest_offset = in(ArrayCopyNode::DestPos);
+ assert(src_offset != NULL && dest_offset != NULL, "should be");
+ Node* cmp = phase->transform(new CmpINode(src_offset, dest_offset));
+ Node *bol = phase->transform(new BoolNode(cmp, BoolTest::lt));
+ IfNode *iff = new IfNode(ctl, bol, PROB_FAIR, COUNT_UNKNOWN);
+
+ phase->transform(iff);
+
+ forward_ctl = phase->transform(new IfFalseNode(iff));
+ backward_ctl = phase->transform(new IfTrueNode(iff));
+ } else {
+ forward_ctl = ctl;
+ }
+}
+
+Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase,
+ bool can_reshape,
+ Node* forward_ctl,
+ Node* start_mem_src,
+ Node* start_mem_dest,
+ const TypePtr* atp_src,
+ const TypePtr* atp_dest,
+ Node* adr_src,
+ Node* base_src,
+ Node* adr_dest,
+ Node* base_dest,
+ BasicType copy_type,
+ const Type* value_type,
+ int count) {
+ Node* mem = phase->C->top();
+ if (!forward_ctl->is_top()) {
+ // copy forward
+ mem = start_mem_dest;
+
+ if (count > 0) {
+ Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
+ v = phase->transform(v);
+ mem = StoreNode::make(*phase, forward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered);
+ mem = phase->transform(mem);
+ for (int i = 1; i < count; i++) {
+ Node* off = phase->MakeConX(type2aelembytes(copy_type) * i);
+ Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off));
+ Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off));
+ v = LoadNode::make(*phase, forward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered);
+ v = phase->transform(v);
+ mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
+ mem = phase->transform(mem);
+ }
+ } else if(can_reshape) {
+ PhaseIterGVN* igvn = phase->is_IterGVN();
+ igvn->_worklist.push(adr_src);
+ igvn->_worklist.push(adr_dest);
+ }
+ }
+ return mem;
+}
+
+Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase,
+ bool can_reshape,
+ Node* backward_ctl,
+ Node* start_mem_src,
+ Node* start_mem_dest,
+ const TypePtr* atp_src,
+ const TypePtr* atp_dest,
+ Node* adr_src,
+ Node* base_src,
+ Node* adr_dest,
+ Node* base_dest,
+ BasicType copy_type,
+ const Type* value_type,
+ int count) {
+ Node* mem = phase->C->top();
+ if (!backward_ctl->is_top()) {
+ // copy backward
+ mem = start_mem_dest;
+
+ if (count > 0) {
+ for (int i = count-1; i >= 1; i--) {
+ Node* off = phase->MakeConX(type2aelembytes(copy_type) * i);
+ Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off));
+ Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off));
+ Node* v = LoadNode::make(*phase, backward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered);
+ v = phase->transform(v);
+ mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
+ mem = phase->transform(mem);
+ }
+ Node* v = LoadNode::make(*phase, backward_ctl, mem, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
+ v = phase->transform(v);
+ mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered);
+ mem = phase->transform(mem);
+ } else if(can_reshape) {
+ PhaseIterGVN* igvn = phase->is_IterGVN();
+ igvn->_worklist.push(adr_src);
+ igvn->_worklist.push(adr_dest);
+ }
+ }
+ return mem;
+}
+
+bool ArrayCopyNode::finish_transform(PhaseGVN *phase, bool can_reshape,
+ Node* ctl, Node *mem) {
+ if (can_reshape) {
+ PhaseIterGVN* igvn = phase->is_IterGVN();
+ igvn->set_delay_transform(false);
+ if (is_clonebasic()) {
+ Node* out_mem = proj_out(TypeFunc::Memory);
+
+ if (out_mem->outcnt() != 1 || !out_mem->raw_out(0)->is_MergeMem() ||
+ out_mem->raw_out(0)->outcnt() != 1 || !out_mem->raw_out(0)->raw_out(0)->is_MemBar()) {
+ assert(!GraphKit::use_ReduceInitialCardMarks(), "can only happen with card marking");
+ return false;
+ }
+
+ igvn->replace_node(out_mem->raw_out(0), mem);
+
+ Node* out_ctl = proj_out(TypeFunc::Control);
+ igvn->replace_node(out_ctl, ctl);
+ } else {
+ // replace fallthrough projections of the ArrayCopyNode by the
+ // new memory, control and the input IO.
+ CallProjections callprojs;
+ extract_projections(&callprojs, true);
+
+ igvn->replace_node(callprojs.fallthrough_ioproj, in(TypeFunc::I_O));
+ igvn->replace_node(callprojs.fallthrough_memproj, mem);
+ igvn->replace_node(callprojs.fallthrough_catchproj, ctl);
+
+ // The ArrayCopyNode is not disconnected. It still has the
+ // projections for the exception case. Replace current
+ // ArrayCopyNode with a dummy new one with a top() control so
+ // that this part of the graph stays consistent but is
+ // eventually removed.
+
+ set_req(0, phase->C->top());
+ remove_dead_region(phase, can_reshape);
+ }
+ } else {
+ if (in(TypeFunc::Control) != ctl) {
+ // we can't return new memory and control from Ideal at parse time
+ assert(!is_clonebasic(), "added control for clone?");
+ return false;
+ }
+ }
+ return true;
+}
+
+
+Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) {
+ if (remove_dead_region(phase, can_reshape)) return this;
+
+ if (StressArrayCopyMacroNode && !can_reshape) {
+ phase->record_for_igvn(this);
+ return NULL;
+ }
+
+ // See if it's a small array copy and we can inline it as
+ // loads/stores
+ // Here we can only do:
+ // - arraycopy if all arguments were validated before and we don't
+ // need card marking
+ // - clone for which we don't need to do card marking
+
+ if (!is_clonebasic() && !is_arraycopy_validated() &&
+ !is_copyofrange_validated() && !is_copyof_validated()) {
+ return NULL;
+ }
+
+ assert(in(TypeFunc::Control) != NULL &&
+ in(TypeFunc::Memory) != NULL &&
+ in(ArrayCopyNode::Src) != NULL &&
+ in(ArrayCopyNode::Dest) != NULL &&
+ in(ArrayCopyNode::Length) != NULL &&
+ ((in(ArrayCopyNode::SrcPos) != NULL && in(ArrayCopyNode::DestPos) != NULL) ||
+ is_clonebasic()), "broken inputs");
+
+ if (in(TypeFunc::Control)->is_top() ||
+ in(TypeFunc::Memory)->is_top() ||
+ phase->type(in(ArrayCopyNode::Src)) == Type::TOP ||
+ phase->type(in(ArrayCopyNode::Dest)) == Type::TOP ||
+ (in(ArrayCopyNode::SrcPos) != NULL && in(ArrayCopyNode::SrcPos)->is_top()) ||
+ (in(ArrayCopyNode::DestPos) != NULL && in(ArrayCopyNode::DestPos)->is_top())) {
+ return NULL;
+ }
+
+ int count = get_count(phase);
+
+ if (count < 0 || count > ArrayCopyLoadStoreMaxElem) {
+ return NULL;
+ }
+
+ Node* mem = try_clone_instance(phase, can_reshape, count);
+ if (mem != NULL) {
+ return mem;
+ }
+
+ Node* adr_src = NULL;
+ Node* base_src = NULL;
+ Node* adr_dest = NULL;
+ Node* base_dest = NULL;
+ BasicType copy_type = T_ILLEGAL;
+ const Type* value_type = NULL;
+ bool disjoint_bases = false;
+
+ if (!prepare_array_copy(phase, can_reshape,
+ adr_src, base_src, adr_dest, base_dest,
+ copy_type, value_type, disjoint_bases)) {
+ return NULL;
+ }
+
+ Node* src = in(ArrayCopyNode::Src);
+ Node* dest = in(ArrayCopyNode::Dest);
+ const TypePtr* atp_src = get_address_type(phase, src);
+ const TypePtr* atp_dest = get_address_type(phase, dest);
+ uint alias_idx_src = phase->C->get_alias_index(atp_src);
+ uint alias_idx_dest = phase->C->get_alias_index(atp_dest);
+
+ Node *in_mem = in(TypeFunc::Memory);
+ Node *start_mem_src = in_mem;
+ Node *start_mem_dest = in_mem;
+ if (in_mem->is_MergeMem()) {
+ start_mem_src = in_mem->as_MergeMem()->memory_at(alias_idx_src);
+ start_mem_dest = in_mem->as_MergeMem()->memory_at(alias_idx_dest);
+ }
+
+
+ if (can_reshape) {
+ assert(!phase->is_IterGVN()->delay_transform(), "cannot delay transforms");
+ phase->is_IterGVN()->set_delay_transform(true);
+ }
+
+ Node* backward_ctl = phase->C->top();
+ Node* forward_ctl = phase->C->top();
+ array_copy_test_overlap(phase, can_reshape, disjoint_bases, count, forward_ctl, backward_ctl);
+
+ Node* forward_mem = array_copy_forward(phase, can_reshape, forward_ctl,
+ start_mem_src, start_mem_dest,
+ atp_src, atp_dest,
+ adr_src, base_src, adr_dest, base_dest,
+ copy_type, value_type, count);
+
+ Node* backward_mem = array_copy_backward(phase, can_reshape, backward_ctl,
+ start_mem_src, start_mem_dest,
+ atp_src, atp_dest,
+ adr_src, base_src, adr_dest, base_dest,
+ copy_type, value_type, count);
+
+ Node* ctl = NULL;
+ if (!forward_ctl->is_top() && !backward_ctl->is_top()) {
+ ctl = new RegionNode(3);
+ mem = new PhiNode(ctl, Type::MEMORY, atp_dest);
+ ctl->init_req(1, forward_ctl);
+ mem->init_req(1, forward_mem);
+ ctl->init_req(2, backward_ctl);
+ mem->init_req(2, backward_mem);
+ ctl = phase->transform(ctl);
+ mem = phase->transform(mem);
+ } else if (!forward_ctl->is_top()) {
+ ctl = forward_ctl;
+ mem = forward_mem;
+ } else {
+ assert(!backward_ctl->is_top(), "no copy?");
+ ctl = backward_ctl;
+ mem = backward_mem;
+ }
+
+ if (can_reshape) {
+ assert(phase->is_IterGVN()->delay_transform(), "should be delaying transforms");
+ phase->is_IterGVN()->set_delay_transform(false);
+ }
+
+ MergeMemNode* out_mem = MergeMemNode::make(in_mem);
+ out_mem->set_memory_at(alias_idx_dest, mem);
+ mem = out_mem;
+
+ if (!finish_transform(phase, can_reshape, ctl, mem)) {
+ return NULL;
+ }
+
+ return mem;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/opto/arraycopynode.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+#ifndef SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
+#define SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
+
+#include "opto/callnode.hpp"
+
+class GraphKit;
+
+class ArrayCopyNode : public CallNode {
+private:
+
+ // What kind of arraycopy variant is this?
+ enum {
+ None, // not set yet
+ ArrayCopy, // System.arraycopy()
+ CloneBasic, // A clone that can be copied by 64 bit chunks
+ CloneOop, // An oop array clone
+ CopyOf, // Arrays.copyOf()
+ CopyOfRange // Arrays.copyOfRange()
+ } _kind;
+
+#ifndef PRODUCT
+ static const char* _kind_names[CopyOfRange+1];
+#endif
+ // Is the alloc obtained with
+ // AllocateArrayNode::Ideal_array_allocation() tighly coupled
+ // (arraycopy follows immediately the allocation)?
+ // We cache the result of LibraryCallKit::tightly_coupled_allocation
+ // here because it's much easier to find whether there's a tightly
+ // couple allocation at parse time than at macro expansion time. At
+ // macro expansion time, for every use of the allocation node we
+ // would need to figure out whether it happens after the arraycopy (and
+ // can be ignored) or between the allocation and the arraycopy. At
+ // parse time, it's straightforward because whatever happens after
+ // the arraycopy is not parsed yet so doesn't exist when
+ // LibraryCallKit::tightly_coupled_allocation() is called.
+ bool _alloc_tightly_coupled;
+
+ bool _arguments_validated;
+
+ static const TypeFunc* arraycopy_type() {
+ const Type** fields = TypeTuple::fields(ParmLimit - TypeFunc::Parms);
+ fields[Src] = TypeInstPtr::BOTTOM;
+ fields[SrcPos] = TypeInt::INT;
+ fields[Dest] = TypeInstPtr::BOTTOM;
+ fields[DestPos] = TypeInt::INT;
+ fields[Length] = TypeInt::INT;
+ fields[SrcLen] = TypeInt::INT;
+ fields[DestLen] = TypeInt::INT;
+ fields[SrcKlass] = TypeKlassPtr::BOTTOM;
+ fields[DestKlass] = TypeKlassPtr::BOTTOM;
+ const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
+
+ // create result type (range)
+ fields = TypeTuple::fields(0);
+
+ const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
+
+ return TypeFunc::make(domain, range);
+ }
+
+ ArrayCopyNode(Compile* C, bool alloc_tightly_coupled);
+
+ intptr_t get_length_if_constant(PhaseGVN *phase) const;
+ int get_count(PhaseGVN *phase) const;
+ static const TypePtr* get_address_type(PhaseGVN *phase, Node* n);
+
+ Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count);
+ Node* conv_I2X_offset(PhaseGVN *phase, Node* offset, const TypeAryPtr* ary_t);
+ bool prepare_array_copy(PhaseGVN *phase, bool can_reshape,
+ Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest,
+ BasicType& copy_type, const Type*& value_type, bool& disjoint_bases);
+ void array_copy_test_overlap(PhaseGVN *phase, bool can_reshape,
+ bool disjoint_bases, int count,
+ Node*& forward_ctl, Node*& backward_ctl);
+ Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node* ctl,
+ Node* start_mem_src, Node* start_mem_dest,
+ const TypePtr* atp_src, const TypePtr* atp_dest,
+ Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
+ BasicType copy_type, const Type* value_type, int count);
+ Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node* ctl,
+ Node *start_mem_src, Node* start_mem_dest,
+ const TypePtr* atp_src, const TypePtr* atp_dest,
+ Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
+ BasicType copy_type, const Type* value_type, int count);
+ bool finish_transform(PhaseGVN *phase, bool can_reshape,
+ Node* ctl, Node *mem);
+
+public:
+
+ enum {
+ Src = TypeFunc::Parms,
+ SrcPos,
+ Dest,
+ DestPos,
+ Length,
+ SrcLen,
+ DestLen,
+ SrcKlass,
+ DestKlass,
+ ParmLimit
+ };
+
+ static ArrayCopyNode* make(GraphKit* kit, bool may_throw,
+ Node* src, Node* src_offset,
+ Node* dest, Node* dest_offset,
+ Node* length,
+ bool alloc_tightly_coupled,
+ Node* src_klass = NULL, Node* dest_klass = NULL,
+ Node* src_length = NULL, Node* dest_length = NULL);
+
+ void connect_outputs(GraphKit* kit);
+
+ bool is_arraycopy() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy; }
+ bool is_arraycopy_validated() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy && _arguments_validated; }
+ bool is_clonebasic() const { assert(_kind != None, "should bet set"); return _kind == CloneBasic; }
+ bool is_cloneoop() const { assert(_kind != None, "should bet set"); return _kind == CloneOop; }
+ bool is_copyof() const { assert(_kind != None, "should bet set"); return _kind == CopyOf; }
+ bool is_copyof_validated() const { assert(_kind != None, "should bet set"); return _kind == CopyOf && _arguments_validated; }
+ bool is_copyofrange() const { assert(_kind != None, "should bet set"); return _kind == CopyOfRange; }
+ bool is_copyofrange_validated() const { assert(_kind != None, "should bet set"); return _kind == CopyOfRange && _arguments_validated; }
+
+ void set_arraycopy(bool validated) { assert(_kind == None, "shouldn't bet set yet"); _kind = ArrayCopy; _arguments_validated = validated; }
+ void set_clonebasic() { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneBasic; }
+ void set_cloneoop() { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneOop; }
+ void set_copyof(bool validated) { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOf; _arguments_validated = validated; }
+ void set_copyofrange(bool validated) { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOfRange; _arguments_validated = validated; }
+
+ virtual int Opcode() const;
+ virtual uint size_of() const; // Size is bigger
+ virtual bool guaranteed_safepoint() { return false; }
+ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+
+ bool is_alloc_tightly_coupled() const { return _alloc_tightly_coupled; }
+
+#ifndef PRODUCT
+ virtual void dump_spec(outputStream *st) const;
+#endif
+};
+
+#endif // SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
--- a/hotspot/src/share/vm/opto/callnode.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/callnode.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1875,194 +1875,3 @@
log->tail(tag);
}
}
-
-ArrayCopyNode::ArrayCopyNode(Compile* C, bool alloc_tightly_coupled)
- : CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
- _alloc_tightly_coupled(alloc_tightly_coupled),
- _kind(None),
- _arguments_validated(false) {
- init_class_id(Class_ArrayCopy);
- init_flags(Flag_is_macro);
- C->add_macro_node(this);
-}
-
-uint ArrayCopyNode::size_of() const { return sizeof(*this); }
-
-ArrayCopyNode* ArrayCopyNode::make(GraphKit* kit, bool may_throw,
- Node* src, Node* src_offset,
- Node* dest, Node* dest_offset,
- Node* length,
- bool alloc_tightly_coupled,
- Node* src_klass, Node* dest_klass,
- Node* src_length, Node* dest_length) {
-
- ArrayCopyNode* ac = new ArrayCopyNode(kit->C, alloc_tightly_coupled);
- Node* prev_mem = kit->set_predefined_input_for_runtime_call(ac);
-
- ac->init_req(ArrayCopyNode::Src, src);
- ac->init_req(ArrayCopyNode::SrcPos, src_offset);
- ac->init_req(ArrayCopyNode::Dest, dest);
- ac->init_req(ArrayCopyNode::DestPos, dest_offset);
- ac->init_req(ArrayCopyNode::Length, length);
- ac->init_req(ArrayCopyNode::SrcLen, src_length);
- ac->init_req(ArrayCopyNode::DestLen, dest_length);
- ac->init_req(ArrayCopyNode::SrcKlass, src_klass);
- ac->init_req(ArrayCopyNode::DestKlass, dest_klass);
-
- if (may_throw) {
- ac->set_req(TypeFunc::I_O , kit->i_o());
- kit->add_safepoint_edges(ac, false);
- }
-
- return ac;
-}
-
-void ArrayCopyNode::connect_outputs(GraphKit* kit) {
- kit->set_all_memory_call(this, true);
- kit->set_control(kit->gvn().transform(new ProjNode(this,TypeFunc::Control)));
- kit->set_i_o(kit->gvn().transform(new ProjNode(this, TypeFunc::I_O)));
- kit->make_slow_call_ex(this, kit->env()->Throwable_klass(), true);
- kit->set_all_memory_call(this);
-}
-
-#ifndef PRODUCT
-const char* ArrayCopyNode::_kind_names[] = {"arraycopy", "arraycopy, validated arguments", "clone", "oop array clone", "CopyOf", "CopyOfRange"};
-void ArrayCopyNode::dump_spec(outputStream *st) const {
- CallNode::dump_spec(st);
- st->print(" (%s%s)", _kind_names[_kind], _alloc_tightly_coupled ? ", tightly coupled allocation" : "");
-}
-#endif
-
-int ArrayCopyNode::get_count(PhaseGVN *phase) const {
- Node* src = in(ArrayCopyNode::Src);
- const Type* src_type = phase->type(src);
-
- assert(is_clonebasic(), "unexpected arraycopy type");
- if (src_type->isa_instptr()) {
- const TypeInstPtr* inst_src = src_type->is_instptr();
- ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
- // ciInstanceKlass::nof_nonstatic_fields() doesn't take injected
- // fields into account. They are rare anyway so easier to simply
- // skip instances with injected fields.
- if ((!inst_src->klass_is_exact() && (ik->is_interface() || ik->has_subklass())) || ik->has_injected_fields()) {
- return -1;
- }
- int nb_fields = ik->nof_nonstatic_fields();
- return nb_fields;
- }
- return -1;
-}
-
-Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int count) {
- assert(is_clonebasic(), "unexpected arraycopy type");
-
- Node* src = in(ArrayCopyNode::Src);
- Node* dest = in(ArrayCopyNode::Dest);
- Node* ctl = in(TypeFunc::Control);
- Node* in_mem = in(TypeFunc::Memory);
-
- const Type* src_type = phase->type(src);
- const Type* dest_type = phase->type(dest);
-
- assert(src->is_AddP(), "should be base + off");
- assert(dest->is_AddP(), "should be base + off");
- Node* base_src = src->in(AddPNode::Base);
- Node* base_dest = dest->in(AddPNode::Base);
-
- MergeMemNode* mem = MergeMemNode::make(in_mem);
-
- const TypeInstPtr* inst_src = src_type->is_instptr();
-
- if (!inst_src->klass_is_exact()) {
- ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
- assert(!ik->is_interface() && !ik->has_subklass(), "inconsistent klass hierarchy");
- phase->C->dependencies()->assert_leaf_type(ik);
- }
-
- ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
- assert(ik->nof_nonstatic_fields() <= ArrayCopyLoadStoreMaxElem, "too many fields");
-
- for (int i = 0; i < count; i++) {
- ciField* field = ik->nonstatic_field_at(i);
- int fieldidx = phase->C->alias_type(field)->index();
- const TypePtr* adr_type = phase->C->alias_type(field)->adr_type();
- Node* off = phase->MakeConX(field->offset());
- Node* next_src = phase->transform(new AddPNode(base_src,base_src,off));
- Node* next_dest = phase->transform(new AddPNode(base_dest,base_dest,off));
- BasicType bt = field->layout_type();
-
- const Type *type;
- if (bt == T_OBJECT) {
- if (!field->type()->is_loaded()) {
- type = TypeInstPtr::BOTTOM;
- } else {
- ciType* field_klass = field->type();
- type = TypeOopPtr::make_from_klass(field_klass->as_klass());
- }
- } else {
- type = Type::get_const_basic_type(bt);
- }
-
- Node* v = LoadNode::make(*phase, ctl, mem->memory_at(fieldidx), next_src, adr_type, type, bt, MemNode::unordered);
- v = phase->transform(v);
- Node* s = StoreNode::make(*phase, ctl, mem->memory_at(fieldidx), next_dest, adr_type, v, bt, MemNode::unordered);
- s = phase->transform(s);
- mem->set_memory_at(fieldidx, s);
- }
-
- if (!finish_transform(phase, can_reshape, ctl, mem)) {
- return NULL;
- }
-
- return mem;
-}
-
-bool ArrayCopyNode::finish_transform(PhaseGVN *phase, bool can_reshape,
- Node* ctl, Node *mem) {
- if (can_reshape) {
- PhaseIterGVN* igvn = phase->is_IterGVN();
- assert(is_clonebasic(), "unexpected arraycopy type");
- Node* out_mem = proj_out(TypeFunc::Memory);
-
- if (out_mem->outcnt() != 1 || !out_mem->raw_out(0)->is_MergeMem() ||
- out_mem->raw_out(0)->outcnt() != 1 || !out_mem->raw_out(0)->raw_out(0)->is_MemBar()) {
- assert(!GraphKit::use_ReduceInitialCardMarks(), "can only happen with card marking");
- return false;
- }
-
- igvn->replace_node(out_mem->raw_out(0), mem);
-
- Node* out_ctl = proj_out(TypeFunc::Control);
- igvn->replace_node(out_ctl, ctl);
- }
- return true;
-}
-
-
-Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) {
- if (remove_dead_region(phase, can_reshape)) return this;
-
- if (StressArrayCopyMacroNode && !can_reshape) return NULL;
-
- // See if it's a small array copy and we can inline it as
- // loads/stores
- // Here we can only do:
- // - clone for which we don't need to do card marking
-
- if (!is_clonebasic()) {
- return NULL;
- }
-
- if (in(TypeFunc::Control)->is_top() || in(TypeFunc::Memory)->is_top()) {
- return NULL;
- }
-
- int count = get_count(phase);
-
- if (count < 0 || count > ArrayCopyLoadStoreMaxElem) {
- return NULL;
- }
-
- Node* mem = try_clone_instance(phase, can_reshape, count);
- return mem;
-}
--- a/hotspot/src/share/vm/opto/callnode.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/callnode.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1083,117 +1083,4 @@
#endif
};
-class GraphKit;
-
-class ArrayCopyNode : public CallNode {
-private:
-
- // What kind of arraycopy variant is this?
- enum {
- None, // not set yet
- ArrayCopy, // System.arraycopy()
- CloneBasic, // A clone that can be copied by 64 bit chunks
- CloneOop, // An oop array clone
- CopyOf, // Arrays.copyOf()
- CopyOfRange // Arrays.copyOfRange()
- } _kind;
-
-#ifndef PRODUCT
- static const char* _kind_names[CopyOfRange+1];
-#endif
- // Is the alloc obtained with
- // AllocateArrayNode::Ideal_array_allocation() tighly coupled
- // (arraycopy follows immediately the allocation)?
- // We cache the result of LibraryCallKit::tightly_coupled_allocation
- // here because it's much easier to find whether there's a tightly
- // couple allocation at parse time than at macro expansion time. At
- // macro expansion time, for every use of the allocation node we
- // would need to figure out whether it happens after the arraycopy (and
- // can be ignored) or between the allocation and the arraycopy. At
- // parse time, it's straightforward because whatever happens after
- // the arraycopy is not parsed yet so doesn't exist when
- // LibraryCallKit::tightly_coupled_allocation() is called.
- bool _alloc_tightly_coupled;
-
- bool _arguments_validated;
-
- static const TypeFunc* arraycopy_type() {
- const Type** fields = TypeTuple::fields(ParmLimit - TypeFunc::Parms);
- fields[Src] = TypeInstPtr::BOTTOM;
- fields[SrcPos] = TypeInt::INT;
- fields[Dest] = TypeInstPtr::BOTTOM;
- fields[DestPos] = TypeInt::INT;
- fields[Length] = TypeInt::INT;
- fields[SrcLen] = TypeInt::INT;
- fields[DestLen] = TypeInt::INT;
- fields[SrcKlass] = TypeKlassPtr::BOTTOM;
- fields[DestKlass] = TypeKlassPtr::BOTTOM;
- const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
-
- // create result type (range)
- fields = TypeTuple::fields(0);
-
- const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
-
- return TypeFunc::make(domain, range);
- }
-
- ArrayCopyNode(Compile* C, bool alloc_tightly_coupled);
-
- int get_count(PhaseGVN *phase) const;
- static const TypePtr* get_address_type(PhaseGVN *phase, Node* n);
-
- Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count);
- bool finish_transform(PhaseGVN *phase, bool can_reshape,
- Node* ctl, Node *mem);
-
-public:
-
- enum {
- Src = TypeFunc::Parms,
- SrcPos,
- Dest,
- DestPos,
- Length,
- SrcLen,
- DestLen,
- SrcKlass,
- DestKlass,
- ParmLimit
- };
-
- static ArrayCopyNode* make(GraphKit* kit, bool may_throw,
- Node* src, Node* src_offset,
- Node* dest, Node* dest_offset,
- Node* length,
- bool alloc_tightly_coupled,
- Node* src_klass = NULL, Node* dest_klass = NULL,
- Node* src_length = NULL, Node* dest_length = NULL);
-
- void connect_outputs(GraphKit* kit);
-
- bool is_arraycopy() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy; }
- bool is_arraycopy_validated() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy && _arguments_validated; }
- bool is_clonebasic() const { assert(_kind != None, "should bet set"); return _kind == CloneBasic; }
- bool is_cloneoop() const { assert(_kind != None, "should bet set"); return _kind == CloneOop; }
- bool is_copyof() const { assert(_kind != None, "should bet set"); return _kind == CopyOf; }
- bool is_copyofrange() const { assert(_kind != None, "should bet set"); return _kind == CopyOfRange; }
-
- void set_arraycopy(bool validated) { assert(_kind == None, "shouldn't bet set yet"); _kind = ArrayCopy; _arguments_validated = validated; }
- void set_clonebasic() { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneBasic; }
- void set_cloneoop() { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneOop; }
- void set_copyof() { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOf; _arguments_validated = false; }
- void set_copyofrange() { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOfRange; _arguments_validated = false; }
-
- virtual int Opcode() const;
- virtual uint size_of() const; // Size is bigger
- virtual bool guaranteed_safepoint() { return false; }
- virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
-
- bool is_alloc_tightly_coupled() const { return _alloc_tightly_coupled; }
-
-#ifndef PRODUCT
- virtual void dump_spec(outputStream *st) const;
-#endif
-};
#endif // SHARE_VM_OPTO_CALLNODE_HPP
--- a/hotspot/src/share/vm/opto/classes.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/classes.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "opto/addnode.hpp"
+#include "opto/arraycopynode.hpp"
#include "opto/callnode.hpp"
#include "opto/castnode.hpp"
#include "opto/cfgnode.hpp"
--- a/hotspot/src/share/vm/opto/compile.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -42,6 +42,7 @@
#include "opto/chaitin.hpp"
#include "opto/compile.hpp"
#include "opto/connode.hpp"
+#include "opto/convertnode.hpp"
#include "opto/divnode.hpp"
#include "opto/escape.hpp"
#include "opto/idealGraphPrinter.hpp"
@@ -3867,6 +3868,26 @@
return SSC_full_test;
}
+Node* Compile::conv_I2X_index(PhaseGVN *phase, Node* idx, const TypeInt* sizetype) {
+#ifdef _LP64
+ // The scaled index operand to AddP must be a clean 64-bit value.
+ // Java allows a 32-bit int to be incremented to a negative
+ // value, which appears in a 64-bit register as a large
+ // positive number. Using that large positive number as an
+ // operand in pointer arithmetic has bad consequences.
+ // On the other hand, 32-bit overflow is rare, and the possibility
+ // can often be excluded, if we annotate the ConvI2L node with
+ // a type assertion that its value is known to be a small positive
+ // number. (The prior range check has ensured this.)
+ // This assertion is used by ConvI2LNode::Ideal.
+ int index_max = max_jint - 1; // array size is max_jint, index is one less
+ if (sizetype != NULL) index_max = sizetype->_hi - 1;
+ const TypeLong* lidxtype = TypeLong::make(CONST64(0), index_max, Type::WidenMax);
+ idx = phase->transform(new ConvI2LNode(idx, lidxtype));
+#endif
+ return idx;
+}
+
// The message about the current inlining is accumulated in
// _print_inlining_stream and transfered into the _print_inlining_list
// once we know whether inlining succeeds or not. For regular
--- a/hotspot/src/share/vm/opto/compile.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/compile.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -74,6 +74,7 @@
class JVMState;
class Type;
class TypeData;
+class TypeInt;
class TypePtr;
class TypeOopPtr;
class TypeFunc;
@@ -1221,6 +1222,8 @@
enum { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test };
int static_subtype_check(ciKlass* superk, ciKlass* subk);
+ static Node* conv_I2X_index(PhaseGVN *phase, Node* offset, const TypeInt* sizetype);
+
// Auxiliary method for randomized fuzzing/stressing
static bool randomized_select(int count);
};
--- a/hotspot/src/share/vm/opto/graphKit.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/graphKit.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1660,22 +1660,7 @@
// must be correct type for alignment purposes
Node* base = basic_plus_adr(ary, header);
-#ifdef _LP64
- // The scaled index operand to AddP must be a clean 64-bit value.
- // Java allows a 32-bit int to be incremented to a negative
- // value, which appears in a 64-bit register as a large
- // positive number. Using that large positive number as an
- // operand in pointer arithmetic has bad consequences.
- // On the other hand, 32-bit overflow is rare, and the possibility
- // can often be excluded, if we annotate the ConvI2L node with
- // a type assertion that its value is known to be a small positive
- // number. (The prior range check has ensured this.)
- // This assertion is used by ConvI2LNode::Ideal.
- int index_max = max_jint - 1; // array size is max_jint, index is one less
- if (sizetype != NULL) index_max = sizetype->_hi - 1;
- const TypeLong* lidxtype = TypeLong::make(CONST64(0), index_max, Type::WidenMax);
- idx = _gvn.transform( new ConvI2LNode(idx, lidxtype) );
-#endif
+ idx = Compile::conv_I2X_index(&_gvn, idx, sizetype);
Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) );
return basic_plus_adr(ary, base, scale);
}
@@ -3759,7 +3744,8 @@
Node* GraphKit::byte_map_base_node() {
// Get base of card map
- CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
+ CardTableModRefBS* ct =
+ barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
if (ct->byte_map_base != NULL) {
return makecon(TypeRawPtr::make((address)ct->byte_map_base));
--- a/hotspot/src/share/vm/opto/library_call.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -30,6 +30,7 @@
#include "compiler/compileLog.hpp"
#include "oops/objArrayKlass.hpp"
#include "opto/addnode.hpp"
+#include "opto/arraycopynode.hpp"
#include "opto/callGenerator.hpp"
#include "opto/castnode.hpp"
#include "opto/cfgnode.hpp"
@@ -3867,26 +3868,65 @@
Node* orig_tail = _gvn.transform(new SubINode(orig_length, start));
Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length);
- newcopy = new_array(klass_node, length, 0); // no arguments to push
-
// Generate a direct call to the right arraycopy function(s).
// We know the copy is disjoint but we might not know if the
// oop stores need checking.
// Extreme case: Arrays.copyOf((Integer[])x, 10, String[].class).
// This will fail a store-check if x contains any non-nulls.
- Node* alloc = tightly_coupled_allocation(newcopy, NULL);
-
- ArrayCopyNode* ac = ArrayCopyNode::make(this, true, original, start, newcopy, intcon(0), moved, alloc != NULL,
+ // ArrayCopyNode:Ideal may transform the ArrayCopyNode to
+ // loads/stores but it is legal only if we're sure the
+ // Arrays.copyOf would succeed. So we need all input arguments
+ // to the copyOf to be validated, including that the copy to the
+ // new array won't trigger an ArrayStoreException. That subtype
+ // check can be optimized if we know something on the type of
+ // the input array from type speculation.
+ if (_gvn.type(klass_node)->singleton()) {
+ ciKlass* subk = _gvn.type(load_object_klass(original))->is_klassptr()->klass();
+ ciKlass* superk = _gvn.type(klass_node)->is_klassptr()->klass();
+
+ int test = C->static_subtype_check(superk, subk);
+ if (test != Compile::SSC_always_true && test != Compile::SSC_always_false) {
+ const TypeOopPtr* t_original = _gvn.type(original)->is_oopptr();
+ if (t_original->speculative_type() != NULL) {
+ original = maybe_cast_profiled_obj(original, t_original->speculative_type(), true);
+ }
+ }
+ }
+
+ bool validated = false;
+ // Reason_class_check rather than Reason_intrinsic because we
+ // want to intrinsify even if this traps.
+ if (!too_many_traps(Deoptimization::Reason_class_check)) {
+ Node* not_subtype_ctrl = gen_subtype_check(load_object_klass(original),
+ klass_node);
+
+ if (not_subtype_ctrl != top()) {
+ PreserveJVMState pjvms(this);
+ set_control(not_subtype_ctrl);
+ uncommon_trap(Deoptimization::Reason_class_check,
+ Deoptimization::Action_make_not_entrant);
+ assert(stopped(), "Should be stopped");
+ }
+ validated = true;
+ }
+
+ newcopy = new_array(klass_node, length, 0); // no arguments to push
+
+ ArrayCopyNode* ac = ArrayCopyNode::make(this, true, original, start, newcopy, intcon(0), moved, true,
load_object_klass(original), klass_node);
if (!is_copyOfRange) {
- ac->set_copyof();
+ ac->set_copyof(validated);
} else {
- ac->set_copyofrange();
+ ac->set_copyofrange(validated);
}
Node* n = _gvn.transform(ac);
- assert(n == ac, "cannot disappear");
- ac->connect_outputs(this);
+ if (n == ac) {
+ ac->connect_outputs(this);
+ } else {
+ assert(validated, "shouldn't transform if all arguments not validated");
+ set_all_memory(n);
+ }
}
} // original reexecute is set back here
--- a/hotspot/src/share/vm/opto/loopTransform.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -2032,7 +2032,7 @@
// Hopefully, compiler will optimize for powers of 2.
Node *ctrl = get_ctrl(main_limit);
Node *stride = cl->stride();
- Node *init = cl->init_trip();
+ Node *init = cl->init_trip()->uncast();
Node *span = new SubINode(main_limit,init);
register_new_node(span,ctrl);
Node *rndup = _igvn.intcon(stride_con + ((stride_con>0)?-1:1));
--- a/hotspot/src/share/vm/opto/macroArrayCopy.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/macroArrayCopy.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
+#include "opto/arraycopynode.hpp"
#include "oops/objArrayKlass.hpp"
#include "opto/convertnode.hpp"
#include "opto/graphKit.hpp"
@@ -519,7 +520,7 @@
// Test S[] against D[], not S against D, because (probably)
// the secondary supertype cache is less busy for S[] than S.
// This usually only matters when D is an interface.
- Node* not_subtype_ctrl = ac->is_arraycopy_validated() ? top() :
+ Node* not_subtype_ctrl = (ac->is_arraycopy_validated() || ac->is_copyof_validated() || ac->is_copyofrange_validated()) ? top() :
Phase::gen_subtype_check(src_klass, dest_klass, ctrl, mem, &_igvn);
// Plug failing path into checked_oop_disjoint_arraycopy
if (not_subtype_ctrl != top()) {
--- a/hotspot/src/share/vm/opto/type.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/opto/type.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -974,21 +974,10 @@
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
-bool TypeF::eq( const Type *t ) const {
- if( g_isnan(_f) ||
- g_isnan(t->getf()) ) {
- // One or both are NANs. If both are NANs return true, else false.
- return (g_isnan(_f) && g_isnan(t->getf()));
- }
- if (_f == t->getf()) {
- // (NaN is impossible at this point, since it is not equal even to itself)
- if (_f == 0.0) {
- // difference between positive and negative zero
- if (jint_cast(_f) != jint_cast(t->getf())) return false;
- }
- return true;
- }
- return false;
+bool TypeF::eq(const Type *t) const {
+ // Bitwise comparison to distinguish between +/-0. These values must be treated
+ // as different to be consistent with C1 and the interpreter.
+ return (jint_cast(_f) == jint_cast(t->getf()));
}
//------------------------------hash-------------------------------------------
@@ -1089,21 +1078,10 @@
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
-bool TypeD::eq( const Type *t ) const {
- if( g_isnan(_d) ||
- g_isnan(t->getd()) ) {
- // One or both are NANs. If both are NANs return true, else false.
- return (g_isnan(_d) && g_isnan(t->getd()));
- }
- if (_d == t->getd()) {
- // (NaN is impossible at this point, since it is not equal even to itself)
- if (_d == 0.0) {
- // difference between positive and negative zero
- if (jlong_cast(_d) != jlong_cast(t->getd())) return false;
- }
- return true;
- }
- return false;
+bool TypeD::eq(const Type *t) const {
+ // Bitwise comparison to distinguish between +/-0. These values must be treated
+ // as different to be consistent with C1 and the interpreter.
+ return (jlong_cast(_d) == jlong_cast(t->getd()));
}
//------------------------------hash-------------------------------------------
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -782,9 +782,13 @@
Method* idnum_owner = scratch_class->method_with_idnum(old_num);
if (idnum_owner != NULL) {
// There is already a method assigned this idnum -- switch them
+ // Take current and original idnum from the new_method
idnum_owner->set_method_idnum(new_num);
+ idnum_owner->set_orig_method_idnum(k_new_method->orig_method_idnum());
}
+ // Take current and original idnum from the old_method
k_new_method->set_method_idnum(old_num);
+ k_new_method->set_orig_method_idnum(k_old_method->orig_method_idnum());
if (thread->has_pending_exception()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
}
@@ -817,9 +821,12 @@
Method* idnum_owner = scratch_class->method_with_idnum(num);
if (idnum_owner != NULL) {
// There is already a method assigned this idnum -- switch them
+ // Take current and original idnum from the new_method
idnum_owner->set_method_idnum(new_num);
+ idnum_owner->set_orig_method_idnum(k_new_method->orig_method_idnum());
}
k_new_method->set_method_idnum(num);
+ k_new_method->set_orig_method_idnum(num);
if (thread->has_pending_exception()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
}
@@ -3327,6 +3334,7 @@
// This is a very busy routine. We don't want too much tracing
// printed out.
bool trace_name_printed = false;
+ InstanceKlass *the_class = InstanceKlass::cast(_the_class_oop);
// Very noisy: only enable this call if you are trying to determine
// that a specific class gets found by this routine.
@@ -3338,10 +3346,8 @@
// If the class being redefined is java.lang.Object, we need to fix all
// array class vtables also
if (k->oop_is_array() && _the_class_oop == SystemDictionary::Object_klass()) {
- k->vtable()->adjust_method_entries(_matching_old_methods,
- _matching_new_methods,
- _matching_methods_length,
- &trace_name_printed);
+ k->vtable()->adjust_method_entries(the_class, &trace_name_printed);
+
} else if (k->oop_is_instance()) {
HandleMark hm(_thread);
InstanceKlass *ik = InstanceKlass::cast(k);
@@ -3383,14 +3389,9 @@
|| ik->is_subtype_of(_the_class_oop))) {
// ik->vtable() creates a wrapper object; rm cleans it up
ResourceMark rm(_thread);
- ik->vtable()->adjust_method_entries(_matching_old_methods,
- _matching_new_methods,
- _matching_methods_length,
- &trace_name_printed);
- ik->adjust_default_methods(_matching_old_methods,
- _matching_new_methods,
- _matching_methods_length,
- &trace_name_printed);
+
+ ik->vtable()->adjust_method_entries(the_class, &trace_name_printed);
+ ik->adjust_default_methods(the_class, &trace_name_printed);
}
// If the current class has an itable and we are either redefining an
@@ -3405,10 +3406,8 @@
|| ik->is_subclass_of(_the_class_oop))) {
// ik->itable() creates a wrapper object; rm cleans it up
ResourceMark rm(_thread);
- ik->itable()->adjust_method_entries(_matching_old_methods,
- _matching_new_methods,
- _matching_methods_length,
- &trace_name_printed);
+
+ ik->itable()->adjust_method_entries(the_class, &trace_name_printed);
}
// The constant pools in other classes (other_cp) can refer to
@@ -3432,10 +3431,7 @@
other_cp = constantPoolHandle(ik->constants());
cp_cache = other_cp->cache();
if (cp_cache != NULL) {
- cp_cache->adjust_method_entries(_matching_old_methods,
- _matching_new_methods,
- _matching_methods_length,
- &trace_name_printed);
+ cp_cache->adjust_method_entries(the_class, &trace_name_printed);
}
}
@@ -3578,6 +3574,7 @@
// obsolete methods need a unique idnum so they become new entries in
// the jmethodID cache in InstanceKlass
+ assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum();
if (num != ConstMethod::UNSET_IDNUM) {
old_method->set_method_idnum(num);
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -289,7 +289,12 @@
// Create MDO if necessary.
void AdvancedThresholdPolicy::create_mdo(methodHandle mh, JavaThread* THREAD) {
- if (mh->is_native() || mh->is_abstract() || mh->is_accessor()) return;
+ if (mh->is_native() ||
+ mh->is_abstract() ||
+ mh->is_accessor() ||
+ mh->is_constant_getter()) {
+ return;
+ }
if (mh->method_data() == NULL) {
Method::build_interpreter_method_data(mh, CHECK_AND_CLEAR);
}
--- a/hotspot/src/share/vm/runtime/java.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/java.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -421,9 +421,11 @@
os::infinite_sleep();
}
- // Terminate watcher thread - must before disenrolling any periodic task
- if (PeriodicTask::num_tasks() > 0)
+ // Stop the WatcherThread. We do this before disenrolling various
+ // PeriodicTasks to reduce the likelihood of races.
+ if (PeriodicTask::num_tasks() > 0) {
WatcherThread::stop();
+ }
// Print statistics gathered (profiling ...)
if (Arguments::has_profile()) {
--- a/hotspot/src/share/vm/runtime/sweeper.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/sweeper.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -724,6 +724,7 @@
// state of the code cache if it's requested.
void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
if (PrintMethodFlushing) {
+ ResourceMark rm;
stringStream s;
// Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts.
@@ -741,6 +742,7 @@
}
if (LogCompilation && (xtty != NULL)) {
+ ResourceMark rm;
stringStream s;
// Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts.
--- a/hotspot/src/share/vm/runtime/task.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/task.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -47,6 +47,8 @@
#endif
void PeriodicTask::real_time_tick(int delay_time) {
+ assert(Thread::current()->is_Watcher_thread(), "must be WatcherThread");
+
#ifndef PRODUCT
if (ProfilerCheckIntervals) {
_ticks++;
@@ -60,6 +62,8 @@
#endif
{
+ // The WatcherThread does not participate in the safepoint protocol
+ // for the PeriodicTask_lock because it is not a JavaThread.
MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
int orig_num_tasks = _num_tasks;
@@ -74,8 +78,7 @@
}
int PeriodicTask::time_to_wait() {
- MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ?
- NULL : PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+ assert(PeriodicTask_lock->owned_by_self(), "PeriodicTask_lock required");
if (_num_tasks == 0) {
return 0; // sleep until shutdown or a task is enrolled
@@ -98,14 +101,19 @@
}
PeriodicTask::~PeriodicTask() {
+ // This PeriodicTask may have already been disenrolled by a call
+ // to disenroll() before the PeriodicTask was deleted.
disenroll();
}
-/* enroll could be called from a JavaThread, so we have to check for
- * safepoint when taking the lock to avoid deadlocking */
+// enroll the current PeriodicTask
void PeriodicTask::enroll() {
- MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ?
- NULL : PeriodicTask_lock);
+ // Follow normal safepoint aware lock enter protocol if the caller does
+ // not already own the PeriodicTask_lock. Otherwise, we don't try to
+ // enter it again because VM internal Mutexes do not support recursion.
+ //
+ MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ? NULL
+ : PeriodicTask_lock);
if (_num_tasks == PeriodicTask::max_tasks) {
fatal("Overflow in PeriodicTask table");
@@ -113,18 +121,21 @@
_tasks[_num_tasks++] = this;
WatcherThread* thread = WatcherThread::watcher_thread();
- if (thread) {
+ if (thread != NULL) {
thread->unpark();
} else {
WatcherThread::start();
}
}
-/* disenroll could be called from a JavaThread, so we have to check for
- * safepoint when taking the lock to avoid deadlocking */
+// disenroll the current PeriodicTask
void PeriodicTask::disenroll() {
- MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ?
- NULL : PeriodicTask_lock);
+ // Follow normal safepoint aware lock enter protocol if the caller does
+ // not already own the PeriodicTask_lock. Otherwise, we don't try to
+ // enter it again because VM internal Mutexes do not support recursion.
+ //
+ MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ? NULL
+ : PeriodicTask_lock);
int index;
for(index = 0; index < _num_tasks && _tasks[index] != this; index++)
--- a/hotspot/src/share/vm/runtime/task.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/task.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -54,6 +54,7 @@
static int _num_tasks;
static PeriodicTask* _tasks[PeriodicTask::max_tasks];
+ // Can only be called by the WatcherThread
static void real_time_tick(int delay_time);
#ifndef PRODUCT
@@ -98,6 +99,7 @@
// Calculate when the next periodic task will fire.
// Called by the WatcherThread's run method.
+ // Requires the PeriodicTask_lock.
static int time_to_wait();
// The task to perform at each period
--- a/hotspot/src/share/vm/runtime/thread.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1161,6 +1161,10 @@
va_end(ap);
}
+void NamedThread::initialize_named_thread() {
+ set_native_thread_name(name());
+}
+
void NamedThread::print_on(outputStream* st) const {
st->print("\"%s\" ", name());
Thread::print_on(st);
@@ -1197,8 +1201,15 @@
}
int WatcherThread::sleep() const {
+ // The WatcherThread does not participate in the safepoint protocol
+ // for the PeriodicTask_lock because it is not a JavaThread.
MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+ if (_should_terminate) {
+ // check for termination before we do any housekeeping or wait
+ return 0; // we did not sleep.
+ }
+
// remaining will be zero if there are no tasks,
// causing the WatcherThread to sleep until a task is
// enrolled
@@ -1211,8 +1222,9 @@
jlong time_before_loop = os::javaTimeNanos();
- for (;;) {
- bool timedout = PeriodicTask_lock->wait(Mutex::_no_safepoint_check_flag, remaining);
+ while (true) {
+ bool timedout = PeriodicTask_lock->wait(Mutex::_no_safepoint_check_flag,
+ remaining);
jlong now = os::javaTimeNanos();
if (remaining == 0) {
@@ -1253,7 +1265,7 @@
this->initialize_thread_local_storage();
this->set_native_thread_name(this->name());
this->set_active_handles(JNIHandleBlock::allocate_block());
- while (!_should_terminate) {
+ while (true) {
assert(watcher_thread() == Thread::current(), "thread consistency check");
assert(watcher_thread() == this, "thread consistency check");
@@ -1289,6 +1301,11 @@
}
}
+ if (_should_terminate) {
+ // check for termination before posting the next tick
+ break;
+ }
+
PeriodicTask::real_time_tick(time_waited);
}
@@ -1319,27 +1336,19 @@
}
void WatcherThread::stop() {
- // Get the PeriodicTask_lock if we can. If we cannot, then the
- // WatcherThread is using it and we don't want to block on that lock
- // here because that might cause a safepoint deadlock depending on
- // what the current WatcherThread tasks are doing.
- bool have_lock = PeriodicTask_lock->try_lock();
-
- _should_terminate = true;
- OrderAccess::fence(); // ensure WatcherThread sees update in main loop
-
- if (have_lock) {
+ {
+ // Follow normal safepoint aware lock enter protocol since the
+ // WatcherThread is stopped by another JavaThread.
+ MutexLocker ml(PeriodicTask_lock);
+ _should_terminate = true;
+
WatcherThread* watcher = watcher_thread();
if (watcher != NULL) {
- // If we managed to get the lock, then we should unpark the
- // WatcherThread so that it can see we want it to stop.
+ // unpark the WatcherThread so it can see that it should terminate
watcher->unpark();
}
-
- PeriodicTask_lock->unlock();
}
- // it is ok to take late safepoints here, if needed
MutexLocker mu(Terminator_lock);
while (watcher_thread() != NULL) {
@@ -1359,9 +1368,7 @@
}
void WatcherThread::unpark() {
- MutexLockerEx ml(PeriodicTask_lock->owned_by_self()
- ? NULL
- : PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+ assert(PeriodicTask_lock->owned_by_self(), "PeriodicTask_lock required");
PeriodicTask_lock->notify();
}
@@ -3558,8 +3565,8 @@
}
{
- MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
- // Make sure the watcher thread can be started by WatcherThread::start()
+ MutexLocker ml(PeriodicTask_lock);
+ // Make sure the WatcherThread can be started by WatcherThread::start()
// or by dynamic enrollment.
WatcherThread::make_startable();
// Start up the WatcherThread if there are any periodic tasks
--- a/hotspot/src/share/vm/runtime/thread.hpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/thread.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -667,6 +667,7 @@
~NamedThread();
// May only be called once per thread.
void set_name(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void initialize_named_thread();
virtual bool is_Named_thread() const { return true; }
virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; }
JavaThread *processed_thread() { return _processed_thread; }
@@ -701,7 +702,8 @@
static WatcherThread* _watcher_thread;
static bool _startable;
- volatile static bool _should_terminate; // updated without holding lock
+ // volatile due to at least one lock-free read
+ volatile static bool _should_terminate;
os::WatcherThreadCrashProtection* _crash_protection;
public:
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -487,7 +487,6 @@
\
unchecked_nonstatic_field(ageTable, sizes, sizeof(ageTable::sizes)) \
\
- nonstatic_field(BarrierSet, _kind, BarrierSet::Name) \
nonstatic_field(BlockOffsetTable, _bottom, HeapWord*) \
nonstatic_field(BlockOffsetTable, _end, HeapWord*) \
\
--- a/hotspot/src/share/vm/runtime/vmThread.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -243,7 +243,7 @@
assert(this == vm_thread(), "check");
this->initialize_thread_local_storage();
- this->set_native_thread_name(this->name());
+ this->initialize_named_thread();
this->record_stack_base_and_size();
// Notify_lock wait checks on active_handles() to rewait in
// case of spurious wakeup, it should wait on the last
--- a/hotspot/src/share/vm/shark/sharkBuilder.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/shark/sharkBuilder.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -446,7 +446,7 @@
CreateIntToPtr(
CreateAdd(
LLVMValue::intptr_constant(
- (intptr_t) ((CardTableModRefBS *) bs)->byte_map_base),
+ (intptr_t) (barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base)),
CreateLShr(
CreatePtrToInt(field, SharkType::intptr_type()),
LLVMValue::intptr_constant(CardTableModRefBS::card_shift))),
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/utilities/fakeRttiSupport.hpp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+#ifndef SHARE_VM_UTILITIES_FAKERTTISUPPORT_HPP
+#define SHARE_VM_UTILITIES_FAKERTTISUPPORT_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/debug.hpp"
+
+// Provides support for checked downcasts in a hierarchy of classes.
+// The base class provides a member of this type, specialized on that
+// base class and an associated tag type. Tags are small non-negative
+// integer values uniquely associated with distinct classes in the
+// hierarchy. A tag type is often an enum type.
+//
+// The concrete class specifies the concrete tag.
+//
+// The tag set specifies the set of classes in the derivation
+// sequence. Classes in the derivation sequence add their associated
+// tag during construction. Given the tag associated with a class, an
+// object is an instance of that class if the tag is included in the
+// object's set of recorded tags.
+//
+// A tag T is present in a tag set if the T'th bit of the tag set is
+// one.
+//
+// Note: The representation of a tag set being uintx sets an upper
+// bound on the size of a class hierarchy this utility can be used
+// with.
+template<typename T, typename TagType>
+class FakeRttiSupport VALUE_OBJ_CLASS_SPEC {
+public:
+ // Construct with the indicated concrete tag, and include the
+ // concrete tag in the associated tag set.
+ explicit FakeRttiSupport(TagType concrete_tag) :
+ _tag_set(tag_bit(concrete_tag)), _concrete_tag(concrete_tag) { }
+
+ // Construct with the indicated concrete tag and tag set.
+ // Note: This constructor is public only to allow clients to set up
+ // "unusual" (or perhaps buggy) fake RTTI configurations.
+ FakeRttiSupport(TagType concrete_tag, uintx tag_set) :
+ _tag_set(tag_set), _concrete_tag(validate_tag(concrete_tag)) { }
+
+ // Get the concrete tag.
+ TagType concrete_tag() const { return _concrete_tag; }
+
+ // Test whether tag is in the tag set.
+ bool has_tag(TagType tag) const {
+ return (_tag_set & tag_bit(tag)) != 0;
+ }
+
+ // Return a new support object which is the same as this, except tag
+ // has been added to the tag set. The tag must not already be
+ // present in the tag set.
+ FakeRttiSupport add_tag(TagType tag) const {
+ uintx tbit = tag_bit(tag);
+ assert((_tag_set & tbit) == 0,
+ err_msg("Tag " UINTX_FORMAT " is already present in tag set: " UINTX_FORMAT,
+ (uintx)tag, _tag_set));
+ return FakeRttiSupport(_concrete_tag, _tag_set | tbit);
+ }
+
+private:
+ uintx _tag_set;
+ TagType _concrete_tag;
+
+ static uintx tag_bit(TagType tag) {
+ return ((uintx)1) << validate_tag(tag);
+ }
+
+ static TagType validate_tag(uintx tag) {
+ // Type of tag is not TagType to dodge useless MacOSX compiler warning.
+ assert(tag < (sizeof(uintx) * BitsPerByte),
+ err_msg("Tag " UINTX_FORMAT " is too large", tag));
+ return static_cast<TagType>(tag);
+ }
+};
+
+#endif // include guard
--- a/hotspot/src/share/vm/utilities/workgroup.cpp Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/src/share/vm/utilities/workgroup.cpp Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -247,6 +247,7 @@
void GangWorker::initialize() {
this->initialize_thread_local_storage();
this->record_stack_base_and_size();
+ this->initialize_named_thread();
assert(_gang != NULL, "No gang to run in");
os::set_priority(this, NearMaxPriority);
if (TraceWorkGang) {
--- a/hotspot/test/TEST.groups Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/TEST.groups Tue Mar 17 12:30:53 2015 -0700
@@ -114,7 +114,9 @@
compiler/c2/7047069/Test7047069.java \
runtime/6294277/SourceDebugExtension.java \
runtime/ClassFile/JsrRewriting.java \
- runtime/ClassFile/OomWhileParsingRepeatedJsr.java
+ runtime/ClassFile/OomWhileParsingRepeatedJsr.java \
+ runtime/SharedArchiveFile/LimitSharedSizes.java \
+ runtime/SharedArchiveFile/SpaceUtilizationCheck.java
# Compact 3 adds further tests to compact2
#
@@ -387,35 +389,7 @@
-compiler/runtime/6826736
hotspot_compiler_closed = \
- closed/compiler/c1/ \
- closed/compiler/c2/ \
- closed/compiler/codegen/ \
- closed/compiler/escapeAnalysis/ \
- closed/compiler/interpreter/ \
- closed/compiler/jsr292/ \
- closed/compiler/loopopts/ \
- closed/compiler/oracle/ \
- closed/compiler/runtime/ \
- closed/compiler/symantec/ \
- -closed/compiler/c1/4477197 \
- -closed/compiler/c1/5040872 \
- -closed/compiler/c1/6507107 \
- -closed/compiler/c2/4344895 \
- -closed/compiler/c2/4485006 \
- -closed/compiler/c2/4523683 \
- -closed/compiler/c2/4620290 \
- -closed/compiler/c2/4998314 \
- -closed/compiler/c2/6329104 \
- -closed/compiler/c2/6434117 \
- -closed/compiler/c2/6547163 \
- -closed/compiler/c2/6563987 \
- -closed/compiler/c2/6595044 \
- -closed/compiler/codegen/6440479 \
- -closed/compiler/codegen/6603011 \
- -closed/compiler/interpreter/5034475 \
- -closed/compiler/jsr292/LongLambdaFormDynamicStackDepth.java \
- -closed/compiler/loopopts/4463485 \
- -closed/compiler/loopopts/8021898
+ sanity/ExecuteInternalVMTests.java
hotspot_gc = \
sanity/ExecuteInternalVMTests.java \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/arraycopy/TestArrayCloneBadAssert.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, 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 8073792
+ * @summary assert broken when array size becomes known during igvn
+ * @run main/othervm -Xcomp -XX:CompileOnly=TestArrayCloneBadAssert.m TestArrayCloneBadAssert
+ *
+ */
+
+public class TestArrayCloneBadAssert {
+
+ static final int[] array = new int[5];
+
+ static int[] m(int[] arr) {
+ int i = 0;
+ for (; i < 2; i++) {
+ }
+ if (i == 2) {
+ arr = array;
+ }
+ return arr.clone();
+ }
+
+ static public void main(String[] args) {
+ int[] arr = new int[5];
+ m(arr);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,617 @@
+/*
+ * Copyright (c) 2015, 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 6912521
+ * @summary small array copy as loads/stores
+ * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestArrayCopyAsLoadsStores::m* -XX:TypeProfileLevel=200 TestArrayCopyAsLoadsStores
+ * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestArrayCopyAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode -XX:TypeProfileLevel=200 TestArrayCopyAsLoadsStores
+ *
+ */
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+public class TestArrayCopyAsLoadsStores {
+
+ public enum ArraySrc {
+ SMALL,
+ LARGE,
+ ZERO
+ }
+
+ public enum ArrayDst {
+ NONE,
+ NEW,
+ SRC
+ }
+
+ static class A {
+ }
+
+ static class B extends A {
+ }
+
+ static final A[] small_a_src = new A[5];
+ static final A[] large_a_src = new A[10];
+ static final A[] zero_a_src = new A[0];
+ static final int[] small_int_src = new int[5];
+ static final int[] large_int_src = new int[10];
+ static final int[] zero_int_src = new int[0];
+ static final Object[] small_object_src = new Object[5];
+ static Object src;
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface Args {
+ ArraySrc src();
+ ArrayDst dst() default ArrayDst.NONE;
+ int[] extra_args() default {};
+ }
+
+ // array clone should be compiled as loads/stores
+ @Args(src=ArraySrc.SMALL)
+ static A[] m1() throws CloneNotSupportedException {
+ return (A[])small_a_src.clone();
+ }
+
+ @Args(src=ArraySrc.SMALL)
+ static int[] m2() throws CloneNotSupportedException {
+ return (int[])small_int_src.clone();
+ }
+
+ // new array allocation should be optimized out
+ @Args(src=ArraySrc.SMALL)
+ static int m3() throws CloneNotSupportedException {
+ int[] array_clone = (int[])small_int_src.clone();
+ return array_clone[0] + array_clone[1] + array_clone[2] +
+ array_clone[3] + array_clone[4];
+ }
+
+ // should not be compiled as loads/stores
+ @Args(src=ArraySrc.LARGE)
+ static int[] m4() throws CloneNotSupportedException {
+ return (int[])large_int_src.clone();
+ }
+
+ // check that array of length 0 is handled correctly
+ @Args(src=ArraySrc.ZERO)
+ static int[] m5() throws CloneNotSupportedException {
+ return (int[])zero_int_src.clone();
+ }
+
+ // array copy should be compiled as loads/stores
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NEW)
+ static void m6(int[] src, int[] dest) {
+ System.arraycopy(src, 0, dest, 0, 5);
+ }
+
+ // array copy should not be compiled as loads/stores
+ @Args(src=ArraySrc.LARGE, dst=ArrayDst.NEW)
+ static void m7(int[] src, int[] dest) {
+ System.arraycopy(src, 0, dest, 0, 10);
+ }
+
+ // array copy should be compiled as loads/stores
+ @Args(src=ArraySrc.SMALL)
+ static A[] m8(A[] src) {
+ src[0] = src[0]; // force null check
+ A[] dest = new A[5];
+ System.arraycopy(src, 0, dest, 0, 5);
+ return dest;
+ }
+
+ // array copy should not be compiled as loads/stores: we would
+ // need to emit GC barriers
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NEW)
+ static void m9(A[] src, A[] dest) {
+ System.arraycopy(src, 0, dest, 0, 5);
+ }
+
+ // overlapping array regions: copy backward
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.SRC)
+ static void m10(int[] src, int[] dest) {
+ System.arraycopy(src, 0, dest, 1, 4);
+ }
+
+ static boolean m10_check(int[] src, int[] dest) {
+ boolean failure = false;
+ for (int i = 0; i < 5; i++) {
+ int j = Math.max(i - 1, 0);
+ if (dest[i] != src[j]) {
+ System.out.println("Test m10 failed for " + i + " src[" + j +"]=" + src[j] + ", dest[" + i + "]=" + dest[i]);
+ failure = true;
+ }
+ }
+ return failure;
+ }
+
+ // overlapping array regions: copy forward
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.SRC)
+ static void m11(int[] src, int[] dest) {
+ System.arraycopy(src, 1, dest, 0, 4);
+ }
+
+ static boolean m11_check(int[] src, int[] dest) {
+ boolean failure = false;
+ for (int i = 0; i < 5; i++) {
+ int j = Math.min(i + 1, 4);
+ if (dest[i] != src[j]) {
+ System.out.println("Test m11 failed for " + i + " src[" + j +"]=" + src[j] + ", dest[" + i + "]=" + dest[i]);
+ failure = true;
+ }
+ }
+ return failure;
+ }
+
+ // overlapping array region with unknown src/dest offsets: compiled code must include both forward and backward copies
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.SRC, extra_args={0,1})
+ static void m12(int[] src, int[] dest, int srcPos, int destPos) {
+ System.arraycopy(src, srcPos, dest, destPos, 4);
+ }
+
+ static boolean m12_check(int[] src, int[] dest) {
+ boolean failure = false;
+ for (int i = 0; i < 5; i++) {
+ int j = Math.max(i - 1, 0);
+ if (dest[i] != src[j]) {
+ System.out.println("Test m10 failed for " + i + " src[" + j +"]=" + src[j] + ", dest[" + i + "]=" + dest[i]);
+ failure = true;
+ }
+ }
+ return failure;
+ }
+
+ // Array allocation and copy should optimize out
+ @Args(src=ArraySrc.SMALL)
+ static int m13(int[] src) {
+ int[] dest = new int[5];
+ System.arraycopy(src, 0, dest, 0, 5);
+ return dest[0] + dest[1] + dest[2] + dest[3] + dest[4];
+ }
+
+ // Check that copy of length 0 is handled correctly
+ @Args(src=ArraySrc.ZERO, dst=ArrayDst.NEW)
+ static void m14(int[] src, int[] dest) {
+ System.arraycopy(src, 0, dest, 0, 0);
+ }
+
+ // copyOf should compile to loads/stores
+ @Args(src=ArraySrc.SMALL)
+ static A[] m15() {
+ return Arrays.copyOf(small_a_src, 5, A[].class);
+ }
+
+ static Object[] helper16(int i) {
+ Object[] arr = null;
+ if ((i%2) == 0) {
+ arr = small_a_src;
+ } else {
+ arr = small_object_src;
+ }
+ return arr;
+ }
+
+ // CopyOf may need subtype check
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NONE, extra_args={0})
+ static A[] m16(A[] unused_src, int i) {
+ Object[] arr = helper16(i);
+ return Arrays.copyOf(arr, 5, A[].class);
+ }
+
+ static Object[] helper17_1(int i) {
+ Object[] arr = null;
+ if ((i%2) == 0) {
+ arr = small_a_src;
+ } else {
+ arr = small_object_src;
+ }
+ return arr;
+ }
+
+ static A[] helper17_2(Object[] arr) {
+ return Arrays.copyOf(arr, 5, A[].class);
+ }
+
+ // CopyOf may leverage type speculation
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NONE, extra_args={0})
+ static A[] m17(A[] unused_src, int i) {
+ Object[] arr = helper17_1(i);
+ return helper17_2(arr);
+ }
+
+ static Object[] helper18_1(int i) {
+ Object[] arr = null;
+ if ((i%2) == 0) {
+ arr = small_a_src;
+ } else {
+ arr = small_object_src;
+ }
+ return arr;
+ }
+
+ static Object[] helper18_2(Object[] arr) {
+ return Arrays.copyOf(arr, 5, Object[].class);
+ }
+
+ // CopyOf should not attempt to use type speculation if it's not needed
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NONE, extra_args={0})
+ static Object[] m18(A[] unused_src, int i) {
+ Object[] arr = helper18_1(i);
+ return helper18_2(arr);
+ }
+
+ static Object[] helper19(int i) {
+ Object[] arr = null;
+ if ((i%2) == 0) {
+ arr = small_a_src;
+ } else {
+ arr = small_object_src;
+ }
+ return arr;
+ }
+
+ // CopyOf may need subtype check. Test is run to make type check
+ // fail and cause deoptimization. Next compilation should not
+ // compile as loads/stores because the first compilation
+ // deoptimized.
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NONE, extra_args={0})
+ static A[] m19(A[] unused_src, int i) {
+ Object[] arr = helper19(i);
+ return Arrays.copyOf(arr, 5, A[].class);
+ }
+
+ // copyOf for large array should not compile to loads/stores
+ @Args(src=ArraySrc.LARGE)
+ static A[] m20() {
+ return Arrays.copyOf(large_a_src, 10, A[].class);
+ }
+
+ // check zero length copyOf is handled correctly
+ @Args(src=ArraySrc.ZERO)
+ static A[] m21() {
+ return Arrays.copyOf(zero_a_src, 0, A[].class);
+ }
+
+ // Run with srcPos=0 for a 1st compile, then with incorrect value
+ // of srcPos to cause deoptimization, then with srcPos=0 for a 2nd
+ // compile. The 2nd compile shouldn't turn arraycopy into
+ // loads/stores because input arguments are no longer known to be
+ // valid.
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.NEW, extra_args={0})
+ static void m22(int[] src, int[] dest, int srcPos) {
+ System.arraycopy(src, srcPos, dest, 0, 5);
+ }
+
+ // copyOfRange should compile to loads/stores
+ @Args(src=ArraySrc.SMALL)
+ static A[] m23() {
+ return Arrays.copyOfRange(small_a_src, 1, 4, A[].class);
+ }
+
+ static boolean m23_check(A[] src, A[] dest) {
+ boolean failure = false;
+ for (int i = 0; i < 3; i++) {
+ if (src[i+1] != dest[i]) {
+ System.out.println("Test m23 failed for " + i + " src[" + (i+1) +"]=" + dest[i] + ", dest[" + i + "]=" + dest[i]);
+ failure = true;
+ }
+ }
+ return failure;
+ }
+
+ // array copy should be compiled as loads/stores. Invoke then with
+ // incompatible array type to verify we don't allow a forbidden
+ // arraycopy to happen.
+ @Args(src=ArraySrc.SMALL)
+ static A[] m24(Object[] src) {
+ src[0] = src[0]; // force null check
+ A[] dest = new A[5];
+ System.arraycopy(src, 0, dest, 0, 5);
+ return dest;
+ }
+
+ // overlapping array region with unknown src/dest offsets but
+ // length 1: compiled code doesn't need both forward and backward
+ // copies
+ @Args(src=ArraySrc.SMALL, dst=ArrayDst.SRC, extra_args={0,1})
+ static void m25(int[] src, int[] dest, int srcPos, int destPos) {
+ System.arraycopy(src, srcPos, dest, destPos, 1);
+ }
+
+ static boolean m25_check(int[] src, int[] dest) {
+ boolean failure = false;
+ if (dest[1] != src[0]) {
+ System.out.println("Test m10 failed for src[0]=" + src[0] + ", dest[1]=" + dest[1]);
+ return true;
+ }
+ return false;
+ }
+
+ final HashMap<String,Method> tests = new HashMap<>();
+ {
+ for (Method m : this.getClass().getDeclaredMethods()) {
+ if (m.getName().matches("m[0-9]+(_check)?")) {
+ assert(Modifier.isStatic(m.getModifiers())) : m;
+ tests.put(m.getName(), m);
+ }
+ }
+ }
+
+ boolean success = true;
+
+ void doTest(String name) throws Exception {
+ Method m = tests.get(name);
+ Method m_check = tests.get(name + "_check");
+ Class[] paramTypes = m.getParameterTypes();
+ Object[] params = new Object[paramTypes.length];
+ Class retType = m.getReturnType();
+ boolean isIntArray = (retType.isPrimitive() && !retType.equals(Void.TYPE)) ||
+ (retType.equals(Void.TYPE) && paramTypes[0].getComponentType().isPrimitive()) ||
+ (retType.isArray() && retType.getComponentType().isPrimitive());
+
+ Args args = m.getAnnotation(Args.class);
+
+ Object src = null;
+ switch(args.src()) {
+ case SMALL: {
+ if (isIntArray) {
+ src = small_int_src;
+ } else {
+ src = small_a_src;
+ }
+ break;
+ }
+ case LARGE: {
+ if (isIntArray) {
+ src = large_int_src;
+ } else {
+ src = large_a_src;
+ }
+ break;
+ }
+ case ZERO: {
+ if (isIntArray) {
+ src = zero_int_src;
+ } else {
+ src = zero_a_src;
+ }
+ break;
+ }
+ }
+
+ for (int i = 0; i < 20000; i++) {
+ boolean failure = false;
+
+ int p = 0;
+
+ if (params.length > 0) {
+ if (isIntArray) {
+ params[0] = ((int[])src).clone();
+ } else {
+ params[0] = ((A[])src).clone();
+ }
+ p++;
+ }
+
+ if (params.length > 1) {
+ switch(args.dst()) {
+ case NEW: {
+ if (isIntArray) {
+ params[1] = new int[((int[])params[0]).length];
+ } else {
+ params[1] = new A[((A[])params[0]).length];
+ }
+ p++;
+ break;
+ }
+ case SRC: {
+ params[1] = params[0];
+ p++;
+ break;
+ }
+ case NONE: break;
+ }
+ }
+
+ for (int j = 0; j < args.extra_args().length; j++) {
+ params[p+j] = args.extra_args()[j];
+ }
+
+ Object res = m.invoke(null, params);
+
+ if (retType.isPrimitive() && !retType.equals(Void.TYPE)) {
+ int s = (int)res;
+ int sum = 0;
+ int[] int_res = (int[])src;
+ for (int j = 0; j < int_res.length; j++) {
+ sum += int_res[j];
+ }
+ failure = (s != sum);
+ if (failure) {
+ System.out.println("Test " + name + " failed: result = " + s + " != " + sum);
+ }
+ } else {
+ Object dest = null;
+ if (!retType.equals(Void.TYPE)) {
+ dest = res;
+ } else {
+ dest = params[1];
+ }
+
+ if (m_check != null) {
+ failure = (boolean)m_check.invoke(null, new Object[] { src, dest });
+ } else {
+ if (isIntArray) {
+ int[] int_res = (int[])src;
+ int[] int_dest = (int[])dest;
+ for (int j = 0; j < int_res.length; j++) {
+ if (int_res[j] != int_dest[j]) {
+ System.out.println("Test " + name + " failed for " + j + " src[" + j +"]=" + int_res[j] + ", dest[" + j + "]=" + int_dest[j]);
+ failure = true;
+ }
+ }
+ } else {
+ Object[] object_res = (Object[])src;
+ Object[] object_dest = (Object[])dest;
+ for (int j = 0; j < object_res.length; j++) {
+ if (object_res[j] != object_dest[j]) {
+ System.out.println("Test " + name + " failed for " + j + " src[" + j +"]=" + object_res[j] + ", dest[" + j + "]=" + object_dest[j]);
+ failure = true;
+ }
+ }
+ }
+ }
+ }
+
+ if (failure) {
+ success = false;
+ break;
+ }
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ for (int i = 0; i < small_a_src.length; i++) {
+ small_a_src[i] = new A();
+ }
+
+ for (int i = 0; i < small_int_src.length; i++) {
+ small_int_src[i] = i;
+ }
+
+ for (int i = 0; i < large_int_src.length; i++) {
+ large_int_src[i] = i;
+ }
+
+ for (int i = 0; i < 5; i++) {
+ small_object_src[i] = new Object();
+ }
+
+ TestArrayCopyAsLoadsStores test = new TestArrayCopyAsLoadsStores();
+
+ test.doTest("m1");
+ test.doTest("m2");
+ test.doTest("m3");
+ test.doTest("m4");
+ test.doTest("m5");
+ test.doTest("m6");
+ test.doTest("m7");
+ test.doTest("m8");
+ test.doTest("m9");
+ test.doTest("m10");
+ test.doTest("m11");
+ test.doTest("m12");
+ test.doTest("m13");
+ test.doTest("m14");
+ test.doTest("m15");
+
+ // make both branches of the If appear taken
+ for (int i = 0; i < 20000; i++) {
+ helper16(i);
+ }
+
+ test.doTest("m16");
+
+ // load class B so type check in m17 would not be simple comparison
+ B b = new B();
+ // make both branches of the If appear taken
+ for (int i = 0; i < 20000; i++) {
+ helper17_1(i);
+ }
+
+ test.doTest("m17");
+
+ // make both branches of the If appear taken
+ for (int i = 0; i < 20000; i++) {
+ helper18_1(i);
+ }
+ test.doTest("m18");
+
+ // make both branches of the If appear taken
+ for (int i = 0; i < 20000; i++) {
+ helper19(i);
+ }
+
+ // Compile
+ for (int i = 0; i < 20000; i++) {
+ m19(null, 0);
+ }
+
+ // force deopt
+ boolean m19_exception = false;
+ for (int i = 0; i < 10; i++) {
+ try {
+ m19(null, 1);
+ } catch(ArrayStoreException ase) {
+ m19_exception = true;
+ }
+ }
+
+ if (!m19_exception) {
+ System.out.println("Test m19: exception wasn't thrown");
+ test.success = false;
+ }
+
+ test.doTest("m19");
+
+ test.doTest("m20");
+ test.doTest("m21");
+
+ // Compile
+ int[] dst = new int[small_int_src.length];
+ for (int i = 0; i < 20000; i++) {
+ m22(small_int_src, dst, 0);
+ }
+
+ // force deopt
+ for (int i = 0; i < 10; i++) {
+ try {
+ m22(small_int_src, dst, 5);
+ } catch(ArrayIndexOutOfBoundsException aioobe) {}
+ }
+
+ test.doTest("m22");
+ test.doTest("m23");
+
+ test.doTest("m24");
+ boolean m24_exception = false;
+ try {
+ m24(small_object_src);
+ } catch(ArrayStoreException ase) {
+ m24_exception = true;
+ }
+
+ if (!m24_exception) {
+ System.out.println("Test m24: exception wasn't thrown");
+ test.success = false;
+ }
+
+ test.doTest("m25");
+
+ if (!test.success) {
+ throw new RuntimeException("some tests failed");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/c2/FloatingPointFoldingTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2015, 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 8073670
+ * @summary Test that causes C2 to fold two NaNs with different values into a single NaN.
+ * @run main/othervm -XX:-TieredCompilation -Xcomp -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_inf -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_zero -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_nan -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_inf -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_zero -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_nan FloatingPointFoldingTest
+ */
+
+public class FloatingPointFoldingTest {
+ // Double values.
+ public static final long MINUS_INF_LONGBITS = 0xfff0000000000000L;
+ public static final double DOUBLE_MINUS_INF = Double.longBitsToDouble(MINUS_INF_LONGBITS);
+
+ public static final long PLUS_INF_LONGBITS = 0x7ff0000000000000L;
+ public static final double DOUBLE_PLUS_INF = Double.longBitsToDouble(PLUS_INF_LONGBITS);
+
+ public static final long MINUS_ZERO_LONGBITS = 0x8000000000000000L;
+ public static final double DOUBLE_MINUS_ZERO = Double.longBitsToDouble(MINUS_ZERO_LONGBITS);
+
+ // We need two different NaN values. A floating point number is
+ // considered to be NaN is the sign bit is 0, all exponent bits
+ // are set to 1, and at least one bit of the exponent is not zero.
+ //
+ // As java.lang.Double.NaN is 0x7ff8000000000000L, we use
+ // 0x7ffc000000000000L as a second NaN double value.
+ public static final long NAN_LONGBITS = 0x7ffc000000000000L;
+ public static final double DOUBLE_NAN = Double.longBitsToDouble(NAN_LONGBITS);
+
+ // Float values.
+ public static final int MINUS_INF_INTBITS = 0xff800000;
+ public static final float FLOAT_MINUS_INF = Float.intBitsToFloat(MINUS_INF_INTBITS);
+
+ public static final int PLUS_INF_INTBITS = 0x7f800000;
+ public static final float FLOAT_PLUS_INF = Float.intBitsToFloat(PLUS_INF_INTBITS);
+
+ public static final int MINUS_ZERO_INTBITS = 0x80000000;
+ public static final float FLOAT_MINUS_ZERO = Float.intBitsToFloat(MINUS_ZERO_INTBITS);
+
+ // As java.lang.Float.NaN is 0x7fc00000, we use 0x7fe00000
+ // as a second NaN float value.
+ public static final int NAN_INTBITS = 0x7fe00000;
+ public static final float FLOAT_NAN = Float.intBitsToFloat(NAN_INTBITS);
+
+
+ // Double tests.
+ static void test_double_inf(long[] result) {
+ double d1 = DOUBLE_MINUS_INF;
+ double d2 = DOUBLE_PLUS_INF;
+ result[0] = Double.doubleToRawLongBits(d1);
+ result[1] = Double.doubleToRawLongBits(d2);
+ }
+
+ static void test_double_zero(long[] result) {
+ double d1 = DOUBLE_MINUS_ZERO;
+ double d2 = 0;
+ result[0] = Double.doubleToRawLongBits(d1);
+ result[1] = Double.doubleToRawLongBits(d2);
+ }
+
+ static void test_double_nan(long[] result) {
+ double d1 = DOUBLE_NAN;
+ double d2 = Double.NaN;
+ result[0] = Double.doubleToRawLongBits(d1);
+ result[1] = Double.doubleToRawLongBits(d2);
+ }
+
+ // Float tests.
+ static void test_float_inf(int[] result) {
+ float f1 = FLOAT_MINUS_INF;
+ float f2 = FLOAT_PLUS_INF;
+ result[0] = Float.floatToRawIntBits(f1);
+ result[1] = Float.floatToRawIntBits(f2);
+ }
+
+ static void test_float_zero(int[] result) {
+ float f1 = FLOAT_MINUS_ZERO;
+ float f2 = 0;
+ result[0] = Float.floatToRawIntBits(f1);
+ result[1] = Float.floatToRawIntBits(f2);
+ }
+
+ static void test_float_nan(int[] result) {
+ float f1 = FLOAT_NAN;
+ float f2 = Float.NaN;
+ result[0] = Float.floatToRawIntBits(f1);
+ result[1] = Float.floatToRawIntBits(f2);
+ }
+
+ // Check doubles.
+ static void check_double(long[] result, double d1, double d2) {
+ if (result[0] == result[1]) {
+ throw new RuntimeException("ERROR: Two different double values are considered equal. \n"
+ + String.format("\toriginal values: 0x%x 0x%x\n", Double.doubleToRawLongBits(d1), Double.doubleToRawLongBits(d2))
+ + String.format("\tvalues after execution of method test(): 0x%x 0x%x", result[0], result[1]));
+ }
+ }
+
+ // Check floats.
+ static void check_float(int[] result, float f1, float f2) {
+ if (result[0] == result[1]) {
+ throw new RuntimeException("ERROR: Two different float values are considered equal. \n"
+ + String.format("\toriginal values: 0x%x 0x%x\n", Float.floatToRawIntBits(f1), Float.floatToRawIntBits(f2))
+ + String.format("\tvalues after execution of method test(): 0x%x 0x%x", result[0], result[1]));
+ }
+ }
+
+ public static void main(String[] args) {
+ // Float tests.
+
+ int[] iresult = new int[2];
+
+ // -Inf and +Inf.
+ test_float_inf(iresult);
+ check_float(iresult, FLOAT_MINUS_INF, FLOAT_PLUS_INF);
+
+ // 0 and -0.
+ test_float_zero(iresult);
+ check_float(iresult, FLOAT_MINUS_ZERO, 0);
+
+ // Diferrent NaNs.
+ test_float_nan(iresult);
+ check_float(iresult, FLOAT_NAN, Float.NaN);
+
+ // Double tests.
+
+ long[] lresult = new long[2];
+
+ // -Inf and +Inf.
+ test_double_inf(lresult);
+ check_double(lresult, DOUBLE_MINUS_INF, DOUBLE_PLUS_INF);
+
+ // 0 and -0.
+ test_double_zero(lresult);
+ check_double(lresult, DOUBLE_MINUS_ZERO, 0);
+
+ // Diferrent NaNs.
+ test_double_nan(lresult);
+ check_double(lresult, DOUBLE_NAN, Double.NaN);
+ }
+}
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -51,7 +51,9 @@
public static void main(String[] args) {
for (BlobType btype : BlobType.getAvailable()) {
- new UsageThresholdIncreasedTest(btype).runTest();
+ if (CodeCacheUtils.isCodeHeapPredictable(btype)) {
+ new UsageThresholdIncreasedTest(btype).runTest();
+ }
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2015, 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 8073956
+ * @summary Tests C2 EA with allocated object escaping through a call.
+ * @run main/othervm -XX:CompileCommand=dontinline,TestEscapeThroughInvoke::create TestEscapeThroughInvoke
+ */
+public class TestEscapeThroughInvoke {
+ private A a;
+
+ public static void main(String[] args) {
+ TestEscapeThroughInvoke test = new TestEscapeThroughInvoke();
+ test.a = new A(42);
+ // Make sure run gets compiled by C2
+ for (int i = 0; i < 100_000; ++i) {
+ test.run();
+ }
+ }
+
+ private void run() {
+ // Allocate something to trigger EA
+ new Object();
+ // Create a new escaping instance of A and
+ // verify that it is always equal to 'a.saved'.
+ A escapingA = create(42);
+ a.check(escapingA);
+ }
+
+ // Create and return a new instance of A that escaped through 'A::saveInto'.
+ // The 'dummy' parameters are needed to avoid EA skipping the methods.
+ private A create(Integer dummy) {
+ A result = new A(dummy);
+ result.saveInto(a, dummy); // result escapes into 'a' here
+ return result;
+ }
+}
+
+class A {
+ private A saved;
+
+ public A(Integer dummy) { }
+
+ public void saveInto(A other, Integer dummy) {
+ other.saved = this;
+ }
+
+ public void check(A other) {
+ if (this.saved != other) {
+ throw new RuntimeException("TEST FAILED: Objects not equal.");
+ }
+ }
+}
--- a/hotspot/test/compiler/loopopts/CountedLoopProblem.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/compiler/loopopts/CountedLoopProblem.java Tue Mar 17 12:30:53 2015 -0700
@@ -36,18 +36,22 @@
public static void main(String[] args) throws Exception {
Random r = new Random(42);
int x = 0;
- StringBuilder sb = new StringBuilder();
- for(int i = 0; i < 1000000; ++i) {
- int v = Math.abs(r.nextInt());
- sb.append('+').append(v).append('\n');
- x += v;
- // To trigger the problem we must OSR in the following loop
- // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62
- while(x < 0) x += 1000000000;
- sb.append('=').append(x).append('\n');
- }
- if (sb.toString().hashCode() != 0xaba94591) {
- throw new Exception("Unexpected result");
+ try {
+ StringBuilder sb = new StringBuilder();
+ for(int i = 0; i < 1000000; ++i) {
+ int v = Math.abs(r.nextInt());
+ sb.append('+').append(v).append('\n');
+ x += v;
+ // To trigger the problem we must OSR in the following loop
+ // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62
+ while(x < 0) x += 1000000000;
+ sb.append('=').append(x).append('\n');
+ }
+ if (sb.toString().hashCode() != 0xaba94591) {
+ throw new Exception("Unexpected result");
+ }
+ } catch(OutOfMemoryError e) {
+ // small heap, ignore
}
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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 8073184
+ * @summary CastII that guards counted loops confuses range check elimination with LoopLimitCheck off
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-LoopLimitCheck -XX:CompileOnly=TestCastIINoLoopLimitCheck.m -Xcomp TestCastIINoLoopLimitCheck
+ *
+ */
+
+public class TestCastIINoLoopLimitCheck {
+
+ static void m(int i, int index, char[] buf) {
+ while (i >= 65536) {
+ i = i / 100;
+ buf [--index] = 0;
+ buf [--index] = 1;
+ }
+ }
+
+ static public void main(String[] args) {
+ m(0, 0, null);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/print/TestProfileReturnTypePrinting.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2015, 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 8073154
+ * @build TestProfileReturnTypePrinting
+ * @run main/othervm -XX:TypeProfileLevel=020
+ * -XX:CompileOnly=TestProfileReturnTypePrinting.testMethod
+ * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintLIR
+ * TestProfileReturnTypePrinting
+ * @summary Verify that c1's LIR that contains ProfileType node could be dumped
+ * without a crash disregard to an exact class knowledge.
+ */
+public class TestProfileReturnTypePrinting {
+ private static final int ITERATIONS = 1_000_000;
+
+ public static void main(String args[]) {
+ for (int i = 0; i < ITERATIONS; i++) {
+ TestProfileReturnTypePrinting.testMethod(i);
+ }
+ }
+
+ private static int testMethod(int i) {
+ return TestProfileReturnTypePrinting.foo().hashCode()
+ + TestProfileReturnTypePrinting.bar(i).hashCode();
+ }
+
+ /* Exact class of returned value is known statically. */
+ private static B foo() {
+ return new B();
+ }
+
+ /* Exact class of returned value is not known statically. */
+ private static Object bar(int i) {
+ if (i % 2 == 0) {
+ return new A();
+ } else {
+ return new B();
+ }
+ }
+
+ private static class A {
+ }
+
+ private static class B extends A {
+ }
+}
--- a/hotspot/test/compiler/tiered/LevelTransitionTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/compiler/tiered/LevelTransitionTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -29,6 +29,7 @@
/**
* @test LevelTransitionTest
* @library /testlibrary /../../test/lib /compiler/whitebox
+ * @ignore 8067651
* @build TransitionsTestExecutor LevelTransitionTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
--- a/hotspot/test/gc/TestSmallHeap.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/gc/TestSmallHeap.java Tue Mar 17 12:30:53 2015 -0700
@@ -26,6 +26,7 @@
* @bug 8067438
* @requires vm.gc=="null"
* @requires (vm.opt.AggressiveOpts=="null") | (vm.opt.AggressiveOpts=="false")
+ * @requires vm.compMode != "Xcomp"
* @summary Verify that starting the VM with a small heap works
* @library /testlibrary /../../test/lib
* @build TestSmallHeap
--- a/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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,6 +26,7 @@
* @key gc
* @summary Tests that all SoftReferences has been cleared at time of OOM.
* @library /testlibrary
+ * @ignore 8073669
* @build TestSoftReferencesBehaviorOnOOME
* @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 512 2k
* @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 128k 256k
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java Tue Mar 17 12:30:53 2015 -0700
@@ -47,6 +47,7 @@
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
"-XX:-TransmitErrorReport",
+ "-XX:-CreateMinidumpOnCrash",
"-Xmx32m",
"AssertSafepointCheckConsistency1",
"test");
@@ -55,5 +56,3 @@
}
}
}
-
-
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java Tue Mar 17 12:30:53 2015 -0700
@@ -47,6 +47,7 @@
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
"-XX:-TransmitErrorReport",
+ "-XX:-CreateMinidumpOnCrash",
"-Xmx32m",
"AssertSafepointCheckConsistency2",
"test");
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java Tue Mar 17 12:30:53 2015 -0700
@@ -47,6 +47,7 @@
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
"-XX:-TransmitErrorReport",
+ "-XX:-CreateMinidumpOnCrash",
"-Xmx32m",
"AssertSafepointCheckConsistency3",
"test");
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java Tue Mar 17 12:30:53 2015 -0700
@@ -47,6 +47,7 @@
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
"-XX:-TransmitErrorReport",
+ "-XX:-CreateMinidumpOnCrash",
"-Xmx32m",
"AssertSafepointCheckConsistency4",
"test");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/Thread/Fibonacci.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2015, 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
+ * @summary Calculates Fibonacci numbers "recursively" via threads and compares
+ * the result with the classical calculation.
+ * This test is skipped on 32-bit Windows: limited virtual space on Win-32
+ * make this test inherently unstable on Windows with 32-bit VM data model.
+ * @requires !(os.family == "windows" & sun.arch.data.model == "32")
+ * @library /testlibrary
+ * @run main Fibonacci 15
+ */
+
+import com.oracle.java.testlibrary.Asserts;
+
+public class Fibonacci extends Thread {
+ private int index;
+ private int value;
+ private Fibonacci left;
+ private Fibonacci right;
+
+ public Fibonacci(int i) {
+ index = i;
+ }
+
+ private int getValue() {
+ return value;
+ }
+
+ @Override
+ public void run() {
+ if (index == 0 || index == 1) {
+ // base cases, 0 Fibonacci number = 0, 1 Fibonacci number = 1
+ value = index;
+ } else {
+ // inductive cases
+ left = new Fibonacci(index - 2);
+ right = new Fibonacci(index - 1);
+ left.start();
+ right.start();
+ try {
+ left.join();
+ right.join();
+ } catch (InterruptedException e) {
+ throw new Error("InterruptedException for index " + index, e);
+ }
+ // compute and terminate
+ value = left.getValue() + right.getValue();
+ }
+ }
+
+ public static int traditionalFibonacci(int n) {
+ int n1 = 0, n2 = 1, nn = 0;
+
+ if (n == 0 || n == 1) {
+ nn = n;
+ }
+
+ for (int i = 1; i < n; ++i) {
+ nn = n2 + n1;
+ n1 = n2;
+ n2 = nn;
+ }
+ return nn;
+ }
+
+ public static void main(String[] args) throws Error,AssertionError {
+ int expected;
+ int number;
+ Fibonacci recursiveFibonacci;
+
+ if (args.length != 1) {
+ throw new Error("Error: args.length must be 1");
+ }
+
+ number = Integer.parseInt(args[0]);
+ recursiveFibonacci = new Fibonacci(number);
+
+ recursiveFibonacci.start();
+ try {
+ recursiveFibonacci.join();
+ } catch (InterruptedException e) {
+ throw new Error("InterruptedException in main thread", e);
+ }
+
+ expected = traditionalFibonacci(number);
+
+ System.out.println("Fibonacci[" + number + "] = " + expected);
+
+ Asserts.assertEQ(recursiveFibonacci.getValue(), expected,
+ "Unexpected calculated value: " + recursiveFibonacci.getValue() + " expected " + expected );
+ }
+}
--- a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -39,7 +39,7 @@
* @library /testlibrary
* @build com.oracle.java.testlibrary.*
* @build com.oracle.java.testlibrary.dcmd.*
- * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog RunGCTest
+ * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest
*/
public class RunGCTest {
public void run(CommandExecutor executor) {
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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,7 +23,7 @@
package sun.hotspot.tools.ctw;
-import sun.management.ManagementFactoryHelper;
+import java.lang.management.ManagementFactory;
import java.io.*;
import java.nio.file.Files;
@@ -55,7 +55,7 @@
try {
try {
- if (ManagementFactoryHelper.getCompilationMXBean() == null) {
+ if (ManagementFactory.getCompilationMXBean() == null) {
throw new RuntimeException(
"CTW can not work in interpreted mode");
}
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -24,7 +24,7 @@
package sun.hotspot.tools.ctw;
import com.sun.management.HotSpotDiagnosticMXBean;
-import sun.management.ManagementFactoryHelper;
+import java.lang.management.ManagementFactory;
import java.io.File;
import java.util.regex.Pattern;
@@ -160,7 +160,7 @@
public static String getVMOption(String name) {
String result;
HotSpotDiagnosticMXBean diagnostic
- = ManagementFactoryHelper.getDiagnosticMXBean();
+ = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
result = diagnostic.getVMOption(name).getValue();
return result;
}
--- a/hotspot/test/testlibrary_tests/RandomGeneratorTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/hotspot/test/testlibrary_tests/RandomGeneratorTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -58,7 +58,7 @@
}
jvmArgs.add(RandomRunner.class.getName());
String[] cmdLineArgs = jvmArgs.toArray(new String[jvmArgs.size()]);
- String etalon = ProcessTools.executeTestJvm(cmdLineArgs).getOutput().trim();
+ String etalon = ProcessTools.executeTestJvm(cmdLineArgs).getStdout().trim();
seedOpt.verify(etalon, cmdLineArgs);
}
@@ -122,7 +122,7 @@
String lastLineOrig = getLastLine(orig);
String lastLine;
try {
- lastLine = getLastLine(ProcessTools.executeTestJvm(cmdLine).getOutput().trim());
+ lastLine = getLastLine(ProcessTools.executeTestJvm(cmdLine).getStdout().trim());
} catch (Throwable t) {
throw new Error("TESTBUG: Unexpedted exception during jvm execution.", t);
}
--- a/jaxp/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -296,3 +296,4 @@
7cb3674cbd8c06222851444285bb66b2952a2a5c jdk9-b51
57b26c883d54f45912bc3885ccad3c6b80960b1f jdk9-b52
d5b5a010a16688f188f5a9247ed873f5100b530c jdk9-b53
+542c0c855ad467624cbedf11bff08e44b86b068d jdk9-b54
--- a/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -247,9 +247,11 @@
* </p>
*
* <p>
- * <b>${JAVA_HOME}/conf/jaxp.properties:</b> This configuration file is in standard
- * {@link java.util.Properties} format. If the file exists and the system property is specified,
- * its value will be used to override the default of the property.
+ * <b>jaxp.properties:</b> This configuration file is in standard
+ * {@link java.util.Properties} format and typically located in the {@code conf}
+ * directory of the Java installation. If the file exists and the system
+ * property is specified, its value will be used to override the default
+ * of the property.
* </p>
*
* <p>
@@ -314,9 +316,11 @@
* </p>
*
* <p>
- * <b>${JAVA_HOME}/conf/jaxp.properties:</b> This configuration file is in standard
- * java.util.Properties format. If the file exists and the system property is specified,
- * its value will be used to override the default of the property.
+ * <b>jaxp.properties:</b> This configuration file is in standard
+ * {@link java.util.Properties} format and typically located in the {@code conf}
+ * directory of the Java installation. If the file exists and the system
+ * property is specified, its value will be used to override the default
+ * of the property.
*
* @since 1.7
* </p>
@@ -380,9 +384,11 @@
* </p>
*
* <p>
- * <b>${JAVA_HOME}/conf/jaxp.properties: </b> This configuration file is in standard
- * java.util.Properties format. If the file exists and the system property is specified,
- * its value will be used to override the default of the property.
+ * <b>jaxp.properties:</b> This configuration file is in standard
+ * {@link java.util.Properties} format and typically located in the {@code conf}
+ * directory of the Java installation. If the file exists and the system
+ * property is specified, its value will be used to override the default
+ * of the property.
*
* @since 1.7
*/
--- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -32,23 +32,34 @@
import java.util.regex.Pattern;
/**
- * <p>Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>
- *
- * <p>A new instance of the <code>DatatypeFactory</code> is created through the {@link #newInstance()} method
- * that uses the following implementation resolution mechanisms to determine an implementation:</p>
+ * Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.
+ * <p>
+ * A new instance of the {@code DatatypeFactory} is created through the {@link #newInstance()} method
+ * that uses the following implementation resolution mechanisms to determine an implementation:
+ * <p>
* <ol>
* <li>
- * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "<code>javax.xml.datatype.DatatypeFactory</code>",
+ * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "{@code javax.xml.datatype.DatatypeFactory}",
* exists, a class with the name of the property value is instantiated.
* Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
* </li>
* <li>
- * If the file ${JAVA_HOME}/conf/jaxp.properties exists, it is loaded in a {@link java.util.Properties} <code>Object</code>.
- * The <code>Properties</code> <code>Object </code> is then queried for the property as documented in the prior step
- * and processed as documented in the prior step.
+ * <p>
+ * Use the configuration file "jaxp.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ * <p>
+ * The jaxp.properties file is read only once by the JAXP implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in jaxp.properties after it has been read for the first time.
* </li>
* <li>
- * Uses the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class, to attempt
+ * <p>
+ * Use the service-provider loading facility, defined by the {@link java.util.ServiceLoader} class, to attempt
* to locate and load an implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
* the service-provider loading facility will use the {@linkplain
@@ -56,13 +67,14 @@
* to attempt to load the service. If the context class
* loader is null, the {@linkplain
* ClassLoader#getSystemClassLoader() system class loader} will be used.
- * <br>
+ * <p>
* In case of {@link java.util.ServiceConfigurationError service
- * configuration error} a {@link javax.xml.datatype.DatatypeConfigurationException}
+ * configuration error}, a {@link javax.xml.datatype.DatatypeConfigurationException}
* will be thrown.
* </li>
* <li>
- * The final mechanism is to attempt to instantiate the <code>Class</code> specified by
+ * <p>
+ * The final mechanism is to attempt to instantiate the {@code Class} specified by
* {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}.
* Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
* </li>
@@ -79,7 +91,7 @@
/**
* <p>Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.</p>
*
- * <p>Default value is <code>javax.xml.datatype.DatatypeFactory</code>.</p>
+ * <p>Default value is {@code javax.xml.datatype.DatatypeFactory}.</p>
*/
public static final String DATATYPEFACTORY_PROPERTY =
// We use a String constant here, rather than calling
@@ -120,18 +132,18 @@
/**
* <p>Protected constructor to prevent instantiation outside of package.</p>
*
- * <p>Use {@link #newInstance()} to create a <code>DatatypeFactory</code>.</p>
+ * <p>Use {@link #newInstance()} to create a {@code DatatypeFactory}.</p>
*/
protected DatatypeFactory() {
}
/**
- * <p>Obtain a new instance of a <code>DatatypeFactory</code>.</p>
+ * <p>Obtain a new instance of a {@code DatatypeFactory}.</p>
*
* <p>The implementation resolution mechanisms are <a href="#DatatypeFactory.newInstance">defined</a> in this
* <code>Class</code>'s documentation.</p>
*
- * @return New instance of a <code>DatatypeFactory</code>
+ * @return New instance of a {@code DatatypeFactory}
*
* @throws DatatypeConfigurationException If the implementation is not
* available or cannot be instantiated.
@@ -149,12 +161,12 @@
}
/**
- * <p>Obtain a new instance of a <code>DatatypeFactory</code> from class name.
+ * <p>Obtain a new instance of a {@code DatatypeFactory} from class name.
* This function is useful when there are multiple providers in the classpath.
* It gives more control to the application as it can specify which provider
* should be loaded.</p>
*
- * <p>Once an application has obtained a reference to a <code>DatatypeFactory</code>
+ * <p>Once an application has obtained a reference to a {@code DatatypeFactory}
* it can use the factory to configure and obtain datatype instances.</P>
*
*
@@ -168,12 +180,12 @@
* java -Djaxp.debug=1 YourProgram ....
* </pre>
*
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.datatype.DatatypeFactory</code>.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.datatype.DatatypeFactory}.
*
* @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
* current <code>Thread</code>'s context classLoader is used to load the factory class.
*
- * @return New instance of a <code>DatatypeFactory</code>
+ * @return New instance of a {@code DatatypeFactory}
*
* @throws DatatypeConfigurationException if <code>factoryClassName</code> is <code>null</code>, or
* the factory class cannot be loaded, instantiated.
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -55,31 +55,34 @@
/**
* Obtain a new instance of a
- * <code>DocumentBuilderFactory</code>. This static method creates
+ * {@code DocumentBuilderFactory}. This static method creates
* a new factory instance.
* This method uses the following ordered lookup procedure to determine
- * the <code>DocumentBuilderFactory</code> implementation class to
+ * the {@code DocumentBuilderFactory} implementation class to
* load:
+ * <p>
* <ul>
* <li>
- * Use the <code>javax.xml.parsers.DocumentBuilderFactory</code> system
+ * Use the {@code javax.xml.parsers.DocumentBuilderFactory} system
* property.
* </li>
* <li>
- * Use the properties file "conf/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
+ * <p>
+ * Use the configuration file "jaxp.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ * <p>
* The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
+ * and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in jaxp.properties after it has been read for the first time.
* </li>
* <li>
- * Uses the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -90,26 +93,30 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, the system-default implementation is returned.
* </li>
* </ul>
*
+ * <p>
* Once an application has obtained a reference to a
- * <code>DocumentBuilderFactory</code> it can use the factory to
+ * {@code DocumentBuilderFactory} it can use the factory to
* configure and obtain parser instances.
*
*
* <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * <p>
+ * Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ * to {@code System.err} about what it is doing and where it is looking at.
*
- * <p> If you have problems loading {@link DocumentBuilder}s, try:</p>
+ * <p>
+ * If you have problems loading {@link DocumentBuilder}s, try:
* <pre>
* java -Djaxp.debug=1 YourProgram ....
* </pre>
*
- * @return New instance of a <code>DocumentBuilderFactory</code>
+ * @return New instance of a {@code DocumentBuilderFactory}
*
* @throws FactoryConfigurationError in case of {@linkplain
* java.util.ServiceConfigurationError service configuration error} or if
@@ -124,31 +131,31 @@
}
/**
- * <p>Obtain a new instance of a <code>DocumentBuilderFactory</code> from class name.
+ * <p>Obtain a new instance of a {@code DocumentBuilderFactory} from class name.
* This function is useful when there are multiple providers in the classpath.
* It gives more control to the application as it can specify which provider
- * should be loaded.</p>
+ * should be loaded.
*
- * <p>Once an application has obtained a reference to a <code>DocumentBuilderFactory</code>
- * it can use the factory to configure and obtain parser instances.</p>
+ * <p>Once an application has obtained a reference to a {@code DocumentBuilderFactory}
+ * it can use the factory to configure and obtain parser instances.
*
*
* <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * <p>Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ * to {@code System.err} about what it is doing and where it is looking at.</p>
*
* <p> If you have problems try:</p>
* <pre>
* java -Djaxp.debug=1 YourProgram ....
* </pre>
*
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.parsers.DocumentBuilderFactory</code>.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.parsers.DocumentBuilderFactory}.
*
* @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
* current <code>Thread</code>'s context classLoader is used to load the factory class.
*
- * @return New instance of a <code>DocumentBuilderFactory</code>
+ * @return New instance of a {@code DocumentBuilderFactory}
*
* @throws FactoryConfigurationError if <code>factoryClassName</code> is <code>null</code>, or
* the factory class cannot be loaded, instantiated.
@@ -406,14 +413,14 @@
throws IllegalArgumentException;
/**
- * <p>Set a feature for this <code>DocumentBuilderFactory</code> and <code>DocumentBuilder</code>s created by this factory.</p>
+ * <p>Set a feature for this {@code DocumentBuilderFactory} and <code>DocumentBuilder</code>s created by this factory.</p>
*
* <p>
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * A {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
+ * A {@link ParserConfigurationException} is thrown if this {@code DocumentBuilderFactory} or the
* <code>DocumentBuilder</code>s it creates cannot support the feature.
- * It is possible for a <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
+ * It is possible for a {@code DocumentBuilderFactory} to expose a feature value but be unable to change its state.
* </p>
*
* <p>
@@ -436,7 +443,7 @@
* @param name Feature name.
* @param value Is feature state <code>true</code> or <code>false</code>.
*
- * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code> or the <code>DocumentBuilder</code>s
+ * @throws ParserConfigurationException if this {@code DocumentBuilderFactory} or the <code>DocumentBuilder</code>s
* it creates cannot support this feature.
* @throws NullPointerException If the <code>name</code> parameter is null.
* @since 1.5
@@ -450,16 +457,16 @@
* <p>
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * An {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
+ * An {@link ParserConfigurationException} is thrown if this {@code DocumentBuilderFactory} or the
* <code>DocumentBuilder</code>s it creates cannot support the feature.
- * It is possible for an <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
+ * It is possible for an {@code DocumentBuilderFactory} to expose a feature value but be unable to change its state.
* </p>
*
* @param name Feature name.
*
* @return State of the named feature.
*
- * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code>
+ * @throws ParserConfigurationException if this {@code DocumentBuilderFactory}
* or the <code>DocumentBuilder</code>s it creates cannot support this feature.
* @since 1.5
*/
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -59,31 +59,34 @@
}
/**
- * Obtain a new instance of a <code>SAXParserFactory</code>. This
+ * Obtain a new instance of a {@code SAXParserFactory}. This
* static method creates a new factory instance
* This method uses the following ordered lookup procedure to determine
- * the <code>SAXParserFactory</code> implementation class to
+ * the {@code SAXParserFactory} implementation class to
* load:
+ * <p>
* <ul>
* <li>
- * Use the <code>javax.xml.parsers.SAXParserFactory</code> system
+ * Use the {@code javax.xml.parsers.SAXParserFactory} system
* property.
* </li>
* <li>
- * Use the properties file "conf/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
+ * <p>
+ * Use the configuration file "jaxp.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ * <p>
* The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
+ * and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in jaxp.properties after it has been read for the first time.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -94,22 +97,26 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise the system-default implementation is returned.
* </li>
* </ul>
*
+ * <p>
* Once an application has obtained a reference to a
- * <code>SAXParserFactory</code> it can use the factory to
+ * {@code SAXParserFactory} it can use the factory to
* configure and obtain parser instances.
*
*
*
* <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * <p>
+ * Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ * to {@code System.err} about what it is doing and where it is looking at.
*
- * <p> If you have problems loading {@link SAXParser}s, try:</p>
+ * <p>
+ * If you have problems loading {@link SAXParser}s, try:
* <pre>
* java -Djaxp.debug=1 YourProgram ....
* </pre>
@@ -131,31 +138,32 @@
}
/**
- * <p>Obtain a new instance of a <code>SAXParserFactory</code> from class name.
+ * <p>Obtain a new instance of a {@code SAXParserFactory} from class name.
* This function is useful when there are multiple providers in the classpath.
* It gives more control to the application as it can specify which provider
* should be loaded.</p>
*
- * <p>Once an application has obtained a reference to a <code>SAXParserFactory</code>
+ * <p>Once an application has obtained a reference to a {@code SAXParserFactory}
* it can use the factory to configure and obtain parser instances.</p>
*
*
* <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * <p>Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ * to {@code System.err} about what it is doing and where it is looking at.</p>
*
- * <p> If you have problems, try:</p>
+ * <p>
+ * If you have problems, try:
* <pre>
* java -Djaxp.debug=1 YourProgram ....
* </pre>
*
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.parsers.SAXParserFactory</code>.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.parsers.SAXParserFactory}.
*
* @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
* current <code>Thread</code>'s context classLoader is used to load the factory class.
*
- * @return New instance of a <code>SAXParserFactory</code>
+ * @return New instance of a {@code SAXParserFactory}
*
* @throws FactoryConfigurationError if <code>factoryClassName</code> is <code>null</code>, or
* the factory class cannot be loaded, instantiated.
--- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -23,7 +23,7 @@
*/
/*
- * Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved.
+ * Copyright (c) 2009, 2015, by Oracle Corporation. All Rights Reserved.
*/
package javax.xml.stream;
@@ -70,19 +70,34 @@
* This static method creates a new factory instance.
* This method uses the following ordered lookup procedure to determine
* the XMLEventFactory implementation class to load:
- * </p>
+ * <p>
* <ul>
* <li>
* Use the javax.xml.stream.XMLEventFactory system property.
* </li>
* <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the system property defined above.
+ * <p>
+ * Use the configuration file "stax.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ *
+ * <p>
+ * The stax.properties file is read only once by the implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in stax.properties after it has been read for the first time.
+ *
+ * <p>
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same
+ * format as stax.properties and will only be read if stax.properties does
+ * not exist.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -93,18 +108,18 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, the system-default implementation is returned.
* </li>
* </ul>
* <p>
* Once an application has obtained a reference to a XMLEventFactory it
* can use the factory to configure and obtain stream instances.
- * </p>
* <p>
* Note that this is a new method that replaces the deprecated newInstance() method.
* No changes in behavior are defined by this replacement method relative to
* the deprecated method.
- * </p>
+ *
* @throws FactoryConfigurationError in case of {@linkplain
* java.util.ServiceConfigurationError service configuration error} or if
* the implementation is not available or cannot be instantiated.
@@ -143,20 +158,35 @@
* <p>
* This method uses the following ordered lookup procedure to determine
* the XMLEventFactory implementation class to load:
- * </p>
+ * <p>
* <ul>
* <li>
* Use the value of the system property identified by {@code factoryId}.
* </li>
* <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the given {@code factoryId}.
+ * <p>
+ * Use the configuration file "stax.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * conf directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ *
+ * <p>
+ * The stax.properties file is read only once by the implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in stax.properties after it has been read for the first time.
+ *
+ * <p>
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same
+ * format as stax.properties and will only be read if stax.properties does
+ * not exist.
* </li>
* <li>
+ * <p>
* If {@code factoryId} is "javax.xml.stream.XMLEventFactory",
- * use the service-provider loading facilities, defined by the
+ * use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to {@linkplain
* java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
* an implementation of the service using the specified {@code ClassLoader}.
@@ -169,6 +199,7 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, throws a {@link FactoryConfigurationError}.
* </li>
* </ul>
@@ -179,7 +210,6 @@
* newInstance(String factoryId, ClassLoader classLoader)} method.
* No changes in behavior are defined by this replacement method relative
* to the deprecated method.
- * </p>
*
* @apiNote The parameter factoryId defined here is inconsistent with that
* of other JAXP factories where the first parameter is fully qualified
--- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -68,7 +68,7 @@
*
*
* @version 1.2
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
+ * @author Copyright (c) 2009, 2015 by Oracle Corporation. All Rights Reserved.
* @see XMLOutputFactory
* @see XMLEventReader
* @see XMLStreamReader
@@ -163,16 +163,28 @@
* </p>
* <ul>
* <li>
- * Use the javax.xml.stream.XMLInputFactory system property.
+ * <p>Use the javax.xml.stream.XMLInputFactory system property.
* </li>
* <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the system property defined above.
+ * <p>Use the configuration file "stax.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ *
+ * <p>The stax.properties file is read only once by the implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in stax.properties after it has been read for the first time.
+ *
+ * <p>
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same
+ * format as stax.properties and will only be read if stax.properties does
+ * not exist.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -183,7 +195,7 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
- * Otherwise, the system-default implementation is returned.
+ * <p>Otherwise, the system-default implementation is returned.
* </li>
* </ul>
* <p>
@@ -233,20 +245,36 @@
* <p>
* This method uses the following ordered lookup procedure to determine
* the XMLInputFactory implementation class to load:
- * </p>
+ * <p>
* <ul>
* <li>
+ * <p>
* Use the value of the system property identified by {@code factoryId}.
* </li>
* <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the given {@code factoryId}.
+ * <p>
+ * Use the configuration file "stax.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ *
+ * <p>
+ * The stax.properties file is read only once by the implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in stax.properties after it has been read for the first time.
+ *
+ * <p>
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same
+ * format as stax.properties and will only be read if stax.properties does
+ * not exist.
* </li>
* <li>
+ * <p>
* If {@code factoryId} is "javax.xml.stream.XMLInputFactory",
- * use the service-provider loading facilities, defined by the
+ * use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to {@linkplain
* java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
* an implementation of the service using the specified {@code ClassLoader}.
@@ -259,6 +287,7 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, throws a {@link FactoryConfigurationError}.
* </li>
* </ul>
@@ -269,7 +298,7 @@
* newInstance(String factoryId, ClassLoader classLoader)} method.
* No changes in behavior are defined by this replacement method relative
* to the deprecated method.
- * </p>
+ *
*
* @apiNote The parameter factoryId defined here is inconsistent with that
* of other JAXP factories where the first parameter is fully qualified
--- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -102,7 +102,7 @@
* namespace URI of the element or attribute using that prefix.</p>
*
* @version 1.2
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
+ * @author Copyright (c) 2009, 2015 by Oracle Corporation. All Rights Reserved.
* @see XMLInputFactory
* @see XMLEventWriter
* @see XMLStreamWriter
@@ -136,19 +136,34 @@
* This static method creates a new factory instance. This method uses the
* following ordered lookup procedure to determine the XMLOutputFactory
* implementation class to load:
- * </p>
+ * <p>
* <ul>
* <li>
* Use the javax.xml.stream.XMLOutputFactory system property.
* </li>
* <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the system property defined above.
+ * <p>
+ * Use the configuration file "stax.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ *
+ * <p>
+ * The stax.properties file is read only once by the implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in stax.properties after it has been read for the first time.
+ *
+ * <p>
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same
+ * format as stax.properties and will only be read if stax.properties does
+ * not exist.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -159,17 +174,17 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, the system-default implementation is returned.
* </li>
* <p>
* Once an application has obtained a reference to a XMLOutputFactory it
* can use the factory to configure and obtain stream instances.
- * </p>
* <p>
* Note that this is a new method that replaces the deprecated newInstance() method.
* No changes in behavior are defined by this replacement method relative to the
* deprecated method.
- * </p>
+ *
* @throws FactoryConfigurationError in case of {@linkplain
* java.util.ServiceConfigurationError service configuration error} or if
* the implementation is not available or cannot be instantiated.
@@ -207,20 +222,35 @@
* <p>
* This method uses the following ordered lookup procedure to determine
* the XMLOutputFactory implementation class to load:
- * </p>
+ * <p>
* <ul>
* <li>
* Use the value of the system property identified by {@code factoryId}.
* </li>
* <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the given {@code factoryId}.
+ * <p>
+ * Use the configuration file "stax.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ *
+ * <p>
+ * The stax.properties file is read only once by the implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in stax.properties after it has been read for the first time.
+ *
+ * <p>
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same
+ * format as stax.properties and will only be read if stax.properties does
+ * not exist.
* </li>
* <li>
+ * <p>
* If {@code factoryId} is "javax.xml.stream.XMLOutputFactory",
- * use the service-provider loading facilities, defined by the
+ * use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to {@linkplain
* java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
* an implementation of the service using the specified {@code ClassLoader}.
@@ -233,6 +263,7 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, throws a {@link FactoryConfigurationError}.
* </li>
* </ul>
@@ -246,7 +277,7 @@
* {@link #newInstance(java.lang.String, java.lang.ClassLoader)
* newInstance(String factoryId, ClassLoader classLoader)} method.
* The original method was incorrectly defined to return XMLInputFactory.
- * </p>
+ *
*
* @param factoryId Name of the factory to find, same as
* a property name
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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,7 +33,7 @@
* <p>The system property that determines which Factory implementation
* to create is named <code>"javax.xml.transform.TransformerFactory"</code>.
* This property names a concrete subclass of the
- * <code>TransformerFactory</code> abstract class. If the property is not
+ * {@code TransformerFactory} abstract class. If the property is not
* defined, a platform default is be used.</p>
*
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
@@ -51,31 +51,36 @@
/**
- * <p>Obtain a new instance of a <code>TransformerFactory</code>.
- * This static method creates a new factory instance.</p>
- * <p>This method uses the following ordered lookup procedure to determine
- * the <code>TransformerFactory</code> implementation class to
- * load:</p>
+ * <p>
+ * Obtain a new instance of a {@code TransformerFactory}.
+ * This static method creates a new factory instance.
+ * <p>
+ * This method uses the following ordered lookup procedure to determine
+ * the {@code TransformerFactory} implementation class to
+ * load:
+ * <p>
* <ul>
* <li>
- * Use the <code>javax.xml.transform.TransformerFactory</code> system
+ * Use the {@code javax.xml.transform.TransformerFactory} system
* property.
* </li>
* <li>
- * Use the properties file "conf/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- * <br>
+ * <p>
+ * Use the configuration file "jaxp.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * {@code conf} directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ * <p>
* The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
+ * and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in jaxp.properties after it has been read for the first time.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -86,13 +91,15 @@
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
+ * <p>
* Otherwise, the system-default implementation is returned.
* </li>
* </ul>
*
- * <p>Once an application has obtained a reference to a <code>
- * TransformerFactory</code> it can use the factory to configure
- * and obtain transformer instances.</p>
+ * <p>
+ * Once an application has obtained a reference to a
+ * {@code TransformerFactory} it can use the factory to configure
+ * and obtain transformer instances.
*
* @return new TransformerFactory instance, never null.
*
@@ -111,13 +118,13 @@
}
/**
- * <p>Obtain a new instance of a <code>TransformerFactory</code> from factory class name.
+ * <p>Obtain a new instance of a {@code TransformerFactory} from factory class name.
* This function is useful when there are multiple providers in the classpath.
* It gives more control to the application as it can specify which provider
* should be loaded.</p>
*
- * <p>Once an application has obtained a reference to a <code>
- * TransformerFactory</code> it can use the factory to configure
+ * <p>Once an application has obtained a reference to a
+ * {@code TransformerFactory} it can use the factory to configure
* and obtain transformer instances.</p>
*
* <h2>Tip for Trouble-shooting</h2>
@@ -130,7 +137,7 @@
* java -Djaxp.debug=1 YourProgram ....
* </pre>
*
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.transform.TransformerFactory</code>.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.transform.TransformerFactory}.
*
* @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
* current <code>Thread</code>'s context classLoader is used to load the factory class.
@@ -232,7 +239,7 @@
* @param charset The value of the charset attribute to match. May be null.
*
* @return A <code>Source</code> <code>Object</code> suitable for passing
- * to the <code>TransformerFactory</code>.
+ * to the {@code TransformerFactory}.
*
* @throws TransformerConfigurationException An <code>Exception</code>
* is thrown if an error occurings during parsing of the
@@ -268,15 +275,15 @@
//======= CONFIGURATION METHODS =======
/**
- * <p>Set a feature for this <code>TransformerFactory</code> and <code>Transformer</code>s
+ * <p>Set a feature for this {@code TransformerFactory} and <code>Transformer</code>s
* or <code>Template</code>s created by this factory.</p>
*
* <p>
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
+ * An {@link TransformerConfigurationException} is thrown if this {@code TransformerFactory} or the
* <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
+ * It is possible for an {@code TransformerFactory} to expose a feature value but be unable to change its state.
* </p>
*
* <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
@@ -299,7 +306,7 @@
* @param name Feature name.
* @param value Is feature state <code>true</code> or <code>false</code>.
*
- * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
+ * @throws TransformerConfigurationException if this {@code TransformerFactory}
* or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
* @throws NullPointerException If the <code>name</code> parameter is null.
*/
@@ -312,9 +319,9 @@
* <p>
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * <code>false</code> is returned if this <code>TransformerFactory</code> or the
+ * <code>false</code> is returned if this {@code TransformerFactory} or the
* <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
+ * It is possible for an {@code TransformerFactory} to expose a feature value but be unable to change its state.
* </p>
*
* @param name Feature name.
--- a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -132,8 +132,9 @@
* where "the class loader" refers to the context class loader:</p>
* <ol>
* <li>
+ * <p>
* If the system property
- * <code>"javax.xml.validation.SchemaFactory:<i>schemaLanguage</i>"</code>
+ * {@code "javax.xml.validation.SchemaFactory:<i>schemaLanguage</i>"}
* is present (where <i>schemaLanguage</i> is the parameter
* to this method), then its value is read
* as a class name. The method will try to
@@ -141,12 +142,22 @@
* and returns it if it is successfully created.
* </li>
* <li>
- * <code>$java.home/conf/jaxp.properties</code> is read and
- * the value associated with the key being the system property above
- * is looked for. If present, the value is processed just like above.
+ * <p>
+ * Use the configuration file "jaxp.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * conf directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ * <p>
+ * The jaxp.properties file is read only once by the JAXP implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in jaxp.properties after it has been read for the first time.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -166,19 +177,20 @@
* {@link SchemaFactoryConfigurationError} will be thrown.
* </li>
* <li>
+ * <p>
* Platform default <code>SchemaFactory</code> is located
* in a implementation specific way. There must be a platform default
* <code>SchemaFactory</code> for W3C XML Schema.
* </li>
* </ol>
*
- * <p>If everything fails, {@link IllegalArgumentException} will be thrown.</p>
+ * <p>If everything fails, {@link IllegalArgumentException} will be thrown.
*
- * <p><strong>Tip for Trouble-shooting:</strong></p>
+ * <p><strong>Tip for Trouble-shooting:</strong>
* <p>See {@link java.util.Properties#load(java.io.InputStream)} for
* exactly how a property file is parsed. In particular, colons ':'
* need to be escaped in a property file, so make sure schema language
- * URIs are properly escaped in it. For example:</p>
+ * URIs are properly escaped in it. For example:
* <pre>
* http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory
* </pre>
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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 @@
package javax.xml.xpath;
/**
- * <p>An <code>XPathFactory</code> instance can be used to create
+ * <p>An {@code XPathFactory} instance can be used to create
* {@link javax.xml.xpath.XPath} objects.</p>
*
*<p>See {@link #newInstance(String uri)} for lookup mechanism.</p>
@@ -68,13 +68,13 @@
/**
* <p>Protected constructor as {@link #newInstance()} or {@link #newInstance(String uri)}
* or {@link #newInstance(String uri, String factoryClassName, ClassLoader classLoader)}
- * should be used to create a new instance of an <code>XPathFactory</code>.</p>
+ * should be used to create a new instance of an {@code XPathFactory}.</p>
*/
protected XPathFactory() {
}
/**
- * <p>Get a new <code>XPathFactory</code> instance using the default object model,
+ * <p>Get a new {@code XPathFactory} instance using the default object model,
* {@link #DEFAULT_OBJECT_MODEL_URI},
* the W3C DOM.</p>
*
@@ -85,10 +85,10 @@
*
* <p>Since the implementation for the W3C DOM is always available, this method will never fail.</p>
*
- * @return Instance of an <code>XPathFactory</code>.
+ * @return Instance of an {@code XPathFactory}.
*
* @throws RuntimeException When there is a failure in creating an
- * <code>XPathFactory</code> for the default object model.
+ * {@code XPathFactory} for the default object model.
*/
public static XPathFactory newInstance() {
@@ -105,23 +105,35 @@
}
/**
- * <p>Get a new <code>XPathFactory</code> instance using the specified object model.</p>
+ * <p>Get a new {@code XPathFactory} instance using the specified object model.</p>
*
- * <p>To find a <code>XPathFactory</code> object,
+ * <p>To find a {@code XPathFactory} object,
* this method looks the following places in the following order where "the class loader" refers to the context class loader:</p>
* <ol>
* <li>
+ * <p>
* If the system property {@link #DEFAULT_PROPERTY_NAME} + ":uri" is present,
* where uri is the parameter to this method, then its value is read as a class name.
* The method will try to create a new instance of this class by using the class loader,
* and returns it if it is successfully created.
* </li>
* <li>
- * ${java.home}/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for.
- * If present, the value is processed just like above.
+ * <p>
+ * Use the configuration file "jaxp.properties". The file is in standard
+ * {@link java.util.Properties} format and typically located in the
+ * conf directory of the Java installation. It contains the fully qualified
+ * name of the implementation class with the key being the system property
+ * defined above.
+ * <p>
+ * The jaxp.properties file is read only once by the JAXP implementation
+ * and its values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in jaxp.properties after it has been read for the first time.
* </li>
* <li>
- * Use the service-provider loading facilities, defined by the
+ * <p>
+ * Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@@ -140,16 +152,17 @@
* {@link XPathFactoryConfigurationException} will be thrown.
* </li>
* <li>
- * Platform default <code>XPathFactory</code> is located in a platform specific way.
+ * <p>
+ * Platform default {@code XPathFactory} is located in a platform specific way.
* There must be a platform default XPathFactory for the W3C DOM, i.e. {@link #DEFAULT_OBJECT_MODEL_URI}.
* </li>
* </ol>
- * <p>If everything fails, an <code>XPathFactoryConfigurationException</code> will be thrown.</p>
+ * <p>If everything fails, an {@code XPathFactoryConfigurationException} will be thrown.
*
- * <p>Tip for Trouble-shooting:</p>
+ * <p>Tip for Trouble-shooting:
* <p>See {@link java.util.Properties#load(java.io.InputStream)} for exactly how a property file is parsed.
* In particular, colons ':' need to be escaped in a property file, so make sure the URIs are properly escaped in it.
- * For example:</p>
+ * For example:
* <pre>
* http\://java.sun.com/jaxp/xpath/dom=org.acme.DomXPathFactory
* </pre>
@@ -159,7 +172,7 @@
* <code>http://java.sun.com/jaxp/xpath/dom</code> for the W3C DOM,
* the org.w3c.dom package, and implementations are free to introduce other URIs for other object models.
*
- * @return Instance of an <code>XPathFactory</code>.
+ * @return Instance of an {@code XPathFactory}.
*
* @throws XPathFactoryConfigurationException If the specified object model
* is unavailable, or if there is a configuration error.
@@ -199,7 +212,7 @@
}
/**
- * <p>Obtain a new instance of a <code>XPathFactory</code> from a factory class name. <code>XPathFactory</code>
+ * <p>Obtain a new instance of a {@code XPathFactory} from a factory class name. {@code XPathFactory}
* is returned if specified factory class supports the specified object model.
* This function is useful when there are multiple providers in the classpath.
* It gives more control to the application as it can specify which provider
@@ -227,7 +240,7 @@
* current <code>Thread</code>'s context classLoader is used to load the factory class.
*
*
- * @return New instance of a <code>XPathFactory</code>
+ * @return New instance of a {@code XPathFactory}
*
* @throws XPathFactoryConfigurationException
* if <code>factoryClassName</code> is <code>null</code>, or
@@ -281,11 +294,11 @@
}
/**
- * <p>Is specified object model supported by this <code>XPathFactory</code>?</p>
+ * <p>Is specified object model supported by this {@code XPathFactory}?</p>
*
- * @param objectModel Specifies the object model which the returned <code>XPathFactory</code> will understand.
+ * @param objectModel Specifies the object model which the returned {@code XPathFactory} will understand.
*
- * @return <code>true</code> if <code>XPathFactory</code> supports <code>objectModel</code>, else <code>false</code>.
+ * @return <code>true</code> if {@code XPathFactory} supports <code>objectModel</code>, else <code>false</code>.
*
* @throws NullPointerException If <code>objectModel</code> is <code>null</code>.
* @throws IllegalArgumentException If <code>objectModel.length() == 0</code>.
@@ -293,16 +306,16 @@
public abstract boolean isObjectModelSupported(String objectModel);
/**
- * <p>Set a feature for this <code>XPathFactory</code> and
+ * <p>Set a feature for this {@code XPathFactory} and
* <code>XPath</code>s created by this factory.</p>
*
* <p>
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
* An {@link XPathFactoryConfigurationException} is thrown if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
+ * {@code XPathFactory} or the <code>XPath</code>s
* it creates cannot support the feature.
- * It is possible for an <code>XPathFactory</code> to expose a feature value
+ * It is possible for an {@code XPathFactory} to expose a feature value
* but be unable to change its state.
* </p>
*
@@ -316,7 +329,7 @@
* @param name Feature name.
* @param value Is feature state <code>true</code> or <code>false</code>.
*
- * @throws XPathFactoryConfigurationException if this <code>XPathFactory</code> or the <code>XPath</code>s
+ * @throws XPathFactoryConfigurationException if this {@code XPathFactory} or the <code>XPath</code>s
* it creates cannot support this feature.
* @throws NullPointerException if <code>name</code> is <code>null</code>.
*/
@@ -330,9 +343,9 @@
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
* An {@link XPathFactoryConfigurationException} is thrown if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
+ * {@code XPathFactory} or the <code>XPath</code>s
* it creates cannot support the feature.
- * It is possible for an <code>XPathFactory</code> to expose a feature value
+ * It is possible for an {@code XPathFactory} to expose a feature value
* but be unable to change its state.
* </p>
*
@@ -341,7 +354,7 @@
* @return State of the named feature.
*
* @throws XPathFactoryConfigurationException if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
+ * {@code XPathFactory} or the <code>XPath</code>s
* it creates cannot support this feature.
* @throws NullPointerException if <code>name</code> is <code>null</code>.
*/
@@ -382,7 +395,7 @@
/**
* <p>Return a new <code>XPath</code> using the underlying object
- * model determined when the <code>XPathFactory</code> was instantiated.</p>
+ * model determined when the {@code XPathFactory} was instantiated.</p>
*
* @return New instance of an <code>XPath</code>.
*/
--- a/jaxws/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/jaxws/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -299,3 +299,4 @@
bb9cf97a5ac6aa1aa2a1034676d64413071f58ea jdk9-b51
1d1e7704eca9c77ebe6a8705d17ac568801f7a3b jdk9-b52
b8fbe40efa97fe0753076ccc6dfc50747c7877d0 jdk9-b53
+83a0cf0e08788c33872e1fe3e87bf9a0d1e59eaa jdk9-b54
--- a/jdk/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -296,3 +296,4 @@
a0dad230aeb3b0d5cfd5b0715029e48d50573f8c jdk9-b51
607ea68032cd4a4cf2c7a7a41fcb39602d6a75e2 jdk9-b52
6cb5f5c34009630749a40cefe116d143f0b2583e jdk9-b53
+568a62ab7d764d7c74ac1d87387dbe500662b551 jdk9-b54
--- a/jdk/make/gendata/GendataPolicyJars.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/make/gendata/GendataPolicyJars.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -77,7 +77,7 @@
$(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
- $(US_EXPORT_POLICY_JAR_DEPS), \
+ DEPENDENCIES := $(US_EXPORT_POLICY_JAR_DEPS), \
SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
SUFFIXES := .policy, \
JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
@@ -139,8 +139,8 @@
$(install-file)
$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
- $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
- $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
+ DEPENDENCIES := $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
+ $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
SUFFIXES := .policy, \
JAR := $(LOCAL_POLICY_JAR_LIMITED), \
@@ -148,7 +148,7 @@
SKIP_METAINF := true))
$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
- $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
+ DEPENDENCIES := $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
SUFFIXES := .policy, \
JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/launcher/Launcher-jdk.policytool.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. 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.
+#
+
+include LauncherCommon.gmk
+
+ifndef BUILD_HEADLESS_ONLY
+ $(eval $(call SetupLauncher,policytool, \
+ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
+ $(XLIBS)))
+endif
--- a/jdk/make/lib/Lib-java.security.jgss.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/make/lib/Lib-java.security.jgss.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -41,7 +41,6 @@
CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
$(LIBJAVA_HEADER_FLAGS) \
-I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
- DISABLED_WARNINGS_gcc := pointer-to-int-cast, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -74,6 +73,8 @@
endif
ifneq ($(BUILD_LIBKRB5_NAME), )
+ # libosxkrb5 needs to call deprecated krb5 APIs so that java
+ # can use the native credentials cache.
$(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
LIBRARY := $(BUILD_LIBKRB5_NAME), \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -83,7 +84,7 @@
CFLAGS := $(CFLAGS_JDKLIB) \
$(addprefix -I, $(BUILD_LIBKRB5_SRC)) \
-I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
- DISABLED_WARNINGS_clang := implicit-function-declaration, \
+ DISABLED_WARNINGS_clang := deprecated-declarations, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \
--- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java Tue Mar 17 12:30:53 2015 -0700
@@ -276,7 +276,7 @@
* @since 1.4
* @spec JSR-51
*/
- public FileChannel getChannel() {
+ public final FileChannel getChannel() {
FileChannel fc = this.channel;
if (fc == null) {
synchronized (this) {
--- a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -153,8 +153,6 @@
* {@code DomainCombiner} with the provided
* {@code AccessControlContext}.
*
- * <p>
- *
* @param acc the {@code AccessControlContext} associated
* with the provided {@code DomainCombiner}.
*
@@ -338,8 +336,6 @@
* Get the {@code DomainCombiner} associated with this
* {@code AccessControlContext}.
*
- * <p>
- *
* @return the {@code DomainCombiner} associated with this
* {@code AccessControlContext}, or {@code null}
* if there is none.
@@ -738,12 +734,12 @@
/**
* Checks two AccessControlContext objects for equality.
- * Checks that <i>obj</i> is
+ * Checks that {@code obj} is
* an AccessControlContext and has the same set of ProtectionDomains
* as this context.
- * <P>
+ *
* @param obj the object we are testing for equality with this object.
- * @return true if <i>obj</i> is an AccessControlContext, and has the
+ * @return true if {@code obj} is an AccessControlContext, and has the
* same set of ProtectionDomains as this context, false otherwise.
*/
public boolean equals(Object obj) {
--- a/jdk/src/java.base/share/classes/java/security/AllPermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/AllPermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -96,7 +96,7 @@
* objects are always equal.
*
* @param obj the object we are testing for equality with this object.
- * @return true if <i>obj</i> is an AllPermission, false otherwise.
+ * @return true if {@code obj} is an AllPermission, false otherwise.
*/
public boolean equals(Object obj) {
return (obj instanceof AllPermission);
@@ -124,7 +124,6 @@
/**
* Returns a new PermissionCollection object for storing AllPermission
* objects.
- * <p>
*
* @return a new PermissionCollection object suitable for
* storing AllPermissions.
--- a/jdk/src/java.base/share/classes/java/security/BasicPermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/BasicPermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -56,7 +56,7 @@
* named permission or you don't.)
* Subclasses may implement actions on top of BasicPermission,
* if desired.
- * <p>
+ *
* @see java.security.Permission
* @see java.security.Permissions
* @see java.security.PermissionCollection
@@ -154,8 +154,8 @@
* <P>
* More specifically, this method returns true if:
* <ul>
- * <li> <i>p</i>'s class is the same as this object's class, and
- * <li> <i>p</i>'s name equals or (in the case of wildcards)
+ * <li> {@code p}'s class is the same as this object's class, and
+ * <li> {@code p}'s name equals or (in the case of wildcards)
* is implied by this object's
* name. For example, "a.b.*" implies "a.b.c".
* </ul>
@@ -193,11 +193,11 @@
/**
* Checks two BasicPermission objects for equality.
- * Checks that <i>obj</i>'s class is the same as this object's class
+ * Checks that {@code obj}'s class is the same as this object's class
* and has the same name as this object.
- * <P>
+ *
* @param obj the object we are testing for equality with this object.
- * @return true if <i>obj</i>'s class is the same as this object's class
+ * @return true if {@code obj}'s class is the same as this object's class
* and has the same name as this BasicPermission object, false otherwise.
*/
public boolean equals(Object obj) {
--- a/jdk/src/java.base/share/classes/java/security/DomainCombiner.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/DomainCombiner.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -87,8 +87,6 @@
* Individual ProtectionDomains may be modified (with a new
* set of Permissions, for example).
*
- * <p>
- *
* @param currentDomains the ProtectionDomains associated with the
* current execution Thread, up to the most recent
* privileged {@code ProtectionDomain}.
@@ -96,7 +94,7 @@
* with the most recently executing {@code ProtectionDomain}
* residing at the beginning of the array. This parameter may
* be {@code null} if the current execution Thread
- * has no associated ProtectionDomains.<p>
+ * has no associated ProtectionDomains.
*
* @param assignedDomains an array of inherited ProtectionDomains.
* ProtectionDomains may be inherited from a parent Thread,
--- a/jdk/src/java.base/share/classes/java/security/KeyRep.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyRep.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -112,8 +112,6 @@
/**
* Construct the alternate Key class.
*
- * <p>
- *
* @param type either one of Type.SECRET, Type.PUBLIC, or Type.PRIVATE
* @param algorithm the algorithm returned from
* {@code Key.getAlgorithm()}
@@ -157,8 +155,6 @@
* encoded key bytes, and generates a private key from the spec
* </ul>
*
- * <p>
- *
* @return the resolved Key object
*
* @exception ObjectStreamException if the Type/format
--- a/jdk/src/java.base/share/classes/java/security/KeyStore.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java Tue Mar 17 12:30:53 2015 -0700
@@ -120,7 +120,7 @@
* KeyStore ks = KeyStore.getInstance("JKS");
* </pre>
* The system will return the most preferred implementation of the
- * specified keystore type available in the environment. <p>
+ * specified keystore type available in the environment.
* </ul>
*
* <p> Before a keystore can be accessed, it must be
@@ -617,7 +617,6 @@
/**
* Retrieves the attributes associated with an entry.
- * <p>
*
* @return an unmodifiable {@code Set} of attributes, possibly empty
*
@@ -708,7 +707,6 @@
/**
* Retrieves the attributes associated with an entry.
- * <p>
*
* @return an unmodifiable {@code Set} of attributes, possibly empty
*
@@ -792,7 +790,6 @@
/**
* Retrieves the attributes associated with an entry.
- * <p>
*
* @return an unmodifiable {@code Set} of attributes, possibly empty
*
--- a/jdk/src/java.base/share/classes/java/security/KeyStoreSpi.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyStoreSpi.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -595,7 +595,6 @@
* Probes the specified input stream to determine whether it contains a
* keystore that is supported by this implementation, or not.
*
- * <p>
* @implSpec
* This method returns false by default. Keystore implementations should
* override this method to peek at the data stream directly or to use other
--- a/jdk/src/java.base/share/classes/java/security/Permissions.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Permissions.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -111,7 +111,7 @@
*
* This method creates
* a new PermissionCollection object (and adds the permission to it)
- * if an appropriate collection does not yet exist. <p>
+ * if an appropriate collection does not yet exist.
*
* @param permission the Permission object to add.
*
@@ -162,7 +162,7 @@
*
* <p>Additionally, if this PermissionCollection contains the
* AllPermission, this method will always return true.
- * <p>
+ *
* @param permission the Permission object to check.
*
* @return true if "permission" is implied by the permissions in the
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Tue Mar 17 12:30:53 2015 -0700
@@ -51,7 +51,6 @@
* ProtectionDomain can also be constructed such that it is dynamically
* mapped to a set of permissions by the current Policy whenever a permission
* is checked.
- * <p>
*
* @author Li Gong
* @author Roland Schemers
@@ -168,7 +167,6 @@
* this domain. This constructor affords the
* Policy provider the opportunity to augment the supplied
* PermissionCollection to reflect policy changes.
- * <p>
*
* @param codesource the CodeSource associated with this domain
* @param permissions the permissions granted to this domain
@@ -263,7 +261,6 @@
* permissions, then the permission will be checked against the
* combination of the PermissionCollection supplied at construction and
* the current Policy binding.
- * <p>
*
* @param permission the Permission object to check.
*
--- a/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -65,7 +65,7 @@
* <p>If there is a security manager, this method first
* calls the security manager's {@code checkCreateClassLoader}
* method to ensure creation of a class loader is allowed.
- * <p>
+ *
* @param parent the parent ClassLoader
* @exception SecurityException if a security manager exists and its
* {@code checkCreateClassLoader} method doesn't allow
@@ -112,7 +112,7 @@
* <p>
* If a non-null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined.
- * <p>
+ *
* @param name the expected name of the class, or {@code null}
* if not known, using '.' and not '/' as the separator
* and without a trailing ".class" suffix.
@@ -149,7 +149,7 @@
* <p>
* If a non-null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined.
- * <p>
+ *
* @param name the expected name of the class, or {@code null}
* if not known, using '.' and not '/' as the separator
* and without a trailing ".class" suffix.
@@ -180,7 +180,7 @@
* This method is invoked by the defineClass method which takes
* a CodeSource as an argument when it is constructing the
* ProtectionDomain for the class being defined.
- * <p>
+ *
* @param codesource the codesource.
*
* @return the permissions granted to the codesource.
--- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -310,7 +310,7 @@
/**
* Checks two UnresolvedPermission objects for equality.
- * Checks that <i>obj</i> is an UnresolvedPermission, and has
+ * Checks that {@code obj} is an UnresolvedPermission, and has
* the same type (class) name, permission name, actions, and
* certificates as this object.
*
@@ -491,7 +491,7 @@
/**
* Returns a new PermissionCollection object for storing
* UnresolvedPermission objects.
- * <p>
+ *
* @return a new PermissionCollection object suitable for
* storing UnresolvedPermissions.
*/
--- a/jdk/src/java.base/share/classes/java/security/cert/Certificate.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/Certificate.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -41,7 +41,7 @@
* An identity certificate is a binding of a principal to a public key which
* is vouched for by another principal. (A principal represents
* an entity such as an individual user, a group, or a corporation.)
- *<p>
+ * <p>
* This class is an abstraction for certificates that have different
* formats but important common uses. For example, different types of
* certificates, such as X.509 and PGP, share general certificate
@@ -248,9 +248,7 @@
* Construct the alternate Certificate class with the Certificate
* type and Certificate encoding bytes.
*
- * <p>
- *
- * @param type the standard name of the Certificate type. <p>
+ * @param type the standard name of the Certificate type.
*
* @param data the Certificate data.
*/
@@ -262,8 +260,6 @@
/**
* Resolve the Certificate Object.
*
- * <p>
- *
* @return the resolved Certificate Object
*
* @throws java.io.ObjectStreamException if the Certificate
--- a/jdk/src/java.base/share/classes/java/util/Properties.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Properties.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -34,8 +34,6 @@
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import jdk.internal.util.xml.PropertiesDefaultHandler;
@@ -311,9 +309,11 @@
* input stream.
* @throws IllegalArgumentException if a malformed Unicode escape
* appears in the input.
+ * @throws NullPointerException if {@code reader} is null.
* @since 1.6
*/
public synchronized void load(Reader reader) throws IOException {
+ Objects.requireNonNull(reader, "reader parameter is null");
load0(new LineReader(reader));
}
@@ -335,9 +335,11 @@
* input stream.
* @throws IllegalArgumentException if the input stream contains a
* malformed Unicode escape sequence.
+ * @throws NullPointerException if {@code inStream} is null.
* @since 1.2
*/
public synchronized void load(InputStream inStream) throws IOException {
+ Objects.requireNonNull(inStream, "inStream parameter is null");
load0(new LineReader(inStream));
}
--- a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java Tue Mar 17 12:30:53 2015 -0700
@@ -292,11 +292,13 @@
@Override
public int start() {
+ checkMatch();
return first;
}
@Override
public int start(int group) {
+ checkMatch();
if (group < 0 || group > groupCount)
throw new IndexOutOfBoundsException("No group " + group);
return groups[group * 2];
@@ -304,11 +306,13 @@
@Override
public int end() {
+ checkMatch();
return last;
}
@Override
public int end(int group) {
+ checkMatch();
if (group < 0 || group > groupCount)
throw new IndexOutOfBoundsException("No group " + group);
return groups[group * 2 + 1];
@@ -321,17 +325,25 @@
@Override
public String group() {
+ checkMatch();
return group(0);
}
@Override
public String group(int group) {
+ checkMatch();
if (group < 0 || group > groupCount)
throw new IndexOutOfBoundsException("No group " + group);
if ((groups[group*2] == -1) || (groups[group*2+1] == -1))
return null;
return text.subSequence(groups[group * 2], groups[group * 2 + 1]).toString();
}
+
+ private void checkMatch() {
+ if (first < 0)
+ throw new IllegalStateException("No match found");
+
+ }
}
/**
--- a/jdk/src/java.base/share/classes/java/util/stream/DoublePipeline.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/DoublePipeline.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -447,7 +447,7 @@
@Override
public final long count() {
- return mapToLong(e -> 1L).sum();
+ return evaluate(ReduceOps.makeDoubleCounting());
}
@Override
--- a/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java Tue Mar 17 12:30:53 2015 -0700
@@ -581,6 +581,24 @@
*
* <p>This is a <a href="package-summary.html#StreamOps">terminal operation</a>.
*
+ * @apiNote
+ * An implementation may choose to not execute the stream pipeline (either
+ * sequentially or in parallel) if it is capable of computing the count
+ * directly from the stream source. In such cases no source elements will
+ * be traversed and no intermediate operations will be evaluated.
+ * Behavioral parameters with side-effects, which are strongly discouraged
+ * except for harmless cases such as debugging, may be affected. For
+ * example, consider the following stream:
+ * <pre>{@code
+ * DoubleStream s = DoubleStream.of(1, 2, 3, 4);
+ * long count = s.peek(System.out::println).count();
+ * }</pre>
+ * The number of elements covered by the stream source is known and the
+ * intermediate operation, {@code peek}, does not inject into or remove
+ * elements from the stream (as may be the case for {@code flatMap} or
+ * {@code filter} operations). Thus the count is 4 and there is no need to
+ * execute the pipeline and, as a side-effect, print out the elements.
+ *
* @return the count of elements in this stream
*/
long count();
--- a/jdk/src/java.base/share/classes/java/util/stream/IntPipeline.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/IntPipeline.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -427,7 +427,7 @@
@Override
public final long count() {
- return mapToLong(e -> 1L).sum();
+ return evaluate(ReduceOps.makeIntCounting());
}
@Override
--- a/jdk/src/java.base/share/classes/java/util/stream/IntStream.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/IntStream.java Tue Mar 17 12:30:53 2015 -0700
@@ -504,6 +504,24 @@
*
* <p>This is a <a href="package-summary.html#StreamOps">terminal operation</a>.
*
+ * @apiNote
+ * An implementation may choose to not execute the stream pipeline (either
+ * sequentially or in parallel) if it is capable of computing the count
+ * directly from the stream source. In such cases no source elements will
+ * be traversed and no intermediate operations will be evaluated.
+ * Behavioral parameters with side-effects, which are strongly discouraged
+ * except for harmless cases such as debugging, may be affected. For
+ * example, consider the following stream:
+ * <pre>{@code
+ * IntStream s = IntStream.of(1, 2, 3, 4);
+ * long count = s.peek(System.out::println).count();
+ * }</pre>
+ * The number of elements covered by the stream source is known and the
+ * intermediate operation, {@code peek}, does not inject into or remove
+ * elements from the stream (as may be the case for {@code flatMap} or
+ * {@code filter} operations). Thus the count is 4 and there is no need to
+ * execute the pipeline and, as a side-effect, print out the elements.
+ *
* @return the count of elements in this stream
*/
long count();
--- a/jdk/src/java.base/share/classes/java/util/stream/LongPipeline.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/LongPipeline.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -425,7 +425,7 @@
@Override
public final long count() {
- return map(e -> 1L).sum();
+ return evaluate(ReduceOps.makeLongCounting());
}
@Override
--- a/jdk/src/java.base/share/classes/java/util/stream/LongStream.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/LongStream.java Tue Mar 17 12:30:53 2015 -0700
@@ -509,6 +509,24 @@
*
* <p>This is a <a href="package-summary.html#StreamOps">terminal operation</a>.
*
+ * @apiNote
+ * An implementation may choose to not execute the stream pipeline (either
+ * sequentially or in parallel) if it is capable of computing the count
+ * directly from the stream source. In such cases no source elements will
+ * be traversed and no intermediate operations will be evaluated.
+ * Behavioral parameters with side-effects, which are strongly discouraged
+ * except for harmless cases such as debugging, may be affected. For
+ * example, consider the following stream:
+ * <pre>{@code
+ * LongStream s = LongStream.of(1, 2, 3, 4);
+ * long count = s.peek(System.out::println).count();
+ * }</pre>
+ * The number of elements covered by the stream source is known and the
+ * intermediate operation, {@code peek}, does not inject into or remove
+ * elements from the stream (as may be the case for {@code flatMap} or
+ * {@code filter} operations). Thus the count is 4 and there is no need to
+ * execute the pipeline and, as a side-effect, print out the elements.
+ *
* @return the count of elements in this stream
*/
long count();
--- a/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -234,6 +234,40 @@
}
/**
+ * Constructs a {@code TerminalOp} that counts the number of stream
+ * elements. If the size of the pipeline is known then count is the size
+ * and there is no need to evaluate the pipeline. If the size of the
+ * pipeline is non known then count is produced, via reduction, using a
+ * {@link CountingSink}.
+ *
+ * @param <T> the type of the input elements
+ * @return a {@code TerminalOp} implementing the counting
+ */
+ public static <T> TerminalOp<T, Long>
+ makeRefCounting() {
+ return new ReduceOp<T, Long, CountingSink<T>>(StreamShape.REFERENCE) {
+ @Override
+ public CountingSink<T> makeSink() { return new CountingSink.OfRef<>(); }
+
+ @Override
+ public <P_IN> Long evaluateSequential(PipelineHelper<T> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateSequential(helper, spliterator);
+ }
+
+ @Override
+ public <P_IN> Long evaluateParallel(PipelineHelper<T> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateParallel(helper, spliterator);
+ }
+ };
+ }
+
+ /**
* Constructs a {@code TerminalOp} that implements a functional reduce on
* {@code int} values.
*
@@ -370,6 +404,39 @@
}
/**
+ * Constructs a {@code TerminalOp} that counts the number of stream
+ * elements. If the size of the pipeline is known then count is the size
+ * and there is no need to evaluate the pipeline. If the size of the
+ * pipeline is non known then count is produced, via reduction, using a
+ * {@link CountingSink}.
+ *
+ * @return a {@code TerminalOp} implementing the counting
+ */
+ public static TerminalOp<Integer, Long>
+ makeIntCounting() {
+ return new ReduceOp<Integer, Long, CountingSink<Integer>>(StreamShape.INT_VALUE) {
+ @Override
+ public CountingSink<Integer> makeSink() { return new CountingSink.OfInt(); }
+
+ @Override
+ public <P_IN> Long evaluateSequential(PipelineHelper<Integer> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateSequential(helper, spliterator);
+ }
+
+ @Override
+ public <P_IN> Long evaluateParallel(PipelineHelper<Integer> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateParallel(helper, spliterator);
+ }
+ };
+ }
+
+ /**
* Constructs a {@code TerminalOp} that implements a functional reduce on
* {@code long} values.
*
@@ -506,6 +573,39 @@
}
/**
+ * Constructs a {@code TerminalOp} that counts the number of stream
+ * elements. If the size of the pipeline is known then count is the size
+ * and there is no need to evaluate the pipeline. If the size of the
+ * pipeline is non known then count is produced, via reduction, using a
+ * {@link CountingSink}.
+ *
+ * @return a {@code TerminalOp} implementing the counting
+ */
+ public static TerminalOp<Long, Long>
+ makeLongCounting() {
+ return new ReduceOp<Long, Long, CountingSink<Long>>(StreamShape.LONG_VALUE) {
+ @Override
+ public CountingSink<Long> makeSink() { return new CountingSink.OfLong(); }
+
+ @Override
+ public <P_IN> Long evaluateSequential(PipelineHelper<Long> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateSequential(helper, spliterator);
+ }
+
+ @Override
+ public <P_IN> Long evaluateParallel(PipelineHelper<Long> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateParallel(helper, spliterator);
+ }
+ };
+ }
+
+ /**
* Constructs a {@code TerminalOp} that implements a functional reduce on
* {@code double} values.
*
@@ -642,6 +742,91 @@
}
/**
+ * Constructs a {@code TerminalOp} that counts the number of stream
+ * elements. If the size of the pipeline is known then count is the size
+ * and there is no need to evaluate the pipeline. If the size of the
+ * pipeline is non known then count is produced, via reduction, using a
+ * {@link CountingSink}.
+ *
+ * @return a {@code TerminalOp} implementing the counting
+ */
+ public static TerminalOp<Double, Long>
+ makeDoubleCounting() {
+ return new ReduceOp<Double, Long, CountingSink<Double>>(StreamShape.DOUBLE_VALUE) {
+ @Override
+ public CountingSink<Double> makeSink() { return new CountingSink.OfDouble(); }
+
+ @Override
+ public <P_IN> Long evaluateSequential(PipelineHelper<Double> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateSequential(helper, spliterator);
+ }
+
+ @Override
+ public <P_IN> Long evaluateParallel(PipelineHelper<Double> helper,
+ Spliterator<P_IN> spliterator) {
+ if (StreamOpFlag.SIZED.isKnown(helper.getStreamAndOpFlags()))
+ return spliterator.getExactSizeIfKnown();
+ return super.evaluateParallel(helper, spliterator);
+ }
+ };
+ }
+
+ /**
+ * A sink that counts elements
+ */
+ static abstract class CountingSink<T>
+ extends Box<Long>
+ implements AccumulatingSink<T, Long, CountingSink<T>> {
+ long count;
+
+ @Override
+ public void begin(long size) {
+ count = 0L;
+ }
+
+ @Override
+ public Long get() {
+ return count;
+ }
+
+ @Override
+ public void combine(CountingSink<T> other) {
+ count += other.count;
+ }
+
+ static final class OfRef<T> extends CountingSink<T> {
+ @Override
+ public void accept(T t) {
+ count++;
+ }
+ }
+
+ static final class OfInt extends CountingSink<Integer> implements Sink.OfInt {
+ @Override
+ public void accept(int t) {
+ count++;
+ }
+ }
+
+ static final class OfLong extends CountingSink<Long> implements Sink.OfLong {
+ @Override
+ public void accept(long t) {
+ count++;
+ }
+ }
+
+ static final class OfDouble extends CountingSink<Double> implements Sink.OfDouble {
+ @Override
+ public void accept(double t) {
+ count++;
+ }
+ }
+ }
+
+ /**
* A type of {@code TerminalSink} that implements an associative reducing
* operation on elements of type {@code T} and producing a result of type
* {@code R}.
@@ -652,7 +837,7 @@
*/
private interface AccumulatingSink<T, R, K extends AccumulatingSink<T, R, K>>
extends TerminalSink<T, R> {
- public void combine(K other);
+ void combine(K other);
}
/**
--- a/jdk/src/java.base/share/classes/java/util/stream/ReferencePipeline.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/ReferencePipeline.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -523,10 +523,9 @@
@Override
public final long count() {
- return mapToLong(e -> 1L).sum();
+ return evaluate(ReduceOps.makeRefCounting());
}
-
//
/**
--- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java Tue Mar 17 12:30:53 2015 -0700
@@ -851,6 +851,25 @@
*
* <p>This is a <a href="package-summary.html#StreamOps">terminal operation</a>.
*
+ * @apiNote
+ * An implementation may choose to not execute the stream pipeline (either
+ * sequentially or in parallel) if it is capable of computing the count
+ * directly from the stream source. In such cases no source elements will
+ * be traversed and no intermediate operations will be evaluated.
+ * Behavioral parameters with side-effects, which are strongly discouraged
+ * except for harmless cases such as debugging, may be affected. For
+ * example, consider the following stream:
+ * <pre>{@code
+ * List<String> l = Arrays.asList("A", "B", "C", "D");
+ * long count = l.stream().peek(System.out::println).count();
+ * }</pre>
+ * The number of elements covered by the stream source, a {@code List}, is
+ * known and the intermediate operation, {@code peek}, does not inject into
+ * or remove elements from the stream (as may be the case for
+ * {@code flatMap} or {@code filter} operations). Thus the count is the
+ * size of the {@code List} and there is no need to execute the pipeline
+ * and, as a side-effect, print out the list elements.
+ *
* @return the count of elements in this stream
*/
long count();
--- a/jdk/src/java.base/share/classes/javax/crypto/CipherInputStream.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/CipherInputStream.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -172,7 +172,6 @@
* <code>-1</code> is returned. This method blocks until input data
* is available, the end of the stream is detected, or an exception
* is thrown.
- * <p>
*
* @return the next byte of data, or <code>-1</code> if the end of the
* stream is reached.
--- a/jdk/src/java.base/share/classes/javax/crypto/package.html Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/package.html Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
<!--
-Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1999, 2015, 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
@@ -47,8 +47,8 @@
<h2>Package Specification</h2>
<ul>
- <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html"><b>
- <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
+ <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
+ <b>Java™
Cryptography Architecture Standard Algorithm Name
Documentation</b></a></li>
</ul>
@@ -60,14 +60,14 @@
<li>
<a href=
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
- <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
+ <b>Java™
Cryptography Architecture (JCA) Reference Guide
</b></a></li>
<li>
<a href=
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
<b>How to Implement a Provider in the
- Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
+ Java™ Cryptography Architecture
</b></a></li>
</ul>
--- a/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -240,7 +240,6 @@
* <P>
* For more flexible initialization, please see
* {@link #init(ManagerFactoryParameters)}.
- * <P>
*
* @param ks the key store or null
* @param password the password for recovering keys in the KeyStore
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -339,7 +339,6 @@
* SSLEngine engine =
* sslContext.createSSLEngine("www.example.com", 443);
* </pre>
- * <P>
*
* @return null or an immutable list of non-null {@link SNIServerName}s
*
--- a/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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,7 +80,7 @@
*
* createLoginContext.{name} - allow code to instantiate a
* {@code LoginContext} with the
- * specified <i>name</i>. <i>name</i>
+ * specified {@code name}. {@code name}
* is used as the index into the installed login
* {@code Configuration}
* (that returned by
@@ -135,8 +135,6 @@
* Creates a new AuthPermission with the specified name.
* The name is the symbolic name of the AuthPermission.
*
- * <p>
- *
* @param name the name of the AuthPermission
*
* @throws NullPointerException if {@code name} is {@code null}.
@@ -154,9 +152,7 @@
* The name is the symbolic name of the AuthPermission, and the
* actions String is currently unused and should be null.
*
- * <p>
- *
- * @param name the name of the AuthPermission <p>
+ * @param name the name of the AuthPermission
*
* @param actions should be null.
*
--- a/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -50,8 +50,6 @@
* message. A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public DestroyFailedException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -44,7 +44,7 @@
* @implSpec
* The default implementation throws {@code DestroyFailedException}.
*
- * @exception DestroyFailedException if the destroy operation fails. <p>
+ * @exception DestroyFailedException if the destroy operation fails.
*
* @exception SecurityException if the caller does not have permission
* to destroy this {@code Object}.
--- a/jdk/src/java.base/share/classes/javax/security/auth/Policy.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Policy.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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,8 +51,8 @@
* The {@code Policy} object consults the local policy and returns
* and appropriate {@code Permissions} object with the
* Permissions granted to the Principals associated with the
- * provided <i>subject</i>, and granted to the code specified
- * by the provided <i>codeSource</i>.
+ * provided {@code subject}, and granted to the code specified
+ * by the provided {@code codeSource}.
*
* <p> A {@code Policy} contains the following information.
* Note that this example only represents the syntax for the default
@@ -181,8 +181,6 @@
* {@code AuthPermission("getPolicy")} permission
* to ensure the caller has permission to get the Policy object.
*
- * <p>
- *
* @return the installed Policy. The return value cannot be
* {@code null}.
*
@@ -263,8 +261,6 @@
* {@code AuthPermission("setPolicy")}
* permission to ensure the caller has permission to set the Policy.
*
- * <p>
- *
* @param policy the new system Policy object.
*
* @exception java.lang.SecurityException if the current thread does not
@@ -321,8 +317,6 @@
* Retrieve the Permissions granted to the Principals associated with
* the specified {@code CodeSource}.
*
- * <p>
- *
* @param subject the {@code Subject}
* whose associated Principals,
* in conjunction with the provided
@@ -353,8 +347,6 @@
* For example, if the Policy object is stored in
* a file, calling {@code refresh} will cause the file to be re-read.
*
- * <p>
- *
* @exception SecurityException if the caller does not have permission
* to refresh the Policy.
*/
--- a/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -157,10 +157,8 @@
* with the specified {@code name}. The {@code name}
* specifies both a Credential class and a {@code Principal} Set.
*
- * <p>
- *
* @param name the name specifying the Credential class and
- * {@code Principal} Set. <p>
+ * {@code Principal} Set.
*
* @param actions the actions specifying that the Credential can be read.
*
@@ -180,8 +178,6 @@
* Returns the Class name of the Credential associated with this
* {@code PrivateCredentialPermission}.
*
- * <p>
- *
* @return the Class name of the Credential associated with this
* {@code PrivateCredentialPermission}.
*/
@@ -202,8 +198,6 @@
* corresponds to the {@code Principal} name of the
* first {@code Principal} in the array.
*
- * <p>
- *
* @return the {@code Principal} class and names associated
* with this {@code PrivateCredentialPermission}.
*/
@@ -229,8 +223,8 @@
*
* This method returns true if:
* <ul>
- * <li> <i>p</i> is an instanceof PrivateCredentialPermission and
- * <li> the target name for <i>p</i> is implied by this object's
+ * <li> {@code p} is an instanceof PrivateCredentialPermission and
+ * <li> the target name for {@code p} is implied by this object's
* target name. For example:
* <pre>
* [* P1 "duke"] implies [a.b.Credential P1 "duke"].
@@ -239,8 +233,6 @@
* </pre>
* </ul>
*
- * <p>
- *
* @param p the {@code Permission} to check against.
*
* @return true if this {@code PrivateCredentialPermission} implies
@@ -261,15 +253,13 @@
/**
* Checks two {@code PrivateCredentialPermission} objects for
- * equality. Checks that <i>obj</i> is a
+ * equality. Checks that {@code obj} is a
* {@code PrivateCredentialPermission},
* and has the same credential class as this object,
* as well as the same Principals as this object.
* The order of the Principals in the respective Permission's
* target names is not relevant.
*
- * <p>
- *
* @param obj the object we are testing for equality with this object.
*
* @return true if obj is a {@code PrivateCredentialPermission},
@@ -301,8 +291,6 @@
* Returns the "canonical string representation" of the actions.
* This method always returns the String, "read".
*
- * <p>
- *
* @return the actions (always returns "read").
*/
public String getActions() {
@@ -315,8 +303,6 @@
* No such {@code PermissionCollection} is defined,
* so this method always returns {@code null}.
*
- * <p>
- *
* @return null in all cases.
*/
public PermissionCollection newPermissionCollection() {
--- a/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -50,8 +50,6 @@
* message. A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public RefreshFailedException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -39,8 +39,6 @@
/**
* Determine if this {@code Object} is current.
*
- * <p>
- *
* @return true if this {@code Object} is currently current,
* false otherwise.
*/
@@ -50,11 +48,9 @@
* Update or extend the validity period for this
* {@code Object}.
*
- * <p>
- *
* @exception SecurityException if the caller does not have permission
* to update or extend the validity period for this
- * {@code Object}. <p>
+ * {@code Object}.
*
* @exception RefreshFailedException if the refresh attempt failed.
*/
--- a/jdk/src/java.base/share/classes/javax/security/auth/Subject.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -105,8 +105,6 @@
* A {@code Set} that provides a view of all of this
* Subject's Principals
*
- * <p>
- *
* @serial Each element in this set is a
* {@code java.security.Principal}.
* The set is a {@code Subject.SecureSet}.
--- a/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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,8 +69,6 @@
* Associate the provided {@code Subject} with this
* {@code SubjectDomainCombiner}.
*
- * <p>
- *
* @param subject the {@code Subject} to be associated with
* with this {@code SubjectDomainCombiner}.
*/
@@ -88,8 +86,6 @@
* Get the {@code Subject} associated with this
* {@code SubjectDomainCombiner}.
*
- * <p>
- *
* @return the {@code Subject} associated with this
* {@code SubjectDomainCombiner}, or {@code null}
* if no {@code Subject} is associated with this
@@ -115,25 +111,23 @@
*
* <p> A new {@code ProtectionDomain} instance is created
* for each {@code ProtectionDomain} in the
- * <i>currentDomains</i> array. Each new {@code ProtectionDomain}
+ * {@code currentDomains} array. Each new {@code ProtectionDomain}
* instance is created using the {@code CodeSource},
* {@code Permission}s and {@code ClassLoader}
* from the corresponding {@code ProtectionDomain} in
- * <i>currentDomains</i>, as well as with the Principals from
+ * {@code currentDomains}, as well as with the Principals from
* the {@code Subject} associated with this
* {@code SubjectDomainCombiner}.
*
* <p> All of the newly instantiated ProtectionDomains are
* combined into a new array. The ProtectionDomains from the
- * <i>assignedDomains</i> array are appended to this new array,
+ * {@code assignedDomains} array are appended to this new array,
* and the result is returned.
*
* <p> Note that optimizations such as the removal of duplicate
* ProtectionDomains may have occurred.
* In addition, caching of ProtectionDomains may be permitted.
*
- * <p>
- *
* @param currentDomains the ProtectionDomains associated with the
* current execution Thread, up to the most recent
* privileged {@code ProtectionDomain}.
@@ -141,15 +135,15 @@
* with the most recently executing {@code ProtectionDomain}
* residing at the beginning of the array. This parameter may
* be {@code null} if the current execution Thread
- * has no associated ProtectionDomains.<p>
+ * has no associated ProtectionDomains.
*
* @param assignedDomains the ProtectionDomains inherited from the
* parent Thread, or the ProtectionDomains from the
- * privileged <i>context</i>, if a call to
- * AccessController.doPrivileged(..., <i>context</i>)
+ * privileged {@code context}, if a call to
+ * {@code AccessController.doPrivileged(..., context)}
* had occurred This parameter may be {@code null}
* if there were no ProtectionDomains inherited from the
- * parent Thread, or from the privileged <i>context</i>.
+ * parent Thread, or from the privileged {@code context}.
*
* @return a new array consisting of the updated ProtectionDomains,
* or {@code null}.
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -139,7 +139,7 @@
* by an underlying security service which contains
* the information requested to be retrieved or displayed.
*
- * @exception java.io.IOException if an input or output error occurs. <p>
+ * @exception java.io.IOException if an input or output error occurs.
*
* @exception UnsupportedCallbackException if the implementation of this
* method does not support one or more of the Callbacks
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -70,16 +70,15 @@
* a list of choices, a default choice, and a boolean specifying
* whether or not multiple selections from the list of choices are allowed.
*
- * <p>
*
- * @param prompt the prompt used to describe the list of choices. <p>
+ * @param prompt the prompt used to describe the list of choices.
*
- * @param choices the list of choices. <p>
+ * @param choices the list of choices.
*
* @param defaultChoice the choice to be used as the default choice
* when the list of choices are displayed. This value
* is represented as an index into the
- * {@code choices} array. <p>
+ * {@code choices} array.
*
* @param multipleSelectionsAllowed boolean specifying whether or
* not multiple selections can be made from the
@@ -117,8 +116,6 @@
/**
* Get the prompt.
*
- * <p>
- *
* @return the prompt.
*/
public String getPrompt() {
@@ -128,8 +125,6 @@
/**
* Get the list of choices.
*
- * <p>
- *
* @return the list of choices.
*/
public String[] getChoices() {
@@ -139,8 +134,6 @@
/**
* Get the defaultChoice.
*
- * <p>
- *
* @return the defaultChoice, represented as an index into
* the {@code choices} list.
*/
@@ -152,8 +145,6 @@
* Get the boolean determining whether multiple selections from
* the {@code choices} list are allowed.
*
- * <p>
- *
* @return whether multiple selections are allowed.
*/
public boolean allowMultipleSelections() {
@@ -163,8 +154,6 @@
/**
* Set the selected choice.
*
- * <p>
- *
* @param selection the selection represented as an index into the
* {@code choices} list.
*
@@ -178,8 +167,6 @@
/**
* Set the selected choices.
*
- * <p>
- *
* @param selections the selections represented as indexes into the
* {@code choices} list.
*
@@ -198,8 +185,6 @@
/**
* Get the selected choices.
*
- * <p>
- *
* @return the selected choices, represented as indexes into the
* {@code choices} list.
*
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -159,14 +159,12 @@
* they require either a YES/NO, YES/NO/CANCEL or OK/CANCEL
* confirmation.
*
- * <p>
- *
* @param messageType the message type ({@code INFORMATION},
- * {@code WARNING} or {@code ERROR}). <p>
+ * {@code WARNING} or {@code ERROR}).
*
* @param optionType the option type ({@code YES_NO_OPTION},
* {@code YES_NO_CANCEL_OPTION} or
- * {@code OK_CANCEL_OPTION}). <p>
+ * {@code OK_CANCEL_OPTION}).
*
* @param defaultOption the default option
* from the provided optionType ({@code YES},
@@ -222,12 +220,10 @@
* and are displayed by the {@code CallbackHandler} implementation
* in a manner consistent with the way preset options are displayed.
*
- * <p>
+ * @param messageType the message type ({@code INFORMATION},
+ * {@code WARNING} or {@code ERROR}).
*
- * @param messageType the message type ({@code INFORMATION},
- * {@code WARNING} or {@code ERROR}). <p>
- *
- * @param options the list of confirmation options. <p>
+ * @param options the list of confirmation options.
*
* @param defaultOption the default option, represented as an index
* into the {@code options} array.
@@ -268,16 +264,14 @@
* they require either a YES/NO, YES/NO/CANCEL or OK/CANCEL
* confirmation.
*
- * <p>
- *
- * @param prompt the prompt used to describe the list of options. <p>
+ * @param prompt the prompt used to describe the list of options.
*
* @param messageType the message type ({@code INFORMATION},
- * {@code WARNING} or {@code ERROR}). <p>
+ * {@code WARNING} or {@code ERROR}).
*
* @param optionType the option type ({@code YES_NO_OPTION},
* {@code YES_NO_CANCEL_OPTION} or
- * {@code OK_CANCEL_OPTION}). <p>
+ * {@code OK_CANCEL_OPTION}).
*
* @param defaultOption the default option
* from the provided optionType ({@code YES},
@@ -337,14 +331,12 @@
* and are displayed by the {@code CallbackHandler} implementation
* in a manner consistent with the way preset options are displayed.
*
- * <p>
- *
- * @param prompt the prompt used to describe the list of options. <p>
+ * @param prompt the prompt used to describe the list of options.
*
* @param messageType the message type ({@code INFORMATION},
- * {@code WARNING} or {@code ERROR}). <p>
+ * {@code WARNING} or {@code ERROR}).
*
- * @param options the list of confirmation options. <p>
+ * @param options the list of confirmation options.
*
* @param defaultOption the default option, represented as an index
* into the {@code options} array.
@@ -384,8 +376,6 @@
/**
* Get the prompt.
*
- * <p>
- *
* @return the prompt, or null if this {@code ConfirmationCallback}
* was instantiated without a {@code prompt}.
*/
@@ -396,8 +386,6 @@
/**
* Get the message type.
*
- * <p>
- *
* @return the message type ({@code INFORMATION},
* {@code WARNING} or {@code ERROR}).
*/
@@ -414,8 +402,6 @@
* In this case, invoke the {@code getOptions} method
* to determine which confirmation options to display.
*
- * <p>
- *
* @return the option type ({@code YES_NO_OPTION},
* {@code YES_NO_CANCEL_OPTION} or
* {@code OK_CANCEL_OPTION}), or
@@ -430,8 +416,6 @@
/**
* Get the confirmation options.
*
- * <p>
- *
* @return the list of confirmation options, or null if this
* {@code ConfirmationCallback} was instantiated with
* an {@code optionType} instead of {@code options}.
@@ -443,8 +427,6 @@
/**
* Get the default option.
*
- * <p>
- *
* @return the default option, represented as
* {@code YES}, {@code NO}, {@code OK} or
* {@code CANCEL} if an {@code optionType}
@@ -462,8 +444,6 @@
/**
* Set the selected confirmation option.
*
- * <p>
- *
* @param selection the selection represented as {@code YES},
* {@code NO}, {@code OK} or {@code CANCEL}
* if an {@code optionType} was specified to the constructor
@@ -481,8 +461,6 @@
/**
* Get the selected confirmation option.
*
- * <p>
- *
* @return the selected confirmation option represented as
* {@code YES}, {@code NO}, {@code OK} or
* {@code CANCEL} if an {@code optionType}
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,8 +53,6 @@
/**
* Set the retrieved {@code Locale}.
*
- * <p>
- *
* @param locale the retrieved {@code Locale}.
*
* @see #getLocale
@@ -66,8 +64,6 @@
/**
* Get the retrieved {@code Locale}.
*
- * <p>
- *
* @return the retrieved {@code Locale}, or null
* if no {@code Locale} could be retrieved.
*
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -55,8 +55,6 @@
/**
* Construct a {@code NameCallback} with a prompt.
*
- * <p>
- *
* @param prompt the prompt used to request the name.
*
* @exception IllegalArgumentException if {@code prompt} is null
@@ -72,9 +70,7 @@
* Construct a {@code NameCallback} with a prompt
* and default name.
*
- * <p>
- *
- * @param prompt the prompt used to request the information. <p>
+ * @param prompt the prompt used to request the information.
*
* @param defaultName the name to be used as the default name displayed
* with the prompt.
@@ -96,8 +92,6 @@
/**
* Get the prompt.
*
- * <p>
- *
* @return the prompt.
*/
public String getPrompt() {
@@ -107,8 +101,6 @@
/**
* Get the default name.
*
- * <p>
- *
* @return the default name, or null if this {@code NameCallback}
* was not instantiated with a {@code defaultName}.
*/
@@ -119,8 +111,6 @@
/**
* Set the retrieved name.
*
- * <p>
- *
* @param name the retrieved name (which may be null).
*
* @see #getName
@@ -132,8 +122,6 @@
/**
* Get the retrieved name.
*
- * <p>
- *
* @return the retrieved name (which may be null)
*
* @see #setName
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -57,9 +57,7 @@
* and a boolean specifying whether the password should be displayed
* as it is being typed.
*
- * <p>
- *
- * @param prompt the prompt used to request the password. <p>
+ * @param prompt the prompt used to request the password.
*
* @param echoOn true if the password should be displayed
* as it is being typed.
@@ -78,8 +76,6 @@
/**
* Get the prompt.
*
- * <p>
- *
* @return the prompt.
*/
public String getPrompt() {
@@ -90,8 +86,6 @@
* Return whether the password
* should be displayed as it is being typed.
*
- * <p>
- *
* @return the whether the password
* should be displayed as it is being typed.
*/
@@ -102,11 +96,9 @@
/**
* Set the retrieved password.
*
- * <p> This method makes a copy of the input <i>password</i>
+ * <p> This method makes a copy of the input {@code password}
* before storing it.
*
- * <p>
- *
* @param password the retrieved password, which may be null.
*
* @see #getPassword
@@ -120,8 +112,6 @@
*
* <p> This method returns a copy of the retrieved password.
*
- * <p>
- *
* @return the retrieved password, which may be null.
*
* @see #setPassword
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -56,8 +56,6 @@
/**
* Construct a {@code TextInputCallback} with a prompt.
*
- * <p>
- *
* @param prompt the prompt used to request the information.
*
* @exception IllegalArgumentException if {@code prompt} is null
@@ -73,9 +71,7 @@
* Construct a {@code TextInputCallback} with a prompt
* and default input value.
*
- * <p>
- *
- * @param prompt the prompt used to request the information. <p>
+ * @param prompt the prompt used to request the information.
*
* @param defaultText the text to be used as the default text displayed
* with the prompt.
@@ -97,8 +93,6 @@
/**
* Get the prompt.
*
- * <p>
- *
* @return the prompt.
*/
public String getPrompt() {
@@ -108,8 +102,6 @@
/**
* Get the default text.
*
- * <p>
- *
* @return the default text, or null if this {@code TextInputCallback}
* was not instantiated with {@code defaultText}.
*/
@@ -120,8 +112,6 @@
/**
* Set the retrieved text.
*
- * <p>
- *
* @param text the retrieved text, which may be null.
*
* @see #getText
@@ -133,8 +123,6 @@
/**
* Get the retrieved text.
*
- * <p>
- *
* @return the retrieved text, which may be null.
*
* @see #setText
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -59,12 +59,10 @@
* Construct a TextOutputCallback with a message type and message
* to be displayed.
*
- * <p>
+ * @param messageType the message type ({@code INFORMATION},
+ * {@code WARNING} or {@code ERROR}).
*
- * @param messageType the message type ({@code INFORMATION},
- * {@code WARNING} or {@code ERROR}). <p>
- *
- * @param message the message to be displayed. <p>
+ * @param message the message to be displayed.
*
* @exception IllegalArgumentException if {@code messageType}
* is not either {@code INFORMATION},
@@ -85,8 +83,6 @@
/**
* Get the message type.
*
- * <p>
- *
* @return the message type ({@code INFORMATION},
* {@code WARNING} or {@code ERROR}).
*/
@@ -97,8 +93,6 @@
/**
* Get the message to be displayed.
*
- * <p>
- *
* @return the message to be displayed.
*/
public String getMessage() {
--- a/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -43,8 +43,6 @@
* Constructs a {@code UnsupportedCallbackException}
* with no detail message.
*
- * <p>
- *
* @param callback the unrecognized {@code Callback}.
*/
public UnsupportedCallbackException(Callback callback) {
@@ -57,9 +55,7 @@
* message. A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
- * @param callback the unrecognized {@code Callback}. <p>
+ * @param callback the unrecognized {@code Callback}.
*
* @param msg the detail message.
*/
@@ -71,8 +67,6 @@
/**
* Get the unrecognized {@code Callback}.
*
- * <p>
- *
* @return the unrecognized {@code Callback}.
*/
public Callback getCallback() {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -47,8 +47,6 @@
* A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public AccountException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,8 +53,6 @@
* message. A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public AccountExpiredException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountLockedException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountLockedException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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,8 +51,6 @@
* detail message. A detail message is a String that describes
* this particular exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public AccountLockedException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountNotFoundException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountNotFoundException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -50,8 +50,6 @@
* detail message. A detail message is a String that describes
* this particular exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public AccountNotFoundException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -57,10 +57,10 @@
*
* @param loginModuleName String representing the class name of the
* {@code LoginModule} configured for the
- * specified application. <p>
+ * specified application.
*
* @param controlFlag either REQUIRED, REQUISITE, SUFFICIENT,
- * or OPTIONAL. <p>
+ * or OPTIONAL.
*
* @param options the options configured for this {@code LoginModule}.
*
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -209,8 +209,6 @@
/**
* Get the installed login Configuration.
*
- * <p>
- *
* @return the login Configuration. If a Configuration object was set
* via the {@code Configuration.setConfiguration} method,
* then that object is returned. Otherwise, a default
@@ -287,8 +285,6 @@
/**
* Set the login {@code Configuration}.
*
- * <p>
- *
* @param configuration the new {@code Configuration}
*
* @exception SecurityException if the current thread does not have
@@ -546,16 +542,14 @@
}
/**
- * Retrieve the AppConfigurationEntries for the specified <i>name</i>
+ * Retrieve the AppConfigurationEntries for the specified {@code name}
* from this Configuration.
*
- * <p>
- *
* @param name the name used to index the Configuration.
*
- * @return an array of AppConfigurationEntries for the specified <i>name</i>
+ * @return an array of AppConfigurationEntries for the specified {@code name}
* from this Configuration, or null if there are no entries
- * for the specified <i>name</i>
+ * for the specified {@code name}
*/
public abstract AppConfigurationEntry[] getAppConfigurationEntry
(String name);
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/ConfigurationSpi.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/ConfigurationSpi.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -44,14 +44,12 @@
public abstract class ConfigurationSpi {
/**
- * Retrieve the AppConfigurationEntries for the specified <i>name</i>.
- *
- * <p>
+ * Retrieve the AppConfigurationEntries for the specified {@code name}.
*
* @param name the name used to index the Configuration.
*
* @return an array of AppConfigurationEntries for the specified
- * <i>name</i>, or null if there are no entries.
+ * {@code name}, or null if there are no entries.
*/
protected abstract AppConfigurationEntry[] engineGetAppConfigurationEntry
(String name);
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -47,8 +47,6 @@
* A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public CredentialException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -55,8 +55,6 @@
* message. A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public CredentialExpiredException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialNotFoundException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialNotFoundException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -50,8 +50,6 @@
* detail message. A detail message is a String that describes
* this particular exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public CredentialNotFoundException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -50,8 +50,6 @@
* message. A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public FailedLoginException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -108,7 +108,6 @@
*
* <li> If the constructor does <b>not</b> have a Subject
* input parameter, the LoginContext instantiates a new Subject.
- * <p>
* </ul>
*
* <li> {@code Configuration}
@@ -150,7 +149,6 @@
* This means the caller context (stored when the LoginContext was created)
* must have sufficient permissions to perform any security-sensitive tasks
* that the modules may perform.
- * <p>
* </ul>
*
* <li> {@code CallbackHandler}
@@ -332,15 +330,15 @@
* @exception LoginException if the caller-specified {@code name}
* does not appear in the {@code Configuration}
* and there is no {@code Configuration} entry
- * for "<i>other</i>", or if the
- * <i>auth.login.defaultCallbackHandler</i>
+ * for "{@code other}", or if the
+ * {@code auth.login.defaultCallbackHandler}
* security property was set, but the implementation
* class could not be loaded.
- * <p>
+ *
* @exception SecurityException if a SecurityManager is set and
* the caller does not have
* AuthPermission("createLoginContext.<i>name</i>"),
- * or if a configuration entry for <i>name</i> does not exist and
+ * or if a configuration entry for {@code name} does not exist and
* the caller does not additionally have
* AuthPermission("createLoginContext.other")
*/
@@ -353,10 +351,8 @@
* Instantiate a new {@code LoginContext} object with a name
* and a {@code Subject} object.
*
- * <p>
- *
* @param name the name used as the index into the
- * {@code Configuration}. <p>
+ * {@code Configuration}.
*
* @param subject the {@code Subject} to authenticate.
*
@@ -368,7 +364,7 @@
* <i>auth.login.defaultCallbackHandler</i>
* security property was set, but the implementation
* class could not be loaded.
- * <p>
+ *
* @exception SecurityException if a SecurityManager is set and
* the caller does not have
* AuthPermission("createLoginContext.<i>name</i>"),
@@ -391,10 +387,8 @@
* Instantiate a new {@code LoginContext} object with a name
* and a {@code CallbackHandler} object.
*
- * <p>
- *
* @param name the name used as the index into the
- * {@code Configuration}. <p>
+ * {@code Configuration}.
*
* @param callbackHandler the {@code CallbackHandler} object used by
* LoginModules to communicate with the user.
@@ -402,9 +396,9 @@
* @exception LoginException if the caller-specified {@code name}
* does not appear in the {@code Configuration}
* and there is no {@code Configuration} entry
- * for "<i>other</i>", or if the caller-specified
+ * for "{@code other}", or if the caller-specified
* {@code callbackHandler} is {@code null}.
- * <p>
+ *
* @exception SecurityException if a SecurityManager is set and
* the caller does not have
* AuthPermission("createLoginContext.<i>name</i>"),
@@ -428,12 +422,10 @@
* a {@code Subject} to be authenticated, and a
* {@code CallbackHandler} object.
*
- * <p>
+ * @param name the name used as the index into the
+ * {@code Configuration}.
*
- * @param name the name used as the index into the
- * {@code Configuration}. <p>
- *
- * @param subject the {@code Subject} to authenticate. <p>
+ * @param subject the {@code Subject} to authenticate.
*
* @param callbackHandler the {@code CallbackHandler} object used by
* LoginModules to communicate with the user.
@@ -445,7 +437,7 @@
* {@code subject} is {@code null},
* or if the caller-specified
* {@code callbackHandler} is {@code null}.
- * <p>
+ *
* @exception SecurityException if a SecurityManager is set and
* the caller does not have
* AuthPermission("createLoginContext.<i>name</i>"),
@@ -467,20 +459,16 @@
/**
* Instantiate a new {@code LoginContext} object with a name,
* a {@code Subject} to be authenticated,
- * a {@code CallbackHandler} object, and a login
- * {@code Configuration}.
- *
- * <p>
+ * a {@code CallbackHandler} object, and a login {@code Configuration}.
*
* @param name the name used as the index into the caller-specified
- * {@code Configuration}. <p>
+ * {@code Configuration}.
*
* @param subject the {@code Subject} to authenticate,
- * or {@code null}. <p>
+ * or {@code null}.
*
* @param callbackHandler the {@code CallbackHandler} object used by
* LoginModules to communicate with the user, or {@code null}.
- * <p>
*
* @param config the {@code Configuration} that lists the
* login modules to be called to perform the authentication,
@@ -490,7 +478,7 @@
* does not appear in the {@code Configuration}
* and there is no {@code Configuration} entry
* for "<i>other</i>".
- * <p>
+ *
* @exception SecurityException if a SecurityManager is set,
* <i>config</i> is {@code null},
* and either the caller does not have
@@ -570,8 +558,6 @@
* {@code abort} phase. This guarantees that proper cleanup
* and state restoration can take place.
*
- * <p>
- *
* @exception LoginException if the authentication fails.
*/
public void login() throws LoginException {
@@ -614,8 +600,6 @@
* ignored for this method. This guarantees that proper cleanup
* and state restoration can take place.
*
- * <p>
- *
* @exception LoginException if the logout fails.
*/
public void logout() throws LoginException {
@@ -631,8 +615,6 @@
/**
* Return the authenticated Subject.
*
- * <p>
- *
* @return the authenticated Subject. If the caller specified a
* Subject to this LoginContext's constructor,
* this method returns the caller-specified Subject.
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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,8 +48,6 @@
* A detail message is a String that describes this particular
* exception.
*
- * <p>
- *
* @param msg the detail message.
*/
public LoginException(String msg) {
--- a/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -139,15 +139,13 @@
* any of the data stored in {@code sharedState} or
* {@code options} parameters, they can be ignored.
*
- * <p>
- *
- * @param subject the {@code Subject} to be authenticated. <p>
+ * @param subject the {@code Subject} to be authenticated.
*
* @param callbackHandler a {@code CallbackHandler} for communicating
* with the end user (prompting for usernames and
- * passwords, for example). <p>
+ * passwords, for example).
*
- * @param sharedState state shared with other configured LoginModules. <p>
+ * @param sharedState state shared with other configured LoginModules.
*
* @param options options specified in the login
* {@code Configuration} for this particular
@@ -167,8 +165,6 @@
* This method saves the result of the authentication attempt
* as private state within the LoginModule.
*
- * <p>
- *
* @exception LoginException if the authentication fails
*
* @return true if the authentication succeeded, or false if this
@@ -192,8 +188,6 @@
* authentication attempted failed, then this method removes/destroys
* any state that was originally saved.
*
- * <p>
- *
* @exception LoginException if the commit fails
*
* @return true if this method succeeded, or false if this
@@ -214,8 +208,6 @@
* {@code login} method), then this method cleans up any state
* that was originally saved.
*
- * <p>
- *
* @exception LoginException if the abort fails
*
* @return true if this method succeeded, or false if this
@@ -229,8 +221,6 @@
* <p>An implementation of this method might remove/destroy a Subject's
* Principals and Credentials.
*
- * <p>
- *
* @exception LoginException if the logout fails
*
* @return true if this method succeeded, or false if this
--- a/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -45,7 +45,7 @@
/**
* Creates an X500PrivateCredential that associates an X.509 certificate,
* a private key and the KeyStore alias.
- * <p>
+ *
* @param cert X509Certificate
* @param key PrivateKey for the certificate
* @exception IllegalArgumentException if either {@code cert} or
@@ -64,7 +64,7 @@
/**
* Creates an X500PrivateCredential that associates an X.509 certificate,
* a private key and the KeyStore alias.
- * <p>
+ *
* @param cert X509Certificate
* @param key PrivateKey for the certificate
* @param alias KeyStore alias
@@ -83,7 +83,7 @@
/**
* Returns the X.509 certificate.
- * <p>
+ *
* @return the X509Certificate
*/
@@ -93,7 +93,7 @@
/**
* Returns the PrivateKey.
- * <p>
+ *
* @return the PrivateKey
*/
public PrivateKey getPrivateKey() {
@@ -102,7 +102,7 @@
/**
* Returns the KeyStore alias.
- * <p>
+ *
* @return the KeyStore alias
*/
@@ -124,7 +124,7 @@
/**
* Determines if the references to the X.509 certificate and private key
* in this object have been cleared.
- * <p>
+ *
* @return true if X509Certificate and the PrivateKey are null
*/
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -670,6 +670,38 @@
return signerCert; // set in verify()
}
+ /**
+ * Build a String-Extension map from DER encoded data.
+ * @param derVal A {@code DerValue} object built from a SEQUENCE of
+ * extensions
+ *
+ * @return A {@code Map} using the OID in string form as the keys. If no
+ * extensions are found or an empty SEQUENCE is passed in, then
+ * an empty {@code Map} will be returned.
+ *
+ * @throws IOException if any decoding errors occur.
+ */
+ private static Map<String, java.security.cert.Extension>
+ parseExtensions(DerValue derVal) throws IOException {
+ DerValue[] extDer = derVal.data.getSequence(3);
+ Map<String, java.security.cert.Extension> extMap =
+ new HashMap<>(extDer.length);
+
+ for (DerValue extDerVal : extDer) {
+ Extension ext = new Extension(extDerVal);
+ // We don't support any extensions yet. Therefore, if it
+ // is critical we must throw an exception because we
+ // don't know how to process it.
+ if (ext.isCritical()) {
+ throw new IOException("Unsupported OCSP critical extension: " +
+ ext.getExtensionId());
+ }
+ extMap.put(ext.getId(), ext);
+ }
+
+ return extMap;
+ }
+
/*
* A class representing a single OCSP response.
*/
@@ -718,7 +750,7 @@
}
} else {
revocationTime = null;
- revocationReason = CRLReason.UNSPECIFIED;
+ revocationReason = null;
if (tag == CERT_STATUS_GOOD) {
certStatus = CertStatus.GOOD;
} else if (tag == CERT_STATUS_UNKNOWN) {
@@ -729,55 +761,59 @@
}
thisUpdate = tmp.getGeneralizedTime();
-
- if (tmp.available() == 0) {
- // we are done
- nextUpdate = null;
- } else {
- derVal = tmp.getDerValue();
- tag = (byte)(derVal.tag & 0x1f);
- if (tag == 0) {
- // next update
- nextUpdate = derVal.data.getGeneralizedTime();
+ if (debug != null) {
+ debug.println("thisUpdate: " + thisUpdate);
+ }
- if (tmp.available() == 0) {
- // we are done
- } else {
- derVal = tmp.getDerValue();
- tag = (byte)(derVal.tag & 0x1f);
- }
- } else {
- nextUpdate = null;
- }
- }
- // singleExtensions
+ // Parse optional fields like nextUpdate and singleExtensions
+ Date tmpNextUpdate = null;
+ Map<String, java.security.cert.Extension> tmpMap = null;
+
+ // Check for the first optional item, it could be nextUpdate
+ // [CONTEXT 0] or singleExtensions [CONTEXT 1]
if (tmp.available() > 0) {
derVal = tmp.getDerValue();
- if (derVal.isContextSpecific((byte)1)) {
- DerValue[] singleExtDer = derVal.data.getSequence(3);
- singleExtensions =
- new HashMap<String, java.security.cert.Extension>
- (singleExtDer.length);
- for (int i = 0; i < singleExtDer.length; i++) {
- Extension ext = new Extension(singleExtDer[i]);
- if (debug != null) {
- debug.println("OCSP single extension: " + ext);
+
+ // nextUpdate processing
+ if (derVal.isContextSpecific((byte)0)) {
+ tmpNextUpdate = derVal.data.getGeneralizedTime();
+ if (debug != null) {
+ debug.println("nextUpdate: " + tmpNextUpdate);
+ }
+
+ // If more data exists in the singleResponse, it
+ // can only be singleExtensions. Get this DER value
+ // for processing in the next block
+ derVal = tmp.available() > 0 ? tmp.getDerValue() : null;
+ }
+
+ // singleExtensions processing
+ if (derVal != null) {
+ if (derVal.isContextSpecific((byte)1)) {
+ tmpMap = parseExtensions(derVal);
+
+ // There should not be any other items in the
+ // singleResponse at this point.
+ if (tmp.available() > 0) {
+ throw new IOException(tmp.available() +
+ " bytes of additional data in singleResponse");
}
- // We don't support any extensions yet. Therefore, if it
- // is critical we must throw an exception because we
- // don't know how to process it.
- if (ext.isCritical()) {
- throw new IOException(
- "Unsupported OCSP critical extension: " +
- ext.getExtensionId());
- }
- singleExtensions.put(ext.getId(), ext);
+ } else {
+ // Unknown item in the singleResponse
+ throw new IOException("Unsupported singleResponse " +
+ "item, tag = " + String.format("%02X", derVal.tag));
}
- } else {
- singleExtensions = Collections.emptyMap();
}
- } else {
- singleExtensions = Collections.emptyMap();
+ }
+
+ nextUpdate = tmpNextUpdate;
+ singleExtensions = (tmpMap != null) ? tmpMap :
+ Collections.emptyMap();
+ if (debug != null) {
+ for (java.security.cert.Extension ext :
+ singleExtensions.values()) {
+ debug.println("singleExtension: " + ext);
+ }
}
}
@@ -793,7 +829,8 @@
}
@Override public Date getRevocationTime() {
- return (Date) revocationTime.clone();
+ return (revocationTime != null ? (Date) revocationTime.clone() :
+ null);
}
@Override public CRLReason getRevocationReason() {
@@ -821,6 +858,9 @@
if (nextUpdate != null) {
sb.append("nextUpdate is " + nextUpdate + "\n");
}
+ for (java.security.cert.Extension ext : singleExtensions.values()) {
+ sb.append("singleExtension: " + ext + "\n");
+ }
return sb.toString();
}
}
--- a/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -257,7 +257,7 @@
throw new NoSuchAlgorithmException("Unsupported cipher " + cipher);
}
- if (cipher == B_NULL) {
+ if (cipher == BulkCipher.B_NULL) {
return NULL;
} else {
return new CipherBox(version, cipher, key, iv, random, encrypt);
--- a/jdk/src/java.base/share/classes/sun/security/ssl/CipherSuite.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherSuite.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -41,6 +41,8 @@
import static sun.security.ssl.CipherSuite.KeyExchange.*;
import static sun.security.ssl.CipherSuite.PRF.*;
import static sun.security.ssl.CipherSuite.CipherType.*;
+import static sun.security.ssl.CipherSuite.MacAlg.*;
+import static sun.security.ssl.CipherSuite.BulkCipher.*;
import static sun.security.ssl.JsseJce.*;
/**
@@ -129,33 +131,15 @@
* Constructor for implemented CipherSuites.
*/
private CipherSuite(String name, int id, int priority,
- KeyExchange keyExchange, BulkCipher cipher,
+ KeyExchange keyExchange, BulkCipher cipher, MacAlg mac,
boolean allowed, int obsoleted, int supported, PRF prfAlg) {
this.name = name;
this.id = id;
this.priority = priority;
this.keyExchange = keyExchange;
this.cipher = cipher;
+ this.macAlg = mac;
this.exportable = cipher.exportable;
- if (cipher.cipherType == CipherType.AEAD_CIPHER) {
- macAlg = M_NULL;
- } else if (name.endsWith("_MD5")) {
- macAlg = M_MD5;
- } else if (name.endsWith("_SHA")) {
- macAlg = M_SHA;
- } else if (name.endsWith("_SHA256")) {
- macAlg = M_SHA256;
- } else if (name.endsWith("_SHA384")) {
- macAlg = M_SHA384;
- } else if (name.endsWith("_NULL")) {
- macAlg = M_NULL;
- } else if (name.endsWith("_SCSV")) {
- macAlg = M_NULL;
- } else {
- throw new IllegalArgumentException
- ("Unknown MAC algorithm for ciphersuite " + name);
- }
-
allowed &= keyExchange.allowed;
allowed &= cipher.allowed;
this.allowed = allowed;
@@ -269,11 +253,11 @@
* TLS 1.2+ that doesn't use the "default" PRF.
*/
private static void add(String name, int id, int priority,
- KeyExchange keyExchange, BulkCipher cipher,
+ KeyExchange keyExchange, BulkCipher cipher, MacAlg mac,
boolean allowed, int obsoleted, int supported, PRF prf) {
CipherSuite c = new CipherSuite(name, id, priority, keyExchange,
- cipher, allowed, obsoleted, supported, prf);
+ cipher, mac, allowed, obsoleted, supported, prf);
if (idMap.put(id, c) != null) {
throw new RuntimeException("Duplicate ciphersuite definition: "
+ id + ", " + name);
@@ -294,16 +278,13 @@
* All cipher suites in this document use P_SHA256.
*/
private static void add(String name, int id, int priority,
- KeyExchange keyExchange, BulkCipher cipher,
+ KeyExchange keyExchange, BulkCipher cipher, MacAlg mac,
boolean allowed, int obsoleted) {
// If this is an obsoleted suite, then don't let the TLS 1.2
// protocol have a valid PRF value.
- PRF prf = P_SHA256;
- if (obsoleted < ProtocolVersion.TLS12.v) {
- prf = P_NONE;
- }
+ PRF prf = obsoleted < ProtocolVersion.TLS12.v ? P_NONE : P_SHA256;
- add(name, id, priority, keyExchange, cipher, allowed, obsoleted,
+ add(name, id, priority, keyExchange, cipher, mac, allowed, obsoleted,
ProtocolVersion.LIMIT_MIN_VALUE, prf);
}
@@ -312,9 +293,10 @@
* suites which have not been obsoleted.
*/
private static void add(String name, int id, int priority,
- KeyExchange keyExchange, BulkCipher cipher, boolean allowed) {
- add(name, id, priority, keyExchange,
- cipher, allowed, ProtocolVersion.LIMIT_MAX_VALUE);
+ KeyExchange keyExchange, BulkCipher cipher, MacAlg mac,
+ boolean allowed) {
+ add(name, id, priority, keyExchange, cipher, mac, allowed,
+ ProtocolVersion.LIMIT_MAX_VALUE);
}
/*
@@ -402,7 +384,23 @@
* Also contains a factory method to obtain in initialized CipherBox
* for this algorithm.
*/
- final static class BulkCipher {
+ static enum BulkCipher {
+
+ // export strength ciphers
+ B_NULL("NULL", STREAM_CIPHER, 0, 0, 0, 0, true),
+ B_RC4_40(CIPHER_RC4, STREAM_CIPHER, 5, 16, 0, 0, true),
+ B_RC2_40("RC2", BLOCK_CIPHER, 5, 16, 8, 0, false),
+ B_DES_40(CIPHER_DES, BLOCK_CIPHER, 5, 8, 8, 0, true),
+
+ // domestic strength ciphers
+ B_RC4_128(CIPHER_RC4, STREAM_CIPHER, 16, 0, 0, true),
+ B_DES(CIPHER_DES, BLOCK_CIPHER, 8, 8, 0, true),
+ B_3DES(CIPHER_3DES, BLOCK_CIPHER, 24, 8, 0, true),
+ B_IDEA("IDEA", BLOCK_CIPHER, 16, 8, 0, false),
+ B_AES_128(CIPHER_AES, BLOCK_CIPHER, 16, 16, 0, true),
+ B_AES_256(CIPHER_AES, BLOCK_CIPHER, 32, 16, 0, true),
+ B_AES_128_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 16, 12, 4, true),
+ B_AES_256_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 32, 12, 4, true);
// Map BulkCipher -> Boolean(available)
private final static Map<BulkCipher,Boolean> availableCache =
@@ -600,7 +598,13 @@
* Also contains a factory method to obtain an initialized MAC
* for this algorithm.
*/
- final static class MacAlg {
+ static enum MacAlg {
+ // MACs
+ M_NULL ("NULL", 0, 0, 0),
+ M_MD5 ("MD5", 16, 64, 9),
+ M_SHA ("SHA", 20, 64, 9),
+ M_SHA256 ("SHA256", 32, 64, 9),
+ M_SHA384 ("SHA384", 48, 128, 17);
// descriptive name, e.g. MD5
final String name;
@@ -639,41 +643,6 @@
}
}
- // export strength ciphers
- final static BulkCipher B_NULL =
- new BulkCipher("NULL", STREAM_CIPHER, 0, 0, 0, 0, true);
- final static BulkCipher B_RC4_40 =
- new BulkCipher(CIPHER_RC4, STREAM_CIPHER, 5, 16, 0, 0, true);
- final static BulkCipher B_RC2_40 =
- new BulkCipher("RC2", BLOCK_CIPHER, 5, 16, 8, 0, false);
- final static BulkCipher B_DES_40 =
- new BulkCipher(CIPHER_DES, BLOCK_CIPHER, 5, 8, 8, 0, true);
-
- // domestic strength ciphers
- final static BulkCipher B_RC4_128 =
- new BulkCipher(CIPHER_RC4, STREAM_CIPHER, 16, 0, 0, true);
- final static BulkCipher B_DES =
- new BulkCipher(CIPHER_DES, BLOCK_CIPHER, 8, 8, 0, true);
- final static BulkCipher B_3DES =
- new BulkCipher(CIPHER_3DES, BLOCK_CIPHER, 24, 8, 0, true);
- final static BulkCipher B_IDEA =
- new BulkCipher("IDEA", BLOCK_CIPHER, 16, 8, 0, false);
- final static BulkCipher B_AES_128 =
- new BulkCipher(CIPHER_AES, BLOCK_CIPHER, 16, 16, 0, true);
- final static BulkCipher B_AES_256 =
- new BulkCipher(CIPHER_AES, BLOCK_CIPHER, 32, 16, 0, true);
- final static BulkCipher B_AES_128_GCM =
- new BulkCipher(CIPHER_AES_GCM, AEAD_CIPHER, 16, 12, 4, true);
- final static BulkCipher B_AES_256_GCM =
- new BulkCipher(CIPHER_AES_GCM, AEAD_CIPHER, 32, 12, 4, true);
-
- // MACs
- final static MacAlg M_NULL = new MacAlg("NULL", 0, 0, 0);
- final static MacAlg M_MD5 = new MacAlg("MD5", 16, 64, 9);
- final static MacAlg M_SHA = new MacAlg("SHA", 20, 64, 9);
- final static MacAlg M_SHA256 = new MacAlg("SHA256", 32, 64, 9);
- final static MacAlg M_SHA384 = new MacAlg("SHA384", 48, 128, 17);
-
/**
* PRFs (PseudoRandom Function) from TLS specifications.
*
@@ -958,8 +927,8 @@
* 0xFF,0x00-FF Reserved for Private Use [RFC5246]
*/
- add("SSL_NULL_WITH_NULL_NULL",
- 0x0000, 1, K_NULL, B_NULL, F);
+ add("SSL_NULL_WITH_NULL_NULL", 0x0000,
+ 1, K_NULL, B_NULL, M_NULL, F);
/*
* Definition of the CipherSuites that are enabled by default.
@@ -992,134 +961,134 @@
// of RFC 6460. In this section, only two cipher suites are listed
// so that applications can make use of Suite-B compliant cipher
// suite firstly.
- add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
- 0xc02c, --p, K_ECDHE_ECDSA, B_AES_256_GCM, T, max, tls12, P_SHA384);
- add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
- 0xc02b, --p, K_ECDHE_ECDSA, B_AES_128_GCM, T, max, tls12, P_SHA256);
+ add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 0xc02c, --p,
+ K_ECDHE_ECDSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
+ add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 0xc02b, --p,
+ K_ECDHE_ECDSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
// AES_256(GCM)
- add("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
- 0xc030, --p, K_ECDHE_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384);
- add("TLS_RSA_WITH_AES_256_GCM_SHA384",
- 0x009d, --p, K_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384);
- add("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
- 0xc02e, --p, K_ECDH_ECDSA, B_AES_256_GCM, T, max, tls12, P_SHA384);
- add("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
- 0xc032, --p, K_ECDH_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384);
- add("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
- 0x009f, --p, K_DHE_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384);
- add("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
- 0x00a3, --p, K_DHE_DSS, B_AES_256_GCM, T, max, tls12, P_SHA384);
+ add("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 0xc030, --p,
+ K_ECDHE_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
+ add("TLS_RSA_WITH_AES_256_GCM_SHA384", 0x009d, --p,
+ K_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
+ add("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 0xc02e, --p,
+ K_ECDH_ECDSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
+ add("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 0xc032, --p,
+ K_ECDH_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
+ add("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 0x009f, --p,
+ K_DHE_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
+ add("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 0x00a3, --p,
+ K_DHE_DSS, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384);
// AES_128(GCM)
- add("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
- 0xc02f, --p, K_ECDHE_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256);
- add("TLS_RSA_WITH_AES_128_GCM_SHA256",
- 0x009c, --p, K_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256);
- add("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
- 0xc02d, --p, K_ECDH_ECDSA, B_AES_128_GCM, T, max, tls12, P_SHA256);
- add("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
- 0xc031, --p, K_ECDH_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256);
- add("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
- 0x009e, --p, K_DHE_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256);
- add("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
- 0x00a2, --p, K_DHE_DSS, B_AES_128_GCM, T, max, tls12, P_SHA256);
+ add("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 0xc02f, --p,
+ K_ECDHE_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
+ add("TLS_RSA_WITH_AES_128_GCM_SHA256", 0x009c, --p,
+ K_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
+ add("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 0xc02d, --p,
+ K_ECDH_ECDSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
+ add("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 0xc031, --p,
+ K_ECDH_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
+ add("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 0x009e, --p,
+ K_DHE_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
+ add("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 0x00a2, --p,
+ K_DHE_DSS, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256);
// AES_256(CBC)
- add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
- 0xc024, --p, K_ECDHE_ECDSA, B_AES_256, T, max, tls12, P_SHA384);
- add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
- 0xc028, --p, K_ECDHE_RSA, B_AES_256, T, max, tls12, P_SHA384);
- add("TLS_RSA_WITH_AES_256_CBC_SHA256",
- 0x003d, --p, K_RSA, B_AES_256, T, max, tls12, P_SHA256);
- add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
- 0xc026, --p, K_ECDH_ECDSA, B_AES_256, T, max, tls12, P_SHA384);
- add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
- 0xc02a, --p, K_ECDH_RSA, B_AES_256, T, max, tls12, P_SHA384);
- add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
- 0x006b, --p, K_DHE_RSA, B_AES_256, T, max, tls12, P_SHA256);
- add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
- 0x006a, --p, K_DHE_DSS, B_AES_256, T, max, tls12, P_SHA256);
+ add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0xc024, --p,
+ K_ECDHE_ECDSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384);
+ add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0xc028, --p,
+ K_ECDHE_RSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384);
+ add("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x003d, --p,
+ K_RSA, B_AES_256, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0xc026, --p,
+ K_ECDH_ECDSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384);
+ add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0xc02a, --p,
+ K_ECDH_RSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384);
+ add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x006b, --p,
+ K_DHE_RSA, B_AES_256, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x006a, --p,
+ K_DHE_DSS, B_AES_256, M_SHA256, T, max, tls12, P_SHA256);
- add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
- 0xC00A, --p, K_ECDHE_ECDSA, B_AES_256, T);
- add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
- 0xC014, --p, K_ECDHE_RSA, B_AES_256, T);
- add("TLS_RSA_WITH_AES_256_CBC_SHA",
- 0x0035, --p, K_RSA, B_AES_256, T);
- add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
- 0xC005, --p, K_ECDH_ECDSA, B_AES_256, T);
- add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
- 0xC00F, --p, K_ECDH_RSA, B_AES_256, T);
- add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
- 0x0039, --p, K_DHE_RSA, B_AES_256, T);
- add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
- 0x0038, --p, K_DHE_DSS, B_AES_256, T);
+ add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", 0xC00A, --p,
+ K_ECDHE_ECDSA, B_AES_256, M_SHA, T);
+ add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", 0xC014, --p,
+ K_ECDHE_RSA, B_AES_256, M_SHA, T);
+ add("TLS_RSA_WITH_AES_256_CBC_SHA", 0x0035, --p,
+ K_RSA, B_AES_256, M_SHA, T);
+ add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", 0xC005, --p,
+ K_ECDH_ECDSA, B_AES_256, M_SHA, T);
+ add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", 0xC00F, --p,
+ K_ECDH_RSA, B_AES_256, M_SHA, T);
+ add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA", 0x0039, --p,
+ K_DHE_RSA, B_AES_256, M_SHA, T);
+ add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA", 0x0038, --p,
+ K_DHE_DSS, B_AES_256, M_SHA, T);
// AES_128(CBC)
- add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
- 0xc023, --p, K_ECDHE_ECDSA, B_AES_128, T, max, tls12, P_SHA256);
- add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
- 0xc027, --p, K_ECDHE_RSA, B_AES_128, T, max, tls12, P_SHA256);
- add("TLS_RSA_WITH_AES_128_CBC_SHA256",
- 0x003c, --p, K_RSA, B_AES_128, T, max, tls12, P_SHA256);
- add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
- 0xc025, --p, K_ECDH_ECDSA, B_AES_128, T, max, tls12, P_SHA256);
- add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
- 0xc029, --p, K_ECDH_RSA, B_AES_128, T, max, tls12, P_SHA256);
- add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
- 0x0067, --p, K_DHE_RSA, B_AES_128, T, max, tls12, P_SHA256);
- add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
- 0x0040, --p, K_DHE_DSS, B_AES_128, T, max, tls12, P_SHA256);
+ add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0xc023, --p,
+ K_ECDHE_ECDSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0xc027, --p,
+ K_ECDHE_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x003c, --p,
+ K_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0xc025, --p,
+ K_ECDH_ECDSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0xc029, --p,
+ K_ECDH_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0067, --p,
+ K_DHE_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
+ add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0040, --p,
+ K_DHE_DSS, B_AES_128, M_SHA256, T, max, tls12, P_SHA256);
- add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
- 0xC009, --p, K_ECDHE_ECDSA, B_AES_128, T);
- add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
- 0xC013, --p, K_ECDHE_RSA, B_AES_128, T);
- add("TLS_RSA_WITH_AES_128_CBC_SHA",
- 0x002f, --p, K_RSA, B_AES_128, T);
- add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
- 0xC004, --p, K_ECDH_ECDSA, B_AES_128, T);
- add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
- 0xC00E, --p, K_ECDH_RSA, B_AES_128, T);
- add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
- 0x0033, --p, K_DHE_RSA, B_AES_128, T);
- add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
- 0x0032, --p, K_DHE_DSS, B_AES_128, T);
+ add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", 0xC009, --p,
+ K_ECDHE_ECDSA, B_AES_128, M_SHA, T);
+ add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", 0xC013, --p,
+ K_ECDHE_RSA, B_AES_128, M_SHA, T);
+ add("TLS_RSA_WITH_AES_128_CBC_SHA", 0x002f, --p,
+ K_RSA, B_AES_128, M_SHA, T);
+ add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", 0xC004, --p,
+ K_ECDH_ECDSA, B_AES_128, M_SHA, T);
+ add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", 0xC00E, --p,
+ K_ECDH_RSA, B_AES_128, M_SHA, T);
+ add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA", 0x0033, --p,
+ K_DHE_RSA, B_AES_128, M_SHA, T);
+ add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA", 0x0032, --p,
+ K_DHE_DSS, B_AES_128, M_SHA, T);
// 3DES_EDE
- add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
- 0xC008, --p, K_ECDHE_ECDSA, B_3DES, T);
- add("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
- 0xC012, --p, K_ECDHE_RSA, B_3DES, T);
- add("SSL_RSA_WITH_3DES_EDE_CBC_SHA",
- 0x000a, --p, K_RSA, B_3DES, T);
- add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
- 0xC003, --p, K_ECDH_ECDSA, B_3DES, T);
- add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
- 0xC00D, --p, K_ECDH_RSA, B_3DES, T);
- add("SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
- 0x0016, --p, K_DHE_RSA, B_3DES, T);
- add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
- 0x0013, --p, K_DHE_DSS, B_3DES, N);
+ add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", 0xC008, --p,
+ K_ECDHE_ECDSA, B_3DES, M_SHA, T);
+ add("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", 0xC012, --p,
+ K_ECDHE_RSA, B_3DES, M_SHA, T);
+ add("SSL_RSA_WITH_3DES_EDE_CBC_SHA", 0x000a, --p,
+ K_RSA, B_3DES, M_SHA, T);
+ add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", 0xC003, --p,
+ K_ECDH_ECDSA, B_3DES, M_SHA, T);
+ add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", 0xC00D, --p,
+ K_ECDH_RSA, B_3DES, M_SHA, T);
+ add("SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", 0x0016, --p,
+ K_DHE_RSA, B_3DES, M_SHA, T);
+ add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", 0x0013, --p,
+ K_DHE_DSS, B_3DES, M_SHA, N);
// RC-4
- add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
- 0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
- add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
- 0xC011, --p, K_ECDHE_RSA, B_RC4_128, N);
- add("SSL_RSA_WITH_RC4_128_SHA",
- 0x0005, --p, K_RSA, B_RC4_128, N);
- add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
- 0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N);
- add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
- 0xC00C, --p, K_ECDH_RSA, B_RC4_128, N);
- add("SSL_RSA_WITH_RC4_128_MD5",
- 0x0004, --p, K_RSA, B_RC4_128, N);
+ add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", 0xC007, --p,
+ K_ECDHE_ECDSA, B_RC4_128, M_SHA, N);
+ add("TLS_ECDHE_RSA_WITH_RC4_128_SHA", 0xC011, --p,
+ K_ECDHE_RSA, B_RC4_128, M_SHA, N);
+ add("SSL_RSA_WITH_RC4_128_SHA", 0x0005, --p,
+ K_RSA, B_RC4_128, M_SHA, N);
+ add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA", 0xC002, --p,
+ K_ECDH_ECDSA, B_RC4_128, M_SHA, N);
+ add("TLS_ECDH_RSA_WITH_RC4_128_SHA", 0xC00C, --p,
+ K_ECDH_RSA, B_RC4_128, M_SHA, N);
+ add("SSL_RSA_WITH_RC4_128_MD5", 0x0004, --p,
+ K_RSA, B_RC4_128, M_MD5, N);
// Renegotiation protection request Signalling Cipher Suite Value (SCSV)
- add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
- 0x00ff, --p, K_SCSV, B_NULL, T);
+ add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0x00ff, --p,
+ K_SCSV, B_NULL, M_NULL, T);
/*
* Definition of the CipherSuites that are supported but not enabled
@@ -1142,98 +1111,98 @@
*/
p = DEFAULT_SUITES_PRIORITY;
- add("TLS_DH_anon_WITH_AES_256_GCM_SHA384",
- 0x00a7, --p, K_DH_ANON, B_AES_256_GCM, N, max, tls12, P_SHA384);
- add("TLS_DH_anon_WITH_AES_128_GCM_SHA256",
- 0x00a6, --p, K_DH_ANON, B_AES_128_GCM, N, max, tls12, P_SHA256);
+ add("TLS_DH_anon_WITH_AES_256_GCM_SHA384", 0x00a7, --p,
+ K_DH_ANON, B_AES_256_GCM, M_NULL, N, max, tls12, P_SHA384);
+ add("TLS_DH_anon_WITH_AES_128_GCM_SHA256", 0x00a6, --p,
+ K_DH_ANON, B_AES_128_GCM, M_NULL, N, max, tls12, P_SHA256);
- add("TLS_DH_anon_WITH_AES_256_CBC_SHA256",
- 0x006d, --p, K_DH_ANON, B_AES_256, N, max, tls12, P_SHA256);
- add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
- 0xC019, --p, K_ECDH_ANON, B_AES_256, N);
- add("TLS_DH_anon_WITH_AES_256_CBC_SHA",
- 0x003a, --p, K_DH_ANON, B_AES_256, N);
+ add("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x006d, --p,
+ K_DH_ANON, B_AES_256, M_SHA256, N, max, tls12, P_SHA256);
+ add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA", 0xC019, --p,
+ K_ECDH_ANON, B_AES_256, M_SHA, N);
+ add("TLS_DH_anon_WITH_AES_256_CBC_SHA", 0x003a, --p,
+ K_DH_ANON, B_AES_256, M_SHA, N);
- add("TLS_DH_anon_WITH_AES_128_CBC_SHA256",
- 0x006c, --p, K_DH_ANON, B_AES_128, N, max, tls12, P_SHA256);
- add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
- 0xC018, --p, K_ECDH_ANON, B_AES_128, N);
- add("TLS_DH_anon_WITH_AES_128_CBC_SHA",
- 0x0034, --p, K_DH_ANON, B_AES_128, N);
+ add("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x006c, --p,
+ K_DH_ANON, B_AES_128, M_SHA256, N, max, tls12, P_SHA256);
+ add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA", 0xC018, --p,
+ K_ECDH_ANON, B_AES_128, M_SHA, N);
+ add("TLS_DH_anon_WITH_AES_128_CBC_SHA", 0x0034, --p,
+ K_DH_ANON, B_AES_128, M_SHA, N);
- add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
- 0xC017, --p, K_ECDH_ANON, B_3DES, N);
- add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
- 0x001b, --p, K_DH_ANON, B_3DES, N);
+ add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", 0xC017, --p,
+ K_ECDH_ANON, B_3DES, M_SHA, N);
+ add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", 0x001b, --p,
+ K_DH_ANON, B_3DES, M_SHA, N);
- add("TLS_ECDH_anon_WITH_RC4_128_SHA",
- 0xC016, --p, K_ECDH_ANON, B_RC4_128, N);
- add("SSL_DH_anon_WITH_RC4_128_MD5",
- 0x0018, --p, K_DH_ANON, B_RC4_128, N);
+ add("TLS_ECDH_anon_WITH_RC4_128_SHA", 0xC016, --p,
+ K_ECDH_ANON, B_RC4_128, M_SHA, N);
+ add("SSL_DH_anon_WITH_RC4_128_MD5", 0x0018, --p,
+ K_DH_ANON, B_RC4_128, M_MD5, N);
// weak cipher suites obsoleted in TLS 1.2
- add("SSL_RSA_WITH_DES_CBC_SHA",
- 0x0009, --p, K_RSA, B_DES, N, tls12);
- add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
- 0x0015, --p, K_DHE_RSA, B_DES, N, tls12);
- add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
- 0x0012, --p, K_DHE_DSS, B_DES, N, tls12);
- add("SSL_DH_anon_WITH_DES_CBC_SHA",
- 0x001a, --p, K_DH_ANON, B_DES, N, tls12);
+ add("SSL_RSA_WITH_DES_CBC_SHA", 0x0009, --p,
+ K_RSA, B_DES, M_SHA, N, tls12);
+ add("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0015, --p,
+ K_DHE_RSA, B_DES, M_SHA, N, tls12);
+ add("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0012, --p,
+ K_DHE_DSS, B_DES, M_SHA, N, tls12);
+ add("SSL_DH_anon_WITH_DES_CBC_SHA", 0x001a, --p,
+ K_DH_ANON, B_DES, M_SHA, N, tls12);
// weak cipher suites obsoleted in TLS 1.1
- add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
- 0x0008, --p, K_RSA_EXPORT, B_DES_40, N, tls11);
- add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
- 0x0014, --p, K_DHE_RSA, B_DES_40, N, tls11);
- add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
- 0x0011, --p, K_DHE_DSS, B_DES_40, N, tls11);
- add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
- 0x0019, --p, K_DH_ANON, B_DES_40, N, tls11);
+ add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0008, --p,
+ K_RSA_EXPORT, B_DES_40, M_SHA, N, tls11);
+ add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0014, --p,
+ K_DHE_RSA, B_DES_40, M_SHA, N, tls11);
+ add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0011, --p,
+ K_DHE_DSS, B_DES_40, M_SHA, N, tls11);
+ add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0019, --p,
+ K_DH_ANON, B_DES_40, M_SHA, N, tls11);
- add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
- 0x0003, --p, K_RSA_EXPORT, B_RC4_40, N, tls11);
- add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
- 0x0017, --p, K_DH_ANON, B_RC4_40, N, tls11);
+ add("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0003, --p,
+ K_RSA_EXPORT, B_RC4_40, M_MD5, N, tls11);
+ add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0017, --p,
+ K_DH_ANON, B_RC4_40, M_MD5, N, tls11);
- add("TLS_RSA_WITH_NULL_SHA256",
- 0x003b, --p, K_RSA, B_NULL, N, max, tls12, P_SHA256);
- add("TLS_ECDHE_ECDSA_WITH_NULL_SHA",
- 0xC006, --p, K_ECDHE_ECDSA, B_NULL, N);
- add("TLS_ECDHE_RSA_WITH_NULL_SHA",
- 0xC010, --p, K_ECDHE_RSA, B_NULL, N);
- add("SSL_RSA_WITH_NULL_SHA",
- 0x0002, --p, K_RSA, B_NULL, N);
- add("TLS_ECDH_ECDSA_WITH_NULL_SHA",
- 0xC001, --p, K_ECDH_ECDSA, B_NULL, N);
- add("TLS_ECDH_RSA_WITH_NULL_SHA",
- 0xC00B, --p, K_ECDH_RSA, B_NULL, N);
- add("TLS_ECDH_anon_WITH_NULL_SHA",
- 0xC015, --p, K_ECDH_ANON, B_NULL, N);
- add("SSL_RSA_WITH_NULL_MD5",
- 0x0001, --p, K_RSA, B_NULL, N);
+ add("TLS_RSA_WITH_NULL_SHA256", 0x003b, --p,
+ K_RSA, B_NULL, M_SHA256, N, max, tls12, P_SHA256);
+ add("TLS_ECDHE_ECDSA_WITH_NULL_SHA", 0xC006, --p,
+ K_ECDHE_ECDSA, B_NULL, M_SHA, N);
+ add("TLS_ECDHE_RSA_WITH_NULL_SHA", 0xC010, --p,
+ K_ECDHE_RSA, B_NULL, M_SHA, N);
+ add("SSL_RSA_WITH_NULL_SHA", 0x0002, --p,
+ K_RSA, B_NULL, M_SHA, N);
+ add("TLS_ECDH_ECDSA_WITH_NULL_SHA", 0xC001, --p,
+ K_ECDH_ECDSA, B_NULL, M_SHA, N);
+ add("TLS_ECDH_RSA_WITH_NULL_SHA", 0xC00B, --p,
+ K_ECDH_RSA, B_NULL, M_SHA, N);
+ add("TLS_ECDH_anon_WITH_NULL_SHA", 0xC015, --p,
+ K_ECDH_ANON, B_NULL, M_SHA, N);
+ add("SSL_RSA_WITH_NULL_MD5", 0x0001, --p,
+ K_RSA, B_NULL, M_MD5, N);
// Supported Kerberos ciphersuites from RFC2712
- add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
- 0x001f, --p, K_KRB5, B_3DES, N);
- add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
- 0x0023, --p, K_KRB5, B_3DES, N);
- add("TLS_KRB5_WITH_RC4_128_SHA",
- 0x0020, --p, K_KRB5, B_RC4_128, N);
- add("TLS_KRB5_WITH_RC4_128_MD5",
- 0x0024, --p, K_KRB5, B_RC4_128, N);
- add("TLS_KRB5_WITH_DES_CBC_SHA",
- 0x001e, --p, K_KRB5, B_DES, N, tls12);
- add("TLS_KRB5_WITH_DES_CBC_MD5",
- 0x0022, --p, K_KRB5, B_DES, N, tls12);
- add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
- 0x0026, --p, K_KRB5_EXPORT, B_DES_40, N, tls11);
- add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
- 0x0029, --p, K_KRB5_EXPORT, B_DES_40, N, tls11);
- add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
- 0x0028, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11);
- add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
- 0x002b, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11);
+ add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA", 0x001f, --p,
+ K_KRB5, B_3DES, M_SHA, N);
+ add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5", 0x0023, --p,
+ K_KRB5, B_3DES, M_MD5, N);
+ add("TLS_KRB5_WITH_RC4_128_SHA", 0x0020, --p,
+ K_KRB5, B_RC4_128, M_SHA, N);
+ add("TLS_KRB5_WITH_RC4_128_MD5", 0x0024, --p,
+ K_KRB5, B_RC4_128, M_MD5, N);
+ add("TLS_KRB5_WITH_DES_CBC_SHA", 0x001e, --p,
+ K_KRB5, B_DES, M_SHA, N, tls12);
+ add("TLS_KRB5_WITH_DES_CBC_MD5", 0x0022, --p,
+ K_KRB5, B_DES, M_MD5, N, tls12);
+ add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0026, --p,
+ K_KRB5_EXPORT, B_DES_40, M_SHA, N, tls11);
+ add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0029, --p,
+ K_KRB5_EXPORT, B_DES_40, M_MD5, N, tls11);
+ add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0028, --p,
+ K_KRB5_EXPORT, B_RC4_40, M_SHA, N, tls11);
+ add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x002b, --p,
+ K_KRB5_EXPORT, B_RC4_40, M_MD5, N, tls11);
/*
* Other values from the TLS Cipher Suite Registry, as of August 2010.
--- a/jdk/src/java.base/share/classes/sun/security/ssl/MAC.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/MAC.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -36,6 +36,7 @@
import sun.security.ssl.CipherSuite.MacAlg;
import static sun.security.ssl.CipherSuite.*;
+import static sun.security.ssl.CipherSuite.MacAlg.*;
/**
* This class computes the "Message Authentication Code" (MAC) for each
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -382,18 +382,18 @@
protected Set<String> decomposes(MacAlg macAlg) {
Set<String> components = new HashSet<>();
- if (macAlg == CipherSuite.M_MD5) {
+ if (macAlg == CipherSuite.MacAlg.M_MD5) {
components.add("MD5");
components.add("HmacMD5");
- } else if (macAlg == CipherSuite.M_SHA) {
+ } else if (macAlg == CipherSuite.MacAlg.M_SHA) {
components.add("SHA1");
components.add("SHA-1");
components.add("HmacSHA1");
- } else if (macAlg == CipherSuite.M_SHA256) {
+ } else if (macAlg == CipherSuite.MacAlg.M_SHA256) {
components.add("SHA256");
components.add("SHA-256");
components.add("HmacSHA256");
- } else if (macAlg == CipherSuite.M_SHA384) {
+ } else if (macAlg == CipherSuite.MacAlg.M_SHA384) {
components.add("SHA384");
components.add("SHA-384");
components.add("HmacSHA384");
--- a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -489,6 +489,8 @@
* <tt>MAX_VALUE_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method.
+ * @throws IllegalArgumentException if either the key or the value contain
+ * the null control character, code point U+0000.
*/
public abstract void put(String key, String value);
--- a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -49,6 +49,13 @@
*/
class FileSystemPreferences extends AbstractPreferences {
+ /**
+ * The code point U+0000, assigned to the null control character, is the
+ * only character encoded in Unicode and ISO/IEC 10646 that is always
+ * invalid in any XML 1.0 and 1.1 document.
+ */
+ private static final String CODE_POINT_U0000 = String.valueOf('\u0000');
+
static {
PrivilegedAction<Void> load = () -> {
System.loadLibrary("prefs");
@@ -525,6 +532,11 @@
}
protected void putSpi(String key, String value) {
+ if (key.indexOf(CODE_POINT_U0000) != -1) {
+ throw new IllegalArgumentException("Key contains code point U+0000");
+ } else if (value.indexOf(CODE_POINT_U0000) != -1) {
+ throw new IllegalArgumentException("Value contains code point U+0000");
+ }
initCacheIfNecessary();
changeLog.add(new Put(key, value));
prefsCache.put(key, value);
--- a/jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c Tue Mar 17 12:30:53 2015 -0700
@@ -25,6 +25,8 @@
#import "sun_security_krb5_Credentials.h"
#import <Kerberos/Kerberos.h>
+#import <string.h>
+#import <time.h>
/*
* Based largely on klist.c,
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -74,8 +74,6 @@
* Create a new {@code DelegationPermission}
* with the specified subordinate and target principals.
*
- * <p>
- *
* @param principals the name of the subordinate and target principals
*
* @throws NullPointerException if {@code principals} is {@code null}.
@@ -89,10 +87,9 @@
/**
* Create a new {@code DelegationPermission}
* with the specified subordinate and target principals.
- * <p>
*
* @param principals the name of the subordinate and target principals
- * <p>
+ *
* @param actions should be null.
*
* @throws NullPointerException if {@code principals} is {@code null}.
@@ -155,10 +152,10 @@
/**
* Checks two DelegationPermission objects for equality.
- * <P>
+ *
* @param obj the object to test for equality with this object.
*
- * @return true if <i>obj</i> is a DelegationPermission, and
+ * @return true if {@code obj} is a DelegationPermission, and
* has the same subordinate and service principal as this.
* DelegationPermission object.
*/
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -42,7 +42,7 @@
* }
* </pre>
* The key material of an {@code EncryptionKey} is defined as the value
- * of the {@code keyValue} above.<p>
+ * of the {@code keyValue} above.
*
* @since 1.9
*/
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -43,7 +43,7 @@
* tickets [2] SEQUENCE OF Ticket,
* enc-part [3] EncryptedData -- EncKrbCredPart
* }
- * </pre><p>
+ * </pre>
*
* @since 1.9
*/
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosKey.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosKey.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -72,7 +72,7 @@
* {@link #KerberosKey(KerberosPrincipal, char[], String)} constructor,
* an implementation may accept non-IANA algorithm names (For example,
* "ArcFourMac" for "rc4-hmac"), but the {@link #getAlgorithm} method
- * must always return the IANA algorithm name.<p>
+ * must always return the IANA algorithm name.
*
* @implNote Old algorithm names used before JDK 9 are supported in the
* {@link #KerberosKey(KerberosPrincipal, char[], String)} constructor in this
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -67,7 +67,7 @@
* The keytab file format is described at
* <a href="http://www.ioplex.com/utilities/keytab.txt">
* http://www.ioplex.com/utilities/keytab.txt</a>.
- * <p>
+ *
* @since 1.7
*/
public final class KeyTab {
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -141,7 +141,7 @@
*
* @param servicePrincipal the name of the service principal.
* An asterisk may appear by itself, to signify any service principal.
- * <p>
+ *
* @param action the action string
*/
public ServicePermission(String servicePrincipal, String action) {
@@ -193,10 +193,10 @@
/**
* Checks two ServicePermission objects for equality.
- * <P>
+ *
* @param obj the object to test for equality with this object.
*
- * @return true if <i>obj</i> is a ServicePermission, and has the
+ * @return true if {@code obj} is a ServicePermission, and has the
* same service principal, and actions as this
* ServicePermission object.
*/
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/package-info.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/package-info.java Tue Mar 17 12:30:53 2015 -0700
@@ -52,7 +52,7 @@
* which contains a series of relations grouped into different sections.
* Each relation contains a key and a value, the value can be an arbitrary
* string or a boolean value. A boolean value can be one of "true", "false",
- * "yes", or "no", case-insensitive.<p>
+ * "yes", or "no", and values are case-insensitive.
*
* @since 1.4
*/
--- a/jdk/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c Tue Mar 17 12:30:53 2015 -0700
@@ -430,11 +430,11 @@
checkStatus(env, jobj, major, minor, "[GSSLibStub_canonicalizeName]");
if ((*env)->ExceptionCheck(env)) {
- return (jlong) GSS_C_NO_NAME;
+ return ptr_to_jlong(GSS_C_NO_NAME);
}
return ptr_to_jlong(mnNameHdl);
}
- return (jlong) GSS_C_NO_NAME;
+ return ptr_to_jlong(GSS_C_NO_NAME);
}
/*
--- a/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Manifest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Manifest.java Tue Mar 17 12:30:53 2015 -0700
@@ -52,7 +52,7 @@
* <pre>
* XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM");
* Reference ref = factory.newReference("#reference-1", DigestMethod.SHA1);
- * List<Reference> references = Collections.singletonList(ref);
+ * List<Reference> references = Collections.singletonList(ref);
* Manifest manifest = factory.newManifest(references, "manifest-1");
* </pre>
*
--- a/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/XMLObject.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/XMLObject.java Tue Mar 17 12:30:53 2015 -0700
@@ -65,7 +65,7 @@
* <pre>
* XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
* Manifest manifest = fac.newManifest(references);
- * List<XMLStructure> content = Collections.singletonList(manifest);
+ * List<XMLStructure> content = Collections.singletonList(manifest);
* XMLObject object = factory.newXMLObject(content, "object-1", null, null);
* </pre>
*
--- a/jdk/src/jdk.compiler/share/classes/sun/tools/serialver/SerialVer.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/src/jdk.compiler/share/classes/sun/tools/serialver/SerialVer.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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,6 +37,9 @@
import java.util.StringTokenizer;
import sun.net.www.ParseUtil;
+/**
+ * Supporting class for the serialver tool.
+ */
public class SerialVer {
/*
@@ -117,6 +120,10 @@
}
}
+ /**
+ * Entry point for serialver tool.
+ * @param args the arguments
+ */
public static void main(String[] args) {
String envcp = null;
int i = 0;
--- a/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -21,36 +21,18 @@
* questions.
*/
-import sun.misc.Version;
-
public class NativeInstanceFilterTarg {
public static void main(String args[]) {
- boolean runTest = jvmSupportsJVMTI_12x();
String s1 = "abc";
String s2 = "def";
latch(s1);
s1.intern();
- if (runTest) {
- s2.intern(); // this is the call that generates events that ought
- // to be filtered out.
- } else {
- System.out.println("Neutering test since JVMTI 1.2 not supported");
- }
+ s2.intern(); // this is the call that generates events that ought
+ // to be filtered out.
}
// Used by debugger to get an instance to filter with
public static String latch(String s) { return s; }
- public static boolean jvmSupportsJVMTI_12x() {
- // This fix requires the JVM to support JVMTI 1.2, which doesn't
- // happen until HSX 20.0, build 05.
- int major = Version.jvmMajorVersion();
- int minor = Version.jvmMinorVersion();
- int micro = Version.jvmMicroVersion();
- int build = Version.jvmBuildNumber();
-
- return (major > 20 || major == 20 &&
- (minor > 0 || micro > 0 || build >= 5));
- }
}
--- a/jdk/test/com/sun/jdi/RunToExit.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/com/sun/jdi/RunToExit.java Tue Mar 17 12:30:53 2015 -0700
@@ -24,74 +24,29 @@
/* @test
* @bug 4997445
* @summary Test that with server=y, when VM runs to System.exit() no error happens
- *
- * @build VMConnection RunToExit Exit0
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.* VMConnection RunToExit Exit0
* @run driver RunToExit
*/
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.File;
-import java.io.BufferedInputStream;
import java.net.ServerSocket;
import com.sun.jdi.Bootstrap;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.event.*;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.AttachingConnector;
+import java.net.ConnectException;
import java.util.Map;
import java.util.List;
import java.util.Iterator;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import jdk.testlibrary.ProcessTools;
public class RunToExit {
/* Increment this when ERROR: seen */
- static int error_seen = 0;
+ static volatile int error_seen = 0;
static volatile boolean ready = false;
- /*
- * Helper class to direct process output to a StringBuffer
- */
- static class IOHandler implements Runnable {
- private String name;
- private BufferedInputStream in;
- private StringBuffer buffer;
-
- IOHandler(String name, InputStream in) {
- this.name = name;
- this.in = new BufferedInputStream(in);
- this.buffer = new StringBuffer();
- }
-
- static void handle(String name, InputStream in) {
- IOHandler handler = new IOHandler(name, in);
- Thread thr = new Thread(handler);
- thr.setDaemon(true);
- thr.start();
- }
-
- public void run() {
- try {
- byte b[] = new byte[100];
- for (;;) {
- int n = in.read(b, 0, 100);
- // The first thing that will get read is
- // Listening for transport dt_socket at address: xxxxx
- // which shows the debuggee is ready to accept connections.
- ready = true;
- if (n < 0) {
- break;
- }
- buffer.append(new String(b, 0, n));
- }
- } catch (IOException ioe) { }
-
- String str = buffer.toString();
- if ( str.contains("ERROR:") ) {
- error_seen++;
- }
- System.out.println(name + ": " + str);
- }
-
- }
/*
* Find a connector by name
@@ -111,24 +66,40 @@
/*
* Launch a server debuggee with the given address
*/
- private static Process launch(String address, String class_name) throws IOException {
- String exe = System.getProperty("java.home")
- + File.separator + "bin" + File.separator + "java";
- String cmd = exe + " " + VMConnection.getDebuggeeVMOptions() +
- " -agentlib:jdwp=transport=dt_socket" +
- ",server=y" + ",suspend=y" + ",address=" + address +
- " " + class_name;
+ private static Process launch(String address, String class_name) throws Exception {
+ String args[] = new String[]{
+ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address="
+ + address,
+ class_name
+ };
+ args = VMConnection.insertDebuggeeVMOptions(args);
+
+ ProcessBuilder launcher = ProcessTools.createJavaProcessBuilder(args);
- System.out.println("Starting: " + cmd);
+ System.out.println(launcher.command().stream().collect(Collectors.joining(" ", "Starting: ", "")));
- Process p = Runtime.getRuntime().exec(cmd);
-
- IOHandler.handle("Input Stream", p.getInputStream());
- IOHandler.handle("Error Stream", p.getErrorStream());
+ Process p = ProcessTools.startProcess(
+ class_name,
+ launcher,
+ RunToExit::checkForError,
+ RunToExit::isTransportListening,
+ 0,
+ TimeUnit.NANOSECONDS
+ );
return p;
}
+ private static boolean isTransportListening(String line) {
+ return line.startsWith("Listening for transport dt_socket");
+ }
+
+ private static void checkForError(String line) {
+ if (line.contains("ERROR:")) {
+ error_seen++;
+ }
+ }
+
/*
* - pick a TCP port
* - Launch a server debuggee: server=y,suspend=y,address=${port}
@@ -146,15 +117,6 @@
// launch the server debuggee
Process process = launch(address, "Exit0");
- // wait for the debugge to be ready
- while (!ready) {
- try {
- Thread.sleep(1000);
- } catch(Exception ee) {
- throw ee;
- }
- }
-
// attach to server debuggee and resume it so it can exit
AttachingConnector conn = (AttachingConnector)findConnector("com.sun.jdi.SocketAttach");
Map conn_args = conn.defaultArguments();
@@ -164,7 +126,16 @@
System.out.println("Connection arguments: " + conn_args);
- VirtualMachine vm = conn.attach(conn_args);
+ VirtualMachine vm = null;
+ while (vm == null) {
+ try {
+ vm = conn.attach(conn_args);
+ } catch (ConnectException e) {
+ e.printStackTrace(System.out);
+ System.out.println("--- Debugee not ready. Retrying in 500ms. ---");
+ Thread.sleep(500);
+ }
+ }
// The first event is always a VMStartEvent, and it is always in
// an EventSet by itself. Wait for it.
--- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -27,21 +27,19 @@
* @summary Basic unit test of ThreadMXBean.getAllThreadIds()
* @author Alexei Guibadoulline and Mandy Chung
*
- * @run build Barrier
* @run main/othervm AllThreadIds
*/
import java.lang.management.*;
-import java.util.*;
+import java.util.concurrent.Phaser;
public class AllThreadIds {
final static int DAEMON_THREADS = 20;
final static int USER_THREADS = 5;
final static int ALL_THREADS = DAEMON_THREADS + USER_THREADS;
- private static volatile boolean live[] = new boolean[ALL_THREADS];
- private static Thread allThreads[] = new Thread[ALL_THREADS];
- private static ThreadMXBean mbean
- = ManagementFactory.getThreadMXBean();
+ private static final boolean live[] = new boolean[ALL_THREADS];
+ private static final Thread allThreads[] = new Thread[ALL_THREADS];
+ private static final ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
private static boolean testFailed = false;
private static boolean trace = false;
@@ -52,8 +50,7 @@
private static int curLiveThreadCount = 0;
private static int curPeakThreadCount = 0;
- // barrier for threads communication
- private static Barrier barrier = new Barrier(ALL_THREADS);
+ private static final Phaser startupCheck = new Phaser(ALL_THREADS + 1);
private static void printThreadList() {
if (!trace) return;
@@ -124,18 +121,15 @@
curPeakThreadCount = mbean.getPeakThreadCount();
checkThreadCount(0, 0);
-
// Start all threads and wait to be sure they all are alive
- barrier.set(ALL_THREADS);
for (int i = 0; i < ALL_THREADS; i++) {
- live[i] = true;
+ setLive(i, true);
allThreads[i] = new MyThread(i);
- allThreads[i].setDaemon( (i < DAEMON_THREADS) ? true : false);
+ allThreads[i].setDaemon(i < DAEMON_THREADS);
allThreads[i].start();
}
// wait until all threads are started.
- barrier.await();
-
+ startupCheck.arriveAndAwaitAdvance();
checkThreadCount(ALL_THREADS, 0);
printThreadList();
@@ -173,15 +167,14 @@
// Stop daemon threads, wait to be sure they all are dead, and check
// that they disappeared from getAllThreadIds() list
- barrier.set(DAEMON_THREADS);
for (int i = 0; i < DAEMON_THREADS; i++) {
- live[i] = false;
+ setLive(i, false);
}
- // wait until daemon threads are terminated.
- barrier.await();
- // give chance to threads to terminate
- pause();
+ // make sure the daemon threads are completely dead
+ joinDaemonThreads();
+
+ // and check the reported thread count
checkThreadCount(0, DAEMON_THREADS);
// Check mbean now
@@ -190,11 +183,11 @@
for (int i = 0; i < ALL_THREADS; i++) {
long expectedId = allThreads[i].getId();
boolean found = false;
- boolean live = (i >= DAEMON_THREADS);
+ boolean alive = (i >= DAEMON_THREADS);
if (trace) {
System.out.print("Looking for thread with id " + expectedId +
- (live ? " expected alive." : " expected terminated."));
+ (alive ? " expected alive." : " expected terminated."));
}
for (int j = 0; j < list.length; j++) {
if (expectedId == list[j]) {
@@ -203,11 +196,11 @@
}
}
- if (live != found) {
+ if (alive != found) {
testFailed = true;
}
if (trace) {
- if (live != found) {
+ if (alive != found) {
System.out.println(" TEST FAILED.");
} else {
System.out.println();
@@ -216,15 +209,14 @@
}
// Stop all threads and wait to be sure they all are dead
- barrier.set(ALL_THREADS - DAEMON_THREADS);
for (int i = DAEMON_THREADS; i < ALL_THREADS; i++) {
- live[i] = false;
+ setLive(i, false);
}
- // wait until daemon threads are terminated .
- barrier.await();
- // give chance to threads to terminate
- pause();
+ // make sure the non-daemon threads are completely dead
+ joinNonDaemonThreads();
+
+ // and check the thread count
checkThreadCount(0, ALL_THREADS - DAEMON_THREADS);
if (testFailed)
@@ -233,6 +225,30 @@
System.out.println("Test passed.");
}
+ private static void joinDaemonThreads() throws InterruptedException {
+ for (int i = 0; i < DAEMON_THREADS; i++) {
+ allThreads[i].join();
+ }
+ }
+
+ private static void joinNonDaemonThreads() throws InterruptedException {
+ for (int i = DAEMON_THREADS; i < ALL_THREADS; i++) {
+ allThreads[i].join();
+ }
+ }
+
+ private static void setLive(int i, boolean val) {
+ synchronized(live) {
+ live[i] = val;
+ }
+ }
+
+ private static boolean isLive(int i) {
+ synchronized(live) {
+ return live[i];
+ }
+ }
+
// The MyThread thread lives as long as correspondent live[i] value is true
private static class MyThread extends Thread {
int id;
@@ -243,8 +259,8 @@
public void run() {
// signal started
- barrier.signal();
- while (live[id]) {
+ startupCheck.arrive();
+ while (isLive(id)) {
try {
sleep(100);
} catch (InterruptedException e) {
@@ -253,23 +269,6 @@
testFailed = true;
}
}
- // signal about to exit
- barrier.signal();
}
}
-
- private static Object pauseObj = new Object();
- private static void pause() {
- // Enter lock a without blocking
- synchronized (pauseObj) {
- try {
- // may need to tune this timeout for different platforms
- pauseObj.wait(50);
- } catch (Exception e) {
- System.err.println("Unexpected exception.");
- e.printStackTrace(System.err);
- }
- }
- }
-
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Properties/Basic.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015, 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.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Properties;
+
+/*
+ * @test
+ * @bug 8073214
+ * @summary Basic tests of Properties methods.
+ */
+public class Basic
+{
+ public static void main(String[] args) throws Exception
+ {
+ int failures = 0;
+
+ Properties props = new Properties();
+
+ try {
+ props.store((OutputStream)null, "comments");
+ failures++;
+ } catch (NullPointerException e) {
+ // do nothing
+ }
+
+ try {
+ props.store((Writer)null, "comments");
+ failures++;
+ } catch (NullPointerException e) {
+ // do nothing
+ }
+
+ try {
+ props.load((InputStream)null);
+ failures++;
+ } catch (NullPointerException e) {
+ // do nothing
+ }
+
+ try {
+ props.load((Reader)null);
+ failures++;
+ } catch (NullPointerException e) {
+ // do nothing
+ }
+
+ if (failures != 0) {
+ throw new RuntimeException("Basic failed with "
+ + failures + " errors!");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2015, 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.reflect.Constructor;
+import java.util.prefs.Preferences;
+import java.util.prefs.PreferencesFactory;
+
+/*
+ * @test
+ * @bug 8068373
+ * @requires os.family == "linux" | os.family == "solaris"
+ * @summary Ensure writing a code point U+0000 null control character is detected.
+ */
+public class CodePointZeroPrefsTest
+{
+ public static void main(String[] args) throws Exception
+ {
+ int failures = 0;
+
+ // Deliberately reflect so you can reproduce it on any platform.
+ Constructor<? extends PreferencesFactory> constructor =
+ Class.forName("java.util.prefs.FileSystemPreferencesFactory").asSubclass(PreferencesFactory.class).getDeclaredConstructor();
+ constructor.setAccessible(true);
+ PreferencesFactory factory = constructor.newInstance();
+
+ Preferences node = factory.userRoot().node("com/acme/testing");
+
+ // legal key and value
+ try {
+ node.put("a", "1");
+ } catch (IllegalArgumentException iae) {
+ System.err.println("Unexpected IllegalArgumentException for legal key");
+ failures++;
+ }
+
+ // illegal key only
+ int numIAEs = 0;
+ try {
+ node.put("a\u0000b", "1");
+ System.err.println("IllegalArgumentException not thrown for illegal key");
+ failures++;
+ } catch (IllegalArgumentException iae) {
+ // do nothing
+ }
+
+ // illegal value only
+ numIAEs = 0;
+ try {
+ node.put("ab", "2\u00003");
+ System.err.println("IllegalArgumentException not thrown for illegal value");
+ failures++;
+ } catch (IllegalArgumentException iae) {
+ // do nothing
+ }
+
+ // illegal key and value
+ numIAEs = 0;
+ try {
+ node.put("a\u0000b", "2\u00003");
+ System.err.println("IllegalArgumentException not thrown for illegal entry");
+ failures++;
+ } catch (IllegalArgumentException iae) {
+ // do nothing
+ }
+
+ if (failures != 0) {
+ throw new RuntimeException("CodePointZeroPrefsTest failed with "
+ + failures + " errors!");
+ }
+ }
+}
--- a/jdk/test/java/util/regex/RegExTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/java/util/regex/RegExTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -32,7 +32,7 @@
* 6358731 6178785 6284152 6231989 6497148 6486934 6233084 6504326 6635133
* 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066
* 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590
- * 8027645 8035076 8039124 8035975
+ * 8027645 8035076 8039124 8035975 8074678
*/
import java.util.function.Function;
@@ -138,6 +138,7 @@
wordSearchTest();
hitEndTest();
toMatchResultTest();
+ toMatchResultTest2();
surrogatesInClassTest();
removeQEQuotingTest();
namedGroupCaptureTest();
@@ -371,6 +372,47 @@
report("toMatchResult is a copy");
}
+ private static void checkExpectedISE(Runnable test) {
+ try {
+ test.run();
+ failCount++;
+ } catch (IllegalStateException x) {
+ } catch (IndexOutOfBoundsException xx) {
+ failCount++;
+ }
+ }
+
+ private static void checkExpectedIOOE(Runnable test) {
+ try {
+ test.run();
+ failCount++;
+ } catch (IndexOutOfBoundsException x) {}
+ }
+
+ // This is for bug 8074678
+ // Test the result of toMatchResult throws ISE if no match is availble
+ private static void toMatchResultTest2() throws Exception {
+ Matcher matcher = Pattern.compile("nomatch").matcher("hello world");
+ matcher.find();
+ MatchResult mr = matcher.toMatchResult();
+
+ checkExpectedISE(() -> mr.start());
+ checkExpectedISE(() -> mr.start(2));
+ checkExpectedISE(() -> mr.end());
+ checkExpectedISE(() -> mr.end(2));
+ checkExpectedISE(() -> mr.group());
+ checkExpectedISE(() -> mr.group(2));
+
+ matcher = Pattern.compile("(match)").matcher("there is a match");
+ matcher.find();
+ MatchResult mr2 = matcher.toMatchResult();
+ checkExpectedIOOE(() -> mr2.start(2));
+ checkExpectedIOOE(() -> mr2.end(2));
+ checkExpectedIOOE(() -> mr2.group(2));
+
+ report("toMatchResult2 appropriate exceptions");
+ }
+
// This is for bug 5013885
// Must test a slice to see if it reports hitEnd correctly
private static void hitEndTest() throws Exception {
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -517,7 +517,7 @@
new ToListAssertion<>())));
}
- @Test
+ @Test(groups = { "serialization-hostile" })
public void testFlatMappingClose() {
Function<Integer, Integer> classifier = i -> i;
AtomicInteger ai = new AtomicInteger();
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountLargeTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountLargeTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -24,7 +24,7 @@
/**
* @test
* @summary Tests counting of streams containing Integer.MAX_VALUE + 1 elements
- * @bug 8031187
+ * @bug 8031187 8067969
*/
package org.openjdk.tests.java.util.stream;
@@ -41,30 +41,62 @@
static final long EXPECTED_LARGE_COUNT = 1L + Integer.MAX_VALUE;
public void testRefLarge() {
- long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
- .mapToObj(e -> null).count();
-
- assertEquals(count, EXPECTED_LARGE_COUNT);
+ // Test known sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .mapToObj(e -> null).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
+ // Test unknown sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .mapToObj(e -> null).filter(e -> true).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
}
public void testIntLarge() {
- long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
- .mapToInt(e -> 0).count();
-
- assertEquals(count, EXPECTED_LARGE_COUNT);
+ // Test known sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .mapToInt(e -> 0).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
+ // Test unknown sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .mapToInt(e -> 0).filter(e -> true).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
}
public void testLongLarge() {
- long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
- .count();
-
- assertEquals(count, EXPECTED_LARGE_COUNT);
+ // Test known sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
+ // Test unknown sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .filter(e -> true).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
}
public void testDoubleLarge() {
- long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
- .mapToDouble(e -> 0.0).count();
-
- assertEquals(count, EXPECTED_LARGE_COUNT);
+ // Test known sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .mapToDouble(e -> 0.0).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
+ // Test unknown sized stream
+ {
+ long count = LongStream.range(0, EXPECTED_LARGE_COUNT)
+ .mapToDouble(e -> 0.0).filter(e -> true).count();
+ assertEquals(count, EXPECTED_LARGE_COUNT);
+ }
}
}
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -24,11 +24,12 @@
/**
* @test
* @summary Tests counting of streams
- * @bug 8031187
+ * @bug 8031187 8067969
*/
package org.openjdk.tests.java.util.stream;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.DoubleStream;
import java.util.stream.DoubleStreamTestDataProvider;
import java.util.stream.IntStream;
@@ -52,6 +53,12 @@
terminal(Stream::count).
expectedResult(expectedCount).
exercise();
+
+ // Test with an unknown sized stream
+ withData(data).
+ terminal(s -> s.filter(e -> true), Stream::count).
+ expectedResult(expectedCount).
+ exercise();
}
@Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
@@ -62,6 +69,11 @@
terminal(IntStream::count).
expectedResult(expectedCount).
exercise();
+
+ withData(data).
+ terminal(s -> s.filter(e -> true), IntStream::count).
+ expectedResult(expectedCount).
+ exercise();
}
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
@@ -72,6 +84,11 @@
terminal(LongStream::count).
expectedResult(expectedCount).
exercise();
+
+ withData(data).
+ terminal(s -> s.filter(e -> true), LongStream::count).
+ expectedResult(expectedCount).
+ exercise();
}
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
@@ -82,5 +99,36 @@
terminal(DoubleStream::count).
expectedResult(expectedCount).
exercise();
+
+ withData(data).
+ terminal(s -> s.filter(e -> true), DoubleStream::count).
+ expectedResult(expectedCount).
+ exercise();
+ }
+
+ public void testNoEvaluationForSizedStream() {
+ {
+ AtomicInteger ai = new AtomicInteger();
+ Stream.of(1, 2, 3, 4).peek(e -> ai.getAndIncrement()).count();
+ assertEquals(ai.get(), 0);
+ }
+
+ {
+ AtomicInteger ai = new AtomicInteger();
+ IntStream.of(1, 2, 3, 4).peek(e -> ai.getAndIncrement()).count();
+ assertEquals(ai.get(), 0);
+ }
+
+ {
+ AtomicInteger ai = new AtomicInteger();
+ LongStream.of(1, 2, 3, 4).peek(e -> ai.getAndIncrement()).count();
+ assertEquals(ai.get(), 0);
+ }
+
+ {
+ AtomicInteger ai = new AtomicInteger();
+ DoubleStream.of(1, 2, 3, 4).peek(e -> ai.getAndIncrement()).count();
+ assertEquals(ai.get(), 0);
+ }
}
}
--- a/jdk/test/javax/xml/ws/8033113/WsImportTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/javax/xml/ws/8033113/WsImportTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -140,9 +140,6 @@
private static String getWsImport() {
String javaHome = System.getProperty("java.home");
- if (javaHome.endsWith("jre")) {
- javaHome = new File(javaHome).getParent();
- }
String wsimport = javaHome + File.separator + "bin" + File.separator + "wsimport";
if (System.getProperty("os.name").startsWith("Windows")) {
wsimport = wsimport.concat(".exe");
--- a/jdk/test/javax/xml/ws/8046817/GenerateEnumSchema.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/javax/xml/ws/8046817/GenerateEnumSchema.java Tue Mar 17 12:30:53 2015 -0700
@@ -86,9 +86,6 @@
private static String getSchemagen() {
String javaHome = System.getProperty("java.home");
- if (javaHome.endsWith("jre")) {
- javaHome = new File(javaHome).getParent();
- }
String schemagen = javaHome + File.separator + "bin" + File.separator + "schemagen";
if (System.getProperty("os.name").startsWith("Windows")) {
schemagen = schemagen.concat(".exe");
--- a/jdk/test/javax/xml/ws/clientjar/TestWsImport.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/javax/xml/ws/clientjar/TestWsImport.java Tue Mar 17 12:30:53 2015 -0700
@@ -55,9 +55,6 @@
public static void main(String[] args) throws IOException {
String javaHome = System.getProperty("java.home");
- if (javaHome.endsWith("jre")) {
- javaHome = new File(javaHome).getParent();
- }
String wsimport = javaHome + File.separator + "bin" + File.separator + "wsimport";
if (System.getProperty("os.name").startsWith("Windows")) {
wsimport = wsimport.concat(".exe");
--- a/jdk/test/javax/xml/ws/ebcdic/WsImportTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/javax/xml/ws/ebcdic/WsImportTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -133,9 +133,6 @@
private static String getWsImport() {
String javaHome = System.getProperty("java.home");
- if (javaHome.endsWith("jre")) {
- javaHome = new File(javaHome).getParent();
- }
String wsimport = javaHome + File.separator + "bin" + File.separator + "wsimport";
if (System.getProperty("os.name").startsWith("Windows")) {
wsimport = wsimport.concat(".exe");
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java Wed Mar 11 08:30:40 2015 -0700
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java Tue Mar 17 12:30:53 2015 -0700
@@ -88,24 +88,12 @@
ProcessBuilder processBuilder,
Consumer<String> consumer)
throws IOException {
- Process p = null;
try {
- p = startProcess(
- name,
- processBuilder,
- line -> {
- if (consumer != null) {
- consumer.accept(line);
- }
- return false;
- },
- -1,
- TimeUnit.NANOSECONDS
- );
+ return startProcess(name, processBuilder, consumer, null, -1, TimeUnit.NANOSECONDS);
} catch (InterruptedException | TimeoutException e) {
- // can't ever happen
+ // will never happen
+ throw new RuntimeException(e);
}
- return p;
}
/**
@@ -134,6 +122,38 @@
long timeout,
TimeUnit unit)
throws IOException, InterruptedException, TimeoutException {
+ return startProcess(name, processBuilder, null, linePredicate, timeout, unit);
+ }
+
+ /**
+ * <p>Starts a process from its builder.</p>
+ * <span>The default redirects of STDOUT and STDERR are started</span>
+ * <p>
+ * It is possible to wait for the process to get to a warmed-up state
+ * via {@linkplain Predicate} condition on the STDOUT and monitor the
+ * in-streams via the provided {@linkplain Consumer}
+ * </p>
+ * @param name The process name
+ * @param processBuilder The process builder
+ * @param lineConsumer The {@linkplain Consumer} the lines will be forwarded to
+ * @param linePredicate The {@linkplain Predicate} to use on the STDOUT
+ * Used to determine the moment the target app is
+ * properly warmed-up.
+ * It can be null - in that case the warmup is skipped.
+ * @param timeout The timeout for the warmup waiting; -1 = no wait; 0 = wait forever
+ * @param unit The timeout {@linkplain TimeUnit}
+ * @return Returns the initialized {@linkplain Process}
+ * @throws IOException
+ * @throws InterruptedException
+ * @throws TimeoutException
+ */
+ public static Process startProcess(String name,
+ ProcessBuilder processBuilder,
+ final Consumer<String> lineConsumer,
+ final Predicate<String> linePredicate,
+ long timeout,
+ TimeUnit unit)
+ throws IOException, InterruptedException, TimeoutException {
System.out.println("["+name+"]:" + processBuilder.command().stream().collect(Collectors.joining(" ")));
Process p = processBuilder.start();
StreamPumper stdout = new StreamPumper(p.getInputStream());
@@ -141,6 +161,18 @@
stdout.addPump(new LineForwarder(name, System.out));
stderr.addPump(new LineForwarder(name, System.err));
+ if (lineConsumer != null) {
+ StreamPumper.LinePump pump = new StreamPumper.LinePump() {
+ @Override
+ protected void processLine(String line) {
+ lineConsumer.accept(line);
+ }
+ };
+ stdout.addPump(pump);
+ stderr.addPump(pump);
+ }
+
+
CountDownLatch latch = new CountDownLatch(1);
if (linePredicate != null) {
StreamPumper.LinePump pump = new StreamPumper.LinePump() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/OCSPSingleExtensions.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2015, 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 8074064
+ * @summary OCSPResponse.SingleResponse objects do not parse singleExtensions
+ * @run main/othervm sun.security.provider.certpath.OCSPSingleExtensions
+ */
+
+package sun.security.provider.certpath;
+
+import java.io.*;
+import java.util.*;
+import java.security.cert.*;
+
+import sun.security.x509.SerialNumber;
+
+/*
+ * Tester note:
+ * For this test, all input files should be co-located with the test source
+ * code. All test input data should be in PEM format, and may be commented
+ * with the '#' character at the beginning of any comment line. Most tests were
+ * generated using the "openssl ocsp" utility in server mode and used the same
+ * utility as a client to drive the responses. In rare cases
+ * (ocsp-good-witharchcut.resp, etc.) the test input was manually modified
+ * because openssl's ocsp could not generate data in that format (e.g. a
+ * "good" response with singleExtensions in the SingleResponse structure.)
+ * These tests were created to force the code to walk codepaths reached only
+ * with invalid OCSP data or legal formats that are not easily generated using
+ * the tools at hand. These hand-modified test cases will not verify.
+ */
+
+public class OCSPSingleExtensions {
+ public static CertificateFactory CF;
+ public static final File testDir =
+ new File(System.getProperty("test.src", "."));
+ public static final Base64.Decoder B64D = Base64.getMimeDecoder();
+
+ public static void main(String [] args) throws Exception {
+ // Get a CertificateFactory for various tests
+ CF = CertificateFactory.getInstance("X509");
+ ByteArrayInputStream bais =
+ new ByteArrayInputStream(readFile("int.crt").getBytes());
+ X509Certificate intCA = (X509Certificate)CF.generateCertificate(bais);
+ System.out.println("Successfully instantiated CA cert \"" +
+ intCA.getSubjectX500Principal() + "\"");
+
+ CertId cid0x1500 = new CertId(intCA, new SerialNumber(0x1500));
+ boolean noFailures = true;
+
+ OCSPResponse.SingleResponse sr =
+ getSRByFilename("ocsp-good-nonext.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 0);
+
+ if (sr.getRevocationTime() != null) {
+ throw new RuntimeException("Oops. revocationTime is non-null " +
+ sr.getRevocationTime());
+ } else if (sr.getRevocationReason() != null) {
+ throw new RuntimeException("Oops. revocationReason is non-null " +
+ sr.getRevocationReason());
+ }
+
+ sr = getSRByFilename("ocsp-good-withnext.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 0);
+
+ sr = getSRByFilename("ocsp-good-witharchcut.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 1);
+
+ sr = getSRByFilename("ocsp-rev-nocerts.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 1);
+
+ sr = getSRByFilename("ocsp-rev-nonext-noinv.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 0);
+
+ sr = getSRByFilename("ocsp-rev-withnext-noinv.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 0);
+
+ sr = getSRByFilename("ocsp-rev-nonext-withinv.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 1);
+
+ sr = getSRByFilename("ocsp-rev-withnext-withinv.resp", cid0x1500);
+ noFailures &= checkSingleExts(sr, 1);
+
+ try {
+ sr = getSRByFilename("ocsp-rev-twonext.resp", cid0x1500);
+ System.out.println("FAIL: Allowed two nextUpdate fields");
+ noFailures = false;
+ } catch (IOException ioe) {
+ System.out.println("Caught expected exception: " + ioe);
+ }
+
+ try {
+ sr = getSRByFilename("ocsp-rev-bad-sr-tag.resp", cid0x1500);
+ System.out.println("FAIL: Allowed invalid singleResponse item");
+ noFailures = false;
+ } catch (IOException ioe) {
+ System.out.println("Caught expected exception: " + ioe);
+ }
+
+ try {
+ sr = getSRByFilename("ocsp-rev-sr-cont-reverse.resp", cid0x1500);
+ System.out.println("FAIL: Allowed reversed " +
+ "nextUpdate/singleExtensions");
+ noFailures = false;
+ } catch (IOException ioe) {
+ System.out.println("Caught expected exception: " + ioe);
+ }
+
+ if (!noFailures) {
+ throw new RuntimeException("One or more tests failed");
+ }
+ }
+
+ private static OCSPResponse.SingleResponse getSRByFilename(String fileName,
+ CertId cid) throws IOException {
+ byte[] respDER = B64D.decode(readFile(fileName));
+ OCSPResponse or = new OCSPResponse(respDER);
+ OCSPResponse.SingleResponse sr = or.getSingleResponse(cid);
+ return sr;
+ }
+
+ private static String readFile(String fileName) throws IOException {
+ String filePath = testDir + "/" + fileName;
+ StringBuilder sb = new StringBuilder();
+
+ try (FileReader fr = new FileReader(filePath);
+ BufferedReader br = new BufferedReader(fr)) {
+ String line;
+ while ((line = br.readLine()) != null) {
+ if (!line.trim().startsWith("#")) {
+ sb.append(line).append("\n");
+ }
+ }
+ }
+
+ System.out.println("Successfully read " + fileName);
+ return sb.toString();
+ }
+
+ private static boolean checkSingleExts(OCSPResponse.SingleResponse sr,
+ int singleExtCount) {
+ Map<String, Extension> singleExts;
+ try {
+ singleExts = sr.getSingleExtensions();
+ } catch (NullPointerException npe) {
+ System.out.println(
+ "Warning: Sent null singleResponse into checkSingleExts");
+ return false;
+ }
+
+ for (String key : singleExts.keySet()) {
+ System.out.println("singleExtension: " + singleExts.get(key));
+ }
+
+ if (singleExts.size() != singleExtCount) {
+ System.out.println("Single Extension count mismatch, " +
+ "expected " + singleExtCount + ", got " +
+ singleExts.size());
+ return false;
+ } else {
+ return true;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/TEST.properties Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,1 @@
+bootclasspath.dirs=.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/int.crt Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,121 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 2 (0x2)
+ Signature Algorithm: sha256WithRSAEncryption
+ Issuer: O=Test, CN=TestRoot
+ Validity
+ Not Before: Feb 24 00:59:51 2015 GMT
+ Not After : Feb 13 00:59:51 2017 GMT
+ Subject: O=Test, CN=TestIntCA
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (4096 bit)
+ Modulus:
+ 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+ cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+ 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+ d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+ 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+ 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+ 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+ 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+ ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+ c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+ f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+ da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+ 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+ 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+ 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+ 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+ 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+ 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+ 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+ 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+ 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+ 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+ 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+ 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+ e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+ ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+ 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+ 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+ d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+ 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+ 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+ 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+ ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+ 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+ f9:cf:21
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+ X509v3 Authority Key Identifier:
+ keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ X509v3 Key Usage:
+ Certificate Sign, CRL Sign
+ Signature Algorithm: sha256WithRSAEncryption
+ 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+ 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+ 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+ a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+ bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+ 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+ 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+ 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+ e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+ 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+ b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+ dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+ 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+ dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+ 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+ 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+ be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+ a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+ 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+ fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+ c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+ 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+ e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+ 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+ 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+ 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+ a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+ aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+ e6:56:87:80:bf:95:20:c5
+
+-----BEGIN CERTIFICATE-----
+MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+EATpJX3DuxDgEVUp5laHgL+VIMU=
+-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-good-nonext.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,316 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:44:43 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: good
+# This Update: Feb 28 00:44:43 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 0410AC8B4F37A9FC4A780725B40C10737187
+# Signature Algorithm: sha1WithRSAEncryption
+# 34:89:04:55:0d:5d:78:0a:ad:19:50:11:eb:34:dc:49:9a:a8:
+# 5d:e6:c1:ff:a9:83:54:6f:3e:30:87:6a:78:c9:d1:09:e9:b9:
+# af:27:08:a9:9e:57:62:ab:b7:27:f2:81:61:f4:44:df:46:01:
+# 32:e7:eb:c6:f2:8d:fc:55:a4:58:84:60:ac:e2:f2:f1:de:05:
+# f2:5f:b3:bc:9e:83:7d:e3:d4:58:71:01:b8:c0:ae:cf:e3:07:
+# 23:7a:88:03:d2:c8:45:cd:07:ee:d6:81:31:81:7e:bd:e3:f4:
+# 7a:fe:c1:49:99:b1:d9:0d:73:d4:47:b7:2d:14:63:d0:87:23:
+# ec:a6:46:86:f6:98:4e:97:d7:93:dc:77:9f:a0:b5:0d:1a:14:
+# 08:33:4c:70:34:ba:d5:1c:21:31:fb:3b:e0:78:33:32:11:70:
+# d2:7a:3c:e4:62:3c:50:cd:d5:11:5f:cc:99:52:2b:6b:75:43:
+# aa:e2:42:a5:d6:a7:4d:09:43:61:13:5b:b7:6a:eb:85:e1:9f:
+# 3b:bf:49:fe:b0:54:4c:16:3a:3b:cc:3c:6c:82:08:08:2f:bf:
+# dc:e6:7e:d3:58:41:1d:2c:cd:a7:f7:64:30:66:0c:b8:06:e6:
+# df:99:10:37:fc:3a:ff:9a:05:37:01:ee:75:6a:ff:58:04:c7:
+# 85:19:e6:48
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+MIILTgoBAKCCC0cwggtDBgkrBgEFBQcwAQEEggs0MIILMDCBsKEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDQ0M1owUjBQ
+MDswCQYFKw4DAhoFAAQUEFZXi3QYEyYf2XEq2mAHf/fGHo8EFJv5hAZq/NLrCJP7
+5O4v2MHCiXqnAgIVAIAAGA8yMDE1MDIyODAwNDQ0M1qhIzAhMB8GCSsGAQUFBzAB
+AgQSBBCsi083qfxKeAcltAwQc3GHMA0GCSqGSIb3DQEBBQUAA4IBAQA0iQRVDV14
+Cq0ZUBHrNNxJmqhd5sH/qYNUbz4wh2p4ydEJ6bmvJwipnldiq7cn8oFh9ETfRgEy
+5+vG8o38VaRYhGCs4vLx3gXyX7O8noN949RYcQG4wK7P4wcjeogD0shFzQfu1oEx
+gX694/R6/sFJmbHZDXPUR7ctFGPQhyPspkaG9phOl9eT3HefoLUNGhQIM0xwNLrV
+HCEx+zvgeDMyEXDSejzkYjxQzdURX8yZUitrdUOq4kKl1qdNCUNhE1u3auuF4Z87
+v0n+sFRMFjo7zDxsgggIL7/c5n7TWEEdLM2n92QwZgy4BubfmRA3/Dr/mgU3Ae51
+av9YBMeFGeZIoIIJZTCCCWEwggQ5MIICIaADAgECAgIBATANBgkqhkiG9w0BAQsF
+ADAjMQ0wCwYDVQQKDARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwHhcNMTUwMjI0
+MDEyMjI0WhcNMTYwMjI0MDEyMjI0WjAiMQ0wCwYDVQQKDARUZXN0MREwDwYDVQQD
+DAhUZXN0T0NTUDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANJcrhH2
+xq6XujHtK7bhx1gD5ZvueFPLM6UV/cZJFoMOyCF9z6jrGDEyCmIMTselpXWd23KQ
+41quUwobWT+9Omexv5hkpIXwlxCLDn57XtQyq7Xvw94iwBGQyDfkSLBe/BoseoUr
+pr0YZAjT47jYqy612OgSLlhFaaxWlGLjwsQ8COqzu6SJfvuEXpVJb7kzZhrCfzZV
+GKch5Bt1wOjJAhuc8YuxWLCM2lwkpfSlNlIcdtNace7wyEtlWAvW1mwjO9CP9Tpm
+1PT9NJDCNaFtcEk5pnE9DXyF09H1bjAFQqGIq5QfJfJ2hVfLd7aeowMm/7FHcWcg
+dY2DEBdsmpNL9jECAwEAAaN4MHYwHQYDVR0OBBYEFFh4gw5HYcLJ4Hen/q2cpF8A
+6KZsMB8GA1UdIwQYMBaAFJv5hAZq/NLrCJP75O4v2MHCiXqnMA4GA1UdDwEB/wQE
+AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDCTAPBgkrBgEFBQcwAQUEAgUAMA0GCSqG
+SIb3DQEBCwUAA4ICAQBVEwwLSjUUJe82SFmGB+jAzdCcGdE2Y4XR8Eb/rzk3gL0+
+xIj6Zi1XCJcbIAA3MDgUz/9dAcTgBqqCyWQ/7Yke2ioCxR1Pi9AV8yZDsagJ9x7U
+Dze9UGzNsYundxrplez8RTE25CPGY15kYaypo6h8JvWRV6oNUdPfrSnT71irdC+B
+3J6XNQ2UiA80XbeA7UkqOfTJUbiNjdvm7AQ5umlVZyT+jybxHGIMrZXc3lx7bA7p
+1P7jz57RXdqq+ReNkqstVGcFwnpRhHLJq/Aya4bzH8STO5uNcxJPWC1ZQzIdCgyl
+WFnazp0StNNPKZjcpUS9kyNlrRkwq3JEFUigep7q1fWanvpwMqpRswS2kcS412Gu
+wEHsWpO0YrwJxATY1DMJ+WMg1QHtuWBHFHfR98VBOzvnXXPZra2VIJxAH+RHCvZU
+u7gJYwBJ2y58KnmWhhuWO1SXSLQ5RvIn74yWRs2vjlVwnWyP0RpM+uiQpCkQBNG/
+st4EKCqvrt3fpvlKZhl2eqrPsGjD74M7e+lvEpcd2x4q2gcD0LrBhwLNWb60ISI7
+2F19tKPHKlY+CWxrb1QiA7uy15iKL1Hs+n0+3Mhv2ypvRlYuCLlBgdhYpG4qyEbb
+Y1I4xkUaaqMEPkgOhD0pR4uA/O60yBLwA+97SC2UgKJRwxSSfleDzVZ+m43FwjCC
+BSAwggMIoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwIjENMAsGA1UECgwEVGVzdDER
+MA8GA1UEAwwIVGVzdFJvb3QwHhcNMTUwMjI0MDA1OTUxWhcNMTcwMjEzMDA1OTUx
+WjAjMQ0wCwYDVQQKDARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwggIiMA0GCSqG
+SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/CikCVACXw4HmM4l0A8yn9I1UFzZIl2oy
+TriHbWKOh3+RZDt11T2TGRfSANjbw5F8NSNZ1Cmj4dooZiiFa9NECTiCQi8jq+Yb
+L4zDEkCZjS6mlRacdbEHvXb2F7ykk4+fzettHIxcDCqNuHEs7a3+e+0+w+ck1K5T
+QjTFgvn6FXG6nhanHsVcp0izJvSpNHGEuHt3p/GijvXozSX5Y4mxmCqOTdqeLdKl
+lsoyHuIisQu5D5gKrggvqP6QL9gNFnktyGIiafMYK6nH0YX3XdWrRG+RmhqGIgt+
+V5eYar27VR7mRGIYC6+kPrqnX/GmKFz+3xmazTnjml68qkkMIiS3HNQhmQvESJW4
+3q1M4TnoNF3GDE8sIsjozRm304/TzXZ2D7G7CkW+nV8qXVEcR3m8ydG8MDOuLdsn
+uRv/LMuyr33lpptvI5h+dnRFX0EVc8Gc9YjGj8qbeHDui7rRvGBPKXZtKC87CeZH
+U0kEFWcdrw1R+EOSyKvq8AmeR4cuYtiRbkDerBvhakdBw33PkODpNIDQVpqSgxgK
+xGG3YD2aTNthCtDQcfHu3hGt+u5Lj/4V7W3ksLpwnDDqUk0xpJU1oRzZFZ+cqwZQ
+667Uuxd0J0S5NfoVYeET9h5GiJzTZ8q8pXzbuX4jHCR3+oSPOH8qQtVJ4DMJXSko
+L5MzIPnPIQIDAQABo2AwXjAdBgNVHQ4EFgQUm/mEBmr80usIk/vk7i/YwcKJeqcw
+HwYDVR0jBBgwFoAUErnDSHntfTDJeHhhlFg3B0B2OBgwDwYDVR0TAQH/BAUwAwEB
+/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIBAHko1UaSH2sl3rAe4kTT
+e6NKbgVD3YVHTcrQ2UNlNDigwmz7SYVt89wQjHM3SSLDh90oirCyLKOc9hVNmDmV
+oSFyNv8EZ+W6Pr1e1IGs9Bz1q43dc+k32dKAOVv17P6cVuwQ94ZCF9HxS8U4/g6F
+LG6sb1LlqLn+r/XcNQp0+HJPUdWV9P6P+j/V0h9EO2NgSuKZN78JQDJs6jxhhXe8
+Y24R+UFfy0yZOSo3ZnlNWn6TkVMzzrHAHGiXLlrhZllBUgfPSgIkVN0Bly/xhdtQ
+nDsWldIIyvaTmgEzNkB8OePf+HuntepgBqV0OtzqNghrwVkDAXcXDmvhmkhoBjED
+KAvL3WGTgAzxFuSHJoZytBIye/eFWZrjHMTYblWpfsXOi77Sv1c0YoPx0Dpz4XXh
+9Hdbo6M1evu2hWjVrSaVcWBikjDTXHuOQhToeycT5qrLNUIs2+kf//1Mj/wE2AUW
+2qiT2zvyURf/3McRlxSs2FrnrTj6F7+9S5KEDZYgfRfuMaZWV16kDdLLR+hFFORq
+SqFA2re86KpgWUxKOwzvJjn8y4z+ecM1NPU6EdPm5/79vIlqxdBbormEnbRT0R/A
+9v2Aioj4qgSPXYNKke2Q8PYKuxoB16S7PMTB4TjKA4th2BirvO9+GKrfYdEfZBAE
+6SV9w7sQ4BFVKeZWh4C/lSDF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-good-witharchcut.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,320 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:44:43 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: good
+# This Update: Feb 28 00:44:43 2015 GMT
+# Response Single Extensions:
+# OCSP Archive Cutoff:
+# Feb 19 14:00:00 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 0410AC8B4F37A9FC4A780725B40C10737187
+# Signature Algorithm: sha1WithRSAEncryption
+# 34:89:04:55:0d:5d:78:0a:ad:19:50:11:eb:34:dc:49:9a:a8:
+# 5d:e6:c1:ff:a9:83:54:6f:3e:30:87:6a:78:c9:d1:09:e9:b9:
+# af:27:08:a9:9e:57:62:ab:b7:27:f2:81:61:f4:44:df:46:01:
+# 32:e7:eb:c6:f2:8d:fc:55:a4:58:84:60:ac:e2:f2:f1:de:05:
+# f2:5f:b3:bc:9e:83:7d:e3:d4:58:71:01:b8:c0:ae:cf:e3:07:
+# 23:7a:88:03:d2:c8:45:cd:07:ee:d6:81:31:81:7e:bd:e3:f4:
+# 7a:fe:c1:49:99:b1:d9:0d:73:d4:47:b7:2d:14:63:d0:87:23:
+# ec:a6:46:86:f6:98:4e:97:d7:93:dc:77:9f:a0:b5:0d:1a:14:
+# 08:33:4c:70:34:ba:d5:1c:21:31:fb:3b:e0:78:33:32:11:70:
+# d2:7a:3c:e4:62:3c:50:cd:d5:11:5f:cc:99:52:2b:6b:75:43:
+# aa:e2:42:a5:d6:a7:4d:09:43:61:13:5b:b7:6a:eb:85:e1:9f:
+# 3b:bf:49:fe:b0:54:4c:16:3a:3b:cc:3c:6c:82:08:08:2f:bf:
+# dc:e6:7e:d3:58:41:1d:2c:cd:a7:f7:64:30:66:0c:b8:06:e6:
+# df:99:10:37:fc:3a:ff:9a:05:37:01:ee:75:6a:ff:58:04:c7:
+# 85:19:e6:48
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+MIILcgoBAKCCC2swggtnBgkrBgEFBQcwAQEEggtYMIILVDCB1KEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDQ0M1owdjB0
+MDswCQYFKw4DAhoFAAQUEFZXi3QYEyYf2XEq2mAHf/fGHo8EFJv5hAZq/NLrCJP7
+5O4v2MHCiXqnAgIVAIAAGA8yMDE1MDIyODAwNDQ0M1qhIjAgMB4GCSsGAQUFBzAB
+BgQRGA8yMDE1MDIxOTE0MDAwMFqhIzAhMB8GCSsGAQUFBzABAgQSBBCsi083qfxK
+eAcltAwQc3GHMA0GCSqGSIb3DQEBBQUAA4IBAQA0iQRVDV14Cq0ZUBHrNNxJmqhd
+5sH/qYNUbz4wh2p4ydEJ6bmvJwipnldiq7cn8oFh9ETfRgEy5+vG8o38VaRYhGCs
+4vLx3gXyX7O8noN949RYcQG4wK7P4wcjeogD0shFzQfu1oExgX694/R6/sFJmbHZ
+DXPUR7ctFGPQhyPspkaG9phOl9eT3HefoLUNGhQIM0xwNLrVHCEx+zvgeDMyEXDS
+ejzkYjxQzdURX8yZUitrdUOq4kKl1qdNCUNhE1u3auuF4Z87v0n+sFRMFjo7zDxs
+gggIL7/c5n7TWEEdLM2n92QwZgy4BubfmRA3/Dr/mgU3Ae51av9YBMeFGeZIoIIJ
+ZTCCCWEwggQ5MIICIaADAgECAgIBATANBgkqhkiG9w0BAQsFADAjMQ0wCwYDVQQK
+DARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwHhcNMTUwMjI0MDEyMjI0WhcNMTYw
+MjI0MDEyMjI0WjAiMQ0wCwYDVQQKDARUZXN0MREwDwYDVQQDDAhUZXN0T0NTUDCC
+ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANJcrhH2xq6XujHtK7bhx1gD
+5ZvueFPLM6UV/cZJFoMOyCF9z6jrGDEyCmIMTselpXWd23KQ41quUwobWT+9Omex
+v5hkpIXwlxCLDn57XtQyq7Xvw94iwBGQyDfkSLBe/BoseoUrpr0YZAjT47jYqy61
+2OgSLlhFaaxWlGLjwsQ8COqzu6SJfvuEXpVJb7kzZhrCfzZVGKch5Bt1wOjJAhuc
+8YuxWLCM2lwkpfSlNlIcdtNace7wyEtlWAvW1mwjO9CP9Tpm1PT9NJDCNaFtcEk5
+pnE9DXyF09H1bjAFQqGIq5QfJfJ2hVfLd7aeowMm/7FHcWcgdY2DEBdsmpNL9jEC
+AwEAAaN4MHYwHQYDVR0OBBYEFFh4gw5HYcLJ4Hen/q2cpF8A6KZsMB8GA1UdIwQY
+MBaAFJv5hAZq/NLrCJP75O4v2MHCiXqnMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUE
+DDAKBggrBgEFBQcDCTAPBgkrBgEFBQcwAQUEAgUAMA0GCSqGSIb3DQEBCwUAA4IC
+AQBVEwwLSjUUJe82SFmGB+jAzdCcGdE2Y4XR8Eb/rzk3gL0+xIj6Zi1XCJcbIAA3
+MDgUz/9dAcTgBqqCyWQ/7Yke2ioCxR1Pi9AV8yZDsagJ9x7UDze9UGzNsYundxrp
+lez8RTE25CPGY15kYaypo6h8JvWRV6oNUdPfrSnT71irdC+B3J6XNQ2UiA80XbeA
+7UkqOfTJUbiNjdvm7AQ5umlVZyT+jybxHGIMrZXc3lx7bA7p1P7jz57RXdqq+ReN
+kqstVGcFwnpRhHLJq/Aya4bzH8STO5uNcxJPWC1ZQzIdCgylWFnazp0StNNPKZjc
+pUS9kyNlrRkwq3JEFUigep7q1fWanvpwMqpRswS2kcS412GuwEHsWpO0YrwJxATY
+1DMJ+WMg1QHtuWBHFHfR98VBOzvnXXPZra2VIJxAH+RHCvZUu7gJYwBJ2y58KnmW
+hhuWO1SXSLQ5RvIn74yWRs2vjlVwnWyP0RpM+uiQpCkQBNG/st4EKCqvrt3fpvlK
+Zhl2eqrPsGjD74M7e+lvEpcd2x4q2gcD0LrBhwLNWb60ISI72F19tKPHKlY+CWxr
+b1QiA7uy15iKL1Hs+n0+3Mhv2ypvRlYuCLlBgdhYpG4qyEbbY1I4xkUaaqMEPkgO
+hD0pR4uA/O60yBLwA+97SC2UgKJRwxSSfleDzVZ+m43FwjCCBSAwggMIoAMCAQIC
+AQIwDQYJKoZIhvcNAQELBQAwIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVz
+dFJvb3QwHhcNMTUwMjI0MDA1OTUxWhcNMTcwMjEzMDA1OTUxWjAjMQ0wCwYDVQQK
+DARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4IC
+DwAwggIKAoICAQC/CikCVACXw4HmM4l0A8yn9I1UFzZIl2oyTriHbWKOh3+RZDt1
+1T2TGRfSANjbw5F8NSNZ1Cmj4dooZiiFa9NECTiCQi8jq+YbL4zDEkCZjS6mlRac
+dbEHvXb2F7ykk4+fzettHIxcDCqNuHEs7a3+e+0+w+ck1K5TQjTFgvn6FXG6nhan
+HsVcp0izJvSpNHGEuHt3p/GijvXozSX5Y4mxmCqOTdqeLdKllsoyHuIisQu5D5gK
+rggvqP6QL9gNFnktyGIiafMYK6nH0YX3XdWrRG+RmhqGIgt+V5eYar27VR7mRGIY
+C6+kPrqnX/GmKFz+3xmazTnjml68qkkMIiS3HNQhmQvESJW43q1M4TnoNF3GDE8s
+IsjozRm304/TzXZ2D7G7CkW+nV8qXVEcR3m8ydG8MDOuLdsnuRv/LMuyr33lpptv
+I5h+dnRFX0EVc8Gc9YjGj8qbeHDui7rRvGBPKXZtKC87CeZHU0kEFWcdrw1R+EOS
+yKvq8AmeR4cuYtiRbkDerBvhakdBw33PkODpNIDQVpqSgxgKxGG3YD2aTNthCtDQ
+cfHu3hGt+u5Lj/4V7W3ksLpwnDDqUk0xpJU1oRzZFZ+cqwZQ667Uuxd0J0S5NfoV
+YeET9h5GiJzTZ8q8pXzbuX4jHCR3+oSPOH8qQtVJ4DMJXSkoL5MzIPnPIQIDAQAB
+o2AwXjAdBgNVHQ4EFgQUm/mEBmr80usIk/vk7i/YwcKJeqcwHwYDVR0jBBgwFoAU
+ErnDSHntfTDJeHhhlFg3B0B2OBgwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMC
+AQYwDQYJKoZIhvcNAQELBQADggIBAHko1UaSH2sl3rAe4kTTe6NKbgVD3YVHTcrQ
+2UNlNDigwmz7SYVt89wQjHM3SSLDh90oirCyLKOc9hVNmDmVoSFyNv8EZ+W6Pr1e
+1IGs9Bz1q43dc+k32dKAOVv17P6cVuwQ94ZCF9HxS8U4/g6FLG6sb1LlqLn+r/Xc
+NQp0+HJPUdWV9P6P+j/V0h9EO2NgSuKZN78JQDJs6jxhhXe8Y24R+UFfy0yZOSo3
+ZnlNWn6TkVMzzrHAHGiXLlrhZllBUgfPSgIkVN0Bly/xhdtQnDsWldIIyvaTmgEz
+NkB8OePf+HuntepgBqV0OtzqNghrwVkDAXcXDmvhmkhoBjEDKAvL3WGTgAzxFuSH
+JoZytBIye/eFWZrjHMTYblWpfsXOi77Sv1c0YoPx0Dpz4XXh9Hdbo6M1evu2hWjV
+rSaVcWBikjDTXHuOQhToeycT5qrLNUIs2+kf//1Mj/wE2AUW2qiT2zvyURf/3McR
+lxSs2FrnrTj6F7+9S5KEDZYgfRfuMaZWV16kDdLLR+hFFORqSqFA2re86KpgWUxK
+OwzvJjn8y4z+ecM1NPU6EdPm5/79vIlqxdBbormEnbRT0R/A9v2Aioj4qgSPXYNK
+ke2Q8PYKuxoB16S7PMTB4TjKA4th2BirvO9+GKrfYdEfZBAE6SV9w7sQ4BFVKeZW
+h4C/lSDF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-good-withnext.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,317 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:42:58 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: good
+# This Update: Feb 28 00:42:58 2015 GMT
+# Next Update: Mar 1 00:42:58 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 04100F63A02D306A7951078F9E6F4C7A8A53
+# Signature Algorithm: sha1WithRSAEncryption
+# 49:b4:7f:24:29:9a:31:30:16:7d:23:74:53:83:e9:4c:db:08:
+# 09:20:c9:78:ea:3d:a5:df:25:fd:4e:de:88:24:35:0b:fa:6f:
+# 88:b0:6f:6a:92:c6:73:29:4d:1e:70:8c:e3:b2:42:df:f5:d2:
+# 0a:a1:4b:bb:77:af:97:07:05:d6:ec:6b:87:8d:ff:23:95:22:
+# 58:41:9f:15:70:44:33:4a:1e:0a:50:bb:17:56:dc:19:ef:a8:
+# 20:3f:71:8e:f2:04:4c:80:22:01:0b:ab:34:df:3d:ff:2e:04:
+# 0f:80:66:b2:bf:d0:9c:bf:73:39:18:06:bd:46:0e:0e:78:f1:
+# 40:bb:8c:59:23:0c:67:3c:bb:a9:bb:14:d9:39:fe:e8:44:87:
+# ae:39:98:a3:36:83:8f:20:ad:35:c7:36:58:c7:03:78:37:6d:
+# 6a:a0:5f:7d:87:6f:4f:37:04:3f:d1:fd:e4:c1:e1:70:07:4a:
+# c6:69:fa:7f:1d:82:1b:1d:b1:fa:d3:9c:82:42:f5:38:cf:4b:
+# 85:9b:fd:f2:4b:d1:81:7e:fc:70:41:f4:3a:7d:66:40:6b:c5:
+# 76:47:2a:f1:79:ff:a0:6f:13:6b:13:fe:86:c3:cd:6b:08:28:
+# 1f:64:c1:b1:23:1d:01:b0:aa:15:81:23:5b:ee:65:00:1d:ef:
+# 46:45:9c:1f
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+MIILYQoBAKCCC1owggtWBgkrBgEFBQcwAQEEggtHMIILQzCBw6EkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDI1OFowZTBj
+MDswCQYFKw4DAhoFAAQUEFZXi3QYEyYf2XEq2mAHf/fGHo8EFJv5hAZq/NLrCJP7
+5O4v2MHCiXqnAgIVAIAAGA8yMDE1MDIyODAwNDI1OFqgERgPMjAxNTAzMDEwMDQy
+NThaoSMwITAfBgkrBgEFBQcwAQIEEgQQD2OgLTBqeVEHj55vTHqKUzANBgkqhkiG
+9w0BAQUFAAOCAQEASbR/JCmaMTAWfSN0U4PpTNsICSDJeOo9pd8l/U7eiCQ1C/pv
+iLBvapLGcylNHnCM47JC3/XSCqFLu3evlwcF1uxrh43/I5UiWEGfFXBEM0oeClC7
+F1bcGe+oID9xjvIETIAiAQurNN89/y4ED4Bmsr/QnL9zORgGvUYODnjxQLuMWSMM
+Zzy7qbsU2Tn+6ESHrjmYozaDjyCtNcc2WMcDeDdtaqBffYdvTzcEP9H95MHhcAdK
+xmn6fx2CGx2x+tOcgkL1OM9LhZv98kvRgX78cEH0On1mQGvFdkcq8Xn/oG8TaxP+
+hsPNawgoH2TBsSMdAbCqFYEjW+5lAB3vRkWcH6CCCWUwgglhMIIEOTCCAiGgAwIB
+AgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVzdDESMBAGA1UEAwwJ
+VGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAxMjIyNFowIjENMAsG
+A1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhTyzOlFf3GSRaDDsgh
+fc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF8JcQiw5+e17UMqu1
+78PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5YRWmsVpRi48LEPAjq
+s7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViwjNpcJKX0pTZSHHbT
+WnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18hdPR9W4wBUKhiKuU
+HyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGjeDB2MB0GA1UdDgQW
+BBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb+YQGavzS6wiT++Tu
+L9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwkwDwYJ
+KwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMMC0o1FCXvNkhZhgfo
+wM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//XQHE4AaqgslkP+2J
+HtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUxNuQjxmNeZGGsqaOo
+fCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0yVG4jY3b5uwEObpp
+VWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRnBcJ6UYRyyavwMmuG
+8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMjZa0ZMKtyRBVIoHqe
+6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCfljINUB7blgRxR30ffF
+QTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtUl0i0OUbyJ++MlkbN
+r45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqqz7Bow++DO3vpbxKX
+HdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7steYii9R7Pp9PtzI
+b9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeLgPzutMgS8APve0gt
+lICiUcMUkn5Xg81WfpuNxcIwggUgMIIDCKADAgECAgECMA0GCSqGSIb3DQEBCwUA
+MCIxDTALBgNVBAoMBFRlc3QxETAPBgNVBAMMCFRlc3RSb290MB4XDTE1MDIyNDAw
+NTk1MVoXDTE3MDIxMzAwNTk1MVowIzENMAsGA1UECgwEVGVzdDESMBAGA1UEAwwJ
+VGVzdEludENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvwopAlQA
+l8OB5jOJdAPMp/SNVBc2SJdqMk64h21ijod/kWQ7ddU9kxkX0gDY28ORfDUjWdQp
+o+HaKGYohWvTRAk4gkIvI6vmGy+MwxJAmY0uppUWnHWxB7129he8pJOPn83rbRyM
+XAwqjbhxLO2t/nvtPsPnJNSuU0I0xYL5+hVxup4Wpx7FXKdIsyb0qTRxhLh7d6fx
+oo716M0l+WOJsZgqjk3ani3SpZbKMh7iIrELuQ+YCq4IL6j+kC/YDRZ5LchiImnz
+GCupx9GF913Vq0RvkZoahiILfleXmGq9u1Ue5kRiGAuvpD66p1/xpihc/t8Zms05
+45pevKpJDCIktxzUIZkLxEiVuN6tTOE56DRdxgxPLCLI6M0Zt9OP0812dg+xuwpF
+vp1fKl1RHEd5vMnRvDAzri3bJ7kb/yzLsq995aabbyOYfnZ0RV9BFXPBnPWIxo/K
+m3hw7ou60bxgTyl2bSgvOwnmR1NJBBVnHa8NUfhDksir6vAJnkeHLmLYkW5A3qwb
+4WpHQcN9z5Dg6TSA0FaakoMYCsRht2A9mkzbYQrQ0HHx7t4RrfruS4/+Fe1t5LC6
+cJww6lJNMaSVNaEc2RWfnKsGUOuu1LsXdCdEuTX6FWHhE/YeRoic02fKvKV827l+
+Ixwkd/qEjzh/KkLVSeAzCV0pKC+TMyD5zyECAwEAAaNgMF4wHQYDVR0OBBYEFJv5
+hAZq/NLrCJP75O4v2MHCiXqnMB8GA1UdIwQYMBaAFBK5w0h57X0wyXh4YZRYNwdA
+djgYMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBCwUA
+A4ICAQB5KNVGkh9rJd6wHuJE03ujSm4FQ92FR03K0NlDZTQ4oMJs+0mFbfPcEIxz
+N0kiw4fdKIqwsiyjnPYVTZg5laEhcjb/BGfluj69XtSBrPQc9auN3XPpN9nSgDlb
+9ez+nFbsEPeGQhfR8UvFOP4OhSxurG9S5ai5/q/13DUKdPhyT1HVlfT+j/o/1dIf
+RDtjYErimTe/CUAybOo8YYV3vGNuEflBX8tMmTkqN2Z5TVp+k5FTM86xwBxoly5a
+4WZZQVIHz0oCJFTdAZcv8YXbUJw7FpXSCMr2k5oBMzZAfDnj3/h7p7XqYAaldDrc
+6jYIa8FZAwF3Fw5r4ZpIaAYxAygLy91hk4AM8RbkhyaGcrQSMnv3hVma4xzE2G5V
+qX7Fzou+0r9XNGKD8dA6c+F14fR3W6OjNXr7toVo1a0mlXFgYpIw01x7jkIU6Hsn
+E+aqyzVCLNvpH//9TI/8BNgFFtqok9s78lEX/9zHEZcUrNha5604+he/vUuShA2W
+IH0X7jGmVldepA3Sy0foRRTkakqhQNq3vOiqYFlMSjsM7yY5/MuM/nnDNTT1OhHT
+5uf+/byJasXQW6K5hJ20U9EfwPb9gIqI+KoEj12DSpHtkPD2CrsaAdekuzzEweE4
+ygOLYdgYq7zvfhiq32HRH2QQBOklfcO7EOARVSnmVoeAv5UgxQ==
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-bad-sr-tag.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,60 @@
+# This is an invalid OCSP response and cannot be displayed using openssl's
+# ocsp utility. Below is an asn1parse of the BasicOCSPResponse. The bytes
+# normally corresponding to a nextUpdate field have been changed from
+# [CONTEXT 0] to an OCTET_STRING (see offset 170 below)
+#
+# 0:d=0 hl=4 l= 528 cons: SEQUENCE
+# 4:d=1 hl=3 l= 249 cons: SEQUENCE
+# 7:d=2 hl=2 l= 36 cons: cont [ 1 ]
+# 9:d=3 hl=2 l= 34 cons: SEQUENCE
+# 11:d=4 hl=2 l= 13 cons: SET
+# 13:d=5 hl=2 l= 11 cons: SEQUENCE
+# 15:d=6 hl=2 l= 3 prim: OBJECT :organizationName
+# 20:d=6 hl=2 l= 4 prim: UTF8STRING :Test
+# 26:d=4 hl=2 l= 17 cons: SET
+# 28:d=5 hl=2 l= 15 cons: SEQUENCE
+# 30:d=6 hl=2 l= 3 prim: OBJECT :commonName
+# 35:d=6 hl=2 l= 8 prim: UTF8STRING :TestOCSP
+# 45:d=2 hl=2 l= 15 prim: GENERALIZEDTIME :20150303165544Z
+# 62:d=2 hl=3 l= 154 cons: SEQUENCE
+# 65:d=3 hl=3 l= 151 cons: SEQUENCE
+# 68:d=4 hl=2 l= 59 cons: SEQUENCE
+# 70:d=5 hl=2 l= 9 cons: SEQUENCE
+# 72:d=6 hl=2 l= 5 prim: OBJECT :sha1
+# 79:d=6 hl=2 l= 0 prim: NULL
+# 81:d=5 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:1056578B741813261FD9712ADA60077FF7C61E8F
+# 103:d=5 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# 125:d=5 hl=2 l= 2 prim: INTEGER :1500
+# 129:d=4 hl=2 l= 22 cons: cont [ 1 ]
+# 131:d=5 hl=2 l= 15 prim: GENERALIZEDTIME :20150219155030Z
+# 148:d=5 hl=2 l= 3 cons: cont [ 0 ]
+# 150:d=6 hl=2 l= 1 prim: ENUMERATED :01
+# 153:d=4 hl=2 l= 15 prim: GENERALIZEDTIME :20150303165544Z
+# 170:d=4 hl=2 l= 17 prim: OCTET STRING [HEX DUMP]:180F32303135303330343136353534345A
+# 189:d=4 hl=2 l= 28 cons: cont [ 1 ]
+# 191:d=5 hl=2 l= 26 cons: SEQUENCE
+# 193:d=6 hl=2 l= 24 cons: SEQUENCE
+# 195:d=7 hl=2 l= 3 prim: OBJECT :Invalidity Date
+# 200:d=7 hl=2 l= 17 prim: OCTET STRING [HEX DUMP]:180F32303135303231393134303030305A
+# 219:d=2 hl=2 l= 35 cons: cont [ 1 ]
+# 221:d=3 hl=2 l= 33 cons: SEQUENCE
+# 223:d=4 hl=2 l= 31 cons: SEQUENCE
+# 225:d=5 hl=2 l= 9 prim: OBJECT :OCSP Nonce
+# 236:d=5 hl=2 l= 18 prim: OCTET STRING [HEX DUMP]:0410381EF873C4A3B4C64B22873751071B53
+# 256:d=1 hl=2 l= 13 cons: SEQUENCE
+# 258:d=2 hl=2 l= 9 prim: OBJECT :sha1WithRSAEncryption
+# 269:d=2 hl=2 l= 0 prim: NULL
+# 271:d=1 hl=4 l= 257 prim: BIT STRING
+
+MIICLgoBAKCCAicwggIjBgkrBgEFBQcwAQEEggIUMIICEDCB+aEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDMwMzE2NTU0NFowgZow
+gZcwOzAJBgUrDgMCGgUABBQQVleLdBgTJh/ZcSraYAd/98YejwQUm/mEBmr80usI
+k/vk7i/YwcKJeqcCAhUAoRYYDzIwMTUwMjE5MTU1MDMwWqADCgEBGA8yMDE1MDMw
+MzE2NTU0NFoEERgPMjAxNTAzMDQxNjU1NDRaoRwwGjAYBgNVHRgEERgPMjAxNTAy
+MTkxNDAwMDBaoSMwITAfBgkrBgEFBQcwAQIEEgQQOB74c8SjtMZLIoc3UQcbUzAN
+BgkqhkiG9w0BAQUFAAOCAQEAbcY28K9+oXtDfNb2yxlzauMaeEoD477ouC7DIwCb
+TgpkcjGCTjmvwg4A3sG95Z02x1xuW48XK2YkFytsBmdcfZvEnoK/WqG+qd9Aiytf
+NoecsMjF8MyatHcJdQ+jq59jPWAqMGWCPmPVZ6TxHF5Ag2DAU5aL5sAjY2zvxYnl
+Uc+FShl4K6Nk+mSSfu6ji8hkUEPx5rU1H0jBomMm4GMyNkxVj3NkOKSCxNWi/1Oe
+utUk8Eir8Krqfd7yOn0flfroHZ2I0zf95VduxvVCsN7pgAf8Q1BAkbuq/8JRNrDr
+a0kHSpO7QAv6iE7YT/SsHN5MDjtRJ780VEggV3td56R37g==
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-nocerts.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Mar 3 16:55:44 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: revoked
+# Revocation Time: Feb 19 15:50:30 2015 GMT
+# Revocation Reason: keyCompromise (0x1)
+# This Update: Mar 3 16:55:44 2015 GMT
+# Next Update: Mar 4 16:55:44 2015 GMT
+# Response Single Extensions:
+# Invalidity Date:
+# Feb 19 14:00:00 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 0410381EF873C4A3B4C64B22873751071B53
+# Signature Algorithm: sha1WithRSAEncryption
+# 6d:c6:36:f0:af:7e:a1:7b:43:7c:d6:f6:cb:19:73:6a:e3:1a:
+# 78:4a:03:e3:be:e8:b8:2e:c3:23:00:9b:4e:0a:64:72:31:82:
+# 4e:39:af:c2:0e:00:de:c1:bd:e5:9d:36:c7:5c:6e:5b:8f:17:
+# 2b:66:24:17:2b:6c:06:67:5c:7d:9b:c4:9e:82:bf:5a:a1:be:
+# a9:df:40:8b:2b:5f:36:87:9c:b0:c8:c5:f0:cc:9a:b4:77:09:
+# 75:0f:a3:ab:9f:63:3d:60:2a:30:65:82:3e:63:d5:67:a4:f1:
+# 1c:5e:40:83:60:c0:53:96:8b:e6:c0:23:63:6c:ef:c5:89:e5:
+# 51:cf:85:4a:19:78:2b:a3:64:fa:64:92:7e:ee:a3:8b:c8:64:
+# 50:43:f1:e6:b5:35:1f:48:c1:a2:63:26:e0:63:32:36:4c:55:
+# 8f:73:64:38:a4:82:c4:d5:a2:ff:53:9e:ba:d5:24:f0:48:ab:
+# f0:aa:ea:7d:de:f2:3a:7d:1f:95:fa:e8:1d:9d:88:d3:37:fd:
+# e5:57:6e:c6:f5:42:b0:de:e9:80:07:fc:43:50:40:91:bb:aa:
+# ff:c2:51:36:b0:eb:6b:49:07:4a:93:bb:40:0b:fa:88:4e:d8:
+# 4f:f4:ac:1c:de:4c:0e:3b:51:27:bf:34:54:48:20:57:7b:5d:
+# e7:a4:77:ee
+
+MIICLgoBAKCCAicwggIjBgkrBgEFBQcwAQEEggIUMIICEDCB+aEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDMwMzE2NTU0NFowgZow
+gZcwOzAJBgUrDgMCGgUABBQQVleLdBgTJh/ZcSraYAd/98YejwQUm/mEBmr80usI
+k/vk7i/YwcKJeqcCAhUAoRYYDzIwMTUwMjE5MTU1MDMwWqADCgEBGA8yMDE1MDMw
+MzE2NTU0NFqgERgPMjAxNTAzMDQxNjU1NDRaoRwwGjAYBgNVHRgEERgPMjAxNTAy
+MTkxNDAwMDBaoSMwITAfBgkrBgEFBQcwAQIEEgQQOB74c8SjtMZLIoc3UQcbUzAN
+BgkqhkiG9w0BAQUFAAOCAQEAbcY28K9+oXtDfNb2yxlzauMaeEoD477ouC7DIwCb
+TgpkcjGCTjmvwg4A3sG95Z02x1xuW48XK2YkFytsBmdcfZvEnoK/WqG+qd9Aiytf
+NoecsMjF8MyatHcJdQ+jq59jPWAqMGWCPmPVZ6TxHF5Ag2DAU5aL5sAjY2zvxYnl
+Uc+FShl4K6Nk+mSSfu6ji8hkUEPx5rU1H0jBomMm4GMyNkxVj3NkOKSCxNWi/1Oe
+utUk8Eir8Krqfd7yOn0flfroHZ2I0zf95VduxvVCsN7pgAf8Q1BAkbuq/8JRNrDr
+a0kHSpO7QAv6iE7YT/SsHN5MDjtRJ780VEggV3td56R37g==
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-nonext-noinv.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,317 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:45:34 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: revoked
+# Revocation Time: Feb 19 15:50:30 2015 GMT
+# This Update: Feb 28 00:45:34 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 04103E7008EC23A3AF6407E2DBADF1824550
+# Signature Algorithm: sha1WithRSAEncryption
+# 80:e7:3c:82:51:51:30:56:7c:9b:10:a3:14:62:86:b7:48:5f:
+# c7:18:3a:d6:a1:63:f4:8b:83:dc:87:0f:41:39:89:b6:60:40:
+# 11:5e:71:2a:dd:f0:c2:3d:bb:9a:9e:d5:05:c5:6a:6b:a1:02:
+# ab:1d:24:94:ae:70:77:19:ba:08:87:05:39:1a:73:82:77:bd:
+# f2:58:5b:a6:94:05:2e:2d:62:99:2d:ec:0a:cc:0c:89:5b:5d:
+# 94:dc:08:b4:79:96:18:4e:79:13:cd:2e:44:02:b3:af:b2:1f:
+# 66:99:2a:37:0a:7d:fb:1b:60:94:97:7a:68:dd:75:15:d3:97:
+# 00:6e:dc:45:b4:92:06:38:26:ce:71:e4:5a:5c:cd:67:1d:f6:
+# 4f:19:b1:51:83:8a:db:9a:cd:6b:63:a1:1f:ea:e5:23:62:20:
+# 73:41:28:bd:e8:51:c7:8a:79:8e:6b:dd:33:a0:a0:db:e5:23:
+# 59:a3:1d:84:48:f5:b2:20:1a:04:a2:ec:07:f6:1d:e5:06:1c:
+# ab:81:49:f1:ea:69:f8:34:8f:59:2a:ee:7a:97:f8:cf:c5:55:
+# 37:2b:fb:ab:8d:76:4f:48:94:16:34:3c:81:61:9a:ae:4b:b5:
+# 2c:39:df:d8:77:d0:02:0c:0c:51:99:1b:37:8e:6b:3f:9d:96:
+# 5a:09:4c:ae
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+MIILXwoBAKCCC1gwggtUBgkrBgEFBQcwAQEEggtFMIILQTCBwaEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDUzNFowYzBh
+MDswCQYFKw4DAhoFAAQUEFZXi3QYEyYf2XEq2mAHf/fGHo8EFJv5hAZq/NLrCJP7
+5O4v2MHCiXqnAgIVAKERGA8yMDE1MDIxOTE1NTAzMFoYDzIwMTUwMjI4MDA0NTM0
+WqEjMCEwHwYJKwYBBQUHMAECBBIEED5wCOwjo69kB+LbrfGCRVAwDQYJKoZIhvcN
+AQEFBQADggEBAIDnPIJRUTBWfJsQoxRihrdIX8cYOtahY/SLg9yHD0E5ibZgQBFe
+cSrd8MI9u5qe1QXFamuhAqsdJJSucHcZugiHBTkac4J3vfJYW6aUBS4tYpkt7ArM
+DIlbXZTcCLR5lhhOeRPNLkQCs6+yH2aZKjcKffsbYJSXemjddRXTlwBu3EW0kgY4
+Js5x5FpczWcd9k8ZsVGDituazWtjoR/q5SNiIHNBKL3oUceKeY5r3TOgoNvlI1mj
+HYRI9bIgGgSi7Af2HeUGHKuBSfHqafg0j1kq7nqX+M/FVTcr+6uNdk9IlBY0PIFh
+mq5LtSw539h30AIMDFGZGzeOaz+dlloJTK6gggllMIIJYTCCBDkwggIhoAMCAQIC
+AgEBMA0GCSqGSIb3DQEBCwUAMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRl
+c3RJbnRDQTAeFw0xNTAyMjQwMTIyMjRaFw0xNjAyMjQwMTIyMjRaMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQMIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEA0lyuEfbGrpe6Me0rtuHHWAPlm+54U8szpRX9xkkWgw7IIX3P
+qOsYMTIKYgxOx6WldZ3bcpDjWq5TChtZP706Z7G/mGSkhfCXEIsOfnte1DKrte/D
+3iLAEZDIN+RIsF78Gix6hSumvRhkCNPjuNirLrXY6BIuWEVprFaUYuPCxDwI6rO7
+pIl++4RelUlvuTNmGsJ/NlUYpyHkG3XA6MkCG5zxi7FYsIzaXCSl9KU2Uhx201px
+7vDIS2VYC9bWbCM70I/1OmbU9P00kMI1oW1wSTmmcT0NfIXT0fVuMAVCoYirlB8l
+8naFV8t3tp6jAyb/sUdxZyB1jYMQF2yak0v2MQIDAQABo3gwdjAdBgNVHQ4EFgQU
+WHiDDkdhwsngd6f+rZykXwDopmwwHwYDVR0jBBgwFoAUm/mEBmr80usIk/vk7i/Y
+wcKJeqcwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMJMA8GCSsG
+AQUFBzABBQQCBQAwDQYJKoZIhvcNAQELBQADggIBAFUTDAtKNRQl7zZIWYYH6MDN
+0JwZ0TZjhdHwRv+vOTeAvT7EiPpmLVcIlxsgADcwOBTP/10BxOAGqoLJZD/tiR7a
+KgLFHU+L0BXzJkOxqAn3HtQPN71QbM2xi6d3GumV7PxFMTbkI8ZjXmRhrKmjqHwm
+9ZFXqg1R09+tKdPvWKt0L4Hcnpc1DZSIDzRdt4DtSSo59MlRuI2N2+bsBDm6aVVn
+JP6PJvEcYgytldzeXHtsDunU/uPPntFd2qr5F42Sqy1UZwXCelGEcsmr8DJrhvMf
+xJM7m41zEk9YLVlDMh0KDKVYWdrOnRK0008pmNylRL2TI2WtGTCrckQVSKB6nurV
+9Zqe+nAyqlGzBLaRxLjXYa7AQexak7RivAnEBNjUMwn5YyDVAe25YEcUd9H3xUE7
+O+ddc9mtrZUgnEAf5EcK9lS7uAljAEnbLnwqeZaGG5Y7VJdItDlG8ifvjJZGza+O
+VXCdbI/RGkz66JCkKRAE0b+y3gQoKq+u3d+m+UpmGXZ6qs+waMPvgzt76W8Slx3b
+HiraBwPQusGHAs1ZvrQhIjvYXX20o8cqVj4JbGtvVCIDu7LXmIovUez6fT7cyG/b
+Km9GVi4IuUGB2FikbirIRttjUjjGRRpqowQ+SA6EPSlHi4D87rTIEvAD73tILZSA
+olHDFJJ+V4PNVn6bjcXCMIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAi
+MQ0wCwYDVQQKDARUZXN0MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5
+NTFaFw0xNzAyMTMwMDU5NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRl
+c3RJbnRDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfD
+geYziXQDzKf0jVQXNkiXajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh
+2ihmKIVr00QJOIJCLyOr5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwM
+Ko24cSztrf577T7D5yTUrlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO
+9ejNJfljibGYKo5N2p4t0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgr
+qcfRhfdd1atEb5GaGoYiC35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOa
+XryqSQwiJLcc1CGZC8RIlbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6d
+XypdURxHebzJ0bwwM64t2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4
+cO6LutG8YE8pdm0oLzsJ5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+Fq
+R0HDfc+Q4Ok0gNBWmpKDGArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCc
+MOpSTTGklTWhHNkVn5yrBlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMc
+JHf6hI84fypC1UngMwldKSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQG
+avzS6wiT++TuL9jBwol6pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4
+GDAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOC
+AgEAeSjVRpIfayXesB7iRNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJ
+IsOH3SiKsLIso5z2FU2YOZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs
+/pxW7BD3hkIX0fFLxTj+DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7
+Y2BK4pk3vwlAMmzqPGGFd7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFm
+WUFSB89KAiRU3QGXL/GF21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2
+CGvBWQMBdxcOa+GaSGgGMQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+
+xc6LvtK/VzRig/HQOnPhdeH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPm
+qss1Qizb6R///UyP/ATYBRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9
+F+4xplZXXqQN0stH6EUU5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn
+/v28iWrF0FuiuYSdtFPRH8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoD
+i2HYGKu8734Yqt9h0R9kEATpJX3DuxDgEVUp5laHgL+VIMU=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-nonext-withinv.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,323 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:47:40 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: revoked
+# Revocation Time: Feb 19 15:50:30 2015 GMT
+# Revocation Reason: keyCompromise (0x1)
+# This Update: Feb 28 00:47:40 2015 GMT
+# Response Single Extensions:
+# Invalidity Date:
+# Feb 19 14:00:00 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 0410DB5B1C50F6601DC4533D159DB197D8AE
+# Signature Algorithm: sha1WithRSAEncryption
+# c0:41:55:17:3d:df:31:a4:f6:9b:2a:24:cd:05:43:b2:e5:15:
+# fb:95:cf:19:a9:70:3b:58:d0:41:14:7d:b8:53:f3:ec:d5:ba:
+# e1:de:f8:a0:f8:3a:0e:b0:5c:50:81:5b:05:a5:5e:10:6f:46:
+# 8f:25:17:10:5c:33:7a:e8:70:6a:93:37:f7:75:4d:69:d3:3a:
+# 51:56:38:07:cd:42:70:09:92:ae:e8:8e:d8:52:b0:e9:3f:64:
+# c2:0a:98:63:15:0c:d7:36:90:72:9f:fb:ac:4c:4d:cb:92:ce:
+# 87:54:b6:49:3b:a8:f5:9c:cd:9f:11:69:f1:af:68:c1:76:4a:
+# c0:90:58:2e:81:e2:e9:28:af:83:06:c3:ae:34:95:ad:42:75:
+# cd:7b:50:12:9c:3a:50:86:b4:36:36:ac:3f:27:2a:6f:06:31:
+# cd:27:7f:f0:eb:8d:c2:e6:37:dd:39:03:e5:0e:a2:83:26:71:
+# bf:dd:a6:4c:a0:fe:47:94:65:82:f3:27:89:78:e0:3b:a5:30:
+# a6:12:9e:1d:0d:fc:c3:41:fc:53:29:e6:04:ab:c0:00:d2:2d:
+# f8:13:d8:b9:e6:64:10:d2:a7:02:e7:3e:aa:ac:52:67:69:46:
+# 3b:8f:a2:96:4f:b3:55:fc:e8:c1:90:61:71:f5:a0:c8:3c:b6:
+# 48:60:c8:5c
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+
+MIILhAoBAKCCC30wggt5BgkrBgEFBQcwAQEEggtqMIILZjCB5qEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDc0MFowgYcw
+gYQwOzAJBgUrDgMCGgUABBQQVleLdBgTJh/ZcSraYAd/98YejwQUm/mEBmr80usI
+k/vk7i/YwcKJeqcCAhUAoRYYDzIwMTUwMjE5MTU1MDMwWqADCgEBGA8yMDE1MDIy
+ODAwNDc0MFqhHDAaMBgGA1UdGAQRGA8yMDE1MDIxOTE0MDAwMFqhIzAhMB8GCSsG
+AQUFBzABAgQSBBDbWxxQ9mAdxFM9FZ2xl9iuMA0GCSqGSIb3DQEBBQUAA4IBAQDA
+QVUXPd8xpPabKiTNBUOy5RX7lc8ZqXA7WNBBFH24U/Ps1brh3vig+DoOsFxQgVsF
+pV4Qb0aPJRcQXDN66HBqkzf3dU1p0zpRVjgHzUJwCZKu6I7YUrDpP2TCCphjFQzX
+NpByn/usTE3Lks6HVLZJO6j1nM2fEWnxr2jBdkrAkFgugeLpKK+DBsOuNJWtQnXN
+e1ASnDpQhrQ2Nqw/JypvBjHNJ3/w643C5jfdOQPlDqKDJnG/3aZMoP5HlGWC8yeJ
+eOA7pTCmEp4dDfzDQfxTKeYEq8AA0i34E9i55mQQ0qcC5z6qrFJnaUY7j6KWT7NV
+/OjBkGFx9aDIPLZIYMhcoIIJZTCCCWEwggQ5MIICIaADAgECAgIBATANBgkqhkiG
+9w0BAQsFADAjMQ0wCwYDVQQKDARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwHhcN
+MTUwMjI0MDEyMjI0WhcNMTYwMjI0MDEyMjI0WjAiMQ0wCwYDVQQKDARUZXN0MREw
+DwYDVQQDDAhUZXN0T0NTUDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
+ANJcrhH2xq6XujHtK7bhx1gD5ZvueFPLM6UV/cZJFoMOyCF9z6jrGDEyCmIMTsel
+pXWd23KQ41quUwobWT+9Omexv5hkpIXwlxCLDn57XtQyq7Xvw94iwBGQyDfkSLBe
+/BoseoUrpr0YZAjT47jYqy612OgSLlhFaaxWlGLjwsQ8COqzu6SJfvuEXpVJb7kz
+ZhrCfzZVGKch5Bt1wOjJAhuc8YuxWLCM2lwkpfSlNlIcdtNace7wyEtlWAvW1mwj
+O9CP9Tpm1PT9NJDCNaFtcEk5pnE9DXyF09H1bjAFQqGIq5QfJfJ2hVfLd7aeowMm
+/7FHcWcgdY2DEBdsmpNL9jECAwEAAaN4MHYwHQYDVR0OBBYEFFh4gw5HYcLJ4Hen
+/q2cpF8A6KZsMB8GA1UdIwQYMBaAFJv5hAZq/NLrCJP75O4v2MHCiXqnMA4GA1Ud
+DwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDCTAPBgkrBgEFBQcwAQUEAgUA
+MA0GCSqGSIb3DQEBCwUAA4ICAQBVEwwLSjUUJe82SFmGB+jAzdCcGdE2Y4XR8Eb/
+rzk3gL0+xIj6Zi1XCJcbIAA3MDgUz/9dAcTgBqqCyWQ/7Yke2ioCxR1Pi9AV8yZD
+sagJ9x7UDze9UGzNsYundxrplez8RTE25CPGY15kYaypo6h8JvWRV6oNUdPfrSnT
+71irdC+B3J6XNQ2UiA80XbeA7UkqOfTJUbiNjdvm7AQ5umlVZyT+jybxHGIMrZXc
+3lx7bA7p1P7jz57RXdqq+ReNkqstVGcFwnpRhHLJq/Aya4bzH8STO5uNcxJPWC1Z
+QzIdCgylWFnazp0StNNPKZjcpUS9kyNlrRkwq3JEFUigep7q1fWanvpwMqpRswS2
+kcS412GuwEHsWpO0YrwJxATY1DMJ+WMg1QHtuWBHFHfR98VBOzvnXXPZra2VIJxA
+H+RHCvZUu7gJYwBJ2y58KnmWhhuWO1SXSLQ5RvIn74yWRs2vjlVwnWyP0RpM+uiQ
+pCkQBNG/st4EKCqvrt3fpvlKZhl2eqrPsGjD74M7e+lvEpcd2x4q2gcD0LrBhwLN
+Wb60ISI72F19tKPHKlY+CWxrb1QiA7uy15iKL1Hs+n0+3Mhv2ypvRlYuCLlBgdhY
+pG4qyEbbY1I4xkUaaqMEPkgOhD0pR4uA/O60yBLwA+97SC2UgKJRwxSSfleDzVZ+
+m43FwjCCBSAwggMIoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwIjENMAsGA1UECgwE
+VGVzdDERMA8GA1UEAwwIVGVzdFJvb3QwHhcNMTUwMjI0MDA1OTUxWhcNMTcwMjEz
+MDA1OTUxWjAjMQ0wCwYDVQQKDARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwggIi
+MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/CikCVACXw4HmM4l0A8yn9I1U
+FzZIl2oyTriHbWKOh3+RZDt11T2TGRfSANjbw5F8NSNZ1Cmj4dooZiiFa9NECTiC
+Qi8jq+YbL4zDEkCZjS6mlRacdbEHvXb2F7ykk4+fzettHIxcDCqNuHEs7a3+e+0+
+w+ck1K5TQjTFgvn6FXG6nhanHsVcp0izJvSpNHGEuHt3p/GijvXozSX5Y4mxmCqO
+TdqeLdKllsoyHuIisQu5D5gKrggvqP6QL9gNFnktyGIiafMYK6nH0YX3XdWrRG+R
+mhqGIgt+V5eYar27VR7mRGIYC6+kPrqnX/GmKFz+3xmazTnjml68qkkMIiS3HNQh
+mQvESJW43q1M4TnoNF3GDE8sIsjozRm304/TzXZ2D7G7CkW+nV8qXVEcR3m8ydG8
+MDOuLdsnuRv/LMuyr33lpptvI5h+dnRFX0EVc8Gc9YjGj8qbeHDui7rRvGBPKXZt
+KC87CeZHU0kEFWcdrw1R+EOSyKvq8AmeR4cuYtiRbkDerBvhakdBw33PkODpNIDQ
+VpqSgxgKxGG3YD2aTNthCtDQcfHu3hGt+u5Lj/4V7W3ksLpwnDDqUk0xpJU1oRzZ
+FZ+cqwZQ667Uuxd0J0S5NfoVYeET9h5GiJzTZ8q8pXzbuX4jHCR3+oSPOH8qQtVJ
+4DMJXSkoL5MzIPnPIQIDAQABo2AwXjAdBgNVHQ4EFgQUm/mEBmr80usIk/vk7i/Y
+wcKJeqcwHwYDVR0jBBgwFoAUErnDSHntfTDJeHhhlFg3B0B2OBgwDwYDVR0TAQH/
+BAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIBAHko1UaSH2sl
+3rAe4kTTe6NKbgVD3YVHTcrQ2UNlNDigwmz7SYVt89wQjHM3SSLDh90oirCyLKOc
+9hVNmDmVoSFyNv8EZ+W6Pr1e1IGs9Bz1q43dc+k32dKAOVv17P6cVuwQ94ZCF9Hx
+S8U4/g6FLG6sb1LlqLn+r/XcNQp0+HJPUdWV9P6P+j/V0h9EO2NgSuKZN78JQDJs
+6jxhhXe8Y24R+UFfy0yZOSo3ZnlNWn6TkVMzzrHAHGiXLlrhZllBUgfPSgIkVN0B
+ly/xhdtQnDsWldIIyvaTmgEzNkB8OePf+HuntepgBqV0OtzqNghrwVkDAXcXDmvh
+mkhoBjEDKAvL3WGTgAzxFuSHJoZytBIye/eFWZrjHMTYblWpfsXOi77Sv1c0YoPx
+0Dpz4XXh9Hdbo6M1evu2hWjVrSaVcWBikjDTXHuOQhToeycT5qrLNUIs2+kf//1M
+j/wE2AUW2qiT2zvyURf/3McRlxSs2FrnrTj6F7+9S5KEDZYgfRfuMaZWV16kDdLL
+R+hFFORqSqFA2re86KpgWUxKOwzvJjn8y4z+ecM1NPU6EdPm5/79vIlqxdBbormE
+nbRT0R/A9v2Aioj4qgSPXYNKke2Q8PYKuxoB16S7PMTB4TjKA4th2BirvO9+GKrf
+YdEfZBAE6SV9w7sQ4BFVKeZWh4C/lSDF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-sr-cont-reverse.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,61 @@
+# This is an invalid OCSP response and cannot be displayed using openssl's
+# ocsp utility. Below is an asn1parse of the BasicOCSPResponse. In this
+# case the singleExtensions field (offset 170) precedes the nextUpdate
+# (offset 200).
+#
+# 0:d=0 hl=4 l= 528 cons: SEQUENCE
+# 4:d=1 hl=3 l= 249 cons: SEQUENCE
+# 7:d=2 hl=2 l= 36 cons: cont [ 1 ]
+# 9:d=3 hl=2 l= 34 cons: SEQUENCE
+# 11:d=4 hl=2 l= 13 cons: SET
+# 13:d=5 hl=2 l= 11 cons: SEQUENCE
+# 15:d=6 hl=2 l= 3 prim: OBJECT :organizationName
+# 20:d=6 hl=2 l= 4 prim: UTF8STRING :Test
+# 26:d=4 hl=2 l= 17 cons: SET
+# 28:d=5 hl=2 l= 15 cons: SEQUENCE
+# 30:d=6 hl=2 l= 3 prim: OBJECT :commonName
+# 35:d=6 hl=2 l= 8 prim: UTF8STRING :TestOCSP
+# 45:d=2 hl=2 l= 15 prim: GENERALIZEDTIME :20150303165544Z
+# 62:d=2 hl=3 l= 154 cons: SEQUENCE
+# 65:d=3 hl=3 l= 151 cons: SEQUENCE
+# 68:d=4 hl=2 l= 59 cons: SEQUENCE
+# 70:d=5 hl=2 l= 9 cons: SEQUENCE
+# 72:d=6 hl=2 l= 5 prim: OBJECT :sha1
+# 79:d=6 hl=2 l= 0 prim: NULL
+# 81:d=5 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:1056578B741813261FD9712ADA60077FF7C61E8F
+# 103:d=5 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# 125:d=5 hl=2 l= 2 prim: INTEGER :1500
+# 129:d=4 hl=2 l= 22 cons: cont [ 1 ]
+# 131:d=5 hl=2 l= 15 prim: GENERALIZEDTIME :20150219155030Z
+# 148:d=5 hl=2 l= 3 cons: cont [ 0 ]
+# 150:d=6 hl=2 l= 1 prim: ENUMERATED :01
+# 153:d=4 hl=2 l= 15 prim: GENERALIZEDTIME :20150303165544Z
+# 170:d=4 hl=2 l= 28 cons: cont [ 1 ]
+# 172:d=5 hl=2 l= 26 cons: SEQUENCE
+# 174:d=6 hl=2 l= 24 cons: SEQUENCE
+# 176:d=7 hl=2 l= 3 prim: OBJECT :Invalidity Date
+# 181:d=7 hl=2 l= 17 prim: OCTET STRING [HEX DUMP]:180F32303135303231393134303030305A
+# 200:d=4 hl=2 l= 17 cons: cont [ 0 ]
+# 202:d=5 hl=2 l= 15 prim: GENERALIZEDTIME :20150304165544Z
+# 219:d=2 hl=2 l= 35 cons: cont [ 1 ]
+# 221:d=3 hl=2 l= 33 cons: SEQUENCE
+# 223:d=4 hl=2 l= 31 cons: SEQUENCE
+# 225:d=5 hl=2 l= 9 prim: OBJECT :OCSP Nonce
+# 236:d=5 hl=2 l= 18 prim: OCTET STRING [HEX DUMP]:0410381EF873C4A3B4C64B22873751071B53
+# 256:d=1 hl=2 l= 13 cons: SEQUENCE
+# 258:d=2 hl=2 l= 9 prim: OBJECT :sha1WithRSAEncryption
+# 269:d=2 hl=2 l= 0 prim: NULL
+# 271:d=1 hl=4 l= 257 prim: BIT STRING
+
+MIICLgoBAKCCAicwggIjBgkrBgEFBQcwAQEEggIUMIICEDCB+aEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDMwMzE2NTU0NFowgZow
+gZcwOzAJBgUrDgMCGgUABBQQVleLdBgTJh/ZcSraYAd/98YejwQUm/mEBmr80usI
+k/vk7i/YwcKJeqcCAhUAoRYYDzIwMTUwMjE5MTU1MDMwWqADCgEBGA8yMDE1MDMw
+MzE2NTU0NFqhHDAaMBgGA1UdGAQRGA8yMDE1MDIxOTE0MDAwMFqgERgPMjAxNTAz
+MDQxNjU1NDRaoSMwITAfBgkrBgEFBQcwAQIEEgQQOB74c8SjtMZLIoc3UQcbUzAN
+BgkqhkiG9w0BAQUFAAOCAQEAbcY28K9+oXtDfNb2yxlzauMaeEoD477ouC7DIwCb
+TgpkcjGCTjmvwg4A3sG95Z02x1xuW48XK2YkFytsBmdcfZvEnoK/WqG+qd9Aiytf
+NoecsMjF8MyatHcJdQ+jq59jPWAqMGWCPmPVZ6TxHF5Ag2DAU5aL5sAjY2zvxYnl
+Uc+FShl4K6Nk+mSSfu6ji8hkUEPx5rU1H0jBomMm4GMyNkxVj3NkOKSCxNWi/1Oe
+utUk8Eir8Krqfd7yOn0flfroHZ2I0zf95VduxvVCsN7pgAf8Q1BAkbuq/8JRNrDr
+a0kHSpO7QAv6iE7YT/SsHN5MDjtRJ780VEggV3td56R37g==
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-twonext.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,58 @@
+# This is an invalid OCSP response and cannot be displayed using openssl's
+# ocsp utility. Below is an asn1parse of the BasicOCSPResponse. Additional
+# bytes have been inserted into the SingleResponse which add a second
+# nextUpdate field (beginning at offset 189)
+#
+# 0:d=0 hl=4 l= 517 cons: SEQUENCE
+# 4:d=1 hl=3 l= 238 cons: SEQUENCE
+# 7:d=2 hl=2 l= 36 cons: cont [ 1 ]
+# 9:d=3 hl=2 l= 34 cons: SEQUENCE
+# 11:d=4 hl=2 l= 13 cons: SET
+# 13:d=5 hl=2 l= 11 cons: SEQUENCE
+# 15:d=6 hl=2 l= 3 prim: OBJECT :organizationName
+# 20:d=6 hl=2 l= 4 prim: UTF8STRING :Test
+# 26:d=4 hl=2 l= 17 cons: SET
+# 28:d=5 hl=2 l= 15 cons: SEQUENCE
+# 30:d=6 hl=2 l= 3 prim: OBJECT :commonName
+# 35:d=6 hl=2 l= 8 prim: UTF8STRING :TestOCSP
+# 45:d=2 hl=2 l= 15 prim: GENERALIZEDTIME :20150303165544Z
+# 62:d=2 hl=3 l= 143 cons: SEQUENCE
+# 65:d=3 hl=3 l= 140 cons: SEQUENCE
+# 68:d=4 hl=2 l= 59 cons: SEQUENCE
+# 70:d=5 hl=2 l= 9 cons: SEQUENCE
+# 72:d=6 hl=2 l= 5 prim: OBJECT :sha1
+# 79:d=6 hl=2 l= 0 prim: NULL
+# 81:d=5 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:1056578B741813261FD9712ADA60077FF7C61E8F
+# 103:d=5 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# 125:d=5 hl=2 l= 2 prim: INTEGER :1500
+# 129:d=4 hl=2 l= 22 cons: cont [ 1 ]
+# 131:d=5 hl=2 l= 15 prim: GENERALIZEDTIME :20150219155030Z
+# 148:d=5 hl=2 l= 3 cons: cont [ 0 ]
+# 150:d=6 hl=2 l= 1 prim: ENUMERATED :01
+# 153:d=4 hl=2 l= 15 prim: GENERALIZEDTIME :20150303165544Z
+# 170:d=4 hl=2 l= 17 cons: cont [ 0 ]
+# 172:d=5 hl=2 l= 15 prim: GENERALIZEDTIME :20150304165544Z
+# 189:d=4 hl=2 l= 17 cons: cont [ 0 ]
+# 191:d=5 hl=2 l= 15 prim: GENERALIZEDTIME :20150304165544Z
+# 208:d=2 hl=2 l= 35 cons: cont [ 1 ]
+# 210:d=3 hl=2 l= 33 cons: SEQUENCE
+# 212:d=4 hl=2 l= 31 cons: SEQUENCE
+# 214:d=5 hl=2 l= 9 prim: OBJECT :OCSP Nonce
+# 225:d=5 hl=2 l= 18 prim: OCTET STRING [HEX DUMP]:0410381EF873C4A3B4C64B22873751071B53
+# 245:d=1 hl=2 l= 13 cons: SEQUENCE
+# 247:d=2 hl=2 l= 9 prim: OBJECT :sha1WithRSAEncryption
+# 258:d=2 hl=2 l= 0 prim: NULL
+# 260:d=1 hl=4 l= 257 prim: BIT STRING
+
+MIICIwoBAKCCAhwwggIYBgkrBgEFBQcwAQEEggIJMIICBTCB7qEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDMwMzE2NTU0NFowgY8w
+gYwwOzAJBgUrDgMCGgUABBQQVleLdBgTJh/ZcSraYAd/98YejwQUm/mEBmr80usI
+k/vk7i/YwcKJeqcCAhUAoRYYDzIwMTUwMjE5MTU1MDMwWqADCgEBGA8yMDE1MDMw
+MzE2NTU0NFqgERgPMjAxNTAzMDQxNjU1NDRaoBEYDzIwMTUwMzA0MTY1NTQ0WqEj
+MCEwHwYJKwYBBQUHMAECBBIEEDge+HPEo7TGSyKHN1EHG1MwDQYJKoZIhvcNAQEF
+BQADggEBAG3GNvCvfqF7Q3zW9ssZc2rjGnhKA+O+6LguwyMAm04KZHIxgk45r8IO
+AN7BveWdNsdcbluPFytmJBcrbAZnXH2bxJ6Cv1qhvqnfQIsrXzaHnLDIxfDMmrR3
+CXUPo6ufYz1gKjBlgj5j1Wek8RxeQINgwFOWi+bAI2Ns78WJ5VHPhUoZeCujZPpk
+kn7uo4vIZFBD8ea1NR9IwaJjJuBjMjZMVY9zZDikgsTVov9TnrrVJPBIq/Cq6n3e
+8jp9H5X66B2diNM3/eVXbsb1QrDe6YAH/ENQQJG7qv/CUTaw62tJB0qTu0AL+ohO
+2E/0rBzeTA47USe/NFRIIFd7Xeekd+4=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-withnext-noinv.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,319 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:46:08 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: revoked
+# Revocation Time: Feb 19 15:50:30 2015 GMT
+# This Update: Feb 28 00:46:08 2015 GMT
+# Next Update: Mar 1 00:46:08 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 041024C5D6772FC53AE6DE208A1C1D6F0913
+# Signature Algorithm: sha1WithRSAEncryption
+# a6:dd:66:77:7d:99:3a:0d:41:21:1a:d6:5a:67:8c:51:88:6f:
+# 77:44:f8:fc:35:99:14:b9:ef:67:c1:fe:5e:36:a1:b8:78:93:
+# 6e:c6:11:08:96:fc:a3:37:55:3c:b3:08:c5:d2:ce:c4:c8:59:
+# 32:1b:05:7c:33:65:66:41:2e:71:2b:d0:25:8d:f4:91:ef:f1:
+# c5:1e:16:55:6a:60:df:28:c8:3c:fe:44:74:4e:2f:80:36:58:
+# 62:56:d4:9a:00:82:49:81:b6:d7:ce:0a:b2:70:ae:69:8f:38:
+# 64:ff:c4:b4:52:34:ad:9d:50:d2:0a:d5:d0:93:2b:61:03:12:
+# 05:28:4f:91:b7:4c:f5:26:c3:a6:76:f9:62:d4:42:e1:ea:c1:
+# 13:e7:d8:a1:3a:49:fd:12:96:9d:c2:d0:45:fc:c1:fe:30:19:
+# fe:ff:73:b4:e4:03:0b:dc:6f:bf:41:b2:fe:23:20:c9:02:d8:
+# 11:3c:8b:f4:a3:07:3a:fe:c2:3d:d9:54:b2:b6:36:5b:3a:24:
+# cb:f3:e8:a7:97:de:62:5c:80:79:0d:cd:68:73:31:c8:ba:bc:
+# 7a:d3:26:04:2b:f0:08:45:ba:d3:21:2f:60:fc:c9:4b:24:8f:
+# ff:e6:6c:11:81:69:87:5f:f9:28:b7:65:6b:f4:ee:f3:ed:6c:
+# b4:c8:ae:0b
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+MIILcgoBAKCCC2swggtnBgkrBgEFBQcwAQEEggtYMIILVDCB1KEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDYwOFowdjB0
+MDswCQYFKw4DAhoFAAQUEFZXi3QYEyYf2XEq2mAHf/fGHo8EFJv5hAZq/NLrCJP7
+5O4v2MHCiXqnAgIVAKERGA8yMDE1MDIxOTE1NTAzMFoYDzIwMTUwMjI4MDA0NjA4
+WqARGA8yMDE1MDMwMTAwNDYwOFqhIzAhMB8GCSsGAQUFBzABAgQSBBAkxdZ3L8U6
+5t4gihwdbwkTMA0GCSqGSIb3DQEBBQUAA4IBAQCm3WZ3fZk6DUEhGtZaZ4xRiG93
+RPj8NZkUue9nwf5eNqG4eJNuxhEIlvyjN1U8swjF0s7EyFkyGwV8M2VmQS5xK9Al
+jfSR7/HFHhZVamDfKMg8/kR0Ti+ANlhiVtSaAIJJgbbXzgqycK5pjzhk/8S0UjSt
+nVDSCtXQkythAxIFKE+Rt0z1JsOmdvli1ELh6sET59ihOkn9EpadwtBF/MH+MBn+
+/3O05AML3G+/QbL+IyDJAtgRPIv0owc6/sI92VSytjZbOiTL8+inl95iXIB5Dc1o
+czHIurx60yYEK/AIRbrTIS9g/MlLJI//5mwRgWmHX/kot2Vr9O7z7Wy0yK4LoIIJ
+ZTCCCWEwggQ5MIICIaADAgECAgIBATANBgkqhkiG9w0BAQsFADAjMQ0wCwYDVQQK
+DARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwHhcNMTUwMjI0MDEyMjI0WhcNMTYw
+MjI0MDEyMjI0WjAiMQ0wCwYDVQQKDARUZXN0MREwDwYDVQQDDAhUZXN0T0NTUDCC
+ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANJcrhH2xq6XujHtK7bhx1gD
+5ZvueFPLM6UV/cZJFoMOyCF9z6jrGDEyCmIMTselpXWd23KQ41quUwobWT+9Omex
+v5hkpIXwlxCLDn57XtQyq7Xvw94iwBGQyDfkSLBe/BoseoUrpr0YZAjT47jYqy61
+2OgSLlhFaaxWlGLjwsQ8COqzu6SJfvuEXpVJb7kzZhrCfzZVGKch5Bt1wOjJAhuc
+8YuxWLCM2lwkpfSlNlIcdtNace7wyEtlWAvW1mwjO9CP9Tpm1PT9NJDCNaFtcEk5
+pnE9DXyF09H1bjAFQqGIq5QfJfJ2hVfLd7aeowMm/7FHcWcgdY2DEBdsmpNL9jEC
+AwEAAaN4MHYwHQYDVR0OBBYEFFh4gw5HYcLJ4Hen/q2cpF8A6KZsMB8GA1UdIwQY
+MBaAFJv5hAZq/NLrCJP75O4v2MHCiXqnMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUE
+DDAKBggrBgEFBQcDCTAPBgkrBgEFBQcwAQUEAgUAMA0GCSqGSIb3DQEBCwUAA4IC
+AQBVEwwLSjUUJe82SFmGB+jAzdCcGdE2Y4XR8Eb/rzk3gL0+xIj6Zi1XCJcbIAA3
+MDgUz/9dAcTgBqqCyWQ/7Yke2ioCxR1Pi9AV8yZDsagJ9x7UDze9UGzNsYundxrp
+lez8RTE25CPGY15kYaypo6h8JvWRV6oNUdPfrSnT71irdC+B3J6XNQ2UiA80XbeA
+7UkqOfTJUbiNjdvm7AQ5umlVZyT+jybxHGIMrZXc3lx7bA7p1P7jz57RXdqq+ReN
+kqstVGcFwnpRhHLJq/Aya4bzH8STO5uNcxJPWC1ZQzIdCgylWFnazp0StNNPKZjc
+pUS9kyNlrRkwq3JEFUigep7q1fWanvpwMqpRswS2kcS412GuwEHsWpO0YrwJxATY
+1DMJ+WMg1QHtuWBHFHfR98VBOzvnXXPZra2VIJxAH+RHCvZUu7gJYwBJ2y58KnmW
+hhuWO1SXSLQ5RvIn74yWRs2vjlVwnWyP0RpM+uiQpCkQBNG/st4EKCqvrt3fpvlK
+Zhl2eqrPsGjD74M7e+lvEpcd2x4q2gcD0LrBhwLNWb60ISI72F19tKPHKlY+CWxr
+b1QiA7uy15iKL1Hs+n0+3Mhv2ypvRlYuCLlBgdhYpG4qyEbbY1I4xkUaaqMEPkgO
+hD0pR4uA/O60yBLwA+97SC2UgKJRwxSSfleDzVZ+m43FwjCCBSAwggMIoAMCAQIC
+AQIwDQYJKoZIhvcNAQELBQAwIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVz
+dFJvb3QwHhcNMTUwMjI0MDA1OTUxWhcNMTcwMjEzMDA1OTUxWjAjMQ0wCwYDVQQK
+DARUZXN0MRIwEAYDVQQDDAlUZXN0SW50Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4IC
+DwAwggIKAoICAQC/CikCVACXw4HmM4l0A8yn9I1UFzZIl2oyTriHbWKOh3+RZDt1
+1T2TGRfSANjbw5F8NSNZ1Cmj4dooZiiFa9NECTiCQi8jq+YbL4zDEkCZjS6mlRac
+dbEHvXb2F7ykk4+fzettHIxcDCqNuHEs7a3+e+0+w+ck1K5TQjTFgvn6FXG6nhan
+HsVcp0izJvSpNHGEuHt3p/GijvXozSX5Y4mxmCqOTdqeLdKllsoyHuIisQu5D5gK
+rggvqP6QL9gNFnktyGIiafMYK6nH0YX3XdWrRG+RmhqGIgt+V5eYar27VR7mRGIY
+C6+kPrqnX/GmKFz+3xmazTnjml68qkkMIiS3HNQhmQvESJW43q1M4TnoNF3GDE8s
+IsjozRm304/TzXZ2D7G7CkW+nV8qXVEcR3m8ydG8MDOuLdsnuRv/LMuyr33lpptv
+I5h+dnRFX0EVc8Gc9YjGj8qbeHDui7rRvGBPKXZtKC87CeZHU0kEFWcdrw1R+EOS
+yKvq8AmeR4cuYtiRbkDerBvhakdBw33PkODpNIDQVpqSgxgKxGG3YD2aTNthCtDQ
+cfHu3hGt+u5Lj/4V7W3ksLpwnDDqUk0xpJU1oRzZFZ+cqwZQ667Uuxd0J0S5NfoV
+YeET9h5GiJzTZ8q8pXzbuX4jHCR3+oSPOH8qQtVJ4DMJXSkoL5MzIPnPIQIDAQAB
+o2AwXjAdBgNVHQ4EFgQUm/mEBmr80usIk/vk7i/YwcKJeqcwHwYDVR0jBBgwFoAU
+ErnDSHntfTDJeHhhlFg3B0B2OBgwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMC
+AQYwDQYJKoZIhvcNAQELBQADggIBAHko1UaSH2sl3rAe4kTTe6NKbgVD3YVHTcrQ
+2UNlNDigwmz7SYVt89wQjHM3SSLDh90oirCyLKOc9hVNmDmVoSFyNv8EZ+W6Pr1e
+1IGs9Bz1q43dc+k32dKAOVv17P6cVuwQ94ZCF9HxS8U4/g6FLG6sb1LlqLn+r/Xc
+NQp0+HJPUdWV9P6P+j/V0h9EO2NgSuKZN78JQDJs6jxhhXe8Y24R+UFfy0yZOSo3
+ZnlNWn6TkVMzzrHAHGiXLlrhZllBUgfPSgIkVN0Bly/xhdtQnDsWldIIyvaTmgEz
+NkB8OePf+HuntepgBqV0OtzqNghrwVkDAXcXDmvhmkhoBjEDKAvL3WGTgAzxFuSH
+JoZytBIye/eFWZrjHMTYblWpfsXOi77Sv1c0YoPx0Dpz4XXh9Hdbo6M1evu2hWjV
+rSaVcWBikjDTXHuOQhToeycT5qrLNUIs2+kf//1Mj/wE2AUW2qiT2zvyURf/3McR
+lxSs2FrnrTj6F7+9S5KEDZYgfRfuMaZWV16kDdLLR+hFFORqSqFA2re86KpgWUxK
+OwzvJjn8y4z+ecM1NPU6EdPm5/79vIlqxdBbormEnbRT0R/A9v2Aioj4qgSPXYNK
+ke2Q8PYKuxoB16S7PMTB4TjKA4th2BirvO9+GKrfYdEfZBAE6SV9w7sQ4BFVKeZW
+h4C/lSDF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/ocsp-rev-withnext-withinv.resp Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,323 @@
+#OCSP Response Data:
+# OCSP Response Status: successful (0x0)
+# Response Type: Basic OCSP Response
+# Version: 1 (0x0)
+# Responder Id: O = Test, CN = TestOCSP
+# Produced At: Feb 28 00:46:49 2015 GMT
+# Responses:
+# Certificate ID:
+# Hash Algorithm: sha1
+# Issuer Name Hash: 1056578B741813261FD9712ADA60077FF7C61E8F
+# Issuer Key Hash: 9BF984066AFCD2EB0893FBE4EE2FD8C1C2897AA7
+# Serial Number: 1500
+# Cert Status: revoked
+# Revocation Time: Feb 19 15:50:30 2015 GMT
+# Revocation Reason: keyCompromise (0x1)
+# This Update: Feb 28 00:46:49 2015 GMT
+# Next Update: Mar 1 00:46:49 2015 GMT
+# Response Single Extensions:
+# Invalidity Date:
+# Feb 19 14:00:00 2015 GMT
+#
+# Response Extensions:
+# OCSP Nonce:
+# 0410F17C49C52CC233FD13FDF79DE32B162D
+# Signature Algorithm: sha1WithRSAEncryption
+# 54:58:00:0a:36:2e:f5:4e:ba:1c:aa:72:e0:be:40:7a:c8:84:
+# 62:5e:2c:ce:bd:e9:7f:fb:fc:f8:e6:d4:e5:19:d2:a5:cd:5b:
+# 31:a5:bf:52:d7:89:29:73:98:e9:1e:c2:dc:e5:e2:6d:18:f1:
+# 18:8a:03:c5:01:e9:c3:3c:d1:a6:22:d4:77:42:83:7b:82:27:
+# f8:eb:89:b8:3f:50:10:fd:0b:59:6f:37:d4:2c:ef:cd:8f:83:
+# 4c:e1:92:e2:3b:cf:5c:b3:86:ed:c6:88:62:e1:53:3c:0f:e3:
+# 14:bb:3f:ad:53:de:d6:e3:4b:ab:e0:3f:c5:b9:2e:00:ec:67:
+# 01:6e:f4:3a:1f:e6:c3:78:b2:61:bd:7d:62:12:35:0e:ab:87:
+# ce:5d:0e:9d:5b:96:21:67:66:da:e4:48:b6:aa:0d:bc:d1:78:
+# ec:41:25:87:ee:d2:48:c1:d1:f5:59:17:1c:fb:43:89:df:4f:
+# 5a:d7:7a:62:a5:ef:aa:f4:b9:99:a5:34:f9:aa:15:d9:89:b2:
+# d4:38:c1:cd:f8:2d:fc:07:dd:10:7a:20:75:bd:1a:0d:23:24:
+# f8:59:0a:9b:56:ae:50:11:f6:b7:c6:8e:4a:c6:e5:f4:3f:5b:
+# 4b:a0:72:91:06:3e:a4:f1:6e:73:6f:d6:f3:3f:2b:6e:49:fb:
+# b0:bc:8a:91
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 257 (0x101)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestIntCA
+# Validity
+# Not Before: Feb 24 01:22:24 2015 GMT
+# Not After : Feb 24 01:22:24 2016 GMT
+# Subject: O=Test, CN=TestOCSP
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (2048 bit)
+# Modulus:
+# 00:d2:5c:ae:11:f6:c6:ae:97:ba:31:ed:2b:b6:e1:
+# c7:58:03:e5:9b:ee:78:53:cb:33:a5:15:fd:c6:49:
+# 16:83:0e:c8:21:7d:cf:a8:eb:18:31:32:0a:62:0c:
+# 4e:c7:a5:a5:75:9d:db:72:90:e3:5a:ae:53:0a:1b:
+# 59:3f:bd:3a:67:b1:bf:98:64:a4:85:f0:97:10:8b:
+# 0e:7e:7b:5e:d4:32:ab:b5:ef:c3:de:22:c0:11:90:
+# c8:37:e4:48:b0:5e:fc:1a:2c:7a:85:2b:a6:bd:18:
+# 64:08:d3:e3:b8:d8:ab:2e:b5:d8:e8:12:2e:58:45:
+# 69:ac:56:94:62:e3:c2:c4:3c:08:ea:b3:bb:a4:89:
+# 7e:fb:84:5e:95:49:6f:b9:33:66:1a:c2:7f:36:55:
+# 18:a7:21:e4:1b:75:c0:e8:c9:02:1b:9c:f1:8b:b1:
+# 58:b0:8c:da:5c:24:a5:f4:a5:36:52:1c:76:d3:5a:
+# 71:ee:f0:c8:4b:65:58:0b:d6:d6:6c:23:3b:d0:8f:
+# f5:3a:66:d4:f4:fd:34:90:c2:35:a1:6d:70:49:39:
+# a6:71:3d:0d:7c:85:d3:d1:f5:6e:30:05:42:a1:88:
+# ab:94:1f:25:f2:76:85:57:cb:77:b6:9e:a3:03:26:
+# ff:b1:47:71:67:20:75:8d:83:10:17:6c:9a:93:4b:
+# f6:31
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 58:78:83:0E:47:61:C2:C9:E0:77:A7:FE:AD:9C:A4:5F:00:E8:A6:6C
+# X509v3 Authority Key Identifier:
+# keyid:9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+#
+# X509v3 Key Usage: critical
+# Digital Signature
+# X509v3 Extended Key Usage:
+# OCSP Signing
+# OCSP No Check:
+#
+# Signature Algorithm: sha256WithRSAEncryption
+# 55:13:0c:0b:4a:35:14:25:ef:36:48:59:86:07:e8:c0:cd:d0:
+# 9c:19:d1:36:63:85:d1:f0:46:ff:af:39:37:80:bd:3e:c4:88:
+# fa:66:2d:57:08:97:1b:20:00:37:30:38:14:cf:ff:5d:01:c4:
+# e0:06:aa:82:c9:64:3f:ed:89:1e:da:2a:02:c5:1d:4f:8b:d0:
+# 15:f3:26:43:b1:a8:09:f7:1e:d4:0f:37:bd:50:6c:cd:b1:8b:
+# a7:77:1a:e9:95:ec:fc:45:31:36:e4:23:c6:63:5e:64:61:ac:
+# a9:a3:a8:7c:26:f5:91:57:aa:0d:51:d3:df:ad:29:d3:ef:58:
+# ab:74:2f:81:dc:9e:97:35:0d:94:88:0f:34:5d:b7:80:ed:49:
+# 2a:39:f4:c9:51:b8:8d:8d:db:e6:ec:04:39:ba:69:55:67:24:
+# fe:8f:26:f1:1c:62:0c:ad:95:dc:de:5c:7b:6c:0e:e9:d4:fe:
+# e3:cf:9e:d1:5d:da:aa:f9:17:8d:92:ab:2d:54:67:05:c2:7a:
+# 51:84:72:c9:ab:f0:32:6b:86:f3:1f:c4:93:3b:9b:8d:73:12:
+# 4f:58:2d:59:43:32:1d:0a:0c:a5:58:59:da:ce:9d:12:b4:d3:
+# 4f:29:98:dc:a5:44:bd:93:23:65:ad:19:30:ab:72:44:15:48:
+# a0:7a:9e:ea:d5:f5:9a:9e:fa:70:32:aa:51:b3:04:b6:91:c4:
+# b8:d7:61:ae:c0:41:ec:5a:93:b4:62:bc:09:c4:04:d8:d4:33:
+# 09:f9:63:20:d5:01:ed:b9:60:47:14:77:d1:f7:c5:41:3b:3b:
+# e7:5d:73:d9:ad:ad:95:20:9c:40:1f:e4:47:0a:f6:54:bb:b8:
+# 09:63:00:49:db:2e:7c:2a:79:96:86:1b:96:3b:54:97:48:b4:
+# 39:46:f2:27:ef:8c:96:46:cd:af:8e:55:70:9d:6c:8f:d1:1a:
+# 4c:fa:e8:90:a4:29:10:04:d1:bf:b2:de:04:28:2a:af:ae:dd:
+# df:a6:f9:4a:66:19:76:7a:aa:cf:b0:68:c3:ef:83:3b:7b:e9:
+# 6f:12:97:1d:db:1e:2a:da:07:03:d0:ba:c1:87:02:cd:59:be:
+# b4:21:22:3b:d8:5d:7d:b4:a3:c7:2a:56:3e:09:6c:6b:6f:54:
+# 22:03:bb:b2:d7:98:8a:2f:51:ec:fa:7d:3e:dc:c8:6f:db:2a:
+# 6f:46:56:2e:08:b9:41:81:d8:58:a4:6e:2a:c8:46:db:63:52:
+# 38:c6:45:1a:6a:a3:04:3e:48:0e:84:3d:29:47:8b:80:fc:ee:
+# b4:c8:12:f0:03:ef:7b:48:2d:94:80:a2:51:c3:14:92:7e:57:
+# 83:cd:56:7e:9b:8d:c5:c2
+#-----BEGIN CERTIFICATE-----
+#MIIEOTCCAiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVz
+#dDESMBAGA1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAx
+#MjIyNFowIjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0G
+#CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhT
+#yzOlFf3GSRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF
+#8JcQiw5+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5Y
+#RWmsVpRi48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViw
+#jNpcJKX0pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18
+#hdPR9W4wBUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGj
+#eDB2MB0GA1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb
+#+YQGavzS6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI
+#KwYBBQUHAwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMM
+#C0o1FCXvNkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//
+#XQHE4AaqgslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUx
+#NuQjxmNeZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0
+#yVG4jY3b5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRn
+#BcJ6UYRyyavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMj
+#Za0ZMKtyRBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCflj
+#INUB7blgRxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtU
+#l0i0OUbyJ++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqq
+#z7Bow++DO3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7
+#steYii9R7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeL
+#gPzutMgS8APve0gtlICiUcMUkn5Xg81WfpuNxcI=
+#-----END CERTIFICATE-----
+#Certificate:
+# Data:
+# Version: 3 (0x2)
+# Serial Number: 2 (0x2)
+# Signature Algorithm: sha256WithRSAEncryption
+# Issuer: O=Test, CN=TestRoot
+# Validity
+# Not Before: Feb 24 00:59:51 2015 GMT
+# Not After : Feb 13 00:59:51 2017 GMT
+# Subject: O=Test, CN=TestIntCA
+# Subject Public Key Info:
+# Public Key Algorithm: rsaEncryption
+# Public-Key: (4096 bit)
+# Modulus:
+# 00:bf:0a:29:02:54:00:97:c3:81:e6:33:89:74:03:
+# cc:a7:f4:8d:54:17:36:48:97:6a:32:4e:b8:87:6d:
+# 62:8e:87:7f:91:64:3b:75:d5:3d:93:19:17:d2:00:
+# d8:db:c3:91:7c:35:23:59:d4:29:a3:e1:da:28:66:
+# 28:85:6b:d3:44:09:38:82:42:2f:23:ab:e6:1b:2f:
+# 8c:c3:12:40:99:8d:2e:a6:95:16:9c:75:b1:07:bd:
+# 76:f6:17:bc:a4:93:8f:9f:cd:eb:6d:1c:8c:5c:0c:
+# 2a:8d:b8:71:2c:ed:ad:fe:7b:ed:3e:c3:e7:24:d4:
+# ae:53:42:34:c5:82:f9:fa:15:71:ba:9e:16:a7:1e:
+# c5:5c:a7:48:b3:26:f4:a9:34:71:84:b8:7b:77:a7:
+# f1:a2:8e:f5:e8:cd:25:f9:63:89:b1:98:2a:8e:4d:
+# da:9e:2d:d2:a5:96:ca:32:1e:e2:22:b1:0b:b9:0f:
+# 98:0a:ae:08:2f:a8:fe:90:2f:d8:0d:16:79:2d:c8:
+# 62:22:69:f3:18:2b:a9:c7:d1:85:f7:5d:d5:ab:44:
+# 6f:91:9a:1a:86:22:0b:7e:57:97:98:6a:bd:bb:55:
+# 1e:e6:44:62:18:0b:af:a4:3e:ba:a7:5f:f1:a6:28:
+# 5c:fe:df:19:9a:cd:39:e3:9a:5e:bc:aa:49:0c:22:
+# 24:b7:1c:d4:21:99:0b:c4:48:95:b8:de:ad:4c:e1:
+# 39:e8:34:5d:c6:0c:4f:2c:22:c8:e8:cd:19:b7:d3:
+# 8f:d3:cd:76:76:0f:b1:bb:0a:45:be:9d:5f:2a:5d:
+# 51:1c:47:79:bc:c9:d1:bc:30:33:ae:2d:db:27:b9:
+# 1b:ff:2c:cb:b2:af:7d:e5:a6:9b:6f:23:98:7e:76:
+# 74:45:5f:41:15:73:c1:9c:f5:88:c6:8f:ca:9b:78:
+# 70:ee:8b:ba:d1:bc:60:4f:29:76:6d:28:2f:3b:09:
+# e6:47:53:49:04:15:67:1d:af:0d:51:f8:43:92:c8:
+# ab:ea:f0:09:9e:47:87:2e:62:d8:91:6e:40:de:ac:
+# 1b:e1:6a:47:41:c3:7d:cf:90:e0:e9:34:80:d0:56:
+# 9a:92:83:18:0a:c4:61:b7:60:3d:9a:4c:db:61:0a:
+# d0:d0:71:f1:ee:de:11:ad:fa:ee:4b:8f:fe:15:ed:
+# 6d:e4:b0:ba:70:9c:30:ea:52:4d:31:a4:95:35:a1:
+# 1c:d9:15:9f:9c:ab:06:50:eb:ae:d4:bb:17:74:27:
+# 44:b9:35:fa:15:61:e1:13:f6:1e:46:88:9c:d3:67:
+# ca:bc:a5:7c:db:b9:7e:23:1c:24:77:fa:84:8f:38:
+# 7f:2a:42:d5:49:e0:33:09:5d:29:28:2f:93:33:20:
+# f9:cf:21
+# Exponent: 65537 (0x10001)
+# X509v3 extensions:
+# X509v3 Subject Key Identifier:
+# 9B:F9:84:06:6A:FC:D2:EB:08:93:FB:E4:EE:2F:D8:C1:C2:89:7A:A7
+# X509v3 Authority Key Identifier:
+# keyid:12:B9:C3:48:79:ED:7D:30:C9:78:78:61:94:58:37:07:40:76:38:18
+#
+# X509v3 Basic Constraints: critical
+# CA:TRUE
+# X509v3 Key Usage:
+# Certificate Sign, CRL Sign
+# Signature Algorithm: sha256WithRSAEncryption
+# 79:28:d5:46:92:1f:6b:25:de:b0:1e:e2:44:d3:7b:a3:4a:6e:
+# 05:43:dd:85:47:4d:ca:d0:d9:43:65:34:38:a0:c2:6c:fb:49:
+# 85:6d:f3:dc:10:8c:73:37:49:22:c3:87:dd:28:8a:b0:b2:2c:
+# a3:9c:f6:15:4d:98:39:95:a1:21:72:36:ff:04:67:e5:ba:3e:
+# bd:5e:d4:81:ac:f4:1c:f5:ab:8d:dd:73:e9:37:d9:d2:80:39:
+# 5b:f5:ec:fe:9c:56:ec:10:f7:86:42:17:d1:f1:4b:c5:38:fe:
+# 0e:85:2c:6e:ac:6f:52:e5:a8:b9:fe:af:f5:dc:35:0a:74:f8:
+# 72:4f:51:d5:95:f4:fe:8f:fa:3f:d5:d2:1f:44:3b:63:60:4a:
+# e2:99:37:bf:09:40:32:6c:ea:3c:61:85:77:bc:63:6e:11:f9:
+# 41:5f:cb:4c:99:39:2a:37:66:79:4d:5a:7e:93:91:53:33:ce:
+# b1:c0:1c:68:97:2e:5a:e1:66:59:41:52:07:cf:4a:02:24:54:
+# dd:01:97:2f:f1:85:db:50:9c:3b:16:95:d2:08:ca:f6:93:9a:
+# 01:33:36:40:7c:39:e3:df:f8:7b:a7:b5:ea:60:06:a5:74:3a:
+# dc:ea:36:08:6b:c1:59:03:01:77:17:0e:6b:e1:9a:48:68:06:
+# 31:03:28:0b:cb:dd:61:93:80:0c:f1:16:e4:87:26:86:72:b4:
+# 12:32:7b:f7:85:59:9a:e3:1c:c4:d8:6e:55:a9:7e:c5:ce:8b:
+# be:d2:bf:57:34:62:83:f1:d0:3a:73:e1:75:e1:f4:77:5b:a3:
+# a3:35:7a:fb:b6:85:68:d5:ad:26:95:71:60:62:92:30:d3:5c:
+# 7b:8e:42:14:e8:7b:27:13:e6:aa:cb:35:42:2c:db:e9:1f:ff:
+# fd:4c:8f:fc:04:d8:05:16:da:a8:93:db:3b:f2:51:17:ff:dc:
+# c7:11:97:14:ac:d8:5a:e7:ad:38:fa:17:bf:bd:4b:92:84:0d:
+# 96:20:7d:17:ee:31:a6:56:57:5e:a4:0d:d2:cb:47:e8:45:14:
+# e4:6a:4a:a1:40:da:b7:bc:e8:aa:60:59:4c:4a:3b:0c:ef:26:
+# 39:fc:cb:8c:fe:79:c3:35:34:f5:3a:11:d3:e6:e7:fe:fd:bc:
+# 89:6a:c5:d0:5b:a2:b9:84:9d:b4:53:d1:1f:c0:f6:fd:80:8a:
+# 88:f8:aa:04:8f:5d:83:4a:91:ed:90:f0:f6:0a:bb:1a:01:d7:
+# a4:bb:3c:c4:c1:e1:38:ca:03:8b:61:d8:18:ab:bc:ef:7e:18:
+# aa:df:61:d1:1f:64:10:04:e9:25:7d:c3:bb:10:e0:11:55:29:
+# e6:56:87:80:bf:95:20:c5
+#-----BEGIN CERTIFICATE-----
+#MIIFIDCCAwigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMQ0wCwYDVQQKDARUZXN0
+#MREwDwYDVQQDDAhUZXN0Um9vdDAeFw0xNTAyMjQwMDU5NTFaFw0xNzAyMTMwMDU5
+#NTFaMCMxDTALBgNVBAoMBFRlc3QxEjAQBgNVBAMMCVRlc3RJbnRDQTCCAiIwDQYJ
+#KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL8KKQJUAJfDgeYziXQDzKf0jVQXNkiX
+#ajJOuIdtYo6Hf5FkO3XVPZMZF9IA2NvDkXw1I1nUKaPh2ihmKIVr00QJOIJCLyOr
+#5hsvjMMSQJmNLqaVFpx1sQe9dvYXvKSTj5/N620cjFwMKo24cSztrf577T7D5yTU
+#rlNCNMWC+foVcbqeFqcexVynSLMm9Kk0cYS4e3en8aKO9ejNJfljibGYKo5N2p4t
+#0qWWyjIe4iKxC7kPmAquCC+o/pAv2A0WeS3IYiJp8xgrqcfRhfdd1atEb5GaGoYi
+#C35Xl5hqvbtVHuZEYhgLr6Q+uqdf8aYoXP7fGZrNOeOaXryqSQwiJLcc1CGZC8RI
+#lbjerUzhOeg0XcYMTywiyOjNGbfTj9PNdnYPsbsKRb6dXypdURxHebzJ0bwwM64t
+#2ye5G/8sy7KvfeWmm28jmH52dEVfQRVzwZz1iMaPypt4cO6LutG8YE8pdm0oLzsJ
+#5kdTSQQVZx2vDVH4Q5LIq+rwCZ5Hhy5i2JFuQN6sG+FqR0HDfc+Q4Ok0gNBWmpKD
+#GArEYbdgPZpM22EK0NBx8e7eEa367kuP/hXtbeSwunCcMOpSTTGklTWhHNkVn5yr
+#BlDrrtS7F3QnRLk1+hVh4RP2HkaInNNnyrylfNu5fiMcJHf6hI84fypC1UngMwld
+#KSgvkzMg+c8hAgMBAAGjYDBeMB0GA1UdDgQWBBSb+YQGavzS6wiT++TuL9jBwol6
+#pzAfBgNVHSMEGDAWgBQSucNIee19MMl4eGGUWDcHQHY4GDAPBgNVHRMBAf8EBTAD
+#AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAeSjVRpIfayXesB7i
+#RNN7o0puBUPdhUdNytDZQ2U0OKDCbPtJhW3z3BCMczdJIsOH3SiKsLIso5z2FU2Y
+#OZWhIXI2/wRn5bo+vV7Ugaz0HPWrjd1z6TfZ0oA5W/Xs/pxW7BD3hkIX0fFLxTj+
+#DoUsbqxvUuWouf6v9dw1CnT4ck9R1ZX0/o/6P9XSH0Q7Y2BK4pk3vwlAMmzqPGGF
+#d7xjbhH5QV/LTJk5KjdmeU1afpORUzPOscAcaJcuWuFmWUFSB89KAiRU3QGXL/GF
+#21CcOxaV0gjK9pOaATM2QHw549/4e6e16mAGpXQ63Oo2CGvBWQMBdxcOa+GaSGgG
+#MQMoC8vdYZOADPEW5IcmhnK0EjJ794VZmuMcxNhuVal+xc6LvtK/VzRig/HQOnPh
+#deH0d1ujozV6+7aFaNWtJpVxYGKSMNNce45CFOh7JxPmqss1Qizb6R///UyP/ATY
+#BRbaqJPbO/JRF//cxxGXFKzYWuetOPoXv71LkoQNliB9F+4xplZXXqQN0stH6EUU
+#5GpKoUDat7zoqmBZTEo7DO8mOfzLjP55wzU09ToR0+bn/v28iWrF0FuiuYSdtFPR
+#H8D2/YCKiPiqBI9dg0qR7ZDw9gq7GgHXpLs8xMHhOMoDi2HYGKu8734Yqt9h0R9k
+#EATpJX3DuxDgEVUp5laHgL+VIMU=
+#-----END CERTIFICATE-----
+
+MIILlwoBAKCCC5AwgguMBgkrBgEFBQcwAQEEggt9MIILeTCB+aEkMCIxDTALBgNV
+BAoMBFRlc3QxETAPBgNVBAMMCFRlc3RPQ1NQGA8yMDE1MDIyODAwNDY0OVowgZow
+gZcwOzAJBgUrDgMCGgUABBQQVleLdBgTJh/ZcSraYAd/98YejwQUm/mEBmr80usI
+k/vk7i/YwcKJeqcCAhUAoRYYDzIwMTUwMjE5MTU1MDMwWqADCgEBGA8yMDE1MDIy
+ODAwNDY0OVqgERgPMjAxNTAzMDEwMDQ2NDlaoRwwGjAYBgNVHRgEERgPMjAxNTAy
+MTkxNDAwMDBaoSMwITAfBgkrBgEFBQcwAQIEEgQQ8XxJxSzCM/0T/fed4ysWLTAN
+BgkqhkiG9w0BAQUFAAOCAQEAVFgACjYu9U66HKpy4L5AesiEYl4szr3pf/v8+ObU
+5RnSpc1bMaW/UteJKXOY6R7C3OXibRjxGIoDxQHpwzzRpiLUd0KDe4In+OuJuD9Q
+EP0LWW831CzvzY+DTOGS4jvPXLOG7caIYuFTPA/jFLs/rVPe1uNLq+A/xbkuAOxn
+AW70Oh/mw3iyYb19YhI1DquHzl0OnVuWIWdm2uRItqoNvNF47EElh+7SSMHR9VkX
+HPtDid9PWtd6YqXvqvS5maU0+aoV2Ymy1DjBzfgt/AfdEHogdb0aDSMk+FkKm1au
+UBH2t8aOSsbl9D9bS6BykQY+pPFuc2/W8z8rbkn7sLyKkaCCCWUwgglhMIIEOTCC
+AiGgAwIBAgICAQEwDQYJKoZIhvcNAQELBQAwIzENMAsGA1UECgwEVGVzdDESMBAG
+A1UEAwwJVGVzdEludENBMB4XDTE1MDIyNDAxMjIyNFoXDTE2MDIyNDAxMjIyNFow
+IjENMAsGA1UECgwEVGVzdDERMA8GA1UEAwwIVGVzdE9DU1AwggEiMA0GCSqGSIb3
+DQEBAQUAA4IBDwAwggEKAoIBAQDSXK4R9saul7ox7Su24cdYA+Wb7nhTyzOlFf3G
+SRaDDsghfc+o6xgxMgpiDE7HpaV1ndtykONarlMKG1k/vTpnsb+YZKSF8JcQiw5+
+e17UMqu178PeIsARkMg35EiwXvwaLHqFK6a9GGQI0+O42KsutdjoEi5YRWmsVpRi
+48LEPAjqs7ukiX77hF6VSW+5M2Yawn82VRinIeQbdcDoyQIbnPGLsViwjNpcJKX0
+pTZSHHbTWnHu8MhLZVgL1tZsIzvQj/U6ZtT0/TSQwjWhbXBJOaZxPQ18hdPR9W4w
+BUKhiKuUHyXydoVXy3e2nqMDJv+xR3FnIHWNgxAXbJqTS/YxAgMBAAGjeDB2MB0G
+A1UdDgQWBBRYeIMOR2HCyeB3p/6tnKRfAOimbDAfBgNVHSMEGDAWgBSb+YQGavzS
+6wiT++TuL9jBwol6pzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUH
+AwkwDwYJKwYBBQUHMAEFBAIFADANBgkqhkiG9w0BAQsFAAOCAgEAVRMMC0o1FCXv
+NkhZhgfowM3QnBnRNmOF0fBG/685N4C9PsSI+mYtVwiXGyAANzA4FM//XQHE4Aaq
+gslkP+2JHtoqAsUdT4vQFfMmQ7GoCfce1A83vVBszbGLp3ca6ZXs/EUxNuQjxmNe
+ZGGsqaOofCb1kVeqDVHT360p0+9Yq3QvgdyelzUNlIgPNF23gO1JKjn0yVG4jY3b
+5uwEObppVWck/o8m8RxiDK2V3N5ce2wO6dT+48+e0V3aqvkXjZKrLVRnBcJ6UYRy
+yavwMmuG8x/EkzubjXMST1gtWUMyHQoMpVhZ2s6dErTTTymY3KVEvZMjZa0ZMKty
+RBVIoHqe6tX1mp76cDKqUbMEtpHEuNdhrsBB7FqTtGK8CcQE2NQzCfljINUB7blg
+RxR30ffFQTs7511z2a2tlSCcQB/kRwr2VLu4CWMASdsufCp5loYbljtUl0i0OUby
+J++MlkbNr45VcJ1sj9EaTProkKQpEATRv7LeBCgqr67d36b5SmYZdnqqz7Bow++D
+O3vpbxKXHdseKtoHA9C6wYcCzVm+tCEiO9hdfbSjxypWPglsa29UIgO7steYii9R
+7Pp9PtzIb9sqb0ZWLgi5QYHYWKRuKshG22NSOMZFGmqjBD5IDoQ9KUeLgPzutMgS
+8APve0gtlICiUcMUkn5Xg81WfpuNxcIwggUgMIIDCKADAgECAgECMA0GCSqGSIb3
+DQEBCwUAMCIxDTALBgNVBAoMBFRlc3QxETAPBgNVBAMMCFRlc3RSb290MB4XDTE1
+MDIyNDAwNTk1MVoXDTE3MDIxMzAwNTk1MVowIzENMAsGA1UECgwEVGVzdDESMBAG
+A1UEAwwJVGVzdEludENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA
+vwopAlQAl8OB5jOJdAPMp/SNVBc2SJdqMk64h21ijod/kWQ7ddU9kxkX0gDY28OR
+fDUjWdQpo+HaKGYohWvTRAk4gkIvI6vmGy+MwxJAmY0uppUWnHWxB7129he8pJOP
+n83rbRyMXAwqjbhxLO2t/nvtPsPnJNSuU0I0xYL5+hVxup4Wpx7FXKdIsyb0qTRx
+hLh7d6fxoo716M0l+WOJsZgqjk3ani3SpZbKMh7iIrELuQ+YCq4IL6j+kC/YDRZ5
+LchiImnzGCupx9GF913Vq0RvkZoahiILfleXmGq9u1Ue5kRiGAuvpD66p1/xpihc
+/t8Zms0545pevKpJDCIktxzUIZkLxEiVuN6tTOE56DRdxgxPLCLI6M0Zt9OP0812
+dg+xuwpFvp1fKl1RHEd5vMnRvDAzri3bJ7kb/yzLsq995aabbyOYfnZ0RV9BFXPB
+nPWIxo/Km3hw7ou60bxgTyl2bSgvOwnmR1NJBBVnHa8NUfhDksir6vAJnkeHLmLY
+kW5A3qwb4WpHQcN9z5Dg6TSA0FaakoMYCsRht2A9mkzbYQrQ0HHx7t4RrfruS4/+
+Fe1t5LC6cJww6lJNMaSVNaEc2RWfnKsGUOuu1LsXdCdEuTX6FWHhE/YeRoic02fK
+vKV827l+Ixwkd/qEjzh/KkLVSeAzCV0pKC+TMyD5zyECAwEAAaNgMF4wHQYDVR0O
+BBYEFJv5hAZq/NLrCJP75O4v2MHCiXqnMB8GA1UdIwQYMBaAFBK5w0h57X0wyXh4
+YZRYNwdAdjgYMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3
+DQEBCwUAA4ICAQB5KNVGkh9rJd6wHuJE03ujSm4FQ92FR03K0NlDZTQ4oMJs+0mF
+bfPcEIxzN0kiw4fdKIqwsiyjnPYVTZg5laEhcjb/BGfluj69XtSBrPQc9auN3XPp
+N9nSgDlb9ez+nFbsEPeGQhfR8UvFOP4OhSxurG9S5ai5/q/13DUKdPhyT1HVlfT+
+j/o/1dIfRDtjYErimTe/CUAybOo8YYV3vGNuEflBX8tMmTkqN2Z5TVp+k5FTM86x
+wBxoly5a4WZZQVIHz0oCJFTdAZcv8YXbUJw7FpXSCMr2k5oBMzZAfDnj3/h7p7Xq
+YAaldDrc6jYIa8FZAwF3Fw5r4ZpIaAYxAygLy91hk4AM8RbkhyaGcrQSMnv3hVma
+4xzE2G5VqX7Fzou+0r9XNGKD8dA6c+F14fR3W6OjNXr7toVo1a0mlXFgYpIw01x7
+jkIU6HsnE+aqyzVCLNvpH//9TI/8BNgFFtqok9s78lEX/9zHEZcUrNha5604+he/
+vUuShA2WIH0X7jGmVldepA3Sy0foRRTkakqhQNq3vOiqYFlMSjsM7yY5/MuM/nnD
+NTT1OhHT5uf+/byJasXQW6K5hJ20U9EfwPb9gIqI+KoEj12DSpHtkPD2CrsaAdek
+uzzEweE4ygOLYdgYq7zvfhiq32HRH2QQBOklfcO7EOARVSnmVoeAv5UgxQ==
--- a/langtools/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -296,3 +296,4 @@
7c44d9a33bbea75f5d91625df9bbccea360aea2a jdk9-b51
ee20efe0255d7ac6e06e88e06f7c72f6c6da7bf9 jdk9-b52
99ff00581f3633c1787bec21f2a8f3a2ffe57665 jdk9-b53
+ed34864f3b43a7df394fce6c3f0bc86b70a5d686 jdk9-b54
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java Tue Mar 17 12:30:53 2015 -0700
@@ -144,6 +144,7 @@
}
public Void scan(DocCommentTree tree, TreePath p) {
+ env.initTypes();
env.setCurrent(p, tree);
boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java Tue Mar 17 12:30:53 2015 -0700
@@ -32,6 +32,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
+import java.util.regex.Pattern;
import javax.lang.model.element.Name;
import javax.tools.StandardLocation;
@@ -79,7 +80,8 @@
private static final String STATS = "-stats";
public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
public static final String XCUSTOM_TAGS_PREFIX = "-XcustomTags:";
- public static final String TAGS_SEPARATOR = ",";
+ public static final String XCHECK_PACKAGE = "-XcheckPackage:";
+ public static final String SEPARATOR = ",";
// <editor-fold defaultstate="collapsed" desc="Command-line entry point">
public static void main(String... args) {
@@ -156,7 +158,7 @@
env.init(task);
checker = new Checker(env);
- DeclScanner ds = new DeclScanner() {
+ DeclScanner ds = new DeclScanner(env) {
@Override
void visitDecl(Tree tree, Name name) {
TreePath p = getCurrentPath();
@@ -272,6 +274,8 @@
env.setImplicitHeaders(Character.digit(ch, 10));
} else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
+ } else if (arg.startsWith(XCHECK_PACKAGE)) {
+ env.setCheckPackages(arg.substring(arg.indexOf(":") + 1));
} else
throw new IllegalArgumentException(arg);
}
@@ -280,7 +284,7 @@
checker = new Checker(env);
if (addTaskListener) {
- final DeclScanner ds = new DeclScanner() {
+ final DeclScanner ds = new DeclScanner(env) {
@Override
void visitDecl(Tree tree, Name name) {
TreePath p = getCurrentPath();
@@ -337,6 +341,9 @@
return true;
if (opt.startsWith(XMSGS_CUSTOM_PREFIX))
return Messages.Options.isValidOptions(opt.substring(XMSGS_CUSTOM_PREFIX.length()));
+ if (opt.startsWith(XCHECK_PACKAGE)) {
+ return Env.validatePackages(opt.substring(opt.indexOf(":") + 1));
+ }
return false;
}
@@ -348,6 +355,12 @@
// <editor-fold defaultstate="collapsed" desc="DeclScanner">
static abstract class DeclScanner extends TreePathScanner<Void, Void> {
+ final Env env;
+
+ public DeclScanner(Env env) {
+ this.env = env;
+ }
+
abstract void visitDecl(Tree tree, Name name);
@Override @DefinedBy(Api.COMPILER_TREE)
@@ -373,6 +386,33 @@
visitDecl(tree, tree.getName());
return super.visitVariable(tree, ignore);
}
+
+ @Override @DefinedBy(Api.COMPILER_TREE)
+ public Void visitCompilationUnit(CompilationUnitTree node, Void p) {
+ if (env.includePackages != null) {
+ String packageName = node.getPackageName() != null
+ ? node.getPackageName().toString()
+ : "";
+ if (!env.includePackages.isEmpty()) {
+ boolean included = false;
+ for (Pattern pack : env.includePackages) {
+ if (pack.matcher(packageName).matches()) {
+ included = true;
+ break;
+ }
+ }
+ if (!included)
+ return null;
+ }
+ for (Pattern pack : env.excludePackages) {
+ if (pack.matcher(packageName).matches()) {
+ return null;
+ }
+ }
+ }
+ return super.visitCompilationUnit(node, p);
+ }
+
}
// </editor-fold>
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java Tue Mar 17 12:30:53 2015 -0700
@@ -26,8 +26,12 @@
package com.sun.tools.doclint;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Set;
-import java.util.LinkedHashSet;
+import java.util.regex.Pattern;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
@@ -36,6 +40,7 @@
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
+import javax.tools.Diagnostic.Kind;
import com.sun.source.doctree.DocCommentTree;
import com.sun.source.util.DocTrees;
@@ -44,6 +49,7 @@
import com.sun.source.util.TreePath;
import com.sun.tools.javac.model.JavacTypes;
import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.util.MatchingUtils;
import com.sun.tools.javac.util.StringUtils;
/**
@@ -90,6 +96,9 @@
Set<String> customTags;
+ Set<Pattern> includePackages;
+ Set<Pattern> excludePackages;
+
// Utility classes
DocTrees trees;
Elements elements;
@@ -129,6 +138,12 @@
this.trees = trees;
this.elements = elements;
this.types = types;
+ }
+
+ void initTypes() {
+ if (java_lang_Error != null)
+ return ;
+
java_lang_Error = elements.getTypeElement("java.lang.Error").asType();
java_lang_RuntimeException = elements.getTypeElement("java.lang.RuntimeException").asType();
java_lang_Throwable = elements.getTypeElement("java.lang.Throwable").asType();
@@ -141,12 +156,43 @@
void setCustomTags(String cTags) {
customTags = new LinkedHashSet<>();
- for (String s : cTags.split(DocLint.TAGS_SEPARATOR)) {
+ for (String s : cTags.split(DocLint.SEPARATOR)) {
if (!s.isEmpty())
customTags.add(s);
}
}
+ void setCheckPackages(String packages) {
+ includePackages = new HashSet<>();
+ excludePackages = new HashSet<>();
+ for (String pack : packages.split(DocLint.SEPARATOR)) {
+ boolean excluded = false;
+ if (pack.startsWith("-")) {
+ pack = pack.substring(1);
+ excluded = true;
+ }
+ if (pack.isEmpty())
+ continue;
+ Pattern pattern = MatchingUtils.validImportStringToPattern(pack);
+ if (excluded) {
+ excludePackages.add(pattern);
+ } else {
+ includePackages.add(pattern);
+ }
+ }
+ }
+
+ static boolean validatePackages(String packages) {
+ for (String pack : packages.split(DocLint.SEPARATOR)) {
+ if (pack.startsWith("-")) {
+ pack = pack.substring(1);
+ }
+ if (!pack.isEmpty() && !MatchingUtils.isValidImportString(pack))
+ return false;
+ }
+ return true;
+ }
+
/** Set the current declaration and its doc comment. */
void setCurrent(TreePath path, DocCommentTree comment) {
currPath = path;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties Tue Mar 17 12:30:53 2015 -0700
@@ -107,6 +107,13 @@
\ equivalent to -Xmsgs:all/protected, meaning that\n\
\ all messages are reported for protected and public\n\
\ declarations only. \n\
+\ -XcheckPackage:<packages>\n\
+\ Enable or disable checks in specific packages.\n\
+\ <packages> is a comma separated list of package specifiers.\n\
+\ Package specifier is either a qualified name of a package\n\
+\ or a package name prefix followed by ''.*'', which expands to\n\
+\ all sub-packages of the given package. Prefix the package specifier\n\
+\ with ''-'' to disable checks for the specified packages.\n\
\ -stats\n\
\ Report statistics on the reported issues.\n\
\ -h -help --help -usage -?\n\
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -1211,10 +1211,8 @@
if (pattype.constValue() == null) {
log.error(c.pat.pos(),
(stringSwitch ? "string.const.req" : "const.expr.req"));
- } else if (labels.contains(pattype.constValue())) {
+ } else if (!labels.add(pattype.constValue())) {
log.error(c.pos(), "duplicate.case.label");
- } else {
- labels.add(pattype.constValue());
}
}
}
@@ -1251,19 +1249,17 @@
// where
/** Return the selected enumeration constant symbol, or null. */
private Symbol enumConstant(JCTree tree, Type enumType) {
- if (!tree.hasTag(IDENT)) {
- log.error(tree.pos(), "enum.label.must.be.unqualified.enum");
- return syms.errSymbol;
- }
- JCIdent ident = (JCIdent)tree;
- Name name = ident.name;
- for (Symbol sym : enumType.tsym.members().getSymbolsByName(name)) {
- if (sym.kind == VAR) {
- Symbol s = ident.sym = sym;
- ((VarSymbol)s).getConstValue(); // ensure initializer is evaluated
- ident.type = s.type;
- return ((s.flags_field & Flags.ENUM) == 0)
- ? null : s;
+ if (tree.hasTag(IDENT)) {
+ JCIdent ident = (JCIdent)tree;
+ Name name = ident.name;
+ for (Symbol sym : enumType.tsym.members().getSymbolsByName(name)) {
+ if (sym.kind == VAR) {
+ Symbol s = ident.sym = sym;
+ ((VarSymbol)s).getConstValue(); // ensure initializer is evaluated
+ ident.type = s.type;
+ return ((s.flags_field & Flags.ENUM) == 0)
+ ? null : s;
+ }
}
}
return null;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java Tue Mar 17 12:30:53 2015 -0700
@@ -496,6 +496,14 @@
if (doclintOpts.equals(Collections.singleton(DocLint.XMSGS_CUSTOM_PREFIX + "none")))
return List.nil();
+ String checkPackages = options.get(Option.XDOCLINT_PACKAGE);
+
+ if (checkPackages != null) {
+ for (String s : checkPackages.split("\\s+")) {
+ doclintOpts.add(s.replace(Option.XDOCLINT_PACKAGE.text, DocLint.XCHECK_PACKAGE));
+ }
+ }
+
// standard doclet normally generates H1, H2,
// so for now, allow user comments to assume that
doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Tue Mar 17 12:30:53 2015 -0700
@@ -129,6 +129,22 @@
}
},
+ XDOCLINT_PACKAGE("-Xdoclint/package:", "opt.Xdoclint.package.args", "opt.Xdoclint.package.desc", EXTENDED, BASIC) {
+ @Override
+ public boolean matches(String option) {
+ return DocLint.isValidOption(
+ option.replace(XDOCLINT_PACKAGE.text, DocLint.XCHECK_PACKAGE));
+ }
+
+ @Override
+ public boolean process(OptionHelper helper, String option) {
+ String prev = helper.get(XDOCLINT_PACKAGE);
+ String next = (prev == null) ? option : (prev + " " + option);
+ helper.put(XDOCLINT_PACKAGE.text, next);
+ return false;
+ }
+ },
+
// -nowarn is retained for command-line backward compatibility
NOWARN("-nowarn", "opt.nowarn", STANDARD, BASIC) {
@Override
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Tue Mar 17 12:30:53 2015 -0700
@@ -70,6 +70,7 @@
import com.sun.tools.javac.util.JavacMessages;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.MatchingUtils;
import com.sun.tools.javac.util.Name;
import com.sun.tools.javac.util.Names;
import com.sun.tools.javac.util.Options;
@@ -1431,7 +1432,6 @@
return specifiedPackages;
}
- private static final Pattern allMatches = Pattern.compile(".*");
public static final Pattern noMatches = Pattern.compile("(\\P{all})+");
/**
@@ -1440,8 +1440,8 @@
* import-style string, return a regex that won't match anything.
*/
private static Pattern importStringToPattern(String s, Processor p, Log log) {
- if (isValidImportString(s)) {
- return validImportStringToPattern(s);
+ if (MatchingUtils.isValidImportString(s)) {
+ return MatchingUtils.validImportStringToPattern(s);
} else {
log.warning("proc.malformed.supported.string", s, p.getClass().getName());
return noMatches; // won't match any valid identifier
@@ -1449,54 +1449,6 @@
}
/**
- * Return true if the argument string is a valid import-style
- * string specifying claimed annotations; return false otherwise.
- */
- public static boolean isValidImportString(String s) {
- if (s.equals("*"))
- return true;
-
- boolean valid = true;
- String t = s;
- int index = t.indexOf('*');
-
- if (index != -1) {
- // '*' must be last character...
- if (index == t.length() -1) {
- // ... any and preceding character must be '.'
- if ( index-1 >= 0 ) {
- valid = t.charAt(index-1) == '.';
- // Strip off ".*$" for identifier checks
- t = t.substring(0, t.length()-2);
- }
- } else
- return false;
- }
-
- // Verify string is off the form (javaId \.)+ or javaId
- if (valid) {
- String[] javaIds = t.split("\\.", t.length()+2);
- for(String javaId: javaIds)
- valid &= SourceVersion.isIdentifier(javaId);
- }
- return valid;
- }
-
- public static Pattern validImportStringToPattern(String s) {
- if (s.equals("*")) {
- return allMatches;
- } else {
- String s_prime = s.replace(".", "\\.");
-
- if (s_prime.endsWith("*")) {
- s_prime = s_prime.substring(0, s_prime.length() - 1) + ".+";
- }
-
- return Pattern.compile(s_prime);
- }
- }
-
- /**
* For internal use only. This method may be removed without warning.
*/
public Context getContext() {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties Tue Mar 17 12:30:53 2015 -0700
@@ -228,6 +228,17 @@
\ Enable or disable specific checks for problems in javadoc comments,\n\
\ where <group> is one of accessibility, html, missing, reference, or syntax,\n\
\ and <access> is one of public, protected, package, or private.
+
+javac.opt.Xdoclint.package.args = \
+ ([-]<packages>)
+
+javac.opt.Xdoclint.package.desc=\n\
+\ Enable or disable checks in specific packages. <packages> is a comma separated\n\
+\ list of package specifiers. Package specifier is either a qualified name of a package\n\
+\ or a package name prefix followed by '.*', which expands to all sub-packages of\n\
+\ the given package. Prefix the package specifier with '-' to disable checks for\n\
+\ the specified packages.
+
javac.opt.Xstdout=\
Redirect standard output
javac.opt.X=\
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/MatchingUtils.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2005, 2015, 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.util;
+
+import java.util.regex.Pattern;
+import javax.lang.model.SourceVersion;
+
+/**Utilities to convert an import-like string to a regexp.
+ *
+ * <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>
+ */
+public class MatchingUtils {
+ private static final Pattern allMatches = Pattern.compile(".*");
+
+ /**
+ * Return true if the argument string is a valid import-style
+ * string specifying claimed annotations; return false otherwise.
+ */
+ public static boolean isValidImportString(String s) {
+ if (s.equals("*"))
+ return true;
+
+ boolean valid = true;
+ String t = s;
+ int index = t.indexOf('*');
+
+ if (index != -1) {
+ // '*' must be last character...
+ if (index == t.length() -1) {
+ // ... any and preceding character must be '.'
+ if ( index-1 >= 0 ) {
+ valid = t.charAt(index-1) == '.';
+ // Strip off ".*$" for identifier checks
+ t = t.substring(0, t.length()-2);
+ }
+ } else
+ return false;
+ }
+
+ // Verify string is off the form (javaId \.)+ or javaId
+ if (valid) {
+ String[] javaIds = t.split("\\.", t.length()+2);
+ for(String javaId: javaIds)
+ valid &= SourceVersion.isIdentifier(javaId);
+ }
+ return valid;
+ }
+
+ public static Pattern validImportStringToPattern(String s) {
+ if (s.equals("*")) {
+ return allMatches;
+ } else {
+ String s_prime = s.replace(".", "\\.");
+
+ if (s_prime.endsWith("*")) {
+ s_prime = s_prime.substring(0, s_prime.length() - 1) + ".+";
+ }
+
+ return Pattern.compile(s_prime);
+ }
+ }
+
+}
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -36,6 +36,7 @@
import java.util.HashSet;
import com.sun.tools.sjavac.Transformer;
+import com.sun.tools.sjavac.Util;
/**
* Instances of this class represent values for sjavac command line options.
@@ -358,21 +359,25 @@
@Override
public void exclude(String exclPattern) {
+ exclPattern = Util.normalizeDriveLetter(exclPattern);
excludes.add(exclPattern);
}
@Override
public void include(String inclPattern) {
+ inclPattern = Util.normalizeDriveLetter(inclPattern);
includes.add(inclPattern);
}
@Override
public void excludeFile(String exclFilePattern) {
+ exclFilePattern = Util.normalizeDriveLetter(exclFilePattern);
excludeFiles.add(exclFilePattern);
}
@Override
public void includeFile(String inclFilePattern) {
+ inclFilePattern = Util.normalizeDriveLetter(inclFilePattern);
includeFiles.add(inclFilePattern);
}
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -55,8 +55,6 @@
*/
int noOfPackages;
- private final String SCROLL_YES = "yes";
-
/**
* Constructor to construct FrameOutputWriter object.
*
@@ -96,90 +94,73 @@
* as well as warning if browser is not supporting the Html frames.
*/
protected void generateFrameFile() throws IOException {
- Content frameset = getFrameDetails();
+ Content frame = getFrameDetails();
+ HtmlTree body = new HtmlTree(HtmlTag.BODY);
+ body.addContent(frame);
if (configuration.windowtitle.length() > 0) {
- printFramesetDocument(configuration.windowtitle, configuration.notimestamp,
- frameset);
+ printFramesDocument(configuration.windowtitle, configuration,
+ body);
} else {
- printFramesetDocument(configuration.getText("doclet.Generated_Docs_Untitled"),
- configuration.notimestamp, frameset);
+ printFramesDocument(configuration.getText("doclet.Generated_Docs_Untitled"),
+ configuration, body);
}
}
/**
- * Add the code for issueing the warning for a non-frame capable web
- * client. Also provide links to the non-frame version documentation.
- *
- * @param contentTree the content tree to which the non-frames information will be added
- */
- protected void addFrameWarning(Content contentTree) {
- Content noframes = new HtmlTree(HtmlTag.NOFRAMES);
- Content noScript = HtmlTree.NOSCRIPT(
- HtmlTree.DIV(getResource("doclet.No_Script_Message")));
- noframes.addContent(noScript);
- Content noframesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
- getResource("doclet.Frame_Alert"));
- noframes.addContent(noframesHead);
- Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message",
- getHyperLink(configuration.topFile,
- configuration.getText("doclet.Non_Frame_Version"))));
- noframes.addContent(p);
- contentTree.addContent(noframes);
- }
-
- /**
* Get the frame sizes and their contents.
*
* @return a content tree for the frame details
*/
protected Content getFrameDetails() {
- HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame",
- "top.loadFrames()");
+ HtmlTree leftContainerDiv = new HtmlTree(HtmlTag.DIV);
+ HtmlTree rightContainerDiv = new HtmlTree(HtmlTag.DIV);
+ leftContainerDiv.addStyle(HtmlStyle.leftContainer);
+ rightContainerDiv.addStyle(HtmlStyle.rightContainer);
if (noOfPackages <= 1) {
- addAllClassesFrameTag(frameset);
+ addAllClassesFrameTag(leftContainerDiv);
} else if (noOfPackages > 1) {
- HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
- "top.loadFrames()");
- addAllPackagesFrameTag(leftFrameset);
- addAllClassesFrameTag(leftFrameset);
- frameset.addContent(leftFrameset);
+ addAllPackagesFrameTag(leftContainerDiv);
+ addAllClassesFrameTag(leftContainerDiv);
}
- addClassFrameTag(frameset);
- addFrameWarning(frameset);
- return frameset;
+ addClassFrameTag(rightContainerDiv);
+ HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv);
+ mainContainer.addContent(rightContainerDiv);
+ return mainContainer;
}
/**
- * Add the FRAME tag for the frame that lists all packages.
+ * Add the IFRAME tag for the frame that lists all packages.
*
* @param contentTree the content tree to which the information will be added
*/
private void addAllPackagesFrameTag(Content contentTree) {
- HtmlTree frame = HtmlTree.FRAME(DocPaths.OVERVIEW_FRAME.getPath(),
+ HtmlTree frame = HtmlTree.IFRAME(DocPaths.OVERVIEW_FRAME.getPath(),
"packageListFrame", configuration.getText("doclet.All_Packages"));
- contentTree.addContent(frame);
+ HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame);
+ contentTree.addContent(leftTop);
}
/**
- * Add the FRAME tag for the frame that lists all classes.
+ * Add the IFRAME tag for the frame that lists all classes.
*
* @param contentTree the content tree to which the information will be added
*/
private void addAllClassesFrameTag(Content contentTree) {
- HtmlTree frame = HtmlTree.FRAME(DocPaths.ALLCLASSES_FRAME.getPath(),
+ HtmlTree frame = HtmlTree.IFRAME(DocPaths.ALLCLASSES_FRAME.getPath(),
"packageFrame", configuration.getText("doclet.All_classes_and_interfaces"));
- contentTree.addContent(frame);
+ HtmlTree leftBottom = HtmlTree.DIV(HtmlStyle.leftBottom, frame);
+ contentTree.addContent(leftBottom);
}
/**
- * Add the FRAME tag for the frame that describes the class in detail.
+ * Add the IFRAME tag for the frame that describes the class in detail.
*
* @param contentTree the content tree to which the information will be added
*/
private void addClassFrameTag(Content contentTree) {
- HtmlTree frame = HtmlTree.FRAME(configuration.topFile.getPath(), "classFrame",
- configuration.getText("doclet.Package_class_and_interface_descriptions"),
- SCROLL_YES);
+ HtmlTree frame = HtmlTree.IFRAME(configuration.topFile.getPath(), "classFrame",
+ configuration.getText("doclet.Package_class_and_interface_descriptions"));
+ frame.addStyle(HtmlStyle.rightIframe);
contentTree.addContent(frame);
}
}
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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,9 +48,6 @@
public static final DocType TRANSITIONAL =
new DocType("Transitional", "http://www.w3.org/TR/html4/loose.dtd");
- public static final DocType FRAMESET =
- new DocType("Frameset", "http://www.w3.org/TR/html4/frameset.dtd");
-
/**
* Constructor to construct a DocType object.
*
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -35,6 +35,7 @@
import com.sun.tools.doclets.internal.toolkit.util.DocFile;
import com.sun.tools.doclets.internal.toolkit.util.DocLink;
import com.sun.tools.doclets.internal.toolkit.util.DocPath;
+import com.sun.tools.doclets.internal.toolkit.util.DocPaths;
/**
@@ -56,6 +57,8 @@
public static final String CONTENT_TYPE = "text/html";
+ DocPath pathToRoot;
+
/**
* Constructor. Initializes the destination file name through the super
* class HtmlWriter.
@@ -65,6 +68,7 @@
public HtmlDocWriter(Configuration configuration, DocPath filename)
throws IOException {
super(configuration, filename);
+ this.pathToRoot = filename.parent().invert();
configuration.message.notice("doclet.Generating_0",
DocFile.createFileForOutput(configuration, filename).getPath());
}
@@ -298,33 +302,54 @@
}
/**
- * Print the frameset version of the Html file header.
- * Called only when generating an HTML frameset file.
+ * Print the frames version of the Html file header.
+ * Called only when generating an HTML frames file.
*
* @param title Title of this HTML document
- * @param noTimeStamp If true, don't print time stamp in header
- * @param frameset the frameset to be added to the HTML document
+ * @param configuration the configuration object
+ * @param frame the frame content tree to be added to the HTML document
*/
- public void printFramesetDocument(String title, boolean noTimeStamp,
- Content frameset) throws IOException {
- Content htmlDocType = DocType.FRAMESET;
+ public void printFramesDocument(String title, ConfigurationImpl configuration,
+ HtmlTree body) throws IOException {
+ Content htmlDocType = DocType.TRANSITIONAL;
Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
Content head = new HtmlTree(HtmlTag.HEAD);
- head.addContent(getGeneratedBy(!noTimeStamp));
+ head.addContent(getGeneratedBy(!configuration.notimestamp));
Content windowTitle = HtmlTree.TITLE(new StringContent(title));
head.addContent(windowTitle);
Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE,
(configuration.charset.length() > 0) ?
configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET);
head.addContent(meta);
- head.addContent(getFramesetJavaScript());
+ head.addContent(getStyleSheetProperties(configuration));
+ head.addContent(getFramesJavaScript());
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
- head, frameset);
+ head, body);
Content htmlDocument = new HtmlDocument(htmlDocType,
htmlComment, htmlTree);
write(htmlDocument);
}
+ /**
+ * Returns a link to the stylesheet file.
+ *
+ * @return an HtmlTree for the lINK tag which provides the stylesheet location
+ */
+ public HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) {
+ String stylesheetfile = configuration.stylesheetfile;
+ DocPath stylesheet;
+ if (stylesheetfile.isEmpty()) {
+ stylesheet = DocPaths.STYLESHEET;
+ } else {
+ DocFile file = DocFile.createFileForInput(configuration, stylesheetfile);
+ stylesheet = DocPath.create(file.getName());
+ }
+ HtmlTree link = HtmlTree.LINK("stylesheet", "text/css",
+ pathToRoot.resolve(stylesheet).getPath(),
+ "Style");
+ return link;
+ }
+
protected Comment getGeneratedBy(boolean timestamp) {
String text = "Generated by javadoc"; // marker string, deliberately not localized
if (timestamp) {
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -67,7 +67,11 @@
indexHeader,
inheritance,
interfaceName,
+ leftContainer,
+ leftTop,
+ leftBottom,
legalCopy,
+ mainContainer,
memberNameLabel,
memberNameLink,
memberSummary,
@@ -79,6 +83,8 @@
packageHierarchyLabel,
paramLabel,
returnLabel,
+ rightContainer,
+ rightIframe,
rowColor,
seeLabel,
serializedFormContainer,
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -52,8 +52,6 @@
DT,
EM(BlockType.INLINE, EndTag.END),
FONT(BlockType.INLINE, EndTag.END),
- FRAME(BlockType.OTHER, EndTag.NOEND),
- FRAMESET(BlockType.OTHER, EndTag.END),
H1,
H2,
H3,
@@ -64,6 +62,7 @@
HR(BlockType.BLOCK, EndTag.NOEND),
HTML(BlockType.OTHER, EndTag.END),
I(BlockType.INLINE, EndTag.END),
+ IFRAME(BlockType.OTHER, EndTag.END),
IMG(BlockType.INLINE, EndTag.NOEND),
LI,
LISTING,
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -326,53 +326,18 @@
}
/**
- * Generates a FRAME tag.
- *
- * @param src the url of the document to be shown in the frame
- * @param name specifies the name of the frame
- * @param title the title for the frame
- * @param scrolling specifies whether to display scrollbars in the frame
- * @return an HtmlTree object for the FRAME tag
- */
- public static HtmlTree FRAME(String src, String name, String title, String scrolling) {
- HtmlTree htmltree = new HtmlTree(HtmlTag.FRAME);
- htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
- htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
- htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
- if (scrolling != null)
- htmltree.addAttr(HtmlAttr.SCROLLING, scrolling);
- return htmltree;
- }
-
- /**
- * Generates a Frame tag.
+ * Generates a IFRAME tag.
*
* @param src the url of the document to be shown in the frame
* @param name specifies the name of the frame
* @param title the title for the frame
- * @return an HtmlTree object for the SPAN tag
+ * @return an HtmlTree object for the IFRAME tag
*/
- public static HtmlTree FRAME(String src, String name, String title) {
- return FRAME(src, name, title, null);
- }
-
- /**
- * Generates a FRAMESET tag.
- *
- * @param cols the size of columns in the frameset
- * @param rows the size of rows in the frameset
- * @param title the title for the frameset
- * @param onload the script to run when the document loads
- * @return an HtmlTree object for the FRAMESET tag
- */
- public static HtmlTree FRAMESET(String cols, String rows, String title, String onload) {
- HtmlTree htmltree = new HtmlTree(HtmlTag.FRAMESET);
- if (cols != null)
- htmltree.addAttr(HtmlAttr.COLS, cols);
- if (rows != null)
- htmltree.addAttr(HtmlAttr.ROWS, rows);
+ public static HtmlTree IFRAME(String src, String name, String title) {
+ HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME);
+ htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
+ htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
- htmltree.addAttr(HtmlAttr.ONLOAD, nullCheck(onload));
return htmltree;
}
@@ -779,7 +744,7 @@
return (hasAttr(HtmlAttr.NAME) || (hasAttr(HtmlAttr.HREF) && hasContent()));
case BR :
return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR)));
- case FRAME :
+ case IFRAME :
return (hasAttr(HtmlAttr.SRC) && !hasContent());
case HR :
return (!hasContent());
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -376,7 +376,7 @@
*
* @return a content for the SCRIPT tag
*/
- protected Content getFramesetJavaScript() {
+ protected Content getFramesJavaScript() {
HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
script.addAttr(HtmlAttr.TYPE, "text/javascript");
String scriptCode = DocletConstants.NL +
@@ -425,10 +425,6 @@
" }" + DocletConstants.NL +
" }" + DocletConstants.NL +
" return true;" + DocletConstants.NL +
- " }" + DocletConstants.NL +
- " function loadFrames() {" + DocletConstants.NL +
- " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
- " top.classFrame.location = top.targetPage;" + DocletConstants.NL +
" }" + DocletConstants.NL;
RawHtml scriptContent = new RawHtml(scriptCode);
script.addContent(scriptContent);
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Tue Mar 17 12:30:53 2015 -0700
@@ -104,10 +104,7 @@
doclet.Package_Hierarchies=Package Hierarchies:
doclet.Hierarchy_For_Package=Hierarchy For Package {0}
doclet.Hierarchy_For_All_Packages=Hierarchy For All Packages
-doclet.Frame_Alert=Frame Alert
-doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to {0}.
doclet.No_Script_Message=JavaScript is disabled on your browser.
-doclet.Non_Frame_Version=Non-frame version
doclet.Description_From_Interface=Description copied from interface:
doclet.Description_From_Class=Description copied from class:
doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document.
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Tue Mar 17 12:30:53 2015 -0700
@@ -11,6 +11,17 @@
font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
font-size:14px;
margin:0;
+ padding:0;
+ height:100%;
+ width:100%;
+}
+iframe {
+ margin:0;
+ padding:0;
+ height:100%;
+ width:100%;
+ overflow-y:scroll;
+ border:none;
}
a:link, a:visited {
text-decoration:none;
@@ -463,7 +474,6 @@
.useSummary td, .constantsSummary td, .deprecatedSummary td {
text-align:left;
padding:0px 0px 12px 10px;
- width:100%;
}
th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
@@ -488,6 +498,7 @@
font-size:13px;
}
.overviewSummary td.colFirst, .overviewSummary th.colFirst,
+.useSummary td.colFirst, .useSummary th.colFirst,
.overviewSummary td.colOne, .overviewSummary th.colOne,
.memberSummary td.colFirst, .memberSummary th.colFirst,
.memberSummary td.colOne, .memberSummary th.colOne,
@@ -569,6 +580,61 @@
font-style:normal;
}
-div.contentContainer ul.blockList li.blockList h2{
+div.contentContainer ul.blockList li.blockList h2 {
padding-bottom:0px;
}
+/*
+IFRAME specific styles
+*/
+.mainContainer {
+ margin:0 auto;
+ padding:0;
+ height:100%;
+ width:100%;
+ position:fixed;
+ top:0;
+ left:0;
+}
+.leftContainer {
+ height:100%;
+ position:fixed;
+ width:320px;
+}
+.leftTop {
+ position:relative;
+ float:left;
+ width:315px;
+ top:0;
+ left:0;
+ height:30%;
+ border-right:6px solid #ccc;
+ border-bottom:6px solid #ccc;
+}
+.leftBottom {
+ position:relative;
+ float:left;
+ width:315px;
+ bottom:0;
+ left:0;
+ height:70%;
+ border-right:6px solid #ccc;
+ border-top:1px solid #000;
+}
+.rightContainer {
+ position:absolute;
+ left:320px;
+ top:0;
+ bottom:0;
+ height:100%;
+ right:0;
+ border-left:1px solid #000;
+}
+.rightIframe {
+ margin:0;
+ padding:0;
+ height:100%;
+ right:30px;
+ width:100%;
+ overflow:visible;
+ margin-bottom:30px;
+}
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java Tue Mar 17 12:30:53 2015 -0700
@@ -833,7 +833,7 @@
for (String customTag : customTagNames) {
customTags.append(sep);
customTags.append(customTag);
- sep = DocLint.TAGS_SEPARATOR;
+ sep = DocLint.SEPARATOR;
}
doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
--- a/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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,11 +23,10 @@
/*
* @test
- * @bug 4275630 4749453 4625400 4753048 4415270
- * @summary Generated HTML is invalid with frameset DTD.
+ * @bug 4275630 4749453 4625400 4753048 4415270 8074521
+ * @summary Generated HTML is invalid with frames.
* Displays unnecessary horizontal scroll bars.
* Missing whitespace in DOCTYPE declaration
- * <NOFRAMES> not allowed outside <FRAMESET> element
* HTML table tags inserted in wrong place in pakcage use page
* @author dkramer
* @library ../lib
@@ -55,7 +54,7 @@
checkExit(Exit.OK);
// Test the proper DOCTYPE element are present:
- checkOutput("index.html", true, FRAMESET);
+ checkOutput("index.html", true, LOOSE);
checkOutput("overview-summary.html", true, LOOSE);
checkOutput("p1/package-summary.html", true, LOOSE);
checkOutput("p1/C.html", true, LOOSE);
@@ -63,10 +62,9 @@
checkOutput("allclasses-frame.html", true, LOOSE);
checkOutput("p1/package-frame.html", true, LOOSE);
- // Test that <NOFRAMES> is inside <FRAMESET> element:
+ // Test for IFRAME element:
checkOutput("index.html", true,
- "</noframes>\n"
- + "</frameset>");
+ "<iframe");
// Test the table elements are in the correct order:
checkOutput("p1/package-use.html", true,
@@ -74,8 +72,6 @@
+ "</tr>");
}
- private static final String FRAMESET =
- "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">";
private static final String LOOSE =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
}
--- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -47,10 +47,9 @@
"pkg", testSrc("NoPackage.java"));
checkExit(Exit.OK);
- //Make sure the horizontal scroll bar does not appear in class frame.
checkOutput("index.html", true,
- "<frame src=\"overview-summary.html\" name=\"classFrame\" title=\""
- + "Package, class and interface descriptions\" scrolling=\"yes\">");
+ "<iframe src=\"overview-summary.html\" name=\"classFrame\" title=\""
+ + "Package, class and interface descriptions\" class=\"rightIframe\">");
//Test index-all.html
checkOutput("index-all.html", true,
--- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -99,10 +99,6 @@
+ " }\n"
+ " return true;\n"
+ " }\n"
- + " function loadFrames() {\n"
- + " if (targetPage != \"\" && targetPage != \"undefined\")\n"
- + " top.classFrame.location = top.targetPage;\n"
- + " }\n"
+ "</script>");
//Make sure title javascript only runs if is-external is not true
--- a/langtools/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java Wed Mar 11 08:30:40 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 7001086
- * @summary Test Non-frame warning.
- * @author Bhavesh Patel
- * @library ../lib
- * @build JavadocTester
- * @run main TestNonFrameWarning
- */
-
-public class TestNonFrameWarning extends JavadocTester {
-
- public static void main(String... args) throws Exception {
- TestNonFrameWarning tester = new TestNonFrameWarning();
- tester.runTests();
- }
-
- @Test
- void test() {
- javadoc("-d", "out",
- "-sourcepath", testSrc,
- "pkg");
- checkExit(Exit.OK);
-
- checkOutput("index.html", true,
- "<p>This document is designed to be viewed using the frames feature. "
- + "If you see this message, you are using a non-frame-capable web client. "
- + "Link to <a href=\"pkg/package-summary.html\">Non-frame version</a>.</p>");
- }
-}
--- a/langtools/test/com/sun/javadoc/testNonFrameWarning/pkg/C.java Wed Mar 11 08:30:40 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package pkg;
-
-/**
- * Source file for C
- */
-public class C {
-}
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -112,7 +112,7 @@
"<div class=\"subTitle\">compact1, compact2, compact3</div>");
checkOutput("index.html", true,
- "<frame src=\"overview-frame.html\" name=\"packageListFrame\" "
+ "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" "
+ "title=\"All Packages\">");
// Test for "overview-summary.html" showing the profile list.
--- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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,7 +23,7 @@
/*
* @test
- * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549
+ * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461
* @summary Run tests on doclet stylesheet.
* @author jamieh
* @library ../lib
@@ -64,6 +64,17 @@
+ " font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;\n"
+ " font-size:14px;\n"
+ " margin:0;\n"
+ + " padding:0;\n"
+ + " height:100%;\n"
+ + " width:100%;\n"
+ + "}",
+ "iframe {\n"
+ + " margin:0;\n"
+ + " padding:0;\n"
+ + " height:100%;\n"
+ + " width:100%;\n"
+ + " overflow-y:scroll;\n"
+ + " border:none;\n"
+ "}",
"ul {\n"
+ " list-style-type:disc;\n"
@@ -118,6 +129,21 @@
+ " background-color:#4D7A97;\n"
+ " height:16px;\n"
+ "}",
+ // Test the formatting styles for proper content display in use and constant values pages.
+ ".overviewSummary td.colFirst, .overviewSummary th.colFirst,\n"
+ + ".useSummary td.colFirst, .useSummary th.colFirst,\n"
+ + ".overviewSummary td.colOne, .overviewSummary th.colOne,\n"
+ + ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
+ + ".memberSummary td.colOne, .memberSummary th.colOne,\n"
+ + ".typeSummary td.colFirst{\n"
+ + " width:25%;\n"
+ + " vertical-align:top;\n"
+ + "}",
+ ".overviewSummary td, .memberSummary td, .typeSummary td,\n"
+ + ".useSummary td, .constantsSummary td, .deprecatedSummary td {\n"
+ + " text-align:left;\n"
+ + " padding:0px 0px 12px 10px;\n"
+ + "}",
".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {\n"
+ " padding-top:0px;\n"
+ " padding-left:0px;\n"
@@ -134,6 +160,9 @@
"<link rel=\"stylesheet\" type=\"text/css\" "
+ "href=\"../stylesheet.css\" title=\"Style\">");
+ checkOutput("index.html", true,
+ "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">");
+
checkOutput("stylesheet.css", false,
"* {\n"
+ " margin:0;\n"
--- a/langtools/test/tools/doclint/tool/HelpTest.out Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/tools/doclint/tool/HelpTest.out Tue Mar 17 12:30:53 2015 -0700
@@ -30,6 +30,13 @@
equivalent to -Xmsgs:all/protected, meaning that
all messages are reported for protected and public
declarations only.
+ -XcheckPackage:<packages>
+ Enable or disable checks in specific packages.
+ <packages> is a comma separated list of package specifiers.
+ Package specifier is either a qualified name of a package
+ or a package name prefix followed by '.*', which expands to
+ all sub-packages of the given package. Prefix the package specifier
+ with '-' to disable checks for the specified packages.
-stats
Report statistics on the reported issues.
-h -help --help -usage -?
--- a/langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/tools/javac/8074306/TestSyntheticNullChecks.java Tue Mar 17 12:30:53 2015 -0700
@@ -25,7 +25,7 @@
/*
* @test
- * @bug 8074306
+ * @bug 8074306 8073432 8074501
* @summary NULLCHK is emitted as Object.getClass
* @compile -source 6 -target 6 TestSyntheticNullChecks.java
* @run main TestSyntheticNullChecks 6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/doclint/IncludePackagesTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2015, 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 8071851
+ * @summary Test the -Xdoclint/package option
+ */
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+import static javax.tools.Diagnostic.Kind.*;
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.main.Main;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class IncludePackagesTest {
+ public static void main(String... args) throws Exception {
+ new IncludePackagesTest().run();
+ }
+
+ JavaCompiler javac;
+ StandardJavaFileManager fm;
+ List<JavaFileObject> files;
+
+ final String[] sources = new String[] {
+ "p1/p1T.java",
+ "package p1;\n" +
+ "/** Syntax < error. */\n" +
+ "public class p1T {\n" +
+ "}\n",
+ "p1/sp1/p1sp1T.java",
+ "package p1.sp1;\n" +
+ "/** Syntax < error. */\n" +
+ "public class p1sp1T {\n" +
+ "}\n",
+ "p1/sp1/sp2/p1sp1sp2T.java",
+ "package p1.sp1.sp2;\n" +
+ "/** Syntax < error. */\n" +
+ "public class p1sp1sp2T {\n" +
+ "}\n",
+ "p2/p2T.java",
+ "package p2;\n" +
+ "/** Syntax < error. */\n" +
+ "public class p2T {\n" +
+ "}\n",
+ "Default.java",
+ "/** Syntax < error. */\n" +
+ "public class Default {\n" +
+ "}\n",
+ };
+
+ final String rawDiags = "-XDrawDiagnostics";
+ private enum Message {
+ // doclint messages
+ p1T(ERROR, "p1T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+ p1sp1T(ERROR, "p1sp1T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+ p1sp1sp2T(ERROR, "p1sp1sp2T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+ p2T(ERROR, "p2T.java:2:12: compiler.err.proc.messager: malformed HTML"),
+ Default(ERROR, "Default.java:1:12: compiler.err.proc.messager: malformed HTML"),
+ INVALID_PACKAGE_ERROR(ERROR, "invalid flag: -Xdoclint/package:wrong+package");
+
+ final Diagnostic.Kind kind;
+ final String text;
+
+ static Message get(String text) {
+ for (Message m: values()) {
+ if (m.text.equals(text))
+ return m;
+ }
+ return null;
+ }
+
+ Message(Diagnostic.Kind kind, String text) {
+ this.kind = kind;
+ this.text = text;
+ }
+
+ @Override
+ public String toString() {
+ return "[" + kind + ",\"" + text + "\"]";
+ }
+ }
+ void run() throws Exception {
+ javac = ToolProvider.getSystemJavaCompiler();
+ fm = javac.getStandardFileManager(null, null, null);
+ try {
+ fm.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(new File(".")));
+ files = new ArrayList<>();
+
+ for (int si = 0; si < sources.length; si += 2) {
+ files.add(new JFOImpl(sources[si], sources[si + 1]));
+ }
+
+ test(Arrays.asList(rawDiags, "-Xdoclint"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.p1T, Message.p1sp1T, Message.p1sp1sp2T,
+ Message.p2T, Message.Default));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:p1"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.p1T));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:p1.*"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.p1sp1T, Message.p1sp1sp2T));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:p1.*,-p1.sp1"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.p1sp1sp2T));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:-p1.sp1"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.p1T, Message.p1sp1sp2T, Message.p2T, Message.Default));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint", "-Xdoclint/package:wrong+package"),
+ Main.Result.CMDERR,
+ EnumSet.of(Message.INVALID_PACKAGE_ERROR));
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred");
+ } finally {
+ fm.close();
+ }
+ }
+
+ void test(List<String> opts, Main.Result expectResult, Set<Message> expectMessages) {
+ System.err.println("test: " + opts);
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ try {
+ JavacTask t = (JavacTask) javac.getTask(pw, fm, null, opts, null, files);
+ boolean ok = t.call();
+ pw.close();
+ String out = sw.toString().replaceAll("[\r\n]+", "\n");
+ if (!out.isEmpty())
+ System.err.println(out);
+ if (ok && expectResult != Main.Result.OK) {
+ error("Compilation succeeded unexpectedly");
+ } else if (!ok && expectResult != Main.Result.ERROR) {
+ error("Compilation failed unexpectedly");
+ } else
+ check(out, expectMessages);
+ } catch (IllegalArgumentException e) {
+ System.err.println(e);
+ String expectOut = expectMessages.iterator().next().text;
+ if (expectResult != Main.Result.CMDERR)
+ error("unexpected exception caught");
+ else if (!e.getMessage().equals(expectOut)) {
+ error("unexpected exception message: "
+ + e.getMessage()
+ + " expected: " + expectOut);
+ }
+ }
+ }
+
+ private void check(String out, Set<Message> expect) {
+ Pattern stats = Pattern.compile("^([1-9]+) (error|warning)(s?)");
+ Set<Message> found = EnumSet.noneOf(Message.class);
+ int e = 0, w = 0;
+ if (!out.isEmpty()) {
+ for (String line: out.split("[\r\n]+")) {
+ Matcher s = stats.matcher(line);
+ if (s.matches()) {
+ int i = Integer.valueOf(s.group(1));
+ if (s.group(2).equals("error"))
+ e++;
+ else
+ w++;
+ continue;
+ }
+
+ Message m = Message.get(line);
+ if (m == null)
+ error("Unexpected line: " + line);
+ else
+ found.add(m);
+ }
+ }
+ for (Message m: expect) {
+ if (!found.contains(m))
+ error("expected message not found: " + m.text);
+ }
+ for (Message m: found) {
+ if (!expect.contains(m))
+ error("unexpected message found: " + m.text);
+ }
+ }
+
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ int errors;
+
+ class JFOImpl extends SimpleJavaFileObject {
+
+ private final String code;
+
+ public JFOImpl(String fileName, String code) {
+ super(URI.create(fileName), JavaFileObject.Kind.SOURCE);
+ this.code = code;
+ }
+
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncoding) {
+ return code;
+ }
+ }
+}
--- a/langtools/test/tools/javac/enum/EnumSwitch2.java Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/tools/javac/enum/EnumSwitch2.java Tue Mar 17 12:30:53 2015 -0700
@@ -1,6 +1,6 @@
/*
* @test /nodynamiccopyright/
- * @bug 4936393
+ * @bug 4936393 8050021
* @summary enum switch case labels required to be unqualified.
* @author gafter
* @compile/fail/ref=EnumSwitch2.out -XDrawDiagnostics EnumSwitch2.java
--- a/langtools/test/tools/javac/enum/EnumSwitch2.out Wed Mar 11 08:30:40 2015 -0700
+++ b/langtools/test/tools/javac/enum/EnumSwitch2.out Tue Mar 17 12:30:53 2015 -0700
@@ -1,4 +1,3 @@
EnumSwitch2.java:14:16: compiler.err.enum.label.must.be.unqualified.enum
EnumSwitch2.java:15:16: compiler.err.enum.label.must.be.unqualified.enum
-EnumSwitch2.java:15:9: compiler.err.duplicate.case.label
-3 errors
+2 errors
--- a/make/CompileJavaModules.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/CompileJavaModules.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2015, 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
@@ -42,6 +42,7 @@
################################################################################
+java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
java.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
java.base_CLEAN := intrinsic.properties
@@ -89,10 +90,12 @@
################################################################################
+java.datatransfer_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
java.datatransfer_COPY := flavormap.properties
################################################################################
+java.desktop_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-missing,-reference '-Xdoclint/package:java.*,javax.*'
java.desktop_COPY := .gif .png .wav .txt .xml .css .pf
java.desktop_CLEAN := iio-plugin.properties cursors.properties
@@ -239,15 +242,18 @@
################################################################################
+java.scripting_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.scripting_COPY := .js
java.scripting_CLEAN := .properties
################################################################################
+java.sql_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
################################################################################
+java.sql.rowset_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.sql.rowset_CLEAN_FILES := $(wildcard \
$(JDK_TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \
$(JDK_TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
@@ -261,6 +267,7 @@
################################################################################
+java.rmi_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.rmi_CLEAN_FILES := $(wildcard \
$(JDK_TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \
$(JDK_TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties)
@@ -309,14 +316,17 @@
################################################################################
+java.naming_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.naming_CLEAN := jndiprovider.properties
################################################################################
+java.security.saaj_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.security.saaj_CLEAN := .properties
################################################################################
+java.xml.crypto_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
java.xml.crypto_COPY := .dtd .xml
java.xml.crypto_CLEAN := .properties
@@ -485,7 +495,7 @@
$1_CLASSPATH := $$($1_CLASSPATH) $$(addprefix $(JDK_OUTPUTDIR)/modules/,jdk.hotspot.agent)
endif
$1_CLASSPATH := $$(subst $$(SPACE),$$(PATH_SEP),$$($1_CLASSPATH))
- $1_JAVAC_FLAGS := -bootclasspath "$$($1_CLASSPATH)"
+ $1_JAVAC_FLAGS := -bootclasspath "$$($1_CLASSPATH)" $$($1_ADD_JAVAC_FLAGS)
$$(eval $$(call SetupJavaCompilation,$1, \
SETUP := $$(if $$($1_SETUP), $$($1_SETUP), GENERATE_JDKBYTECODE), \
--- a/make/Images.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/Images.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -38,7 +38,7 @@
############################################################################
MAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \
- jdk.security.auth jdk.security.jgss jdk.runtime
+ jdk.security.auth jdk.security.jgss jdk.pack200
# providers
PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.localedata \
@@ -46,8 +46,8 @@
# tools
TOOLS_MODULES += jdk.attach jdk.compiler jdk.dev jdk.javadoc jdk.jcmd jdk.jconsole \
- jdk.hotspot.agent jdk.hprof.agent jdk.jdi jdk.jdwp.agent jdk.rmic \
- jdk.xml.bind jdk.xml.ws
+ jdk.hotspot.agent jdk.hprof.agent jdk.jartool jdk.jdi jdk.jdwp.agent \
+ jdk.policytool jdk.rmic jdk.xml.bind jdk.xml.ws
ifeq ($(OPENJDK_TARGET_OS), windows)
PROVIDER_MODULES += jdk.crypto.mscapi
@@ -488,6 +488,42 @@
JDK_TARGETS += $(COPY_JRTFS_JAR)
################################################################################
+# Code coverage data files
+
+ifeq ($(GCOV_ENABLED), true)
+
+ GCOV_FIND_EXPR := -type f -name "*.gcno"
+
+ ifeq ($(JVM_VARIANT_CLIENT), true)
+ $(eval $(call SetupCopyFiles,COPY_HOTSPOT_CLIENT_GCOV_GCNO, \
+ SRC := $(HOTSPOT_OUTPUTDIR), \
+ DEST := $(SYMBOLS_IMAGE_DIR)/gcov/hotspot/client, \
+ FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR)/*compiler1/ $(GCOV_FIND_EXPR)), \
+ FLATTEN := true))
+
+ SYMBOLS_TARGETS += $(COPY_HOTSPOT_CLIENT_GCOV_GCNO)
+ endif
+
+ ifeq ($(JVM_VARIANT_SERVER), true)
+ $(eval $(call SetupCopyFiles,COPY_HOTSPOT_SERVER_GCOV_GCNO, \
+ SRC := $(HOTSPOT_OUTPUTDIR), \
+ DEST := $(SYMBOLS_IMAGE_DIR)/gcov/hotspot/server, \
+ FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR)/*compiler2/ $(GCOV_FIND_EXPR)), \
+ FLATTEN := true))
+
+ SYMBOLS_TARGETS += $(COPY_HOTSPOT_SERVER_GCOV_GCNO)
+ endif
+
+ $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
+ SRC := $(SUPPORT_OUTPUTDIR)/native, \
+ DEST := $(SYMBOLS_IMAGE_DIR)/gcov/jdk, \
+ FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
+
+ SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
+
+endif
+
+################################################################################
# Include custom post hook here to make it possible to augment the target lists
# before actual target prerequisites are declared.
@@ -498,7 +534,8 @@
$(JRE_TARGETS): $(TOOL_JRE_TARGETS)
$(JDK_TARGETS): $(TOOL_JDK_TARGETS)
-jimages: $(TOOL_JRE_TARGETS) $(TOOL_JDK_TARGETS) $(JRE_TARGETS) $(JDK_TARGETS)
+jimages: $(TOOL_JRE_TARGETS) $(TOOL_JDK_TARGETS) $(JRE_TARGETS) $(JDK_TARGETS) \
+ $(SYMBOLS_TARGETS)
$(JRE_COMPACT1_TARGETS): $(TOOL_JRE_COMPACT1_TARGETS)
--- a/make/Jprt.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/Jprt.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -33,10 +33,16 @@
override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
endif
ifdef JPRT_ARCHIVE_INSTALL_BUNDLE
- override JPRT_ARCHIVE_INSTALL_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
+ override JPRT_ARCHIVE_INSTALL_BUNDLE := \
+ $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
endif
ifdef JPRT_ARCHIVE_TEST_BUNDLE
- override JPRT_ARCHIVE_TEST_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
+ override JPRT_ARCHIVE_TEST_BUNDLE := \
+ $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
+ endif
+ ifdef JPRT_ARCHIVE_SYMBOLS_BUNDLE
+ override JPRT_ARCHIVE_SYMBOLS_BUNDLE := \
+ $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_SYMBOLS_BUNDLE))
endif
endif
@@ -51,6 +57,9 @@
ifndef JPRT_ARCHIVE_TEST_BUNDLE
JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
endif
+ifndef JPRT_ARCHIVE_SYMBOLS_BUNDLE
+ JPRT_ARCHIVE_SYMBOLS_BUNDLE=/tmp/jprt_bundles/symbols-image.zip
+endif
ifeq ($(SKIP_BOOT_CYCLE), false)
jprt_bundle: bootcycle-images
@@ -59,6 +68,10 @@
# This target must be called in the context of a SPEC file
jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_TEST_BUNDLE)
+ifeq ($(GCOV_ENABLED), true)
+ jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
+endif
+
# This target must be called in the context of a SPEC file
$(JPRT_ARCHIVE_BUNDLE): bundles
$(MKDIR) -p $(@D)
@@ -70,6 +83,11 @@
$(RM) $@
$(CP) $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip $@
+$(JPRT_ARCHIVE_SYMBOLS_BUNDLE): bundles
+ $(MKDIR) -p $(@D)
+ $(RM) $@
+ $(CP) $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip $@
+
SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
@@ -80,11 +98,19 @@
bundles: all
@$(call TargetEnter)
$(MKDIR) -p $(BUILD_OUTPUT)/bundles
- $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
- $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
- $(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip .
+ $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r \
+ $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
+ $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r \
+ $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
+ $(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r \
+ $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip .
if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
- $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
+ $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r \
+ $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
+ fi
+ if [ -d $(SYMBOLS_IMAGE_DIR) ] ; then \
+ $(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r \
+ $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip . ; \
fi
@$(call TargetExit)
--- a/make/Main.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/Main.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -531,7 +531,7 @@
# file.
CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
- images make-support test-make
+ images make-support test-make bundles
CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
--- a/make/common/IdlCompilation.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/IdlCompilation.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -88,15 +88,8 @@
# EXCLUDES
# OLDIMPLBASES
# DELETES
-define SetupIdlCompilation
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupIdlCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupIdlCompilationInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
+SetupIdlCompilation = $(NamedParamsMacroTemplate)
+define SetupIdlCompilationBody
# Find all existing java files and existing class files.
$$(call MakeDir,$$($1_BIN))
--- a/make/common/JavaCompilation.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/JavaCompilation.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -59,16 +59,8 @@
# FLAGS:=Flags to be supplied to javac
# SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
# SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
-define SetupJavaCompiler
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupJavaCompilerInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupJavaCompilerInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
-
+SetupJavaCompiler = $(NamedParamsMacroTemplate)
+define SetupJavaCompilerBody
# The port file contains the tcp/ip on which the server listens
# and the cookie necessary to talk to the server.
$1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port
@@ -84,10 +76,11 @@
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
-# Parameter 2 is a list of dependencies for the jar target. If left empty,
-# dependencies are searched using SRCS, which should not be empty.
-#
# Remaining parameters are named arguments. These include:
+# DEPENDENCIES:=List of dependencies for the jar target. If left empty,
+# dependencies are calculated automatically from the source files found.
+# For this to work, the source files must exist when the makefile is
+# parsed.
# SRCS:=List of directories in where to find files to add to archive
# SUFFIXES:=File suffixes to include in jar
# INCLUDES:=List of directories/packages in SRCS that should be included
@@ -102,17 +95,8 @@
# added to the archive.
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
# CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
-define SetupArchive
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupArchiveInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupArchiveInner
- # NOTE: $2 is dependencies, not a named argument!
- $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(findstring $(LOG_LEVEL),trace), $(info *[2] <dependencies> = $(strip $2)))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
+SetupArchive = $(NamedParamsMacroTemplate)
+define SetupArchiveBody
$1_JARMAIN:=$(strip $$($1_JARMAIN))
$1_JARNAME:=$$(notdir $$($1_JAR))
@@ -171,29 +155,27 @@
# When this macro is run in the same makefile as the java compilation, dependencies are
# transfered in make variables. When the macro is run in a different makefile than the
# java compilation, the dependencies need to be found in the filesystem.
- ifneq (,$2)
- $1_DEPS:=$2
- else
+ ifeq ($$($1_DEPENDENCIES), )
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(eval $$(call FillCacheFind, $$($1_FIND_LIST)))
- $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
+ $1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
$$(call CacheFind,$$($1_SRCS)))
ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
- $1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS))
+ $1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
endif
ifneq (,$$($1_GREP_EXCLUDE_PATTERNS))
- $1_DEPS:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPS))
+ $1_DEPENDENCIES:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
endif
# Look for EXTRA_FILES in all SRCS dirs and as absolute paths.
- $1_DEPS+=$$(wildcard $$(foreach src, $$($1_SRCS), \
+ $1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
$$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
ifeq (,$$($1_SKIP_METAINF))
- $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
+ $1_DEPENDENCIES+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
endif
endif
# The dependency list should never be empty
- ifeq ($$(strip $$($1_DEPS)), )
+ ifeq ($$(strip $$($1_DEPENDENCIES)), )
$$(warning No dependencies found for $1)
endif
@@ -288,7 +270,7 @@
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
# Here is the rule that creates/updates the jar file.
- $$($1_JAR) : $$($1_DEPS) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
+ $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
$(MKDIR) -p $$($1_BIN)
$$($1_GREP_INCLUDE_OUTPUT)
$$($1_GREP_EXCLUDE_OUTPUT)
@@ -429,15 +411,8 @@
# HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependecy
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
-define SetupJavaCompilation
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupJavaCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupJavaCompilationInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
+SetupJavaCompilation = $(NamedParamsMacroTemplate)
+define SetupJavaCompilationBody
# Verify arguments
ifeq ($$($1_BIN),)
@@ -653,7 +628,8 @@
$1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
endif
- $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1), \
+ $$(eval $$(call SetupArchive,ARCHIVE_$1, \
+ DEPENDENCIES:=$$($1), \
SRCS:=$$($1_BIN), \
SUFFIXES:=$$($1_SUFFIXES), \
EXCLUDE:=$$($1_EXCLUDES), \
--- a/make/common/MakeBase.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/MakeBase.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -374,28 +374,70 @@
# Make sure logging is setup for everyone that includes MakeBase.gmk.
$(eval $(call SetupLogging))
-# This is to be called by all SetupFoo macros
-define LogSetupMacroEntry
- $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
- $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $(strip $($i)),$(NEWLINE) $(strip [$i] $($i))))))
+################################################################################
+# Creates a sequence of increasing numbers (inclusive).
+# Param 1 - starting number
+# Param 2 - ending number
+sequence = \
+ $(wordlist $1, $2, $(strip \
+ $(eval SEQUENCE_COUNT :=) \
+ $(call _sequence-do,$(strip $2))))
+
+_sequence-do = \
+ $(if $(word $1, $(SEQUENCE_COUNT)),, \
+ $(eval SEQUENCE_COUNT += .) \
+ $(words $(SEQUENCE_COUNT)) \
+ $(call _sequence-do,$1))
+
+################################################################################
+
+MAX_PARAMS := 30
+PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
+
+# Template for creating a macro taking named parameters. To use it, assign the
+# template to a variable with the name you want for your macro, using '='
+# assignment. Then define a macro body with the suffix "Body". The Body macro
+# should take 1 parameter which should be a unique string for that invocation
+# of the macro.
+# Ex:
+# SetupFoo = $(NamedParamsMacroTemplate)
+# define SetupFooBody
+# # do something
+# # access parameters as $$($1_BAR)
+# endef
+# Call it like this
+# $(eval $(call SetupFoo, BUILD_SOMETHING, \
+# BAR := some parameter value, \
+# ))
+define NamedParamsMacroTemplate
+ $(if $($(MAX_PARAMS)),$(error Internal makefile error: \
+ Too many named arguments to macro, please update MAX_PARAMS in MakeBase.gmk))
+ # Iterate over 2 3 4... and evaluate the named parameters with $1_ as prefix
+ $(foreach i,$(PARAM_SEQUENCE), $(if $(strip $($i)),\
+ $(strip $1)_$(strip $($i)))$(NEWLINE))
+ # Debug print all named parameter names and values
+ $(if $(findstring $(LOG_LEVEL),debug trace), \
+ $(info $0 $(strip $1) $(foreach i,$(PARAM_SEQUENCE), \
+ $(if $(strip $($i)),$(NEWLINE) $(strip [$i] $(if $(filter $(LOG_LEVEL), trace), \
+ $($i), $(wordlist 1, 20, $($(i))) $(if $(word 21, $($(i))), ...)))))))
+
+ $(if $(DEBUG_$(strip $1)),
+ $(info -------- <<< Begin expansion of $(strip $1)) \
+ $(info $(call $(0)Body,$(strip $1))) \
+ $(info -------- >>> End expansion of $(strip $1)) \
+ )
+
+ $(call $(0)Body,$(strip $1))
endef
-# Support macro for all SetupFoo macros.
-define EvalDebugWrapper
- $(if $(DEBUG_$1),
- $(info -------- <<< Begin expansion of $1)
- $(info $2)
- $(info -------- >>> End expansion of $1)
- )
-
- $2
-endef
-
+################################################################################
# Make directory without forking mkdir if not needed
MakeDir = \
$(strip $(if $(subst $(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),,$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)),\
$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9)))
+################################################################################
+
ifeq ($(OPENJDK_TARGET_OS),solaris)
# On Solaris, if the target is a symlink and exists, cp won't overwrite.
# Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
@@ -437,6 +479,7 @@
endef
endif
+################################################################################
# Convenience functions for working around make's limitations with $(filter ).
containing = \
$(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
@@ -457,8 +500,9 @@
$(and $(findstring $(strip $1),$(strip $2)),\
$(findstring $(strip $2),$(strip $1)))
+################################################################################
+
ifneq ($(DISABLE_CACHE_FIND), true)
- ################################################################################
# In Cygwin, finds are very costly, both because of expensive forks and because
# of bad file system caching. Find is used extensively in $(shell) commands to
# find source files. This makes rerunning make with no or few changes rather
@@ -544,16 +588,8 @@
# FLATTEN : Set to flatten the directory structure in the DEST dir.
# MACRO : Optionally override the default macro used for making the copy.
# Default is 'install-file'
-
-define SetupCopyFiles
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupCopyFiles, please update MakeBase.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupCopyFilesInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupCopyFilesInner
- $(foreach i,2 3 4 5 6, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupCopyFiles($1),$2,$3,$4,$5,$6)
- $(if $(7),$(error Internal makefile error: Too many arguments to SetupCopyFiles, please update MakeBase.gmk))
+SetupCopyFiles = $(NamedParamsMacroTemplate)
+define SetupCopyFilesBody
ifeq ($$($1_MACRO), )
$1_MACRO := install-file
--- a/make/common/NativeCompilation.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/NativeCompilation.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -194,15 +194,9 @@
# CC the compiler to use, default is $(CC)
# LDEXE the linker to use for linking executables, default is $(LDEXE)
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
-define SetupNativeCompilation
- $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupNativeCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)))
-endef
-
-define SetupNativeCompilationInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
- $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
+# DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
+SetupNativeCompilation = $(NamedParamsMacroTemplate)
+define SetupNativeCompilationBody
ifneq (,$$($1_BIN))
$$(error BIN has been replaced with OBJECT_DIR)
@@ -398,6 +392,12 @@
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
endif
+ # Pick up disabled warnings, if possible on this platform.
+ ifneq ($(DISABLE_WARNING_PREFIX),)
+ $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
+ $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
+ endif
+
ifeq ($$($1_DEBUG_SYMBOLS), true)
ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
ifdef OPENJDK
--- a/make/common/RMICompilation.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/RMICompilation.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -37,15 +37,8 @@
# RUN_IIOP:=Set to run rmic with -iiop
# RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage
# KEEP_GENERATED:=Set to keep generated sources around
-define SetupRMICompilation
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupRMICompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupRMICompilationInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
+SetupRMICompilation = $(NamedParamsMacroTemplate)
+define SetupRMICompilationBody
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated
--- a/make/common/TestFilesCompilation.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/TestFilesCompilation.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -46,15 +46,8 @@
# TYPE Must be either PROGRAM or LIBRARY.
# SOURCE_DIRS A list of source directories to search
# OUTPUT_DIR Where to put the resulting files
-define SetupTestFilesCompilation
- $(if $(27),$(error Internal makefile error: Too many arguments to SetupTestFilesCompilation, please update BuildJTRegNative.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupTestFilesCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)))
-endef
-
-define SetupTestFilesCompilationInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupTestFileCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
- $(if $(27),$(error Internal makefile error: Too many arguments to SetupTestFilesCompilation, please update BuildJTRegNative.gmk))
+SetupTestFilesCompilation = $(NamedParamsMacroTemplate)
+define SetupTestFilesCompilationBody
# Check for duplicate base file names. That would have failed later anyhow, but
# this gives a better error message.
@@ -68,13 +61,13 @@
ifeq ($$($1_TYPE), LIBRARY)
$1_PREFIX = lib
$1_OUTPUT_SUBDIR := lib
- $1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
- $1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
+ $1_CFLAGS := $(CFLAGS_TESTLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
+ $1_LDFLAGS := $(LDFLAGS_TESTLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
else ifeq ($$($1_TYPE), PROGRAM)
$1_PREFIX = exe
$1_OUTPUT_SUBDIR := bin
- $1_CFLAGS := $(CFLAGS_JDKEXE) $(CFLAGS_WARNINGS_ARE_ERRORS)
- $1_LDFLAGS := $(LDFLAGS_JDKEXE)
+ $1_CFLAGS := $(CFLAGS_TESTEXE) $(CFLAGS_WARNINGS_ARE_ERRORS)
+ $1_LDFLAGS := $(LDFLAGS_TESTEXE)
else
$$(error Unknown type: $$($1_TYPE))
endif
--- a/make/common/TextFileProcessing.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/TextFileProcessing.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -77,15 +77,8 @@
# processed first, and replacements will be done on the included fragments as well.
# If neither is present, the files will just be copied without modifications.
#
-define SetupTextFileProcessing
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupTextFileProcessingInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupTextFileProcessingInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupTextFileProcessing($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
+SetupTextFileProcessing = $(NamedParamsMacroTemplate)
+define SetupTextFileProcessingBody
ifneq ($$($1_SOURCE_FILES),)
ifneq ($$($1_SOURCE_DIRS),)
--- a/make/common/ZipArchive.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/make/common/ZipArchive.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -45,15 +45,8 @@
# SUFFIXES
# EXTRA_DEPS
# ZIP_OPTIONS extra options to pass to zip
-define SetupZipArchive
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update ZipArchive.gmk))
- $(call EvalDebugWrapper,$(strip $1),$(call SetupZipArchiveInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupZipArchiveInner
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
- $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk))
+SetupZipArchive = $(NamedParamsMacroTemplate)
+define SetupZipArchiveBody
# To avoid running find over too large sets of files, which causes make to crash
# on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
--- a/modules.xml Wed Mar 11 08:30:40 2015 -0700
+++ b/modules.xml Tue Mar 17 12:30:53 2015 -0700
@@ -254,10 +254,10 @@
<to>java.sql</to>
<to>jdk.charsets</to>
<to>jdk.deploy.osx</to>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
<to>jdk.jconsole</to>
<to>jdk.jvmstat</to>
- <to>jdk.runtime</to>
+ <to>jdk.pack200</to>
<to>jdk.security.auth</to>
<to>jdk.security.jgss</to>
</export>
@@ -279,7 +279,7 @@
<name>sun.net.www</name>
<to>java.desktop</to>
<to>jdk.compiler</to>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
</export>
<export>
<name>sun.net.www.protocol.http</name>
@@ -353,14 +353,15 @@
<name>sun.security.pkcs</name>
<to>jdk.crypto.ec</to>
<to>jdk.deploy.osx</to>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
</export>
<export>
<name>sun.security.provider</name>
<to>java.rmi</to>
<to>java.security.jgss</to>
<to>jdk.crypto.pkcs11</to>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
+ <to>jdk.policytool</to>
<to>jdk.security.auth</to>
</export>
<export>
@@ -378,7 +379,7 @@
</export>
<export>
<name>sun.security.tools</name>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
</export>
<export>
<name>sun.security.util</name>
@@ -392,7 +393,8 @@
<to>jdk.crypto.pkcs11</to>
<to>jdk.crypto.ucrypto</to>
<to>jdk.deploy.osx</to>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
+ <to>jdk.policytool</to>
<to>jdk.security.auth</to>
</export>
<export>
@@ -401,7 +403,7 @@
<to>jdk.crypto.ec</to>
<to>jdk.crypto.pkcs11</to>
<to>jdk.deploy.osx</to>
- <to>jdk.dev</to>
+ <to>jdk.jartool</to>
<to>jdk.security.auth</to>
</export>
<export>
@@ -1591,16 +1593,8 @@
<module>
<name>jdk.dev</name>
<depend>java.base</depend>
- <depend>java.scripting</depend>
<depend>java.xml</depend>
- <depend>java.desktop</depend>
<depend>jdk.compiler</depend>
- <depend>jdk.rmic</depend>
- <depend>jdk.xml.bind</depend>
- <depend>jdk.xml.ws</depend>
- <export>
- <name>com.sun.jarsigner</name>
- </export>
</module>
<module>
<name>jdk.hotspot.agent</name>
@@ -1627,6 +1621,13 @@
</export>
</module>
<module>
+ <name>jdk.jartool</name>
+ <depend>java.base</depend>
+ <export>
+ <name>com.sun.jarsigner</name>
+ </export>
+ </module>
+ <module>
<name>jdk.javadoc</name>
<depend>java.base</depend>
<depend re-exports="true">java.compiler</depend>
@@ -1720,6 +1721,15 @@
<depend>java.rmi</depend>
</module>
<module>
+ <name>jdk.pack200</name>
+ <depend>java.base</depend>
+ </module>
+ <module>
+ <name>jdk.policytool</name>
+ <depend>java.base</depend>
+ <depend>java.desktop</depend>
+ </module>
+ <module>
<name>jdk.rmic</name>
<depend>java.base</depend>
<depend>java.corba</depend>
@@ -1727,10 +1737,6 @@
<depend>jdk.javadoc</depend>
</module>
<module>
- <name>jdk.runtime</name>
- <depend>java.base</depend>
- </module>
- <module>
<name>jdk.scripting.nashorn</name>
<depend>java.base</depend>
<depend>java.logging</depend>
--- a/nashorn/.hgtags Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/.hgtags Tue Mar 17 12:30:53 2015 -0700
@@ -287,3 +287,4 @@
10b32cc48ccc2592621b28558a1cf70a0ce22fe5 jdk9-b51
fada76c29db9c792ad7127e674ef5337e15d2225 jdk9-b52
6cd23482ca9bd0caa6bfa6bf9064251178083d17 jdk9-b53
+26460b897225010a4c7664eaff7a71f1156cacb3 jdk9-b54
--- a/nashorn/make/BuildNashorn.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/make/BuildNashorn.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -105,8 +105,8 @@
# Create nashorn.jar from the final classes dir
$(eval $(call SetupArchive,BUILD_NASHORN_JAR, \
- $(NASGEN_RUN_FILE) \
- $(VERSION_FILE), \
+ DEPENDENCIES := $(NASGEN_RUN_FILE) \
+ $(VERSION_FILE), \
SRCS := $(NASHORN_CLASSES_DIR), \
SUFFIXES := .class .js .properties Factory, \
MANIFEST := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/META-INF/MANIFEST.MF, \
--- a/nashorn/make/build-nasgen.xml Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/make/build-nasgen.xml Tue Mar 17 12:30:53 2015 -0700
@@ -35,11 +35,10 @@
<classpath>
<pathelement location="${basedir}/jcov2/lib/jcov_j2se_rt.jar"/>
<pathelement location="${basedir}/buildtools/nasgen/dist/nasgen.jar"/>
- <pathelement path="${basedir}/build/classes"/>
<pathelement location="${dist.dir}/nasgen.jar"/>
<pathelement path="${build.dir}/classes"/>
</classpath>
- <jvmarg value="${boot.class.path}"/>
+ <jvmarg value="-Xbootclasspath/p:${basedir}/build/classes"/>
<arg value="${build.dir}/classes"/>
<arg value="jdk.nashorn.internal.objects"/>
<arg value="${build.dir}/classes"/>
@@ -52,8 +51,8 @@
<java classname="jdk.nashorn.internal.tools.nasgen.Main" fork="true" failonerror="true">
<classpath>
<pathelement location="${basedir}/buildtools/nasgen/dist/nasgen.jar"/>
- <pathelement path="${basedir}/build/eclipse"/>
</classpath>
+ <jvmarg value="-Xbootclasspath/p:${basedir}/build/eclipse"/>
<arg value="${basedir}/build/eclipse"/>
<arg value="jdk.nashorn.internal.objects"/>
<arg value="${basedir}/build/eclipse/.nasgentmp"/>
--- a/nashorn/make/build.xml Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/make/build.xml Tue Mar 17 12:30:53 2015 -0700
@@ -98,7 +98,7 @@
<fail message="Unsupported Java version: ${ant.java.version}. Please use Java version 1.8 or greater." unless="jdk1.8+">
</fail>
</target>
-
+
<target name="init" depends="check-ant-version, check-java-version, init-conditions, init-cc">
<!-- extends jvm args -->
<property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
@@ -209,7 +209,7 @@
</target>
<target name="javadoc" depends="jar">
- <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${src.dir}/overview.html"
+ <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${src.dir}/overview.html"
extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
additionalparam="-quiet" failonerror="true">
<classpath>
@@ -227,7 +227,7 @@
<!-- generate javadoc only for nashorn extension api classes -->
<target name="javadocapi" depends="jar">
- <javadoc destdir="${dist.javadoc.dir}" use="yes" extdirs="${nashorn.ext.path}"
+ <javadoc destdir="${dist.javadoc.dir}" use="yes" extdirs="${nashorn.ext.path}"
windowtitle="${nashorn.product.name}" additionalparam="-quiet" failonerror="true">
<classpath>
<pathelement location="${build.classes.dir}"/>
@@ -314,6 +314,15 @@
permission java.security.AllPermission;
};
+grant codeBase "file:/${basedir}/${nashorn.api.tests.jar}" {
+ permission java.util.PropertyPermission "parserapitest.*", "read";
+ permission java.util.PropertyPermission "test.*", "read";
+ permission java.util.PropertyPermission "test262.*", "read";
+ permission java.io.FilePermission "${basedir}/test/-","read";
+ permission java.io.FilePermission "$${user.dir}", "read";
+ permission java.util.PropertyPermission "user.dir", "read";
+};
+
grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
permission java.security.AllPermission;
};
@@ -395,6 +404,7 @@
<fileset id="test.classes" dir="${build.test.classes.dir}">
<include name="**/api/javaaccess/*Test.class"/>
<include name="**/api/scripting/*Test.class"/>
+ <include name="**/api/tree/*Test.class"/>
<include name="**/codegen/*Test.class"/>
<include name="**/parser/*Test.class"/>
<include name="**/runtime/*Test.class"/>
@@ -440,7 +450,7 @@
<delete dir="${build.dir}/nashorn_code_cache"/>
<property name="debug.test.jvmargs" value=""/>
<testng outputdir="${build.test.results.dir}/${testResultsSubDir}" classfilesetref="test.classes"
- verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+ verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
<jvmarg line="${boot.class.path}"/>
<jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
<jvmarg line="${debug.test.jvmargs}"/>
@@ -466,7 +476,7 @@
<antcall target="-test-nosecurity" inheritRefs="true">
<param name="optimistic" value="true"/>
<param name="testResultsSubDir" value="optimistic"/>
- </antcall>
+ </antcall>
<antcall target="-test-security" inheritRefs="true">
<param name="optimistic" value="true"/>
<param name="testResultsSubDir" value="optimistic"/>
@@ -478,7 +488,7 @@
<antcall target="-test-nosecurity" inheritRefs="true">
<param name="optimistic" value="false"/>
<param name="testResultsSubDir" value="pessimistic"/>
- </antcall>
+ </antcall>
<antcall target="-test-security" inheritRefs="true">
<param name="optimistic" value="false"/>
<param name="testResultsSubDir" value="pessimistic"/>
--- a/nashorn/make/nbproject/project.xml Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/make/nbproject/project.xml Tue Mar 17 12:30:53 2015 -0700
@@ -2,21 +2,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.
@@ -155,7 +155,7 @@
</view>
<subprojects/>
</general-data>
- <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
<compilation-unit>
<package-root>../test/src</package-root>
<unit-tests/>
--- a/nashorn/make/project.properties Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/make/project.properties Tue Mar 17 12:30:53 2015 -0700
@@ -1,21 +1,21 @@
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
-#
+#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
-#
+#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
+#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
@@ -81,8 +81,8 @@
file.reference.testng.jar=test/lib/testng.jar
# Set testng verbose level
-# From TestNG docs: "the verbosity level (0 to 10 where 10 is most detailed)
-# Actually, this is a lie: you can specify -1 and this will put TestNG in
+# From TestNG docs: "the verbosity level (0 to 10 where 10 is most detailed)
+# Actually, this is a lie: you can specify -1 and this will put TestNG in
# debug mode (no longer slicing off stack traces and all)."
testng.verbose=2
@@ -134,6 +134,10 @@
test-sys-prop.test262.suite.dir=${test262.suite.dir}
test-sys-prop.es5conform.testcases.dir=${test.external.dir}/ES5Conform/TestCases
test-sys-prop.test.basic.dir=${test.basic.dir}
+test-sys-prop.test.external.dir=${test.external.dir}
+test-sys-prop.test.maptests.dir=${test.maptests.dir}
+test-sys-prop.test.sandbox.dir=${test.sandbox.dir}
+test-sys-prop.test.trusted.dir=${test.trusted.dir}
test-sys-prop-no-security.test.dir=${test.dir}
test-sys-prop-no-security.test.js.roots=${test.nosecurity.dir}
@@ -147,9 +151,11 @@
# turn on/off scripting mode for parser tests
test-sys-prop.parsertest.scripting=true
+test-sys-prop.parserapitest.verbose=false
# turn on/off test262 scripts for parser tests
test-sys-prop.parsertest.test262=false
+test-sys-prop.parserapitest.test262=false
# Control the verbosity of the CompilerTest
test-sys-prop.compilertest.verbose=false
@@ -289,19 +295,19 @@
# Extra jvmargs that might be useful for debugging
# and performance improvements/monitoring
#
-# -XX:+UnlockDiagnosticVMOptions
+# -XX:+UnlockDiagnosticVMOptions
#
# turn off compressed class pointers in metaspace
-# -XX:-UseCompressedKlassPointers
+# -XX:-UseCompressedKlassPointers
#
# dump the heap after every GC
# -XX:+PrintHeapAtGC
#
-# manually set a metaspace size for class data
+# manually set a metaspace size for class data
# -XX:ClassMetaspaceSize=300M
#
# print out methods compiled
-# -XX:+PrintCompilation
+# -XX:+PrintCompilation
#
# print all compiled nmethods with oopmaps and lots of other info
# -XX:+PrintNMethods
@@ -311,7 +317,7 @@
# feature in HotSpot - for example, the uncommon trap placement fix
# was hidden behind this flag before it became the default
#
-# -XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode
+# -XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode
#
# Crank up the type profile level to 222, which has some warmup
# penalties, but produces much better code for JavaScript, where better
@@ -342,7 +348,7 @@
octane.iterations=25
# List of octane tests to run, as properties prefixed with
-# "octane.benchmark." mapping to the benchmark name in
+# "octane.benchmark." mapping to the benchmark name in
# the test harness
#
# Octane tests that are disabled should have their entire line
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/breakcontinue_in_tryfinally.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+// Find break or continue inside try..finally in all scripts
+// in a given directory (recursively). If no directory is specified
+// the current working directory is scanned for scripts.
+
+if (arguments.length == 0) {
+ arguments[0] = ".";
+}
+
+var File = Java.type("java.io.File");
+var file = new File(arguments[0]);
+if (!file.exists()) {
+ print(arguments[0] + " is neither a directory nor a file");
+ exit(1);
+}
+
+var Files = Java.type("java.nio.file.Files");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+
+var parser = Parser.create("-scripting", "--const-as-var");
+
+function checkFile(file) {
+ // print("checking " + file);
+ var ast = parser.parse(file, print);
+ if (!ast) {
+ return;
+ }
+
+ // locate 'break/continue' inside try..finally
+ ast.accept(visitor = new (Java.extend(SimpleTreeVisitor)) {
+ lineMap: null,
+ inTryFinally: false,
+
+ printWarning: function(node, msg) {
+ var pos = node.startPosition;
+ var line = this.lineMap.getLineNumber(pos);
+ var column = this.lineMap.getColumnNumber(pos);
+ print(msg + " found in " + file + " @ " + line + ":" + column);
+ },
+
+ visitBreak: function(node, extra) {
+ if (this.inTryFinally) {
+ this.printWarning(node, "break");
+ }
+ },
+
+ visitContinue: function(node, extra) {
+ if (this.inTryFinally) {
+ this.printWarning(node, "continue");
+ }
+ },
+
+ visitCompilationUnit: function(node, extra) {
+ this.lineMap = node.lineMap;
+ Java.super(visitor).visitCompilationUnit(node, extra);
+ },
+
+ visitFunctionDeclaration: function(node, extra) {
+ var oldInTryFinally = this.inTryFinally;
+ this.inTryFinally = false;
+ try {
+ Java.super(visitor).visitFunctionDeclaration(node, extra);
+ } finally {
+ this.inTryFinally = oldInTryFinally;
+ }
+ },
+
+ visitFunctionExpression: function(node, extra) {
+ var oldInTryFinally = this.inTryFinally;
+ this.inTryFinally = false;
+ try {
+ Java.super(visitor).visitFunctionExpression(node, extra);
+ } finally {
+ this.inTryFinally = oldInTryFinally;
+ }
+ },
+
+ visitTry: function(node, extra) {
+ var oldInTryFinally = this.inTryFinally;
+ this.inTryFinally = (node.finallyBlock != null);
+ try {
+ Java.super(visitor).visitTry(node, extra);
+ } finally {
+ this.inTryFinally = oldInTryFinally;
+ }
+ }
+ }, null);
+}
+
+
+if (file.isDirectory()) {
+ Files.walk(file.toPath())
+ .filter(function(p) Files.isRegularFile(p))
+ .filter(function(p) p.toFile().name.endsWith('.js'))
+ .forEach(checkFile);
+} else {
+ checkFile(file);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/cricket.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,140 @@
+#// Usage: jjs -scripting cricket.js
+
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+// Example that demonstrates reading XML Rss feed.
+// XML DOM Document element is wrapped by script
+// "proxy" (JSAdapter constructor)
+
+// Java classes used
+var DocBuilderFac = Java.type("javax.xml.parsers.DocumentBuilderFactory");
+var Node = Java.type("org.w3c.dom.Node");
+
+// constants from Node class
+var ELEMENT_NODE = Node.ELEMENT_NODE;
+var TEXT_NODE = Node.TEXT_NODE;
+
+// parse XML from uri and return Document
+function parseXML(uri) {
+ var docBuilder = DocBuilderFac.newInstance().newDocumentBuilder();
+ return docBuilder["parse(java.lang.String)"](uri);
+}
+
+// get child Elements of given name of the parent element given
+function getChildElements(elem, name) {
+ var nodeList = elem.childNodes;
+ var childElems = [];
+ var len = nodeList.length;
+ for (var i = 0; i < len; i++) {
+ var node = nodeList.item(i);
+ if (node.nodeType == ELEMENT_NODE &&
+ node.tagName == name) {
+ childElems.push(wrapElement(node));
+ }
+ }
+
+ return childElems;
+}
+
+// get concatenated child text content of an Element
+function getElemText(elem) {
+ var nodeList = elem.childNodes;
+ var len = nodeList.length;
+ var text = '';
+ for (var i = 0; i < len; i++) {
+ var node = nodeList.item(i);
+ if (node.nodeType == TEXT_NODE) {
+ text += node.nodeValue;
+ }
+ }
+
+ return text;
+}
+
+// Wrap DOM Element object as a convenient script object
+// using JSAdapter. JSAdapter is like java.lang.reflect.Proxy
+// in that it allows property access, method calls be trapped
+// by 'magic' methods like __get__, __call__.
+function wrapElement(elem) {
+ if (! elem) {
+ return elem;
+ }
+ return new JSAdapter() {
+ // getter to expose child elements and attributes by name
+ __get__: function(name) {
+ if (typeof name == 'string') {
+ if (name.startsWith('@')) {
+ var attr = elem.getAttributeNode(name.substring(1));
+ return !attr? undefined : attr.value;
+ }
+
+ var arr = getChildElements(elem, name);
+ if (arr.length == 1) {
+ // single child element, expose as single element
+ return arr[0];
+ } else {
+ // multiple children of given name, expose as array
+ return arr;
+ }
+ }
+ return undefined;
+ },
+
+ __call__: function(name) {
+ // toString override to get text content of this Element
+ if (name == 'toString' || name == 'valueOf') {
+ return getElemText(elem);
+ }
+ return undefined;
+ }
+ }
+}
+
+function printCricketScore() {
+ var doc = parseXML("http://static.cricinfo.com/rss/livescores.xml");
+ // wrap document root Element as script convenient object
+ var rss = wrapElement(doc.documentElement);
+ print("rss file version " + rss['@version']);
+
+ print(rss.channel.title);
+ print(rss.channel.description);
+ print(rss.channel.pubDate);
+
+ print("=====================");
+
+ var items = rss.channel.item;
+ for each (var i in items) {
+ print(i.description);
+ }
+}
+
+printCricketScore();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/evalcheck.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+
+// Simple demo of Nashorn Parser API
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+var IdentifierTree = Java.type("jdk.nashorn.api.tree.IdentifierTree");
+
+var parser = Parser.create();
+var ast = parser.parse("t", "eval('hello');\n eval(2 + 3)", print);
+// locate 'eval' calls in the script
+ast.accept(visitor = new (Java.extend(SimpleTreeVisitor)) {
+ lineMap: null,
+ visitCompilationUnit: function(node, extra) {
+ this.lineMap = node.lineMap;
+ Java.super(visitor).visitCompilationUnit(node, extra);
+ },
+
+ visitFunctionCall: function(node, extra) {
+ var func = node.functionSelect;
+ if (func instanceof IdentifierTree && func.name == "eval") {
+ var pos = node.startPosition;
+ var line = this.lineMap.getLineNumber(pos);
+ var column = this.lineMap.getColumnNumber(pos);
+ print("eval call found @ " + line + ":" + column);
+ }
+ }
+}, null);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/findproto.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+// __proto__ magic property is non-standard. Use Object.getPrototypeOf
+// and Object.setPrototypeOf instead. This script finds __proto__
+// usage in scripts a given directory (recursively). If no directory
+// is specified the current working directory is scanned for scripts.
+
+if (arguments.length == 0) {
+ arguments[0] = ".";
+}
+
+var File = Java.type("java.io.File");
+var file = new File(arguments[0]);
+if (!file.exists()) {
+ print(arguments[0] + " is neither a file nor a directory");
+ exit(1);
+}
+
+var Files = Java.type("java.nio.file.Files");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+
+var parser = Parser.create("-scripting", "--const-as-var");
+var protoFound = false;
+
+function checkFile(file) {
+ // print("checking " + file);
+ var ast = parser.parse(file, print);
+ if (!ast) {
+ return;
+ }
+
+ // locate __proto__ usage and warn
+ ast.accept(visitor = new (Java.extend(SimpleTreeVisitor)) {
+ lineMap: null,
+
+ printWarning: function(node) {
+ var pos = node.startPosition;
+ var line = this.lineMap.getLineNumber(pos);
+ var column = this.lineMap.getColumnNumber(pos);
+ print("WARNING: __proto__ usage in " + file + " @ " + line + ":" + column);
+ },
+
+ checkProto: function(node, name) {
+ if (name == "__proto__") {
+ protoFound = true;
+ this.printWarning(node);
+ }
+ },
+
+ visitCompilationUnit: function(node, extra) {
+ this.lineMap = node.lineMap;
+ Java.super(visitor).visitCompilationUnit(node, extra);
+ },
+
+ visitIdentifier: function(node, extra) {
+ this.checkProto(node, node.name);
+ Java.super(visitor).visitIdentifier(node, extra);
+ },
+
+ visitMemberSelect: function(node, extra) {
+ this.checkProto(node, node.identifier);
+ Java.super(visitor).visitMemberSelect(node, extra);
+ },
+
+ visitProperty: function(node, extra) {
+ this.checkProto(node, node.key);
+ Java.super(visitor).visitProperty(node, extra);
+ }
+ }, null);
+}
+
+if (file.isDirectory()) {
+ Files.walk(file.toPath())
+ .filter(function(p) Files.isRegularFile(p))
+ .filter(function(p) p.toFile().name.endsWith('.js'))
+ .forEach(checkFile);
+} else {
+ checkFile(file);
+}
+
+if (protoFound) {
+ print("__proto__ is non-standard. Use Object.get/setPrototypeOf instead");
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/findvardelete.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+// delete of scope vars is reported as error in strict mode.
+// This script finds scripts that such deletes. Scripts in
+// the specified directory are scanned. If no directory is
+// specified, the current directory is scanned.
+
+if (arguments.length == 0) {
+ arguments[0] = ".";
+}
+
+var File = Java.type("java.io.File");
+var file = new File(arguments[0]);
+if (!file.exists()) {
+ print(arguments[0] + " is neither a directory nor a file");
+ exit(1);
+}
+
+var Files = Java.type("java.nio.file.Files");
+var IdentifierTree = Java.type("jdk.nashorn.api.tree.IdentifierTree");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+var Tree = Java.type("jdk.nashorn.api.tree.Tree");
+
+var parser = Parser.create("-scripting", "--const-as-var");
+
+function checkFile(file) {
+ // print("checking " + file);
+ var ast = parser.parse(file, print);
+ if (!ast) {
+ return;
+ }
+
+ // locate __proto__ usage and warn
+ ast.accept(visitor = new (Java.extend(SimpleTreeVisitor)) {
+ lineMap: null,
+
+ printWarning: function(node, varName) {
+ var pos = node.startPosition;
+ var line = this.lineMap.getLineNumber(pos);
+ var column = this.lineMap.getColumnNumber(pos);
+ print("WARNING: delete " + varName + " in " + file + " @ " + line + ":" + column);
+ },
+
+ visitCompilationUnit: function(node, extra) {
+ this.lineMap = node.lineMap;
+ Java.super(visitor).visitCompilationUnit(node, extra);
+ },
+
+ visitUnary: function(node, extra) {
+ if (node.kind == Tree.Kind.DELETE &&
+ node.expression instanceof IdentifierTree) {
+ this.printWarning(node, node.expression.name);
+ }
+ Java.super(visitor).visitUnary(node, extra);
+ },
+
+ }, null);
+}
+
+if (file.isDirectory()) {
+ Files.walk(file.toPath())
+ .filter(function(p) Files.isRegularFile(p))
+ .filter(function(p) p.toFile().name.endsWith('.js'))
+ .forEach(checkFile);
+} else {
+ checkFile(file);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/findwith.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+// 'with' statement is not considered a good practive. In strict mode,
+// with statements result in early error being thrown.
+
+// This script finds 'with' usage in scripts a given directory (recursively).
+// If no directory is specified the current working directory is scanned
+// for scripts.
+
+if (arguments.length == 0) {
+ arguments[0] = ".";
+}
+
+var File = Java.type("java.io.File");
+var file = new File(arguments[0]);
+if (!file.exists()) {
+ print(arguments[0] + " is neither a directory nor a file");
+ exit(1);
+}
+
+var Files = Java.type("java.nio.file.Files");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+
+var parser = Parser.create("-scripting", "--const-as-var");
+var protoFound = false;
+
+function checkFile(file) {
+ // print("checking " + file);
+ var ast = parser.parse(file, print);
+ if (!ast) {
+ return;
+ }
+
+ // locate __proto__ usage and warn
+ ast.accept(visitor = new (Java.extend(SimpleTreeVisitor)) {
+ lineMap: null,
+
+ printWarning: function(node) {
+ var pos = node.startPosition;
+ var line = this.lineMap.getLineNumber(pos);
+ var column = this.lineMap.getColumnNumber(pos);
+ print("WARNING: 'with' usage in " + file + " @ " + line + ":" + column);
+ },
+
+ visitCompilationUnit: function(node, extra) {
+ this.lineMap = node.lineMap;
+ Java.super(visitor).visitCompilationUnit(node, extra);
+ },
+
+ visitWith: function(node, extra) {
+ this.printWarning(node);
+ Java.super(visitor).visitWith(node, extra);
+ }
+ }, null);
+}
+
+if (file.isDirectory()) {
+ Files.walk(file.toPath())
+ .filter(function(p) Files.isRegularFile(p))
+ .filter(function(p) p.toFile().name.endsWith('.js'))
+ .forEach(checkFile);
+} else {
+ checkFile(file);
+}
+
+if (protoFound) {
+ print("__proto__ is non-standard. Use Object.get/setPrototypeOf instead");
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/nashornastviewer.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,113 @@
+#// Usage: jjs -scripting -fx nashornastviewer.js -- <scriptfile>
+
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+# NOTE: This script requires JDK 9 build to run
+
+if (!$OPTIONS._fx) {
+ print("Usage: jjs -scripting -fx nashornastviewer.js -- <.js file>");
+ exit(1);
+}
+
+// Using JavaFX from Nashorn. See also:
+// http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/javafx.html
+
+// This example shows AST of a script file as a JavaFX
+// tree view in a window. If no file is specified, AST of
+// this script file is shown. This script demonstrates
+// Nashorn Parser API too - http://openjdk.java.net/jeps/236
+
+// JavaFX classes used
+var StackPane = Java.type("javafx.scene.layout.StackPane");
+var Scene = Java.type("javafx.scene.Scene");
+var TreeItem = Java.type("javafx.scene.control.TreeItem");
+var TreeView = Java.type("javafx.scene.control.TreeView");
+
+// Java classes used
+var Enum = Java.type("java.lang.Enum");
+var File = Java.type("java.io.File");
+var List = Java.type("java.util.List");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var Tree = Java.type("jdk.nashorn.api.tree.Tree");
+
+// Create a javafx TreeItem to view a AST node
+function treeItemForASTNode(ast, name) {
+ var item = new TreeItem(name);
+ // make an iteratable script object from a Tree
+ ast = Object.bindProperties({}, ast);
+ for (var prop in ast) {
+ var node = ast[prop];
+ var type = typeof node;
+
+ if (node == null || type == "function") {
+ // skip nulls and Java methods
+ continue;
+ }
+
+ var subitem = null;
+ if (node instanceof Tree) {
+ subitem = treeItemForASTNode(node, prop);
+ } else if (node instanceof List) {
+ var len = node.size();
+ subitem = new TreeItem(prop);
+ for (var i = 0; i < len; i++) {
+ var li = treeItemForASTNode(node.get(i), String(i));
+ subitem.children.add(li);
+ }
+ } else if (node instanceof Enum || type != 'object') {
+ subitem = new TreeItem(prop + ": " + node);
+ }
+
+ if (subitem) {
+ item.children.add(subitem);
+ }
+ }
+ return item;
+}
+
+// do we have a script file passed? if not, use current script
+var sourceName = arguments.length == 0? __FILE__ : arguments[0];
+
+var parser = Parser.create("-scripting");
+// parse script to get CompilationUnitTree of it
+var ast = parser.parse(new File(sourceName), null);
+
+// JavaFX start method
+function start(stage) {
+ stage.title = "AST Viewer";
+ var rootItem = treeItemForASTNode(ast, sourceName);
+ var tree = new TreeView(rootItem);
+ var root = new StackPane();
+ root.children.add(tree);
+ stage.scene = new Scene(root, 300, 450);
+ stage.show();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/withcheck.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+
+// Simple demo of Nashorn Parser API
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var parser = Parser.create("-strict");
+// you'll get diagnostic message for 'with'
+parser.parse("t", "with({}){}", print);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/samples/xmlviewer.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,103 @@
+#jjs -fx xmlviewer.js [-- <url-of-xml-doc>]
+
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+if (! $OPTIONS._fx) {
+ print("Usage: jjs -fx xmlviewer.js [-- <url-of-xml-doc>]");
+ exit(1);
+}
+
+// Using JavaFX from Nashorn. See also:
+// http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/javafx.html
+
+// Simple sample to view a XML document as a JavaFX tree.
+
+// JavaFX classes used
+var StackPane = Java.type("javafx.scene.layout.StackPane");
+var Scene = Java.type("javafx.scene.Scene");
+var TreeItem = Java.type("javafx.scene.control.TreeItem");
+var TreeView = Java.type("javafx.scene.control.TreeView");
+
+// XML DocumentBuilderFactory
+var DocBuilderFac = Java.type("javax.xml.parsers.DocumentBuilderFactory");
+var Attr = Java.type("org.w3c.dom.Attr");
+var Element = Java.type("org.w3c.dom.Element");
+var Text = Java.type("org.w3c.dom.Text");
+
+// parse XML from uri and return Document
+function parseXML(uri) {
+ var docBuilder = DocBuilderFac.newInstance().newDocumentBuilder();
+ docBuilder.validating = false;
+ return docBuilder["parse(java.lang.String)"](uri);
+}
+
+// Create a javafx TreeItem to view a XML element
+function treeItemForObject(element, name) {
+ var item = new TreeItem(name);
+ item.expanded = true;
+ var attrs = element.attributes;
+ var numAttrs = attrs.length;
+ for (var a = 0; a < numAttrs; a++) {
+ var attr = attrs.item(a);
+ var subitem = new TreeItem(attr.name + " = " + attr.value);
+ item.children.add(subitem);
+ }
+
+ var childNodes = element.childNodes;
+ var numNodes = childNodes.length;
+ for (var n = 0; n < numNodes; n++) {
+ var node = childNodes.item(n);
+ if (node instanceof Element) {
+ var subitem = treeItemForObject(node, node.tagName);
+ item.children.add(subitem);
+ }
+ }
+
+ return item;
+}
+
+// Ofcourse, the best default URL is cricket score :)
+var DEFAULT_URL = "http://synd.cricbuzz.com/j2me/1.0/livematches.xml";
+
+var url = arguments.length == 0? DEFAULT_URL : arguments[0];
+var element = parseXML(url).getDocumentElement();
+
+// JavaFX start method
+function start(stage) {
+ stage.title = "XML Viewer: " + url;
+ var rootItem = treeItemForObject(element, element.tagName);
+ var tree = new TreeView(rootItem);
+ var root = new StackPane();
+ root.children.add(tree);
+ stage.scene = new Scene(root, 300, 450);
+ stage.show();
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java Tue Mar 17 12:30:53 2015 -0700
@@ -161,9 +161,8 @@
* @return set of property names
*/
@Override
- @SuppressWarnings("unchecked")
public Set<String> keySet() {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
/**
@@ -172,9 +171,8 @@
* @return set of property values.
*/
@Override
- @SuppressWarnings("unchecked")
public Collection<Object> values() {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
// JavaScript instanceof check
@@ -249,9 +247,27 @@
* Returns this object's numeric value.
*
* @return this object's numeric value.
+ * @deprecated use {@link #getDefaultValue(Class)} with {@link Number} hint instead.
*/
- @Override
+ @Override @Deprecated
public double toNumber() {
return Double.NaN;
}
+
+ /**
+ * When passed an {@link AbstractJSObject}, invokes its {@link #getDefaultValue(Class)} method. When passed any
+ * other {@link JSObject}, it will obtain its {@code [[DefaultValue]]} method as per ECMAScript 5.1 section
+ * 8.6.2.
+ *
+ * @param jsobj the {@link JSObject} whose {@code [[DefaultValue]]} is obtained.
+ * @param hint the type hint. Should be either {@code null}, {@code Number.class} or {@code String.class}.
+ * @return this object's default value.
+ * @throws UnsupportedOperationException if the conversion can't be performed. The engine will convert this
+ * exception into a JavaScript {@code TypeError}.
+ * @deprecated use {@link JSObject#getDefaultValue(Class)} instead.
+ */
+ @Deprecated
+ public static Object getDefaultValue(final JSObject jsobj, final Class<?> hint) {
+ return jsobj.getDefaultValue(hint);
+ }
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java Tue Mar 17 12:30:53 2015 -0700
@@ -813,7 +813,7 @@
}
}
- @Override
+ @Override @Deprecated
public double toNumber() {
return inGlobal(new Callable<Double>() {
@Override public Double call() {
@@ -823,7 +823,7 @@
}
@Override
- public Object getDefaultValue(Class<?> hint) {
+ public Object getDefaultValue(final Class<?> hint) {
return inGlobal(new Callable<Object>() {
@Override public Object call() {
try {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an array access expression.
+ *
+ * For example:
+ * <pre>
+ * <em>expression</em> [ <em>index</em> ]
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ArrayAccessTree extends ExpressionTree {
+ /**
+ * Returns the array that is accessed.
+ *
+ * @return the array that is accessed
+ */
+ ExpressionTree getExpression();
+
+ /**
+ * Returns the index of the array element accessed.
+ *
+ * @return the index expression
+ */
+ ExpressionTree getIndex();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.Expression;
+
+final class ArrayAccessTreeImpl extends ExpressionTreeImpl implements ArrayAccessTree {
+
+ private final ExpressionTree base, index;
+
+ ArrayAccessTreeImpl(final Expression node, final ExpressionTree base, final ExpressionTree index) {
+ super(node);
+ this.base = base;
+ this.index = index;
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.ARRAY_ACCESS;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return base;
+ }
+
+ @Override
+ public ExpressionTree getIndex() {
+ return index;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitArrayAccess(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * Represents ECMAScript array literal expression.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ArrayLiteralTree extends ExpressionTree {
+ /**
+ * Returns the list of Array element expressions.
+ *
+ * @return array element expressions
+ */
+ public List<? extends ExpressionTree> getElements();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.LiteralNode;
+
+final class ArrayLiteralTreeImpl extends ExpressionTreeImpl
+ implements ArrayLiteralTree {
+ private final List<? extends ExpressionTree> elements;
+ ArrayLiteralTreeImpl(final LiteralNode<?> node, final List<? extends ExpressionTree> elements) {
+ super(node);
+ this.elements = elements;
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.ARRAY_LITERAL;
+ }
+
+ @Override
+ public List<? extends ExpressionTree> getElements() {
+ return elements;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitArrayLiteral(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an assignment expression.
+ *
+ * For example:
+ * <pre>
+ * <em>variable</em> = <em>expression</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface AssignmentTree extends ExpressionTree {
+ /**
+ * Returns the left hand side (LHS) of this assignment.
+ *
+ * @return left hand side (LHS) expression
+ */
+ ExpressionTree getVariable();
+
+ /**
+ * Returns the right hand side (RHS) of this assignment.
+ *
+ * @return right hand side (RHS) expression
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.BinaryNode;
+
+final class AssignmentTreeImpl extends ExpressionTreeImpl implements AssignmentTree {
+ private final Tree.Kind kind;
+ private final ExpressionTree var, expr;
+
+ AssignmentTreeImpl(final BinaryNode node, final ExpressionTree left, final ExpressionTree right) {
+ super(node);
+ assert node.isAssignment() : "assignment node expected";
+ this.var = left;
+ this.expr = right;
+ this.kind = getOperator(node.tokenType());
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return kind;
+ }
+
+ @Override
+ public ExpressionTree getVariable() {
+ return var;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitAssignment(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a binary expression.
+ * Use {@link #getKind getKind} to determine the kind of operator.
+ *
+ * For example:
+ * <pre>
+ * <em>leftOperand</em> <em>operator</em> <em>rightOperand</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface BinaryTree extends ExpressionTree {
+ /**
+ * Returns left hand side (LHS) of this binary expression.
+ *
+ * @return left hand side (LHS) of this binary expression
+ */
+ ExpressionTree getLeftOperand();
+
+ /**
+ * Returns right hand side (RHS) of this binary expression.
+ *
+ * @return right hand side (RHS) of this binary expression
+ */
+ ExpressionTree getRightOperand();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.BinaryNode;
+
+class BinaryTreeImpl extends ExpressionTreeImpl implements BinaryTree {
+ private final Tree.Kind kind;
+ private final ExpressionTree left, right;
+
+ BinaryTreeImpl(final BinaryNode node, final ExpressionTree left, final ExpressionTree right) {
+ super(node);
+ assert !node.isAssignment() : "assignment node";
+ this.left = left;
+ this.right = right;
+ this.kind = getOperator(node.tokenType());
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return kind;
+ }
+
+ @Override
+ public ExpressionTree getLeftOperand() {
+ return left;
+ }
+
+ @Override
+ public ExpressionTree getRightOperand() {
+ return right;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitBinary(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a statement block.
+ *
+ * For example:
+ * <pre>
+ * { }
+ *
+ * { <em>statements</em> }
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface BlockTree extends StatementTree {
+ /**
+ * Returns the list of statements in this block.
+ *
+ * @return the list of statements in this block
+ */
+ List<? extends StatementTree> getStatements();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockStatement;
+
+final class BlockTreeImpl extends StatementTreeImpl implements BlockTree {
+ private final List<? extends StatementTree> statements;
+
+ BlockTreeImpl(final BlockStatement node, final List<? extends StatementTree> statements) {
+ super(node);
+ this.statements = statements;
+ }
+
+ BlockTreeImpl(final Block node, final List<? extends StatementTree> statements) {
+ super(node);
+ this.statements = statements;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.BLOCK;
+ }
+
+ @Override
+ public List<? extends StatementTree> getStatements() {
+ return statements;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitBlock(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'break' statement.
+ *
+ * For example:
+ * <pre>
+ * break;
+ *
+ * break <em>label</em> ;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface BreakTree extends GotoTree {
+ /**
+ * Label associated with this break statement. This is null
+ * if there is no label associated with this break statement.
+ *
+ * @return label associated with this break statement.
+ */
+ @Override
+ String getLabel();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.BreakNode;
+
+final class BreakTreeImpl extends StatementTreeImpl implements BreakTree {
+ private final String label;
+
+ BreakTreeImpl(final BreakNode node) {
+ super(node);
+ this.label = node.getLabelName();
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.BREAK;
+ }
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitBreak(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a 'case' in a 'switch' statement.
+ *
+ * For example:
+ * <pre>
+ * case <em>expression</em> :
+ * <em>statements</em>
+ *
+ * default :
+ * <em>statements</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface CaseTree extends Tree {
+ /**
+ * Case expression of this 'case' statement.
+ *
+ * @return null if and only if this Case is {@code default:}
+ */
+ ExpressionTree getExpression();
+
+ /**
+ * Return the list of statements for this 'case'.
+ *
+ * @return list of statements for this 'case'
+ */
+ List<? extends StatementTree> getStatements();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.CaseNode;
+
+final class CaseTreeImpl extends TreeImpl implements CaseTree {
+ private final ExpressionTree expression;
+ private final List<? extends StatementTree> statements;
+
+ public CaseTreeImpl(final CaseNode node,
+ final ExpressionTree expression,
+ final List<? extends StatementTree> statements) {
+ super(node);
+ this.expression = expression;
+ this.statements = statements;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.CASE;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expression;
+ }
+
+ @Override
+ public List<? extends StatementTree> getStatements() {
+ return statements;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitCase(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'catch' block in a 'try' statement.
+ *
+ * For example:
+ * <pre>
+ * catch ( <em>parameter</em> )
+ * <em>block</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface CatchTree extends Tree {
+ /**
+ * Returns the catch parameter identifier of the exception caught.
+ *
+ * @return the catch parameter identifier
+ */
+ IdentifierTree getParameter();
+
+ /**
+ * Returns the code block of this catch block.
+ *
+ * @return the code block
+ */
+ BlockTree getBlock();
+
+ /**
+ * Returns the optional catch condition expression. This is null
+ * if this is an unconditional catch statement.
+ *
+ * @return the optional catch condition expression.
+ */
+ ExpressionTree getCondition();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.CatchNode;
+
+final class CatchTreeImpl extends TreeImpl implements CatchTree {
+ private final IdentifierTree param;
+ private final BlockTree block;
+ private final ExpressionTree condition;
+
+ CatchTreeImpl(final CatchNode node,
+ final IdentifierTree param,
+ final BlockTree block,
+ final ExpressionTree condition) {
+ super(node);
+ this.param = param;
+ this.block = block;
+ this.condition = condition;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.CATCH;
+ }
+
+ @Override
+ public IdentifierTree getParameter() {
+ return param;
+ }
+
+ @Override
+ public BlockTree getBlock() {
+ return block;
+ }
+
+ @Override
+ public ExpressionTree getCondition() {
+ return condition;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitCatch(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * Represents the abstract syntax tree for compilation units (source
+ * files)
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface CompilationUnitTree extends Tree {
+ /**
+ * Return the list of source elements in this compilation unit.
+ *
+ * @return the list of source elements in this compilation unit
+ */
+ List<? extends Tree> getSourceElements();
+
+ /**
+ * Return the source name of this script compilation unit.
+ *
+ * @return the source name of this script compilation unit
+ */
+ String getSourceName();
+
+ /**
+ * Returns if this is a ECMAScript "strict" compilation unit or not.
+ *
+ * @return true if this compilation unit is declared "strict"
+ */
+ boolean isStrict();
+
+ /**
+ * Returns the line map for this compilation unit, if available.
+ * Returns null if the line map is not available.
+ *
+ * @return the line map for this compilation unit
+ */
+ LineMap getLineMap();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.FunctionNode;
+
+final class CompilationUnitTreeImpl extends TreeImpl
+ implements CompilationUnitTree {
+ private final FunctionNode funcNode;
+ private final List<? extends Tree> elements;
+
+ CompilationUnitTreeImpl(final FunctionNode node,
+ final List<? extends Tree> elements) {
+ super(node);
+ this.funcNode = node;
+ assert funcNode.getKind() == FunctionNode.Kind.SCRIPT : "script function expected";
+ this.elements = elements;
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.COMPILATION_UNIT;
+ }
+
+ @Override
+ public List<? extends Tree> getSourceElements() {
+ return elements;
+ }
+
+ @Override
+ public String getSourceName() {
+ return funcNode.getSourceName();
+ }
+
+ @Override
+ public boolean isStrict() {
+ return funcNode.isStrict();
+ }
+
+ @Override
+ public LineMap getLineMap() {
+ return new LineMapImpl(funcNode.getSource());
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitCompilationUnit(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for compound assignment operator.
+ * Use {@link #getKind getKind} to determine the kind of operator.
+ *
+ * For example:
+ * <pre>
+ * <em>variable</em> <em>operator</em> <em>expression</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface CompoundAssignmentTree extends ExpressionTree {
+ /**
+ * Returns the left hand side (LHS) of this assignment.
+ *
+ * @return left hand side (LHS) expression
+ */
+ ExpressionTree getVariable();
+
+ /**
+ * Returns the right hand side (RHS) of this assignment.
+ *
+ * @return right hand side (RHS) expression
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.BinaryNode;
+
+final class CompoundAssignmentTreeImpl extends ExpressionTreeImpl implements CompoundAssignmentTree {
+
+ private final ExpressionTree var, expr;
+ private final Kind kind;
+
+ CompoundAssignmentTreeImpl(final BinaryNode node, final ExpressionTree left, final ExpressionTree right) {
+ super(node);
+ assert node.isAssignment() : "not an assignment node";
+ this.var = left;
+ this.expr = right;
+ this.kind = getOperator(node.tokenType());
+ assert kind != Tree.Kind.ASSIGNMENT : "compound assignment expected";
+ }
+
+ @Override
+ public Kind getKind() {
+ return kind;
+ }
+
+ @Override
+ public ExpressionTree getVariable() {
+ return var;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitCompoundAssignment(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for the conditional operator ? :.
+ *
+ * For example:
+ * <pre>
+ * <em>condition</em> ? <em>trueExpression</em> : <em>falseExpression</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ConditionalExpressionTree extends ExpressionTree {
+ /**
+ * Returns the condition expression of this ternary expression.
+ *
+ * @return the condition expression
+ */
+ ExpressionTree getCondition();
+
+ /**
+ * Returns the true part of this ternary expression.
+ *
+ * @return the 'true' part expression
+ */
+ ExpressionTree getTrueExpression();
+
+ /**
+ * Returns the false part of this ternary expression.
+ *
+ * @return the 'false' part expression
+ */
+ ExpressionTree getFalseExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.TernaryNode;
+
+final class ConditionalExpressionTreeImpl extends ExpressionTreeImpl implements ConditionalExpressionTree {
+ private final ExpressionTree condExpr, trueExpr, falseExpr;
+
+ ConditionalExpressionTreeImpl(final TernaryNode node,
+ final ExpressionTree condExpr, final ExpressionTree trueExpr,
+ final ExpressionTree falseExpr) {
+ super(node);
+ this.condExpr = condExpr;
+ this.trueExpr = trueExpr;
+ this.falseExpr = falseExpr;
+
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.CONDITIONAL_EXPRESSION;
+ }
+
+ @Override
+ public ExpressionTree getCondition() {
+ return condExpr;
+ }
+
+ @Override
+ public ExpressionTree getTrueExpression() {
+ return trueExpr;
+ }
+
+ @Override
+ public ExpressionTree getFalseExpression() {
+ return falseExpr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitConditionalExpression(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A mixin for conditional "loop" statements.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ConditionalLoopTree extends LoopTree {
+ /**
+ * Returns the condition expression of this 'loop' statement.
+ *
+ * @return the condition expression
+ */
+ ExpressionTree getCondition();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'continue' statement.
+ *
+ * For example:
+ * <pre>
+ * continue;
+ * continue <em>label</em> ;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ContinueTree extends GotoTree {
+ /**
+ * Label associated with this continue statement. This is null
+ * if there is no label associated with this continue statement.
+ *
+ * @return label associated with this continue statement.
+ */
+ @Override
+ String getLabel();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ContinueNode;
+
+final class ContinueTreeImpl extends StatementTreeImpl implements ContinueTree {
+ private final String label;
+
+ ContinueTreeImpl(final ContinueNode node) {
+ super(node);
+ this.label = node.getLabelName();
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.CONTINUE;
+ }
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitContinue(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'debugger' statement.
+ *
+ * For example:
+ * <pre>
+ * <em>debugger;</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface DebuggerTree extends StatementTree {
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.DebuggerNode;
+
+final class DebuggerTreeImpl extends StatementTreeImpl implements DebuggerTree {
+ DebuggerTreeImpl(final DebuggerNode node) {
+ super(node);
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.DEBUGGER;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitDebugger(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * Interface for diagnostics from tools. A diagnostic usually reports
+ * a problem at a specific position in a source file. However, not
+ * all diagnostics are associated with a position or a file.
+ *
+ * <p>A position is a zero-based character offset from the beginning of
+ * a file. Negative values (except {@link #NOPOS}) are not valid
+ * positions.
+ *
+ * <p>Line and column numbers begin at 1. Negative values (except
+ * {@link #NOPOS}) and 0 are not valid line or column numbers.
+ *
+ * <p>Line terminator is as defined in ECMAScript specification which is one
+ * of { \u000A, \u000B, \u2028, \u2029 }.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface Diagnostic {
+
+ /**
+ * Kinds of diagnostics, for example, error or warning.
+ *
+ * The kind of a diagnostic can be used to determine how the
+ * diagnostic should be presented to the user. For example,
+ * errors might be colored red or prefixed with the word "Error",
+ * while warnings might be colored yellow or prefixed with the
+ * word "Warning". There is no requirement that the Kind
+ * should imply any inherent semantic meaning to the message
+ * of the diagnostic: for example, a tool might provide an
+ * option to report all warnings as errors.
+ */
+ enum Kind {
+ /**
+ * Problem which prevents the tool's normal completion.
+ */
+ ERROR,
+ /**
+ * Problem which does not usually prevent the tool from
+ * completing normally.
+ */
+ WARNING,
+ /**
+ * Problem similar to a warning, but is mandated by the tool's
+ * specification. For example, the Java™ Language
+ * Specification mandates warnings on certain
+ * unchecked operations and the use of deprecated methods.
+ */
+ MANDATORY_WARNING,
+ /**
+ * Informative message from the tool.
+ */
+ NOTE,
+ /**
+ * Diagnostic which does not fit within the other kinds.
+ */
+ OTHER,
+ }
+
+ /**
+ * Used to signal that no position is available.
+ */
+ public final static long NOPOS = -1;
+
+ /**
+ * Gets the kind of this diagnostic, for example, error or
+ * warning.
+ * @return the kind of this diagnostic
+ */
+ Kind getKind();
+
+ /**
+ * Gets a character offset from the beginning of the source object
+ * associated with this diagnostic that indicates the location of
+ * the problem. In addition, the following must be true:
+ *
+ * <p>{@code getStartPostion() <= getPosition()}
+ * <p>{@code getPosition() <= getEndPosition()}
+ *
+ * @return character offset from beginning of source; {@link
+ * #NOPOS} if no location is suitable
+ */
+ long getPosition();
+
+ /**
+ * Gets the source file name.
+ *
+ * @return the file name or null if not available
+ */
+ String getFileName();
+
+ /**
+ * Gets the line number of the character offset returned by
+ * {@linkplain #getPosition()}.
+ *
+ * @return a line number or {@link #NOPOS} if and only if {@link
+ * #getPosition()} returns {@link #NOPOS}
+ */
+ long getLineNumber();
+
+ /**
+ * Gets the column number of the character offset returned by
+ * {@linkplain #getPosition()}.
+ *
+ * @return a column number or {@link #NOPOS} if and only if {@link
+ * #getPosition()} returns {@link #NOPOS}
+ */
+ long getColumnNumber();
+
+ /**
+ * Gets a diagnostic code indicating the type of diagnostic. The
+ * code is implementation-dependent and might be {@code null}.
+ *
+ * @return a diagnostic code
+ */
+ String getCode();
+
+ /**
+ * Gets a message for this diagnostic.
+ *
+ * @return a message
+ */
+ String getMessage();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.parser.Token;
+import jdk.nashorn.internal.runtime.ParserException;
+
+final class DiagnosticImpl implements Diagnostic {
+ private final ParserException exp;
+ private final Kind kind;
+
+ DiagnosticImpl(final ParserException exp, final Kind kind) {
+ this.exp = exp;
+ this.kind = kind;
+ }
+
+ @Override
+ public Kind getKind() {
+ return kind;
+ }
+
+ @Override
+ public long getPosition() {
+ return exp.getPosition();
+ }
+
+ @Override
+ public String getFileName() {
+ return exp.getFileName();
+ }
+
+ @Override
+ public long getLineNumber() {
+ return exp.getLineNumber();
+ }
+
+ @Override
+ public long getColumnNumber() {
+ return exp.getColumnNumber();
+ }
+
+ @Override
+ public String getCode() {
+ final long token = exp.getToken();
+ return (token < 0)? null : Token.toString(null, token, true);
+ }
+
+ @Override
+ public String getMessage() {
+ return exp.getMessage();
+ }
+
+ @Override
+ public String toString() {
+ return getMessage();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * Interface for receiving diagnostics from Nashorn parser.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+@FunctionalInterface
+public interface DiagnosticListener {
+ /**
+ * Invoked whenever a parsing problem is found.
+ *
+ * @param diagnostic additional information errors, warnings detected during parsing.
+ */
+ void report(Diagnostic diagnostic);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'do' statement.
+ *
+ * For example:
+ * <pre>
+ * do
+ * <em>statement</em>
+ * while ( <em>expression</em> );
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface DoWhileLoopTree extends ConditionalLoopTree {
+ /**
+ * Returns the condition expression of this do-while statement.
+ *
+ * @return the condition expression
+ */
+ ExpressionTree getCondition();
+
+ /**
+ * The statement contained within this do-while statement.
+ *
+ * @return the statement
+ */
+ StatementTree getStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.WhileNode;
+
+final class DoWhileLoopTreeImpl extends StatementTreeImpl implements DoWhileLoopTree {
+ private final ExpressionTree cond;
+ private final StatementTree stat;
+
+ DoWhileLoopTreeImpl(final WhileNode node, final ExpressionTree cond, final StatementTree stat) {
+ super(node);
+ assert node.isDoWhile() : "do while expected";
+ this.cond = cond;
+ this.stat = stat;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.DO_WHILE_LOOP;
+ }
+
+ @Override
+ public ExpressionTree getCondition() {
+ return cond;
+ }
+
+ @Override
+ public StatementTree getStatement() {
+ return stat;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitDoWhileLoop(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an empty (skip) statement.
+ *
+ * For example:
+ * <pre>
+ * ;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface EmptyStatementTree extends StatementTree {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.EmptyNode;
+
+final class EmptyStatementTreeImpl extends StatementTreeImpl implements EmptyStatementTree {
+ EmptyStatementTreeImpl(final EmptyNode node) {
+ super(node);
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.EMPTY_STATEMENT;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitEmptyStatement(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node to stand in for a malformed expression.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ErroneousTree extends ExpressionTree {
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ErrorNode;
+
+final class ErroneousTreeImpl extends ExpressionTreeImpl implements ErroneousTree {
+ ErroneousTreeImpl(final ErrorNode errorNode) {
+ super(errorNode);
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.ERROR;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitErroneous(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an expression statement.
+ *
+ * For example:
+ * <pre>
+ * <em>expression</em> ;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ExpressionStatementTree extends StatementTree {
+ /**
+ * Returns the expression of this expression statement.
+ *
+ * @return the expression
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ExpressionStatement;
+
+final class ExpressionStatementTreeImpl extends StatementTreeImpl implements ExpressionStatementTree {
+ private final ExpressionTree expr;
+
+ ExpressionStatementTreeImpl(final ExpressionStatement es, final ExpressionTree expr) {
+ super(es);
+ this.expr = expr;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.EXPRESSION_STATEMENT;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitExpressionStatement(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node used as the base class for the different types of
+ * expressions.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ExpressionTree extends Tree {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.Expression;
+
+abstract class ExpressionTreeImpl extends TreeImpl implements ExpressionTree {
+ ExpressionTreeImpl(final Expression expr) {
+ super(expr);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for for..in statement
+ *
+ * For example:
+ * <pre>
+ * for ( <em>variable</em> in <em>expression</em> )
+ * <em>statement</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ForInLoopTree extends LoopTree {
+ /**
+ * The for..in left hand side expression.
+ *
+ * @return the left hand side expression
+ */
+ ExpressionTree getVariable();
+
+ /**
+ * The object or array being whose properties are iterated.
+ *
+ * @return the object or array expression being iterated
+ */
+ ExpressionTree getExpression();
+
+ /**
+ * The statement contained in this for..in statement.
+ *
+ * @return the statement
+ */
+ StatementTree getStatement();
+
+ /**
+ * Returns if this is a for..each..in statement or not.
+ *
+ * @return true if this is a for..each..in statement
+ */
+ boolean isForEach();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ForNode;
+
+final class ForInLoopTreeImpl extends StatementTreeImpl implements ForInLoopTree {
+ private final ExpressionTree lhsExpr;
+ private final ExpressionTree expr;
+ private final StatementTree stat;
+ private final boolean forEach;
+
+ ForInLoopTreeImpl(final ForNode node,
+ final ExpressionTree lhsExpr,
+ final ExpressionTree expr,
+ final StatementTree stat) {
+ super(node);
+ assert node.isForIn() : "for ..in expected";
+ this.lhsExpr = lhsExpr;
+ this.expr = expr;
+ this.stat = stat;
+ this.forEach = node.isForEach();
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.FOR_IN_LOOP;
+ }
+
+ @Override
+ public ExpressionTree getVariable() {
+ return lhsExpr;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public StatementTree getStatement() {
+ return stat;
+ }
+
+ @Override
+ public boolean isForEach() {
+ return forEach;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitForInLoop(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a basic 'for' loop statement.
+ *
+ * For example:
+ * <pre>
+ * for ( <em>initializer</em> ; <em>condition</em> ; <em>update</em> )
+ * <em>statement</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ForLoopTree extends ConditionalLoopTree {
+ /**
+ * Returns the initializer expression of this 'for' statement.
+ *
+ * @return the initializer expression
+ */
+ ExpressionTree getInitializer();
+
+ /**
+ * Returns the condition expression of this 'for' statement.
+ *
+ * @return the condition expression
+ */
+ @Override
+ ExpressionTree getCondition();
+
+ /**
+ * Returns the update expression of this 'for' statement.
+ *
+ * @return the update expression
+ */
+ ExpressionTree getUpdate();
+
+ /**
+ * Returns the statement contained in this 'for' statement.
+ *
+ * @return the statement
+ */
+ @Override
+ StatementTree getStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ForNode;
+
+final class ForLoopTreeImpl extends StatementTreeImpl implements ForLoopTree {
+ private final ExpressionTree init;
+ private final ExpressionTree cond;
+ private final ExpressionTree update;
+ private final StatementTree stat;
+
+ ForLoopTreeImpl(final ForNode node,
+ final ExpressionTree init,
+ final ExpressionTree cond,
+ final ExpressionTree update,
+ final StatementTree stat) {
+ super(node);
+ assert !node.isForIn() : "for statement expected";
+ this.init = init;
+ this.cond = cond;
+ this.update = update;
+ this.stat = stat;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.FOR_LOOP;
+ }
+
+ @Override
+ public ExpressionTree getInitializer() {
+ return init;
+ }
+
+ @Override
+ public ExpressionTree getCondition() {
+ return cond;
+ }
+
+ @Override
+ public ExpressionTree getUpdate() {
+ return update;
+ }
+
+ @Override
+ public StatementTree getStatement() {
+ return stat;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitForLoop(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a function call expression.
+ *
+ * For example:
+ * <pre>
+ * <em>identifier</em> ( <em>arguments</em> )
+ *
+ * this . <em>identifier</em> ( <em>arguments</em> )
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface FunctionCallTree extends ExpressionTree {
+ /**
+ * Returns the function being called.
+ *
+ * @return the function being called
+ */
+ ExpressionTree getFunctionSelect();
+
+ /**
+ * Returns the list of arguments being passed to this function call.
+ *
+ * @return the list of argument expressions
+ */
+ List<? extends ExpressionTree> getArguments();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.CallNode;
+
+class FunctionCallTreeImpl extends ExpressionTreeImpl implements FunctionCallTree {
+ private final List<? extends ExpressionTree> arguments;
+ private final ExpressionTree function;
+ FunctionCallTreeImpl(final CallNode node,
+ final ExpressionTree function,
+ final List<? extends ExpressionTree> arguments) {
+ super(node);
+ this.function = function;
+ this.arguments = arguments;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.FUNCTION_INVOCATION;
+ }
+
+ @Override
+ public ExpressionTree getFunctionSelect() {
+ return function;
+ }
+
+ @Override
+ public List<? extends ExpressionTree> getArguments() {
+ return arguments;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitFunctionCall(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a function declaration.
+ *
+ * For example:
+ * <pre>
+ * <em>function</em> <em>name</em>
+ * ( <em>parameters</em> )
+ * <em>body</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface FunctionDeclarationTree extends StatementTree {
+ /**
+ * Returns the name of the function being declared.
+ *
+ * @return name the function declared
+ */
+ String getName();
+
+ /**
+ * Returns the parameters of this function.
+ *
+ * @return the list of parameters
+ */
+ List<? extends ExpressionTree> getParameters();
+
+ /**
+ * Returns the body of code of this function.
+ *
+ * @return the body of code
+ */
+ BlockTree getBody();
+
+ /**
+ * Is this a strict function?
+ *
+ * @return true if this function is strict
+ */
+ boolean isStrict();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.VarNode;
+
+final class FunctionDeclarationTreeImpl extends StatementTreeImpl
+ implements FunctionDeclarationTree {
+ private final FunctionNode funcNode;
+ private final String funcName;
+ private final List<? extends ExpressionTree> params;
+ private final BlockTree body;
+
+ FunctionDeclarationTreeImpl(final VarNode node,
+ final List<? extends ExpressionTree> params,
+ final BlockTree body) {
+ super(node);
+ assert node.getInit() instanceof FunctionNode : "function expected";
+ funcNode = (FunctionNode)node.getInit();
+ assert funcNode.isDeclared() : "function declaration expected";
+ funcName = node.getName().getName();
+ this.params = params;
+ this.body = body;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.FUNCTION;
+ }
+
+ @Override
+ public String getName() {
+ return funcName;
+ }
+
+ @Override
+ public List<? extends ExpressionTree> getParameters() {
+ return params;
+ }
+
+ @Override
+ public BlockTree getBody() {
+ return body;
+ }
+
+ @Override
+ public boolean isStrict() {
+ return funcNode.isStrict();
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitFunctionDeclaration(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a function expression.
+ *
+ * For example:
+ * <pre>
+ * <em>var</em> func = <em>function</em>
+ * ( <em>parameters</em> )
+ * <em>body</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface FunctionExpressionTree extends ExpressionTree {
+ /**
+ * Returns the name of the function being declared.
+ *
+ * @return name the function declared
+ */
+ String getName();
+
+ /**
+ * Returns the parameters of this function.
+ *
+ * @return the list of parameters
+ */
+ List<? extends ExpressionTree> getParameters();
+
+ /**
+ * Returns the body of code of this function.
+ *
+ * @return the body of code
+ */
+ BlockTree getBody();
+
+ /**
+ * Is this a strict function?
+ *
+ * @return true if this function is strict
+ */
+ boolean isStrict();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.FunctionNode;
+
+final class FunctionExpressionTreeImpl extends ExpressionTreeImpl
+ implements FunctionExpressionTree {
+ private final FunctionNode funcNode;
+ private final String funcName;
+ private final List<? extends ExpressionTree> params;
+ private final BlockTree body;
+
+ FunctionExpressionTreeImpl(final FunctionNode node,
+ final List<? extends ExpressionTree> params,
+ final BlockTree body) {
+ super(node);
+ funcNode = node;
+ assert !funcNode.isDeclared() : "function expression expected";
+
+ final FunctionNode.Kind kind = node.getKind();
+ if (node.isAnonymous() || kind == FunctionNode.Kind.GETTER || kind == FunctionNode.Kind.SETTER) {
+ funcName = null;
+ } else {
+ funcName = node.getIdent().getName();
+ }
+
+ this.params = params;
+ this.body = body;
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.FUNCTION_EXPRESSION;
+ }
+
+ @Override
+ public String getName() {
+ return funcName;
+ }
+
+ @Override
+ public List<? extends ExpressionTree> getParameters() {
+ return params;
+ }
+
+ @Override
+ public BlockTree getBody() {
+ return body;
+ }
+
+ @Override
+ public boolean isStrict() {
+ return funcNode.isStrict();
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitFunctionExpression(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a statement that jumps to a target. Note that
+ * ECMAScript does not support a goto statement. But, this Tree
+ * type serves as a super interface for {@link BreakTree} and
+ * {@link ContinueTree}.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface GotoTree extends StatementTree {
+ /**
+ * Label associated with this goto statement. This is null
+ * if there is no label associated with this goto statement.
+ *
+ * @return label associated with this goto statement.
+ */
+ String getLabel();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,517 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.ArrayList;
+import java.util.List;
+import jdk.nashorn.internal.ir.AccessNode;
+import jdk.nashorn.internal.ir.BinaryNode;
+import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockStatement;
+import jdk.nashorn.internal.ir.BreakNode;
+import jdk.nashorn.internal.ir.CallNode;
+import jdk.nashorn.internal.ir.CaseNode;
+import jdk.nashorn.internal.ir.CatchNode;
+import jdk.nashorn.internal.ir.ContinueNode;
+import jdk.nashorn.internal.ir.DebuggerNode;
+import jdk.nashorn.internal.ir.EmptyNode;
+import jdk.nashorn.internal.ir.ErrorNode;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.ExpressionStatement;
+import jdk.nashorn.internal.ir.ForNode;
+import jdk.nashorn.internal.ir.FunctionNode;
+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.LiteralNode;
+import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.ObjectNode;
+import jdk.nashorn.internal.ir.PropertyNode;
+import jdk.nashorn.internal.ir.ReturnNode;
+import jdk.nashorn.internal.ir.RuntimeNode;
+import jdk.nashorn.internal.ir.SplitNode;
+import jdk.nashorn.internal.ir.Statement;
+import jdk.nashorn.internal.ir.SwitchNode;
+import jdk.nashorn.internal.ir.TernaryNode;
+import jdk.nashorn.internal.ir.ThrowNode;
+import jdk.nashorn.internal.ir.TryNode;
+import jdk.nashorn.internal.ir.UnaryNode;
+import jdk.nashorn.internal.ir.VarNode;
+import jdk.nashorn.internal.ir.WhileNode;
+import jdk.nashorn.internal.ir.WithNode;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+import jdk.nashorn.internal.parser.Lexer;
+import jdk.nashorn.internal.parser.TokenType;
+
+/**
+ * This class translates from nashorn IR Node objects
+ * to nashorn parser API Tree objects.
+ */
+final class IRTranslator extends NodeVisitor<LexicalContext> {
+
+ public IRTranslator() {
+ super(new LexicalContext());
+ }
+
+ // currently translated Statement
+ private StatementTreeImpl curStat;
+ // currently translated Expression
+ private ExpressionTreeImpl curExpr;
+
+ // entry point for translator
+ CompilationUnitTree translate(final FunctionNode node) {
+ if (node == null) {
+ return null;
+ }
+
+ assert (node.getKind() == FunctionNode.Kind.SCRIPT) : "script function expected";
+
+ final Block body = node.getBody();
+ return new CompilationUnitTreeImpl(node,
+ translateStats(body != null? body.getStatements() : null));
+ }
+
+ @Override
+ public boolean enterAccessNode(final AccessNode accessNode) {
+ curExpr = new MemberSelectTreeImpl(accessNode, translateExpr(accessNode.getBase()));
+ return false;
+ }
+
+ @Override
+ public boolean enterBlock(final Block block) {
+ // FIXME: revisit this!
+ if (block.isSynthetic()) {
+ final int statCount = block.getStatementCount();
+ switch (statCount) {
+ case 0: {
+ final EmptyNode emptyNode = new EmptyNode(-1, block.getToken(), block.getFinish());
+ curStat = new EmptyStatementTreeImpl(emptyNode);
+ return false;
+ }
+ case 1: {
+ curStat = translateStat(block.getStatements().get(0));
+ return false;
+ }
+ }
+ }
+
+ curStat = new BlockTreeImpl(block,
+ translateStats(block.getStatements()));
+ return false;
+ }
+
+ @Override
+ public boolean enterBinaryNode(final BinaryNode binaryNode) {
+ if (binaryNode.isAssignment()) {
+ final ExpressionTree srcTree = translateExpr(binaryNode.getAssignmentSource());
+ final ExpressionTree destTree = translateExpr(binaryNode.getAssignmentDest());
+
+ if (binaryNode.tokenType() == TokenType.ASSIGN) {
+ curExpr = new AssignmentTreeImpl(binaryNode, destTree, srcTree);
+ } else {
+ curExpr = new CompoundAssignmentTreeImpl(binaryNode, destTree, srcTree);
+ }
+ } else {
+ final ExpressionTree leftTree = translateExpr(binaryNode.lhs());
+ final ExpressionTree rightTree = translateExpr(binaryNode.rhs());
+
+ if (binaryNode.tokenType() == TokenType.INSTANCEOF) {
+ curExpr = new InstanceOfTreeImpl(binaryNode, leftTree, rightTree);
+ } else {
+ curExpr = new BinaryTreeImpl(binaryNode, leftTree, rightTree);
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean enterBreakNode(final BreakNode breakNode) {
+ curStat = new BreakTreeImpl(breakNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterCallNode(final CallNode callNode) {
+ curExpr = null;
+ callNode.getFunction().accept(this);
+ final ExpressionTree funcTree = curExpr;
+ final List<? extends ExpressionTree> argTrees = translateExprs(callNode.getArgs());
+ curExpr = new FunctionCallTreeImpl(callNode, funcTree, argTrees);
+ return false;
+ }
+
+ @Override
+ public boolean enterCaseNode(final CaseNode caseNode) {
+ assert false : "should not reach here!";
+ return false;
+ }
+
+ @Override
+ public boolean enterCatchNode(final CatchNode catchNode) {
+ assert false : "should not reach here";
+ return false;
+ }
+
+ @Override
+ public boolean enterContinueNode(final ContinueNode continueNode) {
+ curStat = new ContinueTreeImpl(continueNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterDebuggerNode(final DebuggerNode debuggerNode) {
+ curStat = new DebuggerTreeImpl(debuggerNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterEmptyNode(final EmptyNode emptyNode) {
+ curStat = new EmptyStatementTreeImpl(emptyNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterErrorNode(final ErrorNode errorNode) {
+ curExpr = new ErroneousTreeImpl(errorNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
+ curStat = new ExpressionStatementTreeImpl(expressionStatement,
+ translateExpr(expressionStatement.getExpression()));
+ return false;
+ }
+
+ @Override
+ public boolean enterBlockStatement(final BlockStatement blockStatement) {
+ final Block block = blockStatement.getBlock();
+ if (blockStatement.isSynthetic()) {
+ assert block != null && block.getStatements() != null && block.getStatements().size() == 1;
+ curStat = translateStat(block.getStatements().get(0));
+ } else {
+ curStat = new BlockTreeImpl(blockStatement,
+ translateStats(block != null? block.getStatements() : null));
+ }
+ return false;
+ }
+
+ @Override
+ public boolean enterForNode(final ForNode forNode) {
+ if (forNode.isForIn()) {
+ curStat = new ForInLoopTreeImpl(forNode,
+ translateExpr(forNode.getInit()),
+ translateExpr(forNode.getModify()),
+ translateBlock(forNode.getBody()));
+ } else {
+ curStat = new ForLoopTreeImpl(forNode,
+ translateExpr(forNode.getInit()),
+ translateExpr(forNode.getTest()),
+ translateExpr(forNode.getModify()),
+ translateBlock(forNode.getBody()));
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean enterFunctionNode(final FunctionNode functionNode) {
+ assert !functionNode.isDeclared() : "should not reach here for function declaration";
+
+ final List<? extends ExpressionTree> paramTrees
+ = translateExprs(functionNode.getParameters());
+ final BlockTree blockTree = (BlockTree) translateBlock(functionNode.getBody());
+ curExpr = new FunctionExpressionTreeImpl(functionNode, paramTrees, blockTree);
+
+ return false;
+ }
+
+ @Override
+ public boolean enterIdentNode(final IdentNode identNode) {
+ curExpr = new IdentifierTreeImpl(identNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterIfNode(final IfNode ifNode) {
+ curStat = new IfTreeImpl(ifNode,
+ translateExpr(ifNode.getTest()),
+ translateBlock(ifNode.getPass()),
+ translateBlock(ifNode.getFail()));
+ return false;
+ }
+
+ @Override
+ public boolean enterIndexNode(final IndexNode indexNode) {
+ curExpr = new ArrayAccessTreeImpl(indexNode,
+ translateExpr(indexNode.getBase()),
+ translateExpr(indexNode.getIndex()));
+ return false;
+ }
+
+ @Override
+ public boolean enterLabelNode(final LabelNode labelNode) {
+ curStat = new LabeledStatementTreeImpl(labelNode,
+ translateBlock(labelNode.getBody()));
+ return false;
+ }
+
+ @Override
+ public boolean enterLiteralNode(final LiteralNode<?> literalNode) {
+ final Object value = literalNode.getValue();
+ if (value instanceof Lexer.RegexToken) {
+ curExpr = new RegExpLiteralTreeImpl(literalNode);
+ } else if (literalNode.isArray()) {
+ final List<Expression> exprNodes = literalNode.getElementExpressions();
+ final List<ExpressionTreeImpl> exprTrees = new ArrayList<>(exprNodes.size());
+ for (final Node node : exprNodes) {
+ if (node == null) {
+ exprTrees.add(null);
+ } else {
+ curExpr = null;
+ node.accept(this);
+ assert curExpr != null : "null for " + node;
+ exprTrees.add(curExpr);
+ }
+ }
+ curExpr = new ArrayLiteralTreeImpl(literalNode, exprTrees);
+ } else {
+ curExpr = new LiteralTreeImpl(literalNode);
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean enterObjectNode(final ObjectNode objectNode) {
+ final List<PropertyNode> propNodes = objectNode.getElements();
+ final List<PropertyTreeImpl> propTrees = new ArrayList<>(propNodes.size());
+ for (final PropertyNode propNode : propNodes) {
+ propTrees.add(new PropertyTreeImpl(propNode,
+ translateExpr(propNode.getKey()),
+ translateExpr(propNode.getValue()),
+ (FunctionExpressionTree) translateExpr(propNode.getGetter()),
+ (FunctionExpressionTree) translateExpr(propNode.getSetter())));
+ }
+ curExpr = new ObjectLiteralTreeImpl(objectNode, propTrees);
+ return false;
+ }
+
+ @Override
+ public boolean enterPropertyNode(final PropertyNode propertyNode) {
+ assert false : "should not reach here!";
+ return false;
+ }
+
+ @Override
+ public boolean enterReturnNode(final ReturnNode returnNode) {
+ curStat = new ReturnTreeImpl(returnNode,
+ translateExpr(returnNode.getExpression()));
+ return false;
+ }
+
+ @Override
+ public boolean enterRuntimeNode(final RuntimeNode runtimeNode) {
+ assert false : "should not reach here: RuntimeNode";
+ return false;
+ }
+
+ @Override
+ public boolean enterSplitNode(final SplitNode splitNode) {
+ assert false : "should not reach here!";
+ return false;
+ }
+
+ @Override
+ public boolean enterSwitchNode(final SwitchNode switchNode) {
+ final List<CaseNode> caseNodes = switchNode.getCases();
+ final List<CaseTreeImpl> caseTrees = new ArrayList<>(caseNodes.size());
+ for (final CaseNode caseNode : caseNodes) {
+ final Block body = caseNode.getBody();
+ caseTrees.add(
+ new CaseTreeImpl(caseNode,
+ translateExpr(caseNode.getTest()),
+ translateStats(body != null? body.getStatements() : null)));
+ }
+
+ curStat = new SwitchTreeImpl(switchNode,
+ translateExpr(switchNode.getExpression()),
+ caseTrees);
+ return false;
+ }
+
+ @Override
+ public boolean enterTernaryNode(final TernaryNode ternaryNode) {
+ curExpr = new ConditionalExpressionTreeImpl(ternaryNode,
+ translateExpr(ternaryNode.getTest()),
+ translateExpr(ternaryNode.getTrueExpression()),
+ translateExpr(ternaryNode.getFalseExpression()));
+ return false;
+ }
+
+ @Override
+ public boolean enterThrowNode(final ThrowNode throwNode) {
+ curStat = new ThrowTreeImpl(throwNode,
+ translateExpr(throwNode.getExpression()));
+ return false;
+ }
+
+ @Override
+ public boolean enterTryNode(final TryNode tryNode) {
+ final List<? extends CatchNode> catchNodes = tryNode.getCatches();
+ final List<CatchTreeImpl> catchTrees = new ArrayList<>(catchNodes.size());
+ for (final CatchNode catchNode : catchNodes) {
+ catchTrees.add(new CatchTreeImpl(catchNode,
+ translateIdent(catchNode.getException()),
+ (BlockTree) translateBlock(catchNode.getBody()),
+ translateExpr(catchNode.getExceptionCondition())));
+ }
+
+ curStat = new TryTreeImpl(tryNode,
+ (BlockTree) translateBlock(tryNode.getBody()),
+ catchTrees,
+ (BlockTree) translateBlock(tryNode.getFinallyBody()));
+
+ return false;
+ }
+
+ @Override
+ public boolean enterUnaryNode(final UnaryNode unaryNode) {
+ if (unaryNode.tokenType() == TokenType.NEW) {
+ curExpr = new NewTreeImpl(unaryNode,
+ translateExpr(unaryNode.getExpression()));
+ } else {
+ curExpr = new UnaryTreeImpl(unaryNode,
+ translateExpr(unaryNode.getExpression()));
+ }
+ return false;
+ }
+
+ @Override
+ public boolean enterVarNode(final VarNode varNode) {
+ final Expression initNode = varNode.getInit();
+ if (initNode instanceof FunctionNode && ((FunctionNode)initNode).isDeclared()) {
+ final FunctionNode funcNode = (FunctionNode) initNode;
+
+ final List<? extends ExpressionTree> paramTrees
+ = translateExprs(funcNode.getParameters());
+ final BlockTree blockTree = (BlockTree) translateBlock(funcNode.getBody());
+ curStat = new FunctionDeclarationTreeImpl(varNode, paramTrees, blockTree);
+ } else {
+ curStat = new VariableTreeImpl(varNode, translateExpr(initNode));
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean enterWhileNode(final WhileNode whileNode) {
+ final ExpressionTree condTree = translateExpr(whileNode.getTest());
+ final StatementTree statTree = translateBlock(whileNode.getBody());
+
+ if (whileNode.isDoWhile()) {
+ curStat = new DoWhileLoopTreeImpl(whileNode, condTree, statTree);
+ } else {
+ curStat = new WhileLoopTreeImpl(whileNode, condTree, statTree);
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean enterWithNode(final WithNode withNode) {
+ curStat = new WithTreeImpl(withNode,
+ translateExpr(withNode.getExpression()),
+ translateBlock(withNode.getBody()));
+
+ return false;
+ }
+
+ private StatementTree translateBlock(final Block blockNode) {
+ if (blockNode == null) {
+ return null;
+ }
+ curStat = null;
+ blockNode.accept(this);
+ return curStat;
+ }
+
+ private List<? extends StatementTree> translateStats(final List<? extends Statement> stats) {
+ if (stats == null) {
+ return null;
+ }
+ final List<StatementTreeImpl> statTrees = new ArrayList<>(stats.size());
+ for (final Statement stat : stats) {
+ curStat = null;
+ stat.accept(this);
+ assert curStat != null;
+ statTrees.add(curStat);
+ }
+ return statTrees;
+ }
+
+ private List<? extends ExpressionTree> translateExprs(final List<? extends Expression> exprs) {
+ if (exprs == null) {
+ return null;
+ }
+ final List<ExpressionTreeImpl> exprTrees = new ArrayList<>(exprs.size());
+ for (final Expression expr : exprs) {
+ curExpr = null;
+ expr.accept(this);
+ assert curExpr != null;
+ exprTrees.add(curExpr);
+ }
+ return exprTrees;
+ }
+
+ private ExpressionTreeImpl translateExpr(final Expression expr) {
+ if (expr == null) {
+ return null;
+ }
+
+ curExpr = null;
+ expr.accept(this);
+ assert curExpr != null : "null for " + expr;
+ return curExpr;
+ }
+
+ private StatementTreeImpl translateStat(final Statement stat) {
+ if (stat == null) {
+ return null;
+ }
+
+ curStat = null;
+ stat.accept(this);
+ assert curStat != null : "null for " + stat;
+ return curStat;
+ }
+
+ private IdentifierTree translateIdent(final IdentNode ident) {
+ return new IdentifierTreeImpl(ident);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an identifier expression.
+ *
+ * For example:
+ * <pre>
+ * <em>name</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface IdentifierTree extends ExpressionTree {
+ /**
+ * Returns the name of this identifier.
+ *
+ * @return the name of this identifier
+ */
+ String getName();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.IdentNode;
+
+final class IdentifierTreeImpl extends ExpressionTreeImpl implements IdentifierTree {
+ private final String name;
+
+ IdentifierTreeImpl(final IdentNode node) {
+ super(node);
+ this.name = node.getName();
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.IDENTIFIER;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitIdentifier(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an 'if' statement.
+ *
+ * For example:
+ * <pre>
+ * if ( <em>condition</em> )
+ * <em>thenStatement</em>
+ *
+ * if ( <em>condition</em> )
+ * <em>thenStatement</em>
+ * else
+ * <em>elseStatement</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface IfTree extends StatementTree {
+ /**
+ * Returns the condition expression of this 'if' statement.
+ *
+ * @return the condition expression
+ */
+ ExpressionTree getCondition();
+
+ /**
+ * Returns the 'then' statement of this 'if' statement.
+ *
+ * @return the 'then' statement
+ */
+ StatementTree getThenStatement();
+
+ /**
+ * Returns the then statement of this 'if' statement.
+ * null if this if statement has no else branch.
+ *
+ * @return the 'else' statement
+ */
+ StatementTree getElseStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.IfNode;
+
+final class IfTreeImpl extends StatementTreeImpl implements IfTree {
+ private final ExpressionTree cond;
+ private final StatementTree thenStat;
+ private final StatementTree elseStat;
+ IfTreeImpl(final IfNode node, final ExpressionTree cond,
+ final StatementTree thenStat, final StatementTree elseStat) {
+ super(node);
+ this.cond = cond;
+ this.thenStat = thenStat;
+ this.elseStat = elseStat;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.IF;
+ }
+
+ @Override
+ public ExpressionTree getCondition() {
+ return cond;
+ }
+
+ @Override
+ public StatementTree getThenStatement() {
+ return thenStat;
+ }
+
+ /**
+ * @return null if this if statement has no else branch.
+ */
+ @Override
+ public StatementTree getElseStatement() {
+ return elseStat;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitIf(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for an 'instanceof' expression.
+ *
+ * For example:
+ * <pre>
+ * <em>expression</em> instanceof <em>type</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface InstanceOfTree extends ExpressionTree {
+ /**
+ * Returns the expression whose type is being checked.
+ *
+ * @return the expression whose type is being checked
+ */
+ ExpressionTree getExpression();
+
+ /**
+ * Returns the type expression.
+ *
+ * @return the type expression
+ */
+ Tree getType();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.BinaryNode;
+import jdk.nashorn.internal.parser.TokenType;
+
+final class InstanceOfTreeImpl extends BinaryTreeImpl implements InstanceOfTree {
+ InstanceOfTreeImpl(final BinaryNode node,
+ final ExpressionTree expr,
+ final ExpressionTree type) {
+ super(node, expr, type);
+ assert node.tokenType() == TokenType.INSTANCEOF : "instanceof expected";
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.INSTANCE_OF;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return getLeftOperand();
+ }
+
+ @Override
+ public Tree getType() {
+ return getRightOperand();
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitInstanceOf(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a labeled statement.
+ *
+ * For example:
+ * <pre>
+ * <em>label</em> : <em>statement</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface LabeledStatementTree extends StatementTree {
+ /**
+ * Returns the label associated with this statement.
+ *
+ * @return the label
+ */
+ String getLabel();
+
+ /**
+ * Returns the statement being labeled.
+ *
+ * @return the statement labeled
+ */
+ StatementTree getStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.LabelNode;
+
+final class LabeledStatementTreeImpl extends StatementTreeImpl
+ implements LabeledStatementTree {
+ private final String name;
+ private final StatementTree stat;
+
+ LabeledStatementTreeImpl(final LabelNode node, final StatementTree stat) {
+ super(node);
+ this.name = node.getLabelName();
+ this.stat = stat;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.LABELED_STATEMENT;
+ }
+
+ @Override
+ public String getLabel() {
+ return name;
+ }
+
+ @Override
+ public StatementTree getStatement() {
+ return stat;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitLabeledStatement(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * Provides methods to convert between character positions and line numbers
+ * for a compilation unit.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface LineMap {
+ /**
+ * Find the line containing a position; a line termination
+ * character is on the line it terminates.
+ *
+ * @param pos character offset of the position
+ * @return the line number of pos (first line is 1)
+ */
+ long getLineNumber(long pos);
+
+ /**
+ * Find the column for a character position.
+ * Tab characters preceding the position on the same line
+ * will be expanded when calculating the column number.
+ *
+ * @param pos character offset of the position
+ * @return the tab-expanded column number of pos (first column is 1)
+ */
+ long getColumnNumber(long pos);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMapImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.runtime.Source;
+
+final class LineMapImpl implements LineMap {
+ private final Source source;
+
+ LineMapImpl(final Source source) {
+ this.source = source;
+ }
+
+ @Override
+ public long getLineNumber(long pos) {
+ return source.getLine((int)pos);
+ }
+
+ @Override
+ public long getColumnNumber(long pos) {
+ return source.getColumn((int)pos);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a literal expression.
+ * Use {@link #getKind getKind} to determine the kind of literal.
+ *
+ * For example:
+ * <pre>
+ * <em>value</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface LiteralTree extends ExpressionTree {
+ /**
+ * Returns the value of this literal.
+ *
+ * @return the value of this literal
+ */
+ Object getValue();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.LiteralNode;
+
+final class LiteralTreeImpl extends ExpressionTreeImpl implements LiteralTree {
+ private final Object value;
+ private final Kind kind;
+ LiteralTreeImpl(final LiteralNode<?> node) {
+ super(node);
+ this.kind = literalKind(node);
+ this.value = node.getValue();
+ }
+
+ @Override
+ public Kind getKind() {
+ return kind;
+ }
+
+ @Override
+ public Object getValue() {
+ return value;
+ }
+
+ private static Kind literalKind(final LiteralNode<?> node) {
+ if (node.isBoolean()) {
+ return Kind.BOOLEAN_LITERAL;
+ } else if (node.isNumeric()) {
+ return Kind.NUMBER_LITERAL;
+ } else if (node.isString()) {
+ return Kind.STRING_LITERAL;
+ } else if (node.isNull()) {
+ return Kind.NULL_LITERAL;
+ } else {
+ throw new AssertionError("should not reach here: " + node.getValue());
+ }
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitLiteral(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A mixin for "loop" statements.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface LoopTree extends StatementTree {
+ /**
+ * Returns the statement contained in this 'loop' statement.
+ *
+ * @return the statement
+ */
+ StatementTree getStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a member access expression.
+ *
+ * For example:
+ * <pre>
+ * <em>expression</em> . <em>identifier</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface MemberSelectTree extends ExpressionTree {
+ /**
+ * The object expression whose member is being selected.
+ *
+ * @return the object whose member is selected
+ */
+ ExpressionTree getExpression();
+
+ /**
+ * Returns the name of the property.
+ *
+ * @return the name of the property
+ */
+ String getIdentifier();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.AccessNode;
+
+final class MemberSelectTreeImpl extends ExpressionTreeImpl
+ implements MemberSelectTree {
+ private final String ident;
+ private final ExpressionTree expr;
+ MemberSelectTreeImpl(final AccessNode node, final ExpressionTree expr) {
+ super(node);
+ this.ident = node.getProperty();
+ this.expr = expr;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.MEMBER_SELECT;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public String getIdentifier() {
+ return ident;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitMemberSelect(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node to declare a new instance of a class.
+ *
+ * For example:
+ * <pre>
+ * new <em>identifier</em> ( )
+ *
+ * new <em>identifier</em> ( <em>arguments</em> )
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface NewTree extends ExpressionTree {
+ /**
+ * Returns the constructor expression of this 'new' expression.
+ *
+ * @return the constructor expression of this 'new' expression
+ */
+ ExpressionTree getConstructorExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.UnaryNode;
+import jdk.nashorn.internal.parser.TokenType;
+
+final class NewTreeImpl extends ExpressionTreeImpl implements NewTree {
+ private final ExpressionTree constrExpr;
+
+ NewTreeImpl(final UnaryNode node, final ExpressionTree constrExpr) {
+ super(node);
+ assert (node.tokenType() == TokenType.NEW) : "new expected";
+ this.constrExpr = constrExpr;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.NEW;
+ }
+
+ @Override
+ public ExpressionTree getConstructorExpression() {
+ return constrExpr;
+ }
+
+ @Override
+ public <R, D> R accept(TreeVisitor<R, D> visitor, D data) {
+ return visitor.visitNew(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * Represents ECMAScript object literal expression.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ObjectLiteralTree extends ExpressionTree {
+ /**
+ * Returns the list of properties of this object literal.
+ *
+ * @return the list of properties of this object literal
+ */
+ public List<? extends PropertyTree> getProperties();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.ObjectNode;
+
+final class ObjectLiteralTreeImpl extends ExpressionTreeImpl
+ implements ObjectLiteralTree {
+ private final List<? extends PropertyTree> props;
+ ObjectLiteralTreeImpl(final ObjectNode node, final List<? extends PropertyTree> props) {
+ super(node);
+ this.props = props;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.OBJECT_LITERAL;
+ }
+
+ @Override
+ public List<? extends PropertyTree> getProperties() {
+ return props;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitObjectLiteral(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a parenthesized expression. Note: parentheses
+ * not be preserved by the parser.
+ *
+ * For example:
+ * <pre>
+ * ( <em>expression</em> )
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ParenthesizedTree extends ExpressionTree {
+ /**
+ * Returns the expression within the parenthesis.
+ *
+ * @return the expression within the parenthesis
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URL;
+import java.nio.file.Path;
+import jdk.nashorn.api.scripting.NashornException;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+
+/**
+ * Represents nashorn ECMAScript parser instance.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface Parser {
+ /**
+ * Parses the source file and returns compilation unit tree
+ *
+ * @param file source file to parse
+ * @param listener to receive diagnostic messages from the parser. This can be null.
+ * if null is passed, a NashornException is thrown on the first parse error.
+ * @return compilation unit tree
+ * @throws NullPointerException if file is null
+ * @throws IOException if parse source read fails
+ * @throws NashornException is thrown if no listener is supplied and parser encounters error
+ */
+ public CompilationUnitTree parse(final File file, final DiagnosticListener listener) throws IOException, NashornException;
+
+ /**
+ * Parses the source Path and returns compilation unit tree
+ *
+ * @param path source Path to parse
+ * @param listener to receive diagnostic messages from the parser. This can be null.
+ * if null is passed, a NashornException is thrown on the first parse error.
+ * @return compilation unit tree
+ * @throws NullPointerException if path is null
+ * @throws IOException if parse source read fails
+ * @throws NashornException is thrown if no listener is supplied and parser encounters error
+ */
+ public CompilationUnitTree parse(final Path path, final DiagnosticListener listener) throws IOException, NashornException;
+
+ /**
+ * Parses the source url and returns compilation unit tree
+ *
+ * @param url source file to parse
+ * @param listener to receive diagnostic messages from the parser. This can be null.
+ * if null is passed, a NashornException is thrown on the first parse error.
+ * @return compilation unit tree
+ * @throws NullPointerException if url is null
+ * @throws IOException if parse source read fails
+ * @throws NashornException is thrown if no listener is supplied and parser encounters error
+ */
+ public CompilationUnitTree parse(final URL url, final DiagnosticListener listener) throws IOException, NashornException;
+
+ /**
+ * Parses the readerand returns compilation unit tree
+ *
+ * @param name name of the source file to parse
+ * @param reader from which source is read
+ * @param listener to receive diagnostic messages from the parser. This can be null.
+ * if null is passed, a NashornException is thrown on the first parse error.
+ * @return compilation unit tree
+ * @throws NullPointerException if name or reader is null
+ * @throws IOException if parse source read fails
+ * @throws NashornException is thrown if no listener is supplied and parser encounters error
+ */
+ public CompilationUnitTree parse(final String name, Reader reader, final DiagnosticListener listener) throws IOException, NashornException;
+
+ /**
+ * Parses the string source and returns compilation unit tree
+ *
+ * @param name of the source
+ * @param code string source
+ * @param listener to receive diagnostic messages from the parser. This can be null.
+ * if null is passed, a NashornException is thrown on the first parse error.
+ * @return compilation unit tree
+ * @throws NullPointerException if name or code is null
+ * @throws NashornException is thrown if no listener is supplied and parser encounters error
+ */
+ public CompilationUnitTree parse(final String name, String code, final DiagnosticListener listener) throws NashornException;
+
+ /**
+ * Parses the source from script object and returns compilation unit tree
+ *
+ * @param scriptObj script object whose script and name properties are used for script source
+ * @param listener to receive diagnostic messages from the parser. This can be null.
+ * if null is passed, a NashornException is thrown on the first parse error.
+ * @return compilation unit tree
+ * @throws NullPointerException if scriptObj is null
+ * @throws NashornException is thrown if no listener is supplied and parser encounters error
+ */
+ public CompilationUnitTree parse(final ScriptObjectMirror scriptObj, final DiagnosticListener listener) throws NashornException;
+
+ /**
+ * Factory method to create a new instance of Parser.
+ *
+ * @param options configuration options to initialize the Parser.
+ * Currently the following options are supported:
+ *
+ * <dl>
+ * <dt>"--const-as-var"</dt><dd>treat "const" declaration as "var"</dd>
+ * <dt>"-dump-on-error" or "-doe"</dt><dd>dump stack trace on error</dd>
+ * <dt>"--empty-statements"</dt><dd>include empty statement nodes</dd>
+ * <dt>"--no-syntax-extensions" or "-nse"</dt><dd>disable ECMAScript syntax extensions</dd>
+ * <dt>"-scripting"</dt><dd>enable scripting mode extensions</dd>
+ * <dt>"-strict"</dt><dd>enable ECMAScript strict mode</dd>
+ * </dl>
+ *
+ * @throws NullPointerException if options arrry or any of it's element is null
+ * @throws IllegalArgumentException on unsupported option value.
+ * @return a new Parser instance.
+ */
+ public static Parser create(final String... options) throws IllegalArgumentException {
+ options.getClass();
+ for (String opt : options) {
+ switch (opt) {
+ case "--const-as-var":
+ case "-dump-on-error":
+ case "-doe":
+ case "--empty-statements":
+ case "--no-syntax-extensions":
+ case "-nse":
+ case "-scripting":
+ case "-strict":
+ break;
+ default:
+ throw new IllegalArgumentException(opt);
+ }
+ }
+
+ return new ParserImpl(options);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParserImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.net.URL;
+import java.nio.file.Path;
+import java.util.Map;
+import java.util.Objects;
+import jdk.nashorn.api.scripting.NashornException;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.runtime.Context;
+import jdk.nashorn.internal.runtime.ErrorManager;
+import jdk.nashorn.internal.runtime.JSType;
+import jdk.nashorn.internal.runtime.ParserException;
+import jdk.nashorn.internal.runtime.ScriptEnvironment;
+import jdk.nashorn.internal.runtime.Source;
+import jdk.nashorn.internal.runtime.options.Options;
+
+final class ParserImpl implements Parser {
+
+ private final ScriptEnvironment env;
+
+ ParserImpl(final String... args) throws IllegalArgumentException {
+ Objects.requireNonNull(args);
+ Options options = new Options("nashorn");
+ options.process(args);
+ this.env = new ScriptEnvironment(options,
+ new PrintWriter(System.out), new PrintWriter(System.err));
+ }
+
+ @Override
+ public CompilationUnitTree parse(final File file, final DiagnosticListener listener) throws IOException, NashornException {
+ Objects.requireNonNull(file);
+ final Source src = Source.sourceFor(file.getName(), file);
+ return translate(makeParser(src, listener).parse());
+ }
+
+ @Override
+ public CompilationUnitTree parse(final Path path, final DiagnosticListener listener) throws IOException, NashornException {
+ Objects.requireNonNull(path);
+ final Source src = Source.sourceFor(path.toString(), path);
+ return translate(makeParser(src, listener).parse());
+ }
+
+ @Override
+ public CompilationUnitTree parse(final URL url, final DiagnosticListener listener) throws IOException, NashornException {
+ final Source src = Source.sourceFor(url.toString(), url);
+ return translate(makeParser(src, listener).parse());
+ }
+
+ @Override
+ public CompilationUnitTree parse(final String name, final Reader reader, final DiagnosticListener listener) throws IOException, NashornException {
+ Objects.requireNonNull(name);
+ Objects.requireNonNull(reader);
+ final Source src = Source.sourceFor(name, reader);
+ return translate(makeParser(src, listener).parse());
+ }
+
+ @Override
+ public CompilationUnitTree parse(final String name, final String code, final DiagnosticListener listener) throws NashornException {
+ final Source src = Source.sourceFor(name, code);
+ return translate(makeParser(src, listener).parse());
+ }
+
+ @Override
+ public CompilationUnitTree parse(final ScriptObjectMirror scriptObj, final DiagnosticListener listener) throws NashornException {
+ Objects.requireNonNull(scriptObj);
+ final Map<?,?> map = scriptObj;
+ if (map.containsKey("script") && map.containsKey("name")) {
+ final String script = JSType.toString(map.get("script"));
+ final String name = JSType.toString(map.get("name"));
+ final Source src = Source.sourceFor(name, script);
+ return translate(makeParser(src, listener).parse());
+ } else {
+ throw new IllegalArgumentException("can't find 'script' and 'name' properties");
+ }
+ }
+
+ private jdk.nashorn.internal.parser.Parser makeParser(final Source source, final DiagnosticListener listener) {
+ final ErrorManager errMgr = listener != null? new ListenerErrorManager(listener) : new Context.ThrowErrorManager();
+ return new jdk.nashorn.internal.parser.Parser(env, source, errMgr);
+ }
+
+ private static class ListenerErrorManager extends ErrorManager {
+ private final DiagnosticListener listener;
+
+ ListenerErrorManager(final DiagnosticListener listener) {
+ // null check
+ listener.getClass();
+ this.listener = listener;
+ }
+
+ @Override
+ public void error(final String msg) {
+ error(new ParserException(msg));
+ }
+
+ @Override
+ public void error(final ParserException e) {
+ listener.report(new DiagnosticImpl(e, Diagnostic.Kind.ERROR));
+ }
+
+ @Override
+ public void warning(final String msg) {
+ warning(new ParserException(msg));
+ }
+
+ @Override
+ public void warning(final ParserException e) {
+ listener.report(new DiagnosticImpl(e, Diagnostic.Kind.WARNING));
+ }
+ }
+
+ private CompilationUnitTree translate(final FunctionNode node) {
+ return new IRTranslator().translate(node);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * To represent property setting in an object literal tree.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface PropertyTree extends Tree {
+ /**
+ * Returns the name of this property.
+ *
+ * @return the name of the property
+ */
+ public ExpressionTree getKey();
+
+ /**
+ * Returns the value of this property. This is null for accessor properties.
+ *
+ * @return the value of the property
+ */
+ public ExpressionTree getValue();
+
+ /**
+ * Returns the setter function of this property if this
+ * is an accessor property. This is null for data properties.
+ *
+ * @return the setter function of the property
+ */
+ public FunctionExpressionTree getGetter();
+
+ /**
+ * Returns the getter function of this property if this
+ * is an accessor property. This is null for data properties.
+ *
+ * @return the getter function of the property
+ */
+ public FunctionExpressionTree getSetter();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.PropertyNode;
+
+final class PropertyTreeImpl extends TreeImpl implements PropertyTree {
+ private final ExpressionTree key;
+ private final ExpressionTree value;
+ private final FunctionExpressionTree getter;
+ private final FunctionExpressionTree setter;
+ PropertyTreeImpl(final PropertyNode node,
+ final ExpressionTree key,
+ final ExpressionTree value,
+ final FunctionExpressionTree getter,
+ final FunctionExpressionTree setter) {
+ super(node);
+ this.key = key;
+ this.value = value;
+ this.getter = getter;
+ this.setter = setter;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.PROPERTY;
+ }
+
+ @Override
+ public ExpressionTree getKey() {
+ return key;
+ }
+
+ @Override
+ public ExpressionTree getValue() {
+ return value;
+ }
+
+ @Override
+ public FunctionExpressionTree getGetter() {
+ return getter;
+ }
+
+ @Override
+ public FunctionExpressionTree getSetter() {
+ return setter;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitProperty(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * Represents regular expression literal in the source code.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface RegExpLiteralTree extends Tree {
+ /**
+ * Regular expression pattern to match.
+ *
+ * @return regular expression patten
+ */
+ public String getPattern();
+
+ /**
+ * Regular expression matching options.
+ *
+ * @return options like "i" for ignoreCase used
+ */
+ public String getOptions();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.LiteralNode;
+import jdk.nashorn.internal.parser.Lexer;
+
+final class RegExpLiteralTreeImpl extends ExpressionTreeImpl
+ implements RegExpLiteralTree {
+ private final String pattern;
+ private final String options;
+ RegExpLiteralTreeImpl(final LiteralNode<?> node) {
+ super(node);
+ assert node.getValue() instanceof Lexer.RegexToken : "regexp expected";
+ final Lexer.RegexToken regex = (Lexer.RegexToken) node.getValue();
+ this.pattern = regex.getExpression();
+ this.options = regex.getOptions();
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.REGEXP_LITERAL;
+ }
+
+ @Override
+ public String getPattern() {
+ return pattern;
+ }
+
+ @Override
+ public String getOptions() {
+ return options;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitRegExpLiteral(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'return' statement.
+ *
+ * For example:
+ * <pre>
+ * return;
+ * return <em>expression</em>;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ReturnTree extends StatementTree {
+ /**
+ * Returns the expression being returned. This is null if no value
+ * is being returned. i.e., empty return statement.
+ *
+ * @return the returned expression
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ReturnNode;
+
+final class ReturnTreeImpl extends StatementTreeImpl implements ReturnTree {
+ private final ExpressionTree expr;
+
+ ReturnTreeImpl(final ReturnNode returnNode, final ExpressionTree expr) {
+ super(returnNode);
+ this.expr = expr;
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.RETURN;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitReturn(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,390 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A simple implementation of the TreeVisitor for ECMAScript edition 5.1.
+ *
+ * <p>The visit methods corresponding to ES 5.1 language constructs walk the
+ * "components" of the given tree by calling accept method passing the
+ * current visitor and the additional parameter.
+ *
+ * <p>For constructs introduced in later versions, {@code visitUnknown}
+ * is called instead which throws {@link UnknownTreeException}.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ */
+public class SimpleTreeVisitorES5_1<R, P> implements TreeVisitor<R, P> {
+ @Override
+ public R visitAssignment(AssignmentTree node, P r) {
+ node.getVariable().accept(this, r);
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitCompoundAssignment(CompoundAssignmentTree node, P r) {
+ node.getVariable().accept(this, r);
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitBinary(BinaryTree node, P r) {
+ node.getLeftOperand().accept(this, r);
+ node.getRightOperand().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitBlock(BlockTree node, P r) {
+ node.getStatements().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitBreak(BreakTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitCase(CaseTree node, P r) {
+ final Tree caseVal = node.getExpression();
+ if (caseVal != null) {
+ caseVal.accept(this, r);
+ }
+
+ node.getStatements().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitCatch(CatchTree node, P r) {
+ final Tree cond = node.getCondition();
+ if (cond != null) {
+ cond.accept(this, r);
+ }
+ node.getParameter().accept(this, r);
+ node.getBlock().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitConditionalExpression(ConditionalExpressionTree node, P r) {
+ node.getCondition().accept(this, r);
+ node.getTrueExpression().accept(this, r);
+ node.getFalseExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitContinue(ContinueTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitDebugger(DebuggerTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitDoWhileLoop(DoWhileLoopTree node, P r) {
+ node.getStatement().accept(this, r);
+ node.getCondition().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitErroneous(ErroneousTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitExpressionStatement(ExpressionStatementTree node, P r) {
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitForLoop(ForLoopTree node, P r) {
+ final Tree init = node.getInitializer();
+ if (init != null) {
+ init.accept(this, r);
+ }
+
+ final Tree cond = node.getCondition();
+ if (cond != null) {
+ cond.accept(this, r);
+ }
+
+ final Tree update = node.getUpdate();
+ if (update != null) {
+ update.accept(this, r);
+ }
+
+ node.getStatement().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitForInLoop(ForInLoopTree node, P r) {
+ node.getVariable().accept(this, r);
+ node.getExpression().accept(this, r);
+ final StatementTree stat = node.getStatement();
+ if (stat != null) {
+ stat.accept(this, r);
+ }
+ return null;
+ }
+
+ @Override
+ public R visitFunctionCall(FunctionCallTree node, P r) {
+ node.getFunctionSelect().accept(this, r);
+ node.getArguments().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitFunctionDeclaration(FunctionDeclarationTree node, P r) {
+ node.getParameters().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ node.getBody().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitFunctionExpression(FunctionExpressionTree node, P r) {
+ node.getParameters().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ node.getBody().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitIdentifier(IdentifierTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitIf(IfTree node, P r) {
+ node.getCondition().accept(this, r);
+ node.getThenStatement().accept(this, r);
+ final Tree elseStat = node.getElseStatement();
+ if (elseStat != null) {
+ elseStat.accept(this, r);
+ }
+ return null;
+ }
+
+ @Override
+ public R visitArrayAccess(ArrayAccessTree node, P r) {
+ node.getExpression().accept(this, r);
+ node.getIndex().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitArrayLiteral(ArrayLiteralTree node, P r) {
+ node.getElements().stream().filter((tree) -> (tree != null)).forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitLabeledStatement(LabeledStatementTree node, P r) {
+ node.getStatement().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitLiteral(LiteralTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitParenthesized(ParenthesizedTree node, P r) {
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitReturn(ReturnTree node, P r) {
+ final Tree retExpr = node.getExpression();
+ if (retExpr != null) {
+ retExpr.accept(this, r);
+ }
+ return null;
+ }
+
+ @Override
+ public R visitMemberSelect(MemberSelectTree node, P r) {
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitNew(NewTree node, P r) {
+ node.getConstructorExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitObjectLiteral(ObjectLiteralTree node, P r) {
+ node.getProperties().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitProperty(PropertyTree node, P r) {
+ FunctionExpressionTree getter = node.getGetter();
+ if (getter != null) {
+ getter.accept(this, r);
+ }
+ ExpressionTree key = node.getKey();
+ if (key != null) {
+ key.accept(this, r);
+ }
+
+ FunctionExpressionTree setter = node.getSetter();
+ if (setter != null) {
+ setter.accept(this, r);
+ }
+
+ ExpressionTree value = node.getValue();
+ if (value != null) {
+ value.accept(this, r);
+ }
+ return null;
+ }
+
+ @Override
+ public R visitRegExpLiteral(RegExpLiteralTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitEmptyStatement(EmptyStatementTree node, P r) {
+ return null;
+ }
+
+ @Override
+ public R visitSwitch(SwitchTree node, P r) {
+ node.getExpression().accept(this, r);
+ node.getCases().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitThrow(ThrowTree node, P r) {
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitCompilationUnit(CompilationUnitTree node, P r) {
+ node.getSourceElements().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+ return null;
+ }
+
+ @Override
+ public R visitTry(TryTree node, P r) {
+ node.getBlock().accept(this, r);
+ node.getCatches().forEach((tree) -> {
+ tree.accept(this, r);
+ });
+
+ final Tree finallyBlock = node.getFinallyBlock();
+ if (finallyBlock != null) {
+ finallyBlock.accept(this, r);
+ }
+ return null;
+ }
+
+ @Override
+ public R visitInstanceOf(InstanceOfTree node, P r) {
+ node.getType().accept(this, r);
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitUnary(UnaryTree node, P r) {
+ node.getExpression().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitVariable(VariableTree node, P r) {
+ if (node.getInitializer() != null) {
+ node.getInitializer().accept(this, r);
+ }
+ return null;
+ }
+
+ @Override
+ public R visitWhileLoop(WhileLoopTree node, P r) {
+ node.getCondition().accept(this, r);
+ node.getStatement().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitWith(WithTree node, P r) {
+ node.getScope().accept(this, r);
+ node.getStatement().accept(this, r);
+ return null;
+ }
+
+ @Override
+ public R visitUnknown(Tree node, P r) {
+ // unknown in ECMAScript 5.1 edition
+ throw new UnknownTreeException(node, r);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node used as the base class for the different kinds of
+ * statements.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface StatementTree extends Tree {
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.Statement;
+
+abstract class StatementTreeImpl extends TreeImpl implements StatementTree {
+ StatementTreeImpl(final Statement stat) {
+ super(stat);
+ }
+
+ StatementTreeImpl(final Block stat) {
+ super(stat);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a 'switch' statement.
+ *
+ * For example:
+ * <pre>
+ * switch ( <em>expression</em> ) {
+ * <em>cases</em>
+ * }
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface SwitchTree extends StatementTree {
+ /**
+ * Returns the expression on which this statement switches.
+ *
+ * @return the switch expression
+ */
+ ExpressionTree getExpression();
+
+
+ /**
+ * Returns the list of 'case' statements.
+ *
+ * @return the 'case' statements
+ */
+ List<? extends CaseTree> getCases();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.SwitchNode;
+
+final class SwitchTreeImpl extends StatementTreeImpl implements SwitchTree {
+ private final ExpressionTree expr;
+ private final List<? extends CaseTree> cases;
+ SwitchTreeImpl(final SwitchNode node,
+ final ExpressionTree expr,
+ List<? extends CaseTree> cases) {
+ super(node);
+ this.expr = expr;
+ this.cases = cases;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.SWITCH;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public List<? extends CaseTree> getCases() {
+ return cases;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitSwitch(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'throw' statement.
+ *
+ * For example:
+ * <pre>
+ * throw <em>expression</em>;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface ThrowTree extends StatementTree {
+ /**
+ * Returns the expression being thrown.
+ *
+ * @return the expression being thrown.
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.ThrowNode;
+
+final class ThrowTreeImpl extends StatementTreeImpl implements ThrowTree {
+ private final ExpressionTree expr;
+ ThrowTreeImpl(final ThrowNode node, final ExpressionTree expr) {
+ super(node);
+ this.expr = expr;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.THROW;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitThrow(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,603 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * Common interface for all nodes in an abstract syntax tree.
+ *
+ * <p><b>WARNING:</b> This interface and its sub-interfaces are
+ * subject to change as the ECMAScript programming language evolves.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface Tree {
+
+ /**
+ * Enumerates all kinds of trees.
+ */
+ @jdk.Exported
+ public enum Kind {
+ /**
+ * Used for instances of {@link ArrayAccessTree}.
+ */
+ ARRAY_ACCESS(ArrayAccessTree.class),
+
+ /**
+ * Used for instances of {@link ArrayLiteralTree}.
+ */
+ ARRAY_LITERAL(ArrayLiteralTree.class),
+
+ /**
+ * Used for instances of {@link AssignmentTree}.
+ */
+ ASSIGNMENT(AssignmentTree.class),
+
+ /**
+ * Used for instances of {@link BlockTree}.
+ */
+ BLOCK(BlockTree.class),
+
+ /**
+ * Used for instances of {@link BreakTree}.
+ */
+ BREAK(BreakTree.class),
+
+ /**
+ * Used for instances of {@link CaseTree}.
+ */
+ CASE(CaseTree.class),
+
+ /**
+ * Used for instances of {@link CatchTree}.
+ */
+ CATCH(CatchTree.class),
+
+ /**
+ * Used for instances of {@link CompilationUnitTree}.
+ */
+ COMPILATION_UNIT(CompilationUnitTree.class),
+
+ /**
+ * Used for instances of {@link ConditionalExpressionTree}.
+ */
+ CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class),
+
+ /**
+ * Used for instances of {@link ContinueTree}.
+ */
+ CONTINUE(ContinueTree.class),
+
+ /**
+ * Used for instances of {@link DoWhileLoopTree}.
+ */
+ DO_WHILE_LOOP(DoWhileLoopTree.class),
+
+ /**
+ * Used for instances of {@link DebuggerTree}.
+ */
+ DEBUGGER(DebuggerTree.class),
+
+ /**
+ * Used for instances of {@link ForInLoopTree}.
+ */
+ FOR_IN_LOOP(ForInLoopTree.class),
+
+ /**
+ * Used for instances of {@link FunctionExpressionTree}.
+ */
+ FUNCTION_EXPRESSION(FunctionExpressionTree.class),
+
+ /**
+ * Used for instances of {@link ErroneousTree}.
+ */
+ ERROR(ErroneousTree.class),
+
+ /**
+ * Used for instances of {@link ExpressionStatementTree}.
+ */
+ EXPRESSION_STATEMENT(ExpressionStatementTree.class),
+
+ /**
+ * Used for instances of {@link MemberSelectTree}.
+ */
+ MEMBER_SELECT(MemberSelectTree.class),
+
+ /**
+ * Used for instances of {@link ForLoopTree}.
+ */
+ FOR_LOOP(ForLoopTree.class),
+
+ /**
+ * Used for instances of {@link IdentifierTree}.
+ */
+ IDENTIFIER(IdentifierTree.class),
+
+ /**
+ * Used for instances of {@link IfTree}.
+ */
+ IF(IfTree.class),
+
+ /**
+ * Used for instances of {@link InstanceOfTree}.
+ */
+ INSTANCE_OF(InstanceOfTree.class),
+
+ /**
+ * Used for instances of {@link LabeledStatementTree}.
+ */
+ LABELED_STATEMENT(LabeledStatementTree.class),
+
+ /**
+ * Used for instances of {@link FunctionDeclarationTree}.
+ */
+ FUNCTION(FunctionDeclarationTree.class),
+
+ /**
+ * Used for instances of {@link FunctionCallTree}.
+ */
+ FUNCTION_INVOCATION(FunctionCallTree.class),
+
+ /**
+ * Used for instances of {@link NewTree}.
+ */
+ NEW(NewTree.class),
+
+ /**
+ * Used for instances of {@link ObjectLiteralTree}.
+ */
+ OBJECT_LITERAL(ObjectLiteralTree.class),
+
+ /**
+ * Used for instances of {@link ParenthesizedTree}.
+ */
+ PARENTHESIZED(ParenthesizedTree.class),
+
+ /**
+ * Used for instances of {@link PropertyTree}.
+ */
+ PROPERTY(PropertyTree.class),
+
+ /**
+ * Used for instances of {@link RegExpLiteralTree}.
+ */
+ REGEXP_LITERAL(RegExpLiteralTree.class),
+
+ /**
+ * Used for instances of {@link ReturnTree}.
+ */
+ RETURN(ReturnTree.class),
+
+ /**
+ * Used for instances of {@link EmptyStatementTree}.
+ */
+ EMPTY_STATEMENT(EmptyStatementTree.class),
+
+ /**
+ * Used for instances of {@link SwitchTree}.
+ */
+ SWITCH(SwitchTree.class),
+
+ /**
+ * Used for instances of {@link ThrowTree}.
+ */
+ THROW(ThrowTree.class),
+
+ /**
+ * Used for instances of {@link TryTree}.
+ */
+ TRY(TryTree.class),
+
+ /**
+ * Used for instances of {@link VariableTree}.
+ */
+ VARIABLE(VariableTree.class),
+
+ /**
+ * Used for instances of {@link WhileLoopTree}.
+ */
+ WHILE_LOOP(WhileLoopTree.class),
+
+ /**
+ * Used for instances of {@link WithTree}.
+ */
+ WITH(WithTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing postfix
+ * increment operator {@code ++}.
+ */
+ POSTFIX_INCREMENT(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing postfix
+ * decrement operator {@code --}.
+ */
+ POSTFIX_DECREMENT(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing prefix
+ * increment operator {@code ++}.
+ */
+ PREFIX_INCREMENT(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing prefix
+ * decrement operator {@code --}.
+ */
+ PREFIX_DECREMENT(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing unary plus
+ * operator {@code +}.
+ */
+ UNARY_PLUS(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing unary minus
+ * operator {@code -}.
+ */
+ UNARY_MINUS(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing bitwise
+ * complement operator {@code ~}.
+ */
+ BITWISE_COMPLEMENT(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing logical
+ * complement operator {@code !}.
+ */
+ LOGICAL_COMPLEMENT(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing logical
+ * delete operator {@code delete}.
+ */
+ DELETE(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing logical
+ * typeof operator {@code typeof}.
+ */
+ TYPEOF(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link UnaryTree} representing logical
+ * void operator {@code typeof}.
+ */
+ VOID(UnaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * comma {@code ,}.
+ */
+ COMMA(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * multiplication {@code *}.
+ */
+ MULTIPLY(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * division {@code /}.
+ */
+ DIVIDE(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * remainder {@code %}.
+ */
+ REMAINDER(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * addition or string concatenation {@code +}.
+ */
+ PLUS(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * subtraction {@code -}.
+ */
+ MINUS(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * left shift {@code <<}.
+ */
+ LEFT_SHIFT(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * right shift {@code >>}.
+ */
+ RIGHT_SHIFT(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * unsigned right shift {@code >>>}.
+ */
+ UNSIGNED_RIGHT_SHIFT(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * less-than {@code <}.
+ */
+ LESS_THAN(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * greater-than {@code >}.
+ */
+ GREATER_THAN(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * less-than-equal {@code <=}.
+ */
+ LESS_THAN_EQUAL(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * greater-than-equal {@code >=}.
+ */
+ GREATER_THAN_EQUAL(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * in operator {@code in}.
+ */
+ IN(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * equal-to {@code ==}.
+ */
+ EQUAL_TO(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * not-equal-to {@code !=}.
+ */
+ NOT_EQUAL_TO(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * equal-to {@code ===}.
+ */
+ STRICT_EQUAL_TO(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * not-equal-to {@code !==}.
+ */
+ STRICT_NOT_EQUAL_TO(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * bitwise and logical "and" {@code &}.
+ */
+ AND(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * bitwise and logical "xor" {@code ^}.
+ */
+ XOR(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * bitwise and logical "or" {@code |}.
+ */
+ OR(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * conditional-and {@code &&}.
+ */
+ CONDITIONAL_AND(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link BinaryTree} representing
+ * conditional-or {@code ||}.
+ */
+ CONDITIONAL_OR(BinaryTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * multiplication assignment {@code *=}.
+ */
+ MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * division assignment {@code /=}.
+ */
+ DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * remainder assignment {@code %=}.
+ */
+ REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * addition or string concatenation assignment {@code +=}.
+ */
+ PLUS_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * subtraction assignment {@code -=}.
+ */
+ MINUS_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * left shift assignment {@code <<=}.
+ */
+ LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * right shift assignment {@code >>=}.
+ */
+ RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * unsigned right shift assignment {@code >>>=}.
+ */
+ UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * bitwise and logical "and" assignment {@code &=}.
+ */
+ AND_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * bitwise and logical "xor" assignment {@code ^=}.
+ */
+ XOR_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link CompoundAssignmentTree} representing
+ * bitwise and logical "or" assignment {@code |=}.
+ */
+ OR_ASSIGNMENT(CompoundAssignmentTree.class),
+
+ /**
+ * Used for instances of {@link LiteralTree} representing
+ * a number literal expression of type {@code double}.
+ */
+ NUMBER_LITERAL(LiteralTree.class),
+
+ /**
+ * Used for instances of {@link LiteralTree} representing
+ * a boolean literal expression of type {@code boolean}.
+ */
+ BOOLEAN_LITERAL(LiteralTree.class),
+
+ /**
+ * Used for instances of {@link LiteralTree} representing
+ * a string literal expression of type {@link String}.
+ */
+ STRING_LITERAL(LiteralTree.class),
+
+ /**
+ * Used for instances of {@link LiteralTree} representing
+ * the use of {@code null}.
+ */
+ NULL_LITERAL(LiteralTree.class),
+
+ /**
+ * An implementation-reserved node. This is the not the node
+ * you are looking for.
+ */
+ OTHER(null);
+
+ Kind(Class<? extends Tree> intf) {
+ associatedInterface = intf;
+ }
+
+ /**
+ * Returns the associated interface type that uses this kind.
+ * @return the associated interface
+ */
+ public Class<? extends Tree> asInterface() {
+ return associatedInterface;
+ }
+
+ /**
+ * Returns if this is a literal tree kind or not.
+ *
+ * @return true if this is a literal tree kind, false otherwise
+ */
+ public boolean isLiteral() {
+ return associatedInterface == LiteralTree.class;
+ }
+
+ /**
+ * Returns if this is an expression tree kind or not.
+ *
+ * @return true if this is an expression tree kind, false otherwise
+ */
+ public boolean isExpression() {
+ return ExpressionTree.class.isAssignableFrom(associatedInterface);
+ }
+
+ /**
+ * Returns if this is a statement tree kind or not.
+ *
+ * @return true if this is a statement tree kind, false otherwise
+ */
+ public boolean isStatement() {
+ return StatementTree.class.isAssignableFrom(associatedInterface);
+ }
+
+ private final Class<? extends Tree> associatedInterface;
+ }
+
+ /**
+ * Start character offset of this Tree within the source.
+ *
+ * @return the position
+ */
+ long getStartPosition();
+
+ /**
+ * End character offset of this Tree within the source.
+ *
+ * @return the position
+ */
+ long getEndPosition();
+
+ /**
+ * Gets the kind of this tree.
+ *
+ * @return the kind of this tree.
+ */
+ Kind getKind();
+
+ /**
+ * Accept method used to implement the visitor pattern. The
+ * visitor pattern is used to implement operations on trees.
+ *
+ * @param <R> result type of this operation.
+ * @param <D> type of additional data.
+ * @param visitor tree visitor
+ * @param data additional data passed to visitor methods
+ * @return the value from visitor's visit methods
+ */
+ <R,D> R accept(TreeVisitor<R,D> visitor, D data);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.Node;
+
+import jdk.nashorn.internal.parser.TokenType;
+
+abstract class TreeImpl implements Tree {
+ protected final Node node;
+
+ TreeImpl(final Node node) {
+ this.node = node;
+ }
+
+ @Override
+ public long getStartPosition() {
+ return node.getStart();
+ }
+
+ @Override
+ public long getEndPosition() {
+ return node.getFinish();
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitUnknown(this, data);
+ }
+
+ static Kind getOperator(final TokenType tt) {
+ switch(tt) {
+ case NEW:
+ return Kind.NEW;
+ case NOT:
+ return Kind.LOGICAL_COMPLEMENT;
+ case NE:
+ return Kind.NOT_EQUAL_TO;
+ case NE_STRICT:
+ return Kind.STRICT_NOT_EQUAL_TO;
+ case MOD:
+ return Kind.REMAINDER;
+ case ASSIGN_MOD:
+ return Kind.REMAINDER_ASSIGNMENT;
+ case BIT_AND:
+ return Kind.AND;
+ case AND:
+ return Kind.CONDITIONAL_AND;
+ case ASSIGN_BIT_AND:
+ return Kind.AND_ASSIGNMENT;
+ case MUL:
+ return Kind.MULTIPLY;
+ case ASSIGN_MUL:
+ return Kind.MULTIPLY_ASSIGNMENT;
+ case ADD:
+ return Kind.PLUS;
+ case INCPREFIX:
+ return Kind.PREFIX_INCREMENT;
+ case INCPOSTFIX:
+ return Kind.POSTFIX_INCREMENT;
+ case ASSIGN_ADD:
+ return Kind.PLUS_ASSIGNMENT;
+ case SUB:
+ return Kind.MINUS;
+ case DECPREFIX:
+ return Kind.PREFIX_DECREMENT;
+ case DECPOSTFIX:
+ return Kind.POSTFIX_DECREMENT;
+ case ASSIGN_SUB:
+ return Kind.MINUS_ASSIGNMENT;
+ case DIV:
+ return Kind.DIVIDE;
+ case ASSIGN_DIV:
+ return Kind.DIVIDE_ASSIGNMENT;
+ case LT:
+ return Kind.LESS_THAN;
+ case SHL:
+ return Kind.LEFT_SHIFT;
+ case ASSIGN_SHL:
+ return Kind.LEFT_SHIFT_ASSIGNMENT;
+ case LE:
+ return Kind.LESS_THAN_EQUAL;
+ case ASSIGN:
+ return Kind.ASSIGNMENT;
+ case EQ:
+ return Kind.EQUAL_TO;
+ case EQ_STRICT:
+ return Kind.STRICT_EQUAL_TO;
+ case GT:
+ return Kind.GREATER_THAN;
+ case GE:
+ return Kind.GREATER_THAN_EQUAL;
+ case SAR:
+ return Kind.RIGHT_SHIFT;
+ case ASSIGN_SAR:
+ return Kind.RIGHT_SHIFT_ASSIGNMENT;
+ case SHR:
+ return Kind.UNSIGNED_RIGHT_SHIFT;
+ case ASSIGN_SHR:
+ return Kind.UNSIGNED_RIGHT_SHIFT_ASSIGNMENT;
+ case TERNARY:
+ return Kind.CONDITIONAL_EXPRESSION;
+ case BIT_XOR:
+ return Kind.XOR;
+ case ASSIGN_BIT_XOR:
+ return Kind.XOR_ASSIGNMENT;
+ case BIT_OR:
+ return Kind.OR;
+ case ASSIGN_BIT_OR:
+ return Kind.OR_ASSIGNMENT;
+ case OR:
+ return Kind.CONDITIONAL_OR;
+ case BIT_NOT:
+ return Kind.BITWISE_COMPLEMENT;
+ case DELETE:
+ return Kind.DELETE;
+ case TYPEOF:
+ return Kind.TYPEOF;
+ case VOID:
+ return Kind.VOID;
+ case IN:
+ return Kind.IN;
+ case INSTANCEOF:
+ return Kind.INSTANCE_OF;
+ case COMMARIGHT:
+ return Kind.COMMA;
+ default:
+ throw new AssertionError("should not reach here: " + tt);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,438 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A visitor of trees, in the style of the visitor design pattern.
+ * Classes implementing this interface are used to operate
+ * on a tree when the kind of tree is unknown at compile time.
+ * When a visitor is passed to an tree's {@link Tree#accept
+ * accept} method, the <tt>visit<i>XYZ</i></tt> method most applicable
+ * to that tree is invoked.
+ *
+ * <p> Classes implementing this interface may or may not throw a
+ * {@code NullPointerException} if the additional parameter {@code p}
+ * is {@code null}; see documentation of the implementing class for
+ * details.
+ *
+ * <p> <b>WARNING:</b> It is possible that methods will be added to
+ this interface to accommodate new, currently unknown, language
+ structures added to future versions of the ECMAScript programming
+ language. When new visit methods are added for new Tree subtypes,
+ default method bodies will be introduced which will call visitUnknown
+ method as a fallback.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface TreeVisitor<R,P> {
+ /**
+ * Visit assignment tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitAssignment(AssignmentTree node, P p);
+
+ /**
+ * Visit compound assignment tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitCompoundAssignment(CompoundAssignmentTree node, P p);
+
+ /**
+ * Visit binary expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitBinary(BinaryTree node, P p);
+
+ /**
+ * Visit block statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitBlock(BlockTree node, P p);
+
+ /**
+ * Visit break statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitBreak(BreakTree node, P p);
+
+ /**
+ * Visit case statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitCase(CaseTree node, P p);
+
+ /**
+ * Visit catch block statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitCatch(CatchTree node, P p);
+
+ /**
+ * Visit conditional expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitConditionalExpression(ConditionalExpressionTree node, P p);
+
+ /**
+ * Visit continue statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitContinue(ContinueTree node, P p);
+
+ /**
+ * Visit debugger statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitDebugger(DebuggerTree node, P p);
+
+ /**
+ * Visit do-while statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitDoWhileLoop(DoWhileLoopTree node, P p);
+
+ /**
+ * Visit error expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitErroneous(ErroneousTree node, P p);
+
+ /**
+ * Visit expression statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitExpressionStatement(ExpressionStatementTree node, P p);
+
+ /**
+ * Visit 'for' statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitForLoop(ForLoopTree node, P p);
+
+ /**
+ * Visit for..in statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitForInLoop(ForInLoopTree node, P p);
+
+ /**
+ * Visit function call expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitFunctionCall(FunctionCallTree node, P p);
+
+ /**
+ * Visit function declaration tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitFunctionDeclaration(FunctionDeclarationTree node, P p);
+
+ /**
+ * Visit function expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitFunctionExpression(FunctionExpressionTree node, P p);
+
+ /**
+ * Visit identifier tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitIdentifier(IdentifierTree node, P p);
+
+ /**
+ * Visit 'if' statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitIf(IfTree node, P p);
+
+ /**
+ * Visit array access expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitArrayAccess(ArrayAccessTree node, P p);
+
+ /**
+ * Visit array literal expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitArrayLiteral(ArrayLiteralTree node, P p);
+
+ /**
+ * Visit labeled statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitLabeledStatement(LabeledStatementTree node, P p);
+
+ /**
+ * Visit literal expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitLiteral(LiteralTree node, P p);
+
+ /**
+ * Visit parenthesized expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitParenthesized(ParenthesizedTree node, P p);
+
+ /**
+ * Visit return statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitReturn(ReturnTree node, P p);
+
+ /**
+ * Visit member select expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitMemberSelect(MemberSelectTree node, P p);
+
+ /**
+ * Visit 'new' expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitNew(NewTree node, P p);
+
+ /**
+ * Visit object literal tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitObjectLiteral(ObjectLiteralTree node, P p);
+
+ /**
+ * Visit a property of an object literal expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitProperty(PropertyTree node, P p);
+
+ /**
+ * Visit regular expression literal tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitRegExpLiteral(RegExpLiteralTree node, P p);
+
+ /**
+ * Visit an empty statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitEmptyStatement(EmptyStatementTree node, P p);
+
+ /**
+ * Visit 'switch' statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitSwitch(SwitchTree node, P p);
+
+ /**
+ * Visit 'throw' expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitThrow(ThrowTree node, P p);
+
+ /**
+ * Visit compilation unit tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitCompilationUnit(CompilationUnitTree node, P p);
+
+ /**
+ * Visit 'try' statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitTry(TryTree node, P p);
+
+ /**
+ * Visit 'instanceof' expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitInstanceOf(InstanceOfTree node, P p);
+
+ /**
+ * Visit unary expression tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitUnary(UnaryTree node, P p);
+
+ /**
+ * Visit variable declaration tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitVariable(VariableTree node, P p);
+
+ /**
+ * Visit 'while' statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitWhileLoop(WhileLoopTree node, P p);
+
+ /**
+ * Visit 'with' statement tree.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitWith(WithTree node, P p);
+
+ /**
+ * Visit unknown expression/statement tree. This fallback will be
+ * called if new Tree subtypes are introduced in future. A specific
+ * implementation may throw {{@linkplain UnknownTreeException unknown tree exception}
+ * if the visitor implementation was for an older language version.
+ *
+ * @param node node being visited
+ * @param p extra parameter passed to the visitor
+ * @return value from the visitor
+ */
+ R visitUnknown(Tree node, P p);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for a 'try' statement.
+ *
+ * For example:
+ * <pre>
+ * try
+ * <em>block</em>
+ * <em>catches</em>
+ * finally
+ * <em>finallyBlock</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface TryTree extends StatementTree {
+ /**
+ * Returns the 'try' block of this 'try' statement.
+ *
+ * @return the 'try' block
+ */
+ BlockTree getBlock();
+
+ /**
+ * Returns the list of 'catch' statements associated with this 'try'.
+ *
+ * @return the list of 'catch' statements associated with this 'try'.
+ */
+ List<? extends CatchTree> getCatches();
+
+ /**
+ * Returns the 'finally' block associated with this 'try'. This is
+ * null if there is no 'finally' block associated with this 'try'.
+ *
+ * @return the 'finally' block associated with this 'try'.
+ */
+ BlockTree getFinallyBlock();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.TryNode;
+
+final class TryTreeImpl extends StatementTreeImpl implements TryTree {
+ private final BlockTree block;
+ private final List<? extends CatchTree> catches;
+ private final BlockTree finallyBlock;
+ TryTreeImpl(final TryNode node,
+ final BlockTree block,
+ final List<? extends CatchTree> catches,
+ final BlockTree finallyBlock) {
+ super(node);
+ this.block = block;
+ this.catches = catches;
+ this.finallyBlock = finallyBlock;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.TRY;
+ }
+
+ @Override
+ public BlockTree getBlock() {
+ return block;
+ }
+
+ @Override
+ public List<? extends CatchTree> getCatches() {
+ return catches;
+ }
+
+ @Override
+ public BlockTree getFinallyBlock() {
+ return finallyBlock;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitTry(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for postfix and unary expressions.
+ * Use {@link #getKind getKind} to determine the kind of operator.
+ *
+ * For example:
+ * <pre>
+ * <em>operator</em> <em>expression</em>
+ *
+ * <em>expression</em> <em>operator</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface UnaryTree extends ExpressionTree {
+ /**
+ * Returns the expression operated by the unary operator.
+ *
+ * @return The expression operated by the unary operator.
+ */
+ ExpressionTree getExpression();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.UnaryNode;
+
+class UnaryTreeImpl extends ExpressionTreeImpl implements UnaryTree {
+ private final ExpressionTree expr;
+ private final Kind kind;
+ UnaryTreeImpl(final UnaryNode node, final ExpressionTree expr) {
+ super(node);
+ this.expr = expr;
+ this.kind = getOperator(node.tokenType());
+ }
+
+ @Override
+ public Kind getKind() {
+ return kind;
+ }
+
+ @Override
+ public ExpressionTree getExpression() {
+ return expr;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitUnary(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+
+/**
+ * Indicates that an unknown kind of Tree was encountered. This
+ * can occur if the language evolves and new kinds of Trees are
+ * added to the {@code Tree} hierarchy. May be thrown by a
+ * {@linkplain TreeVisitor tree visitor} to indicate that the
+ * visitor was created for a prior version of the language.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public class UnknownTreeException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ private transient final Tree tree;
+ private transient final Object parameter;
+
+ /**
+ * Creates a new {@code UnknownTreeException}. The {@code p}
+ * parameter may be used to pass in an additional argument with
+ * information about the context in which the unknown element was
+ * encountered; for example, the visit methods of {@link
+ * TreeVisitor} may pass in their additional parameter.
+ *
+ * @param t the unknown tree, may be {@code null}
+ * @param p an additional parameter, may be {@code null}
+ */
+ public UnknownTreeException(Tree t, Object p) {
+ super("Unknown tree: " + t);
+ this.tree = t;
+ this.parameter = p;
+ }
+
+ /**
+ * Returns the unknown tree.
+ * The value may be unavailable if this exception has been
+ * serialized and then read back in.
+ *
+ * @return the unknown element, or {@code null} if unavailable
+ */
+ public Tree getUnknownTree() {
+ return tree;
+ }
+
+ /**
+ * Returns the additional argument.
+ * The value may be unavailable if this exception has been
+ * serialized and then read back in.
+ *
+ * @return the additional argument
+ */
+ public Object getArgument() {
+ return parameter;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a variable declaration.
+ *
+ * For example:
+ * <pre>
+ * <em>var</em> <em>name</em> <em>initializer</em> ;
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface VariableTree extends StatementTree {
+ /**
+ * Returns the name of this variable.
+ *
+ * @return the name of this variable
+ */
+ String getName();
+
+ /**
+ * Returns the initial value expression for this variable. This is
+ * null if no initial value for this variable.
+ *
+ * @return the initial value expression
+ */
+ ExpressionTree getInitializer();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.VarNode;
+
+final class VariableTreeImpl extends StatementTreeImpl implements VariableTree {
+ private final String name;
+ private final ExpressionTree init;
+
+ VariableTreeImpl(final VarNode node, final ExpressionTree init) {
+ super(node);
+ this.name = node.getName().getName();
+ this.init = init;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.VARIABLE;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public ExpressionTree getInitializer() {
+ return init;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitVariable(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'while' loop statement.
+ *
+ * For example:
+ * <pre>
+ * while ( <em>condition</em> )
+ * <em>statement</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface WhileLoopTree extends ConditionalLoopTree {
+ /**
+ * The condition expression of this 'while' statement.
+ *
+ * @return the condition expression
+ */
+ ExpressionTree getCondition();
+
+ /**
+ * The statement contained in this 'while' statement.
+ *
+ * @return the statement contained
+ */
+ StatementTree getStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.WhileNode;
+
+final class WhileLoopTreeImpl extends StatementTreeImpl implements WhileLoopTree {
+ private final ExpressionTree cond;
+ private final StatementTree stat;
+
+ WhileLoopTreeImpl(final WhileNode node, final ExpressionTree cond, final StatementTree stat) {
+ super(node);
+ assert !node.isDoWhile() : "while expected";
+ this.cond = cond;
+ this.stat = stat;
+ }
+
+ @Override
+ public Tree.Kind getKind() {
+ return Tree.Kind.WHILE_LOOP;
+ }
+
+ @Override
+ public ExpressionTree getCondition() {
+ return cond;
+ }
+
+ @Override
+ public StatementTree getStatement() {
+ return stat;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitWhileLoop(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+/**
+ * A tree node for a 'with' statement.
+ *
+ * For example:
+ * <pre>
+ * with ( <em>scope</em> )
+ * <em>statement</em>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public interface WithTree extends StatementTree {
+ /**
+ * The scope object expression for this 'with' statement.
+ *
+ * @return the scope object
+ */
+ ExpressionTree getScope();
+
+ /**
+ * The statement contained in this 'with' statement.
+ *
+ * @return the statement contained
+ */
+ StatementTree getStatement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTreeImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import jdk.nashorn.internal.ir.WithNode;
+
+final class WithTreeImpl extends StatementTreeImpl implements WithTree {
+ private final ExpressionTree scope;
+ private final StatementTree stat;
+ WithTreeImpl(final WithNode node, final ExpressionTree scope,
+ final StatementTree stat) {
+ super(node);
+ this.scope = scope;
+ this.stat = stat;
+ }
+
+ @Override
+ public Kind getKind() {
+ return Kind.WITH;
+ }
+
+ @Override
+ public ExpressionTree getScope() {
+ return scope;
+ }
+
+ @Override
+ public StatementTree getStatement() {
+ return stat;
+ }
+
+ @Override
+ public <R,D> R accept(TreeVisitor<R,D> visitor, D data) {
+ return visitor.visitWith(this, data);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * <p>
+ * Nashorn parser API provides interfaces to represent ECMAScript source code
+ * as abstract syntax trees (AST) and Parser to parse ECMAScript source scripts.
+ * </p>
+ * <p>
+ * Using parser API user can write Java code to access parse tree
+ * representation of ECMAScript source. Script source may be a file,
+ * a URL or a String. Unless stated otherwise null argument in methods of this
+ * package result in NullPointerException being thrown.
+ * </p>
+ *
+ * <pre>
+ * <code>
+ * import jdk.nashorn.api.tree.*;
+ * import java.io.File;
+ *
+ * // Simple example that prints warning on 'with' statements
+ * public class Main {
+ * public static void main(String[] args) throws Exception {
+ * // Create a new parser instance
+ * Parser parser = Parser.create();
+ * File sourceFile = new File(args[0]);
+ *
+ * // Parse given source File using parse method.
+ * // Pass a diagnostic listener to print error messages.
+ * CompilationUnitTree cut = parser.parse(sourceFile,
+ * (d) -> { System.out.println(d); });
+ *
+ * if (cut != null) {
+ * // call Tree.accept method passing a SimpleTreeVisitor
+ * cut.accept(new SimpleTreeVisitor<Void, Void>() {
+ * // visit method for 'with' statement
+ * public Void visitWith(WithTree wt, Void v) {
+ * // print warning on 'with' statement
+ * System.out.println("Warning: using 'with' statement!");
+ * return null;
+ * }
+ * }, null);
+ * }
+ * }
+ * }
+ * </code>
+ * </pre>
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+package jdk.nashorn.api.tree;
+
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java Tue Mar 17 12:30:53 2015 -0700
@@ -836,7 +836,7 @@
*/
final CodeGenerator codegen = this;
- final Node currentDiscard = codegen.lc.getCurrentDiscard();
+ final boolean isCurrentDiscard = codegen.lc.isCurrentDiscard(expr);
expr.accept(new NodeOperatorVisitor<LexicalContext>(new LexicalContext()) {
@Override
public boolean enterIdentNode(final IdentNode identNode) {
@@ -1192,7 +1192,7 @@
@Override
public boolean enterJoinPredecessorExpression(final JoinPredecessorExpression joinExpr) {
- loadExpression(joinExpr.getExpression(), resultBounds);
+ loadMaybeDiscard(joinExpr, joinExpr.getExpression(), resultBounds);
return false;
}
@@ -1209,7 +1209,7 @@
throw new AssertionError(otherNode.getClass().getName());
}
});
- if(currentDiscard != expr) {
+ if(!isCurrentDiscard) {
coerceStackTop(resultBounds);
}
return method;
@@ -3648,7 +3648,7 @@
// TODO: move checks for discarding to actual expression load code (e.g. as we do with void). That way we might
// be able to eliminate even more checks.
if(expr instanceof PrimitiveLiteralNode | isLocalVariable(expr)) {
- assert lc.getCurrentDiscard() != expr;
+ assert !lc.isCurrentDiscard(expr);
// Don't bother evaluating expressions without side effects. Typical usage is "void 0" for reliably generating
// undefined.
return;
@@ -3656,11 +3656,37 @@
lc.pushDiscard(expr);
loadExpression(expr, TypeBounds.UNBOUNDED);
- if (lc.getCurrentDiscard() == expr) {
+ if (lc.popDiscardIfCurrent(expr)) {
assert !expr.isAssignment();
// NOTE: if we had a way to load with type void, we could avoid popping
method.pop();
- lc.popDiscard();
+ }
+ }
+
+ /**
+ * Loads the expression with the specified type bounds, but if the parent expression is the current discard,
+ * then instead loads and discards the expression.
+ * @param parent the parent expression that's tested for being the current discard
+ * @param expr the expression that's either normally loaded or discard-loaded
+ * @param resultBounds result bounds for when loading the expression normally
+ */
+ private void loadMaybeDiscard(final Expression parent, final Expression expr, final TypeBounds resultBounds) {
+ loadMaybeDiscard(lc.popDiscardIfCurrent(parent), expr, resultBounds);
+ }
+
+ /**
+ * Loads the expression with the specified type bounds, or loads and discards the expression, depending on the
+ * value of the discard flag. Useful as a helper for expressions with control flow where you often can't combine
+ * testing for being the current discard and loading the subexpressions.
+ * @param discard if true, the expression is loaded and discarded
+ * @param expr the expression that's either normally loaded or discard-loaded
+ * @param resultBounds result bounds for when loading the expression normally
+ */
+ private void loadMaybeDiscard(final boolean discard, final Expression expr, final TypeBounds resultBounds) {
+ if (discard) {
+ loadAndDiscard(expr);
+ } else {
+ loadExpression(expr, resultBounds);
}
}
@@ -3717,9 +3743,7 @@
public void loadVOID(final UnaryNode unaryNode, final TypeBounds resultBounds) {
loadAndDiscard(unaryNode.getExpression());
- if(lc.getCurrentDiscard() == unaryNode) {
- lc.popDiscard();
- } else {
+ if (!lc.popDiscardIfCurrent(unaryNode)) {
method.loadUndefined(resultBounds.widest);
}
}
@@ -3752,16 +3776,23 @@
private void loadAND_OR(final BinaryNode binaryNode, final TypeBounds resultBounds, final boolean isAnd) {
final Type narrowestOperandType = Type.widestReturnType(binaryNode.lhs().getType(), binaryNode.rhs().getType());
+ final boolean isCurrentDiscard = lc.popDiscardIfCurrent(binaryNode);
+
final Label skip = new Label("skip");
if(narrowestOperandType == Type.BOOLEAN) {
// optimize all-boolean logical expressions
final Label onTrue = new Label("andor_true");
emitBranch(binaryNode, onTrue, true);
- method.load(false);
- method._goto(skip);
- method.label(onTrue);
- method.load(true);
- method.label(skip);
+ if (isCurrentDiscard) {
+ method.label(onTrue);
+ method.pop();
+ } else {
+ method.load(false);
+ method._goto(skip);
+ method.label(onTrue);
+ method.load(true);
+ method.label(skip);
+ }
return;
}
@@ -3770,7 +3801,11 @@
final boolean lhsConvert = LocalVariableConversion.hasLiveConversion(lhs);
final Label evalRhs = lhsConvert ? new Label("eval_rhs") : null;
- loadExpression(lhs, outBounds).dup().convert(Type.BOOLEAN);
+ loadExpression(lhs, outBounds);
+ if (!isCurrentDiscard) {
+ method.dup();
+ }
+ method.convert(Type.BOOLEAN);
if (isAnd) {
if(lhsConvert) {
method.ifne(evalRhs);
@@ -3789,9 +3824,11 @@
method.label(evalRhs);
}
- method.pop();
+ if (!isCurrentDiscard) {
+ method.pop();
+ }
final JoinPredecessorExpression rhs = (JoinPredecessorExpression)binaryNode.rhs();
- loadExpression(rhs, outBounds);
+ loadMaybeDiscard(isCurrentDiscard, rhs, outBounds);
method.beforeJoinPoint(rhs);
method.label(skip);
}
@@ -3813,9 +3850,8 @@
// Detect dead assignments
if(lhs instanceof IdentNode) {
final Symbol symbol = ((IdentNode)lhs).getSymbol();
- if(!symbol.isScope() && !symbol.hasSlotFor(rhsType) && lc.getCurrentDiscard() == binaryNode) {
+ if(!symbol.isScope() && !symbol.hasSlotFor(rhsType) && lc.popDiscardIfCurrent(binaryNode)) {
loadAndDiscard(rhs);
- lc.popDiscard();
method.markDeadLocalVariable(symbol);
return;
}
@@ -4069,11 +4105,11 @@
private void loadCOMMARIGHT(final BinaryNode binaryNode, final TypeBounds resultBounds) {
loadAndDiscard(binaryNode.lhs());
- loadExpression(binaryNode.rhs(), resultBounds);
+ loadMaybeDiscard(binaryNode, binaryNode.rhs(), resultBounds);
}
private void loadCOMMALEFT(final BinaryNode binaryNode, final TypeBounds resultBounds) {
- loadExpression(binaryNode.lhs(), resultBounds);
+ loadMaybeDiscard(binaryNode, binaryNode.lhs(), resultBounds);
loadAndDiscard(binaryNode.rhs());
}
@@ -4173,13 +4209,14 @@
emitBranch(test, falseLabel, false);
- loadExpression(trueExpr.getExpression(), outBounds);
- assert Type.generic(method.peekType()) == outBounds.narrowest;
+ final boolean isCurrentDiscard = lc.popDiscardIfCurrent(ternaryNode);
+ loadMaybeDiscard(isCurrentDiscard, trueExpr.getExpression(), outBounds);
+ assert isCurrentDiscard || Type.generic(method.peekType()) == outBounds.narrowest;
method.beforeJoinPoint(trueExpr);
method._goto(exitLabel);
method.label(falseLabel);
- loadExpression(falseExpr.getExpression(), outBounds);
- assert Type.generic(method.peekType()) == outBounds.narrowest;
+ loadMaybeDiscard(isCurrentDiscard, falseExpr.getExpression(), outBounds);
+ assert isCurrentDiscard || Type.generic(method.peekType()) == outBounds.narrowest;
method.beforeJoinPoint(falseExpr);
method.label(exitLabel);
}
@@ -4365,9 +4402,8 @@
// store the result that "lives on" after the op, e.g. "i" in i++ postfix.
protected void storeNonDiscard() {
- if (lc.getCurrentDiscard() == assignNode) {
+ if (lc.popDiscardIfCurrent(assignNode)) {
assert assignNode.isAssignment();
- lc.popDiscard();
return;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java Tue Mar 17 12:30:53 2015 -0700
@@ -34,6 +34,7 @@
import jdk.nashorn.internal.IntDeque;
import jdk.nashorn.internal.codegen.types.Type;
import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.FunctionNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LexicalContextNode;
@@ -59,9 +60,11 @@
/** Method emitter stack - every time we start a sub method (e.g. a split) we push one */
private final Deque<MethodEmitter> methodEmitters = new ArrayDeque<>();
- /** The discard stack - whenever we enter a discard node we keep track of its return value status -
- * i.e. should we keep it or throw it away */
- private final Deque<Node> discard = new ArrayDeque<>();
+ /** The discard stack - whenever we evaluate an expression that will be discarded, we push it on this stack. Various
+ * implementations of expression code emitter can choose to emit code that'll discard the expression themselves, or
+ * ignore it in which case CodeGenerator.loadAndDiscard() will explicitly emit a pop instruction. */
+ private final Deque<Expression> discard = new ArrayDeque<>();
+
private final Deque<Map<String, Collection<Label>>> unwarrantedOptimismHandlers = new ArrayDeque<>();
private final Deque<StringBuilder> slotTypesDescriptors = new ArrayDeque<>();
@@ -270,16 +273,20 @@
}
}
- void pushDiscard(final Node node) {
- discard.push(node);
+ void pushDiscard(final Expression expr) {
+ discard.push(expr);
}
- Node popDiscard() {
- return discard.pop();
+ boolean popDiscardIfCurrent(final Expression expr) {
+ if (isCurrentDiscard(expr)) {
+ discard.pop();
+ return true;
+ }
+ return false;
}
- Node getCurrentDiscard() {
- return discard.peek();
+ boolean isCurrentDiscard(final Expression expr) {
+ return discard.peek() == expr;
}
int quickSlot(final Type type) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java Tue Mar 17 12:30:53 2015 -0700
@@ -32,7 +32,6 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
-import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
import jdk.nashorn.internal.ir.Block;
import jdk.nashorn.internal.ir.FunctionNode;
import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -208,7 +207,7 @@
final RecompilableScriptFunctionData data = new RecompilableScriptFunctionData(
newFunctionNode,
compiler.getCodeInstaller(),
- new AllocatorDescriptor(newFunctionNode.getThisProperties()),
+ ObjectClassGenerator.createAllocationStrategy(newFunctionNode.getThisProperties()),
nestedFunctions,
externalSymbolDepths.get(fnId),
internalSymbols.get(fnId),
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Tue Mar 17 12:30:53 2015 -0700
@@ -206,7 +206,6 @@
// continuations (since RewriteException's byteCodeSlots carries an array and not a name-value map).
symbolIsConverted(symbol, branchLvarType, targetType);
- //symbolIsUsed(symbol, branchLvarType);
return new LocalVariableConversion(symbol, branchLvarType.type, targetType.type, next);
}
@@ -229,7 +228,7 @@
for(final Symbol symbol: commonSymbols) {
final LvarType type1 = types1.get(symbol);
final LvarType type2 = types2.get(symbol);
- final LvarType widest = widestLvarType(type1, type2);
+ final LvarType widest = widestLvarType(type1, type2);
if(widest != type1 && matches1) {
matches1 = false;
if(!matches2) {
@@ -242,7 +241,7 @@
union = cloneMap(types2);
}
}
- if(!(matches1 || matches2) && union != null) { //remove overly enthusiastic "union can be null" warning
+ if(!(matches1 || matches2)) {
assert union != null;
union.put(symbol, widest);
}
@@ -711,8 +710,13 @@
@Override
public boolean enterIfNode(final IfNode ifNode) {
+ processIfNode(ifNode);
+ return false;
+ }
+
+ private void processIfNode(final IfNode ifNode) {
if(!reachable) {
- return false;
+ return;
}
final Expression test = ifNode.getTest();
@@ -721,48 +725,48 @@
visitExpressionOnEmptyStack(test);
- final Map<Symbol, LvarType> afterTestLvarTypes = localVariableTypes;
- if(!isAlwaysFalse(test)) {
+ final Map<Symbol, LvarType> passLvarTypes;
+ final boolean reachableFromPass;
+ final boolean isTestAlwaysTrue = isAlwaysTrue(test);
+ if(isAlwaysFalse(test)) {
+ passLvarTypes = null;
+ reachableFromPass = false;
+ } else {
+ final Map<Symbol, LvarType> afterTestLvarTypes = localVariableTypes;
pass.accept(this);
assertTypeStackIsEmpty();
+ if (isTestAlwaysTrue) {
+ return;
+ }
+ passLvarTypes = localVariableTypes;
+ reachableFromPass = reachable;
+ localVariableTypes = afterTestLvarTypes;
+ reachable = true;
}
- final Map<Symbol, LvarType> passLvarTypes = localVariableTypes;
- final boolean reachableFromPass = reachable;
- reachable = true;
- localVariableTypes = afterTestLvarTypes;
- if(!isAlwaysTrue(test) && fail != null) {
+ // If we get here, then we need to consider the case where pass block is not executed
+ assert !isTestAlwaysTrue;
+
+ if (fail != null) {
fail.accept(this);
assertTypeStackIsEmpty();
- final boolean reachableFromFail = reachable;
- reachable |= reachableFromPass;
- if(!reachable) {
- return false;
- }
-
- if(reachableFromFail) {
- if(reachableFromPass) {
- final Map<Symbol, LvarType> failLvarTypes = localVariableTypes;
- localVariableTypes = getUnionTypes(passLvarTypes, failLvarTypes);
- setConversion(pass, passLvarTypes, localVariableTypes);
- setConversion(fail, failLvarTypes, localVariableTypes);
- }
- return false;
- }
}
- if(reachableFromPass) {
- localVariableTypes = getUnionTypes(afterTestLvarTypes, passLvarTypes);
- // IfNode itself is associated with conversions that might need to be performed after the test if there's no
- // else branch. E.g.
- // if(x = 1, cond) { x = 1.0 } must widen "x = 1" to a double.
- setConversion(pass, passLvarTypes, localVariableTypes);
- setConversion(ifNode, afterTestLvarTypes, localVariableTypes);
- } else {
- localVariableTypes = afterTestLvarTypes;
+ if(reachable) {
+ if(reachableFromPass) {
+ final Map<Symbol, LvarType> failLvarTypes = localVariableTypes;
+ localVariableTypes = getUnionTypes(passLvarTypes, failLvarTypes);
+ setConversion(pass, passLvarTypes, localVariableTypes);
+ // IfNode itself is associated with conversions that might need to be performed after the test if
+ // there's no else branch. E.g.
+ // if(x = 1, cond) { x = 1.0 } must widen "x = 1" to a double.
+ setConversion(fail != null ? fail : ifNode, failLvarTypes, localVariableTypes);
+ }
+ } else if (reachableFromPass) {
+ assert passLvarTypes != null;
+ localVariableTypes = passLvarTypes;
+ reachable = true;
}
-
- return false;
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Tue Mar 17 12:30:53 2015 -0700
@@ -45,6 +45,7 @@
import jdk.nashorn.internal.ir.CallNode;
import jdk.nashorn.internal.ir.CaseNode;
import jdk.nashorn.internal.ir.CatchNode;
+import jdk.nashorn.internal.ir.DebuggerNode;
import jdk.nashorn.internal.ir.ContinueNode;
import jdk.nashorn.internal.ir.EmptyNode;
import jdk.nashorn.internal.ir.Expression;
@@ -185,6 +186,15 @@
}
@Override
+ public boolean enterDebuggerNode(final DebuggerNode debuggerNode) {
+ final int line = debuggerNode.getLineNumber();
+ final long token = debuggerNode.getToken();
+ final int finish = debuggerNode.getFinish();
+ addStatement(new ExpressionStatement(line, token, finish, new RuntimeNode(token, finish, RuntimeNode.Request.DEBUGGER, new ArrayList<Expression>())));
+ return false;
+ }
+
+ @Override
public boolean enterJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
addStatement(jumpToInlinedFinally);
return false;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java Tue Mar 17 12:30:53 2015 -0700
@@ -100,15 +100,16 @@
for (final MapTuple<T> tuple : tuples) {
final String key = tuple.key;
final Symbol symbol = tuple.symbol;
+ final Class<?> initialType = tuple.getValueType();
- //TODO initial type is object here no matter what. Is that right?
if (symbol != null && !isValidArrayIndex(getArrayIndex(key))) {
final int flags = getPropertyFlags(symbol, hasArguments, false);
properties.add(
new SpillProperty(
key,
flags,
- spillIndex++));
+ spillIndex++,
+ initialType));
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java Tue Mar 17 12:30:53 2015 -0700
@@ -56,6 +56,7 @@
import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
import jdk.nashorn.internal.codegen.types.Type;
import jdk.nashorn.internal.runtime.AccessorProperty;
+import jdk.nashorn.internal.runtime.AllocationStrategy;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.FunctionScope;
import jdk.nashorn.internal.runtime.JSType;
@@ -826,44 +827,13 @@
}
/**
- * Describes the allocator class name and property map for a constructor function with the specified
+ * Creates the allocator class name and property map for a constructor function with the specified
* number of "this" properties that it initializes.
- *
+ * @param thisProperties number of properties assigned to "this"
+ * @return the allocation strategy
*/
- public static class AllocatorDescriptor {
- private final String allocatorClassName;
- private final PropertyMap allocatorMap;
-
- /**
- * Creates a new allocator descriptor
- * @param thisProperties the number of "this" properties that the function initializes
- */
- public AllocatorDescriptor(final int thisProperties) {
- final int paddedFieldCount = getPaddedFieldCount(thisProperties);
- this.allocatorClassName = Compiler.binaryName(getClassName(paddedFieldCount));
- this.allocatorMap = PropertyMap.newMap(null, allocatorClassName, 0, paddedFieldCount, 0);
- }
-
- /**
- * Returns the name of the class that the function allocates
- * @return the name of the class that the function allocates
- */
- public String getAllocatorClassName() {
- return allocatorClassName;
- }
-
- /**
- * Returns the allocator map for the function.
- * @return the allocator map for the function.
- */
- public PropertyMap getAllocatorMap() {
- return allocatorMap;
- }
-
- @Override
- public String toString() {
- return "AllocatorDescriptor[allocatorClassName=" + allocatorClassName + ", allocatorMap.size=" +
- allocatorMap.size() + "]";
- }
+ static AllocationStrategy createAllocationStrategy(final int thisProperties) {
+ final int paddedFieldCount = getPaddedFieldCount(thisProperties);
+ return new AllocationStrategy(paddedFieldCount);
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java Tue Mar 17 12:30:53 2015 -0700
@@ -56,7 +56,7 @@
/** Break label. */
private final Label breakLabel;
- /** Does the block/function need a new scope? */
+ /** Does the block/function need a new scope? Is this synthetic? */
protected final int flags;
/**
@@ -80,6 +80,11 @@
public static final int IS_GLOBAL_SCOPE = 1 << 3;
/**
+ * Is this block a synthetic one introduced by Parser?
+ */
+ public static final int IS_SYNTHETIC = 1 << 4;
+
+ /**
* Constructor
*
* @param token The first token of the block
@@ -108,7 +113,7 @@
* @param statements All statements in the block
*/
public Block(final long token, final int finish, final Statement...statements){
- this(token, finish, 0, statements);
+ this(token, finish, IS_SYNTHETIC, statements);
}
/**
@@ -119,7 +124,7 @@
* @param statements All statements in the block
*/
public Block(final long token, final int finish, final List<Statement> statements){
- this(token, finish, 0, statements);
+ this(token, finish, IS_SYNTHETIC, statements);
}
/**
@@ -366,6 +371,15 @@
return (flags & NEEDS_SCOPE) == NEEDS_SCOPE;
}
+ /**
+ * Check whether this block is synthetic or not.
+ *
+ * @return true if this is a synthetic block
+ */
+ public boolean isSynthetic() {
+ return (flags & IS_SYNTHETIC) == IS_SYNTHETIC;
+ }
+
@Override
public Block setFlags(final LexicalContext lc, final int flags) {
if (this.flags == flags) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BlockStatement.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BlockStatement.java Tue Mar 17 12:30:53 2015 -0700
@@ -90,6 +90,15 @@
return block.isTerminal();
}
+ /**
+ * Tells if this is a synthetic block statement or not.
+ *
+ * @return true if this is a synthetic statement
+ */
+ public boolean isSynthetic() {
+ return block.isSynthetic();
+ }
+
@Override
public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
if (visitor.enterBlockStatement(this)) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/DebuggerNode.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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.Immutable;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+/**
+ * IR representation for a debugger statement.
+ */
+@Immutable
+public final class DebuggerNode extends Statement {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ *
+ * @param lineNumber line number
+ * @param token token
+ * @param finish finish
+ */
+ public DebuggerNode(final int lineNumber, final long token, final int finish) {
+ super(lineNumber, token, finish);
+ }
+
+ @Override
+ public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+ if (visitor.enterDebuggerNode(this)) {
+ return visitor.leaveDebuggerNode(this);
+ }
+
+ return this;
+ }
+
+ @Override
+ public void toString(final StringBuilder sb, final boolean printType) {
+ sb.append("debugger");
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ErrorNode.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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.codegen.types.Type;
+import jdk.nashorn.internal.ir.annotations.Immutable;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+/**
+ * IR representation for an error expression.
+ */
+@Immutable
+public final class ErrorNode extends Expression {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ *
+ * @param token token
+ * @param finish finish
+ */
+ public ErrorNode(final long token, final int finish) {
+ super(token, finish);
+ }
+
+ @Override
+ public Type getType() {
+ return Type.OBJECT;
+ }
+
+ @Override
+ public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+ if (visitor.enterErrorNode(this)) {
+ return visitor.leaveErrorNode(this);
+ }
+
+ return this;
+ }
+
+ @Override
+ public void toString(final StringBuilder sb, final boolean printType) {
+ sb.append("<error>");
+ }
+}
+
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LiteralNode.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LiteralNode.java Tue Mar 17 12:30:53 2015 -0700
@@ -181,6 +181,28 @@
}
/**
+ * Test if the value is an array
+ *
+ * @return True if value is an array
+ */
+ public boolean isArray() {
+ return false;
+ }
+
+ public List<Expression> getElementExpressions() {
+ return null;
+ }
+
+ /**
+ * Test if the value is a boolean.
+ *
+ * @return True if value is a boolean.
+ */
+ public boolean isBoolean() {
+ return value instanceof Boolean;
+ }
+
+ /**
* Test if the value is a string.
*
* @return True if value is a string.
@@ -607,6 +629,12 @@
/** Sub units with indexes ranges, in which to split up code generation, for large literals */
private final List<ArrayUnit> units;
+ @Override
+ public boolean isArray() {
+ return true;
+ }
+
+
/**
* An ArrayUnit is a range in an ArrayLiteral. ArrayLiterals can
* be split if they are too large, for bytecode generation reasons
@@ -834,6 +862,7 @@
* null.
* @return a list of array element expressions.
*/
+ @Override
public List<Expression> getElementExpressions() {
return Collections.unmodifiableList(Arrays.asList(value));
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/debug/JSONWriter.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/debug/JSONWriter.java Tue Mar 17 12:30:53 2015 -0700
@@ -38,6 +38,7 @@
import jdk.nashorn.internal.ir.CaseNode;
import jdk.nashorn.internal.ir.CatchNode;
import jdk.nashorn.internal.ir.ContinueNode;
+import jdk.nashorn.internal.ir.DebuggerNode;
import jdk.nashorn.internal.ir.EmptyNode;
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.ExpressionStatement;
@@ -289,6 +290,13 @@
}
@Override
+ public boolean enterDebuggerNode(final DebuggerNode debuggerNode) {
+ enterDefault(debuggerNode);
+ type("DebuggerStatement");
+ return leave();
+ }
+
+ @Override
public boolean enterEmptyNode(final EmptyNode emptyNode) {
enterDefault(emptyNode);
@@ -302,7 +310,7 @@
// handle debugger statement
final Node expression = expressionStatement.getExpression();
if (expression instanceof RuntimeNode) {
- expression.accept(this);
+ assert false : "should not reach here: RuntimeNode";
return false;
}
@@ -319,14 +327,18 @@
@Override
public boolean enterBlockStatement(final BlockStatement blockStatement) {
+ if (blockStatement.isSynthetic()) {
+ final Block blk = blockStatement.getBlock();
+ blk.getStatements().get(0).accept(this);
+ return false;
+ }
+
enterDefault(blockStatement);
type("BlockStatement");
comma();
- property("block");
- blockStatement.getBlock().accept(this);
-
+ array("body", blockStatement.getBlock().getStatements());
return leave();
}
@@ -677,19 +689,13 @@
@Override
public boolean enterRuntimeNode(final RuntimeNode runtimeNode) {
- final RuntimeNode.Request req = runtimeNode.getRequest();
-
- if (req == RuntimeNode.Request.DEBUGGER) {
- enterDefault(runtimeNode);
- type("DebuggerStatement");
- return leave();
- }
-
+ assert false : "should not reach here: RuntimeNode";
return false;
}
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
+ assert false : "should not reach here: SplitNode";
return false;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeVisitor.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeVisitor.java Tue Mar 17 12:30:53 2015 -0700
@@ -34,7 +34,9 @@
import jdk.nashorn.internal.ir.CaseNode;
import jdk.nashorn.internal.ir.CatchNode;
import jdk.nashorn.internal.ir.ContinueNode;
+import jdk.nashorn.internal.ir.DebuggerNode;
import jdk.nashorn.internal.ir.EmptyNode;
+import jdk.nashorn.internal.ir.ErrorNode;
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
import jdk.nashorn.internal.ir.FunctionNode;
@@ -293,6 +295,27 @@
return leaveDefault(continueNode);
}
+
+ /**
+ * Callback for entering a DebuggerNode
+ *
+ * @param debuggerNode the node
+ * @return true if traversal should continue and node children be traversed, false otherwise
+ */
+ public boolean enterDebuggerNode(final DebuggerNode debuggerNode) {
+ return enterDefault(debuggerNode);
+ }
+
+ /**
+ * Callback for leaving a DebuggerNode
+ *
+ * @param debuggerNode the node
+ * @return processed node, which will replace the original one, or the original node
+ */
+ public Node leaveDebuggerNode(final DebuggerNode debuggerNode) {
+ return leaveDefault(debuggerNode);
+ }
+
/**
* Callback for entering an EmptyNode
*
@@ -314,6 +337,26 @@
}
/**
+ * Callback for entering an ErrorNode
+ *
+ * @param errorNode the node
+ * @return true if traversal should continue and node children be traversed, false otherwise
+ */
+ public boolean enterErrorNode(final ErrorNode errorNode) {
+ return enterDefault(errorNode);
+ }
+
+ /**
+ * Callback for leaving an ErrorNode
+ *
+ * @param errorNode the node
+ * @return processed node, which will replace the original one, or the original node
+ */
+ public Node leaveErrorNode(final ErrorNode errorNode) {
+ return leaveDefault(errorNode);
+ }
+
+ /**
* Callback for entering an ExpressionStatement
*
* @param expressionStatement the node
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/ScriptFunctionImpl.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/ScriptFunctionImpl.java Tue Mar 17 12:30:53 2015 -0700
@@ -305,7 +305,7 @@
final ScriptFunction typeErrorThrower = global.getTypeErrorThrower();
if (findProperty("arguments", true) != null) {
initUserAccessors("arguments", Property.NOT_CONFIGURABLE | Property.NOT_ENUMERABLE, typeErrorThrower, typeErrorThrower);
- }
+ }
if (findProperty("caller", true) != null) {
initUserAccessors("caller", Property.NOT_CONFIGURABLE | Property.NOT_ENUMERABLE, typeErrorThrower, typeErrorThrower);
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java Tue Mar 17 12:30:53 2015 -0700
@@ -244,20 +244,15 @@
private static PropertyMap addObjectProperty(final PropertyMap propertyMap, final List<Object> values,
final String id, final Object value) {
final Property oldProperty = propertyMap.findProperty(id);
- final Property newProperty;
final PropertyMap newMap;
final Class<?> type = ObjectClassGenerator.OBJECT_FIELDS_ONLY ? Object.class : getType(value);
if (oldProperty != null) {
values.set(oldProperty.getSlot(), value);
- newProperty = new SpillProperty(id, 0, oldProperty.getSlot());
- newProperty.setType(type);
- newMap = propertyMap.replaceProperty(oldProperty, newProperty);;
+ newMap = propertyMap.replaceProperty(oldProperty, new SpillProperty(id, 0, oldProperty.getSlot(), type));;
} else {
values.add(value);
- newProperty = new SpillProperty(id, 0, propertyMap.size());
- newProperty.setType(type);
- newMap = propertyMap.addProperty(newProperty);
+ newMap = propertyMap.addProperty(new SpillProperty(id, 0, propertyMap.size(), type));
}
return newMap;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java Tue Mar 17 12:30:53 2015 -0700
@@ -77,7 +77,9 @@
import jdk.nashorn.internal.ir.CaseNode;
import jdk.nashorn.internal.ir.CatchNode;
import jdk.nashorn.internal.ir.ContinueNode;
+import jdk.nashorn.internal.ir.DebuggerNode;
import jdk.nashorn.internal.ir.EmptyNode;
+import jdk.nashorn.internal.ir.ErrorNode;
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.ExpressionStatement;
import jdk.nashorn.internal.ir.ForNode;
@@ -356,7 +358,8 @@
restoreBlock(body);
body.setFlag(Block.NEEDS_SCOPE);
- final Block functionBody = new Block(functionToken, source.getLength() - 1, body.getFlags(), body.getStatements());
+ final Block functionBody = new Block(functionToken, source.getLength() - 1,
+ body.getFlags() | Block.IS_SYNTHETIC, body.getStatements());
lc.pop(function);
expect(EOF);
@@ -540,7 +543,8 @@
expect(RBRACE);
}
- return new Block(blockToken, finish, newBlock.getFlags(), newBlock.getStatements());
+ final int flags = newBlock.getFlags() | (needsBraces? 0 : Block.IS_SYNTHETIC);
+ return new Block(blockToken, finish, flags, newBlock.getStatements());
}
@@ -559,7 +563,7 @@
} finally {
restoreBlock(newBlock);
}
- return new Block(newBlock.getToken(), finish, newBlock.getFlags(), newBlock.getStatements());
+ return new Block(newBlock.getToken(), finish, newBlock.getFlags() | Block.IS_SYNTHETIC, newBlock.getStatements());
}
/**
@@ -712,7 +716,7 @@
restoreBlock(body);
body.setFlag(Block.NEEDS_SCOPE);
- final Block programBody = new Block(functionToken, functionLine, body.getFlags(), body.getStatements());
+ final Block programBody = new Block(functionToken, functionLine, body.getFlags() | Block.IS_SYNTHETIC, body.getStatements());
lc.pop(script);
script.setLastToken(token);
@@ -826,8 +830,13 @@
}
}
} catch (final Exception e) {
+ final int errorLine = line;
+ final long errorToken = token;
//recover parsing
recover(e);
+ final ErrorNode errorExpr = new ErrorNode(errorToken, finish);
+ final ExpressionStatement expressionStatement = new ExpressionStatement(errorLine, errorToken, finish, errorExpr);
+ appendStatement(expressionStatement);
}
// No backtracking from here on.
@@ -1853,7 +1862,7 @@
appendStatement(catchNode);
} finally {
restoreBlock(catchBlock);
- catchBlocks.add(new Block(catchBlock.getToken(), finish, catchBlock.getFlags(), catchBlock.getStatements()));
+ catchBlocks.add(new Block(catchBlock.getToken(), finish, catchBlock.getFlags() | Block.IS_SYNTHETIC, catchBlock.getStatements()));
}
// If unconditional catch then should to be the end.
@@ -1883,7 +1892,7 @@
restoreBlock(outer);
}
- appendStatement(new BlockStatement(startLine, new Block(tryToken, finish, outer.getFlags(), outer.getStatements())));
+ appendStatement(new BlockStatement(startLine, new Block(tryToken, finish, outer.getFlags() | Block.IS_SYNTHETIC, outer.getStatements())));
}
/**
@@ -1901,7 +1910,7 @@
// DEBUGGER tested in caller.
next();
endOfLine();
- appendStatement(new ExpressionStatement(debuggerLine, debuggerToken, finish, new RuntimeNode(debuggerToken, finish, RuntimeNode.Request.DEBUGGER, Collections.<Expression>emptyList())));
+ appendStatement(new DebuggerNode(debuggerLine, debuggerToken, finish));
}
/**
@@ -2882,7 +2891,6 @@
Block functionBody;
int bodyFinish = 0;
-
final boolean parseBody;
Object endParserState = null;
try {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AllocationStrategy.java Tue Mar 17 12:30:53 2015 -0700
@@ -29,55 +29,52 @@
import java.io.Serializable;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
+import jdk.nashorn.internal.codegen.Compiler;
import jdk.nashorn.internal.codegen.CompilerConstants;
-import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
+import jdk.nashorn.internal.codegen.ObjectClassGenerator;
/**
- * Encapsulates the allocation strategy for a function when used as a constructor. Basically the same as
- * {@link AllocatorDescriptor}, but with an additionally cached resolved method handle. There is also a
- * canonical default allocation strategy for functions that don't assign any "this" properties (vast majority
- * of all functions), therefore saving some storage space in {@link RecompilableScriptFunctionData} that would
- * otherwise be lost to identical tuples of (map, className, handle) fields.
+ * Encapsulates the allocation strategy for a function when used as a constructor.
*/
-final class AllocationStrategy implements Serializable {
+final public class AllocationStrategy implements Serializable {
private static final long serialVersionUID = 1L;
private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
- private static final AllocationStrategy DEFAULT_STRATEGY = new AllocationStrategy(new AllocatorDescriptor(0));
-
- /** Allocator map from allocator descriptor */
- private final PropertyMap allocatorMap;
+ /** Number of fields in the allocated object */
+ private final int fieldCount;
/** Name of class where allocator function resides */
- private final String allocatorClassName;
+ private transient String allocatorClassName;
/** lazily generated allocator */
private transient MethodHandle allocator;
- private AllocationStrategy(final AllocatorDescriptor desc) {
- this.allocatorMap = desc.getAllocatorMap();
- // These classes get loaded, so an interned variant of their name is most likely around anyway.
- this.allocatorClassName = desc.getAllocatorClassName().intern();
+ /**
+ * Construct an allocation strategy with the given map and class name.
+ * @param fieldCount number of fields in the allocated object
+ */
+ public AllocationStrategy(final int fieldCount) {
+ this.fieldCount = fieldCount;
}
- private boolean matches(final AllocatorDescriptor desc) {
- return desc.getAllocatorMap().size() == allocatorMap.size() &&
- desc.getAllocatorClassName().equals(allocatorClassName);
- }
-
- static AllocationStrategy get(final AllocatorDescriptor desc) {
- return DEFAULT_STRATEGY.matches(desc) ? DEFAULT_STRATEGY : new AllocationStrategy(desc);
+ private String getAllocatorClassName() {
+ if (allocatorClassName == null) {
+ // These classes get loaded, so an interned variant of their name is most likely around anyway.
+ allocatorClassName = Compiler.binaryName(ObjectClassGenerator.getClassName(fieldCount)).intern();
+ }
+ return allocatorClassName;
}
PropertyMap getAllocatorMap() {
- return allocatorMap;
+ // Create a new map for each function instance
+ return PropertyMap.newMap(null, getAllocatorClassName(), 0, fieldCount, 0);
}
ScriptObject allocate(final PropertyMap map) {
try {
if (allocator == null) {
- allocator = MH.findStatic(LOOKUP, Context.forStructureClass(allocatorClassName),
+ allocator = MH.findStatic(LOOKUP, Context.forStructureClass(getAllocatorClassName()),
CompilerConstants.ALLOCATE.symbolName(), MH.type(ScriptObject.class, PropertyMap.class));
}
return (ScriptObject)allocator.invokeExact(map);
@@ -88,17 +85,8 @@
}
}
- private Object readResolve() {
- if(allocatorMap.size() == DEFAULT_STRATEGY.allocatorMap.size() &&
- allocatorClassName.equals(DEFAULT_STRATEGY.allocatorClassName)) {
- return DEFAULT_STRATEGY;
- }
- return this;
- }
-
@Override
public String toString() {
- return "AllocationStrategy[allocatorClassName=" + allocatorClassName + ", allocatorMap.size=" +
- allocatorMap.size() + "]";
+ return "AllocationStrategy[fieldCount=" + fieldCount + "]";
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java Tue Mar 17 12:30:53 2015 -0700
@@ -27,6 +27,7 @@
import static jdk.nashorn.internal.lookup.Lookup.MH;
import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.isValid;
+
import java.lang.invoke.CallSite;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
@@ -594,7 +595,7 @@
* switchpoint has been invalidated by a {@code RewriteException} triggered on another thread for this function.
* This is not a problem, though, as these switch points are always used to produce call sites that fall back to
* relinking when they are invalidated, and in this case the execution will end up here again. What this method
- * basically does is minimize such busy-loop relinking while the function is being recompiled on a different thread.
+ * basically does is reduce such busy-loop relinking while the function is being recompiled on a different thread.
* @param invocationSupplier the supplier that constructs the actual invocation method handle; should use the
* {@code CompiledFunction} method itself in some capacity.
* @return a tuple object containing the method handle as created by the supplier and an optimistic assumptions
@@ -602,20 +603,27 @@
* function can't be further deoptimized).
*/
private synchronized HandleAndAssumptions getValidOptimisticInvocation(final Supplier<MethodHandle> invocationSupplier) {
- for(;;) {
+ for(int i = 0; i < 2; ++i) {
final MethodHandle handle = invocationSupplier.get();
final SwitchPoint assumptions = canBeDeoptimized() ? optimismInfo.optimisticAssumptions : null;
- if(assumptions != null && assumptions.hasBeenInvalidated()) {
+ if(i == 0 && assumptions != null && assumptions.hasBeenInvalidated()) {
// We can be in a situation where one thread is in the middle of a deoptimizing compilation when we hit
// this and thus, it has invalidated the old switch point, but hasn't created the new one yet. Note that
// the behavior of invalidating the old switch point before recompilation, and only creating the new one
- // after recompilation is by design. If we didn't wait here for the recompilation to complete, we would
- // be busy looping through the fallback path of the invalidated switch point, relinking the call site
- // again with the same invalidated switch point, invoking the fallback, etc. stealing CPU cycles from
- // the recompilation task we're dependent on. This can still happen if the switch point gets invalidated
- // after we grabbed it here, in which case we'll indeed do one busy relink immediately.
+ // after recompilation is by design. If we didn't wait here, we would be busy looping through the
+ // fallback path of the invalidated switch point, relinking the call site again with the same
+ // invalidated switch point, invoking the fallback, etc. stealing CPU cycles from the recompilation
+ // task we're dependent on. This can still happen if the switch point gets invalidated after we grabbed
+ // it here, in which case we'll indeed do one busy relink immediately.
+ // On the other hand, in order to avoid a rare livelock, we aren't doing an infinite loop, and we
+ // aren't wait()-ing indefinitely. We'll do at most one, at most 1000ms long wait after which we'll
+ // return the current handle even if it's invalidated (and which'll then trigger one loop through the
+ // relink mechanism). We therefore strike a balance between busy looping and a livelock risk by making
+ // sure that there's at most one iteration of busy loop per second. It is theoretically possible to
+ // correctly implement this without ever risking a livelock, but using this heuristic we eliminate the
+ // chance of the livelock, while still maintaining a good enough busy-looping prevention.
try {
- wait();
+ wait(1000L);
} catch (final InterruptedException e) {
// Intentionally ignored. There's nothing meaningful we can do if we're interrupted
}
@@ -623,6 +631,7 @@
return new HandleAndAssumptions(handle, assumptions);
}
}
+ throw new AssertionError(); // never reached
}
private static void relinkComposableInvoker(final CallSite cs, final CompiledFunction inv, final boolean constructor) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Tue Mar 17 12:30:53 2015 -0700
@@ -43,7 +43,6 @@
import jdk.nashorn.internal.codegen.CompilerConstants;
import jdk.nashorn.internal.codegen.FunctionSignature;
import jdk.nashorn.internal.codegen.Namespace;
-import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
import jdk.nashorn.internal.codegen.OptimisticTypesPersistence;
import jdk.nashorn.internal.codegen.TypeMap;
import jdk.nashorn.internal.codegen.types.Type;
@@ -126,7 +125,7 @@
*
* @param functionNode functionNode that represents this function code
* @param installer installer for code regeneration versions of this function
- * @param allocationDescriptor descriptor for the allocation behavior when this function is used as a constructor
+ * @param allocationStrategy strategy for the allocation behavior when this function is used as a constructor
* @param nestedFunctions nested function map
* @param externalScopeDepths external scope depths
* @param internalSymbols internal symbols to method, defined in its scope
@@ -135,7 +134,7 @@
public RecompilableScriptFunctionData(
final FunctionNode functionNode,
final CodeInstaller<ScriptEnvironment> installer,
- final AllocatorDescriptor allocationDescriptor,
+ final AllocationStrategy allocationStrategy,
final Map<Integer, RecompilableScriptFunctionData> nestedFunctions,
final Map<String, Integer> externalScopeDepths,
final Set<String> internalSymbols,
@@ -153,7 +152,7 @@
this.endParserState = functionNode.getEndParserState();
this.token = tokenFor(functionNode);
this.installer = installer;
- this.allocationStrategy = AllocationStrategy.get(allocationDescriptor);
+ this.allocationStrategy = allocationStrategy;
this.nestedFunctions = smallMap(nestedFunctions);
this.externalScopeDepths = smallMap(externalScopeDepths);
this.internalSymbols = smallSet(new HashSet<>(internalSymbols));
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Tue Mar 17 12:30:53 2015 -0700
@@ -143,7 +143,6 @@
this.data = data;
this.scope = scope;
- this.allocatorMap = data.getAllocatorMap();
}
@Override
@@ -253,7 +252,7 @@
assert !isBoundFunction(); // allocate never invoked on bound functions
- final ScriptObject object = data.allocate(allocatorMap);
+ final ScriptObject object = data.allocate(getAllocatorMap());
if (object != null) {
final Object prototype = getPrototype();
@@ -269,6 +268,13 @@
return object;
}
+ private PropertyMap getAllocatorMap() {
+ if (allocatorMap == null) {
+ allocatorMap = data.getAllocatorMap();
+ }
+ return allocatorMap;
+ }
+
/**
* Return Object.prototype - used by "allocate"
* @return Object.prototype
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Source.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Source.java Tue Mar 17 12:30:53 2015 -0700
@@ -484,6 +484,30 @@
* Constructor
*
* @param name source name
+ * @param path path from which source can be loaded
+ *
+ * @return source instance
+ *
+ * @throws IOException if source cannot be loaded
+ */
+ public static Source sourceFor(final String name, final Path path) throws IOException {
+ File file = null;
+ try {
+ file = path.toFile();
+ } catch (final UnsupportedOperationException uoe) {
+ }
+
+ if (file != null) {
+ return sourceFor(name, file);
+ } else {
+ return sourceFor(name, Files.newBufferedReader(path));
+ }
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name source name
* @param file file from which source can be loaded
* @param cs Charset used to convert bytes to chars
*
@@ -601,7 +625,7 @@
/**
* Get explicit source URL.
- * @return URL set vial sourceURL directive
+ * @return URL set via sourceURL directive
*/
public String getExplicitURL() {
return explicitURL;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SpillProperty.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SpillProperty.java Tue Mar 17 12:30:53 2015 -0700
@@ -164,7 +164,14 @@
assert !OBJECT_FIELDS_ONLY || getLocalType() == Object.class;
}
- SpillProperty(final String key, final int flags, final int slot, final Class<?> initialType) {
+ /**
+ * Constructor for spill properties with an initial type.
+ * @param key the property key
+ * @param flags the property flags
+ * @param slot spill slot
+ * @param initialType initial type
+ */
+ public SpillProperty(final String key, final int flags, final int slot, final Class<?> initialType) {
this(key, flags, slot);
setType(OBJECT_FIELDS_ONLY ? Object.class : initialType);
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/Options.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/Options.java Tue Mar 17 12:30:53 2015 -0700
@@ -429,6 +429,7 @@
while (!argList.isEmpty()) {
final String arg = argList.remove(0);
+ Objects.requireNonNull(arg);
// skip empty args
if (arg.isEmpty()) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8074545.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,1038 @@
+/*
+ * Copyright (c) 2015, 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-8074545: Undefined object values in object literals with spill properties
+ *
+ * @test
+ * @run
+ */
+
+var obj = {
+ "p0": { "x" : 0 },
+ "p1": { "x" : 1 },
+ "p2": { "x" : 2 },
+ "p3": { "x" : 3 },
+ "p4": { "x" : 4 },
+ "p5": { "x" : 5 },
+ "p6": { "x" : 6 },
+ "p7": { "x" : 7 },
+ "p8": { "x" : 8 },
+ "p9": { "x" : 9 },
+ "p10": { "x" : 10 },
+ "p11": { "x" : 11 },
+ "p12": { "x" : 12 },
+ "p13": { "x" : 13 },
+ "p14": { "x" : 14 },
+ "p15": { "x" : 15 },
+ "p16": { "x" : 16 },
+ "p17": { "x" : 17 },
+ "p18": { "x" : 18 },
+ "p19": { "x" : 19 },
+ "p20": { "x" : 20 },
+ "p21": { "x" : 21 },
+ "p22": { "x" : 22 },
+ "p23": { "x" : 23 },
+ "p24": { "x" : 24 },
+ "p25": { "x" : 25 },
+ "p26": { "x" : 26 },
+ "p27": { "x" : 27 },
+ "p28": { "x" : 28 },
+ "p29": { "x" : 29 },
+ "p30": { "x" : 30 },
+ "p31": { "x" : 31 },
+ "p32": { "x" : 32 },
+ "p33": { "x" : 33 },
+ "p34": { "x" : 34 },
+ "p35": { "x" : 35 },
+ "p36": { "x" : 36 },
+ "p37": { "x" : 37 },
+ "p38": { "x" : 38 },
+ "p39": { "x" : 39 },
+ "p40": { "x" : 40 },
+ "p41": { "x" : 41 },
+ "p42": { "x" : 42 },
+ "p43": { "x" : 43 },
+ "p44": { "x" : 44 },
+ "p45": { "x" : 45 },
+ "p46": { "x" : 46 },
+ "p47": { "x" : 47 },
+ "p48": { "x" : 48 },
+ "p49": { "x" : 49 },
+ "p50": { "x" : 50 },
+ "p51": { "x" : 51 },
+ "p52": { "x" : 52 },
+ "p53": { "x" : 53 },
+ "p54": { "x" : 54 },
+ "p55": { "x" : 55 },
+ "p56": { "x" : 56 },
+ "p57": { "x" : 57 },
+ "p58": { "x" : 58 },
+ "p59": { "x" : 59 },
+ "p60": { "x" : 60 },
+ "p61": { "x" : 61 },
+ "p62": { "x" : 62 },
+ "p63": { "x" : 63 },
+ "p64": { "x" : 64 },
+ "p65": { "x" : 65 },
+ "p66": { "x" : 66 },
+ "p67": { "x" : 67 },
+ "p68": { "x" : 68 },
+ "p69": { "x" : 69 },
+ "p70": { "x" : 70 },
+ "p71": { "x" : 71 },
+ "p72": { "x" : 72 },
+ "p73": { "x" : 73 },
+ "p74": { "x" : 74 },
+ "p75": { "x" : 75 },
+ "p76": { "x" : 76 },
+ "p77": { "x" : 77 },
+ "p78": { "x" : 78 },
+ "p79": { "x" : 79 },
+ "p80": { "x" : 80 },
+ "p81": { "x" : 81 },
+ "p82": { "x" : 82 },
+ "p83": { "x" : 83 },
+ "p84": { "x" : 84 },
+ "p85": { "x" : 85 },
+ "p86": { "x" : 86 },
+ "p87": { "x" : 87 },
+ "p88": { "x" : 88 },
+ "p89": { "x" : 89 },
+ "p90": { "x" : 90 },
+ "p91": { "x" : 91 },
+ "p92": { "x" : 92 },
+ "p93": { "x" : 93 },
+ "p94": { "x" : 94 },
+ "p95": { "x" : 95 },
+ "p96": { "x" : 96 },
+ "p97": { "x" : 97 },
+ "p98": { "x" : 98 },
+ "p99": { "x" : 99 },
+ "p100": { "x" : 100 },
+ "p101": { "x" : 101 },
+ "p102": { "x" : 102 },
+ "p103": { "x" : 103 },
+ "p104": { "x" : 104 },
+ "p105": { "x" : 105 },
+ "p106": { "x" : 106 },
+ "p107": { "x" : 107 },
+ "p108": { "x" : 108 },
+ "p109": { "x" : 109 },
+ "p110": { "x" : 110 },
+ "p111": { "x" : 111 },
+ "p112": { "x" : 112 },
+ "p113": { "x" : 113 },
+ "p114": { "x" : 114 },
+ "p115": { "x" : 115 },
+ "p116": { "x" : 116 },
+ "p117": { "x" : 117 },
+ "p118": { "x" : 118 },
+ "p119": { "x" : 119 },
+ "p120": { "x" : 120 },
+ "p121": { "x" : 121 },
+ "p122": { "x" : 122 },
+ "p123": { "x" : 123 },
+ "p124": { "x" : 124 },
+ "p125": { "x" : 125 },
+ "p126": { "x" : 126 },
+ "p127": { "x" : 127 },
+ "p128": { "x" : 128 },
+ "p129": { "x" : 129 },
+ "p130": { "x" : 130 },
+ "p131": { "x" : 131 },
+ "p132": { "x" : 132 },
+ "p133": { "x" : 133 },
+ "p134": { "x" : 134 },
+ "p135": { "x" : 135 },
+ "p136": { "x" : 136 },
+ "p137": { "x" : 137 },
+ "p138": { "x" : 138 },
+ "p139": { "x" : 139 },
+ "p140": { "x" : 140 },
+ "p141": { "x" : 141 },
+ "p142": { "x" : 142 },
+ "p143": { "x" : 143 },
+ "p144": { "x" : 144 },
+ "p145": { "x" : 145 },
+ "p146": { "x" : 146 },
+ "p147": { "x" : 147 },
+ "p148": { "x" : 148 },
+ "p149": { "x" : 149 },
+ "p150": { "x" : 150 },
+ "p151": { "x" : 151 },
+ "p152": { "x" : 152 },
+ "p153": { "x" : 153 },
+ "p154": { "x" : 154 },
+ "p155": { "x" : 155 },
+ "p156": { "x" : 156 },
+ "p157": { "x" : 157 },
+ "p158": { "x" : 158 },
+ "p159": { "x" : 159 },
+ "p160": { "x" : 160 },
+ "p161": { "x" : 161 },
+ "p162": { "x" : 162 },
+ "p163": { "x" : 163 },
+ "p164": { "x" : 164 },
+ "p165": { "x" : 165 },
+ "p166": { "x" : 166 },
+ "p167": { "x" : 167 },
+ "p168": { "x" : 168 },
+ "p169": { "x" : 169 },
+ "p170": { "x" : 170 },
+ "p171": { "x" : 171 },
+ "p172": { "x" : 172 },
+ "p173": { "x" : 173 },
+ "p174": { "x" : 174 },
+ "p175": { "x" : 175 },
+ "p176": { "x" : 176 },
+ "p177": { "x" : 177 },
+ "p178": { "x" : 178 },
+ "p179": { "x" : 179 },
+ "p180": { "x" : 180 },
+ "p181": { "x" : 181 },
+ "p182": { "x" : 182 },
+ "p183": { "x" : 183 },
+ "p184": { "x" : 184 },
+ "p185": { "x" : 185 },
+ "p186": { "x" : 186 },
+ "p187": { "x" : 187 },
+ "p188": { "x" : 188 },
+ "p189": { "x" : 189 },
+ "p190": { "x" : 190 },
+ "p191": { "x" : 191 },
+ "p192": { "x" : 192 },
+ "p193": { "x" : 193 },
+ "p194": { "x" : 194 },
+ "p195": { "x" : 195 },
+ "p196": { "x" : 196 },
+ "p197": { "x" : 197 },
+ "p198": { "x" : 198 },
+ "p199": { "x" : 199 },
+ "p200": { "x" : 200 },
+ "p201": { "x" : 201 },
+ "p202": { "x" : 202 },
+ "p203": { "x" : 203 },
+ "p204": { "x" : 204 },
+ "p205": { "x" : 205 },
+ "p206": { "x" : 206 },
+ "p207": { "x" : 207 },
+ "p208": { "x" : 208 },
+ "p209": { "x" : 209 },
+ "p210": { "x" : 210 },
+ "p211": { "x" : 211 },
+ "p212": { "x" : 212 },
+ "p213": { "x" : 213 },
+ "p214": { "x" : 214 },
+ "p215": { "x" : 215 },
+ "p216": { "x" : 216 },
+ "p217": { "x" : 217 },
+ "p218": { "x" : 218 },
+ "p219": { "x" : 219 },
+ "p220": { "x" : 220 },
+ "p221": { "x" : 221 },
+ "p222": { "x" : 222 },
+ "p223": { "x" : 223 },
+ "p224": { "x" : 224 },
+ "p225": { "x" : 225 },
+ "p226": { "x" : 226 },
+ "p227": { "x" : 227 },
+ "p228": { "x" : 228 },
+ "p229": { "x" : 229 },
+ "p230": { "x" : 230 },
+ "p231": { "x" : 231 },
+ "p232": { "x" : 232 },
+ "p233": { "x" : 233 },
+ "p234": { "x" : 234 },
+ "p235": { "x" : 235 },
+ "p236": { "x" : 236 },
+ "p237": { "x" : 237 },
+ "p238": { "x" : 238 },
+ "p239": { "x" : 239 },
+ "p240": { "x" : 240 },
+ "p241": { "x" : 241 },
+ "p242": { "x" : 242 },
+ "p243": { "x" : 243 },
+ "p244": { "x" : 244 },
+ "p245": { "x" : 245 },
+ "p246": { "x" : 246 },
+ "p247": { "x" : 247 },
+ "p248": { "x" : 248 },
+ "p249": { "x" : 249 },
+ "p250": { "x" : 250 },
+ "p251": { "x" : 251 },
+ "p252": { "x" : 252 },
+ "p253": { "x" : 253 },
+ "p254": { "x" : 254 },
+ "p255": { "x" : 255 },
+ "p256": { "x" : 256 },
+ "p257": { "x" : 257 },
+ "p258": { "x" : 258 },
+ "p259": { "x" : 259 },
+ "p260": { "x" : 260 },
+ "p261": { "x" : 261 },
+ "p262": { "x" : 262 },
+ "p263": { "x" : 263 },
+ "p264": { "x" : 264 },
+ "p265": { "x" : 265 },
+ "p266": { "x" : 266 },
+ "p267": { "x" : 267 },
+ "p268": { "x" : 268 },
+ "p269": { "x" : 269 },
+ "p270": { "x" : 270 },
+ "p271": { "x" : 271 },
+ "p272": { "x" : 272 },
+ "p273": { "x" : 273 },
+ "p274": { "x" : 274 },
+ "p275": { "x" : 275 },
+ "p276": { "x" : 276 },
+ "p277": { "x" : 277 },
+ "p278": { "x" : 278 },
+ "p279": { "x" : 279 },
+ "p280": { "x" : 280 },
+ "p281": { "x" : 281 },
+ "p282": { "x" : 282 },
+ "p283": { "x" : 283 },
+ "p284": { "x" : 284 },
+ "p285": { "x" : 285 },
+ "p286": { "x" : 286 },
+ "p287": { "x" : 287 },
+ "p288": { "x" : 288 },
+ "p289": { "x" : 289 },
+ "p290": { "x" : 290 },
+ "p291": { "x" : 291 },
+ "p292": { "x" : 292 },
+ "p293": { "x" : 293 },
+ "p294": { "x" : 294 },
+ "p295": { "x" : 295 },
+ "p296": { "x" : 296 },
+ "p297": { "x" : 297 },
+ "p298": { "x" : 298 },
+ "p299": { "x" : 299 },
+ "p300": { "x" : 300 },
+ "p301": { "x" : 301 },
+ "p302": { "x" : 302 },
+ "p303": { "x" : 303 },
+ "p304": { "x" : 304 },
+ "p305": { "x" : 305 },
+ "p306": { "x" : 306 },
+ "p307": { "x" : 307 },
+ "p308": { "x" : 308 },
+ "p309": { "x" : 309 },
+ "p310": { "x" : 310 },
+ "p311": { "x" : 311 },
+ "p312": { "x" : 312 },
+ "p313": { "x" : 313 },
+ "p314": { "x" : 314 },
+ "p315": { "x" : 315 },
+ "p316": { "x" : 316 },
+ "p317": { "x" : 317 },
+ "p318": { "x" : 318 },
+ "p319": { "x" : 319 },
+ "p320": { "x" : 320 },
+ "p321": { "x" : 321 },
+ "p322": { "x" : 322 },
+ "p323": { "x" : 323 },
+ "p324": { "x" : 324 },
+ "p325": { "x" : 325 },
+ "p326": { "x" : 326 },
+ "p327": { "x" : 327 },
+ "p328": { "x" : 328 },
+ "p329": { "x" : 329 },
+ "p330": { "x" : 330 },
+ "p331": { "x" : 331 },
+ "p332": { "x" : 332 },
+ "p333": { "x" : 333 },
+ "p334": { "x" : 334 },
+ "p335": { "x" : 335 },
+ "p336": { "x" : 336 },
+ "p337": { "x" : 337 },
+ "p338": { "x" : 338 },
+ "p339": { "x" : 339 },
+ "p340": { "x" : 340 },
+ "p341": { "x" : 341 },
+ "p342": { "x" : 342 },
+ "p343": { "x" : 343 },
+ "p344": { "x" : 344 },
+ "p345": { "x" : 345 },
+ "p346": { "x" : 346 },
+ "p347": { "x" : 347 },
+ "p348": { "x" : 348 },
+ "p349": { "x" : 349 },
+ "p350": { "x" : 350 },
+ "p351": { "x" : 351 },
+ "p352": { "x" : 352 },
+ "p353": { "x" : 353 },
+ "p354": { "x" : 354 },
+ "p355": { "x" : 355 },
+ "p356": { "x" : 356 },
+ "p357": { "x" : 357 },
+ "p358": { "x" : 358 },
+ "p359": { "x" : 359 },
+ "p360": { "x" : 360 },
+ "p361": { "x" : 361 },
+ "p362": { "x" : 362 },
+ "p363": { "x" : 363 },
+ "p364": { "x" : 364 },
+ "p365": { "x" : 365 },
+ "p366": { "x" : 366 },
+ "p367": { "x" : 367 },
+ "p368": { "x" : 368 },
+ "p369": { "x" : 369 },
+ "p370": { "x" : 370 },
+ "p371": { "x" : 371 },
+ "p372": { "x" : 372 },
+ "p373": { "x" : 373 },
+ "p374": { "x" : 374 },
+ "p375": { "x" : 375 },
+ "p376": { "x" : 376 },
+ "p377": { "x" : 377 },
+ "p378": { "x" : 378 },
+ "p379": { "x" : 379 },
+ "p380": { "x" : 380 },
+ "p381": { "x" : 381 },
+ "p382": { "x" : 382 },
+ "p383": { "x" : 383 },
+ "p384": { "x" : 384 },
+ "p385": { "x" : 385 },
+ "p386": { "x" : 386 },
+ "p387": { "x" : 387 },
+ "p388": { "x" : 388 },
+ "p389": { "x" : 389 },
+ "p390": { "x" : 390 },
+ "p391": { "x" : 391 },
+ "p392": { "x" : 392 },
+ "p393": { "x" : 393 },
+ "p394": { "x" : 394 },
+ "p395": { "x" : 395 },
+ "p396": { "x" : 396 },
+ "p397": { "x" : 397 },
+ "p398": { "x" : 398 },
+ "p399": { "x" : 399 },
+ "p400": { "x" : 400 },
+ "p401": { "x" : 401 },
+ "p402": { "x" : 402 },
+ "p403": { "x" : 403 },
+ "p404": { "x" : 404 },
+ "p405": { "x" : 405 },
+ "p406": { "x" : 406 },
+ "p407": { "x" : 407 },
+ "p408": { "x" : 408 },
+ "p409": { "x" : 409 },
+ "p410": { "x" : 410 },
+ "p411": { "x" : 411 },
+ "p412": { "x" : 412 },
+ "p413": { "x" : 413 },
+ "p414": { "x" : 414 },
+ "p415": { "x" : 415 },
+ "p416": { "x" : 416 },
+ "p417": { "x" : 417 },
+ "p418": { "x" : 418 },
+ "p419": { "x" : 419 },
+ "p420": { "x" : 420 },
+ "p421": { "x" : 421 },
+ "p422": { "x" : 422 },
+ "p423": { "x" : 423 },
+ "p424": { "x" : 424 },
+ "p425": { "x" : 425 },
+ "p426": { "x" : 426 },
+ "p427": { "x" : 427 },
+ "p428": { "x" : 428 },
+ "p429": { "x" : 429 },
+ "p430": { "x" : 430 },
+ "p431": { "x" : 431 },
+ "p432": { "x" : 432 },
+ "p433": { "x" : 433 },
+ "p434": { "x" : 434 },
+ "p435": { "x" : 435 },
+ "p436": { "x" : 436 },
+ "p437": { "x" : 437 },
+ "p438": { "x" : 438 },
+ "p439": { "x" : 439 },
+ "p440": { "x" : 440 },
+ "p441": { "x" : 441 },
+ "p442": { "x" : 442 },
+ "p443": { "x" : 443 },
+ "p444": { "x" : 444 },
+ "p445": { "x" : 445 },
+ "p446": { "x" : 446 },
+ "p447": { "x" : 447 },
+ "p448": { "x" : 448 },
+ "p449": { "x" : 449 },
+ "p450": { "x" : 450 },
+ "p451": { "x" : 451 },
+ "p452": { "x" : 452 },
+ "p453": { "x" : 453 },
+ "p454": { "x" : 454 },
+ "p455": { "x" : 455 },
+ "p456": { "x" : 456 },
+ "p457": { "x" : 457 },
+ "p458": { "x" : 458 },
+ "p459": { "x" : 459 },
+ "p460": { "x" : 460 },
+ "p461": { "x" : 461 },
+ "p462": { "x" : 462 },
+ "p463": { "x" : 463 },
+ "p464": { "x" : 464 },
+ "p465": { "x" : 465 },
+ "p466": { "x" : 466 },
+ "p467": { "x" : 467 },
+ "p468": { "x" : 468 },
+ "p469": { "x" : 469 },
+ "p470": { "x" : 470 },
+ "p471": { "x" : 471 },
+ "p472": { "x" : 472 },
+ "p473": { "x" : 473 },
+ "p474": { "x" : 474 },
+ "p475": { "x" : 475 },
+ "p476": { "x" : 476 },
+ "p477": { "x" : 477 },
+ "p478": { "x" : 478 },
+ "p479": { "x" : 479 },
+ "p480": { "x" : 480 },
+ "p481": { "x" : 481 },
+ "p482": { "x" : 482 },
+ "p483": { "x" : 483 },
+ "p484": { "x" : 484 },
+ "p485": { "x" : 485 },
+ "p486": { "x" : 486 },
+ "p487": { "x" : 487 },
+ "p488": { "x" : 488 },
+ "p489": { "x" : 489 },
+ "p490": { "x" : 490 },
+ "p491": { "x" : 491 },
+ "p492": { "x" : 492 },
+ "p493": { "x" : 493 },
+ "p494": { "x" : 494 },
+ "p495": { "x" : 495 },
+ "p496": { "x" : 496 },
+ "p497": { "x" : 497 },
+ "p498": { "x" : 498 },
+ "p499": { "x" : 499 },
+ "p500": { "x" : 500 },
+ "p501": { "x" : 501 },
+ "p502": { "x" : 502 },
+ "p503": { "x" : 503 },
+ "p504": { "x" : 504 },
+ "p505": { "x" : 505 },
+ "p506": { "x" : 506 },
+ "p507": { "x" : 507 },
+ "p508": { "x" : 508 },
+ "p509": { "x" : 509 },
+ "p510": { "x" : 510 },
+ "p511": { "x" : 511 },
+ "p512": { "x" : 512 },
+ "p513": { "x" : 513 },
+ "p514": { "x" : 514 },
+ "p515": { "x" : 515 },
+ "p516": { "x" : 516 },
+ "p517": { "x" : 517 },
+ "p518": { "x" : 518 },
+ "p519": { "x" : 519 },
+ "p520": { "x" : 520 },
+ "p521": { "x" : 521 },
+ "p522": { "x" : 522 },
+ "p523": { "x" : 523 },
+ "p524": { "x" : 524 },
+ "p525": { "x" : 525 },
+ "p526": { "x" : 526 },
+ "p527": { "x" : 527 },
+ "p528": { "x" : 528 },
+ "p529": { "x" : 529 },
+ "p530": { "x" : 530 },
+ "p531": { "x" : 531 },
+ "p532": { "x" : 532 },
+ "p533": { "x" : 533 },
+ "p534": { "x" : 534 },
+ "p535": { "x" : 535 },
+ "p536": { "x" : 536 },
+ "p537": { "x" : 537 },
+ "p538": { "x" : 538 },
+ "p539": { "x" : 539 },
+ "p540": { "x" : 540 },
+ "p541": { "x" : 541 },
+ "p542": { "x" : 542 },
+ "p543": { "x" : 543 },
+ "p544": { "x" : 544 },
+ "p545": { "x" : 545 },
+ "p546": { "x" : 546 },
+ "p547": { "x" : 547 },
+ "p548": { "x" : 548 },
+ "p549": { "x" : 549 },
+ "p550": { "x" : 550 },
+ "p551": { "x" : 551 },
+ "p552": { "x" : 552 },
+ "p553": { "x" : 553 },
+ "p554": { "x" : 554 },
+ "p555": { "x" : 555 },
+ "p556": { "x" : 556 },
+ "p557": { "x" : 557 },
+ "p558": { "x" : 558 },
+ "p559": { "x" : 559 },
+ "p560": { "x" : 560 },
+ "p561": { "x" : 561 },
+ "p562": { "x" : 562 },
+ "p563": { "x" : 563 },
+ "p564": { "x" : 564 },
+ "p565": { "x" : 565 },
+ "p566": { "x" : 566 },
+ "p567": { "x" : 567 },
+ "p568": { "x" : 568 },
+ "p569": { "x" : 569 },
+ "p570": { "x" : 570 },
+ "p571": { "x" : 571 },
+ "p572": { "x" : 572 },
+ "p573": { "x" : 573 },
+ "p574": { "x" : 574 },
+ "p575": { "x" : 575 },
+ "p576": { "x" : 576 },
+ "p577": { "x" : 577 },
+ "p578": { "x" : 578 },
+ "p579": { "x" : 579 },
+ "p580": { "x" : 580 },
+ "p581": { "x" : 581 },
+ "p582": { "x" : 582 },
+ "p583": { "x" : 583 },
+ "p584": { "x" : 584 },
+ "p585": { "x" : 585 },
+ "p586": { "x" : 586 },
+ "p587": { "x" : 587 },
+ "p588": { "x" : 588 },
+ "p589": { "x" : 589 },
+ "p590": { "x" : 590 },
+ "p591": { "x" : 591 },
+ "p592": { "x" : 592 },
+ "p593": { "x" : 593 },
+ "p594": { "x" : 594 },
+ "p595": { "x" : 595 },
+ "p596": { "x" : 596 },
+ "p597": { "x" : 597 },
+ "p598": { "x" : 598 },
+ "p599": { "x" : 599 },
+ "p600": { "x" : 600 },
+ "p601": { "x" : 601 },
+ "p602": { "x" : 602 },
+ "p603": { "x" : 603 },
+ "p604": { "x" : 604 },
+ "p605": { "x" : 605 },
+ "p606": { "x" : 606 },
+ "p607": { "x" : 607 },
+ "p608": { "x" : 608 },
+ "p609": { "x" : 609 },
+ "p610": { "x" : 610 },
+ "p611": { "x" : 611 },
+ "p612": { "x" : 612 },
+ "p613": { "x" : 613 },
+ "p614": { "x" : 614 },
+ "p615": { "x" : 615 },
+ "p616": { "x" : 616 },
+ "p617": { "x" : 617 },
+ "p618": { "x" : 618 },
+ "p619": { "x" : 619 },
+ "p620": { "x" : 620 },
+ "p621": { "x" : 621 },
+ "p622": { "x" : 622 },
+ "p623": { "x" : 623 },
+ "p624": { "x" : 624 },
+ "p625": { "x" : 625 },
+ "p626": { "x" : 626 },
+ "p627": { "x" : 627 },
+ "p628": { "x" : 628 },
+ "p629": { "x" : 629 },
+ "p630": { "x" : 630 },
+ "p631": { "x" : 631 },
+ "p632": { "x" : 632 },
+ "p633": { "x" : 633 },
+ "p634": { "x" : 634 },
+ "p635": { "x" : 635 },
+ "p636": { "x" : 636 },
+ "p637": { "x" : 637 },
+ "p638": { "x" : 638 },
+ "p639": { "x" : 639 },
+ "p640": { "x" : 640 },
+ "p641": { "x" : 641 },
+ "p642": { "x" : 642 },
+ "p643": { "x" : 643 },
+ "p644": { "x" : 644 },
+ "p645": { "x" : 645 },
+ "p646": { "x" : 646 },
+ "p647": { "x" : 647 },
+ "p648": { "x" : 648 },
+ "p649": { "x" : 649 },
+ "p650": { "x" : 650 },
+ "p651": { "x" : 651 },
+ "p652": { "x" : 652 },
+ "p653": { "x" : 653 },
+ "p654": { "x" : 654 },
+ "p655": { "x" : 655 },
+ "p656": { "x" : 656 },
+ "p657": { "x" : 657 },
+ "p658": { "x" : 658 },
+ "p659": { "x" : 659 },
+ "p660": { "x" : 660 },
+ "p661": { "x" : 661 },
+ "p662": { "x" : 662 },
+ "p663": { "x" : 663 },
+ "p664": { "x" : 664 },
+ "p665": { "x" : 665 },
+ "p666": { "x" : 666 },
+ "p667": { "x" : 667 },
+ "p668": { "x" : 668 },
+ "p669": { "x" : 669 },
+ "p670": { "x" : 670 },
+ "p671": { "x" : 671 },
+ "p672": { "x" : 672 },
+ "p673": { "x" : 673 },
+ "p674": { "x" : 674 },
+ "p675": { "x" : 675 },
+ "p676": { "x" : 676 },
+ "p677": { "x" : 677 },
+ "p678": { "x" : 678 },
+ "p679": { "x" : 679 },
+ "p680": { "x" : 680 },
+ "p681": { "x" : 681 },
+ "p682": { "x" : 682 },
+ "p683": { "x" : 683 },
+ "p684": { "x" : 684 },
+ "p685": { "x" : 685 },
+ "p686": { "x" : 686 },
+ "p687": { "x" : 687 },
+ "p688": { "x" : 688 },
+ "p689": { "x" : 689 },
+ "p690": { "x" : 690 },
+ "p691": { "x" : 691 },
+ "p692": { "x" : 692 },
+ "p693": { "x" : 693 },
+ "p694": { "x" : 694 },
+ "p695": { "x" : 695 },
+ "p696": { "x" : 696 },
+ "p697": { "x" : 697 },
+ "p698": { "x" : 698 },
+ "p699": { "x" : 699 },
+ "p700": { "x" : 700 },
+ "p701": { "x" : 701 },
+ "p702": { "x" : 702 },
+ "p703": { "x" : 703 },
+ "p704": { "x" : 704 },
+ "p705": { "x" : 705 },
+ "p706": { "x" : 706 },
+ "p707": { "x" : 707 },
+ "p708": { "x" : 708 },
+ "p709": { "x" : 709 },
+ "p710": { "x" : 710 },
+ "p711": { "x" : 711 },
+ "p712": { "x" : 712 },
+ "p713": { "x" : 713 },
+ "p714": { "x" : 714 },
+ "p715": { "x" : 715 },
+ "p716": { "x" : 716 },
+ "p717": { "x" : 717 },
+ "p718": { "x" : 718 },
+ "p719": { "x" : 719 },
+ "p720": { "x" : 720 },
+ "p721": { "x" : 721 },
+ "p722": { "x" : 722 },
+ "p723": { "x" : 723 },
+ "p724": { "x" : 724 },
+ "p725": { "x" : 725 },
+ "p726": { "x" : 726 },
+ "p727": { "x" : 727 },
+ "p728": { "x" : 728 },
+ "p729": { "x" : 729 },
+ "p730": { "x" : 730 },
+ "p731": { "x" : 731 },
+ "p732": { "x" : 732 },
+ "p733": { "x" : 733 },
+ "p734": { "x" : 734 },
+ "p735": { "x" : 735 },
+ "p736": { "x" : 736 },
+ "p737": { "x" : 737 },
+ "p738": { "x" : 738 },
+ "p739": { "x" : 739 },
+ "p740": { "x" : 740 },
+ "p741": { "x" : 741 },
+ "p742": { "x" : 742 },
+ "p743": { "x" : 743 },
+ "p744": { "x" : 744 },
+ "p745": { "x" : 745 },
+ "p746": { "x" : 746 },
+ "p747": { "x" : 747 },
+ "p748": { "x" : 748 },
+ "p749": { "x" : 749 },
+ "p750": { "x" : 750 },
+ "p751": { "x" : 751 },
+ "p752": { "x" : 752 },
+ "p753": { "x" : 753 },
+ "p754": { "x" : 754 },
+ "p755": { "x" : 755 },
+ "p756": { "x" : 756 },
+ "p757": { "x" : 757 },
+ "p758": { "x" : 758 },
+ "p759": { "x" : 759 },
+ "p760": { "x" : 760 },
+ "p761": { "x" : 761 },
+ "p762": { "x" : 762 },
+ "p763": { "x" : 763 },
+ "p764": { "x" : 764 },
+ "p765": { "x" : 765 },
+ "p766": { "x" : 766 },
+ "p767": { "x" : 767 },
+ "p768": { "x" : 768 },
+ "p769": { "x" : 769 },
+ "p770": { "x" : 770 },
+ "p771": { "x" : 771 },
+ "p772": { "x" : 772 },
+ "p773": { "x" : 773 },
+ "p774": { "x" : 774 },
+ "p775": { "x" : 775 },
+ "p776": { "x" : 776 },
+ "p777": { "x" : 777 },
+ "p778": { "x" : 778 },
+ "p779": { "x" : 779 },
+ "p780": { "x" : 780 },
+ "p781": { "x" : 781 },
+ "p782": { "x" : 782 },
+ "p783": { "x" : 783 },
+ "p784": { "x" : 784 },
+ "p785": { "x" : 785 },
+ "p786": { "x" : 786 },
+ "p787": { "x" : 787 },
+ "p788": { "x" : 788 },
+ "p789": { "x" : 789 },
+ "p790": { "x" : 790 },
+ "p791": { "x" : 791 },
+ "p792": { "x" : 792 },
+ "p793": { "x" : 793 },
+ "p794": { "x" : 794 },
+ "p795": { "x" : 795 },
+ "p796": { "x" : 796 },
+ "p797": { "x" : 797 },
+ "p798": { "x" : 798 },
+ "p799": { "x" : 799 },
+ "p800": { "x" : 800 },
+ "p801": { "x" : 801 },
+ "p802": { "x" : 802 },
+ "p803": { "x" : 803 },
+ "p804": { "x" : 804 },
+ "p805": { "x" : 805 },
+ "p806": { "x" : 806 },
+ "p807": { "x" : 807 },
+ "p808": { "x" : 808 },
+ "p809": { "x" : 809 },
+ "p810": { "x" : 810 },
+ "p811": { "x" : 811 },
+ "p812": { "x" : 812 },
+ "p813": { "x" : 813 },
+ "p814": { "x" : 814 },
+ "p815": { "x" : 815 },
+ "p816": { "x" : 816 },
+ "p817": { "x" : 817 },
+ "p818": { "x" : 818 },
+ "p819": { "x" : 819 },
+ "p820": { "x" : 820 },
+ "p821": { "x" : 821 },
+ "p822": { "x" : 822 },
+ "p823": { "x" : 823 },
+ "p824": { "x" : 824 },
+ "p825": { "x" : 825 },
+ "p826": { "x" : 826 },
+ "p827": { "x" : 827 },
+ "p828": { "x" : 828 },
+ "p829": { "x" : 829 },
+ "p830": { "x" : 830 },
+ "p831": { "x" : 831 },
+ "p832": { "x" : 832 },
+ "p833": { "x" : 833 },
+ "p834": { "x" : 834 },
+ "p835": { "x" : 835 },
+ "p836": { "x" : 836 },
+ "p837": { "x" : 837 },
+ "p838": { "x" : 838 },
+ "p839": { "x" : 839 },
+ "p840": { "x" : 840 },
+ "p841": { "x" : 841 },
+ "p842": { "x" : 842 },
+ "p843": { "x" : 843 },
+ "p844": { "x" : 844 },
+ "p845": { "x" : 845 },
+ "p846": { "x" : 846 },
+ "p847": { "x" : 847 },
+ "p848": { "x" : 848 },
+ "p849": { "x" : 849 },
+ "p850": { "x" : 850 },
+ "p851": { "x" : 851 },
+ "p852": { "x" : 852 },
+ "p853": { "x" : 853 },
+ "p854": { "x" : 854 },
+ "p855": { "x" : 855 },
+ "p856": { "x" : 856 },
+ "p857": { "x" : 857 },
+ "p858": { "x" : 858 },
+ "p859": { "x" : 859 },
+ "p860": { "x" : 860 },
+ "p861": { "x" : 861 },
+ "p862": { "x" : 862 },
+ "p863": { "x" : 863 },
+ "p864": { "x" : 864 },
+ "p865": { "x" : 865 },
+ "p866": { "x" : 866 },
+ "p867": { "x" : 867 },
+ "p868": { "x" : 868 },
+ "p869": { "x" : 869 },
+ "p870": { "x" : 870 },
+ "p871": { "x" : 871 },
+ "p872": { "x" : 872 },
+ "p873": { "x" : 873 },
+ "p874": { "x" : 874 },
+ "p875": { "x" : 875 },
+ "p876": { "x" : 876 },
+ "p877": { "x" : 877 },
+ "p878": { "x" : 878 },
+ "p879": { "x" : 879 },
+ "p880": { "x" : 880 },
+ "p881": { "x" : 881 },
+ "p882": { "x" : 882 },
+ "p883": { "x" : 883 },
+ "p884": { "x" : 884 },
+ "p885": { "x" : 885 },
+ "p886": { "x" : 886 },
+ "p887": { "x" : 887 },
+ "p888": { "x" : 888 },
+ "p889": { "x" : 889 },
+ "p890": { "x" : 890 },
+ "p891": { "x" : 891 },
+ "p892": { "x" : 892 },
+ "p893": { "x" : 893 },
+ "p894": { "x" : 894 },
+ "p895": { "x" : 895 },
+ "p896": { "x" : 896 },
+ "p897": { "x" : 897 },
+ "p898": { "x" : 898 },
+ "p899": { "x" : 899 },
+ "p900": { "x" : 900 },
+ "p901": { "x" : 901 },
+ "p902": { "x" : 902 },
+ "p903": { "x" : 903 },
+ "p904": { "x" : 904 },
+ "p905": { "x" : 905 },
+ "p906": { "x" : 906 },
+ "p907": { "x" : 907 },
+ "p908": { "x" : 908 },
+ "p909": { "x" : 909 },
+ "p910": { "x" : 910 },
+ "p911": { "x" : 911 },
+ "p912": { "x" : 912 },
+ "p913": { "x" : 913 },
+ "p914": { "x" : 914 },
+ "p915": { "x" : 915 },
+ "p916": { "x" : 916 },
+ "p917": { "x" : 917 },
+ "p918": { "x" : 918 },
+ "p919": { "x" : 919 },
+ "p920": { "x" : 920 },
+ "p921": { "x" : 921 },
+ "p922": { "x" : 922 },
+ "p923": { "x" : 923 },
+ "p924": { "x" : 924 },
+ "p925": { "x" : 925 },
+ "p926": { "x" : 926 },
+ "p927": { "x" : 927 },
+ "p928": { "x" : 928 },
+ "p929": { "x" : 929 },
+ "p930": { "x" : 930 },
+ "p931": { "x" : 931 },
+ "p932": { "x" : 932 },
+ "p933": { "x" : 933 },
+ "p934": { "x" : 934 },
+ "p935": { "x" : 935 },
+ "p936": { "x" : 936 },
+ "p937": { "x" : 937 },
+ "p938": { "x" : 938 },
+ "p939": { "x" : 939 },
+ "p940": { "x" : 940 },
+ "p941": { "x" : 941 },
+ "p942": { "x" : 942 },
+ "p943": { "x" : 943 },
+ "p944": { "x" : 944 },
+ "p945": { "x" : 945 },
+ "p946": { "x" : 946 },
+ "p947": { "x" : 947 },
+ "p948": { "x" : 948 },
+ "p949": { "x" : 949 },
+ "p950": { "x" : 950 },
+ "p951": { "x" : 951 },
+ "p952": { "x" : 952 },
+ "p953": { "x" : 953 },
+ "p954": { "x" : 954 },
+ "p955": { "x" : 955 },
+ "p956": { "x" : 956 },
+ "p957": { "x" : 957 },
+ "p958": { "x" : 958 },
+ "p959": { "x" : 959 },
+ "p960": { "x" : 960 },
+ "p961": { "x" : 961 },
+ "p962": { "x" : 962 },
+ "p963": { "x" : 963 },
+ "p964": { "x" : 964 },
+ "p965": { "x" : 965 },
+ "p966": { "x" : 966 },
+ "p967": { "x" : 967 },
+ "p968": { "x" : 968 },
+ "p969": { "x" : 969 },
+ "p970": { "x" : 970 },
+ "p971": { "x" : 971 },
+ "p972": { "x" : 972 },
+ "p973": { "x" : 973 },
+ "p974": { "x" : 974 },
+ "p975": { "x" : 975 },
+ "p976": { "x" : 976 },
+ "p977": { "x" : 977 },
+ "p978": { "x" : 978 },
+ "p979": { "x" : 979 },
+ "p980": { "x" : 980 },
+ "p981": { "x" : 981 },
+ "p982": { "x" : 982 },
+ "p983": { "x" : 983 },
+ "p984": { "x" : 984 },
+ "p985": { "x" : 985 },
+ "p986": { "x" : 986 },
+ "p987": { "x" : 987 },
+ "p988": { "x" : 988 },
+ "p989": { "x" : 989 },
+ "p990": { "x" : 990 },
+ "p991": { "x" : 991 },
+ "p992": { "x" : 992 },
+ "p993": { "x" : 993 },
+ "p994": { "x" : 994 },
+ "p995": { "x" : 995 },
+ "p996": { "x" : 996 },
+ "p997": { "x" : 997 },
+ "p998": { "x" : 998 },
+ "p999": { "x" : 999 }
+};
+
+for (var i = 0; i < 1000; i++) {
+ var value = obj["p" + i];
+ Assert.assertTrue(typeof value === "object");
+ Assert.assertTrue(value.x === i);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8074556.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, 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-8074556: Functions should not share allocator maps
+ *
+ * @test
+ * @run
+ */
+
+function A () {
+ return this;
+}
+
+function B() {
+ return this;
+}
+
+A.prototype.x = "x";
+A.prototype.y = "y";
+B.prototype.y = "y"; // same properties but different order
+B.prototype.x = "x";
+
+function test(o) {
+ Assert.assertEquals(o.x, "x");
+ Assert.assertEquals(o.y, "y");
+}
+
+test(new A());
+test(new B());
+test(new A());
+test(new B());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8074687.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, 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-8074687: Add tests for JSON parsing of numeric keys
+ *
+ * @test
+ * @run
+ */
+
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {} }')), '{"0":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1 }')), '{"0":1}');
+
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": {} }')), '{"65503":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": 1 }')), '{"65503":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "65503": {} }')), '{"0":{},"65503":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "65503": 1 }')), '{"0":1,"65503":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": {}, "0": {} }')), '{"0":{},"65503":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": 1, "0": 1 }')), '{"0":1,"65503":1}');
+
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": {} }')), '{"4294967295":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": 1 }')), '{"4294967295":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "4294967295": {} }')), '{"0":{},"4294967295":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "4294967295": 1 }')), '{"0":1,"4294967295":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": {}, "0": {} }')), '{"0":{},"4294967295":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": 1, "0": 1 }')), '{"0":1,"4294967295":1}');
+
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": {} }')), '{"100":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": 1 }')), '{"100":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "100": {} }')), '{"0":{},"100":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "100": 1 }')), '{"0":1,"100":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": {}, "0": {} }')), '{"0":{},"100":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": 1, "0": 1 }')), '{"0":1,"100":1}');
+
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": {} }')), '{"-100":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": 1 }')), '{"-100":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "-100": {} }')), '{"0":{},"-100":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "-100": 1 }')), '{"0":1,"-100":1}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": {}, "0": {} }')), '{"0":{},"-100":{}}');
+Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": 1, "0": 1 }')), '{"0":1,"-100":1}');
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8074693.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2015, 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-8074693: Different instances of same function use same allocator map
+ *
+ * @test
+ * @run
+ */
+
+var lib = {};
+
+lib.mixin = function(target, source) {
+ for (var p in source) {
+ if (source.hasOwnProperty(p) && !target.hasOwnProperty(p)) {
+ target.prototype[p] = source[p];
+ }
+ }
+};
+
+lib.declare = function(def) {
+ var className = def.name;
+
+ lib[className] = function() {
+ this.init.apply(this, arguments);
+ };
+
+ lib.mixin(lib[className], def.members);
+};
+
+
+lib.declare({
+ name: "ClassA",
+ members: {
+ init : function () {
+ print("init A called");
+ }
+ }
+});
+
+lib.declare({
+ name: "ClassB",
+ members: {
+ util : function () {
+ print("util called")
+ },
+ init : function() {
+ print("init B called");
+ }
+ }
+});
+
+var objA = new lib.ClassA();
+var objB = new lib.ClassB();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8074693.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,2 @@
+init A called
+init B called
--- a/nashorn/test/script/basic/parser/tryCatchStat.js.EXPECTED Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/test/script/basic/parser/tryCatchStat.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -1,32 +1,70 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "TryStatement",
+ "block": {
+ "type": "BlockStatement",
+ "body": []
+ },
+ "guardedHandlers": [],
+ "handler": {
+ "type": "CatchClause",
+ "param": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": []
+ }
+ },
+ "finalizer": null
+ }
+ ]
+}
{
"type": "Program",
"body": [
{
- "type": "BlockStatement",
+ "type": "TryStatement",
"block": {
"type": "BlockStatement",
- "body": [
- {
- "type": "TryStatement",
- "block": {
- "type": "BlockStatement",
- "body": []
- },
- "guardedHandlers": [],
- "handler": {
- "type": "CatchClause",
- "param": {
- "type": "Identifier",
- "name": "e"
- },
- "body": {
- "type": "BlockStatement",
- "body": []
- }
- },
- "finalizer": null
- }
- ]
+ "body": []
+ },
+ "guardedHandlers": [],
+ "handler": {
+ "type": "CatchClause",
+ "param": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": []
+ }
+ },
+ "finalizer": {
+ "type": "BlockStatement",
+ "body": []
+ }
+ }
+ ]
+}
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "TryStatement",
+ "block": {
+ "type": "BlockStatement",
+ "body": []
+ },
+ "guardedHandlers": [],
+ "handler": null,
+ "finalizer": {
+ "type": "BlockStatement",
+ "body": []
}
}
]
@@ -35,35 +73,36 @@
"type": "Program",
"body": [
{
- "type": "BlockStatement",
+ "type": "TryStatement",
"block": {
"type": "BlockStatement",
- "body": [
- {
- "type": "TryStatement",
- "block": {
- "type": "BlockStatement",
- "body": []
- },
- "guardedHandlers": [],
- "handler": {
- "type": "CatchClause",
- "param": {
- "type": "Identifier",
- "name": "e"
- },
- "body": {
- "type": "BlockStatement",
- "body": []
+ "body": []
+ },
+ "guardedHandlers": [],
+ "handler": {
+ "type": "CatchClause",
+ "param": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "handle"
+ },
+ "arguments": []
}
- },
- "finalizer": {
- "type": "BlockStatement",
- "body": []
}
- }
- ]
- }
+ ]
+ }
+ },
+ "finalizer": null
}
]
}
@@ -71,21 +110,59 @@
"type": "Program",
"body": [
{
- "type": "BlockStatement",
+ "type": "TryStatement",
"block": {
"type": "BlockStatement",
"body": [
{
- "type": "TryStatement",
- "block": {
- "type": "BlockStatement",
- "body": []
- },
- "guardedHandlers": [],
- "handler": null,
- "finalizer": {
- "type": "BlockStatement",
- "body": []
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "that"
+ },
+ "arguments": []
+ }
+ }
+ ]
+ },
+ "guardedHandlers": [],
+ "handler": {
+ "type": "CatchClause",
+ "param": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "handle"
+ },
+ "arguments": []
+ }
+ }
+ ]
+ }
+ },
+ "finalizer": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "clean"
+ },
+ "arguments": []
}
}
]
@@ -97,209 +174,84 @@
"type": "Program",
"body": [
{
- "type": "BlockStatement",
- "block": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "TryStatement",
- "block": {
- "type": "BlockStatement",
- "body": []
- },
- "guardedHandlers": [],
- "handler": {
- "type": "CatchClause",
- "param": {
- "type": "Identifier",
- "name": "e"
- },
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "handle"
- },
- "arguments": []
- }
- }
- ]
- }
- },
- "finalizer": null
- }
- ]
- }
- }
- ]
-}
-{
- "type": "Program",
- "body": [
- {
- "type": "BlockStatement",
+ "type": "TryStatement",
"block": {
"type": "BlockStatement",
"body": [
{
- "type": "TryStatement",
- "block": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "that"
- },
- "arguments": []
- }
- }
- ]
- },
- "guardedHandlers": [],
- "handler": {
- "type": "CatchClause",
- "param": {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
"type": "Identifier",
- "name": "e"
+ "name": "that"
},
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "handle"
- },
- "arguments": []
- }
- }
- ]
- }
- },
- "finalizer": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "clean"
- },
- "arguments": []
- }
- }
- ]
+ "arguments": []
}
}
]
- }
+ },
+ "guardedHandlers": [
+ {
+ "type": "CatchClause",
+ "param": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "guard": {
+ "type": "BinaryExpression",
+ "operator": "instanceof",
+ "left": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "right": {
+ "type": "Identifier",
+ "name": "TypeError"
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "handle"
+ },
+ "arguments": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "handler": {
+ "type": "CatchClause",
+ "param": {
+ "type": "Identifier",
+ "name": "e"
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "rest"
+ },
+ "arguments": []
+ }
+ }
+ ]
+ }
+ },
+ "finalizer": null
}
]
}
-{
- "type": "Program",
- "body": [
- {
- "type": "BlockStatement",
- "block": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "TryStatement",
- "block": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "that"
- },
- "arguments": []
- }
- }
- ]
- },
- "guardedHandlers": [
- {
- "type": "CatchClause",
- "param": {
- "type": "Identifier",
- "name": "e"
- },
- "guard": {
- "type": "BinaryExpression",
- "operator": "instanceof",
- "left": {
- "type": "Identifier",
- "name": "e"
- },
- "right": {
- "type": "Identifier",
- "name": "TypeError"
- }
- },
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "handle"
- },
- "arguments": []
- }
- }
- ]
- }
- }
- ],
- "handler": {
- "type": "CatchClause",
- "param": {
- "type": "Identifier",
- "name": "e"
- },
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "rest"
- },
- "arguments": []
- }
- }
- ]
- }
- },
- "finalizer": null
- }
- ]
- }
- }
- ]
-}
--- a/nashorn/test/script/basic/parser/util.js Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/test/script/basic/parser/util.js Tue Mar 17 12:30:53 2015 -0700
@@ -25,7 +25,7 @@
* @subtest
*/
-// utilitity for parser tests
+// utility for parser tests
load("nashorn:parser.js");
function printParse(code) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API usage.
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+function Parser() {
+ // create nashorn parser
+ this._parser = Parser.create();
+}
+
+// Java types used
+Parser.Diagnostic = Java.type("jdk.nashorn.api.tree.Diagnostic");
+Parser.SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+Parser.Tree = Java.type("jdk.nashorn.api.tree.Tree");
+Parser.List = Java.type("java.util.List");
+Parser.Enum = Java.type("java.lang.Enum");
+
+// function to parse the script and return script friendly object
+Parser.prototype.parse = function(name, script, listener) {
+ var tree = this._parser.parse(name, script, listener);
+ tree.accept(new Parser.SimpleTreeVisitor(), null);
+ return this.convert(tree);
+}
+
+Parser.create = function() {
+ return Java.type("jdk.nashorn.api.tree.Parser").create();
+}
+
+// convert Nashorn parser Tree, Diagnostic as a script friendly object
+Parser.prototype.convert = function(tree) {
+ if (!tree || typeof tree != 'object') {
+ return tree;
+ }
+
+ var obj = Object.bindProperties({}, tree);
+ var result = {};
+ for (var i in obj) {
+ var val = obj[i];
+ if (val instanceof Parser.Tree) {
+ result[i] = this.convert(val);
+ } else if (val instanceof Parser.List) {
+ var arr = new Array(val.size());
+ for (var j in val) {
+ arr[j] = this.convert(val[j]);
+ }
+
+ result[i] = arr;
+ } else {
+ switch (typeof val) {
+ case 'number':
+ case 'string':
+ case 'boolean':
+ result[i] = String(val);
+ default:
+ if (val instanceof Parser.Enum) {
+ result[i] = String(val);
+ }
+ }
+ }
+ }
+ return result;
+}
+
+function processFiles(subdir) {
+ var File = Java.type("java.io.File");
+ var files = new File(__DIR__ + subdir).listFiles();
+ java.util.Arrays.sort(files);
+ for each (var file in files) {
+ if (file.name.endsWith(".js")) {
+ var script = readFully(file);
+ var parser = new Parser();
+ var tree = parser.parse(subdir + "/" + file.name, script,
+ function(diagnostic) {
+ print(JSON.stringify(parser.convert(diagnostic), null, 2));
+ print(",");
+ });
+
+ if (tree != null) {
+ print(JSON.stringify(tree, null, 2));
+ print(",");
+ }
+ }
+ }
+}
+
+// parse files in parsertests directory
+function main() {
+ print("[");
+
+ processFiles("parsertests");
+ processFiles("parsernegativetests");
+
+ // parse this file first!
+ var script = readFully(__FILE__);
+ var tree = new Parser().parse("parserapi.js", script, null);
+ print(JSON.stringify(tree, null, 2));
+ print("]");
+}
+
+main();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,7015 @@
+[
+{
+ "endPosition": "1113",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1123",
+ "kind": "VARIABLE",
+ "name": "x",
+ "startPosition": "1117",
+ "initializer": {
+ "endPosition": "1123",
+ "kind": "ARRAY_LITERAL",
+ "elements": [],
+ "startPosition": "1121"
+ }
+ },
+ {
+ "endPosition": "1147",
+ "kind": "VARIABLE",
+ "name": "y",
+ "startPosition": "1129",
+ "initializer": {
+ "endPosition": "1147",
+ "kind": "ARRAY_LITERAL",
+ "elements": [
+ {
+ "endPosition": "1135",
+ "kind": "NUMBER_LITERAL",
+ "value": "1",
+ "startPosition": "1134"
+ },
+ {
+ "endPosition": "1139",
+ "kind": "NUMBER_LITERAL",
+ "value": "43",
+ "startPosition": "1137"
+ },
+ {
+ "endPosition": "1142",
+ "kind": "NUMBER_LITERAL",
+ "value": "5",
+ "startPosition": "1141"
+ },
+ {
+ "endPosition": "1146",
+ "kind": "NUMBER_LITERAL",
+ "value": "45",
+ "startPosition": "1144"
+ }
+ ],
+ "startPosition": "1133"
+ }
+ },
+ {
+ "endPosition": "1165",
+ "kind": "VARIABLE",
+ "name": "z",
+ "startPosition": "1153",
+ "initializer": {
+ "endPosition": "1165",
+ "kind": "ARRAY_LITERAL",
+ "elements": [
+ {
+ "endPosition": "1160",
+ "kind": "NUMBER_LITERAL",
+ "value": "34",
+ "startPosition": "1158"
+ },
+ null,
+ null,
+ {
+ "endPosition": "1164",
+ "kind": "NUMBER_LITERAL",
+ "value": "4",
+ "startPosition": "1163"
+ }
+ ],
+ "startPosition": "1157"
+ }
+ },
+ {
+ "endPosition": "1200",
+ "kind": "VARIABLE",
+ "name": "k",
+ "startPosition": "1171",
+ "initializer": {
+ "endPosition": "1200",
+ "kind": "ARRAY_LITERAL",
+ "elements": [
+ {
+ "endPosition": "1179",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1177",
+ "properties": []
+ },
+ {
+ "endPosition": "1189",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1181",
+ "properties": [
+ {
+ "endPosition": "1185",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1187",
+ "kind": "NUMBER_LITERAL",
+ "value": "3",
+ "startPosition": "1186"
+ },
+ "startPosition": "1183",
+ "key": {
+ "endPosition": "1184",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1183"
+ }
+ }
+ ]
+ },
+ {
+ "endPosition": "1197",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1192"
+ }
+ ],
+ "startPosition": "1175"
+ }
+ }
+ ],
+ "sourceName": "parsertests/array_literal.js",
+ "strict": "false",
+ "startPosition": "1113"
+}
+,
+{
+ "endPosition": "1126",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1135",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1132"
+ },
+ "endPosition": "1135",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1129",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1126"
+ },
+ "startPosition": "1126"
+ },
+ "endPosition": "1135",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1126"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1147",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1144"
+ },
+ "endPosition": "1147",
+ "kind": "PLUS_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1140",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1137"
+ },
+ "startPosition": "1137"
+ },
+ "endPosition": "1147",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1137"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1159",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1156"
+ },
+ "endPosition": "1159",
+ "kind": "MINUS_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1152",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1149"
+ },
+ "startPosition": "1149"
+ },
+ "endPosition": "1159",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1149"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1171",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1168"
+ },
+ "endPosition": "1171",
+ "kind": "MULTIPLY_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1164",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1161"
+ },
+ "startPosition": "1161"
+ },
+ "endPosition": "1171",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1161"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1183",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1180"
+ },
+ "endPosition": "1183",
+ "kind": "DIVIDE_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1176",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1173"
+ },
+ "startPosition": "1173"
+ },
+ "endPosition": "1183",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1173"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1195",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1192"
+ },
+ "endPosition": "1195",
+ "kind": "REMAINDER_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1188",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1185"
+ },
+ "startPosition": "1185"
+ },
+ "endPosition": "1195",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1185"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1208",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1205"
+ },
+ "endPosition": "1208",
+ "kind": "LEFT_SHIFT_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1200",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1197"
+ },
+ "startPosition": "1197"
+ },
+ "endPosition": "1208",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1197"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1221",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1218"
+ },
+ "endPosition": "1221",
+ "kind": "RIGHT_SHIFT_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1213",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1210"
+ },
+ "startPosition": "1210"
+ },
+ "endPosition": "1221",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1210"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1235",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1232"
+ },
+ "endPosition": "1235",
+ "kind": "UNSIGNED_RIGHT_SHIFT_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1226",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1223"
+ },
+ "startPosition": "1223"
+ },
+ "endPosition": "1235",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1223"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1247",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1244"
+ },
+ "endPosition": "1247",
+ "kind": "AND_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1240",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1237"
+ },
+ "startPosition": "1237"
+ },
+ "endPosition": "1247",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1237"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1259",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1256"
+ },
+ "endPosition": "1259",
+ "kind": "XOR_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1252",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1249"
+ },
+ "startPosition": "1249"
+ },
+ "endPosition": "1259",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1249"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1271",
+ "kind": "NUMBER_LITERAL",
+ "value": "314",
+ "startPosition": "1268"
+ },
+ "endPosition": "1271",
+ "kind": "OR_ASSIGNMENT",
+ "variable": {
+ "endPosition": "1264",
+ "kind": "IDENTIFIER",
+ "name": "xyz",
+ "startPosition": "1261"
+ },
+ "startPosition": "1261"
+ },
+ "endPosition": "1271",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1261"
+ }
+ ],
+ "sourceName": "parsertests/assignmentExpr.js",
+ "strict": "false",
+ "startPosition": "1126"
+}
+,
+{
+ "endPosition": "1116",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1117",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1116"
+ },
+ "endPosition": "1121",
+ "kind": "MULTIPLY",
+ "rightOperand": {
+ "endPosition": "1121",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1120"
+ },
+ "startPosition": "1116"
+ },
+ "endPosition": "1121",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1116"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1123",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1122"
+ },
+ "endPosition": "1127",
+ "kind": "DIVIDE",
+ "rightOperand": {
+ "endPosition": "1127",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1126"
+ },
+ "startPosition": "1122"
+ },
+ "endPosition": "1127",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1122"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1130",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1129"
+ },
+ "endPosition": "1134",
+ "kind": "REMAINDER",
+ "rightOperand": {
+ "endPosition": "1134",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1133"
+ },
+ "startPosition": "1129"
+ },
+ "endPosition": "1134",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1129"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1137",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1136"
+ },
+ "endPosition": "1141",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "1141",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1140"
+ },
+ "startPosition": "1136"
+ },
+ "endPosition": "1141",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1136"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1144",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1143"
+ },
+ "endPosition": "1148",
+ "kind": "MINUS",
+ "rightOperand": {
+ "endPosition": "1148",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1147"
+ },
+ "startPosition": "1143"
+ },
+ "endPosition": "1148",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1143"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1151",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1150"
+ },
+ "endPosition": "1156",
+ "kind": "LEFT_SHIFT",
+ "rightOperand": {
+ "endPosition": "1156",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1155"
+ },
+ "startPosition": "1150"
+ },
+ "endPosition": "1156",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1150"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1159",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1158"
+ },
+ "endPosition": "1164",
+ "kind": "RIGHT_SHIFT",
+ "rightOperand": {
+ "endPosition": "1164",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1163"
+ },
+ "startPosition": "1158"
+ },
+ "endPosition": "1164",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1158"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1167",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1166"
+ },
+ "endPosition": "1173",
+ "kind": "UNSIGNED_RIGHT_SHIFT",
+ "rightOperand": {
+ "endPosition": "1173",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1172"
+ },
+ "startPosition": "1166"
+ },
+ "endPosition": "1173",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1166"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1176",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1175"
+ },
+ "endPosition": "1180",
+ "kind": "LESS_THAN",
+ "rightOperand": {
+ "endPosition": "1180",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1179"
+ },
+ "startPosition": "1175"
+ },
+ "endPosition": "1180",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1175"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1183",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1182"
+ },
+ "endPosition": "1187",
+ "kind": "GREATER_THAN",
+ "rightOperand": {
+ "endPosition": "1187",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1186"
+ },
+ "startPosition": "1182"
+ },
+ "endPosition": "1187",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1182"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1190",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1189"
+ },
+ "endPosition": "1195",
+ "kind": "LESS_THAN_EQUAL",
+ "rightOperand": {
+ "endPosition": "1195",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1194"
+ },
+ "startPosition": "1189"
+ },
+ "endPosition": "1195",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1189"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1198",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1197"
+ },
+ "endPosition": "1203",
+ "kind": "GREATER_THAN_EQUAL",
+ "rightOperand": {
+ "endPosition": "1203",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1202"
+ },
+ "startPosition": "1197"
+ },
+ "endPosition": "1203",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1197"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1206",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1205"
+ },
+ "expression": {
+ "endPosition": "1206",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1205"
+ },
+ "endPosition": "1219",
+ "kind": "INSTANCE_OF",
+ "rightOperand": {
+ "endPosition": "1219",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1218"
+ },
+ "type": {
+ "endPosition": "1219",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1218"
+ },
+ "startPosition": "1205"
+ },
+ "endPosition": "1219",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1205"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1222",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1221"
+ },
+ "endPosition": "1227",
+ "kind": "EQUAL_TO",
+ "rightOperand": {
+ "endPosition": "1227",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1226"
+ },
+ "startPosition": "1221"
+ },
+ "endPosition": "1227",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1221"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1230",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1229"
+ },
+ "endPosition": "1235",
+ "kind": "NOT_EQUAL_TO",
+ "rightOperand": {
+ "endPosition": "1235",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1234"
+ },
+ "startPosition": "1229"
+ },
+ "endPosition": "1235",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1229"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1238",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1237"
+ },
+ "endPosition": "1244",
+ "kind": "STRICT_EQUAL_TO",
+ "rightOperand": {
+ "endPosition": "1244",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1243"
+ },
+ "startPosition": "1237"
+ },
+ "endPosition": "1244",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1237"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1247",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1246"
+ },
+ "endPosition": "1253",
+ "kind": "STRICT_NOT_EQUAL_TO",
+ "rightOperand": {
+ "endPosition": "1253",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1252"
+ },
+ "startPosition": "1246"
+ },
+ "endPosition": "1253",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1246"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1256",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1255"
+ },
+ "endPosition": "1260",
+ "kind": "AND",
+ "rightOperand": {
+ "endPosition": "1260",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1259"
+ },
+ "startPosition": "1255"
+ },
+ "endPosition": "1260",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1255"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1263",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1262"
+ },
+ "endPosition": "1267",
+ "kind": "XOR",
+ "rightOperand": {
+ "endPosition": "1267",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1266"
+ },
+ "startPosition": "1262"
+ },
+ "endPosition": "1267",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1262"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1270",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1269"
+ },
+ "endPosition": "1274",
+ "kind": "OR",
+ "rightOperand": {
+ "endPosition": "1274",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1273"
+ },
+ "startPosition": "1269"
+ },
+ "endPosition": "1274",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1269"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1277",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1276"
+ },
+ "endPosition": "1282",
+ "kind": "CONDITIONAL_AND",
+ "rightOperand": {
+ "endPosition": "1282",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1281"
+ },
+ "startPosition": "1276"
+ },
+ "endPosition": "1282",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1276"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1285",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1284"
+ },
+ "endPosition": "1290",
+ "kind": "CONDITIONAL_OR",
+ "rightOperand": {
+ "endPosition": "1290",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1289"
+ },
+ "startPosition": "1284"
+ },
+ "endPosition": "1290",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1284"
+ }
+ ],
+ "sourceName": "parsertests/binaryExpr.js",
+ "strict": "false",
+ "startPosition": "1116"
+}
+,
+{
+ "endPosition": "1117",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1119",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1117"
+ },
+ {
+ "endPosition": "1139",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1136",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1127",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1122"
+ },
+ "arguments": [
+ {
+ "endPosition": "1134",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1129"
+ }
+ ],
+ "startPosition": "1122"
+ },
+ "endPosition": "1136",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1122"
+ }
+ ],
+ "startPosition": "1120"
+ }
+ ],
+ "sourceName": "parsertests/block.js",
+ "strict": "false",
+ "startPosition": "1117"
+}
+,
+{
+ "endPosition": "1117",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "condition": {
+ "endPosition": "1128",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1124"
+ },
+ "endPosition": "1140",
+ "kind": "WHILE_LOOP",
+ "statement": {
+ "endPosition": "1140",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1138",
+ "kind": "BREAK",
+ "startPosition": "1132"
+ }
+ ],
+ "startPosition": "1130"
+ },
+ "startPosition": "1117"
+ },
+ {
+ "endPosition": "1179",
+ "kind": "LABELED_STATEMENT",
+ "statement": {
+ "endPosition": "1179",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "condition": {
+ "endPosition": "1161",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1157"
+ },
+ "endPosition": "1177",
+ "kind": "WHILE_LOOP",
+ "statement": {
+ "endPosition": "1177",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1175",
+ "kind": "BREAK",
+ "label": "loop",
+ "startPosition": "1165"
+ }
+ ],
+ "startPosition": "1163"
+ },
+ "startPosition": "1150"
+ }
+ ],
+ "startPosition": "1148"
+ },
+ "label": "loop",
+ "startPosition": "1142"
+ },
+ {
+ "endPosition": "1214",
+ "kind": "LABELED_STATEMENT",
+ "statement": {
+ "endPosition": "1214",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1212",
+ "kind": "FOR_LOOP",
+ "statement": {
+ "endPosition": "1212",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1210",
+ "kind": "BREAK",
+ "label": "loop",
+ "startPosition": "1200"
+ }
+ ],
+ "startPosition": "1198"
+ },
+ "startPosition": "1189"
+ }
+ ],
+ "startPosition": "1187"
+ },
+ "label": "loop",
+ "startPosition": "1181"
+ }
+ ],
+ "sourceName": "parsertests/breakStat.js",
+ "strict": "false",
+ "startPosition": "1117"
+}
+,
+{
+ "endPosition": "1117",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "condition": {
+ "endPosition": "1118",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1117"
+ },
+ "endPosition": "1125",
+ "kind": "CONDITIONAL_EXPRESSION",
+ "trueExpression": {
+ "endPosition": "1121",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1120"
+ },
+ "falseExpression": {
+ "endPosition": "1125",
+ "kind": "IDENTIFIER",
+ "name": "c",
+ "startPosition": "1124"
+ },
+ "startPosition": "1118"
+ },
+ "endPosition": "1125",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1117"
+ }
+ ],
+ "sourceName": "parsertests/condExpr.js",
+ "strict": "false",
+ "startPosition": "1117"
+}
+,
+{
+ "endPosition": "1120",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "condition": {
+ "endPosition": "1131",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1127"
+ },
+ "endPosition": "1146",
+ "kind": "WHILE_LOOP",
+ "statement": {
+ "endPosition": "1146",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1144",
+ "kind": "CONTINUE",
+ "startPosition": "1135"
+ }
+ ],
+ "startPosition": "1133"
+ },
+ "startPosition": "1120"
+ },
+ {
+ "endPosition": "1191",
+ "kind": "LABELED_STATEMENT",
+ "statement": {
+ "endPosition": "1191",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "condition": {
+ "endPosition": "1168",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1164"
+ },
+ "endPosition": "1189",
+ "kind": "WHILE_LOOP",
+ "statement": {
+ "endPosition": "1189",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1187",
+ "kind": "CONTINUE",
+ "label": "begin",
+ "startPosition": "1172"
+ }
+ ],
+ "startPosition": "1170"
+ },
+ "startPosition": "1157"
+ }
+ ],
+ "startPosition": "1155"
+ },
+ "label": "begin",
+ "startPosition": "1148"
+ },
+ {
+ "endPosition": "1231",
+ "kind": "LABELED_STATEMENT",
+ "statement": {
+ "endPosition": "1231",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1229",
+ "kind": "FOR_LOOP",
+ "statement": {
+ "endPosition": "1229",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1227",
+ "kind": "CONTINUE",
+ "label": "start",
+ "startPosition": "1212"
+ }
+ ],
+ "startPosition": "1210"
+ },
+ "startPosition": "1202"
+ }
+ ],
+ "startPosition": "1200"
+ },
+ "label": "start",
+ "startPosition": "1193"
+ }
+ ],
+ "sourceName": "parsertests/continueStat.js",
+ "strict": "false",
+ "startPosition": "1120"
+}
+,
+{
+ "endPosition": "1118",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1127",
+ "kind": "DEBUGGER",
+ "startPosition": "1118"
+ }
+ ],
+ "sourceName": "parsertests/debuggerStat.js",
+ "strict": "false",
+ "startPosition": "1118"
+}
+,
+{
+ "endPosition": "1137",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1172",
+ "kind": "FUNCTION",
+ "name": "hello",
+ "body": {
+ "endPosition": "1170",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1170",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1161",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1156"
+ },
+ "arguments": [
+ {
+ "endPosition": "1168",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1163"
+ }
+ ],
+ "startPosition": "1156"
+ },
+ "endPosition": "1170",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1156"
+ }
+ ],
+ "startPosition": "1154"
+ },
+ "strict": "false",
+ "startPosition": "1137",
+ "parameters": []
+ },
+ {
+ "endPosition": "1203",
+ "kind": "FUNCTION",
+ "name": "hello",
+ "body": {
+ "endPosition": "1201",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1201",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1198",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1193"
+ },
+ "arguments": [
+ {
+ "endPosition": "1200",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1199"
+ }
+ ],
+ "startPosition": "1193"
+ },
+ "endPosition": "1201",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1193"
+ }
+ ],
+ "startPosition": "1191"
+ },
+ "strict": "false",
+ "startPosition": "1173",
+ "parameters": [
+ {
+ "endPosition": "1189",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1188"
+ }
+ ]
+ },
+ {
+ "endPosition": "1240",
+ "kind": "FUNCTION",
+ "name": "hello",
+ "body": {
+ "endPosition": "1238",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1238",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1232",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1227"
+ },
+ "arguments": [
+ {
+ "endPosition": "1234",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1233"
+ },
+ {
+ "endPosition": "1237",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1236"
+ }
+ ],
+ "startPosition": "1227"
+ },
+ "endPosition": "1238",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1227"
+ }
+ ],
+ "startPosition": "1225"
+ },
+ "strict": "false",
+ "startPosition": "1204",
+ "parameters": [
+ {
+ "endPosition": "1220",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1219"
+ },
+ {
+ "endPosition": "1223",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1222"
+ }
+ ]
+ },
+ {
+ "endPosition": "1380",
+ "kind": "FUNCTION",
+ "name": "test",
+ "body": {
+ "endPosition": "1377",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1377",
+ "kind": "STRING_LITERAL",
+ "value": "use strict",
+ "startPosition": "1367"
+ },
+ "endPosition": "1377",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1367"
+ }
+ ],
+ "startPosition": "1364"
+ },
+ "strict": "true",
+ "startPosition": "1348",
+ "parameters": []
+ },
+ {
+ "endPosition": "1282",
+ "kind": "VARIABLE",
+ "name": "hello",
+ "startPosition": "1245",
+ "initializer": {
+ "endPosition": "1264",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1280",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1280",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1271",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1266"
+ },
+ "arguments": [
+ {
+ "endPosition": "1278",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1273"
+ }
+ ],
+ "startPosition": "1266"
+ },
+ "endPosition": "1280",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1266"
+ }
+ ],
+ "startPosition": "1264"
+ },
+ "strict": "false",
+ "startPosition": "1264",
+ "parameters": []
+ }
+ },
+ {
+ "endPosition": "1331",
+ "kind": "VARIABLE",
+ "name": "hello",
+ "startPosition": "1288",
+ "initializer": {
+ "endPosition": "1313",
+ "kind": "FUNCTION_EXPRESSION",
+ "name": "hello",
+ "body": {
+ "endPosition": "1329",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1329",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1320",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1315"
+ },
+ "arguments": [
+ {
+ "endPosition": "1327",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1322"
+ }
+ ],
+ "startPosition": "1315"
+ },
+ "endPosition": "1329",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1315"
+ }
+ ],
+ "startPosition": "1313"
+ },
+ "strict": "false",
+ "startPosition": "1313",
+ "parameters": []
+ }
+ },
+ {
+ "expression": {
+ "endPosition": "1344",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1345",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1344"
+ },
+ "strict": "false",
+ "startPosition": "1344",
+ "parameters": []
+ },
+ "endPosition": "1347",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1333"
+ }
+ ],
+ "sourceName": "parsertests/functions.js",
+ "strict": "false",
+ "startPosition": "1137"
+}
+,
+{
+ "endPosition": "1114",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "condition": {
+ "endPosition": "1120",
+ "kind": "IDENTIFIER",
+ "name": "js",
+ "startPosition": "1118"
+ },
+ "endPosition": "1135",
+ "kind": "IF",
+ "startPosition": "1114",
+ "thenStatement": {
+ "endPosition": "1135",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1133",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1131",
+ "kind": "IDENTIFIER",
+ "name": "nashorn",
+ "startPosition": "1124"
+ },
+ "arguments": [],
+ "startPosition": "1124"
+ },
+ "endPosition": "1133",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1124"
+ }
+ ],
+ "startPosition": "1122"
+ }
+ },
+ {
+ "condition": {
+ "endPosition": "1143",
+ "kind": "IDENTIFIER",
+ "name": "js",
+ "startPosition": "1141"
+ },
+ "elseStatement": {
+ "endPosition": "1174",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1172",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1170",
+ "kind": "IDENTIFIER",
+ "name": "java",
+ "startPosition": "1166"
+ },
+ "arguments": [],
+ "startPosition": "1166"
+ },
+ "endPosition": "1172",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1166"
+ }
+ ],
+ "startPosition": "1164"
+ },
+ "endPosition": "1174",
+ "kind": "IF",
+ "startPosition": "1137",
+ "thenStatement": {
+ "endPosition": "1158",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1156",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1154",
+ "kind": "IDENTIFIER",
+ "name": "nashorn",
+ "startPosition": "1147"
+ },
+ "arguments": [],
+ "startPosition": "1147"
+ },
+ "endPosition": "1156",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1147"
+ }
+ ],
+ "startPosition": "1145"
+ }
+ }
+ ],
+ "sourceName": "parsertests/ifStat.js",
+ "strict": "false",
+ "startPosition": "1114"
+}
+,
+{
+ "endPosition": "1113",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1144",
+ "kind": "LABELED_STATEMENT",
+ "statement": {
+ "endPosition": "1144",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1142",
+ "kind": "FOR_LOOP",
+ "statement": {
+ "endPosition": "1142",
+ "kind": "BREAK",
+ "label": "begin",
+ "startPosition": "1131"
+ },
+ "startPosition": "1122"
+ }
+ ],
+ "startPosition": "1120"
+ },
+ "label": "begin",
+ "startPosition": "1113"
+ },
+ {
+ "endPosition": "1181",
+ "kind": "LABELED_STATEMENT",
+ "statement": {
+ "endPosition": "1181",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "condition": {
+ "endPosition": "1166",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1162"
+ },
+ "endPosition": "1179",
+ "kind": "WHILE_LOOP",
+ "statement": {
+ "endPosition": "1179",
+ "kind": "BREAK",
+ "label": "begin",
+ "startPosition": "1168"
+ },
+ "startPosition": "1155"
+ }
+ ],
+ "startPosition": "1153"
+ },
+ "label": "begin",
+ "startPosition": "1146"
+ }
+ ],
+ "sourceName": "parsertests/labelledStat.js",
+ "strict": "false",
+ "startPosition": "1113"
+}
+,
+{
+ "endPosition": "1125",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1126",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1125"
+ },
+ "endPosition": "1129",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "1128",
+ "kind": "NUMBER_LITERAL",
+ "value": "3",
+ "startPosition": "1127"
+ },
+ "startPosition": "1125"
+ },
+ "endPosition": "1129",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1125"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1132",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1131"
+ },
+ "endPosition": "1135",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "1134",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1133"
+ },
+ "startPosition": "1131"
+ },
+ "endPosition": "1135",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1131"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1138",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1137"
+ },
+ "endPosition": "1145",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "1143",
+ "kind": "STRING_LITERAL",
+ "value": "foo",
+ "startPosition": "1140"
+ },
+ "startPosition": "1137"
+ },
+ "endPosition": "1145",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1137"
+ },
+ {
+ "expression": {
+ "identifier": "foo",
+ "expression": {
+ "endPosition": "1150",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1147"
+ },
+ "endPosition": "1154",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1147"
+ },
+ "endPosition": "1154",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1147"
+ },
+ {
+ "expression": {
+ "identifier": "bar",
+ "expression": {
+ "identifier": "foo",
+ "expression": {
+ "endPosition": "1159",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1156"
+ },
+ "endPosition": "1163",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1156"
+ },
+ "endPosition": "1167",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1156"
+ },
+ "endPosition": "1167",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1156"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1177",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1177",
+ "kind": "IDENTIFIER",
+ "name": "Type",
+ "startPosition": "1173"
+ },
+ "arguments": [],
+ "startPosition": "1173"
+ },
+ "endPosition": "1177",
+ "kind": "NEW",
+ "startPosition": "1169"
+ },
+ "endPosition": "1177",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1169"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1189",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1187",
+ "kind": "IDENTIFIER",
+ "name": "Type",
+ "startPosition": "1183"
+ },
+ "arguments": [],
+ "startPosition": "1183"
+ },
+ "endPosition": "1189",
+ "kind": "NEW",
+ "startPosition": "1179"
+ },
+ "endPosition": "1189",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1179"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1211",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1199",
+ "kind": "IDENTIFIER",
+ "name": "Type",
+ "startPosition": "1195"
+ },
+ "arguments": [
+ {
+ "endPosition": "1201",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1200"
+ },
+ {
+ "endPosition": "1209",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1204"
+ }
+ ],
+ "startPosition": "1195"
+ },
+ "endPosition": "1211",
+ "kind": "NEW",
+ "startPosition": "1191"
+ },
+ "endPosition": "1211",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1191"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1225",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "Type",
+ "expression": {
+ "endPosition": "1220",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1217"
+ },
+ "endPosition": "1225",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1217"
+ },
+ "arguments": [],
+ "startPosition": "1220"
+ },
+ "endPosition": "1225",
+ "kind": "NEW",
+ "startPosition": "1213"
+ },
+ "endPosition": "1225",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1213"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1241",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "Type",
+ "expression": {
+ "endPosition": "1234",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1231"
+ },
+ "endPosition": "1239",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1231"
+ },
+ "arguments": [],
+ "startPosition": "1234"
+ },
+ "endPosition": "1241",
+ "kind": "NEW",
+ "startPosition": "1227"
+ },
+ "endPosition": "1241",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1227"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1267",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "Type",
+ "expression": {
+ "endPosition": "1250",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1247"
+ },
+ "endPosition": "1255",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1247"
+ },
+ "arguments": [
+ {
+ "endPosition": "1257",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1256"
+ },
+ {
+ "endPosition": "1265",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1260"
+ }
+ ],
+ "startPosition": "1250"
+ },
+ "endPosition": "1267",
+ "kind": "NEW",
+ "startPosition": "1243"
+ },
+ "endPosition": "1267",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1243"
+ },
+ {
+ "expression": {
+ "endPosition": "1274",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1272",
+ "kind": "IDENTIFIER",
+ "name": "foo",
+ "startPosition": "1269"
+ },
+ "arguments": [],
+ "startPosition": "1269"
+ },
+ "endPosition": "1274",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1269"
+ },
+ {
+ "expression": {
+ "endPosition": "1284",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "foo",
+ "expression": {
+ "endPosition": "1278",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1275"
+ },
+ "endPosition": "1282",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1275"
+ },
+ "arguments": [],
+ "startPosition": "1275"
+ },
+ "endPosition": "1284",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1275"
+ },
+ {
+ "expression": {
+ "endPosition": "1294",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1289",
+ "kind": "IDENTIFIER",
+ "name": "foo",
+ "startPosition": "1286"
+ },
+ "arguments": [
+ {
+ "endPosition": "1291",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1290"
+ },
+ {
+ "endPosition": "1293",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1292"
+ }
+ ],
+ "startPosition": "1286"
+ },
+ "endPosition": "1294",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1286"
+ },
+ {
+ "expression": {
+ "endPosition": "1309",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "foo",
+ "expression": {
+ "endPosition": "1299",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1296"
+ },
+ "endPosition": "1303",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1296"
+ },
+ "arguments": [
+ {
+ "endPosition": "1305",
+ "kind": "IDENTIFIER",
+ "name": "a",
+ "startPosition": "1304"
+ },
+ {
+ "endPosition": "1308",
+ "kind": "IDENTIFIER",
+ "name": "b",
+ "startPosition": "1307"
+ }
+ ],
+ "startPosition": "1296"
+ },
+ "endPosition": "1309",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1296"
+ }
+ ],
+ "sourceName": "parsertests/lhsExpr.js",
+ "strict": "false",
+ "startPosition": "1125"
+}
+,
+{
+ "endPosition": "1110",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "condition": {
+ "endPosition": "1120",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1116"
+ },
+ "endPosition": "1140",
+ "kind": "WHILE_LOOP",
+ "statement": {
+ "endPosition": "1140",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1138",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1129",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1124"
+ },
+ "arguments": [
+ {
+ "endPosition": "1136",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1131"
+ }
+ ],
+ "startPosition": "1124"
+ },
+ "endPosition": "1138",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1124"
+ }
+ ],
+ "startPosition": "1122"
+ },
+ "startPosition": "1110"
+ },
+ {
+ "condition": {
+ "endPosition": "1173",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1169"
+ },
+ "endPosition": "1174",
+ "kind": "DO_WHILE_LOOP",
+ "statement": {
+ "endPosition": "1162",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1160",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1151",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1146"
+ },
+ "arguments": [
+ {
+ "endPosition": "1158",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1153"
+ }
+ ],
+ "startPosition": "1146"
+ },
+ "endPosition": "1160",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1146"
+ }
+ ],
+ "startPosition": "1144"
+ },
+ "startPosition": "1141"
+ },
+ {
+ "expression": {
+ "endPosition": "1188",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1185"
+ },
+ "endPosition": "1207",
+ "kind": "FOR_IN_LOOP",
+ "forEach": "false",
+ "variable": {
+ "endPosition": "1181",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1180"
+ },
+ "statement": {
+ "endPosition": "1207",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1205",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1197",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1192"
+ },
+ "arguments": [
+ {
+ "expression": {
+ "endPosition": "1201",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1198"
+ },
+ "endPosition": "1204",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "1203",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1202"
+ },
+ "startPosition": "1198"
+ }
+ ],
+ "startPosition": "1192"
+ },
+ "endPosition": "1205",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1192"
+ }
+ ],
+ "startPosition": "1190"
+ },
+ "startPosition": "1175"
+ },
+ {
+ "expression": {
+ "endPosition": "1226",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1223"
+ },
+ "endPosition": "1240",
+ "kind": "FOR_IN_LOOP",
+ "forEach": "true",
+ "variable": {
+ "endPosition": "1219",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1218"
+ },
+ "statement": {
+ "endPosition": "1240",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1238",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1235",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1230"
+ },
+ "arguments": [
+ {
+ "endPosition": "1237",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1236"
+ }
+ ],
+ "startPosition": "1230"
+ },
+ "endPosition": "1238",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1230"
+ }
+ ],
+ "startPosition": "1228"
+ },
+ "startPosition": "1208"
+ },
+ {
+ "condition": {
+ "leftOperand": {
+ "endPosition": "1254",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1253"
+ },
+ "endPosition": "1259",
+ "kind": "LESS_THAN",
+ "rightOperand": {
+ "endPosition": "1259",
+ "kind": "NUMBER_LITERAL",
+ "value": "10",
+ "startPosition": "1257"
+ },
+ "startPosition": "1253"
+ },
+ "endPosition": "1278",
+ "kind": "FOR_LOOP",
+ "statement": {
+ "endPosition": "1278",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1276",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1273",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1268"
+ },
+ "arguments": [
+ {
+ "endPosition": "1275",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1274"
+ }
+ ],
+ "startPosition": "1268"
+ },
+ "endPosition": "1276",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1268"
+ }
+ ],
+ "startPosition": "1266"
+ },
+ "update": {
+ "expression": {
+ "endPosition": "1262",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1261"
+ },
+ "endPosition": "1264",
+ "kind": "POSTFIX_INCREMENT",
+ "startPosition": "1261"
+ },
+ "startPosition": "1241",
+ "initializer": {
+ "expression": {
+ "endPosition": "1251",
+ "kind": "NUMBER_LITERAL",
+ "value": "0",
+ "startPosition": "1250"
+ },
+ "endPosition": "1251",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1247",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "1246"
+ },
+ "startPosition": "1246"
+ }
+ }
+ ],
+ "sourceName": "parsertests/loopStat.js",
+ "strict": "false",
+ "startPosition": "1110"
+}
+,
+{
+ "endPosition": "1125",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1133",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1131",
+ "properties": []
+ },
+ "endPosition": "1133",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1128",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "1125"
+ },
+ "startPosition": "1125"
+ },
+ "endPosition": "1133",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1125"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1154",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1139",
+ "properties": [
+ {
+ "endPosition": "1143",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1146",
+ "kind": "NUMBER_LITERAL",
+ "value": "10",
+ "startPosition": "1144"
+ },
+ "startPosition": "1141",
+ "key": {
+ "endPosition": "1142",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1141"
+ }
+ },
+ {
+ "endPosition": "1150",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1152",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1151"
+ },
+ "startPosition": "1148",
+ "key": {
+ "endPosition": "1149",
+ "kind": "IDENTIFIER",
+ "name": "y",
+ "startPosition": "1148"
+ }
+ }
+ ]
+ },
+ "endPosition": "1154",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1136",
+ "kind": "IDENTIFIER",
+ "name": "p",
+ "startPosition": "1135"
+ },
+ "startPosition": "1135"
+ },
+ "endPosition": "1154",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1135"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1179",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1160",
+ "properties": [
+ {
+ "endPosition": "1166",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1169",
+ "kind": "NUMBER_LITERAL",
+ "value": "10",
+ "startPosition": "1167"
+ },
+ "startPosition": "1163",
+ "key": {
+ "endPosition": "1164",
+ "kind": "STRING_LITERAL",
+ "value": "x",
+ "startPosition": "1163"
+ }
+ },
+ {
+ "endPosition": "1175",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1177",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1176"
+ },
+ "startPosition": "1172",
+ "key": {
+ "endPosition": "1173",
+ "kind": "STRING_LITERAL",
+ "value": "y",
+ "startPosition": "1172"
+ }
+ }
+ ]
+ },
+ "endPosition": "1179",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1157",
+ "kind": "IDENTIFIER",
+ "name": "p",
+ "startPosition": "1156"
+ },
+ "startPosition": "1156"
+ },
+ "endPosition": "1179",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1156"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1241",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1185",
+ "properties": [
+ {
+ "getter": {
+ "endPosition": "1195",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1210",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1210",
+ "kind": "IDENTIFIER",
+ "name": "xValue",
+ "startPosition": "1204"
+ },
+ "endPosition": "1210",
+ "kind": "RETURN",
+ "startPosition": "1197"
+ }
+ ],
+ "startPosition": "1195"
+ },
+ "strict": "false",
+ "startPosition": "1195",
+ "parameters": []
+ },
+ "endPosition": "1212",
+ "kind": "PROPERTY",
+ "startPosition": "1187",
+ "key": {
+ "endPosition": "1192",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1191"
+ }
+ },
+ {
+ "getter": {
+ "endPosition": "1222",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1237",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1237",
+ "kind": "IDENTIFIER",
+ "name": "yValue",
+ "startPosition": "1231"
+ },
+ "endPosition": "1237",
+ "kind": "RETURN",
+ "startPosition": "1224"
+ }
+ ],
+ "startPosition": "1222"
+ },
+ "strict": "false",
+ "startPosition": "1222",
+ "parameters": []
+ },
+ "endPosition": "1239",
+ "kind": "PROPERTY",
+ "startPosition": "1214",
+ "key": {
+ "endPosition": "1219",
+ "kind": "IDENTIFIER",
+ "name": "y",
+ "startPosition": "1218"
+ }
+ }
+ ]
+ },
+ "endPosition": "1241",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1182",
+ "kind": "IDENTIFIER",
+ "name": "p",
+ "startPosition": "1181"
+ },
+ "startPosition": "1181"
+ },
+ "endPosition": "1241",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1181"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1315",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1247",
+ "properties": [
+ {
+ "getter": {
+ "endPosition": "1259",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1277",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "identifier": "_foo",
+ "expression": {
+ "endPosition": "1272",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "1268"
+ },
+ "endPosition": "1277",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1268"
+ },
+ "endPosition": "1277",
+ "kind": "RETURN",
+ "startPosition": "1261"
+ }
+ ],
+ "startPosition": "1259"
+ },
+ "strict": "false",
+ "startPosition": "1259",
+ "parameters": []
+ },
+ "endPosition": "1279",
+ "kind": "PROPERTY",
+ "setter": {
+ "endPosition": "1294",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1311",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1311",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "1308"
+ },
+ "endPosition": "1311",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "_foo",
+ "expression": {
+ "endPosition": "1300",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "1296"
+ },
+ "endPosition": "1305",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1296"
+ },
+ "startPosition": "1296"
+ },
+ "endPosition": "1311",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1296"
+ }
+ ],
+ "startPosition": "1294"
+ },
+ "strict": "false",
+ "startPosition": "1294",
+ "parameters": [
+ {
+ "endPosition": "1292",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "1289"
+ }
+ ]
+ },
+ "startPosition": "1249",
+ "key": {
+ "endPosition": "1256",
+ "kind": "IDENTIFIER",
+ "name": "foo",
+ "startPosition": "1253"
+ }
+ }
+ ]
+ },
+ "endPosition": "1315",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1244",
+ "kind": "IDENTIFIER",
+ "name": "p",
+ "startPosition": "1243"
+ },
+ "startPosition": "1243"
+ },
+ "endPosition": "1315",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1243"
+ }
+ ],
+ "sourceName": "parsertests/objectLitExpr.js",
+ "strict": "false",
+ "startPosition": "1125"
+}
+,
+{
+ "endPosition": "1118",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "leftOperand": {
+ "leftOperand": {
+ "endPosition": "1120",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1119"
+ },
+ "endPosition": "1126",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "1126",
+ "kind": "NUMBER_LITERAL",
+ "value": "1",
+ "startPosition": "1125"
+ },
+ "startPosition": "1119"
+ },
+ "endPosition": "1131",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "1131",
+ "kind": "NUMBER_LITERAL",
+ "value": "4",
+ "startPosition": "1130"
+ },
+ "startPosition": "1119"
+ },
+ "endPosition": "1131",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1118"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "leftOperand": {
+ "endPosition": "1134",
+ "kind": "NUMBER_LITERAL",
+ "value": "3",
+ "startPosition": "1133"
+ },
+ "endPosition": "1139",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "1139",
+ "kind": "NUMBER_LITERAL",
+ "value": "7",
+ "startPosition": "1138"
+ },
+ "startPosition": "1133"
+ },
+ "endPosition": "1146",
+ "kind": "LEFT_SHIFT",
+ "rightOperand": {
+ "endPosition": "1146",
+ "kind": "NUMBER_LITERAL",
+ "value": "5",
+ "startPosition": "1145"
+ },
+ "startPosition": "1133"
+ },
+ "endPosition": "1147",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1133"
+ }
+ ],
+ "sourceName": "parsertests/parenExpr.js",
+ "strict": "false",
+ "startPosition": "1118"
+}
+,
+{
+ "endPosition": "1119",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1123",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "1119"
+ },
+ "endPosition": "1123",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1119"
+ },
+ {
+ "expression": {
+ "endPosition": "1128",
+ "kind": "IDENTIFIER",
+ "name": "foo",
+ "startPosition": "1125"
+ },
+ "endPosition": "1128",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1125"
+ },
+ {
+ "expression": {
+ "endPosition": "1134",
+ "kind": "NULL_LITERAL",
+ "startPosition": "1130"
+ },
+ "endPosition": "1134",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1130"
+ },
+ {
+ "expression": {
+ "endPosition": "1140",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "true",
+ "startPosition": "1136"
+ },
+ "endPosition": "1140",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1136"
+ },
+ {
+ "expression": {
+ "endPosition": "1147",
+ "kind": "BOOLEAN_LITERAL",
+ "value": "false",
+ "startPosition": "1142"
+ },
+ "endPosition": "1147",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1142"
+ },
+ {
+ "expression": {
+ "endPosition": "1151",
+ "kind": "NUMBER_LITERAL",
+ "value": "33",
+ "startPosition": "1149"
+ },
+ "endPosition": "1151",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1149"
+ },
+ {
+ "expression": {
+ "endPosition": "1157",
+ "kind": "NUMBER_LITERAL",
+ "value": "3.14",
+ "startPosition": "1153"
+ },
+ "endPosition": "1157",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1153"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "leftOperand": {
+ "endPosition": "1162",
+ "kind": "NUMBER_LITERAL",
+ "value": "10",
+ "startPosition": "1160"
+ },
+ "endPosition": "1166",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "1166",
+ "kind": "NUMBER_LITERAL",
+ "value": "3",
+ "startPosition": "1165"
+ },
+ "startPosition": "1160"
+ },
+ "endPosition": "1169",
+ "kind": "MULTIPLY",
+ "rightOperand": {
+ "endPosition": "1169",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1168"
+ },
+ "startPosition": "1160"
+ },
+ "endPosition": "1169",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1159"
+ },
+ {
+ "expression": {
+ "endPosition": "1174",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1172",
+ "properties": []
+ },
+ "endPosition": "1175",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1171"
+ },
+ {
+ "expression": {
+ "endPosition": "1186",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1178",
+ "properties": [
+ {
+ "endPosition": "1182",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1184",
+ "kind": "NUMBER_LITERAL",
+ "value": "3",
+ "startPosition": "1183"
+ },
+ "startPosition": "1180",
+ "key": {
+ "endPosition": "1181",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1180"
+ }
+ }
+ ]
+ },
+ "endPosition": "1187",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1177"
+ },
+ {
+ "expression": {
+ "endPosition": "1191",
+ "kind": "ARRAY_LITERAL",
+ "elements": [],
+ "startPosition": "1189"
+ },
+ "endPosition": "1191",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1189"
+ },
+ {
+ "expression": {
+ "endPosition": "1197",
+ "kind": "ARRAY_LITERAL",
+ "elements": [
+ null,
+ null
+ ],
+ "startPosition": "1193"
+ },
+ "endPosition": "1197",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1193"
+ },
+ {
+ "expression": {
+ "endPosition": "1208",
+ "kind": "ARRAY_LITERAL",
+ "elements": [
+ {
+ "endPosition": "1201",
+ "kind": "NUMBER_LITERAL",
+ "value": "4",
+ "startPosition": "1200"
+ },
+ {
+ "endPosition": "1204",
+ "kind": "NUMBER_LITERAL",
+ "value": "5",
+ "startPosition": "1203"
+ },
+ {
+ "endPosition": "1207",
+ "kind": "NUMBER_LITERAL",
+ "value": "5",
+ "startPosition": "1206"
+ }
+ ],
+ "startPosition": "1199"
+ },
+ "endPosition": "1208",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1199"
+ }
+ ],
+ "sourceName": "parsertests/primaryExpr.js",
+ "strict": "false",
+ "startPosition": "1119"
+}
+,
+{
+ "endPosition": "1114",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1127",
+ "kind": "VARIABLE",
+ "name": "x",
+ "startPosition": "1118",
+ "initializer": {
+ "endPosition": "1127",
+ "kind": "REGEXP_LITERAL",
+ "options": "",
+ "pattern": "foo",
+ "startPosition": "1122"
+ }
+ },
+ {
+ "endPosition": "1143",
+ "kind": "VARIABLE",
+ "name": "y",
+ "startPosition": "1133",
+ "initializer": {
+ "endPosition": "1143",
+ "kind": "REGEXP_LITERAL",
+ "options": "g",
+ "pattern": "foo",
+ "startPosition": "1137"
+ }
+ },
+ {
+ "endPosition": "1168",
+ "kind": "VARIABLE",
+ "name": "z",
+ "startPosition": "1149",
+ "initializer": {
+ "endPosition": "1168",
+ "kind": "REGEXP_LITERAL",
+ "options": "",
+ "pattern": "[a-z]*[1-10]?",
+ "startPosition": "1153"
+ }
+ }
+ ],
+ "sourceName": "parsertests/regexp_literal.js",
+ "strict": "false",
+ "startPosition": "1114"
+}
+,
+{
+ "endPosition": "1118",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1130",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1138",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1138",
+ "kind": "RETURN",
+ "startPosition": "1132"
+ }
+ ],
+ "startPosition": "1130"
+ },
+ "strict": "false",
+ "startPosition": "1130",
+ "parameters": []
+ },
+ "endPosition": "1141",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1118"
+ },
+ {
+ "expression": {
+ "endPosition": "1155",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1167",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1167",
+ "kind": "IDENTIFIER",
+ "name": "res",
+ "startPosition": "1164"
+ },
+ "endPosition": "1167",
+ "kind": "RETURN",
+ "startPosition": "1157"
+ }
+ ],
+ "startPosition": "1155"
+ },
+ "strict": "false",
+ "startPosition": "1155",
+ "parameters": []
+ },
+ "endPosition": "1170",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1143"
+ },
+ {
+ "expression": {
+ "endPosition": "1184",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1198",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1198",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1196",
+ "kind": "IDENTIFIER",
+ "name": "foo",
+ "startPosition": "1193"
+ },
+ "arguments": [],
+ "startPosition": "1193"
+ },
+ "endPosition": "1198",
+ "kind": "RETURN",
+ "startPosition": "1186"
+ }
+ ],
+ "startPosition": "1184"
+ },
+ "strict": "false",
+ "startPosition": "1184",
+ "parameters": []
+ },
+ "endPosition": "1201",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1172"
+ }
+ ],
+ "sourceName": "parsertests/returnStat.js",
+ "strict": "false",
+ "startPosition": "1118"
+}
+,
+{
+ "endPosition": "1111",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "cases": [],
+ "expression": {
+ "endPosition": "1122",
+ "kind": "IDENTIFIER",
+ "name": "key",
+ "startPosition": "1119"
+ },
+ "endPosition": "1126",
+ "kind": "SWITCH",
+ "startPosition": "1111"
+ },
+ {
+ "cases": [
+ {
+ "expression": {
+ "endPosition": "1149",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1148"
+ },
+ "endPosition": "1166",
+ "kind": "CASE",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1158",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1156",
+ "kind": "IDENTIFIER",
+ "name": "hello",
+ "startPosition": "1151"
+ },
+ "arguments": [],
+ "startPosition": "1151"
+ },
+ "endPosition": "1158",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1151"
+ },
+ {
+ "endPosition": "1166",
+ "kind": "BREAK",
+ "startPosition": "1160"
+ }
+ ],
+ "startPosition": "1143"
+ }
+ ],
+ "expression": {
+ "endPosition": "1139",
+ "kind": "IDENTIFIER",
+ "name": "key",
+ "startPosition": "1136"
+ },
+ "endPosition": "1168",
+ "kind": "SWITCH",
+ "startPosition": "1128"
+ },
+ {
+ "cases": [
+ {
+ "expression": {
+ "endPosition": "1191",
+ "kind": "NUMBER_LITERAL",
+ "value": "4",
+ "startPosition": "1190"
+ },
+ "endPosition": "1208",
+ "kind": "CASE",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1200",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1198",
+ "kind": "IDENTIFIER",
+ "name": "hello",
+ "startPosition": "1193"
+ },
+ "arguments": [],
+ "startPosition": "1193"
+ },
+ "endPosition": "1200",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1193"
+ },
+ {
+ "endPosition": "1208",
+ "kind": "BREAK",
+ "startPosition": "1202"
+ }
+ ],
+ "startPosition": "1185"
+ },
+ {
+ "expression": {
+ "endPosition": "1215",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1214"
+ },
+ "endPosition": "1232",
+ "kind": "CASE",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1224",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1222",
+ "kind": "IDENTIFIER",
+ "name": "world",
+ "startPosition": "1217"
+ },
+ "arguments": [],
+ "startPosition": "1217"
+ },
+ "endPosition": "1224",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1217"
+ },
+ {
+ "endPosition": "1232",
+ "kind": "BREAK",
+ "startPosition": "1226"
+ }
+ ],
+ "startPosition": "1209"
+ },
+ {
+ "endPosition": "1247",
+ "kind": "CASE",
+ "statements": [
+ {
+ "endPosition": "1247",
+ "kind": "BREAK",
+ "startPosition": "1242"
+ }
+ ],
+ "startPosition": "1233"
+ }
+ ],
+ "expression": {
+ "endPosition": "1181",
+ "kind": "IDENTIFIER",
+ "name": "key",
+ "startPosition": "1178"
+ },
+ "endPosition": "1249",
+ "kind": "SWITCH",
+ "startPosition": "1170"
+ }
+ ],
+ "sourceName": "parsertests/switchStat.js",
+ "strict": "false",
+ "startPosition": "1111"
+}
+,
+{
+ "endPosition": "1110",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1119",
+ "kind": "IDENTIFIER",
+ "name": "err",
+ "startPosition": "1116"
+ },
+ "endPosition": "1120",
+ "kind": "THROW",
+ "startPosition": "1110"
+ },
+ {
+ "expression": {
+ "endPosition": "1133",
+ "kind": "STRING_LITERAL",
+ "value": "wrong",
+ "startPosition": "1128"
+ },
+ "endPosition": "1135",
+ "kind": "THROW",
+ "startPosition": "1121"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1155",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1155",
+ "kind": "IDENTIFIER",
+ "name": "TypeError",
+ "startPosition": "1146"
+ },
+ "arguments": [],
+ "startPosition": "1146"
+ },
+ "endPosition": "1155",
+ "kind": "NEW",
+ "startPosition": "1142"
+ },
+ "endPosition": "1156",
+ "kind": "THROW",
+ "startPosition": "1136"
+ },
+ {
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "1192",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1176",
+ "kind": "IDENTIFIER",
+ "name": "TypeError",
+ "startPosition": "1167"
+ },
+ "arguments": [
+ {
+ "endPosition": "1190",
+ "kind": "STRING_LITERAL",
+ "value": "not an array",
+ "startPosition": "1178"
+ }
+ ],
+ "startPosition": "1167"
+ },
+ "endPosition": "1192",
+ "kind": "NEW",
+ "startPosition": "1163"
+ },
+ "endPosition": "1193",
+ "kind": "THROW",
+ "startPosition": "1157"
+ },
+ {
+ "expression": {
+ "endPosition": "1217",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "1200",
+ "properties": [
+ {
+ "endPosition": "1206",
+ "kind": "PROPERTY",
+ "value": {
+ "endPosition": "1214",
+ "kind": "STRING_LITERAL",
+ "value": "wrong!",
+ "startPosition": "1208"
+ },
+ "startPosition": "1202",
+ "key": {
+ "endPosition": "1205",
+ "kind": "IDENTIFIER",
+ "name": "msg",
+ "startPosition": "1202"
+ }
+ }
+ ]
+ },
+ "endPosition": "1218",
+ "kind": "THROW",
+ "startPosition": "1194"
+ }
+ ],
+ "sourceName": "parsertests/throwStat.js",
+ "strict": "false",
+ "startPosition": "1110"
+}
+,
+{
+ "endPosition": "1121",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1142",
+ "kind": "TRY",
+ "catches": [
+ {
+ "endPosition": "1142",
+ "kind": "CATCH",
+ "parameter": {
+ "endPosition": "1137",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1136"
+ },
+ "block": {
+ "endPosition": "1142",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1139"
+ },
+ "startPosition": "1129"
+ }
+ ],
+ "block": {
+ "endPosition": "1128",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1125"
+ },
+ "startPosition": "1121"
+ },
+ {
+ "endPosition": "1175",
+ "kind": "TRY",
+ "catches": [
+ {
+ "endPosition": "1164",
+ "kind": "CATCH",
+ "parameter": {
+ "endPosition": "1159",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1158"
+ },
+ "block": {
+ "endPosition": "1164",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1161"
+ },
+ "startPosition": "1151"
+ }
+ ],
+ "block": {
+ "endPosition": "1150",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1147"
+ },
+ "finallyBlock": {
+ "endPosition": "1175",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1173"
+ },
+ "startPosition": "1143"
+ },
+ {
+ "endPosition": "1194",
+ "kind": "TRY",
+ "catches": [],
+ "block": {
+ "endPosition": "1183",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1180"
+ },
+ "finallyBlock": {
+ "endPosition": "1194",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1192"
+ },
+ "startPosition": "1176"
+ },
+ {
+ "endPosition": "1225",
+ "kind": "TRY",
+ "catches": [
+ {
+ "endPosition": "1225",
+ "kind": "CATCH",
+ "parameter": {
+ "endPosition": "1211",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1210"
+ },
+ "block": {
+ "endPosition": "1225",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1223",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1221",
+ "kind": "IDENTIFIER",
+ "name": "handle",
+ "startPosition": "1215"
+ },
+ "arguments": [],
+ "startPosition": "1215"
+ },
+ "endPosition": "1223",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1215"
+ }
+ ],
+ "startPosition": "1213"
+ },
+ "startPosition": "1203"
+ }
+ ],
+ "block": {
+ "endPosition": "1202",
+ "kind": "BLOCK",
+ "statements": [],
+ "startPosition": "1199"
+ },
+ "startPosition": "1195"
+ },
+ {
+ "endPosition": "1283",
+ "kind": "TRY",
+ "catches": [
+ {
+ "endPosition": "1263",
+ "kind": "CATCH",
+ "parameter": {
+ "endPosition": "1249",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1248"
+ },
+ "block": {
+ "endPosition": "1263",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1261",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1259",
+ "kind": "IDENTIFIER",
+ "name": "handle",
+ "startPosition": "1253"
+ },
+ "arguments": [],
+ "startPosition": "1253"
+ },
+ "endPosition": "1261",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1253"
+ }
+ ],
+ "startPosition": "1251"
+ },
+ "startPosition": "1241"
+ }
+ ],
+ "block": {
+ "endPosition": "1240",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1238",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1236",
+ "kind": "IDENTIFIER",
+ "name": "that",
+ "startPosition": "1232"
+ },
+ "arguments": [],
+ "startPosition": "1232"
+ },
+ "endPosition": "1238",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1232"
+ }
+ ],
+ "startPosition": "1230"
+ },
+ "finallyBlock": {
+ "endPosition": "1283",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1281",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1279",
+ "kind": "IDENTIFIER",
+ "name": "clean",
+ "startPosition": "1274"
+ },
+ "arguments": [],
+ "startPosition": "1274"
+ },
+ "endPosition": "1281",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1274"
+ }
+ ],
+ "startPosition": "1272"
+ },
+ "startPosition": "1226"
+ },
+ {
+ "endPosition": "1368",
+ "kind": "TRY",
+ "catches": [
+ {
+ "condition": {
+ "leftOperand": {
+ "endPosition": "1312",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1311"
+ },
+ "expression": {
+ "endPosition": "1312",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1311"
+ },
+ "endPosition": "1333",
+ "kind": "INSTANCE_OF",
+ "rightOperand": {
+ "endPosition": "1333",
+ "kind": "IDENTIFIER",
+ "name": "TypeError",
+ "startPosition": "1324"
+ },
+ "type": {
+ "endPosition": "1333",
+ "kind": "IDENTIFIER",
+ "name": "TypeError",
+ "startPosition": "1324"
+ },
+ "startPosition": "1311"
+ },
+ "endPosition": "1347",
+ "kind": "CATCH",
+ "parameter": {
+ "endPosition": "1307",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1306"
+ },
+ "block": {
+ "endPosition": "1347",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1345",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1343",
+ "kind": "IDENTIFIER",
+ "name": "handle",
+ "startPosition": "1337"
+ },
+ "arguments": [],
+ "startPosition": "1337"
+ },
+ "endPosition": "1345",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1337"
+ }
+ ],
+ "startPosition": "1335"
+ },
+ "startPosition": "1299"
+ },
+ {
+ "endPosition": "1368",
+ "kind": "CATCH",
+ "parameter": {
+ "endPosition": "1356",
+ "kind": "IDENTIFIER",
+ "name": "e",
+ "startPosition": "1355"
+ },
+ "block": {
+ "endPosition": "1368",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1366",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1364",
+ "kind": "IDENTIFIER",
+ "name": "rest",
+ "startPosition": "1360"
+ },
+ "arguments": [],
+ "startPosition": "1360"
+ },
+ "endPosition": "1366",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1360"
+ }
+ ],
+ "startPosition": "1358"
+ },
+ "startPosition": "1348"
+ }
+ ],
+ "block": {
+ "endPosition": "1298",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1296",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1294",
+ "kind": "IDENTIFIER",
+ "name": "that",
+ "startPosition": "1290"
+ },
+ "arguments": [],
+ "startPosition": "1290"
+ },
+ "endPosition": "1296",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1290"
+ }
+ ],
+ "startPosition": "1288"
+ },
+ "startPosition": "1284"
+ }
+ ],
+ "sourceName": "parsertests/tryCatchStat.js",
+ "strict": "false",
+ "startPosition": "1121"
+}
+,
+{
+ "endPosition": "1115",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1116",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1115"
+ },
+ "endPosition": "1118",
+ "kind": "POSTFIX_INCREMENT",
+ "startPosition": "1115"
+ },
+ "endPosition": "1118",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1115"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1121",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1120"
+ },
+ "endPosition": "1123",
+ "kind": "POSTFIX_DECREMENT",
+ "startPosition": "1120"
+ },
+ "endPosition": "1123",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1120"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1133",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1132"
+ },
+ "endPosition": "1133",
+ "kind": "DELETE",
+ "startPosition": "1125"
+ },
+ "endPosition": "1133",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1125"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1141",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1140"
+ },
+ "endPosition": "1141",
+ "kind": "VOID",
+ "startPosition": "1135"
+ },
+ "endPosition": "1141",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1135"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1151",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1150"
+ },
+ "endPosition": "1151",
+ "kind": "TYPEOF",
+ "startPosition": "1143"
+ },
+ "endPosition": "1151",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1143"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1156",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1155"
+ },
+ "endPosition": "1156",
+ "kind": "PREFIX_INCREMENT",
+ "startPosition": "1153"
+ },
+ "endPosition": "1156",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1153"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1161",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1160"
+ },
+ "endPosition": "1161",
+ "kind": "PREFIX_DECREMENT",
+ "startPosition": "1158"
+ },
+ "endPosition": "1161",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1158"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1165",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1164"
+ },
+ "endPosition": "1165",
+ "kind": "PLUS",
+ "startPosition": "1163"
+ },
+ "endPosition": "1165",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1163"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1169",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1168"
+ },
+ "endPosition": "1169",
+ "kind": "MINUS",
+ "startPosition": "1167"
+ },
+ "endPosition": "1169",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1167"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1173",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1172"
+ },
+ "endPosition": "1173",
+ "kind": "BITWISE_COMPLEMENT",
+ "startPosition": "1171"
+ },
+ "endPosition": "1173",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1171"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1177",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1176"
+ },
+ "endPosition": "1177",
+ "kind": "LOGICAL_COMPLEMENT",
+ "startPosition": "1175"
+ },
+ "endPosition": "1177",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1175"
+ }
+ ],
+ "sourceName": "parsertests/unaryExpr.js",
+ "strict": "false",
+ "startPosition": "1115"
+}
+,
+{
+ "endPosition": "1122",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1165",
+ "kind": "FUNCTION",
+ "name": "f",
+ "body": {
+ "endPosition": "1162",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1162",
+ "kind": "STRING_LITERAL",
+ "value": "use strict",
+ "startPosition": "1152"
+ },
+ "endPosition": "1162",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1152"
+ }
+ ],
+ "startPosition": "1149"
+ },
+ "strict": "true",
+ "startPosition": "1136",
+ "parameters": []
+ },
+ {
+ "expression": {
+ "endPosition": "1133",
+ "kind": "STRING_LITERAL",
+ "value": "use strict",
+ "startPosition": "1123"
+ },
+ "endPosition": "1133",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1123"
+ }
+ ],
+ "sourceName": "parsertests/useStrict.js",
+ "strict": "true",
+ "startPosition": "1122"
+}
+,
+{
+ "endPosition": "1143",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1148",
+ "kind": "VARIABLE",
+ "name": "a",
+ "startPosition": "1147"
+ },
+ {
+ "endPosition": "1155",
+ "kind": "VARIABLE",
+ "name": "a",
+ "startPosition": "1154"
+ },
+ {
+ "endPosition": "1158",
+ "kind": "VARIABLE",
+ "name": "b",
+ "startPosition": "1157"
+ },
+ {
+ "endPosition": "1200",
+ "kind": "VARIABLE",
+ "name": "a",
+ "startPosition": "1190",
+ "initializer": {
+ "endPosition": "1200",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1195"
+ }
+ },
+ {
+ "endPosition": "1212",
+ "kind": "VARIABLE",
+ "name": "a",
+ "startPosition": "1207",
+ "initializer": {
+ "endPosition": "1212",
+ "kind": "NUMBER_LITERAL",
+ "value": "1",
+ "startPosition": "1211"
+ }
+ },
+ {
+ "endPosition": "1219",
+ "kind": "VARIABLE",
+ "name": "b",
+ "startPosition": "1214",
+ "initializer": {
+ "endPosition": "1219",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "1218"
+ }
+ },
+ {
+ "endPosition": "1226",
+ "kind": "VARIABLE",
+ "name": "c",
+ "startPosition": "1221",
+ "initializer": {
+ "endPosition": "1226",
+ "kind": "NUMBER_LITERAL",
+ "value": "3",
+ "startPosition": "1225"
+ }
+ }
+ ],
+ "sourceName": "parsertests/varDecl.js",
+ "strict": "false",
+ "startPosition": "1143"
+}
+,
+{
+ "endPosition": "1111",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1133",
+ "kind": "WITH",
+ "scope": {
+ "endPosition": "1122",
+ "kind": "IDENTIFIER",
+ "name": "scope",
+ "startPosition": "1117"
+ },
+ "statement": {
+ "endPosition": "1133",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1131",
+ "kind": "IDENTIFIER",
+ "name": "y",
+ "startPosition": "1130"
+ },
+ "endPosition": "1131",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "endPosition": "1127",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1126"
+ },
+ "startPosition": "1126"
+ },
+ "endPosition": "1131",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1126"
+ }
+ ],
+ "startPosition": "1124"
+ },
+ "startPosition": "1111"
+ }
+ ],
+ "sourceName": "parsertests/withStat.js",
+ "strict": "false",
+ "startPosition": "1111"
+}
+,
+{
+ "fileName": "parsernegativetests/caseoutofswitch.js",
+ "code": "case (1090, 4)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1090",
+ "message": "parsernegativetests/caseoutofswitch.js:29:0 Expected an operand but found case\ncase 23:\n^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/caseoutofswitch.js",
+ "code": "default (1112, 7)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1112",
+ "message": "parsernegativetests/caseoutofswitch.js:31:0 Expected an operand but found default\ndefault:\n^",
+ "lineNumber": "31"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1098",
+ "kind": "ERROR",
+ "startPosition": "1090"
+ },
+ "endPosition": "1098",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1090"
+ },
+ {
+ "expression": {
+ "endPosition": "1110",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1104",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1099"
+ },
+ "arguments": [
+ {
+ "endPosition": "1108",
+ "kind": "STRING_LITERAL",
+ "value": "23",
+ "startPosition": "1106"
+ }
+ ],
+ "startPosition": "1099"
+ },
+ "endPosition": "1110",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1099"
+ },
+ {
+ "expression": {
+ "endPosition": "1120",
+ "kind": "ERROR",
+ "startPosition": "1112"
+ },
+ "endPosition": "1120",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1112"
+ },
+ {
+ "expression": {
+ "endPosition": "1135",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "1126",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "1121"
+ },
+ "arguments": [
+ {
+ "endPosition": "1133",
+ "kind": "STRING_LITERAL",
+ "value": "hello",
+ "startPosition": "1128"
+ }
+ ],
+ "startPosition": "1121"
+ },
+ "endPosition": "1135",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1121"
+ }
+ ],
+ "sourceName": "parsernegativetests/caseoutofswitch.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/illegalbreak.js",
+ "code": "break (1090, 5)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1090",
+ "message": "parsernegativetests/illegalbreak.js:29:0 Illegal break statement\nbreak;\n^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/illegalbreak.js",
+ "code": "ident (1103, 3)",
+ "columnNumber": "6",
+ "kind": "ERROR",
+ "position": "1103",
+ "message": "parsernegativetests/illegalbreak.js:30:6 Undefined Label \"foo\"\nbreak foo;\n ^",
+ "lineNumber": "30"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1096",
+ "kind": "ERROR",
+ "startPosition": "1095"
+ },
+ "endPosition": "1096",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1095"
+ },
+ {
+ "expression": {
+ "endPosition": "1107",
+ "kind": "ERROR",
+ "startPosition": "1106"
+ },
+ "endPosition": "1107",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1106"
+ }
+ ],
+ "sourceName": "parsernegativetests/illegalbreak.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/illegalcontinue.js",
+ "code": "continue (1090, 8)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1090",
+ "message": "parsernegativetests/illegalcontinue.js:29:0 Illegal continue statement\ncontinue;\n^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/illegalcontinue.js",
+ "code": "ident (1109, 3)",
+ "columnNumber": "9",
+ "kind": "ERROR",
+ "position": "1109",
+ "message": "parsernegativetests/illegalcontinue.js:30:9 Undefined Label \"foo\"\ncontinue foo;\n ^",
+ "lineNumber": "30"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1099",
+ "kind": "ERROR",
+ "startPosition": "1098"
+ },
+ "endPosition": "1099",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1098"
+ },
+ {
+ "expression": {
+ "endPosition": "1113",
+ "kind": "ERROR",
+ "startPosition": "1112"
+ },
+ "endPosition": "1113",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1112"
+ }
+ ],
+ "sourceName": "parsernegativetests/illegalcontinue.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/illegallvalue.js",
+ "code": "decimal (1090, 2)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1090",
+ "message": "parsernegativetests/illegallvalue.js:29:0 Invalid left hand side for assignment\n44 = 54;\n^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/illegallvalue.js",
+ "code": "decimal (1099, 3)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1099",
+ "message": "parsernegativetests/illegallvalue.js:30:0 Invalid left hand side for assignment\n233 += 33;\n^",
+ "lineNumber": "30"
+}
+,
+{
+ "fileName": "parsernegativetests/illegallvalue.js",
+ "code": "decimal (1110, 4)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1110",
+ "message": "parsernegativetests/illegallvalue.js:31:0 Invalid left hand side for assignment\n3423 -= 234;\n^",
+ "lineNumber": "31"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1098",
+ "kind": "ERROR",
+ "startPosition": "1097"
+ },
+ "endPosition": "1098",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1097"
+ },
+ {
+ "expression": {
+ "endPosition": "1109",
+ "kind": "ERROR",
+ "startPosition": "1108"
+ },
+ "endPosition": "1109",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1108"
+ },
+ {
+ "expression": {
+ "endPosition": "1122",
+ "kind": "ERROR",
+ "startPosition": "1121"
+ },
+ "endPosition": "1122",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1121"
+ }
+ ],
+ "sourceName": "parsernegativetests/illegallvalue.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/illegaloperator.js",
+ "code": "* (1093, 1)",
+ "columnNumber": "3",
+ "kind": "ERROR",
+ "position": "1093",
+ "message": "parsernegativetests/illegaloperator.js:29:3 Expected an operand but found *\nx ** y\n ^",
+ "lineNumber": "29"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1096",
+ "kind": "ERROR",
+ "startPosition": "1093"
+ },
+ "endPosition": "1096",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1093"
+ }
+ ],
+ "sourceName": "parsernegativetests/illegaloperator.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/keywordident.js",
+ "code": "var (1094, 3)",
+ "columnNumber": "4",
+ "kind": "ERROR",
+ "position": "1094",
+ "message": "parsernegativetests/keywordident.js:29:4 Expected ident but found var\nvar var = 23;\n ^",
+ "lineNumber": "29"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1103",
+ "kind": "ERROR",
+ "startPosition": "1094"
+ },
+ "endPosition": "1103",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1094"
+ },
+ {
+ "endPosition": "1115",
+ "kind": "VARIABLE",
+ "name": "x",
+ "startPosition": "1108",
+ "initializer": {
+ "endPosition": "1115",
+ "kind": "NUMBER_LITERAL",
+ "value": "223",
+ "startPosition": "1112"
+ }
+ }
+ ],
+ "sourceName": "parsernegativetests/keywordident.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/parenmissing.js",
+ "code": "; (1096, 1)",
+ "columnNumber": "6",
+ "kind": "ERROR",
+ "position": "1096",
+ "message": "parsernegativetests/parenmissing.js:29:6 Expected ) but found ;\n(1 + 2;\n ^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/parenmissing.js",
+ "code": ") (1103, 1)",
+ "columnNumber": "5",
+ "kind": "ERROR",
+ "position": "1103",
+ "message": "parsernegativetests/parenmissing.js:30:5 Expected ; but found )\nx * y);\n ^",
+ "lineNumber": "30"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1097",
+ "kind": "ERROR",
+ "startPosition": "1096"
+ },
+ "endPosition": "1097",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1096"
+ },
+ {
+ "expression": {
+ "leftOperand": {
+ "endPosition": "1099",
+ "kind": "IDENTIFIER",
+ "name": "x",
+ "startPosition": "1098"
+ },
+ "endPosition": "1103",
+ "kind": "MULTIPLY",
+ "rightOperand": {
+ "endPosition": "1103",
+ "kind": "IDENTIFIER",
+ "name": "y",
+ "startPosition": "1102"
+ },
+ "startPosition": "1098"
+ },
+ "endPosition": "1103",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1098"
+ },
+ {
+ "expression": {
+ "endPosition": "1105",
+ "kind": "ERROR",
+ "startPosition": "1103"
+ },
+ "endPosition": "1105",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1103"
+ }
+ ],
+ "sourceName": "parsernegativetests/parenmissing.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/repeatedproperty.js",
+ "code": "ident (1111, 3)",
+ "columnNumber": "21",
+ "kind": "ERROR",
+ "position": "1111",
+ "message": "parsernegativetests/repeatedproperty.js:29:21 Property \"foo\" already defined\nvar obj = { foo: 34, get foo() { return 'hello' } };\n ^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/repeatedproperty.js",
+ "code": "ident (1165, 3)",
+ "columnNumber": "22",
+ "kind": "ERROR",
+ "position": "1165",
+ "message": "parsernegativetests/repeatedproperty.js:30:22 Property \"foo\" already defined\nvar obj1 = { foo: 34, set foo(x) { } };\n ^",
+ "lineNumber": "30"
+}
+,
+{
+ "fileName": "parsernegativetests/repeatedproperty.js",
+ "code": "ident (1205, 3)",
+ "columnNumber": "22",
+ "kind": "ERROR",
+ "position": "1205",
+ "message": "parsernegativetests/repeatedproperty.js:31:22 Property \"foo\" already defined\nvar obj2 = { foo: 34, set foo(x) { } };\n ^",
+ "lineNumber": "31"
+}
+,
+{
+ "fileName": "parsernegativetests/repeatedproperty.js",
+ "code": "ident (1251, 3)",
+ "columnNumber": "28",
+ "kind": "ERROR",
+ "position": "1251",
+ "message": "parsernegativetests/repeatedproperty.js:32:28 Property \"bar\" already defined\nvar obj3 = { get bar() { }, get bar() {} };\n ^",
+ "lineNumber": "32"
+}
+,
+{
+ "fileName": "parsernegativetests/repeatedproperty.js",
+ "code": "ident (1296, 3)",
+ "columnNumber": "29",
+ "kind": "ERROR",
+ "position": "1296",
+ "message": "parsernegativetests/repeatedproperty.js:33:29 Property \"bar\" already defined\nvar obj4 = { set bar(x) { }, set bar(x) {} };\n ^",
+ "lineNumber": "33"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1141",
+ "kind": "ERROR",
+ "startPosition": "1140"
+ },
+ "endPosition": "1141",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1140"
+ },
+ {
+ "expression": {
+ "endPosition": "1181",
+ "kind": "ERROR",
+ "startPosition": "1180"
+ },
+ "endPosition": "1181",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1180"
+ },
+ {
+ "expression": {
+ "endPosition": "1221",
+ "kind": "ERROR",
+ "startPosition": "1220"
+ },
+ "endPosition": "1221",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1220"
+ },
+ {
+ "expression": {
+ "endPosition": "1265",
+ "kind": "ERROR",
+ "startPosition": "1264"
+ },
+ "endPosition": "1265",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1264"
+ },
+ {
+ "expression": {
+ "endPosition": "1311",
+ "kind": "ERROR",
+ "startPosition": "1310"
+ },
+ "endPosition": "1311",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1310"
+ }
+ ],
+ "sourceName": "parsernegativetests/repeatedproperty.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/strict_repeatedproperty.js",
+ "code": "ident (1126, 3)",
+ "columnNumber": "21",
+ "kind": "ERROR",
+ "position": "1126",
+ "message": "parsernegativetests/strict_repeatedproperty.js:31:21 Property \"foo\" already defined\nvar obj = { foo: 34, foo: 'hello' };\n ^",
+ "lineNumber": "31"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1101",
+ "kind": "STRING_LITERAL",
+ "value": "use strict",
+ "startPosition": "1091"
+ },
+ "endPosition": "1101",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1091"
+ },
+ {
+ "expression": {
+ "endPosition": "1140",
+ "kind": "ERROR",
+ "startPosition": "1139"
+ },
+ "endPosition": "1140",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1139"
+ }
+ ],
+ "sourceName": "parsernegativetests/strict_repeatedproperty.js",
+ "strict": "true",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/strict_repeatparam.js",
+ "code": "ident (1119, 1)",
+ "columnNumber": "14",
+ "kind": "ERROR",
+ "position": "1119",
+ "message": "parsernegativetests/strict_repeatparam.js:31:14 strict mode function cannot have duplicate parameter name \"x\"\nfunction func(x, x) {}\n ^",
+ "lineNumber": "31"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1101",
+ "kind": "STRING_LITERAL",
+ "value": "use strict",
+ "startPosition": "1091"
+ },
+ "endPosition": "1101",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1091"
+ },
+ {
+ "expression": {
+ "endPosition": "1127",
+ "kind": "ERROR",
+ "startPosition": "1128"
+ },
+ "endPosition": "1127",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1128"
+ }
+ ],
+ "sourceName": "parsernegativetests/strict_repeatparam.js",
+ "strict": "true",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/strict_with.js",
+ "code": "with (1105, 4)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1105",
+ "message": "parsernegativetests/strict_with.js:31:0 \"with\" statement cannot be used in strict mode\nwith({}) {}\n^",
+ "lineNumber": "31"
+}
+,
+{
+ "fileName": "parsernegativetests/strict_with.js",
+ "code": ") (1112, 1)",
+ "columnNumber": "7",
+ "kind": "ERROR",
+ "position": "1112",
+ "message": "parsernegativetests/strict_with.js:31:7 Expected ; but found )\nwith({}) {}\n ^",
+ "lineNumber": "31"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1101",
+ "kind": "STRING_LITERAL",
+ "value": "use strict",
+ "startPosition": "1091"
+ },
+ "endPosition": "1101",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1091"
+ },
+ {
+ "expression": {
+ "endPosition": "1112",
+ "kind": "ERROR",
+ "startPosition": "1109"
+ },
+ "endPosition": "1112",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1109"
+ },
+ {
+ "expression": {
+ "endPosition": "1116",
+ "kind": "ERROR",
+ "startPosition": "1112"
+ },
+ "endPosition": "1116",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1112"
+ }
+ ],
+ "sourceName": "parsernegativetests/strict_with.js",
+ "strict": "true",
+ "startPosition": "1090"
+}
+,
+{
+ "fileName": "parsernegativetests/toplevelreturn.js",
+ "code": "return (1090, 6)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1090",
+ "message": "parsernegativetests/toplevelreturn.js:29:0 Invalid return statement\nreturn;\n^",
+ "lineNumber": "29"
+}
+,
+{
+ "fileName": "parsernegativetests/toplevelreturn.js",
+ "code": "return (1098, 6)",
+ "columnNumber": "0",
+ "kind": "ERROR",
+ "position": "1098",
+ "message": "parsernegativetests/toplevelreturn.js:30:0 Invalid return statement\nreturn 23;\n^",
+ "lineNumber": "30"
+}
+,
+{
+ "endPosition": "1090",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "expression": {
+ "endPosition": "1097",
+ "kind": "ERROR",
+ "startPosition": "1090"
+ },
+ "endPosition": "1097",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1090"
+ },
+ {
+ "expression": {
+ "endPosition": "1108",
+ "kind": "ERROR",
+ "startPosition": "1098"
+ },
+ "endPosition": "1108",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1098"
+ }
+ ],
+ "sourceName": "parsernegativetests/toplevelreturn.js",
+ "strict": "false",
+ "startPosition": "1090"
+}
+,
+{
+ "endPosition": "1136",
+ "kind": "COMPILATION_UNIT",
+ "sourceElements": [
+ {
+ "endPosition": "1240",
+ "kind": "FUNCTION",
+ "name": "Parser",
+ "body": {
+ "endPosition": "1218",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1217",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "create",
+ "expression": {
+ "endPosition": "1208",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1202"
+ },
+ "endPosition": "1215",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1202"
+ },
+ "arguments": [],
+ "startPosition": "1202"
+ },
+ "endPosition": "1217",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "_parser",
+ "expression": {
+ "endPosition": "1191",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "1187"
+ },
+ "endPosition": "1199",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1187"
+ },
+ "startPosition": "1187"
+ },
+ "endPosition": "1217",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1187"
+ }
+ ],
+ "startPosition": "1154"
+ },
+ "strict": "false",
+ "startPosition": "1136",
+ "parameters": []
+ },
+ {
+ "endPosition": "3598",
+ "kind": "FUNCTION",
+ "name": "processFiles",
+ "body": {
+ "endPosition": "3555",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "2938",
+ "kind": "VARIABLE",
+ "name": "File",
+ "startPosition": "2906",
+ "initializer": {
+ "endPosition": "2938",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "2917",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "2913"
+ },
+ "endPosition": "2922",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2913"
+ },
+ "arguments": [
+ {
+ "endPosition": "2936",
+ "kind": "STRING_LITERAL",
+ "value": "java.io.File",
+ "startPosition": "2924"
+ }
+ ],
+ "startPosition": "2913"
+ }
+ },
+ {
+ "endPosition": "2993",
+ "kind": "VARIABLE",
+ "name": "files",
+ "startPosition": "2947",
+ "initializer": {
+ "endPosition": "2993",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "listFiles",
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "2981",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "2963",
+ "kind": "IDENTIFIER",
+ "name": "File",
+ "startPosition": "2959"
+ },
+ "arguments": [
+ {
+ "leftOperand": {
+ "endPosition": "2971",
+ "kind": "IDENTIFIER",
+ "name": "__DIR__",
+ "startPosition": "2964"
+ },
+ "endPosition": "2980",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "2980",
+ "kind": "IDENTIFIER",
+ "name": "subdir",
+ "startPosition": "2974"
+ },
+ "startPosition": "2964"
+ }
+ ],
+ "startPosition": "2959"
+ },
+ "endPosition": "2981",
+ "kind": "NEW",
+ "startPosition": "2955"
+ },
+ "endPosition": "2991",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2955"
+ },
+ "arguments": [],
+ "startPosition": "2955"
+ }
+ },
+ {
+ "expression": {
+ "endPosition": "3026",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "sort",
+ "expression": {
+ "identifier": "Arrays",
+ "expression": {
+ "identifier": "util",
+ "expression": {
+ "endPosition": "3002",
+ "kind": "IDENTIFIER",
+ "name": "java",
+ "startPosition": "2998"
+ },
+ "endPosition": "3007",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2998"
+ },
+ "endPosition": "3014",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2998"
+ },
+ "endPosition": "3019",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2998"
+ },
+ "arguments": [
+ {
+ "endPosition": "3025",
+ "kind": "IDENTIFIER",
+ "name": "files",
+ "startPosition": "3020"
+ }
+ ],
+ "startPosition": "2998"
+ },
+ "endPosition": "3026",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "2998"
+ },
+ {
+ "endPosition": "3049",
+ "kind": "VARIABLE",
+ "name": "file",
+ "startPosition": "3045"
+ },
+ {
+ "expression": {
+ "endPosition": "3058",
+ "kind": "IDENTIFIER",
+ "name": "files",
+ "startPosition": "3053"
+ },
+ "endPosition": "3555",
+ "kind": "FOR_IN_LOOP",
+ "forEach": "true",
+ "variable": {
+ "endPosition": "3049",
+ "kind": "IDENTIFIER",
+ "name": "file",
+ "startPosition": "3045"
+ },
+ "statement": {
+ "endPosition": "3555",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "condition": {
+ "endPosition": "3098",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "endsWith",
+ "expression": {
+ "identifier": "name",
+ "expression": {
+ "endPosition": "3077",
+ "kind": "IDENTIFIER",
+ "name": "file",
+ "startPosition": "3073"
+ },
+ "endPosition": "3082",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3073"
+ },
+ "endPosition": "3091",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3073"
+ },
+ "arguments": [
+ {
+ "endPosition": "3096",
+ "kind": "STRING_LITERAL",
+ "value": ".js",
+ "startPosition": "3093"
+ }
+ ],
+ "startPosition": "3073"
+ },
+ "endPosition": "3550",
+ "kind": "IF",
+ "startPosition": "3069",
+ "thenStatement": {
+ "endPosition": "3550",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "3141",
+ "kind": "VARIABLE",
+ "name": "script",
+ "startPosition": "3117",
+ "initializer": {
+ "endPosition": "3141",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3135",
+ "kind": "IDENTIFIER",
+ "name": "readFully",
+ "startPosition": "3126"
+ },
+ "arguments": [
+ {
+ "endPosition": "3140",
+ "kind": "IDENTIFIER",
+ "name": "file",
+ "startPosition": "3136"
+ }
+ ],
+ "startPosition": "3126"
+ }
+ },
+ {
+ "endPosition": "3179",
+ "kind": "VARIABLE",
+ "name": "parser",
+ "startPosition": "3158",
+ "initializer": {
+ "constructorExpression": {
+ "endPosition": "3179",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3177",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "3171"
+ },
+ "arguments": [],
+ "startPosition": "3171"
+ },
+ "endPosition": "3179",
+ "kind": "NEW",
+ "startPosition": "3167"
+ }
+ },
+ {
+ "endPosition": "3415",
+ "kind": "VARIABLE",
+ "name": "tree",
+ "startPosition": "3196",
+ "initializer": {
+ "endPosition": "3415",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "parse",
+ "expression": {
+ "endPosition": "3209",
+ "kind": "IDENTIFIER",
+ "name": "parser",
+ "startPosition": "3203"
+ },
+ "endPosition": "3215",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3203"
+ },
+ "arguments": [
+ {
+ "leftOperand": {
+ "leftOperand": {
+ "endPosition": "3222",
+ "kind": "IDENTIFIER",
+ "name": "subdir",
+ "startPosition": "3216"
+ },
+ "endPosition": "3227",
+ "kind": "PLUS",
+ "rightOperand": {
+ "endPosition": "3227",
+ "kind": "STRING_LITERAL",
+ "value": "/",
+ "startPosition": "3226"
+ },
+ "startPosition": "3216"
+ },
+ "endPosition": "3240",
+ "kind": "PLUS",
+ "rightOperand": {
+ "identifier": "name",
+ "expression": {
+ "endPosition": "3235",
+ "kind": "IDENTIFIER",
+ "name": "file",
+ "startPosition": "3231"
+ },
+ "endPosition": "3240",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3231"
+ },
+ "startPosition": "3216"
+ },
+ {
+ "endPosition": "3248",
+ "kind": "IDENTIFIER",
+ "name": "script",
+ "startPosition": "3242"
+ },
+ {
+ "endPosition": "3286",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "3397",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "3365",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3312",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3307"
+ },
+ "arguments": [
+ {
+ "endPosition": "3364",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "stringify",
+ "expression": {
+ "endPosition": "3317",
+ "kind": "IDENTIFIER",
+ "name": "JSON",
+ "startPosition": "3313"
+ },
+ "endPosition": "3327",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3313"
+ },
+ "arguments": [
+ {
+ "endPosition": "3354",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "convert",
+ "expression": {
+ "endPosition": "3334",
+ "kind": "IDENTIFIER",
+ "name": "parser",
+ "startPosition": "3328"
+ },
+ "endPosition": "3342",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3328"
+ },
+ "arguments": [
+ {
+ "endPosition": "3353",
+ "kind": "IDENTIFIER",
+ "name": "diagnostic",
+ "startPosition": "3343"
+ }
+ ],
+ "startPosition": "3328"
+ },
+ {
+ "endPosition": "3360",
+ "kind": "NULL_LITERAL",
+ "startPosition": "3356"
+ },
+ {
+ "endPosition": "3363",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "3362"
+ }
+ ],
+ "startPosition": "3313"
+ }
+ ],
+ "startPosition": "3307"
+ },
+ "endPosition": "3365",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3307"
+ },
+ {
+ "expression": {
+ "endPosition": "3396",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3391",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3386"
+ },
+ "arguments": [
+ {
+ "endPosition": "3394",
+ "kind": "STRING_LITERAL",
+ "value": ",",
+ "startPosition": "3393"
+ }
+ ],
+ "startPosition": "3386"
+ },
+ "endPosition": "3396",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3386"
+ }
+ ],
+ "startPosition": "3286"
+ },
+ "strict": "false",
+ "startPosition": "3286",
+ "parameters": [
+ {
+ "endPosition": "3284",
+ "kind": "IDENTIFIER",
+ "name": "diagnostic",
+ "startPosition": "3274"
+ }
+ ]
+ }
+ ],
+ "startPosition": "3203"
+ }
+ },
+ {
+ "condition": {
+ "leftOperand": {
+ "endPosition": "3437",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "3433"
+ },
+ "endPosition": "3445",
+ "kind": "NOT_EQUAL_TO",
+ "rightOperand": {
+ "endPosition": "3445",
+ "kind": "NULL_LITERAL",
+ "startPosition": "3441"
+ },
+ "startPosition": "3433"
+ },
+ "endPosition": "3541",
+ "kind": "IF",
+ "startPosition": "3429",
+ "thenStatement": {
+ "endPosition": "3541",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "3500",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3469",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3464"
+ },
+ "arguments": [
+ {
+ "endPosition": "3499",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "stringify",
+ "expression": {
+ "endPosition": "3474",
+ "kind": "IDENTIFIER",
+ "name": "JSON",
+ "startPosition": "3470"
+ },
+ "endPosition": "3484",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3470"
+ },
+ "arguments": [
+ {
+ "endPosition": "3489",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "3485"
+ },
+ {
+ "endPosition": "3495",
+ "kind": "NULL_LITERAL",
+ "startPosition": "3491"
+ },
+ {
+ "endPosition": "3498",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "3497"
+ }
+ ],
+ "startPosition": "3470"
+ }
+ ],
+ "startPosition": "3464"
+ },
+ "endPosition": "3500",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3464"
+ },
+ {
+ "expression": {
+ "endPosition": "3527",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3522",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3517"
+ },
+ "arguments": [
+ {
+ "endPosition": "3525",
+ "kind": "STRING_LITERAL",
+ "value": ",",
+ "startPosition": "3524"
+ }
+ ],
+ "startPosition": "3517"
+ },
+ "endPosition": "3527",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3517"
+ }
+ ],
+ "startPosition": "3447"
+ }
+ }
+ ],
+ "startPosition": "3100"
+ }
+ }
+ ],
+ "startPosition": "3060"
+ },
+ "startPosition": "3031"
+ }
+ ],
+ "startPosition": "2897"
+ },
+ "strict": "false",
+ "startPosition": "2867",
+ "parameters": [
+ {
+ "endPosition": "2895",
+ "kind": "IDENTIFIER",
+ "name": "subdir",
+ "startPosition": "2889"
+ }
+ ]
+ },
+ {
+ "endPosition": "3901",
+ "kind": "FUNCTION",
+ "name": "main",
+ "body": {
+ "endPosition": "3899",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "3631",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3626",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3621"
+ },
+ "arguments": [
+ {
+ "endPosition": "3629",
+ "kind": "STRING_LITERAL",
+ "value": "[",
+ "startPosition": "3628"
+ }
+ ],
+ "startPosition": "3621"
+ },
+ "endPosition": "3631",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3621"
+ },
+ {
+ "expression": {
+ "endPosition": "3665",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3650",
+ "kind": "IDENTIFIER",
+ "name": "processFiles",
+ "startPosition": "3638"
+ },
+ "arguments": [
+ {
+ "endPosition": "3663",
+ "kind": "STRING_LITERAL",
+ "value": "parsertests",
+ "startPosition": "3652"
+ }
+ ],
+ "startPosition": "3638"
+ },
+ "endPosition": "3665",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3638"
+ },
+ {
+ "expression": {
+ "endPosition": "3706",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3683",
+ "kind": "IDENTIFIER",
+ "name": "processFiles",
+ "startPosition": "3671"
+ },
+ "arguments": [
+ {
+ "endPosition": "3704",
+ "kind": "STRING_LITERAL",
+ "value": "parsernegativetests",
+ "startPosition": "3685"
+ }
+ ],
+ "startPosition": "3671"
+ },
+ "endPosition": "3706",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3671"
+ },
+ {
+ "endPosition": "3775",
+ "kind": "VARIABLE",
+ "name": "script",
+ "startPosition": "3747",
+ "initializer": {
+ "endPosition": "3775",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3765",
+ "kind": "IDENTIFIER",
+ "name": "readFully",
+ "startPosition": "3756"
+ },
+ "arguments": [
+ {
+ "endPosition": "3774",
+ "kind": "IDENTIFIER",
+ "name": "__FILE__",
+ "startPosition": "3766"
+ }
+ ],
+ "startPosition": "3756"
+ }
+ },
+ {
+ "endPosition": "3840",
+ "kind": "VARIABLE",
+ "name": "tree",
+ "startPosition": "3785",
+ "initializer": {
+ "endPosition": "3840",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "parse",
+ "expression": {
+ "constructorExpression": {
+ "endPosition": "3804",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3802",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "3796"
+ },
+ "arguments": [],
+ "startPosition": "3796"
+ },
+ "endPosition": "3804",
+ "kind": "NEW",
+ "startPosition": "3792"
+ },
+ "endPosition": "3810",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3792"
+ },
+ "arguments": [
+ {
+ "endPosition": "3824",
+ "kind": "STRING_LITERAL",
+ "value": "parserapi.js",
+ "startPosition": "3812"
+ },
+ {
+ "endPosition": "3833",
+ "kind": "IDENTIFIER",
+ "name": "script",
+ "startPosition": "3827"
+ },
+ {
+ "endPosition": "3839",
+ "kind": "NULL_LITERAL",
+ "startPosition": "3835"
+ }
+ ],
+ "startPosition": "3792"
+ }
+ },
+ {
+ "expression": {
+ "endPosition": "3882",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3851",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3846"
+ },
+ "arguments": [
+ {
+ "endPosition": "3881",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "stringify",
+ "expression": {
+ "endPosition": "3856",
+ "kind": "IDENTIFIER",
+ "name": "JSON",
+ "startPosition": "3852"
+ },
+ "endPosition": "3866",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "3852"
+ },
+ "arguments": [
+ {
+ "endPosition": "3871",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "3867"
+ },
+ {
+ "endPosition": "3877",
+ "kind": "NULL_LITERAL",
+ "startPosition": "3873"
+ },
+ {
+ "endPosition": "3880",
+ "kind": "NUMBER_LITERAL",
+ "value": "2",
+ "startPosition": "3879"
+ }
+ ],
+ "startPosition": "3852"
+ }
+ ],
+ "startPosition": "3846"
+ },
+ "endPosition": "3882",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3846"
+ },
+ {
+ "expression": {
+ "endPosition": "3898",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3893",
+ "kind": "IDENTIFIER",
+ "name": "print",
+ "startPosition": "3888"
+ },
+ "arguments": [
+ {
+ "endPosition": "3896",
+ "kind": "STRING_LITERAL",
+ "value": "]",
+ "startPosition": "3895"
+ }
+ ],
+ "startPosition": "3888"
+ },
+ "endPosition": "3898",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3888"
+ }
+ ],
+ "startPosition": "3615"
+ },
+ "strict": "false",
+ "startPosition": "3599",
+ "parameters": []
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1305",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "1265",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "1261"
+ },
+ "endPosition": "1270",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1261"
+ },
+ "arguments": [
+ {
+ "endPosition": "1303",
+ "kind": "STRING_LITERAL",
+ "value": "jdk.nashorn.api.tree.Diagnostic",
+ "startPosition": "1272"
+ }
+ ],
+ "startPosition": "1261"
+ },
+ "endPosition": "1305",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "Diagnostic",
+ "expression": {
+ "endPosition": "1247",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1241"
+ },
+ "endPosition": "1258",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1241"
+ },
+ "startPosition": "1241"
+ },
+ "endPosition": "1305",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1241"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1390",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "1338",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "1334"
+ },
+ "endPosition": "1343",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1334"
+ },
+ "arguments": [
+ {
+ "endPosition": "1388",
+ "kind": "STRING_LITERAL",
+ "value": "jdk.nashorn.api.tree.SimpleTreeVisitorES5_1",
+ "startPosition": "1345"
+ }
+ ],
+ "startPosition": "1334"
+ },
+ "endPosition": "1390",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "SimpleTreeVisitor",
+ "expression": {
+ "endPosition": "1313",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1307"
+ },
+ "endPosition": "1331",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1307"
+ },
+ "startPosition": "1307"
+ },
+ "endPosition": "1390",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1307"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1444",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "1410",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "1406"
+ },
+ "endPosition": "1415",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1406"
+ },
+ "arguments": [
+ {
+ "endPosition": "1442",
+ "kind": "STRING_LITERAL",
+ "value": "jdk.nashorn.api.tree.Tree",
+ "startPosition": "1417"
+ }
+ ],
+ "startPosition": "1406"
+ },
+ "endPosition": "1444",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "Tree",
+ "expression": {
+ "endPosition": "1398",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1392"
+ },
+ "endPosition": "1403",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1392"
+ },
+ "startPosition": "1392"
+ },
+ "endPosition": "1444",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1392"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1487",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "1464",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "1460"
+ },
+ "endPosition": "1469",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1460"
+ },
+ "arguments": [
+ {
+ "endPosition": "1485",
+ "kind": "STRING_LITERAL",
+ "value": "java.util.List",
+ "startPosition": "1471"
+ }
+ ],
+ "startPosition": "1460"
+ },
+ "endPosition": "1487",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "List",
+ "expression": {
+ "endPosition": "1452",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1446"
+ },
+ "endPosition": "1457",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1446"
+ },
+ "startPosition": "1446"
+ },
+ "endPosition": "1487",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1446"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1530",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "1507",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "1503"
+ },
+ "endPosition": "1512",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1503"
+ },
+ "arguments": [
+ {
+ "endPosition": "1528",
+ "kind": "STRING_LITERAL",
+ "value": "java.lang.Enum",
+ "startPosition": "1514"
+ }
+ ],
+ "startPosition": "1503"
+ },
+ "endPosition": "1530",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "Enum",
+ "expression": {
+ "endPosition": "1495",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1489"
+ },
+ "endPosition": "1500",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1489"
+ },
+ "startPosition": "1489"
+ },
+ "endPosition": "1530",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1489"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1657",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1803",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "1716",
+ "kind": "VARIABLE",
+ "name": "tree",
+ "startPosition": "1667",
+ "initializer": {
+ "endPosition": "1716",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "parse",
+ "expression": {
+ "identifier": "_parser",
+ "expression": {
+ "endPosition": "1678",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "1674"
+ },
+ "endPosition": "1686",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1674"
+ },
+ "endPosition": "1692",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1674"
+ },
+ "arguments": [
+ {
+ "endPosition": "1697",
+ "kind": "IDENTIFIER",
+ "name": "name",
+ "startPosition": "1693"
+ },
+ {
+ "endPosition": "1705",
+ "kind": "IDENTIFIER",
+ "name": "script",
+ "startPosition": "1699"
+ },
+ {
+ "endPosition": "1715",
+ "kind": "IDENTIFIER",
+ "name": "listener",
+ "startPosition": "1707"
+ }
+ ],
+ "startPosition": "1674"
+ }
+ },
+ {
+ "expression": {
+ "endPosition": "1771",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "accept",
+ "expression": {
+ "endPosition": "1726",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "1722"
+ },
+ "endPosition": "1733",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1722"
+ },
+ "arguments": [
+ {
+ "constructorExpression": {
+ "endPosition": "1764",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "SimpleTreeVisitor",
+ "expression": {
+ "endPosition": "1744",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1738"
+ },
+ "endPosition": "1762",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1738"
+ },
+ "arguments": [],
+ "startPosition": "1744"
+ },
+ "endPosition": "1764",
+ "kind": "NEW",
+ "startPosition": "1734"
+ },
+ {
+ "endPosition": "1770",
+ "kind": "NULL_LITERAL",
+ "startPosition": "1766"
+ }
+ ],
+ "startPosition": "1722"
+ },
+ "endPosition": "1771",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1722"
+ },
+ {
+ "expression": {
+ "endPosition": "1802",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "convert",
+ "expression": {
+ "endPosition": "1788",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "1784"
+ },
+ "endPosition": "1796",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1784"
+ },
+ "arguments": [
+ {
+ "endPosition": "1801",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "1797"
+ }
+ ],
+ "startPosition": "1784"
+ },
+ "endPosition": "1803",
+ "kind": "RETURN",
+ "startPosition": "1777"
+ }
+ ],
+ "startPosition": "1657"
+ },
+ "strict": "false",
+ "startPosition": "1657",
+ "parameters": [
+ {
+ "endPosition": "1637",
+ "kind": "IDENTIFIER",
+ "name": "name",
+ "startPosition": "1633"
+ },
+ {
+ "endPosition": "1645",
+ "kind": "IDENTIFIER",
+ "name": "script",
+ "startPosition": "1639"
+ },
+ {
+ "endPosition": "1655",
+ "kind": "IDENTIFIER",
+ "name": "listener",
+ "startPosition": "1647"
+ }
+ ]
+ },
+ "endPosition": "1657",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "parse",
+ "expression": {
+ "identifier": "prototype",
+ "expression": {
+ "endPosition": "1605",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1599"
+ },
+ "endPosition": "1615",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1599"
+ },
+ "endPosition": "1621",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1599"
+ },
+ "startPosition": "1599"
+ },
+ "endPosition": "1805",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1599"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "1834",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "1897",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "1896",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "create",
+ "expression": {
+ "endPosition": "1887",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "type",
+ "expression": {
+ "endPosition": "1851",
+ "kind": "IDENTIFIER",
+ "name": "Java",
+ "startPosition": "1847"
+ },
+ "endPosition": "1856",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1847"
+ },
+ "arguments": [
+ {
+ "endPosition": "1885",
+ "kind": "STRING_LITERAL",
+ "value": "jdk.nashorn.api.tree.Parser",
+ "startPosition": "1858"
+ }
+ ],
+ "startPosition": "1847"
+ },
+ "endPosition": "1894",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1847"
+ },
+ "arguments": [],
+ "startPosition": "1894"
+ },
+ "endPosition": "1897",
+ "kind": "RETURN",
+ "startPosition": "1840"
+ }
+ ],
+ "startPosition": "1834"
+ },
+ "strict": "false",
+ "startPosition": "1834",
+ "parameters": []
+ },
+ "endPosition": "1834",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "create",
+ "expression": {
+ "endPosition": "1813",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1807"
+ },
+ "endPosition": "1820",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1807"
+ },
+ "startPosition": "1807"
+ },
+ "endPosition": "1971",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1807"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "2014",
+ "kind": "FUNCTION_EXPRESSION",
+ "body": {
+ "endPosition": "2863",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "condition": {
+ "leftOperand": {
+ "expression": {
+ "endPosition": "2029",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "2025"
+ },
+ "endPosition": "2029",
+ "kind": "LOGICAL_COMPLEMENT",
+ "startPosition": "2024"
+ },
+ "endPosition": "2055",
+ "kind": "CONDITIONAL_OR",
+ "rightOperand": {
+ "leftOperand": {
+ "expression": {
+ "endPosition": "2044",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "2040"
+ },
+ "endPosition": "2044",
+ "kind": "TYPEOF",
+ "startPosition": "2033"
+ },
+ "endPosition": "2055",
+ "kind": "NOT_EQUAL_TO",
+ "rightOperand": {
+ "endPosition": "2055",
+ "kind": "STRING_LITERAL",
+ "value": "object",
+ "startPosition": "2049"
+ },
+ "startPosition": "2033"
+ },
+ "startPosition": "2024"
+ },
+ "endPosition": "2086",
+ "kind": "IF",
+ "startPosition": "2020",
+ "thenStatement": {
+ "endPosition": "2086",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "endPosition": "2079",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "2075"
+ },
+ "endPosition": "2080",
+ "kind": "RETURN",
+ "startPosition": "2068"
+ }
+ ],
+ "startPosition": "2058"
+ }
+ },
+ {
+ "endPosition": "2133",
+ "kind": "VARIABLE",
+ "name": "obj",
+ "startPosition": "2096",
+ "initializer": {
+ "endPosition": "2133",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "bindProperties",
+ "expression": {
+ "endPosition": "2108",
+ "kind": "IDENTIFIER",
+ "name": "Object",
+ "startPosition": "2102"
+ },
+ "endPosition": "2123",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2102"
+ },
+ "arguments": [
+ {
+ "endPosition": "2126",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "2124",
+ "properties": []
+ },
+ {
+ "endPosition": "2132",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "2128"
+ }
+ ],
+ "startPosition": "2102"
+ }
+ },
+ {
+ "endPosition": "2154",
+ "kind": "VARIABLE",
+ "name": "result",
+ "startPosition": "2143",
+ "initializer": {
+ "endPosition": "2154",
+ "kind": "OBJECT_LITERAL",
+ "startPosition": "2152",
+ "properties": []
+ }
+ },
+ {
+ "endPosition": "2170",
+ "kind": "VARIABLE",
+ "name": "i",
+ "startPosition": "2169"
+ },
+ {
+ "expression": {
+ "endPosition": "2177",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "2174"
+ },
+ "endPosition": "2845",
+ "kind": "FOR_IN_LOOP",
+ "forEach": "false",
+ "variable": {
+ "endPosition": "2170",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "2169"
+ },
+ "statement": {
+ "endPosition": "2845",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "2204",
+ "kind": "VARIABLE",
+ "name": "val",
+ "startPosition": "2192",
+ "initializer": {
+ "expression": {
+ "endPosition": "2201",
+ "kind": "IDENTIFIER",
+ "name": "obj",
+ "startPosition": "2198"
+ },
+ "endPosition": "2204",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2203",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "2202"
+ },
+ "startPosition": "2198"
+ }
+ },
+ {
+ "condition": {
+ "leftOperand": {
+ "endPosition": "2220",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2217"
+ },
+ "expression": {
+ "endPosition": "2220",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2217"
+ },
+ "endPosition": "2243",
+ "kind": "INSTANCE_OF",
+ "rightOperand": {
+ "identifier": "Tree",
+ "expression": {
+ "endPosition": "2238",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "2232"
+ },
+ "endPosition": "2243",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2232"
+ },
+ "type": {
+ "identifier": "Tree",
+ "expression": {
+ "endPosition": "2238",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "2232"
+ },
+ "endPosition": "2243",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2232"
+ },
+ "startPosition": "2217"
+ },
+ "elseStatement": {
+ "condition": {
+ "leftOperand": {
+ "endPosition": "2309",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2306"
+ },
+ "expression": {
+ "endPosition": "2309",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2306"
+ },
+ "endPosition": "2332",
+ "kind": "INSTANCE_OF",
+ "rightOperand": {
+ "identifier": "List",
+ "expression": {
+ "endPosition": "2327",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "2321"
+ },
+ "endPosition": "2332",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2321"
+ },
+ "type": {
+ "identifier": "List",
+ "expression": {
+ "endPosition": "2327",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "2321"
+ },
+ "endPosition": "2332",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2321"
+ },
+ "startPosition": "2306"
+ },
+ "elseStatement": {
+ "endPosition": "2840",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "cases": [
+ {
+ "expression": {
+ "endPosition": "2574",
+ "kind": "STRING_LITERAL",
+ "value": "number",
+ "startPosition": "2568"
+ },
+ "endPosition": "2576",
+ "kind": "CASE",
+ "statements": [],
+ "startPosition": "2562"
+ },
+ {
+ "expression": {
+ "endPosition": "2603",
+ "kind": "STRING_LITERAL",
+ "value": "string",
+ "startPosition": "2597"
+ },
+ "endPosition": "2605",
+ "kind": "CASE",
+ "statements": [],
+ "startPosition": "2591"
+ },
+ {
+ "expression": {
+ "endPosition": "2633",
+ "kind": "STRING_LITERAL",
+ "value": "boolean",
+ "startPosition": "2626"
+ },
+ "endPosition": "2678",
+ "kind": "CASE",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "2677",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "2672",
+ "kind": "IDENTIFIER",
+ "name": "String",
+ "startPosition": "2666"
+ },
+ "arguments": [
+ {
+ "endPosition": "2676",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2673"
+ }
+ ],
+ "startPosition": "2666"
+ },
+ "endPosition": "2677",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "expression": {
+ "endPosition": "2660",
+ "kind": "IDENTIFIER",
+ "name": "result",
+ "startPosition": "2654"
+ },
+ "endPosition": "2663",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2662",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "2661"
+ },
+ "startPosition": "2654"
+ },
+ "startPosition": "2654"
+ },
+ "endPosition": "2677",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "2654"
+ }
+ ],
+ "startPosition": "2620"
+ },
+ {
+ "endPosition": "2820",
+ "kind": "CASE",
+ "statements": [
+ {
+ "condition": {
+ "leftOperand": {
+ "endPosition": "2727",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2724"
+ },
+ "expression": {
+ "endPosition": "2727",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2724"
+ },
+ "endPosition": "2750",
+ "kind": "INSTANCE_OF",
+ "rightOperand": {
+ "identifier": "Enum",
+ "expression": {
+ "endPosition": "2745",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "2739"
+ },
+ "endPosition": "2750",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2739"
+ },
+ "type": {
+ "identifier": "Enum",
+ "expression": {
+ "endPosition": "2745",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "2739"
+ },
+ "endPosition": "2750",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2739"
+ },
+ "startPosition": "2724"
+ },
+ "endPosition": "2820",
+ "kind": "IF",
+ "startPosition": "2720",
+ "thenStatement": {
+ "endPosition": "2820",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "2799",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "2794",
+ "kind": "IDENTIFIER",
+ "name": "String",
+ "startPosition": "2788"
+ },
+ "arguments": [
+ {
+ "endPosition": "2798",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2795"
+ }
+ ],
+ "startPosition": "2788"
+ },
+ "endPosition": "2799",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "expression": {
+ "endPosition": "2782",
+ "kind": "IDENTIFIER",
+ "name": "result",
+ "startPosition": "2776"
+ },
+ "endPosition": "2785",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2784",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "2783"
+ },
+ "startPosition": "2776"
+ },
+ "startPosition": "2776"
+ },
+ "endPosition": "2799",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "2776"
+ }
+ ],
+ "startPosition": "2752"
+ }
+ }
+ ],
+ "startPosition": "2693"
+ }
+ ],
+ "expression": {
+ "expression": {
+ "endPosition": "2544",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2541"
+ },
+ "endPosition": "2544",
+ "kind": "TYPEOF",
+ "startPosition": "2534"
+ },
+ "endPosition": "2832",
+ "kind": "SWITCH",
+ "startPosition": "2526"
+ }
+ ],
+ "startPosition": "2514"
+ },
+ "endPosition": "2840",
+ "kind": "IF",
+ "startPosition": "2302",
+ "thenStatement": {
+ "endPosition": "2508",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "endPosition": "2377",
+ "kind": "VARIABLE",
+ "name": "arr",
+ "startPosition": "2350",
+ "initializer": {
+ "constructorExpression": {
+ "endPosition": "2377",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "2365",
+ "kind": "IDENTIFIER",
+ "name": "Array",
+ "startPosition": "2360"
+ },
+ "arguments": [
+ {
+ "endPosition": "2376",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "size",
+ "expression": {
+ "endPosition": "2369",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2366"
+ },
+ "endPosition": "2374",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2366"
+ },
+ "arguments": [],
+ "startPosition": "2366"
+ }
+ ],
+ "startPosition": "2360"
+ },
+ "endPosition": "2377",
+ "kind": "NEW",
+ "startPosition": "2356"
+ }
+ },
+ {
+ "endPosition": "2399",
+ "kind": "VARIABLE",
+ "name": "j",
+ "startPosition": "2398"
+ },
+ {
+ "expression": {
+ "endPosition": "2406",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2403"
+ },
+ "endPosition": "2466",
+ "kind": "FOR_IN_LOOP",
+ "forEach": "false",
+ "variable": {
+ "endPosition": "2399",
+ "kind": "IDENTIFIER",
+ "name": "j",
+ "startPosition": "2398"
+ },
+ "statement": {
+ "endPosition": "2466",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "2453",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "convert",
+ "expression": {
+ "endPosition": "2437",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "2433"
+ },
+ "endPosition": "2445",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2433"
+ },
+ "arguments": [
+ {
+ "expression": {
+ "endPosition": "2449",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2446"
+ },
+ "endPosition": "2452",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2451",
+ "kind": "IDENTIFIER",
+ "name": "j",
+ "startPosition": "2450"
+ },
+ "startPosition": "2446"
+ }
+ ],
+ "startPosition": "2433"
+ },
+ "endPosition": "2453",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "expression": {
+ "endPosition": "2427",
+ "kind": "IDENTIFIER",
+ "name": "arr",
+ "startPosition": "2424"
+ },
+ "endPosition": "2430",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2429",
+ "kind": "IDENTIFIER",
+ "name": "j",
+ "startPosition": "2428"
+ },
+ "startPosition": "2424"
+ },
+ "startPosition": "2424"
+ },
+ "endPosition": "2453",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "2424"
+ }
+ ],
+ "startPosition": "2408"
+ },
+ "startPosition": "2389"
+ },
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "2499",
+ "kind": "IDENTIFIER",
+ "name": "arr",
+ "startPosition": "2496"
+ },
+ "endPosition": "2499",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "expression": {
+ "endPosition": "2490",
+ "kind": "IDENTIFIER",
+ "name": "result",
+ "startPosition": "2484"
+ },
+ "endPosition": "2493",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2492",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "2491"
+ },
+ "startPosition": "2484"
+ },
+ "startPosition": "2484"
+ },
+ "endPosition": "2499",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "2484"
+ }
+ ],
+ "startPosition": "2334"
+ }
+ },
+ "endPosition": "2840",
+ "kind": "IF",
+ "startPosition": "2213",
+ "thenStatement": {
+ "endPosition": "2296",
+ "kind": "BLOCK",
+ "statements": [
+ {
+ "expression": {
+ "expression": {
+ "endPosition": "2286",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "identifier": "convert",
+ "expression": {
+ "endPosition": "2273",
+ "kind": "IDENTIFIER",
+ "name": "this",
+ "startPosition": "2269"
+ },
+ "endPosition": "2281",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "2269"
+ },
+ "arguments": [
+ {
+ "endPosition": "2285",
+ "kind": "IDENTIFIER",
+ "name": "val",
+ "startPosition": "2282"
+ }
+ ],
+ "startPosition": "2269"
+ },
+ "endPosition": "2286",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "expression": {
+ "endPosition": "2263",
+ "kind": "IDENTIFIER",
+ "name": "result",
+ "startPosition": "2257"
+ },
+ "endPosition": "2266",
+ "kind": "ARRAY_ACCESS",
+ "index": {
+ "endPosition": "2265",
+ "kind": "IDENTIFIER",
+ "name": "i",
+ "startPosition": "2264"
+ },
+ "startPosition": "2257"
+ },
+ "startPosition": "2257"
+ },
+ "endPosition": "2286",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "2257"
+ }
+ ],
+ "startPosition": "2245"
+ }
+ }
+ ],
+ "startPosition": "2179"
+ },
+ "startPosition": "2160"
+ },
+ {
+ "expression": {
+ "endPosition": "2862",
+ "kind": "IDENTIFIER",
+ "name": "result",
+ "startPosition": "2856"
+ },
+ "endPosition": "2863",
+ "kind": "RETURN",
+ "startPosition": "2849"
+ }
+ ],
+ "startPosition": "2014"
+ },
+ "strict": "false",
+ "startPosition": "2014",
+ "parameters": [
+ {
+ "endPosition": "2012",
+ "kind": "IDENTIFIER",
+ "name": "tree",
+ "startPosition": "2008"
+ }
+ ]
+ },
+ "endPosition": "2014",
+ "kind": "ASSIGNMENT",
+ "variable": {
+ "identifier": "convert",
+ "expression": {
+ "identifier": "prototype",
+ "expression": {
+ "endPosition": "1978",
+ "kind": "IDENTIFIER",
+ "name": "Parser",
+ "startPosition": "1972"
+ },
+ "endPosition": "1988",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1972"
+ },
+ "endPosition": "1996",
+ "kind": "MEMBER_SELECT",
+ "startPosition": "1972"
+ },
+ "startPosition": "1972"
+ },
+ "endPosition": "2865",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "1972"
+ },
+ {
+ "expression": {
+ "endPosition": "3909",
+ "kind": "FUNCTION_INVOCATION",
+ "functionSelect": {
+ "endPosition": "3907",
+ "kind": "IDENTIFIER",
+ "name": "main",
+ "startPosition": "3903"
+ },
+ "arguments": [],
+ "startPosition": "3903"
+ },
+ "endPosition": "3909",
+ "kind": "EXPRESSION_STATEMENT",
+ "startPosition": "3903"
+ }
+ ],
+ "sourceName": "parserapi.js",
+ "strict": "false",
+ "startPosition": "1136"
+}
+]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_const_as_var.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API --const-as-var option test.
+ *
+ * @test
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var constAsVarParser = Parser.create("--const-as-var");
+var parser = Parser.create();
+
+var constStr = "const PI = 3.14;";
+// this one should not report error
+constAsVarParser.parse("const_as_var.js", constStr, print);
+// default parser should report error
+parser.parse("const_as_var1.js", constStr, print);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_const_as_var.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,3 @@
+const_as_var1.js:1:0 Expected an operand but found const
+const PI = 3.14;
+^
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_empty_stat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API --empty-statements option test.
+ *
+ * @test
+ * @run
+ */
+
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+
+// with --empty-statements parse tree should contain
+// EmptyStatement tree nodes. Without this option, empty
+// statement Tree nodes may be optimized away by Parser.
+var emptyStatParser = Parser.create("--empty-statements");
+
+var emptyStat = ";";
+emptyStatParser.parse("empty.js", emptyStat, print).
+ accept(new (Java.extend(SimpleTreeVisitor)) {
+ visitEmptyStatement: function(node, p) {
+ print("inside EmptyStatement visit");
+ }
+ }, null);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_empty_stat.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,1 @@
+inside EmptyStatement visit
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_nse.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API -nse option test.
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var noExtParser = Parser.create("-nse");
+var parser = Parser.create();
+var scriptingParser = Parser.create("-scripting");
+
+var condCatch = <<EOF
+
+try {
+ that();
+} catch (e if e instanceof ReferenceError) {}
+
+EOF;
+
+noExtParser.parse("cond_catch.js", condCatch, print);
+parser.parse("cond_catch1.js", condCatch, print);
+
+var funcClosure = <<EOF
+
+function square(x) x*x;
+
+EOF;
+
+noExtParser.parse("func_closure.js", funcClosure, print);
+parser.parse("func_closure1.js", funcClosure, print);
+
+var forEach = <<EOF
+
+for each (arg in arguments) print(arg);
+
+EOF;
+
+noExtParser.parse("for_each.js", forEach, print);
+parser.parse("for_each1.js", forEach, print);
+
+var anonNew = <<EOF
+
+var r = new java.lang.Runnable() {
+ run: function() { print("hello") }
+};
+
+EOF;
+
+noExtParser.parse("anon_new.js", anonNew, print);
+parser.parse("anon_new1.js", anonNew, print);
+
+var anonFuncStat = <<EOF
+
+function () { print("hello") }
+
+EOF;
+
+noExtParser.parse("anon_func_stat.js", anonFuncStat, print);
+parser.parse("anon_func_stat1.js", anonFuncStat, print);
+
+// These lexer (scripting) extensions should also be not parsed
+// by "no extensions parser" ( as well as "default" parser )
+
+var backquote = "`ls`";
+noExtParser.parse("backquote.js", backquote, print);
+parser.parse("backquote1.js", backquote, print);
+scriptingParser.parse("backquote2.js", backquote, print);
+
+var heredoc = "var str = <<EOF\nprint('hello')\nEOF\n";
+noExtParser.parse("heredoc.js", heredoc, print);
+parser.parse("heredoc1.js", heredoc, print);
+scriptingParser.parse("heredoc2.js", heredoc, print);
+
+var hashComment = "#comment\nprint('hello')";
+noExtParser.parse("hashcomment.js", hashComment, print);
+parser.parse("hashcomment1.js", hashComment, print);
+scriptingParser.parse("hashcomment2.js", hashComment, print);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_nse.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,43 @@
+cond_catch.js:4:11 Expected ) but found if
+} catch (e if e instanceof ReferenceError) {}
+ ^
+func_closure.js:2:19 Expected { but found x
+
+function square(x) x*x;
+ ^
+for_each.js:2:4 Expected ( but found each
+
+for each (arg in arguments) print(arg);
+ ^
+anon_new.js:2:33 Expected ; but found {
+
+var r = new java.lang.Runnable() {
+ ^
+anon_new.js:3:18 Expected ident but found (
+ run: function() { print("hello") }
+ ^
+anon_new.js:4:0 Expected eof but found }
+};
+^
+anon_func_stat.js:2:9 Expected ident but found (
+
+function () { print("hello") }
+ ^
+backquote.js:1:0 Expected an operand but found error
+`ls`
+^
+backquote1.js:1:0 Expected an operand but found error
+`ls`
+^
+heredoc.js:1:10 Expected an operand but found <<
+var str = <<EOF
+ ^
+heredoc1.js:1:10 Expected an operand but found <<
+var str = <<EOF
+ ^
+hashcomment.js:1:0 Expected an operand but found error
+#comment
+^
+hashcomment1.js:1:0 Expected an operand but found error
+#comment
+^
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_scripting.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API -scripting option test.
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var scriptingParser = Parser.create("-scripting");
+var parser = Parser.create();
+
+var backquote = "`ls`";
+scriptingParser.parse("backquote.js", backquote, print);
+parser.parse("backquote1.js", backquote, print);
+
+var heredoc = "var str = <<EOF\nprint('hello')\nEOF\n";
+scriptingParser.parse("heredoc.js", heredoc, print);
+parser.parse("heredoc1.js", heredoc, print);
+
+var hashComment = "#comment\nprint('hello')";
+scriptingParser.parse("hashcomment.js", hashComment, print);
+parser.parse("hashcomment1.js", hashComment, print);
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_scripting.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,9 @@
+backquote1.js:1:0 Expected an operand but found error
+`ls`
+^
+heredoc1.js:1:10 Expected an operand but found <<
+var str = <<EOF
+ ^
+hashcomment1.js:1:0 Expected an operand but found error
+#comment
+^
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_strict.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API -strict option test.
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var strictParser = Parser.create("-strict");
+var parser = Parser.create();
+
+var withStat = <<EOF
+
+with({}) {}
+EOF;
+
+strictParser.parse("with_stat.js", withStat, print);
+parser.parse("with_stat1.js", withStat, print);
+
+var repeatParam = <<EOF
+
+function func(x, x) {}
+EOF;
+
+strictParser.parse("repeat_param.js", repeatParam, print);
+parser.parse("repeat_param1.js", repeatParam, print);
+
+var repeatProp = <<EOF
+
+var obj = { foo: 34, foo: 'hello' };
+
+EOF
+
+strictParser.parse("repeat_prop.js", repeatProp, print);
+parser.parse("repeat_prop1.js", repeatProp, print);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parserapi_strict.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,16 @@
+with_stat.js:2:1 "with" statement cannot be used in strict mode
+
+with({}) {}
+ ^
+with_stat.js:2:7 Expected ; but found )
+
+with({}) {}
+ ^
+repeat_param.js:2:15 strict mode function cannot have duplicate parameter name "x"
+
+function func(x, x) {}
+ ^
+repeat_prop.js:2:22 Property "foo" already defined
+
+var obj = { foo: 34, foo: 'hello' };
+ ^
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/caseoutofswitch.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+case 23:
+print("23");
+default:
+print("hello");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/illegalbreak.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+break;
+break foo;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/illegalcontinue.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+continue;
+continue foo;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/illegallvalue.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+44 = 54;
+233 += 33;
+3423 -= 234;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/illegaloperator.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+x ** y
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/keywordident.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+var var = 23;
+var x = 223;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/parenmissing.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+(1 + 2;
+x * y);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/repeatedproperty.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+var obj = { foo: 34, get foo() { return 'hello' } };
+var obj1 = { foo: 34, set foo(x) { } };
+var obj2 = { foo: 34, set foo(x) { } };
+var obj3 = { get bar() { }, get bar() {} };
+var obj4 = { set bar(x) { }, set bar(x) {} };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/strict_repeatedproperty.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+'use strict';
+
+var obj = { foo: 34, foo: 'hello' };
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/strict_repeatparam.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+'use strict';
+
+function func(x, x) {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/strict_with.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+'use strict';
+
+with({}) {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsernegativetests/toplevelreturn.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * @subtest
+ * @negative
+ */
+
+return;
+return 23;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/array_literal.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check array literal.
+ *
+ * @subtest
+ */
+
+var x = [];
+var y = [1, 43, 5, 45];
+var z = [34,,,4];
+var k = [ {}, { x: 3 }, "hello" ];
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/assignmentExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check assignment e xyzpressions.
+ *
+ * @subtest
+ */
+
+
+xyz = 314;
+xyz += 314;
+xyz -= 314;
+xyz *= 314;
+xyz /= 314;
+xyz %= 314;
+xyz <<= 314;
+xyz >>= 314;
+xyz >>>= 314;
+xyz &= 314;
+xyz ^= 314;
+xyz |= 314;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/binaryExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check binary operators.
+ *
+ * @subtest
+ */
+
+a * b
+a / b;
+a % b;
+a + b;
+a - b;
+a << b;
+a >> b;
+a >>> b;
+a < b;
+a > b;
+a <= b;
+a >= b;
+a instanceof b;
+a == b;
+a != b;
+a === b;
+a !== b;
+a & b;
+a ^ b;
+a | b;
+a && b;
+a || b;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/block.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'block' statement.
+ *
+ * @subtest
+ */
+
+{}
+{ print("hello"); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/breakStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'break' statement.
+ *
+ * @subtest
+ */
+
+while (true) { break; };
+loop: { while (true) { break loop } };
+loop: { for (;;) { break loop } };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/condExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check ternary operator.
+ *
+ * @subtest
+ */
+
+
+a? b : c;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/continueStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'continue' statement.
+ *
+ * @subtest
+ */
+
+while (true) { continue; };
+begin: { while (true) { continue begin; } };
+start: { for(;;) { continue start; } };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/debuggerStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check debugger statement.
+ *
+ * @subtest
+ */
+
+debugger;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/functions.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'function' statements and expressions.
+ *
+ * @subtest
+ */
+
+function hello() { print('hello') }
+function hello(a) { print(a) }
+function hello(a, b) { print(a, b) }
+var hello = function() { print('hello') };
+var hello = function hello() { print('hello') };
+(function(){})
+function test() { 'use strict' };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/ifStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'if' statement.
+ *
+ * @subtest
+ */
+
+if (js) { nashorn() };
+if (js) { nashorn() } else { java() };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/labelledStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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 for labelled statements.
+ *
+ * @subtest
+ */
+
+begin: { for (;;) break begin };
+begin: { while (true) break begin };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/lhsExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check left-hand-side expressions
+ *
+ * @subtest
+ */
+
+a[3];
+a[b];
+a['foo'];
+obj.foo;
+obj.foo.bar;
+new Type;
+new Type();
+new Type(a, 'hello');
+new obj.Type;
+new obj.Type();
+new obj.Type(a, 'hello');
+foo()
+obj.foo();
+foo(a,b);
+obj.foo(a, b);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/loopStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests for loop statements.
+ *
+ * @subtest
+ */
+
+while(true) { print('hello') }
+do { print('hello') } while(true)
+for (i in obj) { print(obj[i]) }
+for each (i in obj) { print(i) }
+for (i = 0; i < 10; i++) { print(i) }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/objectLitExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check assignment e xyzpressions.
+ *
+ * @subtest
+ */
+
+obj = {};
+p = { x: 10, y: 2 };
+p = { 'x': 10, 'y': 2 };
+p = { get x() { return xValue }, get y() { return yValue } };
+p = { get foo() { return this._foo }, set foo(val) { this._foo = val } };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/parenExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests for parenthesis expressions.
+ *
+ * @subtest
+ */
+
+(2) + (1) + 4;
+3 + (7) << (5);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/primaryExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check primary expressions.
+ *
+ * @subtest
+ */
+
+this;
+foo;
+null;
+true;
+false;
+33;
+3.14;
+(10 + 3)*2;
+({});
+({ x: 3 });
+[];
+[,,];
+[4, 5, 5];
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/regexp_literal.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check regexp literal.
+ *
+ * @subtest
+ */
+
+var x = /foo/;
+var y = /foo/g;
+var z = /[a-z]*[1-10]?/;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/returnStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'return' statement.
+ *
+ * @subtest
+ */
+
+(function() { return });
+(function() { return res });
+(function() { return foo() });
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/switchStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests for switch statement.
+ *
+ * @subtest
+ */
+
+switch (key) {};
+switch (key) { case 2: hello(); break; };
+switch (key) { case 4: hello(); break; case 2: world(); break; default: break };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/throwStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests for throw statement.
+ *
+ * @subtest
+ */
+
+throw err;
+throw 'wrong';
+throw new TypeError;
+throw new TypeError('not an array');
+throw { msg: 'wrong!' };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/tryCatchStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check try..catch statements.
+ *
+ * @subtest
+ */
+
+try { } catch (e) { }
+try { } catch (e) { } finally {}
+try { } finally {}
+try { } catch (e) { handle() }
+try { that() } catch (e) { handle() } finally { clean() }
+try { that() } catch (e if e instanceof TypeError) { handle() } catch (e) { rest() }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/unaryExpr.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check unary operators.
+ *
+ * @subtest
+ */
+
+x++;
+x--;
+delete x;
+void x;
+typeof x;
+++x;
+--x;
++x;
+-x;
+~x;
+!x;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/useStrict.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check 'use strict' directive.
+ *
+ * @subtest
+ */
+
+'use strict';
+function f() { 'use strict' }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/varDecl.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests to check variable declarations.
+ *
+ * @subtest
+ */
+
+
+// no initialization
+var a;
+var a, b;
+
+// init single, multiple
+var a = 'hello';
+var a = 1, b = 2, c = 3;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parsertests/withStat.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Tests for 'with' statement.
+ *
+ * @subtest
+ */
+
+with (scope) { x = y };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parservisitor.js Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * Nashorn parser API - Basic TreeVisitor tests.
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+// Java types used
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+
+function parse(name, script, visitor) {
+ var parser = Parser.create("--empty-statements");
+ var tree = parser.parse(name, script, null);
+ return tree.accept(visitor, print);
+}
+
+parse("arrayaccess.js", "this['eval']",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitArrayAccess: function(aa) {
+ print("in visitArrayAccess " +
+ aa.expression.name + " " + aa.index.value);
+ }
+ });
+
+parse("arrayliteral.js", "[2, 3, 22]",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitArrayLiteral: function(al) {
+ print("in visitArrayLiteral");
+ for each (var e in al.elements) {
+ print(e.value);
+ }
+ }
+ });
+
+parse("assign.js", "x = 33",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitAssignment: function(an) {
+ print("in visitAssignment " +
+ an.variable.name + " " + an.expression.value);
+ }
+ });
+
+function binaryExpr(name, code) {
+ parse(name, code,
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitBinary: function(bn) {
+ print("in visitBinary " + bn.kind + " " +
+ bn.leftOperand.value + ", " + bn.rightOperand.value);
+ }
+ });
+}
+
+binaryExpr("add.js", "3 + 4");
+binaryExpr("sub.js", "3 - 4");
+binaryExpr("mul.js", "3 * 4");
+binaryExpr("div.js", "3 / 4");
+binaryExpr("rem.js", "3 % 4");
+binaryExpr("rshift.js", "3 >> 4");
+binaryExpr("rshift.js", "3 >>> 4");
+binaryExpr("lshift.js", "3 << 4");
+binaryExpr("less.js", "3 < 4");
+binaryExpr("lessOrEq.js", "3 <= 4");
+binaryExpr("greater.js", "3 > 4");
+binaryExpr("greaterOrEq.js", "3 >= 4");
+binaryExpr("in.js", "3 in this");
+binaryExpr("eq.js", "3 == 3");
+binaryExpr("ne.js", "3 != 2");
+binaryExpr("seq.js", "3 === 2");
+binaryExpr("sne.js", "3 !== 2");
+binaryExpr("and.js", "3 & 2");
+binaryExpr("or.js", "3 | 2");
+binaryExpr("xor.js", "3 ^ 2");
+binaryExpr("cond_and.js", "3 && 2");
+binaryExpr("cond_or.js", "3 || 2");
+binaryExpr("comma", "3, 2");
+
+parse("block.js", "{ print('hello'); }",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitBlock: function() {
+ print("in visitBlock");
+ }
+ });
+
+
+parse("break.js", "while(true) { break; }",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitBreak: function() {
+ print("in visitBreak");
+ }
+ });
+
+function compAssignExpr(name, code) {
+ parse(name, code,
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitCompoundAssignment: function(bn) {
+ print("in visitCompoundAssignment " + bn.kind + " " +
+ bn.variable.name + " " + bn.expression.value);
+ }
+ });
+}
+
+compAssignExpr("mult_assign.js", "x *= 3");
+compAssignExpr("div_assign.js", "x /= 3");
+compAssignExpr("rem_assign.js", "x %= 3");
+compAssignExpr("add_assign.js", "x += 3");
+compAssignExpr("sub_assign.js", "x -= 3");
+compAssignExpr("lshift_assign.js", "x <<= 3");
+compAssignExpr("rshift_assign.js", "x >>= 3");
+compAssignExpr("urshift_assign.js", "x >>>= 3");
+compAssignExpr("and_assign.js", "x &= 3");
+compAssignExpr("xor_assign.js", "x ^= 3");
+compAssignExpr("or_assign.js", "x |= 3");
+
+parse("condexpr.js", "foo? x : y",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitConditionalExpression: function() {
+ print("in visitConditionalExpression");
+ }
+ });
+
+parse("continue.js", "while(true) { continue; }",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitContinue: function() {
+ print("in visitContinue");
+ }
+ });
+
+parse("debugger.js", "debugger;",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitDebugger: function() {
+ print("in visitDebugger");
+ }
+ });
+
+parse("dowhile.js", "do {} while(true)",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitDoWhileLoop: function() {
+ print("in visitDoWhileLoop");
+ }
+ });
+
+parse("empty.js", ";",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitEmptyStatement: function() {
+ print("in visitEmptyStatement");
+ }
+ });
+
+parse("exprstat.js", "2+3;",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitExpressionStatement: function() {
+ print("in visitExpressionStatement");
+ }
+ });
+
+parse("forin.js", "for(i in this) {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitForInLoop: function() {
+ print("in visitForInLoop");
+ }
+ });
+
+parse("for.js", "for(;;) {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitForLoop: function() {
+ print("in visitForLoop");
+ }
+ });
+
+parse("funccall.js", "func()",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitFunctionCall: function(fc) {
+ print("in visitFunctionCall " + fc.functionSelect.name);
+ }
+ });
+
+parse("funcdecl.js", "function func() {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitFunctionDeclaration: function(fd) {
+ print("in visitFunctionDeclaration " + fd.name);
+ }
+ });
+
+parse("funcexpr.js", "x = function() {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitFunctionExpression: function() {
+ print("in visitFunctionExpression");
+ }
+ });
+
+parse("ident.js", "this",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitIdentifier: function(ident) {
+ print("in visitIdentifier " + ident.name);
+ }
+ });
+
+parse("if.js", "if (true) {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitIf: function() {
+ print("in visitIf");
+ }
+ });
+
+parse("if2.js", "if (true) print('yes')",
+ new (visitor = Java.extend(SimpleTreeVisitor))() {
+ visitBlock: function(node, extra) {
+ print("ERROR: No block expected here!");
+ Error.dumpStack();
+ }
+ });
+
+parse("instanceof.js", "this instanceof Object",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitInstanceOf: function() {
+ print("in visitInstanceOf");
+ }
+ });
+
+parse("labeled.js", "foo: print('hello');",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitLabeledStatement: function() {
+ print("in visitLabeledStatement");
+ }
+ });
+
+function literalExpr(name, code) {
+ parse(name, code,
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitLiteral: function(ln) {
+ print("in visitLiteral " + ln.kind + " " + ln.value);
+ }
+ });
+}
+
+literalExpr("bool.js", "true");
+literalExpr("num.js", "3.14");
+literalExpr("str.js", "'hello'");
+literalExpr("null.js", "null");
+
+parse("memselect.js", "this.foo",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitMemberSelect: function(ms) {
+ print("in visitMemberSelect " + ms.identifier);
+ }
+ });
+
+parse("new.js", "new Object()",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitNew: function() {
+ print("in visitNew");
+ }
+ });
+
+parse("obj_literal.js", "({ foo: 343 })",
+ visitor = new (Java.extend(SimpleTreeVisitor))() {
+ visitObjectLiteral: function(ol) {
+ print("in visitObjectLiteral");
+ Java.super(visitor).visitObjectLiteral(ol, null);
+ },
+
+ visitProperty: function(pn) {
+ print("in visitProperty " + pn.key.name);
+ }
+ });
+
+parse("regexp.js", "/[a-b]/i",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitRegExpLiteral: function(re) {
+ print("in visitRegExpLiteral " + re.pattern + " " + re.options);
+ }
+ });
+
+parse("ret.js", "function func() { return 33 }",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitReturn: function(ret) {
+ print("in visitReturn " + ret.expression.value);
+ }
+ });
+
+parse("switch.js", "switch(c) { case '1': break; default: }",
+ visitor = new (Java.extend(SimpleTreeVisitor))() {
+ visitSwitch: function(sn) {
+ print("in visitSwitch");
+ Java.super(visitor).visitSwitch(sn, null);
+ },
+
+ visitCase: function(cn) {
+ if (cn.expression) {
+ print("in visitCase");
+ } else {
+ print("in visitCase (default)");
+ }
+ }
+ });
+
+parse("throw.js", "throw 2",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitThrow: function(tn) {
+ print("in visitThrow " + tn.expression.value);
+ }
+ });
+
+parse("try.js", "try { func() } catch(e) {}",
+ visitor = new (Java.extend(SimpleTreeVisitor))() {
+ visitTry: function(tn) {
+ print("in visitTry");
+ Java.super(visitor).visitTry(tn, null);
+ },
+ visitCatch: function(cn) {
+ print("in visitCatch " + cn.parameter.name);
+ }
+ });
+
+function unaryExpr(name, code) {
+ parse(name, code,
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitUnary: function(un) {
+ print("in visitUnary " + un.kind + " " + un.expression.name);
+ }
+ });
+}
+
+unaryExpr("postincr.js", "x++");
+unaryExpr("postdecr.js", "x--");
+unaryExpr("preincr.js", "++x");
+unaryExpr("predecr.js", "--x");
+unaryExpr("plus.js", "+x");
+unaryExpr("minus.js", "-x");
+unaryExpr("complement.js", "~x");
+unaryExpr("logical_compl.js", "!x");
+unaryExpr("delete.js", "delete x");
+unaryExpr("typeof.js", "typeof x");
+unaryExpr("void.js", "void x");
+
+parse("var.js", "var x = 34;",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitVariable: function(vn) {
+ print("in visitVariable " + vn.name + " = " + vn.initializer.value);
+ }
+ });
+
+parse("while.js", "while(true) {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitWhileLoop: function() {
+ print("in visitWhileLoop");
+ }
+ });
+
+parse("with.js", "with({}) {}",
+ new (Java.extend(SimpleTreeVisitor))() {
+ visitWith: function() {
+ print("in visitWith");
+ }
+ });
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parservisitor.js.EXPECTED Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,87 @@
+in visitArrayAccess this eval
+in visitArrayLiteral
+2
+3
+22
+in visitAssignment x 33
+in visitBinary PLUS 3, 4
+in visitBinary MINUS 3, 4
+in visitBinary MULTIPLY 3, 4
+in visitBinary DIVIDE 3, 4
+in visitBinary REMAINDER 3, 4
+in visitBinary RIGHT_SHIFT 3, 4
+in visitBinary UNSIGNED_RIGHT_SHIFT 3, 4
+in visitBinary LEFT_SHIFT 3, 4
+in visitBinary LESS_THAN 3, 4
+in visitBinary LESS_THAN_EQUAL 3, 4
+in visitBinary GREATER_THAN 3, 4
+in visitBinary GREATER_THAN_EQUAL 3, 4
+in visitBinary IN 3, undefined
+in visitBinary EQUAL_TO 3, 3
+in visitBinary NOT_EQUAL_TO 3, 2
+in visitBinary STRICT_EQUAL_TO 3, 2
+in visitBinary STRICT_NOT_EQUAL_TO 3, 2
+in visitBinary AND 3, 2
+in visitBinary OR 3, 2
+in visitBinary XOR 3, 2
+in visitBinary CONDITIONAL_AND 3, 2
+in visitBinary CONDITIONAL_OR 3, 2
+in visitBinary COMMA 3, 2
+in visitBlock
+in visitBreak
+in visitCompoundAssignment MULTIPLY_ASSIGNMENT x 3
+in visitCompoundAssignment DIVIDE_ASSIGNMENT x 3
+in visitCompoundAssignment REMAINDER_ASSIGNMENT x 3
+in visitCompoundAssignment PLUS_ASSIGNMENT x 3
+in visitCompoundAssignment MINUS_ASSIGNMENT x 3
+in visitCompoundAssignment LEFT_SHIFT_ASSIGNMENT x 3
+in visitCompoundAssignment RIGHT_SHIFT_ASSIGNMENT x 3
+in visitCompoundAssignment UNSIGNED_RIGHT_SHIFT_ASSIGNMENT x 3
+in visitCompoundAssignment AND_ASSIGNMENT x 3
+in visitCompoundAssignment XOR_ASSIGNMENT x 3
+in visitCompoundAssignment OR_ASSIGNMENT x 3
+in visitConditionalExpression
+in visitContinue
+in visitDebugger
+in visitDoWhileLoop
+in visitEmptyStatement
+in visitExpressionStatement
+in visitForInLoop
+in visitForLoop
+in visitFunctionCall func
+in visitFunctionDeclaration func
+in visitFunctionExpression
+in visitIdentifier this
+in visitIf
+in visitInstanceOf
+in visitLabeledStatement
+in visitLiteral BOOLEAN_LITERAL true
+in visitLiteral NUMBER_LITERAL 3.14
+in visitLiteral STRING_LITERAL hello
+in visitLiteral NULL_LITERAL null
+in visitMemberSelect foo
+in visitNew
+in visitObjectLiteral
+in visitProperty foo
+in visitRegExpLiteral [a-b] i
+in visitReturn 33
+in visitSwitch
+in visitCase
+in visitCase (default)
+in visitThrow 2
+in visitTry
+in visitCatch e
+in visitUnary POSTFIX_INCREMENT x
+in visitUnary POSTFIX_DECREMENT x
+in visitUnary PREFIX_INCREMENT x
+in visitUnary PREFIX_DECREMENT x
+in visitUnary PLUS x
+in visitUnary MINUS x
+in visitUnary BITWISE_COMPLEMENT x
+in visitUnary LOGICAL_COMPLEMENT x
+in visitUnary DELETE x
+in visitUnary TYPEOF x
+in visitUnary VOID x
+in visitVariable x = 34
+in visitWhileLoop
+in visitWith
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/api/tree/ParseAPITest.java Tue Mar 17 12:30:53 2015 -0700
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2015, 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.tree;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * Test for nashorn Parser API (jdk.nashorn.api.tree.*)
+ */
+public class ParseAPITest {
+
+ private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("parserapitest.verbose"));
+ private static final boolean TEST262 = Boolean.valueOf(System.getProperty("parserapitest.test262"));
+
+ private static final String TEST_BASIC_DIR = System.getProperty("test.basic.dir");
+ private static final String TEST_MAPTESTS_DIR = System.getProperty("test.maptests.dir");
+ private static final String TEST_SANDBOX_DIR = System.getProperty("test.sandbox.dir");
+ private static final String TEST_TRUSTED_DIR = System.getProperty("test.trusted.dir");
+ private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir");
+
+ interface TestFilter {
+ public boolean exclude(File file, String content);
+ }
+
+ private void log(String msg) {
+ org.testng.Reporter.log(msg, true);
+ }
+
+ private static final String[] options = new String[] {
+ "-scripting", "--const-as-var"
+ };
+
+ @Test
+ public void parseAllTests() {
+ if (TEST262) {
+ parseTestSet(TEST262_SUITE_DIR, new TestFilter() {
+ @Override
+ public boolean exclude(final File file, final String content) {
+ return content.indexOf("@negative") != -1;
+ }
+ });
+ }
+ parseTestSet(TEST_BASIC_DIR, new TestFilter() {
+ @Override
+ public boolean exclude(final File file, final String content) {
+ return file.getParentFile().getName().equals("es6");
+ }
+ });
+ parseTestSet(TEST_MAPTESTS_DIR, null);
+ parseTestSet(TEST_SANDBOX_DIR, null);
+ parseTestSet(TEST_TRUSTED_DIR, null);
+ }
+
+ private void parseTestSet(final String testSet, 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;
+ }
+ log(testSetDir.getAbsolutePath());
+ parseJSDirectory(testSetDir, filter);
+
+ log(testSet + " parse API done!");
+ log("parse API ok: " + passed);
+ log("parse API failed: " + failed);
+ log("parse API skipped: " + skipped);
+ if (failed != 0) {
+ Assert.fail(failed + " tests failed to parse in " + testSetDir.getAbsolutePath());
+ }
+ }
+
+ // number of scripts that parsed fine
+ private int passed;
+ // number of scripts resulting in parse failure
+ private int failed;
+ // scripts that were skipped - all tests with @negative are
+ // skipped for now.
+ private int skipped;
+
+ private void parseJSDirectory(final File dir, final TestFilter filter) {
+ for (final File f : dir.listFiles()) {
+ if (f.isDirectory()) {
+ parseJSDirectory(f, filter);
+ } else if (f.getName().endsWith(".js")) {
+ parseJSFile(f, filter);
+ }
+ }
+ }
+
+ private void parseJSFile(final File file, final TestFilter filter) {
+ if (VERBOSE) {
+ log("Begin parsing " + file.getAbsolutePath());
+ }
+
+ try {
+ final char[] buffer = readFully(file);
+ final String content = new String(buffer);
+ boolean excluded = false;
+ if (filter != null) {
+ excluded = filter.exclude(file, content);
+ }
+
+ if (excluded) {
+ if (VERBOSE) {
+ log("Skipping " + file.getAbsolutePath());
+ }
+ skipped++;
+ return;
+ }
+
+ final Parser parser = Parser.create(options);
+ final Tree tree = parser.parse(file.getAbsolutePath(), content, null);
+ tree.accept(new SimpleTreeVisitorES5_1<Void, Void>(), null);
+ passed++;
+ } catch (final Throwable exp) {
+ log("Parse API failed: " + file.getAbsolutePath() + " : " + exp);
+ //if (VERBOSE) {
+ exp.printStackTrace(System.out);
+ //}
+ failed++;
+ }
+
+ if (VERBOSE) {
+ log("Done parsing via parser API " + file.getAbsolutePath());
+ }
+ }
+
+ private static char[] byteToCharArray(final byte[] bytes) {
+ Charset cs = StandardCharsets.UTF_8;
+ int start = 0;
+ // BOM detection.
+ if (bytes.length > 1 && bytes[0] == (byte) 0xFE && bytes[1] == (byte) 0xFF) {
+ start = 2;
+ cs = StandardCharsets.UTF_16BE;
+ } else if (bytes.length > 1 && bytes[0] == (byte) 0xFF && bytes[1] == (byte) 0xFE) {
+ start = 2;
+ cs = StandardCharsets.UTF_16LE;
+ } else if (bytes.length > 2 && bytes[0] == (byte) 0xEF && bytes[1] == (byte) 0xBB && bytes[2] == (byte) 0xBF) {
+ start = 3;
+ cs = StandardCharsets.UTF_8;
+ } else if (bytes.length > 3 && bytes[0] == (byte) 0xFF && bytes[1] == (byte) 0xFE && bytes[2] == 0 && bytes[3] == 0) {
+ start = 4;
+ cs = Charset.forName("UTF-32LE");
+ } else if (bytes.length > 3 && bytes[0] == 0 && bytes[1] == 0 && bytes[2] == (byte) 0xFE && bytes[3] == (byte) 0xFF) {
+ start = 4;
+ cs = Charset.forName("UTF-32BE");
+ }
+
+ return new String(bytes, start, bytes.length - start, cs).toCharArray();
+ }
+
+ private static char[] readFully(final File file) throws IOException {
+ final byte[] buf = Files.readAllBytes(file.toPath());
+ return byteToCharArray(buf);
+ }
+}
--- a/nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -66,7 +66,6 @@
@BeforeClass
public void setupTest() {
final Options options = new Options("nashorn");
- options.set("anon.functions", true);
options.set("compile.only", true);
options.set("print.ast", true);
options.set("print.parse", true);
--- a/nashorn/test/src/jdk/nashorn/internal/parser/ParserTest.java Wed Mar 11 08:30:40 2015 -0700
+++ b/nashorn/test/src/jdk/nashorn/internal/parser/ParserTest.java Tue Mar 17 12:30:53 2015 -0700
@@ -62,7 +62,6 @@
@BeforeClass
public void setupTest() {
final Options options = new Options("nashorn");
- options.set("anon.functions", true);
options.set("parse.only", true);
options.set("scripting", true);
options.set("const.as.var", true);
--- a/test/lib/sun/hotspot/code/BlobType.java Wed Mar 11 08:30:40 2015 -0700
+++ b/test/lib/sun/hotspot/code/BlobType.java Tue Mar 17 12:30:53 2015 -0700
@@ -32,15 +32,28 @@
public enum BlobType {
// Execution level 1 and 4 (non-profiled) nmethods (including native nmethods)
- MethodNonProfiled(0, "CodeHeap 'non-profiled nmethods'", "NonProfiledCodeHeapSize"),
+ MethodNonProfiled(0, "CodeHeap 'non-profiled nmethods'", "NonProfiledCodeHeapSize") {
+ @Override
+ public boolean allowTypeWhenOverflow(BlobType type) {
+ return super.allowTypeWhenOverflow(type)
+ || type == BlobType.MethodProfiled;
+ }
+ },
// Execution level 2 and 3 (profiled) nmethods
- MethodProfiled(1, "CodeHeap 'profiled nmethods'", "ProfiledCodeHeapSize"),
+ MethodProfiled(1, "CodeHeap 'profiled nmethods'", "ProfiledCodeHeapSize") {
+ @Override
+ public boolean allowTypeWhenOverflow(BlobType type) {
+ return super.allowTypeWhenOverflow(type)
+ || type == BlobType.MethodNonProfiled;
+ }
+ },
// Non-nmethods like Buffers, Adapters and Runtime Stubs
NonNMethod(2, "CodeHeap 'non-nmethods'", "NonNMethodCodeHeapSize") {
@Override
public boolean allowTypeWhenOverflow(BlobType type) {
return super.allowTypeWhenOverflow(type)
- || type == BlobType.MethodNonProfiled;
+ || type == BlobType.MethodNonProfiled
+ || type == BlobType.MethodProfiled;
}
},
// All types (No code cache segmentation)
--- a/test/make/TestJavaCompilation.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/test/make/TestJavaCompilation.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -67,7 +67,7 @@
$(TOUCH) $@
$(eval $(call SetupArchive,BUILD_JAR1, \
- $(OUTPUT_DIR)/_jar1_created, \
+ DEPENDENCIES := $(OUTPUT_DIR)/_jar1_created, \
SRCS := $(JAR1_SRC_ROOT), \
MANIFEST := $(JAR1_MANIFEST), \
JAR := $(JAR1_FILE)))
@@ -143,7 +143,7 @@
$(TOUCH) $@
$(eval $(call SetupArchive,BUILD_JAR2, \
- $(OUTPUT_DIR)/_jar2_created, \
+ DEPENDENCIES := $(OUTPUT_DIR)/_jar2_created, \
SRCS := $(JAR2_SRC_ROOT1) $(JAR2_SRC_ROOT2), \
JAR := $(JAR2_FILE)))
@@ -196,7 +196,7 @@
$(TOUCH) $@
$(eval $(call SetupArchive,BUILD_JAR3, \
- $(OUTPUT_DIR)/_jar3_created, \
+ DEPENDENCIES := $(OUTPUT_DIR)/_jar3_created, \
SRCS := $(JAR3_SRC_ROOT1) $(JAR3_SRC_ROOT2), \
EXTRA_FILES := extra-file \
dir2/file$$$$foo.dollar \
--- a/test/make/TestMakeBase.gmk Wed Mar 11 08:30:40 2015 -0700
+++ b/test/make/TestMakeBase.gmk Tue Mar 17 12:30:53 2015 -0700
@@ -182,5 +182,23 @@
TEST_TARGETS += test-vardep
################################################################################
+# Test sequence
+
+ifneq ($(call sequence, 1, 1), 1)
+ $(error Sequence 1, 1 should be "1", but was $(call sequence, 1, 1))
+endif
+
+ifneq ($(call sequence, 2, 3), 2 3)
+ $(error Sequence 2, 3 should be "2 3", but was $(call sequence, 2, 3))
+endif
+
+ifneq ($(call sequence, 4, 9), 4 5 6 7 8 9)
+ $(error Sequence 4, 9 should be "4 5 6 7 8 9", but was $(call sequence, 4, 9))
+endif
+
+ifneq ($(call sequence, 5, 15), 5 6 7 8 9 10 11 12 13 14 15)
+ $(error Sequence 5, 15 should be "5 6 7 8 9 10 11 12 13 14 15", \
+ but was $(call sequence, 5, 15))
+endif
all: $(TEST_TARGETS)