Merge
authorhseigel
Sun, 29 Mar 2015 09:20:27 -0400
changeset 30120 af79e35d33e1
parent 30119 7c3010fca7e7 (current diff)
parent 29706 28d6b0ce6aa3 (diff)
child 30121 cc43664a0ad7
Merge
hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
hotspot/src/cpu/x86/vm/templateTable_x86.cpp
hotspot/src/share/vm/memory/metaspaceShared.cpp
hotspot/src/share/vm/memory/specialized_oop_closures.cpp
hotspot/src/share/vm/oops/instanceKlass.cpp
hotspot/src/share/vm/oops/instanceKlass.hpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/globals.hpp
jdk/make/gensrc/Gensrc-jdk.jconsole.gmk
jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/Version.java.template
--- a/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -297,3 +297,4 @@
 d6224d6021459ac8b3832e822f5acc849fa944af jdk9-b52
 874d76e4699dfcd61ae1826c9fe0ddc1610ad598 jdk9-b53
 82cd31c5d6ca8d4c1653f4eb1c09eb2d9a3b2813 jdk9-b54
+c97e2d1bad9708d379793ba2a4c848eda14c741e jdk9-b55
--- a/.hgtags-top-repo	Fri Mar 27 12:43:45 2015 +0100
+++ b/.hgtags-top-repo	Sun Mar 29 09:20:27 2015 -0400
@@ -297,3 +297,4 @@
 1822e59f17121b09e7899cf338cfb6e37fe5fceb jdk9-b52
 d6ed47125a76cd1cf8a100568507bfb5e9669d9f jdk9-b53
 cb7367141e910e265b8344a8facee740bd1e5467 jdk9-b54
+0c37a832458f0e0b7d2a3f1a6f69aeae311aeb18 jdk9-b55
--- a/common/autoconf/configure.ac	Fri Mar 27 12:43:45 2015 +0100
+++ b/common/autoconf/configure.ac	Sun Mar 29 09:20:27 2015 -0400
@@ -54,6 +54,7 @@
 
 AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
 AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
+AC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
 AC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
 
 # This line needs to be here, verbatim, after all includes and the dummy hook
@@ -265,6 +266,7 @@
 
 # Create the actual output files. Now the main work of configure is done.
 AC_OUTPUT
+CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
 
 # Try to move the config.log file to the output directory.
 if test -e ./config.log; then
--- a/common/autoconf/flags.m4	Fri Mar 27 12:43:45 2015 +0100
+++ b/common/autoconf/flags.m4	Sun Mar 29 09:20:27 2015 -0400
@@ -481,9 +481,8 @@
     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"
-    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
+    CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
+    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
   if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
@@ -762,6 +761,8 @@
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
+    LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -liconv -bexpall -bernotok"
   fi
 
   # Customize LDFLAGS for executables
--- a/common/autoconf/generated-configure.sh	Fri Mar 27 12:43:45 2015 +0100
+++ b/common/autoconf/generated-configure.sh	Sun Mar 29 09:20:27 2015 -0400
@@ -4362,13 +4362,14 @@
 
 
 
+
 # This line needs to be here, verbatim, after all includes and the dummy hook
 # definitions. It is replaced with custom functionality when building
 # custom sources.
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1425994551
+DATE_WHEN_GENERATED=1426774983
 
 ###############################################################################
 #
@@ -41173,7 +41174,7 @@
 
 
       # jtreg win32 script works for everybody
-      JTREGEXE="$JT_HOME/win32/bin/jtreg"
+      JTREGEXE="$JT_HOME/bin/jtreg"
 
       if test ! -f "$JTREGEXE"; then
         as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
@@ -42372,9 +42373,8 @@
     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"
-    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
+    CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
+    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
   if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
@@ -42668,6 +42668,8 @@
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
+    LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -liconv -bexpall -bernotok"
   fi
 
   # Customize LDFLAGS for executables
@@ -52969,6 +52971,7 @@
 fi
 
 
+
 # Try to move the config.log file to the output directory.
 if test -e ./config.log; then
   $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null
--- a/common/autoconf/toolchain.m4	Fri Mar 27 12:43:45 2015 +0100
+++ b/common/autoconf/toolchain.m4	Sun Mar 29 09:20:27 2015 -0400
@@ -763,7 +763,7 @@
       BASIC_FIXUP_PATH([JT_HOME])
 
       # jtreg win32 script works for everybody
-      JTREGEXE="$JT_HOME/win32/bin/jtreg"
+      JTREGEXE="$JT_HOME/bin/jtreg"
 
       if test ! -f "$JTREGEXE"; then
         AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
--- a/corba/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/corba/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -297,3 +297,4 @@
 b8538bbb6f224ab1dabba579137099c166ad4724 jdk9-b52
 aadc16ca5ab7d56f92ef9dbfa443595a939241b4 jdk9-b53
 d469c5ad0c763e325a78e0af3016878a57dfc5cc jdk9-b54
+734ca5311a225711b79618f3e92f47f07c82154a jdk9-b55
--- a/hotspot/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -457,3 +457,4 @@
 9fb7fdc554db5be5c5b10f88f529ec3b870c44e3 jdk9-b52
 effd5ef0c3eb4bb85aa975c489d6761dbf13ad6a jdk9-b53
 c3b117fa5bdedfafd9ed236403e6d406911195b1 jdk9-b54
+be49ab55e5c498c5077bbf58c2737100d1992339 jdk9-b55
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Sun Mar 29 09:20:27 2015 -0400
@@ -123,6 +123,7 @@
 
   private static Type intxType;
   private static Type uintxType;
+  private static Type sizetType;
   private static CIntegerType boolType;
   private Boolean sharingEnabled;
   private Boolean compressedOopsEnabled;
@@ -175,7 +176,7 @@
 
      public long getIntx() {
         if (Assert.ASSERTS_ENABLED) {
-           Assert.that(isIntx(), "not a intx flag!");
+           Assert.that(isIntx(), "not an intx flag!");
         }
         return addr.getCIntegerAt(0, intxType.getSize(), false);
      }
@@ -191,6 +192,17 @@
         return addr.getCIntegerAt(0, uintxType.getSize(), true);
      }
 
+     public boolean isSizet() {
+        return type.equals("size_t");
+     }
+
+     public long getSizet() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isSizet(), "not a size_t flag!");
+        }
+        return addr.getCIntegerAt(0, sizetType.getSize(), true);
+     }
+
      public String getValue() {
         if (isBool()) {
            return new Boolean(getBool()).toString();
@@ -198,6 +210,8 @@
            return new Long(getIntx()).toString();
         } else if (isUIntx()) {
            return new Long(getUIntx()).toString();
+        } else if (isSizet()) {
+            return new Long(getSizet()).toString();
         } else {
            return null;
         }
@@ -323,6 +337,7 @@
 
     intxType = db.lookupType("intx");
     uintxType = db.lookupType("uintx");
+    sizetType = db.lookupType("size_t");
     boolType = (CIntegerType) db.lookupType("bool");
 
     minObjAlignmentInBytes = getObjectAlignmentInBytes();
--- a/hotspot/make/linux/makefiles/gcc.make	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/make/linux/makefiles/gcc.make	Sun Mar 29 09:20:27 2015 -0400
@@ -207,7 +207,7 @@
   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
 endif
 
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
 
 ifeq ($(USE_CLANG),)
   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad	Sun Mar 29 09:20:27 2015 -0400
@@ -6056,7 +6056,7 @@
 %}
 
 // Store Byte
-instruct storeB_volatile(iRegI src, /* sync_memory*/indirect mem)
+instruct storeB_volatile(iRegIorL2I src, /* sync_memory*/indirect mem)
 %{
   match(Set mem (StoreB mem src));
 
@@ -6069,7 +6069,7 @@
 %}
 
 // Store Char/Short
-instruct storeC_volatile(iRegI src, /* sync_memory*/indirect mem)
+instruct storeC_volatile(iRegIorL2I src, /* sync_memory*/indirect mem)
 %{
   match(Set mem (StoreC mem src));
 
@@ -6225,7 +6225,7 @@
 // ============================================================================
 // Zero Count Instructions
 
-instruct countLeadingZerosI(iRegINoSp dst, iRegI src) %{
+instruct countLeadingZerosI(iRegINoSp dst, iRegIorL2I src) %{
   match(Set dst (CountLeadingZerosI src));
 
   ins_cost(INSN_COST);
@@ -6249,7 +6249,7 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct countTrailingZerosI(iRegINoSp dst, iRegI src) %{
+instruct countTrailingZerosI(iRegINoSp dst, iRegIorL2I src) %{
   match(Set dst (CountTrailingZerosI src));
 
   ins_cost(INSN_COST * 2);
@@ -6935,7 +6935,7 @@
 // which throws a ShouldNotHappen. So, we have to provide two flavours
 // of each rule, one for a cmpOp and a second for a cmpOpU (sigh).
 
-instruct cmovI_reg_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegI src1, iRegI src2) %{
+instruct cmovI_reg_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2) %{
   match(Set dst (CMoveI (Binary cmp cr) (Binary src1 src2)));
 
   ins_cost(INSN_COST * 2);
@@ -6951,7 +6951,7 @@
   ins_pipe(icond_reg_reg);
 %}
 
-instruct cmovUI_reg_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegI src1, iRegI src2) %{
+instruct cmovUI_reg_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2) %{
   match(Set dst (CMoveI (Binary cmp cr) (Binary src1 src2)));
 
   ins_cost(INSN_COST * 2);
@@ -6976,7 +6976,7 @@
 // we ought only to be able to cull one of these variants as the ideal
 // transforms ought always to order the zero consistently (to left/right?)
 
-instruct cmovI_zero_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, immI0 zero, iRegI src) %{
+instruct cmovI_zero_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, immI0 zero, iRegIorL2I src) %{
   match(Set dst (CMoveI (Binary cmp cr) (Binary zero src)));
 
   ins_cost(INSN_COST * 2);
@@ -6992,7 +6992,7 @@
   ins_pipe(icond_reg);
 %}
 
-instruct cmovUI_zero_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, immI0 zero, iRegI src) %{
+instruct cmovUI_zero_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, immI0 zero, iRegIorL2I src) %{
   match(Set dst (CMoveI (Binary cmp cr) (Binary zero src)));
 
   ins_cost(INSN_COST * 2);
@@ -7008,7 +7008,7 @@
   ins_pipe(icond_reg);
 %}
 
-instruct cmovI_reg_zero(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegI src, immI0 zero) %{
+instruct cmovI_reg_zero(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegIorL2I src, immI0 zero) %{
   match(Set dst (CMoveI (Binary cmp cr) (Binary src zero)));
 
   ins_cost(INSN_COST * 2);
@@ -7024,7 +7024,7 @@
   ins_pipe(icond_reg);
 %}
 
-instruct cmovUI_reg_zero(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegI src, immI0 zero) %{
+instruct cmovUI_reg_zero(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegIorL2I src, immI0 zero) %{
   match(Set dst (CMoveI (Binary cmp cr) (Binary src zero)));
 
   ins_cost(INSN_COST * 2);
@@ -7476,7 +7476,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct addI_reg_imm(iRegINoSp dst, iRegI src1, immIAddSub src2) %{
+instruct addI_reg_imm(iRegINoSp dst, iRegIorL2I src1, immIAddSub src2) %{
   match(Set dst (AddI src1 src2));
 
   ins_cost(INSN_COST);
@@ -7869,7 +7869,7 @@
   ins_pipe(idiv_reg_reg);
 %}
 
-instruct signExtract(iRegINoSp dst, iRegI src1, immI_31 div1, immI_31 div2) %{
+instruct signExtract(iRegINoSp dst, iRegIorL2I src1, immI_31 div1, immI_31 div2) %{
   match(Set dst (URShiftI (RShiftI src1 div1) div2));
   ins_cost(INSN_COST);
   format %{ "lsrw $dst, $src1, $div1" %}
@@ -7879,7 +7879,7 @@
   ins_pipe(ialu_reg_shift);
 %}
 
-instruct div2Round(iRegINoSp dst, iRegI src, immI_31 div1, immI_31 div2) %{
+instruct div2Round(iRegINoSp dst, iRegIorL2I src, immI_31 div1, immI_31 div2) %{
   match(Set dst (AddI src (URShiftI (RShiftI src div1) div2)));
   ins_cost(INSN_COST);
   format %{ "addw $dst, $src, LSR $div1" %}
@@ -8189,7 +8189,7 @@
   ins_pipe(ialu_reg);
 %}
 instruct regI_not_reg(iRegINoSp dst,
-                         iRegI src1, immI_M1 m1,
+                         iRegIorL2I src1, immI_M1 m1,
                          rFlagsReg cr) %{
   match(Set dst (XorI src1 m1));
   ins_cost(INSN_COST);
@@ -8206,14 +8206,14 @@
 %}
 
 instruct AndI_reg_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2, immI_M1 m1,
+                         iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1,
                          rFlagsReg cr) %{
   match(Set dst (AndI src1 (XorI src2 m1)));
   ins_cost(INSN_COST);
-  format %{ "bic  $dst, $src1, $src2" %}
-
-  ins_encode %{
-    __ bic(as_Register($dst$$reg),
+  format %{ "bicw  $dst, $src1, $src2" %}
+
+  ins_encode %{
+    __ bicw(as_Register($dst$$reg),
               as_Register($src1$$reg),
               as_Register($src2$$reg),
               Assembler::LSL, 0);
@@ -8240,14 +8240,14 @@
 %}
 
 instruct OrI_reg_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2, immI_M1 m1,
+                         iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1,
                          rFlagsReg cr) %{
   match(Set dst (OrI src1 (XorI src2 m1)));
   ins_cost(INSN_COST);
-  format %{ "orn  $dst, $src1, $src2" %}
-
-  ins_encode %{
-    __ orn(as_Register($dst$$reg),
+  format %{ "ornw  $dst, $src1, $src2" %}
+
+  ins_encode %{
+    __ ornw(as_Register($dst$$reg),
               as_Register($src1$$reg),
               as_Register($src2$$reg),
               Assembler::LSL, 0);
@@ -8274,14 +8274,14 @@
 %}
 
 instruct XorI_reg_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2, immI_M1 m1,
+                         iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1,
                          rFlagsReg cr) %{
   match(Set dst (XorI m1 (XorI src2 src1)));
   ins_cost(INSN_COST);
-  format %{ "eon  $dst, $src1, $src2" %}
-
-  ins_encode %{
-    __ eon(as_Register($dst$$reg),
+  format %{ "eonw  $dst, $src1, $src2" %}
+
+  ins_encode %{
+    __ eonw(as_Register($dst$$reg),
               as_Register($src1$$reg),
               as_Register($src2$$reg),
               Assembler::LSL, 0);
@@ -8308,7 +8308,7 @@
 %}
 
 instruct AndI_reg_URShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (AndI src1 (XorI(URShiftI src2 src3) src4)));
   ins_cost(1.9 * INSN_COST);
@@ -8344,7 +8344,7 @@
 %}
 
 instruct AndI_reg_RShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (AndI src1 (XorI(RShiftI src2 src3) src4)));
   ins_cost(1.9 * INSN_COST);
@@ -8380,7 +8380,7 @@
 %}
 
 instruct AndI_reg_LShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (AndI src1 (XorI(LShiftI src2 src3) src4)));
   ins_cost(1.9 * INSN_COST);
@@ -8416,7 +8416,7 @@
 %}
 
 instruct XorI_reg_URShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (XorI src4 (XorI(URShiftI src2 src3) src1)));
   ins_cost(1.9 * INSN_COST);
@@ -8452,7 +8452,7 @@
 %}
 
 instruct XorI_reg_RShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (XorI src4 (XorI(RShiftI src2 src3) src1)));
   ins_cost(1.9 * INSN_COST);
@@ -8488,7 +8488,7 @@
 %}
 
 instruct XorI_reg_LShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (XorI src4 (XorI(LShiftI src2 src3) src1)));
   ins_cost(1.9 * INSN_COST);
@@ -8524,7 +8524,7 @@
 %}
 
 instruct OrI_reg_URShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (OrI src1 (XorI(URShiftI src2 src3) src4)));
   ins_cost(1.9 * INSN_COST);
@@ -8560,7 +8560,7 @@
 %}
 
 instruct OrI_reg_RShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (OrI src1 (XorI(RShiftI src2 src3) src4)));
   ins_cost(1.9 * INSN_COST);
@@ -8596,7 +8596,7 @@
 %}
 
 instruct OrI_reg_LShift_not_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, immI_M1 src4, rFlagsReg cr) %{
   match(Set dst (OrI src1 (XorI(LShiftI src2 src3) src4)));
   ins_cost(1.9 * INSN_COST);
@@ -8632,7 +8632,7 @@
 %}
 
 instruct AndI_reg_URShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (AndI src1 (URShiftI src2 src3)));
 
@@ -8670,7 +8670,7 @@
 %}
 
 instruct AndI_reg_RShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (AndI src1 (RShiftI src2 src3)));
 
@@ -8708,7 +8708,7 @@
 %}
 
 instruct AndI_reg_LShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (AndI src1 (LShiftI src2 src3)));
 
@@ -8746,7 +8746,7 @@
 %}
 
 instruct XorI_reg_URShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (XorI src1 (URShiftI src2 src3)));
 
@@ -8784,7 +8784,7 @@
 %}
 
 instruct XorI_reg_RShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (XorI src1 (RShiftI src2 src3)));
 
@@ -8822,7 +8822,7 @@
 %}
 
 instruct XorI_reg_LShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (XorI src1 (LShiftI src2 src3)));
 
@@ -8860,7 +8860,7 @@
 %}
 
 instruct OrI_reg_URShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (OrI src1 (URShiftI src2 src3)));
 
@@ -8898,7 +8898,7 @@
 %}
 
 instruct OrI_reg_RShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (OrI src1 (RShiftI src2 src3)));
 
@@ -8936,7 +8936,7 @@
 %}
 
 instruct OrI_reg_LShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (OrI src1 (LShiftI src2 src3)));
 
@@ -8974,7 +8974,7 @@
 %}
 
 instruct AddI_reg_URShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (AddI src1 (URShiftI src2 src3)));
 
@@ -9012,7 +9012,7 @@
 %}
 
 instruct AddI_reg_RShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (AddI src1 (RShiftI src2 src3)));
 
@@ -9050,7 +9050,7 @@
 %}
 
 instruct AddI_reg_LShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (AddI src1 (LShiftI src2 src3)));
 
@@ -9088,7 +9088,7 @@
 %}
 
 instruct SubI_reg_URShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (SubI src1 (URShiftI src2 src3)));
 
@@ -9126,7 +9126,7 @@
 %}
 
 instruct SubI_reg_RShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (SubI src1 (RShiftI src2 src3)));
 
@@ -9164,7 +9164,7 @@
 %}
 
 instruct SubI_reg_LShift_reg(iRegINoSp dst,
-                         iRegI src1, iRegI src2,
+                         iRegIorL2I src1, iRegIorL2I src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst (SubI src1 (LShiftI src2 src3)));
 
@@ -9228,7 +9228,7 @@
 
 // Shift Left followed by Shift Right.
 // This idiom is used by the compiler for the i2b bytecode etc.
-instruct sbfmwI(iRegINoSp dst, iRegI src, immI lshift_count, immI rshift_count)
+instruct sbfmwI(iRegINoSp dst, iRegIorL2I src, immI lshift_count, immI rshift_count)
 %{
   match(Set dst (RShiftI (LShiftI src lshift_count) rshift_count));
   // Make sure we are not going to exceed what sbfmw can do.
@@ -9274,7 +9274,7 @@
 
 // Shift Left followed by Shift Right.
 // This idiom is used by the compiler for the i2b bytecode etc.
-instruct ubfmwI(iRegINoSp dst, iRegI src, immI lshift_count, immI rshift_count)
+instruct ubfmwI(iRegINoSp dst, iRegIorL2I src, immI lshift_count, immI rshift_count)
 %{
   match(Set dst (URShiftI (LShiftI src lshift_count) rshift_count));
   // Make sure we are not going to exceed what ubfmw can do.
@@ -9296,7 +9296,7 @@
 %}
 // Bitfield extract with shift & mask
 
-instruct ubfxwI(iRegINoSp dst, iRegI src, immI rshift, immI_bitmask mask)
+instruct ubfxwI(iRegINoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask)
 %{
   match(Set dst (AndI (URShiftI src rshift) mask));
 
@@ -9362,7 +9362,7 @@
   ins_pipe(ialu_reg_reg_extr);
 %}
 
-instruct extrOrI(iRegINoSp dst, iRegI src1, iRegI src2, immI lshift, immI rshift, rFlagsReg cr)
+instruct extrOrI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI lshift, immI rshift, rFlagsReg cr)
 %{
   match(Set dst (OrI (LShiftI src1 lshift) (URShiftI src2 rshift)));
   predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & 31));
@@ -9392,7 +9392,7 @@
   ins_pipe(ialu_reg_reg_extr);
 %}
 
-instruct extrAddI(iRegINoSp dst, iRegI src1, iRegI src2, immI lshift, immI rshift, rFlagsReg cr)
+instruct extrAddI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI lshift, immI rshift, rFlagsReg cr)
 %{
   match(Set dst (AddI (LShiftI src1 lshift) (URShiftI src2 rshift)));
   predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & 31));
@@ -9571,7 +9571,7 @@
 %};
 
 
-instruct AddExtI_sxth(iRegINoSp dst, iRegI src1, iRegI src2, immI_16 lshift, immI_16 rshift, rFlagsReg cr)
+instruct AddExtI_sxth(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_16 lshift, immI_16 rshift, rFlagsReg cr)
 %{
   match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift)));
   ins_cost(INSN_COST);
@@ -9584,7 +9584,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct AddExtI_sxtb(iRegINoSp dst, iRegI src1, iRegI src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
+instruct AddExtI_sxtb(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
 %{
   match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift)));
   ins_cost(INSN_COST);
@@ -9597,7 +9597,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct AddExtI_uxtb(iRegINoSp dst, iRegI src1, iRegI src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
+instruct AddExtI_uxtb(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
 %{
   match(Set dst (AddI src1 (URShiftI (LShiftI src2 lshift) rshift)));
   ins_cost(INSN_COST);
@@ -9663,7 +9663,7 @@
 %}
 
 
-instruct AddExtI_uxtb_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_255 mask, rFlagsReg cr)
+instruct AddExtI_uxtb_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, rFlagsReg cr)
 %{
   match(Set dst (AddI src1 (AndI src2 mask)));
   ins_cost(INSN_COST);
@@ -9676,7 +9676,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct AddExtI_uxth_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_65535 mask, rFlagsReg cr)
+instruct AddExtI_uxth_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, rFlagsReg cr)
 %{
   match(Set dst (AddI src1 (AndI src2 mask)));
   ins_cost(INSN_COST);
@@ -9728,7 +9728,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct SubExtI_uxtb_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_255 mask, rFlagsReg cr)
+instruct SubExtI_uxtb_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, rFlagsReg cr)
 %{
   match(Set dst (SubI src1 (AndI src2 mask)));
   ins_cost(INSN_COST);
@@ -9741,7 +9741,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct SubExtI_uxth_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_65535 mask, rFlagsReg cr)
+instruct SubExtI_uxth_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, rFlagsReg cr)
 %{
   match(Set dst (SubI src1 (AndI src2 mask)));
   ins_cost(INSN_COST);
@@ -10343,7 +10343,7 @@
 %}
 
 // this pattern occurs in bigmath arithmetic
-instruct convUI2L_reg_reg(iRegLNoSp dst, iRegI src, immL_32bits mask)
+instruct convUI2L_reg_reg(iRegLNoSp dst, iRegIorL2I src, immL_32bits mask)
 %{
   match(Set dst (AndL (ConvI2L src) mask));
 
@@ -10369,7 +10369,7 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct convI2B(iRegINoSp dst, iRegI src, rFlagsReg cr)
+instruct convI2B(iRegINoSp dst, iRegIorL2I src, rFlagsReg cr)
 %{
   match(Set dst (Conv2B src));
   effect(KILL cr);
@@ -10457,7 +10457,7 @@
   ins_pipe(pipe_class_default);
 %}
 
-instruct convI2F_reg_reg(vRegF dst, iRegI src) %{
+instruct convI2F_reg_reg(vRegF dst, iRegIorL2I src) %{
   match(Set dst (ConvI2F src));
 
   ins_cost(INSN_COST * 5);
@@ -10509,7 +10509,7 @@
   ins_pipe(pipe_class_default);
 %}
 
-instruct convI2D_reg_reg(vRegD dst, iRegI src) %{
+instruct convI2D_reg_reg(vRegD dst, iRegIorL2I src) %{
   match(Set dst (ConvI2D src));
 
   ins_cost(INSN_COST * 5);
@@ -10772,7 +10772,7 @@
 // ============================================================================
 // Overflow Math Instructions
 
-instruct overflowAddI_reg_reg(rFlagsReg cr, iRegI op1, iRegI op2)
+instruct overflowAddI_reg_reg(rFlagsReg cr, iRegIorL2I op1, iRegIorL2I op2)
 %{
   match(Set cr (OverflowAddI op1 op2));
 
@@ -10785,7 +10785,7 @@
   ins_pipe(icmp_reg_reg);
 %}
 
-instruct overflowAddI_reg_imm(rFlagsReg cr, iRegI op1, immIAddSub op2)
+instruct overflowAddI_reg_imm(rFlagsReg cr, iRegIorL2I op1, immIAddSub op2)
 %{
   match(Set cr (OverflowAddI op1 op2));
 
@@ -10824,7 +10824,7 @@
   ins_pipe(icmp_reg_imm);
 %}
 
-instruct overflowSubI_reg_reg(rFlagsReg cr, iRegI op1, iRegI op2)
+instruct overflowSubI_reg_reg(rFlagsReg cr, iRegIorL2I op1, iRegIorL2I op2)
 %{
   match(Set cr (OverflowSubI op1 op2));
 
@@ -10837,7 +10837,7 @@
   ins_pipe(icmp_reg_reg);
 %}
 
-instruct overflowSubI_reg_imm(rFlagsReg cr, iRegI op1, immIAddSub op2)
+instruct overflowSubI_reg_imm(rFlagsReg cr, iRegIorL2I op1, immIAddSub op2)
 %{
   match(Set cr (OverflowSubI op1 op2));
 
@@ -10876,7 +10876,7 @@
   ins_pipe(icmp_reg_imm);
 %}
 
-instruct overflowNegI_reg(rFlagsReg cr, immI0 zero, iRegI op1)
+instruct overflowNegI_reg(rFlagsReg cr, immI0 zero, iRegIorL2I op1)
 %{
   match(Set cr (OverflowSubI zero op1));
 
@@ -10902,7 +10902,7 @@
   ins_pipe(icmp_reg_imm);
 %}
 
-instruct overflowMulI_reg(rFlagsReg cr, iRegI op1, iRegI op2)
+instruct overflowMulI_reg(rFlagsReg cr, iRegIorL2I op1, iRegIorL2I op2)
 %{
   match(Set cr (OverflowMulI op1 op2));
 
@@ -10923,7 +10923,7 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct overflowMulI_reg_branch(cmpOp cmp, iRegI op1, iRegI op2, label labl, rFlagsReg cr)
+instruct overflowMulI_reg_branch(cmpOp cmp, iRegIorL2I op1, iRegIorL2I op2, label labl, rFlagsReg cr)
 %{
   match(If cmp (OverflowMulI op1 op2));
   predicate(n->in(1)->as_Bool()->_test._test == BoolTest::overflow
@@ -11393,7 +11393,7 @@
 
 %}
 
-instruct cmpLTMask_reg_reg(iRegINoSp dst, iRegI p, iRegI q, rFlagsReg cr)
+instruct cmpLTMask_reg_reg(iRegINoSp dst, iRegIorL2I p, iRegIorL2I q, rFlagsReg cr)
 %{
   match(Set dst (CmpLTMask p q));
   effect(KILL cr);
@@ -11414,7 +11414,7 @@
   ins_pipe(ialu_reg_reg);
 %}
 
-instruct cmpLTMask_reg_zero(iRegINoSp dst, iRegI src, immI0 zero, rFlagsReg cr)
+instruct cmpLTMask_reg_zero(iRegINoSp dst, iRegIorL2I src, immI0 zero, rFlagsReg cr)
 %{
   match(Set dst (CmpLTMask src zero));
   effect(KILL cr);
@@ -11548,7 +11548,7 @@
 // shorter than (cmp; branch), have the additional benefit of not
 // killing the flags.
 
-instruct cmpI_imm0_branch(cmpOp cmp, iRegI op1, immI0 op2, label labl, rFlagsReg cr) %{
+instruct cmpI_imm0_branch(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl, rFlagsReg cr) %{
   match(If cmp (CmpI op1 op2));
   predicate(n->in(1)->as_Bool()->_test._test == BoolTest::ne
             || n->in(1)->as_Bool()->_test._test == BoolTest::eq);
--- a/hotspot/src/cpu/aarch64/vm/aarch64_ad.m4	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/aarch64/vm/aarch64_ad.m4	Sun Mar 29 09:20:27 2015 -0400
@@ -24,11 +24,13 @@
 dnl and shift patterns patterns used in aarch64.ad.
 dnl
 // BEGIN This section of the file is automatically generated. Do not edit --------------
-
+dnl
+define(`ORL2I', `ifelse($1,I,orL2I)')
+dnl
 define(`BASE_SHIFT_INSN',
 `
 instruct $2$1_reg_$4_reg(iReg$1NoSp dst,
-                         iReg$1 src1, iReg$1 src2,
+                         iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2,
                          immI src3, rFlagsReg cr) %{
   match(Set dst ($2$1 src1 ($4$1 src2 src3)));
 
@@ -48,7 +50,7 @@
 define(`BASE_INVERTED_INSN',
 `
 instruct $2$1_reg_not_reg(iReg$1NoSp dst,
-                         iReg$1 src1, iReg$1 src2, imm$1_M1 m1,
+                         iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_M1 m1,
                          rFlagsReg cr) %{
 dnl This ifelse is because hotspot reassociates (xor (xor ..)..)
 dnl into this canonical form.
@@ -70,7 +72,7 @@
 define(`INVERTED_SHIFT_INSN',
 `
 instruct $2$1_reg_$4_not_reg(iReg$1NoSp dst,
-                         iReg$1 src1, iReg$1 src2,
+                         iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2,
                          immI src3, imm$1_M1 src4, rFlagsReg cr) %{
 dnl This ifelse is because hotspot reassociates (xor (xor ..)..)
 dnl into this canonical form.
@@ -92,7 +94,7 @@
 %}')dnl
 define(`NOT_INSN',
 `instruct reg$1_not_reg(iReg$1NoSp dst,
-                         iReg$1 src1, imm$1_M1 m1,
+                         iReg$1`'ORL2I($1) src1, imm$1_M1 m1,
                          rFlagsReg cr) %{
   match(Set dst (Xor$1 src1 m1));
   ins_cost(INSN_COST);
@@ -113,7 +115,7 @@
 BASE_SHIFT_INSN(L, $1, $2, $3, $4)')dnl
 dnl
 define(`BOTH_INVERTED_INSNS',
-`BASE_INVERTED_INSN(I, $1, $2, $3, $4)
+`BASE_INVERTED_INSN(I, $1, $2w, $3, $4)
 BASE_INVERTED_INSN(L, $1, $2, $3, $4)')dnl
 dnl
 define(`BOTH_INVERTED_SHIFT_INSNS',
@@ -149,7 +151,7 @@
 define(`BFM_INSN',`
 // Shift Left followed by Shift Right.
 // This idiom is used by the compiler for the i2b bytecode etc.
-instruct $4$1(iReg$1NoSp dst, iReg$1 src, immI lshift_count, immI rshift_count)
+instruct $4$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI lshift_count, immI rshift_count)
 %{
   match(Set dst EXTEND($1, $3, src, lshift_count, rshift_count));
   // Make sure we are not going to exceed what $4 can do.
@@ -176,7 +178,7 @@
 dnl
 // Bitfield extract with shift & mask
 define(`BFX_INSN',
-`instruct $3$1(iReg$1NoSp dst, iReg$1 src, immI rshift, imm$1_bitmask mask)
+`instruct $3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI rshift, imm$1_bitmask mask)
 %{
   match(Set dst (And$1 ($2$1 src rshift) mask));
 
@@ -215,7 +217,7 @@
 // Rotations
 
 define(`EXTRACT_INSN',
-`instruct extr$3$1(iReg$1NoSp dst, iReg$1 src1, iReg$1 src2, immI lshift, immI rshift, rFlagsReg cr)
+`instruct extr$3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI lshift, immI rshift, rFlagsReg cr)
 %{
   match(Set dst ($3$1 (LShift$1 src1 lshift) (URShift$1 src2 rshift)));
   predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & $2));
@@ -299,7 +301,7 @@
 // Add/subtract (extended)
 dnl ADD_SUB_EXTENDED(mode, size, add node, shift node, insn, shift type, wordsize
 define(`ADD_SUB_CONV', `
-instruct $3Ext$1(iReg$2NoSp dst, iReg$2 src1, iReg$1orL2I src2, rFlagsReg cr)
+instruct $3Ext$1(iReg$2NoSp dst, iReg$2`'ORL2I($2) src1, iReg$1`'ORL2I($1) src2, rFlagsReg cr)
 %{
   match(Set dst ($3$2 src1 (ConvI2L src2)));
   ins_cost(INSN_COST);
@@ -315,7 +317,7 @@
 ADD_SUB_CONV(I,L,Sub,sub,sxtw);
 dnl
 define(`ADD_SUB_EXTENDED', `
-instruct $3Ext$1_$6(iReg$1NoSp dst, iReg$1 src1, iReg$1 src2, immI_`'eval($7-$2) lshift, immI_`'eval($7-$2) rshift, rFlagsReg cr)
+instruct $3Ext$1_$6(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI_`'eval($7-$2) lshift, immI_`'eval($7-$2) rshift, rFlagsReg cr)
 %{
   match(Set dst ($3$1 src1 EXTEND($1, $4, src2, lshift, rshift)));
   ins_cost(INSN_COST);
@@ -337,7 +339,7 @@
 dnl
 dnl ADD_SUB_ZERO_EXTEND(mode, size, add node, insn, shift type)
 define(`ADD_SUB_ZERO_EXTEND', `
-instruct $3Ext$1_$5_and(iReg$1NoSp dst, iReg$1 src1, iReg$1 src2, imm$1_$2 mask, rFlagsReg cr)
+instruct $3Ext$1_$5_and(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_$2 mask, rFlagsReg cr)
 %{
   match(Set dst ($3$1 src1 (And$1 src2 mask)));
   ins_cost(INSN_COST);
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -673,7 +673,6 @@
   void  gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       // With G1, don't generate the call if we statically know that the target in uninitialized
       if (!dest_uninitialized) {
@@ -719,7 +718,6 @@
     assert_different_registers(start, end, scratch);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
 
         {
--- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -150,7 +150,6 @@
   assert(val == noreg || val == r0, "parameter is just for looks");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // flatten object address if needed
--- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -49,7 +49,7 @@
 define_pd_global(intx, MinJumpTableSize,             10);
 define_pd_global(intx, INTPRESSURE,                  25);
 define_pd_global(intx, InteriorEntryAlignment,       16);
-define_pd_global(intx, NewSizeThreadIncrease,        ScaleForWordSize(4*K));
+define_pd_global(size_t, NewSizeThreadIncrease,      ScaleForWordSize(4*K));
 define_pd_global(intx, RegisterCostAreaRatio,        16000);
 define_pd_global(bool, UseTLAB,                      true);
 define_pd_global(bool, ResizeTLAB,                   true);
@@ -85,14 +85,14 @@
 define_pd_global(intx, CodeCacheExpansionSize,       64*K);
 
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    4ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   4ULL*G);
 define_pd_global(uintx, CodeCacheMinBlockLength,     4);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
 
 define_pd_global(bool,  TrapBasedRangeChecks,        true);
 
 // Heap related flags
-define_pd_global(uintx,MetaspaceSize,                ScaleForWordSize(16*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(16*M));
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
--- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -56,7 +56,7 @@
 define_pd_global(bool, UseMembar,             false);
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 16*M);  // Default max size of CMS young gen, per GC worker thread.
+define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // Default max size of CMS young gen, per GC worker thread.
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -608,7 +608,6 @@
   void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1) {
     BarrierSet* const bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
@@ -665,7 +664,6 @@
     BarrierSet* const bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           if (branchToEnd) {
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -66,7 +66,6 @@
 
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // Load and record the previous value.
--- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -53,10 +53,10 @@
 define_pd_global(intx, CodeCacheExpansionSize,       32*K );
 define_pd_global(uintx, CodeCacheMinBlockLength,     1);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
-define_pd_global(uintx, MetaspaceSize,               12*M );
+define_pd_global(size_t, MetaspaceSize,              12*M );
 define_pd_global(bool, NeverActAsServerClassMachine, true );
-define_pd_global(intx, NewSizeThreadIncrease,        16*K );
-define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
+define_pd_global(size_t, NewSizeThreadIncrease,      16*K );
+define_pd_global(uint64_t, MaxRAM,                   1ULL*G);
 define_pd_global(intx, InitialCodeCacheSize,         160*K);
 #endif // !TIERED
 
--- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -51,7 +51,7 @@
 define_pd_global(intx, FreqInlineSize,               175);
 define_pd_global(intx, INTPRESSURE,                  48);  // large register set
 define_pd_global(intx, InteriorEntryAlignment,       16);  // = CodeEntryAlignment
-define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
+define_pd_global(size_t, NewSizeThreadIncrease,      ScaleForWordSize(4*K));
 define_pd_global(intx, RegisterCostAreaRatio,        12000);
 define_pd_global(bool, UseTLAB,                      true);
 define_pd_global(bool, ResizeTLAB,                   true);
@@ -90,7 +90,7 @@
 define_pd_global(intx, NonNMethodCodeHeapSize,       5*M );
 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    4ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   4ULL*G);
 #endif
 define_pd_global(uintx, CodeCacheMinBlockLength,     4);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
@@ -98,7 +98,7 @@
 define_pd_global(bool,  TrapBasedRangeChecks,        false); // Not needed on sparc.
 
 // Heap related flags
-define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(16*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(16*M));
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
--- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -75,7 +75,7 @@
 define_pd_global(bool, UseMembar,            false);
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
+define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -957,7 +957,6 @@
   void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
@@ -1005,7 +1004,6 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           // Get some new fresh output registers.
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -56,7 +56,6 @@
   assert(index == noreg || offset == 0, "only one offset");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // Load and record the previous value.
--- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -32,39 +32,39 @@
 // (see c1_globals.hpp)
 
 #ifndef TIERED
-define_pd_global(bool, BackgroundCompilation,        true );
-define_pd_global(bool, UseTLAB,                      true );
-define_pd_global(bool, ResizeTLAB,                   true );
-define_pd_global(bool, InlineIntrinsics,             true );
-define_pd_global(bool, PreferInterpreterNativeStubs, false);
-define_pd_global(bool, ProfileTraps,                 false);
-define_pd_global(bool, UseOnStackReplacement,        true );
-define_pd_global(bool, TieredCompilation,            false);
-define_pd_global(intx, CompileThreshold,             1500 );
+define_pd_global(bool, BackgroundCompilation,          true );
+define_pd_global(bool, UseTLAB,                        true );
+define_pd_global(bool, ResizeTLAB,                     true );
+define_pd_global(bool, InlineIntrinsics,               true );
+define_pd_global(bool, PreferInterpreterNativeStubs,   false);
+define_pd_global(bool, ProfileTraps,                   false);
+define_pd_global(bool, UseOnStackReplacement,          true );
+define_pd_global(bool, TieredCompilation,              false);
+define_pd_global(intx, CompileThreshold,               1500 );
 
-define_pd_global(intx, OnStackReplacePercentage,     933  );
-define_pd_global(intx, FreqInlineSize,               325  );
-define_pd_global(intx, NewSizeThreadIncrease,        4*K  );
-define_pd_global(intx, InitialCodeCacheSize,         160*K);
-define_pd_global(intx, ReservedCodeCacheSize,        32*M );
-define_pd_global(intx, NonProfiledCodeHeapSize,      13*M );
-define_pd_global(intx, ProfiledCodeHeapSize,         14*M );
-define_pd_global(intx, NonNMethodCodeHeapSize,       5*M  );
-define_pd_global(bool, ProfileInterpreter,           false);
-define_pd_global(intx, CodeCacheExpansionSize,       32*K );
-define_pd_global(uintx, CodeCacheMinBlockLength,     1);
-define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
-define_pd_global(uintx, MetaspaceSize,               12*M );
-define_pd_global(bool, NeverActAsServerClassMachine, true );
-define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
-define_pd_global(bool, CICompileOSR,                 true );
+define_pd_global(intx,   OnStackReplacePercentage,     933  );
+define_pd_global(intx,   FreqInlineSize,               325  );
+define_pd_global(size_t, NewSizeThreadIncrease,        4*K  );
+define_pd_global(intx, InitialCodeCacheSize,           160*K);
+define_pd_global(intx, ReservedCodeCacheSize,          32*M );
+define_pd_global(intx, NonProfiledCodeHeapSize,        13*M );
+define_pd_global(intx, ProfiledCodeHeapSize,           14*M );
+define_pd_global(intx, NonNMethodCodeHeapSize,         5*M  );
+define_pd_global(bool,   ProfileInterpreter,           false);
+define_pd_global(intx, CodeCacheExpansionSize,         32*K );
+define_pd_global(uintx, CodeCacheMinBlockLength,       1    );
+define_pd_global(uintx, CodeCacheMinimumUseSpace,      400*K);
+define_pd_global(size_t, MetaspaceSize,                12*M );
+define_pd_global(bool,   NeverActAsServerClassMachine, true );
+define_pd_global(uint64_t, MaxRAM,                    1ULL*G);
+define_pd_global(bool,   CICompileOSR,                 true );
 #endif // !TIERED
-define_pd_global(bool, UseTypeProfile,               false);
-define_pd_global(bool, RoundFPResults,               true );
+define_pd_global(bool, UseTypeProfile,                 false);
+define_pd_global(bool, RoundFPResults,                 true );
 
-define_pd_global(bool, LIRFillDelaySlots,            false);
-define_pd_global(bool, OptimizeSinglePrecision,      true );
-define_pd_global(bool, CSEArrayLength,               false);
-define_pd_global(bool, TwoOperandLIRForm,            true );
+define_pd_global(bool, LIRFillDelaySlots,              false);
+define_pd_global(bool, OptimizeSinglePrecision,        true );
+define_pd_global(bool, CSEArrayLength,                 false);
+define_pd_global(bool, TwoOperandLIRForm,              true );
 
 #endif // CPU_X86_VM_C1_GLOBALS_X86_HPP
--- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -54,25 +54,25 @@
 #ifdef AMD64
 define_pd_global(intx, INTPRESSURE,                  13);
 define_pd_global(intx, InteriorEntryAlignment,       16);
-define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
+define_pd_global(size_t, NewSizeThreadIncrease,      ScaleForWordSize(4*K));
 define_pd_global(intx, LoopUnrollLimit,              60);
 // InitialCodeCacheSize derived from specjbb2000 run.
 define_pd_global(intx, InitialCodeCacheSize,         2496*K); // Integral multiple of CodeCacheExpansionSize
 define_pd_global(intx, CodeCacheExpansionSize,       64*K);
 
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   128ULL*G);
 #else
 define_pd_global(intx, INTPRESSURE,                  6);
 define_pd_global(intx, InteriorEntryAlignment,       4);
-define_pd_global(intx, NewSizeThreadIncrease,        4*K);
+define_pd_global(size_t, NewSizeThreadIncrease,      4*K);
 define_pd_global(intx, LoopUnrollLimit,              50);     // Design center runs on 1.3.1
 // InitialCodeCacheSize derived from specjbb2000 run.
 define_pd_global(intx, InitialCodeCacheSize,         2304*K); // Integral multiple of CodeCacheExpansionSize
 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    4ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   4ULL*G);
 #endif // AMD64
 define_pd_global(intx, RegisterCostAreaRatio,        16000);
 
@@ -93,7 +93,7 @@
 define_pd_global(bool,  TrapBasedRangeChecks,        false); // Not needed on x86.
 
 // Heap related flags
-define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(16*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(16*M));
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
--- a/hotspot/src/cpu/x86/vm/globals_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -78,7 +78,7 @@
 #endif
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 64*M);  // default max size of CMS young gen, per GC worker thread
+define_pd_global(size_t, CMSYoungGenPerWorker, 64*M);  // default max size of CMS young gen, per GC worker thread
 
 define_pd_global(uintx, TypeProfileLevel, 111);
 
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -706,7 +706,6 @@
     assert_different_registers(start, count);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!uninitialized_target) {
@@ -739,7 +738,6 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
     assert_different_registers(start, count);
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           __ pusha();                      // push registers
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1207,7 +1207,6 @@
   void  gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
@@ -1252,7 +1251,6 @@
     assert_different_registers(start, count, scratch);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           __ pusha();             // push registers (overkill)
--- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -156,7 +156,6 @@
   assert(val == noreg || val == rax, "parameter is just for looks");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // flatten object address if needed
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -57,7 +57,7 @@
 define_pd_global(bool,  UseMembar,            true);
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
+define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
--- a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -50,7 +50,7 @@
 define_pd_global(intx,     OnStackReplacePercentage,     933  );
 define_pd_global(intx,     FreqInlineSize,               325  );
 define_pd_global(uintx,    NewRatio,                     12   );
-define_pd_global(intx,     NewSizeThreadIncrease,        4*K  );
+define_pd_global(size_t,   NewSizeThreadIncrease,        4*K  );
 define_pd_global(intx,     InitialCodeCacheSize,         160*K);
 define_pd_global(intx,     ReservedCodeCacheSize,        32*M );
 define_pd_global(intx,     NonProfiledCodeHeapSize,      13*M );
@@ -61,7 +61,7 @@
 define_pd_global(uintx,    CodeCacheMinBlockLength,      1    );
 define_pd_global(uintx,    CodeCacheMinimumUseSpace,     200*K);
 
-define_pd_global(uintx,    MetaspaceSize,                12*M );
+define_pd_global(size_t,   MetaspaceSize,                12*M );
 define_pd_global(bool,     NeverActAsServerClassMachine, true );
 define_pd_global(uint64_t, MaxRAM,                       1ULL*G);
 define_pd_global(bool,     CICompileOSR,                 true );
--- a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -40,13 +40,13 @@
 define_pd_global(intx, CompilerThreadStackSize,  4096);
 
 // Allow extra space in DEBUG builds for asserts.
-define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 define_pd_global(intx, StackYellowPages,         6);
 define_pd_global(intx, StackRedPages,            1);
 define_pd_global(intx, StackShadowPages,         6 DEBUG_ONLY(+2));
 
 // Only used on 64 bit platforms
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_AIX_OJDKPPC_VM_GLOBALS_AIX_PPC_HPP
--- a/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -43,9 +43,9 @@
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
--- a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -39,9 +39,9 @@
 define_pd_global(intx,  VMThreadStackSize,       512);
 #endif // _LP64
 define_pd_global(intx,  CompilerThreadStackSize, 0);
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
--- a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -116,6 +116,14 @@
 #endif
 }
 
+void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#ifdef BUILTIN_SIM
+  uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc;
+#else
+  uc->uc_mcontext.pc = (intptr_t)pc;
+#endif
+}
+
 intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) {
 #ifdef BUILTIN_SIM
   return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
@@ -311,7 +319,7 @@
     }
 #else
     if (StubRoutines::is_safefetch_fault(pc)) {
-      uc->uc_mcontext.pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
+      os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
       return 1;
     }
 #endif
@@ -432,11 +440,7 @@
     // save all thread context in case we need to restore it
     if (thread != NULL) thread->set_saved_exception_pc(pc);
 
-#ifdef BUILTIN_SIM
-    uc->uc_mcontext.gregs[REG_PC] = (greg_t)stub;
-#else
-    uc->uc_mcontext.pc = (__u64)stub;
-#endif
+    os::Linux::ucontext_set_pc(uc, stub);
     return true;
   }
 
--- a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -40,13 +40,13 @@
 define_pd_global(intx, CompilerThreadStackSize,  4096);
 
 // Allow extra space in DEBUG builds for asserts.
-define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 define_pd_global(intx, StackYellowPages,         6);
 define_pd_global(intx, StackRedPages,            1);
 define_pd_global(intx, StackShadowPages,         6 DEBUG_ONLY(+2));
 
 // Only used on 64 bit platforms
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_LINUX_PPC_VM_GLOBALS_LINUX_PPC_HPP
--- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -30,10 +30,10 @@
 // runtime system.  (see globals.hpp)
 //
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    12288);
+define_pd_global(size_t, JVMInvokeMethodSlack,   12288);
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      CONST64(4)*G);
+define_pd_global(size_t, HeapBaseMinAddress,     CONST64(4)*G);
 
 #endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
--- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -42,9 +42,9 @@
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
--- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -39,9 +39,9 @@
 define_pd_global(intx,  VMThreadStackSize,       512);
 #endif // _LP64
 define_pd_global(intx,  CompilerThreadStackSize, 0);
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
--- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -30,16 +30,16 @@
 // (see globals.hpp)
 //
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    12288);
+define_pd_global(size_t, JVMInvokeMethodSlack,   12288);
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
 // Used on 64 bit platforms for UseCompressedOops base address
 #ifdef _LP64
 // use 6G as default base address because by default the OS maps the application
 // to 4G on Solaris-Sparc. This leaves at least 2G for the native heap.
-define_pd_global(uintx, HeapBaseMinAddress,      CONST64(6)*G);
+define_pd_global(size_t, HeapBaseMinAddress,     CONST64(6)*G);
 #else
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 #endif
 
 
--- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -32,18 +32,18 @@
 #ifdef AMD64
 define_pd_global(intx, ThreadStackSize,          1024); // 0 => use system default
 define_pd_global(intx, VMThreadStackSize,        1024);
-define_pd_global(uintx,JVMInvokeMethodSlack,     8*K);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8*K);
 #else
 // ThreadStackSize 320 allows a couple of test cases to run while
 // keeping the number of threads that can be created high.
 define_pd_global(intx, ThreadStackSize,          320);
 define_pd_global(intx, VMThreadStackSize,        512);
-define_pd_global(uintx,JVMInvokeMethodSlack,     10*K);
+define_pd_global(size_t, JVMInvokeMethodSlack,   10*K);
 #endif // AMD64
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
--- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -43,9 +43,9 @@
 define_pd_global(intx, CompilerThreadStackSize,  0);
 #endif
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1421,7 +1421,6 @@
   // Do the pre-write barrier, if any.
   switch (_bs->kind()) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
       break;
@@ -1442,7 +1441,6 @@
 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
   switch (_bs->kind()) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       G1SATBCardTableModRef_post_barrier(addr,  new_val);
       break;
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -186,7 +186,7 @@
       cp->space->set_compaction_top(compact_top);
       cp->space = cp->space->next_compaction_space();
       if (cp->space == NULL) {
-        cp->gen = GenCollectedHeap::heap()->prev_gen(cp->gen);
+        cp->gen = GenCollectedHeap::heap()->young_gen();
         assert(cp->gen != NULL, "compaction must succeed");
         cp->space = cp->gen->first_compaction_space();
         assert(cp->space != NULL, "generation must have a first compaction space");
@@ -900,7 +900,6 @@
   }
 }
 
-
 // Callers of this iterator beware: The closure application should
 // be robust in the face of uninitialized objects and should (always)
 // return a correct size so that the next addr + size below gives us a
@@ -2663,8 +2662,8 @@
       // Need to smooth wrt historical average
       if (ResizeOldPLAB) {
         _blocks_to_claim[i].sample(
-          MAX2((size_t)CMSOldPLABMin,
-          MIN2((size_t)CMSOldPLABMax,
+          MAX2(CMSOldPLABMin,
+          MIN2(CMSOldPLABMax,
                _global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills))));
       }
       // Reset counters for next round
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -36,7 +36,9 @@
 // space, in this case a CompactibleFreeListSpace.
 
 // Forward declarations
+class CMSCollector;
 class CompactibleFreeListSpace;
+class ConcurrentMarkSweepGeneration;
 class BlkClosure;
 class BlkClosureCareful;
 class FreeChunk;
@@ -396,6 +398,10 @@
   // Resizing support
   void set_end(HeapWord* value);  // override
 
+  // Never mangle CompactibleFreeListSpace
+  void mangle_unused_area() {}
+  void mangle_unused_area_complete() {}
+
   // Mutual exclusion support
   Mutex* freelistLock() const { return &_freelistLock; }
 
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -369,7 +369,7 @@
 double CMSStats::time_until_cms_gen_full() const {
   size_t cms_free = _cms_gen->cmsSpace()->free();
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  size_t expected_promotion = MIN2(gch->get_gen(0)->capacity(),
+  size_t expected_promotion = MIN2(gch->young_gen()->capacity(),
                                    (size_t) _cms_gen->gc_stats()->avg_promoted()->padded_average());
   if (cms_free > expected_promotion) {
     // Start a cms collection if there isn't enough space to promote
@@ -506,7 +506,7 @@
   _collector_policy(cp),
   _should_unload_classes(CMSClassUnloadingEnabled),
   _concurrent_cycles_since_last_unload(0),
-  _roots_scanning_options(SharedHeap::SO_None),
+  _roots_scanning_options(GenCollectedHeap::SO_None),
   _inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
   _intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
   _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
@@ -626,8 +626,8 @@
 
   // Support for parallelizing young gen rescan
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  assert(gch->prev_gen(_cmsGen)->kind() == Generation::ParNew, "CMS can only be used with ParNew");
-  _young_gen = (ParNewGeneration*)gch->prev_gen(_cmsGen);
+  assert(gch->young_gen()->kind() == Generation::ParNew, "CMS can only be used with ParNew");
+  _young_gen = (ParNewGeneration*)gch->young_gen();
   if (gch->supports_inline_contig_alloc()) {
     _top_addr = gch->top_addr();
     _end_addr = gch->end_addr();
@@ -869,7 +869,7 @@
       if (prev_level >= 0) {
         size_t prev_size = 0;
         GenCollectedHeap* gch = GenCollectedHeap::heap();
-        Generation* prev_gen = gch->get_gen(prev_level);
+        Generation* prev_gen = gch->young_gen();
         prev_size = prev_gen->capacity();
           gclog_or_tty->print_cr("  Younger gen size "SIZE_FORMAT,
                                  prev_size/1000);
@@ -1049,11 +1049,8 @@
     // expand and retry
     size_t s = _cmsSpace->expansionSpaceRequired(obj_size);  // HeapWords
     expand_for_gc_cause(s*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_promotion);
-    // Since there's currently no next generation, we don't try to promote
+    // Since this is the old generation, we don't try to promote
     // into a more senior generation.
-    assert(next_gen() == NULL, "assumption, based upon which no attempt "
-                               "is made to pass on a possibly failing "
-                               "promotion to next generation");
     res = _cmsSpace->promote(obj, obj_size);
   }
   if (res != NULL) {
@@ -2499,7 +2496,7 @@
   gch->gen_process_roots(_cmsGen->level(),
                          true,   // younger gens are roots
                          true,   // activate StrongRootsScope
-                         SharedHeap::ScanningOption(roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(roots_scanning_options()),
                          should_unload_classes(),
                          &notOlder,
                          NULL,
@@ -2567,7 +2564,7 @@
   gch->gen_process_roots(_cmsGen->level(),
                          true,   // younger gens are roots
                          true,   // activate StrongRootsScope
-                         SharedHeap::ScanningOption(roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(roots_scanning_options()),
                          should_unload_classes(),
                          &notOlder,
                          NULL,
@@ -2751,7 +2748,7 @@
 void CMSCollector::setup_cms_unloading_and_verification_state() {
   const  bool should_verify =   VerifyBeforeGC || VerifyAfterGC || VerifyDuringGC
                              || VerifyBeforeExit;
-  const  int  rso           =   SharedHeap::SO_AllCodeCache;
+  const  int  rso           =   GenCollectedHeap::SO_AllCodeCache;
 
   // We set the proper root for this CMS cycle here.
   if (should_unload_classes()) {   // Should unload classes this cycle
@@ -3000,7 +2997,6 @@
   report_heap_summary(GCWhen::BeforeGC);
 
   ReferenceProcessor* rp = ref_processor();
-  SpecializationStats::clear();
   assert(_restart_addr == NULL, "Control point invariant");
   {
     // acquire locks for subsequent manipulations
@@ -3011,7 +3007,6 @@
     rp->enable_discovery();
     _collectorState = Marking;
   }
-  SpecializationStats::print();
 }
 
 void CMSCollector::checkpointRootsInitialWork() {
@@ -3092,7 +3087,7 @@
       gch->gen_process_roots(_cmsGen->level(),
                              true,   // younger gens are roots
                              true,   // activate StrongRootsScope
-                             SharedHeap::ScanningOption(roots_scanning_options()),
+                             GenCollectedHeap::ScanningOption(roots_scanning_options()),
                              should_unload_classes(),
                              &notOlder,
                              NULL,
@@ -4329,7 +4324,6 @@
   verify_work_stacks_empty();
   verify_overflow_empty();
 
-  SpecializationStats::clear();
   if (PrintGCDetails) {
     gclog_or_tty->print("[YG occupancy: "SIZE_FORMAT" K ("SIZE_FORMAT" K)]",
                         _young_gen->used() / K,
@@ -4360,7 +4354,6 @@
   }
   verify_work_stacks_empty();
   verify_overflow_empty();
-  SpecializationStats::print();
 }
 
 void CMSCollector::checkpointRootsFinalWork() {
@@ -4528,13 +4521,13 @@
   gch->gen_process_roots(_collector->_cmsGen->level(),
                          false,     // yg was scanned above
                          false,     // this is parallel code
-                         SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                          _collector->should_unload_classes(),
                          &par_mri_cl,
                          NULL,
                          &cld_closure);
   assert(_collector->should_unload_classes()
-         || (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
+         || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
          "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
   _timer.stop();
   if (PrintCMSStatistics != 0) {
@@ -4664,14 +4657,14 @@
   gch->gen_process_roots(_collector->_cmsGen->level(),
                          false,     // yg was scanned above
                          false,     // this is parallel code
-                         SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                          _collector->should_unload_classes(),
                          &par_mrias_cl,
                          NULL,
                          NULL);     // The dirty klasses will be handled below
 
   assert(_collector->should_unload_classes()
-         || (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
+         || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
          "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
   _timer.stop();
   if (PrintCMSStatistics != 0) {
@@ -5255,14 +5248,14 @@
     gch->gen_process_roots(_cmsGen->level(),
                            true,  // younger gens as roots
                            false, // use the local StrongRootsScope
-                           SharedHeap::ScanningOption(roots_scanning_options()),
+                           GenCollectedHeap::ScanningOption(roots_scanning_options()),
                            should_unload_classes(),
                            &mrias_cl,
                            NULL,
                            NULL); // The dirty klasses will be handled below
 
     assert(should_unload_classes()
-           || (roots_scanning_options() & SharedHeap::SO_AllCodeCache),
+           || (roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
            "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
   }
 
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
 
+#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
 #include "gc_implementation/shared/gcHeapSummary.hpp"
 #include "gc_implementation/shared/gSpaceCounters.hpp"
 #include "gc_implementation/shared/gcStats.hpp"
@@ -55,6 +56,7 @@
 // means of a sliding mark-compact.
 
 class AdaptiveSizePolicy;
+class CMSCollector;
 class CMSConcMarkingTask;
 class CMSGCAdaptivePolicyCounters;
 class CMSTracer;
@@ -64,6 +66,7 @@
 class ConcurrentMarkSweepThread;
 class CompactibleFreeListSpace;
 class FreeChunk;
+class ParNewGeneration;
 class PromotionInfo;
 class ScanMarkedObjectsAgainCarefullyClosure;
 class TenuredGeneration;
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -696,32 +696,32 @@
   }
 
   if (FLAG_IS_DEFAULT(MarkStackSize)) {
-    uintx mark_stack_size =
+    size_t mark_stack_size =
       MIN2(MarkStackSizeMax,
-          MAX2(MarkStackSize, (uintx) (parallel_marking_threads() * TASKQUEUE_SIZE)));
+          MAX2(MarkStackSize, (size_t) (parallel_marking_threads() * TASKQUEUE_SIZE)));
     // Verify that the calculated value for MarkStackSize is in range.
     // It would be nice to use the private utility routine from Arguments.
     if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
-      warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
-              "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
-              mark_stack_size, (uintx) 1, MarkStackSizeMax);
+      warning("Invalid value calculated for MarkStackSize (" SIZE_FORMAT "): "
+              "must be between 1 and " SIZE_FORMAT,
+              mark_stack_size, MarkStackSizeMax);
       return;
     }
-    FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
+    FLAG_SET_ERGO(size_t, MarkStackSize, mark_stack_size);
   } else {
     // Verify MarkStackSize is in range.
     if (FLAG_IS_CMDLINE(MarkStackSize)) {
       if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
         if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
-          warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
-                  "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
-                  MarkStackSize, (uintx) 1, MarkStackSizeMax);
+          warning("Invalid value specified for MarkStackSize (" SIZE_FORMAT "): "
+                  "must be between 1 and " SIZE_FORMAT,
+                  MarkStackSize, MarkStackSizeMax);
           return;
         }
       } else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
         if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
-          warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT ")"
-                  " or for MarkStackSizeMax (" UINTX_FORMAT ")",
+          warning("Invalid value specified for MarkStackSize (" SIZE_FORMAT ")"
+                  " or for MarkStackSizeMax (" SIZE_FORMAT ")",
                   MarkStackSize, MarkStackSizeMax);
           return;
         }
@@ -745,7 +745,7 @@
   // so that the assertion in MarkingTaskQueue::task_queue doesn't fail
   _active_tasks = _max_worker_id;
 
-  size_t max_regions = (size_t) _g1h->max_regions();
+  uint max_regions = _g1h->max_regions();
   for (uint i = 0; i < _max_worker_id; ++i) {
     CMTaskQueue* task_queue = new CMTaskQueue();
     task_queue->initialize();
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -34,6 +34,7 @@
 class G1CollectedHeap;
 class CMBitMap;
 class CMTask;
+class ConcurrentMark;
 typedef GenericTaskQueue<oop, mtGC>            CMTaskQueue;
 typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -48,6 +48,7 @@
 #include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/g1RootProcessor.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/g1/g1YCTypes.hpp"
 #include "gc_implementation/g1/heapRegion.inline.hpp"
@@ -89,18 +90,6 @@
 // apply to TLAB allocation, which is not part of this interface: it
 // is done by clients of this interface.)
 
-// Notes on implementation of parallelism in different tasks.
-//
-// G1ParVerifyTask uses heap_region_par_iterate() for parallelism.
-// The number of GC workers is passed to heap_region_par_iterate().
-// It does use run_task() which sets _n_workers in the task.
-// G1ParTask executes g1_process_roots() ->
-// SharedHeap::process_roots() which calls eventually to
-// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
-// SequentialSubTasksDone.  SharedHeap::process_roots() also
-// directly uses SubTasksDone (_process_strong_tasks field in SharedHeap).
-//
-
 // Local to this file.
 
 class RefineCardTableEntryClosure: public CardTableEntryClosure {
@@ -1767,7 +1756,6 @@
   _is_alive_closure_stw(this),
   _ref_processor_cm(NULL),
   _ref_processor_stw(NULL),
-  _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)),
   _bot_shared(NULL),
   _evac_failure_scan_stack(NULL),
   _mark_in_progress(false),
@@ -1801,9 +1789,6 @@
   _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) {
 
   _g1h = this;
-  if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
-    vm_exit_during_initialization("Failed necessary allocation.");
-  }
 
   _allocator = G1Allocator::create_allocator(_g1h);
   _humongous_object_threshold_in_words = HeapRegion::GrainWords / 2;
@@ -2026,10 +2011,6 @@
                                              Shared_DirtyCardQ_lock,
                                              &JavaThread::dirty_card_queue_set());
 
-  // In case we're keeping closure specialization stats, initialize those
-  // counts and that mechanism.
-  SpecializationStats::clear();
-
   // Here we allocate the dummy HeapRegion that is required by the
   // G1AllocRegion class.
   HeapRegion* dummy_region = _hrm.get_dummy_region();
@@ -2206,11 +2187,11 @@
   hot_card_cache->drain(worker_i, g1_rem_set(), into_cset_dcq);
 
   DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
-  int n_completed_buffers = 0;
+  size_t n_completed_buffers = 0;
   while (dcqs.apply_closure_to_completed_buffer(cl, worker_i, 0, true)) {
     n_completed_buffers++;
   }
-  g1_policy()->phase_times()->record_update_rs_processed_buffers(worker_i, n_completed_buffers);
+  g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
   dcqs.clear_n_completed_buffers();
   assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
 }
@@ -3111,11 +3092,12 @@
     G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
     G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
 
-    process_all_roots(true,            // activate StrongRootsScope
-                      SO_AllCodeCache, // roots scanning options
-                      &rootsCl,
-                      &cldCl,
-                      &blobsCl);
+    {
+      G1RootProcessor root_processor(this);
+      root_processor.process_all_roots(&rootsCl,
+                                       &cldCl,
+                                       &blobsCl);
+    }
 
     bool failures = rootsCl.failures() || codeRootsCl.failures();
 
@@ -3321,7 +3303,6 @@
     concurrent_mark()->print_summary_info();
   }
   g1_policy()->print_yg_surv_rate_info();
-  SpecializationStats::print();
 }
 
 #ifndef PRODUCT
@@ -3751,9 +3732,9 @@
 
     TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
 
-    int active_workers = workers()->active_workers();
+    uint active_workers = workers()->active_workers();
     double pause_start_sec = os::elapsedTime();
-    g1_policy()->phase_times()->note_gc_start(active_workers);
+    g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());
     log_gc_header();
 
     TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
@@ -4365,60 +4346,11 @@
   }
 };
 
-class G1CodeBlobClosure : public CodeBlobClosure {
-  class HeapRegionGatheringOopClosure : public OopClosure {
-    G1CollectedHeap* _g1h;
-    OopClosure* _work;
-    nmethod* _nm;
-
-    template <typename T>
-    void do_oop_work(T* p) {
-      _work->do_oop(p);
-      T oop_or_narrowoop = oopDesc::load_heap_oop(p);
-      if (!oopDesc::is_null(oop_or_narrowoop)) {
-        oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
-        HeapRegion* hr = _g1h->heap_region_containing_raw(o);
-        assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
-        hr->add_strong_code_root(_nm);
-      }
-    }
-
-  public:
-    HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
-
-    void do_oop(oop* o) {
-      do_oop_work(o);
-    }
-
-    void do_oop(narrowOop* o) {
-      do_oop_work(o);
-    }
-
-    void set_nm(nmethod* nm) {
-      _nm = nm;
-    }
-  };
-
-  HeapRegionGatheringOopClosure _oc;
-public:
-  G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
-
-  void do_code_blob(CodeBlob* cb) {
-    nmethod* nm = cb->as_nmethod_or_null();
-    if (nm != NULL) {
-      if (!nm->test_set_oops_do_mark()) {
-        _oc.set_nm(nm);
-        nm->oops_do(&_oc);
-        nm->fix_oop_relocations();
-      }
-    }
-  }
-};
-
 class G1ParTask : public AbstractGangTask {
 protected:
   G1CollectedHeap*       _g1h;
   RefToScanQueueSet      *_queues;
+  G1RootProcessor*       _root_processor;
   ParallelTaskTerminator _terminator;
   uint _n_workers;
 
@@ -4426,10 +4358,11 @@
   Mutex* stats_lock() { return &_stats_lock; }
 
 public:
-  G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues)
+  G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor)
     : AbstractGangTask("G1 collection"),
       _g1h(g1h),
       _queues(task_queues),
+      _root_processor(root_processor),
       _terminator(0, _queues),
       _stats_lock(Mutex::leaf, "parallel G1 stats lock", true)
   {}
@@ -4443,13 +4376,7 @@
   ParallelTaskTerminator* terminator() { return &_terminator; }
 
   virtual void set_for_termination(int active_workers) {
-    // This task calls set_n_termination() in par_non_clean_card_iterate_work()
-    // in the young space (_par_seq_tasks) in the G1 heap
-    // for SequentialSubTasksDone.
-    // This task also uses SubTasksDone in SharedHeap and G1CollectedHeap
-    // both of which need setting by set_n_termination().
-    _g1h->SharedHeap::set_n_termination(active_workers);
-    _g1h->set_n_termination(active_workers);
+    _root_processor->set_num_workers(active_workers);
     terminator()->reset_for_reuse(active_workers);
     _n_workers = active_workers;
   }
@@ -4486,8 +4413,7 @@
   void work(uint worker_id) {
     if (worker_id >= _n_workers) return;  // no work needed this round
 
-    double start_time_ms = os::elapsedTime() * 1000.0;
-    _g1h->g1_policy()->phase_times()->record_gc_worker_start_time(worker_id, start_time_ms);
+    _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, os::elapsedTime());
 
     {
       ResourceMark rm;
@@ -4519,24 +4445,21 @@
                                                                                     false, // Process all klasses.
                                                                                     true); // Need to claim CLDs.
 
-      G1CodeBlobClosure scan_only_code_cl(&scan_only_root_cl);
-      G1CodeBlobClosure scan_mark_code_cl(&scan_mark_root_cl);
-      // IM Weak code roots are handled later.
-
       OopClosure* strong_root_cl;
       OopClosure* weak_root_cl;
       CLDClosure* strong_cld_cl;
       CLDClosure* weak_cld_cl;
-      CodeBlobClosure* strong_code_cl;
+
+      bool trace_metadata = false;
 
       if (_g1h->g1_policy()->during_initial_mark_pause()) {
         // We also need to mark copied objects.
         strong_root_cl = &scan_mark_root_cl;
         strong_cld_cl  = &scan_mark_cld_cl;
-        strong_code_cl = &scan_mark_code_cl;
         if (ClassUnloadingWithConcurrentMark) {
           weak_root_cl = &scan_mark_weak_root_cl;
           weak_cld_cl  = &scan_mark_weak_cld_cl;
+          trace_metadata = true;
         } else {
           weak_root_cl = &scan_mark_root_cl;
           weak_cld_cl  = &scan_mark_cld_cl;
@@ -4546,31 +4469,32 @@
         weak_root_cl   = &scan_only_root_cl;
         strong_cld_cl  = &scan_only_cld_cl;
         weak_cld_cl    = &scan_only_cld_cl;
-        strong_code_cl = &scan_only_code_cl;
       }
 
-
-      G1ParPushHeapRSClosure  push_heap_rs_cl(_g1h, &pss);
-
       pss.start_strong_roots();
-      _g1h->g1_process_roots(strong_root_cl,
-                             weak_root_cl,
-                             &push_heap_rs_cl,
-                             strong_cld_cl,
-                             weak_cld_cl,
-                             strong_code_cl,
-                             worker_id);
-
+
+      _root_processor->evacuate_roots(strong_root_cl,
+                                      weak_root_cl,
+                                      strong_cld_cl,
+                                      weak_cld_cl,
+                                      trace_metadata,
+                                      worker_id);
+
+      G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
+      _root_processor->scan_remembered_sets(&push_heap_rs_cl,
+                                            weak_root_cl,
+                                            worker_id);
       pss.end_strong_roots();
 
       {
         double start = os::elapsedTime();
         G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
         evac.do_void();
-        double elapsed_ms = (os::elapsedTime()-start)*1000.0;
-        double term_ms = pss.term_time()*1000.0;
-        _g1h->g1_policy()->phase_times()->add_obj_copy_time(worker_id, elapsed_ms-term_ms);
-        _g1h->g1_policy()->phase_times()->record_termination(worker_id, term_ms, pss.term_attempts());
+        double elapsed_sec = os::elapsedTime() - start;
+        double term_sec = pss.term_time();
+        _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
+        _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
+        _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, pss.term_attempts());
       }
       _g1h->g1_policy()->record_thread_age_table(pss.age_table());
       _g1h->update_surviving_young_words(pss.surviving_young_words()+1);
@@ -4586,100 +4510,10 @@
       // destructors are executed here and are included as part of the
       // "GC Worker Time".
     }
-
-    double end_time_ms = os::elapsedTime() * 1000.0;
-    _g1h->g1_policy()->phase_times()->record_gc_worker_end_time(worker_id, end_time_ms);
+    _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerEnd, worker_id, os::elapsedTime());
   }
 };
 
-// *** Common G1 Evacuation Stuff
-
-// This method is run in a GC worker.
-
-void
-G1CollectedHeap::
-g1_process_roots(OopClosure* scan_non_heap_roots,
-                 OopClosure* scan_non_heap_weak_roots,
-                 G1ParPushHeapRSClosure* scan_rs,
-                 CLDClosure* scan_strong_clds,
-                 CLDClosure* scan_weak_clds,
-                 CodeBlobClosure* scan_strong_code,
-                 uint worker_i) {
-
-  // First scan the shared roots.
-  double ext_roots_start = os::elapsedTime();
-  double closure_app_time_sec = 0.0;
-
-  bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
-  bool trace_metadata = during_im && ClassUnloadingWithConcurrentMark;
-
-  BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
-  BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
-
-  process_roots(false, // no scoping; this is parallel code
-                SharedHeap::SO_None,
-                &buf_scan_non_heap_roots,
-                &buf_scan_non_heap_weak_roots,
-                scan_strong_clds,
-                // Unloading Initial Marks handle the weak CLDs separately.
-                (trace_metadata ? NULL : scan_weak_clds),
-                scan_strong_code);
-
-  // Now the CM ref_processor roots.
-  if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
-    // We need to treat the discovered reference lists of the
-    // concurrent mark ref processor as roots and keep entries
-    // (which are added by the marking threads) on them live
-    // until they can be processed at the end of marking.
-    ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
-  }
-
-  if (trace_metadata) {
-    // Barrier to make sure all workers passed
-    // the strong CLD and strong nmethods phases.
-    active_strong_roots_scope()->wait_until_all_workers_done_with_threads(n_par_threads());
-
-    // Now take the complement of the strong CLDs.
-    ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
-  }
-
-  // Finish up any enqueued closure apps (attributed as object copy time).
-  buf_scan_non_heap_roots.done();
-  buf_scan_non_heap_weak_roots.done();
-
-  double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
-      + buf_scan_non_heap_weak_roots.closure_app_seconds();
-
-  g1_policy()->phase_times()->record_obj_copy_time(worker_i, obj_copy_time_sec * 1000.0);
-
-  double ext_root_time_ms =
-    ((os::elapsedTime() - ext_roots_start) - obj_copy_time_sec) * 1000.0;
-
-  g1_policy()->phase_times()->record_ext_root_scan_time(worker_i, ext_root_time_ms);
-
-  // During conc marking we have to filter the per-thread SATB buffers
-  // to make sure we remove any oops into the CSet (which will show up
-  // as implicitly live).
-  double satb_filtering_ms = 0.0;
-  if (!_process_strong_tasks->is_task_claimed(G1H_PS_filter_satb_buffers)) {
-    if (mark_in_progress()) {
-      double satb_filter_start = os::elapsedTime();
-
-      JavaThread::satb_mark_queue_set().filter_thread_buffers();
-
-      satb_filtering_ms = (os::elapsedTime() - satb_filter_start) * 1000.0;
-    }
-  }
-  g1_policy()->phase_times()->record_satb_filtering_time(worker_i, satb_filtering_ms);
-
-  // Now scan the complement of the collection set.
-  G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
-
-  g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
-
-  _process_strong_tasks->all_tasks_completed();
-}
-
 class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
 private:
   BoolObjectClosure* _is_alive;
@@ -5054,14 +4888,13 @@
   G1RedirtyLoggedCardsTask(DirtyCardQueueSet* queue) : AbstractGangTask("Redirty Cards"), _queue(queue) { }
 
   virtual void work(uint worker_id) {
-    double start_time = os::elapsedTime();
+    G1GCPhaseTimes* phase_times = G1CollectedHeap::heap()->g1_policy()->phase_times();
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::RedirtyCards, worker_id);
 
     RedirtyLoggedCardTableEntryClosure cl;
     _queue->par_apply_closure_to_all_completed_buffers(&cl);
 
-    G1GCPhaseTimes* timer = G1CollectedHeap::heap()->g1_policy()->phase_times();
-    timer->record_redirty_logged_cards_time_ms(worker_id, (os::elapsedTime() - start_time) * 1000.0);
-    timer->record_redirty_logged_cards_processed_cards(worker_id, cl.num_processed());
+    phase_times->record_thread_work_item(G1GCPhaseTimes::RedirtyCards, worker_id, cl.num_processed());
   }
 };
 
@@ -5608,7 +5441,6 @@
   workers()->set_active_workers(n_workers);
   set_par_threads(n_workers);
 
-  G1ParTask g1_par_task(this, _task_queues);
 
   init_for_evac_failure(NULL);
 
@@ -5617,7 +5449,8 @@
   double end_par_time_sec;
 
   {
-    StrongRootsScope srs(this);
+    G1RootProcessor root_processor(this);
+    G1ParTask g1_par_task(this, _task_queues, &root_processor);
     // InitialMark needs claim bits to keep track of the marked-through CLDs.
     if (g1_policy()->during_initial_mark_pause()) {
       ClassLoaderDataGraph::clear_claimed_marks();
@@ -5633,18 +5466,20 @@
     end_par_time_sec = os::elapsedTime();
 
     // Closing the inner scope will execute the destructor
-    // for the StrongRootsScope object. We record the current
+    // for the G1RootProcessor object. We record the current
     // elapsed time before closing the scope so that time
-    // taken for the SRS destructor is NOT included in the
+    // taken for the destructor is NOT included in the
     // reported parallel time.
   }
 
+  G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
+
   double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
-  g1_policy()->phase_times()->record_par_time(par_time_ms);
+  phase_times->record_par_time(par_time_ms);
 
   double code_root_fixup_time_ms =
         (os::elapsedTime() - end_par_time_sec) * 1000.0;
-  g1_policy()->phase_times()->record_code_root_fixup_time(code_root_fixup_time_ms);
+  phase_times->record_code_root_fixup_time(code_root_fixup_time_ms);
 
   set_par_threads(0);
 
@@ -5656,9 +5491,14 @@
   process_discovered_references(n_workers);
 
   if (G1StringDedup::is_enabled()) {
+    double fixup_start = os::elapsedTime();
+
     G1STWIsAliveClosure is_alive(this);
     G1KeepAliveClosure keep_alive(this);
-    G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive);
+    G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, phase_times);
+
+    double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
+    phase_times->record_string_dedup_fixup_time(fixup_time_ms);
   }
 
   _allocator->release_gc_alloc_regions(n_workers, evacuation_info);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -56,6 +56,7 @@
 class GenerationSpec;
 class OopsInHeapRegionClosure;
 class G1KlassScanClosure;
+class G1ParScanThreadState;
 class ObjectClosure;
 class SpaceClosure;
 class CompactibleSpaceClosure;
@@ -780,22 +781,6 @@
   // statistics or updating free lists.
   void abandon_collection_set(HeapRegion* cs_head);
 
-  // Applies "scan_non_heap_roots" to roots outside the heap,
-  // "scan_rs" to roots inside the heap (having done "set_region" to
-  // indicate the region in which the root resides),
-  // and does "scan_metadata" If "scan_rs" is
-  // NULL, then this step is skipped.  The "worker_i"
-  // param is for use with parallel roots processing, and should be
-  // the "i" of the calling parallel worker thread's work(i) function.
-  // In the sequential case this param will be ignored.
-  void g1_process_roots(OopClosure* scan_non_heap_roots,
-                        OopClosure* scan_non_heap_weak_roots,
-                        G1ParPushHeapRSClosure* scan_rs,
-                        CLDClosure* scan_strong_clds,
-                        CLDClosure* scan_weak_clds,
-                        CodeBlobClosure* scan_strong_code,
-                        uint worker_i);
-
   // The concurrent marker (and the thread it runs in.)
   ConcurrentMark* _cm;
   ConcurrentMarkThread* _cmThread;
@@ -982,21 +967,10 @@
   // of G1CollectedHeap::_gc_time_stamp.
   uint* _worker_cset_start_region_time_stamp;
 
-  enum G1H_process_roots_tasks {
-    G1H_PS_filter_satb_buffers,
-    G1H_PS_refProcessor_oops_do,
-    // Leave this one last.
-    G1H_PS_NumElements
-  };
-
-  SubTasksDone* _process_strong_tasks;
-
   volatile bool _free_regions_coming;
 
 public:
 
-  SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
-
   void set_refine_cte_cl_concurrency(bool concurrent);
 
   RefToScanQueue *task_queue(int i) const;
@@ -1029,21 +1003,11 @@
   // Initialize weak reference processing.
   virtual void ref_processing_init();
 
-  void set_par_threads(uint t) {
-    SharedHeap::set_par_threads(t);
-    // Done in SharedHeap but oddly there are
-    // two _process_strong_tasks's in a G1CollectedHeap
-    // so do it here too.
-    _process_strong_tasks->set_n_threads(t);
-  }
-
+  // Explicitly import set_par_threads into this scope
+  using SharedHeap::set_par_threads;
   // Set _n_par_threads according to a policy TBD.
   void set_par_threads();
 
-  void set_n_termination(int t) {
-    _process_strong_tasks->set_n_threads(t);
-  }
-
   virtual CollectedHeap::Name kind() const {
     return CollectedHeap::G1CollectedHeap;
   }
@@ -1118,6 +1082,10 @@
   // The number of regions that are completely free.
   uint num_free_regions() const { return _hrm.num_free_regions(); }
 
+  MemoryUsage get_auxiliary_data_memory_usage() const {
+    return _hrm.get_auxiliary_data_memory_usage();
+  }
+
   // The number of regions that are not completely free.
   uint num_used_regions() const { return num_regions() - num_free_regions(); }
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -321,7 +321,7 @@
 
 void G1CollectorPolicy::initialize_flags() {
   if (G1HeapRegionSize != HeapRegion::GrainBytes) {
-    FLAG_SET_ERGO(uintx, G1HeapRegionSize, HeapRegion::GrainBytes);
+    FLAG_SET_ERGO(size_t, G1HeapRegionSize, HeapRegion::GrainBytes);
   }
 
   if (SurvivorRatio < 1) {
@@ -335,7 +335,7 @@
   uintx max_regions = G1CollectedHeap::heap()->max_regions();
   size_t max_young_size = (size_t)_young_gen_sizer->max_young_length(max_regions) * HeapRegion::GrainBytes;
   if (max_young_size != MaxNewSize) {
-    FLAG_SET_ERGO(uintx, MaxNewSize, max_young_size);
+    FLAG_SET_ERGO(size_t, MaxNewSize, max_young_size);
   }
 }
 
@@ -1073,7 +1073,7 @@
   if (update_stats) {
     double cost_per_card_ms = 0.0;
     if (_pending_cards > 0) {
-      cost_per_card_ms = phase_times()->average_last_update_rs_time() / (double) _pending_cards;
+      cost_per_card_ms = phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) / (double) _pending_cards;
       _cost_per_card_ms_seq->add(cost_per_card_ms);
     }
 
@@ -1081,7 +1081,7 @@
 
     double cost_per_entry_ms = 0.0;
     if (cards_scanned > 10) {
-      cost_per_entry_ms = phase_times()->average_last_scan_rs_time() / (double) cards_scanned;
+      cost_per_entry_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) / (double) cards_scanned;
       if (_last_gc_was_young) {
         _cost_per_entry_ms_seq->add(cost_per_entry_ms);
       } else {
@@ -1123,7 +1123,7 @@
     double cost_per_byte_ms = 0.0;
 
     if (copied_bytes > 0) {
-      cost_per_byte_ms = phase_times()->average_last_obj_copy_time() / (double) copied_bytes;
+      cost_per_byte_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) / (double) copied_bytes;
       if (_in_marking_window) {
         _cost_per_byte_ms_during_cm_seq->add(cost_per_byte_ms);
       } else {
@@ -1132,8 +1132,8 @@
     }
 
     double all_other_time_ms = pause_time_ms -
-      (phase_times()->average_last_update_rs_time() + phase_times()->average_last_scan_rs_time()
-      + phase_times()->average_last_obj_copy_time() + phase_times()->average_last_termination_time());
+      (phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) + phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) +
+          phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) + phase_times()->average_time_ms(G1GCPhaseTimes::Termination));
 
     double young_other_time_ms = 0.0;
     if (young_cset_region_length() > 0) {
@@ -1174,8 +1174,8 @@
 
   // Note that _mmu_tracker->max_gc_time() returns the time in seconds.
   double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
-  adjust_concurrent_refinement(phase_times()->average_last_update_rs_time(),
-                               phase_times()->sum_last_update_rs_processed_buffers(), update_rs_time_goal_ms);
+  adjust_concurrent_refinement(phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS),
+                               phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS), update_rs_time_goal_ms);
 
   _collectionSetChooser->verify();
 }
@@ -2114,19 +2114,19 @@
     _other.add(pause_time_ms - phase_times->accounted_time_ms());
     _root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
     _parallel.add(phase_times->cur_collection_par_time_ms());
-    _ext_root_scan.add(phase_times->average_last_ext_root_scan_time());
-    _satb_filtering.add(phase_times->average_last_satb_filtering_times_ms());
-    _update_rs.add(phase_times->average_last_update_rs_time());
-    _scan_rs.add(phase_times->average_last_scan_rs_time());
-    _obj_copy.add(phase_times->average_last_obj_copy_time());
-    _termination.add(phase_times->average_last_termination_time());
+    _ext_root_scan.add(phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan));
+    _satb_filtering.add(phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering));
+    _update_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS));
+    _scan_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::ScanRS));
+    _obj_copy.add(phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy));
+    _termination.add(phase_times->average_time_ms(G1GCPhaseTimes::Termination));
 
-    double parallel_known_time = phase_times->average_last_ext_root_scan_time() +
-      phase_times->average_last_satb_filtering_times_ms() +
-      phase_times->average_last_update_rs_time() +
-      phase_times->average_last_scan_rs_time() +
-      phase_times->average_last_obj_copy_time() +
-      + phase_times->average_last_termination_time();
+    double parallel_known_time = phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan) +
+      phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering) +
+      phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS) +
+      phase_times->average_time_ms(G1GCPhaseTimes::ScanRS) +
+      phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy) +
+      phase_times->average_time_ms(G1GCPhaseTimes::Termination);
 
     double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time;
     _parallel_other.add(parallel_other_time);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -22,13 +22,13 @@
  *
  */
 
-
 #include "precompiled.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
 #include "gc_implementation/g1/g1Log.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
-#include "runtime/atomic.inline.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/os.hpp"
 
 // Helper class for avoiding interleaved logging
 class LineBuffer: public StackObj {
@@ -71,184 +71,258 @@
     va_end(ap);
   }
 
+  void print_cr() {
+    gclog_or_tty->print_cr("%s", _buffer);
+    _cur = _indent_level * INDENT_CHARS;
+  }
+
   void append_and_print_cr(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3) {
     va_list ap;
     va_start(ap, format);
     vappend(format, ap);
     va_end(ap);
-    gclog_or_tty->print_cr("%s", _buffer);
-    _cur = _indent_level * INDENT_CHARS;
+    print_cr();
   }
 };
 
-PRAGMA_DIAG_PUSH
-PRAGMA_FORMAT_NONLITERAL_IGNORED
 template <class T>
-void WorkerDataArray<T>::print(int level, const char* title) {
-  if (_length == 1) {
-    // No need for min, max, average and sum for only one worker
-    LineBuffer buf(level);
-    buf.append("[%s:  ", title);
-    buf.append(_print_format, _data[0]);
-    buf.append_and_print_cr("]");
-    return;
+class WorkerDataArray  : public CHeapObj<mtGC> {
+  friend class G1GCParPhasePrinter;
+  T*          _data;
+  uint        _length;
+  const char* _title;
+  bool        _print_sum;
+  int         _log_level;
+  uint        _indent_level;
+  bool        _enabled;
+
+  WorkerDataArray<size_t>* _thread_work_items;
+
+  NOT_PRODUCT(T uninitialized();)
+
+  // We are caching the sum and average to only have to calculate them once.
+  // This is not done in an MT-safe way. It is intended to allow single
+  // threaded code to call sum() and average() multiple times in any order
+  // without having to worry about the cost.
+  bool   _has_new_data;
+  T      _sum;
+  T      _min;
+  T      _max;
+  double _average;
+
+ public:
+  WorkerDataArray(uint length, const char* title, bool print_sum, int log_level, uint indent_level) :
+    _title(title), _length(0), _print_sum(print_sum), _log_level(log_level), _indent_level(indent_level),
+    _has_new_data(true), _thread_work_items(NULL), _enabled(true) {
+    assert(length > 0, "Must have some workers to store data for");
+    _length = length;
+    _data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
+  }
+
+  ~WorkerDataArray() {
+    FREE_C_HEAP_ARRAY(T, _data);
+  }
+
+  void link_thread_work_items(WorkerDataArray<size_t>* thread_work_items) {
+    _thread_work_items = thread_work_items;
+  }
+
+  WorkerDataArray<size_t>* thread_work_items() { return _thread_work_items; }
+
+  void set(uint worker_i, T value) {
+    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+    assert(_data[worker_i] == WorkerDataArray<T>::uninitialized(), err_msg("Overwriting data for worker %d in %s", worker_i, _title));
+    _data[worker_i] = value;
+    _has_new_data = true;
+  }
+
+  void set_thread_work_item(uint worker_i, size_t value) {
+    assert(_thread_work_items != NULL, "No sub count");
+    _thread_work_items->set(worker_i, value);
   }
 
-  T min = _data[0];
-  T max = _data[0];
-  T sum = 0;
+  T get(uint worker_i) {
+    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data added for worker %d", worker_i));
+    return _data[worker_i];
+  }
+
+  void add(uint worker_i, T value) {
+    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data to add to for worker %d", worker_i));
+    _data[worker_i] += value;
+    _has_new_data = true;
+  }
 
-  LineBuffer buf(level);
-  buf.append("[%s:", title);
-  for (uint i = 0; i < _length; ++i) {
-    T val = _data[i];
-    min = MIN2(val, min);
-    max = MAX2(val, max);
-    sum += val;
-    if (G1Log::finest()) {
-      buf.append("  ");
-      buf.append(_print_format, val);
-    }
+  double average(){
+    calculate_totals();
+    return _average;
+  }
+
+  T sum() {
+    calculate_totals();
+    return _sum;
+  }
+
+  T minimum() {
+    calculate_totals();
+    return _min;
   }
 
-  if (G1Log::finest()) {
-    buf.append_and_print_cr("%s", "");
+  T maximum() {
+    calculate_totals();
+    return _max;
   }
 
-  double avg = (double)sum / (double)_length;
-  buf.append(" Min: ");
-  buf.append(_print_format, min);
-  buf.append(", Avg: ");
-  buf.append("%.1lf", avg); // Always print average as a double
-  buf.append(", Max: ");
-  buf.append(_print_format, max);
-  buf.append(", Diff: ");
-  buf.append(_print_format, max - min);
-  if (_print_sum) {
-    // for things like the start and end times the sum is not
-    // that relevant
-    buf.append(", Sum: ");
-    buf.append(_print_format, sum);
+  void reset() PRODUCT_RETURN;
+  void verify() PRODUCT_RETURN;
+
+  void set_enabled(bool enabled) { _enabled = enabled; }
+
+  int log_level() { return _log_level;  }
+
+ private:
+
+  void calculate_totals(){
+    if (!_has_new_data) {
+      return;
+    }
+
+    _sum = (T)0;
+    _min = _data[0];
+    _max = _min;
+    for (uint i = 0; i < _length; ++i) {
+      T val = _data[i];
+      _sum += val;
+      _min = MIN2(_min, val);
+      _max = MAX2(_max, val);
+    }
+    _average = (double)_sum / (double)_length;
+    _has_new_data = false;
   }
-  buf.append_and_print_cr("]");
-}
-PRAGMA_DIAG_POP
+};
+
 
 #ifndef PRODUCT
 
-template <> const int WorkerDataArray<int>::_uninitialized = -1;
-template <> const double WorkerDataArray<double>::_uninitialized = -1.0;
-template <> const size_t WorkerDataArray<size_t>::_uninitialized = (size_t)-1;
+template <>
+size_t WorkerDataArray<size_t>::uninitialized() {
+  return (size_t)-1;
+}
+
+template <>
+double WorkerDataArray<double>::uninitialized() {
+  return -1.0;
+}
 
 template <class T>
 void WorkerDataArray<T>::reset() {
   for (uint i = 0; i < _length; i++) {
-    _data[i] = (T)_uninitialized;
+    _data[i] = WorkerDataArray<T>::uninitialized();
+  }
+  if (_thread_work_items != NULL) {
+    _thread_work_items->reset();
   }
 }
 
 template <class T>
 void WorkerDataArray<T>::verify() {
+  if (!_enabled) {
+    return;
+  }
+
   for (uint i = 0; i < _length; i++) {
-    assert(_data[i] != _uninitialized,
-        err_msg("Invalid data for worker %u, data: %lf, uninitialized: %lf",
-            i, (double)_data[i], (double)_uninitialized));
+    assert(_data[i] != WorkerDataArray<T>::uninitialized(),
+        err_msg("Invalid data for worker %u in '%s'", i, _title));
+  }
+  if (_thread_work_items != NULL) {
+    _thread_work_items->verify();
   }
 }
 
 #endif
 
 G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) :
-  _max_gc_threads(max_gc_threads),
-  _last_gc_worker_start_times_ms(_max_gc_threads, "%.1lf", false),
-  _last_ext_root_scan_times_ms(_max_gc_threads, "%.1lf"),
-  _last_satb_filtering_times_ms(_max_gc_threads, "%.1lf"),
-  _last_update_rs_times_ms(_max_gc_threads, "%.1lf"),
-  _last_update_rs_processed_buffers(_max_gc_threads, "%d"),
-  _last_scan_rs_times_ms(_max_gc_threads, "%.1lf"),
-  _last_strong_code_root_scan_times_ms(_max_gc_threads, "%.1lf"),
-  _last_obj_copy_times_ms(_max_gc_threads, "%.1lf"),
-  _last_termination_times_ms(_max_gc_threads, "%.1lf"),
-  _last_termination_attempts(_max_gc_threads, SIZE_FORMAT),
-  _last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false),
-  _last_gc_worker_times_ms(_max_gc_threads, "%.1lf"),
-  _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf"),
-  _last_redirty_logged_cards_time_ms(_max_gc_threads, "%.1lf"),
-  _last_redirty_logged_cards_processed_cards(_max_gc_threads, SIZE_FORMAT),
-  _cur_string_dedup_queue_fixup_worker_times_ms(_max_gc_threads, "%.1lf"),
-  _cur_string_dedup_table_fixup_worker_times_ms(_max_gc_threads, "%.1lf")
+  _max_gc_threads(max_gc_threads)
 {
   assert(max_gc_threads > 0, "Must have some GC threads");
+
+  _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms)", false, G1Log::LevelFiner, 2);
+  _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms)", true, G1Log::LevelFiner, 2);
+
+  // Root scanning phases
+  _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[StringTableRoots] = new WorkerDataArray<double>(max_gc_threads, "StringTable Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray<double>(max_gc_threads, "FlatProfiler Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[CodeCacheRoots] = new WorkerDataArray<double>(max_gc_threads, "CodeCache Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[SATBFiltering] = new WorkerDataArray<double>(max_gc_threads, "SATB Filtering (ms)", true, G1Log::LevelFinest, 3);
+
+  _gc_par_phases[UpdateRS] = new WorkerDataArray<double>(max_gc_threads, "Update RS (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[ScanRS] = new WorkerDataArray<double>(max_gc_threads, "Scan RS (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[CodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Code Root Scanning (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[ObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Object Copy (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[Termination] = new WorkerDataArray<double>(max_gc_threads, "Termination (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[GCWorkerTotal] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Total (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[GCWorkerEnd] = new WorkerDataArray<double>(max_gc_threads, "GC Worker End (ms)", false, G1Log::LevelFiner, 2);
+  _gc_par_phases[Other] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Other (ms)", true, G1Log::LevelFiner, 2);
+
+  _update_rs_processed_buffers = new WorkerDataArray<size_t>(max_gc_threads, "Processed Buffers", true, G1Log::LevelFiner, 3);
+  _gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_processed_buffers);
+
+  _termination_attempts = new WorkerDataArray<size_t>(max_gc_threads, "Termination Attempts", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[Termination]->link_thread_work_items(_termination_attempts);
+
+  _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray<double>(max_gc_threads, "Queue Fixup (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray<double>(max_gc_threads, "Table Fixup (ms)", true, G1Log::LevelFiner, 2);
+
+  _gc_par_phases[RedirtyCards] = new WorkerDataArray<double>(max_gc_threads, "Parallel Redirty", true, G1Log::LevelFinest, 3);
+  _redirtied_cards = new WorkerDataArray<size_t>(max_gc_threads, "Redirtied Cards", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards);
 }
 
-void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) {
+void G1GCPhaseTimes::note_gc_start(uint active_gc_threads, bool mark_in_progress) {
   assert(active_gc_threads > 0, "The number of threads must be > 0");
-  assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max nubmer of threads");
+  assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max number of threads");
   _active_gc_threads = active_gc_threads;
 
-  _last_gc_worker_start_times_ms.reset();
-  _last_ext_root_scan_times_ms.reset();
-  _last_satb_filtering_times_ms.reset();
-  _last_update_rs_times_ms.reset();
-  _last_update_rs_processed_buffers.reset();
-  _last_scan_rs_times_ms.reset();
-  _last_strong_code_root_scan_times_ms.reset();
-  _last_obj_copy_times_ms.reset();
-  _last_termination_times_ms.reset();
-  _last_termination_attempts.reset();
-  _last_gc_worker_end_times_ms.reset();
-  _last_gc_worker_times_ms.reset();
-  _last_gc_worker_other_times_ms.reset();
+  for (int i = 0; i < GCParPhasesSentinel; i++) {
+    _gc_par_phases[i]->reset();
+  }
 
-  _last_redirty_logged_cards_time_ms.reset();
-  _last_redirty_logged_cards_processed_cards.reset();
-
+  _gc_par_phases[StringDedupQueueFixup]->set_enabled(G1StringDedup::is_enabled());
+  _gc_par_phases[StringDedupTableFixup]->set_enabled(G1StringDedup::is_enabled());
 }
 
 void G1GCPhaseTimes::note_gc_end() {
-  _last_gc_worker_start_times_ms.verify();
-  _last_ext_root_scan_times_ms.verify();
-  _last_satb_filtering_times_ms.verify();
-  _last_update_rs_times_ms.verify();
-  _last_update_rs_processed_buffers.verify();
-  _last_scan_rs_times_ms.verify();
-  _last_strong_code_root_scan_times_ms.verify();
-  _last_obj_copy_times_ms.verify();
-  _last_termination_times_ms.verify();
-  _last_termination_attempts.verify();
-  _last_gc_worker_end_times_ms.verify();
+  for (uint i = 0; i < _active_gc_threads; i++) {
+    double worker_time = _gc_par_phases[GCWorkerEnd]->get(i) - _gc_par_phases[GCWorkerStart]->get(i);
+    record_time_secs(GCWorkerTotal, i , worker_time);
 
-  for (uint i = 0; i < _active_gc_threads; i++) {
-    double worker_time = _last_gc_worker_end_times_ms.get(i) - _last_gc_worker_start_times_ms.get(i);
-    _last_gc_worker_times_ms.set(i, worker_time);
+    double worker_known_time =
+        _gc_par_phases[ExtRootScan]->get(i) +
+        _gc_par_phases[SATBFiltering]->get(i) +
+        _gc_par_phases[UpdateRS]->get(i) +
+        _gc_par_phases[ScanRS]->get(i) +
+        _gc_par_phases[CodeRoots]->get(i) +
+        _gc_par_phases[ObjCopy]->get(i) +
+        _gc_par_phases[Termination]->get(i);
 
-    double worker_known_time = _last_ext_root_scan_times_ms.get(i) +
-                               _last_satb_filtering_times_ms.get(i) +
-                               _last_update_rs_times_ms.get(i) +
-                               _last_scan_rs_times_ms.get(i) +
-                               _last_strong_code_root_scan_times_ms.get(i) +
-                               _last_obj_copy_times_ms.get(i) +
-                               _last_termination_times_ms.get(i);
-
-    double worker_other_time = worker_time - worker_known_time;
-    _last_gc_worker_other_times_ms.set(i, worker_other_time);
+    record_time_secs(Other, i, worker_time - worker_known_time);
   }
 
-  _last_gc_worker_times_ms.verify();
-  _last_gc_worker_other_times_ms.verify();
-
-  _last_redirty_logged_cards_time_ms.verify();
-  _last_redirty_logged_cards_processed_cards.verify();
-}
-
-void G1GCPhaseTimes::note_string_dedup_fixup_start() {
-  _cur_string_dedup_queue_fixup_worker_times_ms.reset();
-  _cur_string_dedup_table_fixup_worker_times_ms.reset();
-}
-
-void G1GCPhaseTimes::note_string_dedup_fixup_end() {
-  _cur_string_dedup_queue_fixup_worker_times_ms.verify();
-  _cur_string_dedup_table_fixup_worker_times_ms.verify();
+  for (int i = 0; i < GCParPhasesSentinel; i++) {
+    _gc_par_phases[i]->verify();
+  }
 }
 
 void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
@@ -288,35 +362,172 @@
     return misc_time_ms;
 }
 
+// record the time a phase took in seconds
+void G1GCPhaseTimes::record_time_secs(GCParPhases phase, uint worker_i, double secs) {
+  _gc_par_phases[phase]->set(worker_i, secs);
+}
+
+// add a number of seconds to a phase
+void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_i, double secs) {
+  _gc_par_phases[phase]->add(worker_i, secs);
+}
+
+void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_i, size_t count) {
+  _gc_par_phases[phase]->set_thread_work_item(worker_i, count);
+}
+
+// return the average time for a phase in milliseconds
+double G1GCPhaseTimes::average_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->average() * 1000.0;
+}
+
+double G1GCPhaseTimes::get_time_ms(GCParPhases phase, uint worker_i) {
+  return _gc_par_phases[phase]->get(worker_i) * 1000.0;
+}
+
+double G1GCPhaseTimes::sum_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->sum() * 1000.0;
+}
+
+double G1GCPhaseTimes::min_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->minimum() * 1000.0;
+}
+
+double G1GCPhaseTimes::max_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->maximum() * 1000.0;
+}
+
+size_t G1GCPhaseTimes::get_thread_work_item(GCParPhases phase, uint worker_i) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->get(worker_i);
+}
+
+size_t G1GCPhaseTimes::sum_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->sum();
+}
+
+double G1GCPhaseTimes::average_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->average();
+}
+
+size_t G1GCPhaseTimes::min_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->minimum();
+}
+
+size_t G1GCPhaseTimes::max_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->maximum();
+}
+
+class G1GCParPhasePrinter : public StackObj {
+  G1GCPhaseTimes* _phase_times;
+ public:
+  G1GCParPhasePrinter(G1GCPhaseTimes* phase_times) : _phase_times(phase_times) {}
+
+  void print(G1GCPhaseTimes::GCParPhases phase_id) {
+    WorkerDataArray<double>* phase = _phase_times->_gc_par_phases[phase_id];
+
+    if (phase->_log_level > G1Log::level() || !phase->_enabled) {
+      return;
+    }
+
+    if (phase->_length == 1) {
+      print_single_length(phase_id, phase);
+    } else {
+      print_multi_length(phase_id, phase);
+    }
+  }
+
+ private:
+
+  void print_single_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
+    // No need for min, max, average and sum for only one worker
+    LineBuffer buf(phase->_indent_level);
+    buf.append_and_print_cr("[%s:  %.1lf]", phase->_title, _phase_times->get_time_ms(phase_id, 0));
+
+    if (phase->_thread_work_items != NULL) {
+      LineBuffer buf2(phase->_thread_work_items->_indent_level);
+      buf2.append_and_print_cr("[%s:  "SIZE_FORMAT"]", phase->_thread_work_items->_title, _phase_times->sum_thread_work_items(phase_id));
+    }
+  }
+
+  void print_time_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
+    for (uint i = 0; i < phase->_length; ++i) {
+      buf.append("  %.1lf", _phase_times->get_time_ms(phase_id, i));
+    }
+    buf.print_cr();
+  }
+
+  void print_count_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
+    for (uint i = 0; i < thread_work_items->_length; ++i) {
+      buf.append("  " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i));
+    }
+    buf.print_cr();
+  }
+
+  void print_thread_work_items(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
+    LineBuffer buf(thread_work_items->_indent_level);
+    buf.append("[%s:", thread_work_items->_title);
+
+    if (G1Log::finest()) {
+      print_count_values(buf, phase_id, thread_work_items);
+    }
+
+    assert(thread_work_items->_print_sum, err_msg("%s does not have print sum true even though it is a count", thread_work_items->_title));
+
+    buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]",
+        _phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id),
+        _phase_times->max_thread_work_items(phase_id) - _phase_times->min_thread_work_items(phase_id), _phase_times->sum_thread_work_items(phase_id));
+  }
+
+  void print_multi_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
+    LineBuffer buf(phase->_indent_level);
+    buf.append("[%s:", phase->_title);
+
+    if (G1Log::finest()) {
+      print_time_values(buf, phase_id, phase);
+    }
+
+    buf.append(" Min: %.1lf, Avg: %.1lf, Max: %.1lf, Diff: %.1lf",
+        _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id),
+        _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id));
+
+    if (phase->_print_sum) {
+      // for things like the start and end times the sum is not
+      // that relevant
+      buf.append(", Sum: %.1lf", _phase_times->sum_time_ms(phase_id));
+    }
+
+    buf.append_and_print_cr("]");
+
+    if (phase->_thread_work_items != NULL) {
+      print_thread_work_items(phase_id, phase->_thread_work_items);
+    }
+  }
+};
+
 void G1GCPhaseTimes::print(double pause_time_sec) {
+  G1GCParPhasePrinter par_phase_printer(this);
+
   if (_root_region_scan_wait_time_ms > 0.0) {
     print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms);
   }
+
   print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads);
-  _last_gc_worker_start_times_ms.print(2, "GC Worker Start (ms)");
-  _last_ext_root_scan_times_ms.print(2, "Ext Root Scanning (ms)");
-  if (_last_satb_filtering_times_ms.sum() > 0.0) {
-    _last_satb_filtering_times_ms.print(2, "SATB Filtering (ms)");
+  for (int i = 0; i <= GCMainParPhasesLast; i++) {
+    par_phase_printer.print((GCParPhases) i);
   }
-  _last_update_rs_times_ms.print(2, "Update RS (ms)");
-    _last_update_rs_processed_buffers.print(3, "Processed Buffers");
-  _last_scan_rs_times_ms.print(2, "Scan RS (ms)");
-  _last_strong_code_root_scan_times_ms.print(2, "Code Root Scanning (ms)");
-  _last_obj_copy_times_ms.print(2, "Object Copy (ms)");
-  _last_termination_times_ms.print(2, "Termination (ms)");
-  if (G1Log::finest()) {
-    _last_termination_attempts.print(3, "Termination Attempts");
-  }
-  _last_gc_worker_other_times_ms.print(2, "GC Worker Other (ms)");
-  _last_gc_worker_times_ms.print(2, "GC Worker Total (ms)");
-  _last_gc_worker_end_times_ms.print(2, "GC Worker End (ms)");
 
   print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms);
   print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms);
   if (G1StringDedup::is_enabled()) {
     print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads);
-    _cur_string_dedup_queue_fixup_worker_times_ms.print(2, "Queue Fixup (ms)");
-    _cur_string_dedup_table_fixup_worker_times_ms.print(2, "Table Fixup (ms)");
+    for (int i = StringDedupPhasesFirst; i <= StringDedupPhasesLast; i++) {
+      par_phase_printer.print((GCParPhases) i);
+    }
   }
   print_stats(1, "Clear CT", _cur_clear_ct_time_ms);
   double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
@@ -340,10 +551,7 @@
   print_stats(2, "Ref Proc", _cur_ref_proc_time_ms);
   print_stats(2, "Ref Enq", _cur_ref_enq_time_ms);
   print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms);
-  if (G1Log::finest()) {
-    _last_redirty_logged_cards_time_ms.print(3, "Parallel Redirty");
-    _last_redirty_logged_cards_processed_cards.print(3, "Redirtied Cards");
-  }
+  par_phase_printer.print(RedirtyCards);
   if (G1EagerReclaimHumongousObjects) {
     print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms);
     if (G1Log::finest()) {
@@ -366,3 +574,17 @@
     print_stats(2, "Verify After", _cur_verify_after_time_ms);
   }
 }
+
+G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
+    _phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
+  if (_phase_times != NULL) {
+    _start_time = os::elapsedTime();
+  }
+}
+
+G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
+  if (_phase_times != NULL) {
+    _phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time);
+  }
+}
+
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -26,106 +26,60 @@
 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
 
 #include "memory/allocation.hpp"
-#include "gc_interface/gcCause.hpp"
-
-template <class T>
-class WorkerDataArray  : public CHeapObj<mtGC> {
-  T*          _data;
-  uint        _length;
-  const char* _print_format;
-  bool        _print_sum;
-
-  NOT_PRODUCT(static const T _uninitialized;)
-
-  // We are caching the sum and average to only have to calculate them once.
-  // This is not done in an MT-safe way. It is intended to allow single
-  // threaded code to call sum() and average() multiple times in any order
-  // without having to worry about the cost.
-  bool   _has_new_data;
-  T      _sum;
-  double _average;
-
- public:
-  WorkerDataArray(uint length, const char* print_format, bool print_sum = true) :
-  _length(length), _print_format(print_format), _print_sum(print_sum), _has_new_data(true) {
-    assert(length > 0, "Must have some workers to store data for");
-    _data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
-  }
-
-  ~WorkerDataArray() {
-    FREE_C_HEAP_ARRAY(T, _data);
-  }
-
-  void set(uint worker_i, T value) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] == (T)-1, err_msg("Overwriting data for worker %d", worker_i));
-    _data[worker_i] = value;
-    _has_new_data = true;
-  }
 
-  T get(uint worker_i) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
-    return _data[worker_i];
-  }
-
-  void add(uint worker_i, T value) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
-    _data[worker_i] += value;
-    _has_new_data = true;
-  }
-
-  double average(){
-    if (_has_new_data) {
-      calculate_totals();
-    }
-    return _average;
-  }
+class LineBuffer;
 
-  T sum() {
-    if (_has_new_data) {
-      calculate_totals();
-    }
-    return _sum;
-  }
-
-  void print(int level, const char* title);
-
-  void reset() PRODUCT_RETURN;
-  void verify() PRODUCT_RETURN;
-
- private:
-
-  void calculate_totals(){
-    _sum = (T)0;
-    for (uint i = 0; i < _length; ++i) {
-      _sum += _data[i];
-    }
-    _average = (double)_sum / (double)_length;
-    _has_new_data = false;
-  }
-};
+template <class T> class WorkerDataArray;
 
 class G1GCPhaseTimes : public CHeapObj<mtGC> {
+  friend class G1GCParPhasePrinter;
 
- private:
   uint _active_gc_threads;
   uint _max_gc_threads;
 
-  WorkerDataArray<double> _last_gc_worker_start_times_ms;
-  WorkerDataArray<double> _last_ext_root_scan_times_ms;
-  WorkerDataArray<double> _last_satb_filtering_times_ms;
-  WorkerDataArray<double> _last_update_rs_times_ms;
-  WorkerDataArray<int>    _last_update_rs_processed_buffers;
-  WorkerDataArray<double> _last_scan_rs_times_ms;
-  WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
-  WorkerDataArray<double> _last_obj_copy_times_ms;
-  WorkerDataArray<double> _last_termination_times_ms;
-  WorkerDataArray<size_t> _last_termination_attempts;
-  WorkerDataArray<double> _last_gc_worker_end_times_ms;
-  WorkerDataArray<double> _last_gc_worker_times_ms;
-  WorkerDataArray<double> _last_gc_worker_other_times_ms;
+ public:
+  enum GCParPhases {
+    GCWorkerStart,
+    ExtRootScan,
+    ThreadRoots,
+    StringTableRoots,
+    UniverseRoots,
+    JNIRoots,
+    ObjectSynchronizerRoots,
+    FlatProfilerRoots,
+    ManagementRoots,
+    SystemDictionaryRoots,
+    CLDGRoots,
+    JVMTIRoots,
+    CodeCacheRoots,
+    CMRefRoots,
+    WaitForStrongCLD,
+    WeakCLDRoots,
+    SATBFiltering,
+    UpdateRS,
+    ScanRS,
+    CodeRoots,
+    ObjCopy,
+    Termination,
+    Other,
+    GCWorkerTotal,
+    GCWorkerEnd,
+    StringDedupQueueFixup,
+    StringDedupTableFixup,
+    RedirtyCards,
+    GCParPhasesSentinel
+  };
+
+ private:
+  // Markers for grouping the phases in the GCPhases enum above
+  static const int GCMainParPhasesLast = GCWorkerEnd;
+  static const int StringDedupPhasesFirst = StringDedupQueueFixup;
+  static const int StringDedupPhasesLast = StringDedupTableFixup;
+
+  WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
+  WorkerDataArray<size_t>* _update_rs_processed_buffers;
+  WorkerDataArray<size_t>* _termination_attempts;
+  WorkerDataArray<size_t>* _redirtied_cards;
 
   double _cur_collection_par_time_ms;
   double _cur_collection_code_root_fixup_time_ms;
@@ -135,9 +89,7 @@
   double _cur_evac_fail_restore_remsets;
   double _cur_evac_fail_remove_self_forwards;
 
-  double                  _cur_string_dedup_fixup_time_ms;
-  WorkerDataArray<double> _cur_string_dedup_queue_fixup_worker_times_ms;
-  WorkerDataArray<double> _cur_string_dedup_table_fixup_worker_times_ms;
+  double _cur_string_dedup_fixup_time_ms;
 
   double _cur_clear_ct_time_ms;
   double _cur_ref_proc_time_ms;
@@ -149,8 +101,6 @@
   double _recorded_young_cset_choice_time_ms;
   double _recorded_non_young_cset_choice_time_ms;
 
-  WorkerDataArray<double> _last_redirty_logged_cards_time_ms;
-  WorkerDataArray<size_t> _last_redirty_logged_cards_processed_cards;
   double _recorded_redirty_logged_cards_time_ms;
 
   double _recorded_young_free_cset_time_ms;
@@ -172,54 +122,34 @@
 
  public:
   G1GCPhaseTimes(uint max_gc_threads);
-  void note_gc_start(uint active_gc_threads);
+  void note_gc_start(uint active_gc_threads, bool mark_in_progress);
   void note_gc_end();
   void print(double pause_time_sec);
 
-  void record_gc_worker_start_time(uint worker_i, double ms) {
-    _last_gc_worker_start_times_ms.set(worker_i, ms);
-  }
-
-  void record_ext_root_scan_time(uint worker_i, double ms) {
-    _last_ext_root_scan_times_ms.set(worker_i, ms);
-  }
+  // record the time a phase took in seconds
+  void record_time_secs(GCParPhases phase, uint worker_i, double secs);
 
-  void record_satb_filtering_time(uint worker_i, double ms) {
-    _last_satb_filtering_times_ms.set(worker_i, ms);
-  }
+  // add a number of seconds to a phase
+  void add_time_secs(GCParPhases phase, uint worker_i, double secs);
 
-  void record_update_rs_time(uint worker_i, double ms) {
-    _last_update_rs_times_ms.set(worker_i, ms);
-  }
+  void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count);
 
-  void record_update_rs_processed_buffers(uint worker_i, int processed_buffers) {
-    _last_update_rs_processed_buffers.set(worker_i, processed_buffers);
-  }
+  // return the average time for a phase in milliseconds
+  double average_time_ms(GCParPhases phase);
 
-  void record_scan_rs_time(uint worker_i, double ms) {
-    _last_scan_rs_times_ms.set(worker_i, ms);
-  }
-
-  void record_strong_code_root_scan_time(uint worker_i, double ms) {
-    _last_strong_code_root_scan_times_ms.set(worker_i, ms);
-  }
-
-  void record_obj_copy_time(uint worker_i, double ms) {
-    _last_obj_copy_times_ms.set(worker_i, ms);
-  }
+  size_t sum_thread_work_items(GCParPhases phase);
 
-  void add_obj_copy_time(uint worker_i, double ms) {
-    _last_obj_copy_times_ms.add(worker_i, ms);
-  }
+ private:
+  double get_time_ms(GCParPhases phase, uint worker_i);
+  double sum_time_ms(GCParPhases phase);
+  double min_time_ms(GCParPhases phase);
+  double max_time_ms(GCParPhases phase);
+  size_t get_thread_work_item(GCParPhases phase, uint worker_i);
+  double average_thread_work_items(GCParPhases phase);
+  size_t min_thread_work_items(GCParPhases phase);
+  size_t max_thread_work_items(GCParPhases phase);
 
-  void record_termination(uint worker_i, double ms, size_t attempts) {
-    _last_termination_times_ms.set(worker_i, ms);
-    _last_termination_attempts.set(worker_i, attempts);
-  }
-
-  void record_gc_worker_end_time(uint worker_i, double ms) {
-    _last_gc_worker_end_times_ms.set(worker_i, ms);
-  }
+ public:
 
   void record_clear_ct_time(double ms) {
     _cur_clear_ct_time_ms = ms;
@@ -249,21 +179,10 @@
     _cur_evac_fail_remove_self_forwards = ms;
   }
 
-  void note_string_dedup_fixup_start();
-  void note_string_dedup_fixup_end();
-
   void record_string_dedup_fixup_time(double ms) {
     _cur_string_dedup_fixup_time_ms = ms;
   }
 
-  void record_string_dedup_queue_fixup_worker_time(uint worker_id, double ms) {
-    _cur_string_dedup_queue_fixup_worker_times_ms.set(worker_id, ms);
-  }
-
-  void record_string_dedup_table_fixup_worker_time(uint worker_id, double ms) {
-    _cur_string_dedup_table_fixup_worker_times_ms.set(worker_id, ms);
-  }
-
   void record_ref_proc_time(double ms) {
     _cur_ref_proc_time_ms = ms;
   }
@@ -303,14 +222,6 @@
     _recorded_non_young_cset_choice_time_ms = time_ms;
   }
 
-  void record_redirty_logged_cards_time_ms(uint worker_i, double time_ms) {
-    _last_redirty_logged_cards_time_ms.set(worker_i, time_ms);
-  }
-
-  void record_redirty_logged_cards_processed_cards(uint worker_i, size_t processed_buffers) {
-    _last_redirty_logged_cards_processed_cards.set(worker_i, processed_buffers);
-  }
-
   void record_redirty_logged_cards_time_ms(double time_ms) {
     _recorded_redirty_logged_cards_time_ms = time_ms;
   }
@@ -364,38 +275,16 @@
   double fast_reclaim_humongous_time_ms() {
     return _cur_fast_reclaim_humongous_time_ms;
   }
-
-  double average_last_update_rs_time() {
-    return _last_update_rs_times_ms.average();
-  }
-
-  int sum_last_update_rs_processed_buffers() {
-    return _last_update_rs_processed_buffers.sum();
-  }
-
-  double average_last_scan_rs_time(){
-    return _last_scan_rs_times_ms.average();
-  }
+};
 
-  double average_last_strong_code_root_scan_time(){
-    return _last_strong_code_root_scan_times_ms.average();
-  }
-
-  double average_last_obj_copy_time() {
-    return _last_obj_copy_times_ms.average();
-  }
-
-  double average_last_termination_time() {
-    return _last_termination_times_ms.average();
-  }
-
-  double average_last_ext_root_scan_time() {
-    return _last_ext_root_scan_times_ms.average();
-  }
-
-  double average_last_satb_filtering_times_ms() {
-    return _last_satb_filtering_times_ms.average();
-  }
+class G1GCParPhaseTimesTracker : public StackObj {
+  double _start_time;
+  G1GCPhaseTimes::GCParPhases _phase;
+  G1GCPhaseTimes* _phase_times;
+  uint _worker_id;
+public:
+  G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
+  ~G1GCParPhaseTimesTracker();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -28,6 +28,7 @@
 #include "memory/allocation.hpp"
 
 class G1Log : public AllStatic {
+ public:
   typedef enum {
     LevelNone,
     LevelFine,
@@ -35,6 +36,7 @@
     LevelFinest
   } LogLevel;
 
+ private:
   static LogLevel _level;
 
  public:
@@ -50,6 +52,10 @@
     return _level == LevelFinest;
   }
 
+  static LogLevel level() {
+    return _level;
+  }
+
   static void init();
 };
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -31,6 +31,7 @@
 #include "code/icBuffer.hpp"
 #include "gc_implementation/g1/g1Log.hpp"
 #include "gc_implementation/g1/g1MarkSweep.hpp"
+#include "gc_implementation/g1/g1RootProcessor.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/shared/gcHeapSummary.hpp"
 #include "gc_implementation/shared/gcTimer.hpp"
@@ -125,21 +126,22 @@
   GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   GenMarkSweep::trace(" 1");
 
-  SharedHeap* sh = SharedHeap::heap();
+  G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
   // Need cleared claim bits for the roots processing
   ClassLoaderDataGraph::clear_claimed_marks();
 
   MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
-  sh->process_strong_roots(true,   // activate StrongRootsScope
-                           SharedHeap::SO_None,
-                           &GenMarkSweep::follow_root_closure,
-                           &GenMarkSweep::follow_cld_closure,
-                           &follow_code_closure);
+  {
+    G1RootProcessor root_processor(g1h);
+    root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
+                                        &GenMarkSweep::follow_cld_closure,
+                                        &follow_code_closure);
+  }
 
   // Process reference objects found during marking
   ReferenceProcessor* rp = GenMarkSweep::ref_processor();
-  assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
+  assert(rp == g1h->ref_processor_stw(), "Sanity");
 
   rp->setup_policy(clear_all_softrefs);
   const ReferenceProcessorStats& stats =
@@ -225,6 +227,12 @@
   }
 };
 
+class G1AlwaysTrueClosure: public BoolObjectClosure {
+public:
+  bool do_object_b(oop p) { return true; }
+};
+static G1AlwaysTrueClosure always_true;
+
 void G1MarkSweep::mark_sweep_phase3() {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
@@ -232,24 +240,23 @@
   GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   GenMarkSweep::trace("3");
 
-  SharedHeap* sh = SharedHeap::heap();
-
   // Need cleared claim bits for the roots processing
   ClassLoaderDataGraph::clear_claimed_marks();
 
   CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
-  sh->process_all_roots(true,  // activate StrongRootsScope
-                        SharedHeap::SO_AllCodeCache,
-                        &GenMarkSweep::adjust_pointer_closure,
-                        &GenMarkSweep::adjust_cld_closure,
-                        &adjust_code_closure);
+  {
+    G1RootProcessor root_processor(g1h);
+    root_processor.process_all_roots(&GenMarkSweep::adjust_pointer_closure,
+                                     &GenMarkSweep::adjust_cld_closure,
+                                     &adjust_code_closure);
+  }
 
   assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
   g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
 
   // Now adjust pointers in remaining weak roots.  (All of which should
   // have been cleared if they pointed to non-surviving objects.)
-  sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
+  JNIHandles::weak_oops_do(&always_true, &GenMarkSweep::adjust_pointer_closure);
 
   if (G1StringDedup::is_enabled()) {
     G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -109,6 +109,18 @@
   template <class T> void do_klass_barrier(T* p, oop new_obj);
 };
 
+enum G1Barrier {
+  G1BarrierNone,
+  G1BarrierEvac,
+  G1BarrierKlass
+};
+
+enum G1Mark {
+  G1MarkNone,
+  G1MarkFromRoot,
+  G1MarkPromotedFromRoot
+};
+
 template <G1Barrier barrier, G1Mark do_mark_object>
 class G1ParCopyClosure : public G1ParCopyHelper {
 private:
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -226,6 +226,8 @@
   }
 
   assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
+  assert(_g1h->is_in_reserved(obj_ptr), "Allocated memory should be in the heap");
+
 #ifndef PRODUCT
   // Should this evacuation fail?
   if (_g1h->evacuation_should_fail()) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -57,6 +57,9 @@
  public:
   MemRegion reserved() { return _storage.reserved(); }
 
+  size_t reserved_size() { return _storage.reserved_size(); }
+  size_t committed_size() { return _storage.committed_size(); }
+
   void set_mapping_changed_listener(G1MappingChangedListener* listener) { _listener = listener; }
 
   virtual ~G1RegionToSpaceMapper() {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -79,7 +79,6 @@
     _cards_scanned(NULL), _total_cards_scanned(0),
     _prev_period_summary()
 {
-  _seq_task = new SubTasksDone(NumSeqTasks);
   _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
   for (uint i = 0; i < n_workers(); i++) {
     _cset_rs_update_cl[i] = NULL;
@@ -90,7 +89,6 @@
 }
 
 G1RemSet::~G1RemSet() {
-  delete _seq_task;
   for (uint i = 0; i < n_workers(); i++) {
     assert(_cset_rs_update_cl[i] == NULL, "it should be");
   }
@@ -109,7 +107,7 @@
 
   double _strong_code_root_scan_time_sec;
   uint   _worker_i;
-  int    _block_size;
+  size_t _block_size;
   bool   _try_claimed;
 
 public:
@@ -127,7 +125,7 @@
     _g1h = G1CollectedHeap::heap();
     _bot_shared = _g1h->bot_shared();
     _ct_bs = _g1h->g1_barrier_set();
-    _block_size = MAX2<int>(G1RSetScanBlockSize, 1);
+    _block_size = MAX2<size_t>(G1RSetScanBlockSize, 1);
   }
 
   void set_try_claimed() { _try_claimed = true; }
@@ -248,9 +246,8 @@
   assert(_cards_scanned != NULL, "invariant");
   _cards_scanned[worker_i] = scanRScl.cards_done();
 
-  _g1p->phase_times()->record_scan_rs_time(worker_i, scan_rs_time_sec * 1000.0);
-  _g1p->phase_times()->record_strong_code_root_scan_time(worker_i,
-                                                         scanRScl.strong_code_root_scan_time_sec() * 1000.0);
+  _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec);
+  _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec());
 }
 
 // Closure used for updating RSets and recording references that
@@ -287,13 +284,11 @@
 };
 
 void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, uint worker_i) {
-  double start = os::elapsedTime();
+  G1GCParPhaseTimesTracker x(_g1p->phase_times(), G1GCPhaseTimes::UpdateRS, worker_i);
   // Apply the given closure to all remaining log entries.
   RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq);
 
   _g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i);
-
-  _g1p->phase_times()->record_update_rs_time(worker_i, (os::elapsedTime() - start) * 1000.0);
 }
 
 void G1RemSet::cleanupHRRS() {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -58,7 +58,6 @@
   };
 
   CardTableModRefBS*     _ct_bs;
-  SubTasksDone*          _seq_task;
   G1CollectorPolicy*     _g1p;
 
   ConcurrentG1Refine*    _cg1r;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,337 @@
+/*
+ * 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 "classfile/stringTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/g1/bufferingOopClosure.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/g1RootProcessor.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/mutex.hpp"
+#include "services/management.hpp"
+
+class G1CodeBlobClosure : public CodeBlobClosure {
+  class HeapRegionGatheringOopClosure : public OopClosure {
+    G1CollectedHeap* _g1h;
+    OopClosure* _work;
+    nmethod* _nm;
+
+    template <typename T>
+    void do_oop_work(T* p) {
+      _work->do_oop(p);
+      T oop_or_narrowoop = oopDesc::load_heap_oop(p);
+      if (!oopDesc::is_null(oop_or_narrowoop)) {
+        oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
+        HeapRegion* hr = _g1h->heap_region_containing_raw(o);
+        assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
+        hr->add_strong_code_root(_nm);
+      }
+    }
+
+  public:
+    HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
+
+    void do_oop(oop* o) {
+      do_oop_work(o);
+    }
+
+    void do_oop(narrowOop* o) {
+      do_oop_work(o);
+    }
+
+    void set_nm(nmethod* nm) {
+      _nm = nm;
+    }
+  };
+
+  HeapRegionGatheringOopClosure _oc;
+public:
+  G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
+
+  void do_code_blob(CodeBlob* cb) {
+    nmethod* nm = cb->as_nmethod_or_null();
+    if (nm != NULL) {
+      if (!nm->test_set_oops_do_mark()) {
+        _oc.set_nm(nm);
+        nm->oops_do(&_oc);
+        nm->fix_oop_relocations();
+      }
+    }
+  }
+};
+
+
+void G1RootProcessor::worker_has_discovered_all_strong_classes() {
+  uint n_workers = _g1h->n_par_threads();
+  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+
+  uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
+  if (new_value == n_workers) {
+    // This thread is last. Notify the others.
+    MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
+    _lock.notify_all();
+  }
+}
+
+void G1RootProcessor::wait_until_all_strong_classes_discovered() {
+  uint n_workers = _g1h->n_par_threads();
+  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+
+  if ((uint)_n_workers_discovered_strong_classes != n_workers) {
+    MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
+    while ((uint)_n_workers_discovered_strong_classes != n_workers) {
+      _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
+    }
+  }
+}
+
+G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
+    _g1h(g1h),
+    _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
+    _srs(g1h),
+    _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
+    _n_workers_discovered_strong_classes(0) {}
+
+void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
+                                     OopClosure* scan_non_heap_weak_roots,
+                                     CLDClosure* scan_strong_clds,
+                                     CLDClosure* scan_weak_clds,
+                                     bool trace_metadata,
+                                     uint worker_i) {
+  // First scan the shared roots.
+  double ext_roots_start = os::elapsedTime();
+  G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+
+  BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
+  BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
+
+  OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
+  OopClosure* const strong_roots = &buf_scan_non_heap_roots;
+
+  // CodeBlobClosures are not interoperable with BufferingOopClosures
+  G1CodeBlobClosure root_code_blobs(scan_non_heap_roots);
+
+  process_java_roots(strong_roots,
+                     trace_metadata ? scan_strong_clds : NULL,
+                     scan_strong_clds,
+                     trace_metadata ? NULL : scan_weak_clds,
+                     &root_code_blobs,
+                     phase_times,
+                     worker_i);
+
+  // This is the point where this worker thread will not find more strong CLDs/nmethods.
+  // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
+  if (trace_metadata) {
+    worker_has_discovered_all_strong_classes();
+  }
+
+  process_vm_roots(strong_roots, weak_roots, phase_times, worker_i);
+
+  {
+    // Now the CM ref_processor roots.
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_refProcessor_oops_do)) {
+      // We need to treat the discovered reference lists of the
+      // concurrent mark ref processor as roots and keep entries
+      // (which are added by the marking threads) on them live
+      // until they can be processed at the end of marking.
+      _g1h->ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
+    }
+  }
+
+  if (trace_metadata) {
+    {
+      G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WaitForStrongCLD, worker_i);
+      // Barrier to make sure all workers passed
+      // the strong CLD and strong nmethods phases.
+      wait_until_all_strong_classes_discovered();
+    }
+
+    // Now take the complement of the strong CLDs.
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
+    ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
+  } else {
+    phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
+    phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
+  }
+
+  // Finish up any enqueued closure apps (attributed as object copy time).
+  buf_scan_non_heap_roots.done();
+  buf_scan_non_heap_weak_roots.done();
+
+  double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
+      + buf_scan_non_heap_weak_roots.closure_app_seconds();
+
+  phase_times->record_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, obj_copy_time_sec);
+
+  double ext_root_time_sec = os::elapsedTime() - ext_roots_start - obj_copy_time_sec;
+
+  phase_times->record_time_secs(G1GCPhaseTimes::ExtRootScan, worker_i, ext_root_time_sec);
+
+  // During conc marking we have to filter the per-thread SATB buffers
+  // to make sure we remove any oops into the CSet (which will show up
+  // as implicitly live).
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SATBFiltering, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_filter_satb_buffers) && _g1h->mark_in_progress()) {
+      JavaThread::satb_mark_queue_set().filter_thread_buffers();
+    }
+  }
+
+  _process_strong_tasks->all_tasks_completed();
+}
+
+void G1RootProcessor::process_strong_roots(OopClosure* oops,
+                                           CLDClosure* clds,
+                                           CodeBlobClosure* blobs) {
+
+  process_java_roots(oops, clds, clds, NULL, blobs, NULL, 0);
+  process_vm_roots(oops, NULL, NULL, 0);
+
+  _process_strong_tasks->all_tasks_completed();
+}
+
+void G1RootProcessor::process_all_roots(OopClosure* oops,
+                                        CLDClosure* clds,
+                                        CodeBlobClosure* blobs) {
+
+  process_java_roots(oops, NULL, clds, clds, NULL, NULL, 0);
+  process_vm_roots(oops, oops, NULL, 0);
+
+  if (!_process_strong_tasks->is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
+    CodeCache::blobs_do(blobs);
+  }
+
+  _process_strong_tasks->all_tasks_completed();
+}
+
+void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
+                                         CLDClosure* thread_stack_clds,
+                                         CLDClosure* strong_clds,
+                                         CLDClosure* weak_clds,
+                                         CodeBlobClosure* strong_code,
+                                         G1GCPhaseTimes* phase_times,
+                                         uint worker_i) {
+  assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
+  // Iterating over the CLDG and the Threads are done early to allow us to
+  // first process the strong CLDs and nmethods and then, after a barrier,
+  // let the thread process the weak CLDs and nmethods.
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
+      ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
+    Threads::possibly_parallel_oops_do(strong_roots, thread_stack_clds, strong_code);
+  }
+}
+
+void G1RootProcessor::process_vm_roots(OopClosure* strong_roots,
+                                       OopClosure* weak_roots,
+                                       G1GCPhaseTimes* phase_times,
+                                       uint worker_i) {
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Universe_oops_do)) {
+      Universe::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_JNIHandles_oops_do)) {
+      JNIHandles::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ObjectSynchronizerRoots, worker_i);
+    if (!_process_strong_tasks-> is_task_claimed(G1RP_PS_ObjectSynchronizer_oops_do)) {
+      ObjectSynchronizer::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::FlatProfilerRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_FlatProfiler_oops_do)) {
+      FlatProfiler::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Management_oops_do)) {
+      Management::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMTIRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_jvmti_oops_do)) {
+      JvmtiExport::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_SystemDictionary_oops_do)) {
+      SystemDictionary::roots_oops_do(strong_roots, weak_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
+    // All threads execute the following. A specific chunk of buckets
+    // from the StringTable are the individual tasks.
+    if (weak_roots != NULL) {
+      StringTable::possibly_parallel_oops_do(weak_roots);
+    }
+  }
+}
+
+void G1RootProcessor::scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
+                                           OopClosure* scan_non_heap_weak_roots,
+                                           uint worker_i) {
+  G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+  G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CodeCacheRoots, worker_i);
+
+  // Now scan the complement of the collection set.
+  G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
+
+  _g1h->g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
+}
+
+void G1RootProcessor::set_num_workers(int active_workers) {
+  _process_strong_tasks->set_n_threads(active_workers);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,121 @@
+/*
+ * 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_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/sharedHeap.hpp"
+#include "runtime/mutex.hpp"
+
+class CLDClosure;
+class CodeBlobClosure;
+class G1CollectedHeap;
+class G1GCPhaseTimes;
+class G1ParPushHeapRSClosure;
+class Monitor;
+class OopClosure;
+class SubTasksDone;
+
+// Scoped object to assist in applying oop, CLD and code blob closures to
+// root locations. Handles claiming of different root scanning tasks
+// and takes care of global state for root scanning via a StrongRootsScope.
+// In the parallel case there is a shared G1RootProcessor object where all
+// worker thread call the process_roots methods.
+class G1RootProcessor : public StackObj {
+  G1CollectedHeap* _g1h;
+  SubTasksDone* _process_strong_tasks;
+  SharedHeap::StrongRootsScope _srs;
+
+  // Used to implement the Thread work barrier.
+  Monitor _lock;
+  volatile jint _n_workers_discovered_strong_classes;
+
+  enum G1H_process_roots_tasks {
+    G1RP_PS_Universe_oops_do,
+    G1RP_PS_JNIHandles_oops_do,
+    G1RP_PS_ObjectSynchronizer_oops_do,
+    G1RP_PS_FlatProfiler_oops_do,
+    G1RP_PS_Management_oops_do,
+    G1RP_PS_SystemDictionary_oops_do,
+    G1RP_PS_ClassLoaderDataGraph_oops_do,
+    G1RP_PS_jvmti_oops_do,
+    G1RP_PS_CodeCache_oops_do,
+    G1RP_PS_filter_satb_buffers,
+    G1RP_PS_refProcessor_oops_do,
+    // Leave this one last.
+    G1RP_PS_NumElements
+  };
+
+  void worker_has_discovered_all_strong_classes();
+  void wait_until_all_strong_classes_discovered();
+
+  void process_java_roots(OopClosure* scan_non_heap_roots,
+                          CLDClosure* thread_stack_clds,
+                          CLDClosure* scan_strong_clds,
+                          CLDClosure* scan_weak_clds,
+                          CodeBlobClosure* scan_strong_code,
+                          G1GCPhaseTimes* phase_times,
+                          uint worker_i);
+
+  void process_vm_roots(OopClosure* scan_non_heap_roots,
+                        OopClosure* scan_non_heap_weak_roots,
+                        G1GCPhaseTimes* phase_times,
+                        uint worker_i);
+
+public:
+  G1RootProcessor(G1CollectedHeap* g1h);
+
+  // Apply closures to the strongly and weakly reachable roots in the system
+  // in a single pass.
+  // Record and report timing measurements for sub phases using the worker_i
+  void evacuate_roots(OopClosure* scan_non_heap_roots,
+                      OopClosure* scan_non_heap_weak_roots,
+                      CLDClosure* scan_strong_clds,
+                      CLDClosure* scan_weak_clds,
+                      bool trace_metadata,
+                      uint worker_i);
+
+  // Apply oops, clds and blobs to all strongly reachable roots in the system
+  void process_strong_roots(OopClosure* oops,
+                            CLDClosure* clds,
+                            CodeBlobClosure* blobs);
+
+  // Apply oops, clds and blobs to strongly and weakly reachable roots in the system
+  void process_all_roots(OopClosure* oops,
+                         CLDClosure* clds,
+                         CodeBlobClosure* blobs);
+
+  // Apply scan_rs to all locations in the union of the remembered sets for all
+  // regions in the collection set
+  // (having done "set_region" to indicate the region in which the root resides),
+  void scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
+                            OopClosure* scan_non_heap_weak_roots,
+                            uint worker_i);
+
+  // Inform the root processor about the number of worker threads
+  void set_num_workers(int active_workers);
+};
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -106,7 +106,7 @@
 
 void G1StringDedup::oops_do(OopClosure* keep_alive) {
   assert(is_enabled(), "String deduplication not enabled");
-  unlink_or_oops_do(NULL, keep_alive);
+  unlink_or_oops_do(NULL, keep_alive, true /* allow_resize_and_rehash */);
 }
 
 void G1StringDedup::unlink(BoolObjectClosure* is_alive) {
@@ -123,45 +123,39 @@
 class G1StringDedupUnlinkOrOopsDoTask : public AbstractGangTask {
 private:
   G1StringDedupUnlinkOrOopsDoClosure _cl;
+  G1GCPhaseTimes* _phase_times;
 
 public:
   G1StringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive,
                                   OopClosure* keep_alive,
-                                  bool allow_resize_and_rehash) :
+                                  bool allow_resize_and_rehash,
+                                  G1GCPhaseTimes* phase_times) :
     AbstractGangTask("G1StringDedupUnlinkOrOopsDoTask"),
-    _cl(is_alive, keep_alive, allow_resize_and_rehash) {
-  }
+    _cl(is_alive, keep_alive, allow_resize_and_rehash), _phase_times(phase_times) { }
 
   virtual void work(uint worker_id) {
-    double queue_fixup_start = os::elapsedTime();
-    G1StringDedupQueue::unlink_or_oops_do(&_cl);
-
-    double table_fixup_start = os::elapsedTime();
-    G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
-
-    double queue_fixup_time_ms = (table_fixup_start - queue_fixup_start) * 1000.0;
-    double table_fixup_time_ms = (os::elapsedTime() - table_fixup_start) * 1000.0;
-    G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
-    g1p->phase_times()->record_string_dedup_queue_fixup_worker_time(worker_id, queue_fixup_time_ms);
-    g1p->phase_times()->record_string_dedup_table_fixup_worker_time(worker_id, table_fixup_time_ms);
+    {
+      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupQueueFixup, worker_id);
+      G1StringDedupQueue::unlink_or_oops_do(&_cl);
+    }
+    {
+      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupTableFixup, worker_id);
+      G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
+    }
   }
 };
 
-void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
+void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive,
+                                      OopClosure* keep_alive,
+                                      bool allow_resize_and_rehash,
+                                      G1GCPhaseTimes* phase_times) {
   assert(is_enabled(), "String deduplication not enabled");
-  G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
-  g1p->phase_times()->note_string_dedup_fixup_start();
-  double fixup_start = os::elapsedTime();
 
-  G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
+  G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash, phase_times);
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   g1h->set_par_threads();
   g1h->workers()->run_task(&task);
   g1h->set_par_threads(0);
-
-  double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
-  g1p->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
-  g1p->phase_times()->note_string_dedup_fixup_end();
 }
 
 void G1StringDedup::threads_do(ThreadClosure* tc) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -91,6 +91,7 @@
 class ThreadClosure;
 class outputStream;
 class G1StringDedupTable;
+class G1GCPhaseTimes;
 
 //
 // Main interface for interacting with string deduplication.
@@ -131,7 +132,7 @@
   static void oops_do(OopClosure* keep_alive);
   static void unlink(BoolObjectClosure* is_alive);
   static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive,
-                                bool allow_resize_and_rehash = true);
+                                bool allow_resize_and_rehash, G1GCPhaseTimes* phase_times = NULL);
 
   static void threads_do(ThreadClosure* tc);
   static void print_worker_threads_on(outputStream* st);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -86,7 +86,7 @@
           "If true, enable reference discovery during concurrent "          \
           "marking and reference processing at the end of remark.")         \
                                                                             \
-  product(intx, G1SATBBufferSize, 1*K,                                      \
+  product(size_t, G1SATBBufferSize, 1*K,                                    \
           "Number of entries in an SATB log buffer.")                       \
                                                                             \
   develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
@@ -112,7 +112,7 @@
             "Prints the liveness information for all regions in the heap "  \
             "at the end of a marking cycle.")                               \
                                                                             \
-  product(intx, G1UpdateBufferSize, 256,                                    \
+  product(size_t, G1UpdateBufferSize, 256,                                  \
           "Size of an update buffer")                                       \
                                                                             \
   product(intx, G1ConcRefinementYellowZone, 0,                              \
@@ -148,7 +148,7 @@
           "Select green, yellow and red zones adaptively to meet the "      \
           "the pause requirements.")                                        \
                                                                             \
-  product(uintx, G1ConcRSLogCacheSize, 10,                                  \
+  product(size_t, G1ConcRSLogCacheSize, 10,                                 \
           "Log base 2 of the length of conc RS hot-card cache.")            \
                                                                             \
   product(uintx, G1ConcRSHotCardLimit, 4,                                   \
@@ -210,7 +210,7 @@
           "When set, G1 will fail when it encounters an FP 'error', "       \
           "so as to allow debugging")                                       \
                                                                             \
-  product(uintx, G1HeapRegionSize, 0,                                       \
+  product(size_t, G1HeapRegionSize, 0,                                      \
           "Size of the G1 regions.")                                        \
                                                                             \
   product(uintx, G1ConcRefinementThreads, 0,                                \
@@ -220,7 +220,7 @@
   develop(bool, G1VerifyCTCleanup, false,                                   \
           "Verify card table cleanup.")                                     \
                                                                             \
-  product(uintx, G1RSetScanBlockSize, 64,                                   \
+  product(size_t, G1RSetScanBlockSize, 64,                                  \
           "Size of a work unit of cards claimed by a worker thread"         \
           "during RSet scanning.")                                          \
                                                                             \
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, 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
@@ -30,23 +30,8 @@
 // non-virtually, using a mechanism defined in this file.  Extend these
 // macros in the obvious way to add specializations for new closures.
 
-enum G1Barrier {
-  G1BarrierNone,
-  G1BarrierEvac,
-  G1BarrierKlass
-};
-
-enum G1Mark {
-  G1MarkNone,
-  G1MarkFromRoot,
-  G1MarkPromotedFromRoot
-};
-
 // Forward declarations.
 
-template<G1Barrier barrier, G1Mark do_mark_object>
-class G1ParCopyClosure;
-
 class G1ParScanClosure;
 class G1ParPushHeapRSClosure;
 
@@ -61,26 +46,16 @@
 class G1InvokeIfNotTriggeredClosure;
 class G1UpdateRSOrPushRefOopClosure;
 
-#ifdef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
-#error "FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES already defined."
-#endif
-
-#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
-      f(G1ParScanClosure,_nv)                           \
-      f(G1ParPushHeapRSClosure,_nv)                     \
-      f(FilterIntoCSClosure,_nv)                        \
-      f(FilterOutOfRegionClosure,_nv)                   \
-      f(G1CMOopClosure,_nv)                             \
-      f(G1RootRegionScanClosure,_nv)                    \
-      f(G1Mux2Closure,_nv)                              \
-      f(G1TriggerClosure,_nv)                           \
-      f(G1InvokeIfNotTriggeredClosure,_nv)              \
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \
+      f(G1ParScanClosure,_nv)                      \
+      f(G1ParPushHeapRSClosure,_nv)                \
+      f(FilterIntoCSClosure,_nv)                   \
+      f(FilterOutOfRegionClosure,_nv)              \
+      f(G1CMOopClosure,_nv)                        \
+      f(G1RootRegionScanClosure,_nv)               \
+      f(G1Mux2Closure,_nv)                         \
+      f(G1TriggerClosure,_nv)                      \
+      f(G1InvokeIfNotTriggeredClosure,_nv)         \
       f(G1UpdateRSOrPushRefOopClosure,_nv)
 
-#ifdef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
-#error "FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES already defined."
-#endif
-
-#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
-
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -106,18 +106,18 @@
 }
 
 void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size) {
-  uintx region_size = G1HeapRegionSize;
+  size_t region_size = G1HeapRegionSize;
   if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
     size_t average_heap_size = (initial_heap_size + max_heap_size) / 2;
     region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(),
-                       (uintx) HeapRegionBounds::min_size());
+                       HeapRegionBounds::min_size());
   }
 
   int region_size_log = log2_long((jlong) region_size);
   // Recalculate the region size to make sure it's a power of
   // 2. This means that region_size is the largest power of 2 that's
   // <= what we've calculated so far.
-  region_size = ((uintx)1 << region_size_log);
+  region_size = ((size_t)1 << region_size_log);
 
   // Now make sure that we don't go over or under our limits.
   if (region_size < HeapRegionBounds::min_size()) {
@@ -139,7 +139,7 @@
   guarantee(GrainBytes == 0, "we should only set it once");
   // The cast to int is safe, given that we've bounded region_size by
   // MIN_REGION_SIZE and MAX_REGION_SIZE.
-  GrainBytes = (size_t)region_size;
+  GrainBytes = region_size;
 
   guarantee(GrainWords == 0, "we should only set it once");
   GrainWords = GrainBytes >> LogHeapWordSize;
@@ -933,6 +933,16 @@
   _offsets.resize(new_end - bottom());
 }
 
+#ifndef PRODUCT
+void G1OffsetTableContigSpace::mangle_unused_area() {
+  mangle_unused_area_complete();
+}
+
+void G1OffsetTableContigSpace::mangle_unused_area_complete() {
+  SpaceMangler::mangle_region(MemRegion(top(), end()));
+}
+#endif
+
 void G1OffsetTableContigSpace::print() const {
   print_short();
   gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -27,7 +27,6 @@
 
 #include "gc_implementation/g1/g1AllocationContext.hpp"
 #include "gc_implementation/g1/g1BlockOffsetTable.hpp"
-#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
 #include "gc_implementation/g1/heapRegionType.hpp"
 #include "gc_implementation/g1/survRateGroup.hpp"
 #include "gc_implementation/shared/ageTable.hpp"
@@ -155,6 +154,9 @@
   void set_bottom(HeapWord* value);
   void set_end(HeapWord* value);
 
+  void mangle_unused_area() PRODUCT_RETURN;
+  void mangle_unused_area_complete() PRODUCT_RETURN;
+
   HeapWord* scan_top() const;
   void record_timestamp();
   void reset_gc_time_stamp() { _gc_time_stamp = 0; }
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -145,6 +145,24 @@
   }
 }
 
+MemoryUsage HeapRegionManager::get_auxiliary_data_memory_usage() const {
+  size_t used_sz =
+    _prev_bitmap_mapper->committed_size() +
+    _next_bitmap_mapper->committed_size() +
+    _bot_mapper->committed_size() +
+    _cardtable_mapper->committed_size() +
+    _card_counts_mapper->committed_size();
+
+  size_t committed_sz =
+    _prev_bitmap_mapper->reserved_size() +
+    _next_bitmap_mapper->reserved_size() +
+    _bot_mapper->reserved_size() +
+    _cardtable_mapper->reserved_size() +
+    _card_counts_mapper->reserved_size();
+
+  return MemoryUsage(0, used_sz, committed_sz, committed_sz);
+}
+
 uint HeapRegionManager::expand_by(uint num_regions) {
   return expand_at(0, num_regions);
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -28,6 +28,7 @@
 #include "gc_implementation/g1/g1BiasedArray.hpp"
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "gc_implementation/g1/heapRegionSet.hpp"
+#include "services/memoryUsage.hpp"
 
 class HeapRegion;
 class HeapRegionClosure;
@@ -196,6 +197,8 @@
   // Return the maximum number of regions in the heap.
   uint max_length() const { return (uint)_regions.length(); }
 
+  MemoryUsage get_auxiliary_data_memory_usage() const;
+
   MemRegion reserved() const { return MemRegion(heap_bottom(), heap_end()); }
 
   // Expand the sequence to reflect that the heap has grown. Either create new
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
 #include "gc_implementation/parNew/parNewGeneration.hpp"
 #include "gc_implementation/parNew/parOopClosures.inline.hpp"
@@ -325,7 +326,7 @@
 private:
   ParallelTaskTerminator& _term;
   ParNewGeneration&       _gen;
-  Generation&             _next_gen;
+  Generation&             _old_gen;
  public:
   bool is_valid(int id) const { return id < length(); }
   ParallelTaskTerminator* terminator() { return &_term; }
@@ -338,7 +339,7 @@
   Stack<oop, mtGC>* overflow_stacks,
   size_t desired_plab_sz, ParallelTaskTerminator& term)
   : ResourceArray(sizeof(ParScanThreadState), num_threads),
-    _gen(gen), _next_gen(old_gen), _term(term)
+    _gen(gen), _old_gen(old_gen), _term(term)
 {
   assert(num_threads > 0, "sanity check!");
   assert(ParGCUseLocalOverflow == (overflow_stacks != NULL),
@@ -471,8 +472,8 @@
     _gen.age_table()->merge(local_table);
 
     // Inform old gen that we're done.
-    _next_gen.par_promote_alloc_done(i);
-    _next_gen.par_oop_since_save_marks_iterate_done(i);
+    _old_gen.par_promote_alloc_done(i);
+    _old_gen.par_oop_since_save_marks_iterate_done(i);
   }
 
   if (UseConcMarkSweepGC) {
@@ -574,10 +575,10 @@
   par_scan_state()->end_term_time();
 }
 
-ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* next_gen,
-                HeapWord* young_old_boundary, ParScanThreadStateSet* state_set) :
+ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* old_gen,
+                             HeapWord* young_old_boundary, ParScanThreadStateSet* state_set) :
     AbstractGangTask("ParNewGeneration collection"),
-    _gen(gen), _next_gen(next_gen),
+    _gen(gen), _old_gen(old_gen),
     _young_old_boundary(young_old_boundary),
     _state_set(state_set)
   {}
@@ -601,8 +602,6 @@
   // We would need multiple old-gen queues otherwise.
   assert(gch->n_gens() == 2, "Par young collection currently only works with one older gen.");
 
-  Generation* old_gen = gch->next_gen(_gen);
-
   ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id);
   assert(_state_set->is_valid(worker_id), "Should not have been called");
 
@@ -619,7 +618,7 @@
                          true,  // Process younger gens, if any,
                                 // as strong roots.
                          false, // no scope; this is parallel code
-                         SharedHeap::SO_ScavengeCodeCache,
+                         GenCollectedHeap::SO_ScavengeCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &par_scan_state.to_space_root_closure(),
                          &par_scan_state.older_gen_closure(),
@@ -763,8 +762,9 @@
 class ParNewRefProcTaskProxy: public AbstractGangTask {
   typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
 public:
-  ParNewRefProcTaskProxy(ProcessTask& task, ParNewGeneration& gen,
-                         Generation& next_gen,
+  ParNewRefProcTaskProxy(ProcessTask& task,
+                         ParNewGeneration& gen,
+                         Generation& old_gen,
                          HeapWord* young_old_boundary,
                          ParScanThreadStateSet& state_set);
 
@@ -776,20 +776,20 @@
 private:
   ParNewGeneration&      _gen;
   ProcessTask&           _task;
-  Generation&            _next_gen;
+  Generation&            _old_gen;
   HeapWord*              _young_old_boundary;
   ParScanThreadStateSet& _state_set;
 };
 
-ParNewRefProcTaskProxy::ParNewRefProcTaskProxy(
-    ProcessTask& task, ParNewGeneration& gen,
-    Generation& next_gen,
-    HeapWord* young_old_boundary,
-    ParScanThreadStateSet& state_set)
+ParNewRefProcTaskProxy::ParNewRefProcTaskProxy(ProcessTask& task,
+                                               ParNewGeneration& gen,
+                                               Generation& old_gen,
+                                               HeapWord* young_old_boundary,
+                                               ParScanThreadStateSet& state_set)
   : AbstractGangTask("ParNewGeneration parallel reference processing"),
     _gen(gen),
     _task(task),
-    _next_gen(next_gen),
+    _old_gen(old_gen),
     _young_old_boundary(young_old_boundary),
     _state_set(state_set)
 {
@@ -893,7 +893,7 @@
   from()->set_next_compaction_space(to());
   gch->set_incremental_collection_failed();
   // Inform the next generation that a promotion failure occurred.
-  _next_gen->promotion_failure_occurred();
+  _old_gen->promotion_failure_occurred();
 
   // Trace promotion failure in the parallel GC threads
   thread_state_set.trace_promotion_failed(gc_tracer());
@@ -927,7 +927,7 @@
   workers->set_active_workers(active_workers);
   assert(gch->n_gens() == 2,
          "Par collection currently only works with single older gen.");
-  _next_gen = gch->next_gen(this);
+  _old_gen = gch->old_gen();
 
   // If the next generation is too full to accommodate worst-case promotion
   // from this generation, pass on collection; let the next generation
@@ -952,8 +952,6 @@
   // Capture heap used before collection (for printing).
   size_t gch_prev_used = gch->used();
 
-  SpecializationStats::clear();
-
   age_table()->clear();
   to()->clear(SpaceDecorator::Mangle);
 
@@ -968,10 +966,10 @@
   // because only those workers go through the termination protocol.
   ParallelTaskTerminator _term(n_workers, task_queues());
   ParScanThreadStateSet thread_state_set(workers->active_workers(),
-                                         *to(), *this, *_next_gen, *task_queues(),
+                                         *to(), *this, *_old_gen, *task_queues(),
                                          _overflow_stacks, desired_plab_sz(), _term);
 
-  ParNewGenTask tsk(this, _next_gen, reserved().end(), &thread_state_set);
+  ParNewGenTask tsk(this, _old_gen, reserved().end(), &thread_state_set);
   gch->set_par_threads(n_workers);
   gch->rem_set()->prepare_for_younger_refs_iterate(true);
   // It turns out that even when we're using 1 thread, doing the work in a
@@ -1073,8 +1071,6 @@
   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
   update_time_of_last_gc(now);
 
-  SpecializationStats::print();
-
   rp->set_enqueuing_is_done(true);
   if (rp->processing_is_mt()) {
     ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
@@ -1127,14 +1123,6 @@
   return forward_ptr;
 }
 
-#ifdef ASSERT
-bool ParNewGeneration::is_legal_forward_ptr(oop p) {
-  return
-    (p == ClaimedForwardPtr)
-    || Universe::heap()->is_in_reserved(p);
-}
-#endif
-
 void ParNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) {
   if (m->must_be_preserved_for_promotion_failure(obj)) {
     // We should really have separate per-worker stacks, rather
@@ -1191,8 +1179,8 @@
     }
 
     if (!_promotion_failed) {
-      new_obj = _next_gen->par_promote(par_scan_state->thread_num(),
-                                        old, m, sz);
+      new_obj = _old_gen->par_promote(par_scan_state->thread_num(),
+                                      old, m, sz);
     }
 
     if (new_obj == NULL) {
@@ -1209,6 +1197,7 @@
   } else {
     // Is in to-space; do copying ourselves.
     Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
+    assert(Universe::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
     forward_ptr = old->forward_to_atomic(new_obj);
     // Restore the mark word copied above.
     new_obj->set_mark(m);
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
 
+#include "gc_implementation/parNew/parOopClosures.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"
 #include "gc_implementation/shared/parGCAllocBuffer.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
@@ -233,13 +234,13 @@
 class ParNewGenTask: public AbstractGangTask {
  private:
   ParNewGeneration*            _gen;
-  Generation*                  _next_gen;
+  Generation*                  _old_gen;
   HeapWord*                    _young_old_boundary;
   class ParScanThreadStateSet* _state_set;
 
 public:
   ParNewGenTask(ParNewGeneration*      gen,
-                Generation*            next_gen,
+                Generation*            old_gen,
                 HeapWord*              young_old_boundary,
                 ParScanThreadStateSet* state_set);
 
@@ -419,8 +420,6 @@
   }
 
   static oop real_forwardee(oop obj);
-
-  DEBUG_ONLY(static bool is_legal_forward_ptr(oop p);)
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
--- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 #include "gc_implementation/parNew/parOopClosures.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
 
 template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
   assert (!oopDesc::is_null(*p), "null weak reference?");
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #include "gc_implementation/parallelScavenge/pcTasks.hpp"
 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
 #include "gc_implementation/shared/gcTimer.hpp"
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
 
 #include "gc_implementation/shared/collectorCounters.hpp"
-#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
 #include "utilities/stack.hpp"
 
 class PSAdaptiveSizePolicy;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -29,7 +29,6 @@
 #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
 #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
 #include "gc_implementation/shared/collectorCounters.hpp"
-#include "gc_implementation/shared/markSweep.hpp"
 #include "gc_implementation/shared/mutableSpace.hpp"
 #include "memory/sharedHeap.hpp"
 #include "oops/oop.hpp"
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -34,6 +34,7 @@
 #include "memory/padded.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/oop.psgc.inline.hpp"
+#include "utilities/stack.inline.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -40,6 +40,7 @@
 #include "runtime/thread.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
+#include "utilities/stack.inline.hpp"
 #include "utilities/taskqueue.hpp"
 
 //
--- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, 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
@@ -63,3 +63,20 @@
                                      _space->capacity(), CHECK);
   }
 }
+
+void CSpaceCounters::update_capacity() {
+  _capacity->set_value(_space->capacity());
+}
+
+void CSpaceCounters::update_used() {
+  _used->set_value(_space->used());
+}
+
+void CSpaceCounters::update_all() {
+  update_used();
+  update_capacity();
+}
+
+jlong ContiguousSpaceUsedHelper::take_sample(){
+  return _space->used();
+}
--- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
 
 #include "gc_implementation/shared/generationCounters.hpp"
-#include "memory/space.inline.hpp"
+#include "memory/space.hpp"
 #include "runtime/perfData.hpp"
 
 // A CSpaceCounters is a holder class for performance counters
@@ -56,18 +56,9 @@
       if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
   }
 
-  virtual inline void update_capacity() {
-    _capacity->set_value(_space->capacity());
-  }
-
-  virtual inline void update_used() {
-    _used->set_value(_space->used());
-  }
-
-  virtual inline void update_all() {
-    update_used();
-    update_capacity();
-  }
+  virtual void update_capacity();
+  virtual void update_used();
+  virtual void update_all();
 
   const char* name_space() const        { return _name_space; }
 };
@@ -79,9 +70,7 @@
   public:
     ContiguousSpaceUsedHelper(ContiguousSpace* space) : _space(space) { }
 
-    inline jlong take_sample() {
-      return _space->used();
-    }
+    jlong take_sample();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -84,6 +84,14 @@
 
 void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
 
+void PreservedMark::adjust_pointer() {
+  MarkSweep::adjust_pointer(&_obj);
+}
+
+void PreservedMark::restore() {
+  _obj->set_mark(_mark);
+}
+
 // We preserve the mark which should be replaced at the end and the location
 // that it will go.  Note that the object that this markOop belongs to isn't
 // currently at that address but it will be after phase4
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -26,7 +26,8 @@
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
 
 #include "gc_interface/collectedHeap.hpp"
-#include "memory/universe.hpp"
+#include "memory/genOopClosures.hpp"
+#include "memory/iterator.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.hpp"
 #include "runtime/timer.hpp"
@@ -182,13 +183,8 @@
     _mark = mark;
   }
 
-  void adjust_pointer() {
-    MarkSweep::adjust_pointer(&_obj);
-  }
-
-  void restore() {
-    _obj->set_mark(_mark);
-  }
+  void adjust_pointer();
+  void restore();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -98,7 +98,7 @@
   if (!is_init_completed()) {
     vm_exit_during_initialization(
       err_msg("GC triggered before VM initialization completed. Try increasing "
-              "NewSize, current value " UINTX_FORMAT "%s.",
+              "NewSize, current value " SIZE_FORMAT "%s.",
               byte_size_in_proper_unit(NewSize),
               proper_unit_for_byte_size(NewSize)));
   }
--- a/hotspot/src/share/vm/memory/cardTableRS.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/cardTableRS.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -27,7 +27,7 @@
 #include "memory/cardTableRS.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/generation.hpp"
-#include "memory/space.hpp"
+#include "memory/space.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/java.hpp"
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -104,15 +104,15 @@
 
   // User inputs from -Xmx and -Xms must be aligned
   _min_heap_byte_size = align_size_up(_min_heap_byte_size, _heap_alignment);
-  uintx aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
-  uintx aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
+  size_t aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
+  size_t aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
 
   // Write back to flags if the values changed
   if (aligned_initial_heap_size != InitialHeapSize) {
-    FLAG_SET_ERGO(uintx, InitialHeapSize, aligned_initial_heap_size);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, aligned_initial_heap_size);
   }
   if (aligned_max_heap_size != MaxHeapSize) {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, aligned_max_heap_size);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, aligned_max_heap_size);
   }
 
   if (FLAG_IS_CMDLINE(InitialHeapSize) && _min_heap_byte_size != 0 &&
@@ -120,9 +120,9 @@
     vm_exit_during_initialization("Incompatible minimum and initial heap sizes specified");
   }
   if (!FLAG_IS_DEFAULT(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, InitialHeapSize);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, InitialHeapSize);
   } else if (!FLAG_IS_DEFAULT(MaxHeapSize) && InitialHeapSize > MaxHeapSize) {
-    FLAG_SET_ERGO(uintx, InitialHeapSize, MaxHeapSize);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, MaxHeapSize);
     if (InitialHeapSize < _min_heap_byte_size) {
       _min_heap_byte_size = InitialHeapSize;
     }
@@ -131,7 +131,7 @@
   _initial_heap_byte_size = InitialHeapSize;
   _max_heap_byte_size = MaxHeapSize;
 
-  FLAG_SET_ERGO(uintx, MinHeapDeltaBytes, align_size_up(MinHeapDeltaBytes, _space_alignment));
+  FLAG_SET_ERGO(size_t, MinHeapDeltaBytes, align_size_up(MinHeapDeltaBytes, _space_alignment));
 
   DEBUG_ONLY(CollectorPolicy::assert_flags();)
 }
@@ -282,18 +282,18 @@
   // All generational heaps have a youngest gen; handle those flags here
 
   // Make sure the heap is large enough for two generations
-  uintx smallest_new_size = young_gen_size_lower_bound();
-  uintx smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
+  size_t smallest_new_size = young_gen_size_lower_bound();
+  size_t smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
                                            _heap_alignment);
   if (MaxHeapSize < smallest_heap_size) {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, smallest_heap_size);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, smallest_heap_size);
     _max_heap_byte_size = MaxHeapSize;
   }
   // If needed, synchronize _min_heap_byte size and _initial_heap_byte_size
   if (_min_heap_byte_size < smallest_heap_size) {
     _min_heap_byte_size = smallest_heap_size;
     if (InitialHeapSize < _min_heap_byte_size) {
-      FLAG_SET_ERGO(uintx, InitialHeapSize, smallest_heap_size);
+      FLAG_SET_ERGO(size_t, InitialHeapSize, smallest_heap_size);
       _initial_heap_byte_size = smallest_heap_size;
     }
   }
@@ -306,8 +306,8 @@
 
   // Now take the actual NewSize into account. We will silently increase NewSize
   // if the user specified a smaller or unaligned value.
-  uintx bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
-  bounded_new_size = MAX2(smallest_new_size, (uintx)align_size_down(bounded_new_size, _gen_alignment));
+  size_t bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
+  bounded_new_size = MAX2(smallest_new_size, (size_t)align_size_down(bounded_new_size, _gen_alignment));
   if (bounded_new_size != NewSize) {
     // Do not use FLAG_SET_ERGO to update NewSize here, since this will override
     // if NewSize was set on the command line or not. This information is needed
@@ -320,21 +320,21 @@
   if (!FLAG_IS_DEFAULT(MaxNewSize)) {
     if (MaxNewSize >= MaxHeapSize) {
       // Make sure there is room for an old generation
-      uintx smaller_max_new_size = MaxHeapSize - _gen_alignment;
+      size_t smaller_max_new_size = MaxHeapSize - _gen_alignment;
       if (FLAG_IS_CMDLINE(MaxNewSize)) {
         warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
                 "heap (" SIZE_FORMAT "k).  A new max generation size of " SIZE_FORMAT "k will be used.",
                 MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
       }
-      FLAG_SET_ERGO(uintx, MaxNewSize, smaller_max_new_size);
+      FLAG_SET_ERGO(size_t, MaxNewSize, smaller_max_new_size);
       if (NewSize > MaxNewSize) {
-        FLAG_SET_ERGO(uintx, NewSize, MaxNewSize);
+        FLAG_SET_ERGO(size_t, NewSize, MaxNewSize);
         _initial_young_size = NewSize;
       }
     } else if (MaxNewSize < _initial_young_size) {
-      FLAG_SET_ERGO(uintx, MaxNewSize, _initial_young_size);
+      FLAG_SET_ERGO(size_t, MaxNewSize, _initial_young_size);
     } else if (!is_size_aligned(MaxNewSize, _gen_alignment)) {
-      FLAG_SET_ERGO(uintx, MaxNewSize, align_size_down(MaxNewSize, _gen_alignment));
+      FLAG_SET_ERGO(size_t, MaxNewSize, align_size_down(MaxNewSize, _gen_alignment));
     }
     _max_young_size = MaxNewSize;
   }
@@ -347,7 +347,7 @@
               "A new max generation size of " SIZE_FORMAT "k will be used.",
               NewSize/K, MaxNewSize/K, NewSize/K);
     }
-    FLAG_SET_ERGO(uintx, MaxNewSize, NewSize);
+    FLAG_SET_ERGO(size_t, MaxNewSize, NewSize);
     _max_young_size = MaxNewSize;
   }
 
@@ -369,9 +369,9 @@
     size_t calculated_heapsize = (OldSize / NewRatio) * (NewRatio + 1);
 
     calculated_heapsize = align_size_up(calculated_heapsize, _heap_alignment);
-    FLAG_SET_ERGO(uintx, MaxHeapSize, calculated_heapsize);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, calculated_heapsize);
     _max_heap_byte_size = MaxHeapSize;
-    FLAG_SET_ERGO(uintx, InitialHeapSize, calculated_heapsize);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, calculated_heapsize);
     _initial_heap_byte_size = InitialHeapSize;
   }
 
@@ -380,19 +380,19 @@
     if (_max_heap_size_cmdline) {
       // Somebody has set a maximum heap size with the intention that we should not
       // exceed it. Adjust New/OldSize as necessary.
-      uintx calculated_size = NewSize + OldSize;
+      size_t calculated_size = NewSize + OldSize;
       double shrink_factor = (double) MaxHeapSize / calculated_size;
-      uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment);
-      FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
+      size_t smaller_new_size = align_size_down((size_t)(NewSize * shrink_factor), _gen_alignment);
+      FLAG_SET_ERGO(size_t, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
       _initial_young_size = NewSize;
 
       // OldSize is already aligned because above we aligned MaxHeapSize to
       // _heap_alignment, and we just made sure that NewSize is aligned to
       // _gen_alignment. In initialize_flags() we verified that _heap_alignment
       // is a multiple of _gen_alignment.
-      FLAG_SET_ERGO(uintx, OldSize, MaxHeapSize - NewSize);
+      FLAG_SET_ERGO(size_t, OldSize, MaxHeapSize - NewSize);
     } else {
-      FLAG_SET_ERGO(uintx, MaxHeapSize, align_size_up(NewSize + OldSize, _heap_alignment));
+      FLAG_SET_ERGO(size_t, MaxHeapSize, align_size_up(NewSize + OldSize, _heap_alignment));
       _max_heap_byte_size = MaxHeapSize;
     }
   }
@@ -405,7 +405,7 @@
       // Need to compare against the flag value for max since _max_young_size
       // might not have been set yet.
       if (new_size >= _min_young_size && new_size <= MaxNewSize) {
-        FLAG_SET_ERGO(uintx, NewSize, new_size);
+        FLAG_SET_ERGO(size_t, NewSize, new_size);
         _initial_young_size = NewSize;
       }
     }
@@ -561,15 +561,15 @@
 
   // Write back to flags if necessary.
   if (NewSize != _initial_young_size) {
-    FLAG_SET_ERGO(uintx, NewSize, _initial_young_size);
+    FLAG_SET_ERGO(size_t, NewSize, _initial_young_size);
   }
 
   if (MaxNewSize != _max_young_size) {
-    FLAG_SET_ERGO(uintx, MaxNewSize, _max_young_size);
+    FLAG_SET_ERGO(size_t, MaxNewSize, _max_young_size);
   }
 
   if (OldSize != _initial_old_size) {
-    FLAG_SET_ERGO(uintx, OldSize, _initial_old_size);
+    FLAG_SET_ERGO(size_t, OldSize, _initial_old_size);
   }
 
   if (PrintGCDetails && Verbose) {
@@ -601,7 +601,7 @@
     HandleMark hm; // Discard any handles allocated in each iteration.
 
     // First allocation attempt is lock-free.
-    Generation *young = gch->get_gen(0);
+    Generation *young = gch->young_gen();
     assert(young->supports_inline_contig_alloc(),
       "Otherwise, must do alloc within heap lock");
     if (young->should_allocate(size, is_tlab)) {
@@ -615,8 +615,8 @@
     {
       MutexLocker ml(Heap_lock);
       if (PrintGC && Verbose) {
-        gclog_or_tty->print_cr("TwoGenerationCollectorPolicy::mem_allocate_work:"
-                      " attempting locked slow path allocation");
+        gclog_or_tty->print_cr("GenCollectorPolicy::mem_allocate_work:"
+                               " attempting locked slow path allocation");
       }
       // Note that only large objects get a shot at being
       // allocated in later generations.
@@ -705,7 +705,7 @@
     // Give a warning if we seem to be looping forever.
     if ((QueuedAllocationWarningCount > 0) &&
         (try_count % QueuedAllocationWarningCount == 0)) {
-          warning("TwoGenerationCollectorPolicy::mem_allocate_work retries %d times \n\t"
+          warning("GenCollectorPolicy::mem_allocate_work retries %d times \n\t"
                   " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
     }
   }
@@ -715,10 +715,14 @@
                                                        bool   is_tlab) {
   GenCollectedHeap *gch = GenCollectedHeap::heap();
   HeapWord* result = NULL;
-  for (int i = number_of_generations() - 1; i >= 0 && result == NULL; i--) {
-    Generation *gen = gch->get_gen(i);
-    if (gen->should_allocate(size, is_tlab)) {
-      result = gen->expand_and_allocate(size, is_tlab);
+  Generation *old = gch->old_gen();
+  if (old->should_allocate(size, is_tlab)) {
+    result = old->expand_and_allocate(size, is_tlab);
+  }
+  if (result == NULL) {
+    Generation *young = gch->young_gen();
+    if (young->should_allocate(size, is_tlab)) {
+      result = young->expand_and_allocate(size, is_tlab);
     }
   }
   assert(result == NULL || gch->is_in_reserved(result), "result not in heap");
@@ -891,7 +895,7 @@
 bool GenCollectorPolicy::should_try_older_generation_allocation(
         size_t word_size) const {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  size_t young_capacity = gch->get_gen(0)->capacity_before_gc();
+  size_t young_capacity = gch->young_gen()->capacity_before_gc();
   return    (word_size > heap_word_size(young_capacity))
          || GC_locker::is_active_and_needs_gc()
          || gch->incremental_collection_failed();
@@ -903,7 +907,7 @@
 //
 
 void MarkSweepPolicy::initialize_alignments() {
-  _space_alignment = _gen_alignment = (uintx)Generation::GenGrain;
+  _space_alignment = _gen_alignment = (size_t)Generation::GenGrain;
   _heap_alignment = compute_heap_alignment();
 }
 
@@ -935,18 +939,18 @@
     // for both min and initial young size if less than min heap.
     flag_value = 20 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_min(flag_value);
 
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_initial(flag_value);
 
     // If NewSize is set on command line, but is larger than the min
     // heap size, it should only be used for initial young size.
     flag_value = 80 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_initial(flag_value);
 
     // If NewSize has been ergonomically set, the collector policy
@@ -954,11 +958,11 @@
     // using NewRatio.
     flag_value = 20 * M;
     set_basic_flag_values();
-    FLAG_SET_ERGO(uintx, NewSize, flag_value);
+    FLAG_SET_ERGO(size_t, NewSize, flag_value);
     verify_young_min(flag_value);
 
     set_basic_flag_values();
-    FLAG_SET_ERGO(uintx, NewSize, flag_value);
+    FLAG_SET_ERGO(size_t, NewSize, flag_value);
     verify_scaled_young_initial(InitialHeapSize);
 
     restore_flags();
@@ -974,11 +978,11 @@
     // for both min and initial old size if less than min heap.
     flag_value = 20 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
     verify_old_min(flag_value);
 
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
     // Calculate what we expect the flag to be.
     size_t expected_old_initial = align_size_up(InitialHeapSize, heap_alignment) - MaxNewSize;
     verify_old_initial(expected_old_initial);
@@ -989,10 +993,10 @@
     // We intentionally set MaxNewSize + OldSize > MaxHeapSize (see over_size).
     flag_value = 30 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
     size_t over_size = 20*M;
     size_t new_size_value = align_size_up(MaxHeapSize, heap_alignment) - flag_value + over_size;
-    FLAG_SET_CMDLINE(uintx, MaxNewSize, new_size_value);
+    FLAG_SET_CMDLINE(size_t, MaxNewSize, new_size_value);
     // Calculate what we expect the flag to be.
     expected_old_initial = align_size_up(MaxHeapSize, heap_alignment) - MaxNewSize;
     verify_old_initial(expected_old_initial);
@@ -1053,11 +1057,11 @@
   static size_t original_OldSize;
 
   static void set_basic_flag_values() {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, 180 * M);
-    FLAG_SET_ERGO(uintx, InitialHeapSize, 100 * M);
-    FLAG_SET_ERGO(uintx, OldSize, 4 * M);
-    FLAG_SET_ERGO(uintx, NewSize, 1 * M);
-    FLAG_SET_ERGO(uintx, MaxNewSize, 80 * M);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, 180 * M);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, 100 * M);
+    FLAG_SET_ERGO(size_t, OldSize, 4 * M);
+    FLAG_SET_ERGO(size_t, NewSize, 1 * M);
+    FLAG_SET_ERGO(size_t, MaxNewSize, 80 * M);
     Arguments::set_min_heap_size(40 * M);
   }
 
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -226,7 +226,7 @@
 
   compute_space_boundaries(0, SpaceDecorator::Clear, SpaceDecorator::Mangle);
   update_counters();
-  _next_gen = NULL;
+  _old_gen = NULL;
   _tenuring_threshold = MaxTenuringThreshold;
   _pretenure_size_threshold_words = PretenureSizeThreshold >> LogHeapWordSize;
 
@@ -383,8 +383,8 @@
   assert(next_level < gch->_n_gens,
          "DefNewGeneration cannot be an oldest gen");
 
-  Generation* next_gen = gch->get_gen(next_level);
-  size_t old_size = next_gen->capacity();
+  Generation* old_gen = gch->old_gen();
+  size_t old_size = old_gen->capacity();
   size_t new_size_before = _virtual_space.committed_size();
   size_t min_new_size = spec()->init_size();
   size_t max_new_size = reserved().byte_size();
@@ -568,7 +568,7 @@
   DefNewTracer gc_tracer;
   gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
 
-  _next_gen = gch->next_gen(this);
+  _old_gen = gch->old_gen();
 
   // If the next generation is too full to accommodate promotion
   // from this generation, pass on collection; let the next generation
@@ -590,8 +590,6 @@
 
   gch->trace_heap_before_gc(&gc_tracer);
 
-  SpecializationStats::clear();
-
   // These can be shared for all code paths
   IsAliveClosure is_alive(this);
   ScanWeakRefClosure scan_weak_ref(this);
@@ -628,7 +626,7 @@
                          true,  // Process younger gens, if any,
                                 // as strong roots.
                          true,  // activate StrongRootsScope
-                         SharedHeap::SO_ScavengeCodeCache,
+                         GenCollectedHeap::SO_ScavengeCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &fsc_with_no_gc_barrier,
                          &fsc_with_gc_barrier,
@@ -688,7 +686,7 @@
     gch->set_incremental_collection_failed();
 
     // Inform the next generation that a promotion failure occurred.
-    _next_gen->promotion_failure_occurred();
+    _old_gen->promotion_failure_occurred();
     gc_tracer.report_promotion_failed(_promotion_failed_info);
 
     // Reset the PromotionFailureALot counters.
@@ -700,7 +698,6 @@
   // set new iteration safe limit for the survivor spaces
   from()->set_concurrent_iteration_safe_limit(from()->top());
   to()->set_concurrent_iteration_safe_limit(to()->top());
-  SpecializationStats::print();
 
   // We need to use a monotonically non-decreasing time in ms
   // or we will see time-warp warnings and os::javaTimeMillis()
@@ -793,7 +790,7 @@
 
   // Otherwise try allocating obj tenured
   if (obj == NULL) {
-    obj = _next_gen->promote(old, s);
+    obj = _old_gen->promote(old, s);
     if (obj == NULL) {
       handle_promotion_failure(old);
       return old;
@@ -898,11 +895,11 @@
     }
     return false;
   }
-  if (_next_gen == NULL) {
+  if (_old_gen == NULL) {
     GenCollectedHeap* gch = GenCollectedHeap::heap();
-    _next_gen = gch->next_gen(this);
+    _old_gen = gch->old_gen();
   }
-  return _next_gen->promotion_attempt_is_safe(used());
+  return _old_gen->promotion_attempt_is_safe(used());
 }
 
 void DefNewGeneration::gc_epilogue(bool full) {
@@ -1022,8 +1019,7 @@
   return eden();
 }
 
-HeapWord* DefNewGeneration::allocate(size_t word_size,
-                                     bool is_tlab) {
+HeapWord* DefNewGeneration::allocate(size_t word_size, bool is_tlab) {
   // This is the slow-path allocation for the DefNewGeneration.
   // Most allocations are fast-path in compiled code.
   // We try to allocate from the eden.  If that works, we are happy.
@@ -1031,8 +1027,8 @@
   // have to use it here, as well.
   HeapWord* result = eden()->par_allocate(word_size);
   if (result != NULL) {
-    if (CMSEdenChunksRecordAlways && _next_gen != NULL) {
-      _next_gen->sample_eden_chunk();
+    if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
+      _old_gen->sample_eden_chunk();
     }
   } else {
     // If the eden is full and the last collection bailed out, we are running
@@ -1047,8 +1043,8 @@
 HeapWord* DefNewGeneration::par_allocate(size_t word_size,
                                          bool is_tlab) {
   HeapWord* res = eden()->par_allocate(word_size);
-  if (CMSEdenChunksRecordAlways && _next_gen != NULL) {
-    _next_gen->sample_eden_chunk();
+  if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
+    _old_gen->sample_eden_chunk();
   }
   return res;
 }
--- a/hotspot/src/share/vm/memory/defNewGeneration.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -29,11 +29,14 @@
 #include "gc_implementation/shared/cSpaceCounters.hpp"
 #include "gc_implementation/shared/generationCounters.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
+#include "memory/generation.hpp"
 #include "utilities/stack.hpp"
 
 class ContiguousSpace;
 class ScanClosure;
 class STWGCTimer;
+class CSpaceCounters;
+class ScanWeakRefClosure;
 
 // DefNewGeneration is a young generation containing eden, from- and
 // to-space.
@@ -42,7 +45,7 @@
   friend class VMStructs;
 
 protected:
-  Generation* _next_gen;
+  Generation* _old_gen;
   uint        _tenuring_threshold;   // Tenuring threshold for next collection.
   ageTable    _age_table;
   // Size of object to pretenure in words; command line provides bytes
--- a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, 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
@@ -25,8 +25,10 @@
 #ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
 #define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
 
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/defNewGeneration.hpp"
+#include "memory/genOopClosures.inline.hpp"
 #include "memory/space.hpp"
 
 // Methods of protected closure types
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -26,6 +26,7 @@
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/icBuffer.hpp"
 #include "gc_implementation/shared/collectorCounters.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"
@@ -47,6 +48,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/vmThread.hpp"
+#include "services/management.hpp"
 #include "services/memoryService.hpp"
 #include "utilities/vmError.hpp"
 #include "utilities/workgroup.hpp"
@@ -61,7 +63,15 @@
 
 // The set of potentially parallel tasks in root scanning.
 enum GCH_strong_roots_tasks {
-  // We probably want to parallelize both of these internally, but for now...
+  GCH_PS_Universe_oops_do,
+  GCH_PS_JNIHandles_oops_do,
+  GCH_PS_ObjectSynchronizer_oops_do,
+  GCH_PS_FlatProfiler_oops_do,
+  GCH_PS_Management_oops_do,
+  GCH_PS_SystemDictionary_oops_do,
+  GCH_PS_ClassLoaderDataGraph_oops_do,
+  GCH_PS_jvmti_oops_do,
+  GCH_PS_CodeCache_oops_do,
   GCH_PS_younger_gens,
   // Leave this one last.
   GCH_PS_NumElements
@@ -71,13 +81,9 @@
   SharedHeap(policy),
   _rem_set(NULL),
   _gen_policy(policy),
-  _gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
+  _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
   _full_collections_completed(0)
 {
-  if (_gen_process_roots_tasks == NULL ||
-      !_gen_process_roots_tasks->valid()) {
-    vm_exit_during_initialization("Failed necessary allocation.");
-  }
   assert(policy != NULL, "Sanity check");
 }
 
@@ -177,18 +183,17 @@
   SharedHeap::post_initialize();
   GenCollectorPolicy *policy = (GenCollectorPolicy *)collector_policy();
   guarantee(policy->is_generation_policy(), "Illegal policy type");
-  assert((get_gen(0)->kind() == Generation::DefNew) ||
-         (get_gen(0)->kind() == Generation::ParNew),
+  assert((_young_gen->kind() == Generation::DefNew) ||
+         (_young_gen->kind() == Generation::ParNew),
     "Wrong youngest generation type");
-  DefNewGeneration* def_new_gen = (DefNewGeneration*)get_gen(0);
+  DefNewGeneration* def_new_gen = (DefNewGeneration*)_young_gen;
 
-  Generation* old_gen = get_gen(1);
-  assert(old_gen->kind() == Generation::ConcurrentMarkSweep ||
-         old_gen->kind() == Generation::MarkSweepCompact,
+  assert(_old_gen->kind() == Generation::ConcurrentMarkSweep ||
+         _old_gen->kind() == Generation::MarkSweepCompact,
     "Wrong generation kind");
 
   policy->initialize_size_policy(def_new_gen->eden()->capacity(),
-                                 old_gen->capacity(),
+                                 _old_gen->capacity(),
                                  def_new_gen->from()->capacity());
   policy->initialize_gc_policy_counters();
 }
@@ -570,29 +575,137 @@
 
 void GenCollectedHeap::set_par_threads(uint t) {
   SharedHeap::set_par_threads(t);
-  _gen_process_roots_tasks->set_n_threads(t);
+  set_n_termination(t);
+}
+
+void GenCollectedHeap::set_n_termination(uint t) {
+  _process_strong_tasks->set_n_threads(t);
 }
 
-void GenCollectedHeap::
-gen_process_roots(int level,
-                  bool younger_gens_as_roots,
-                  bool activate_scope,
-                  SharedHeap::ScanningOption so,
-                  OopsInGenClosure* not_older_gens,
-                  OopsInGenClosure* weak_roots,
-                  OopsInGenClosure* older_gens,
-                  CLDClosure* cld_closure,
-                  CLDClosure* weak_cld_closure,
-                  CodeBlobClosure* code_closure) {
+#ifdef ASSERT
+class AssertNonScavengableClosure: public OopClosure {
+public:
+  virtual void do_oop(oop* p) {
+    assert(!Universe::heap()->is_in_partial_collection(*p),
+      "Referent should not be scavengable.");  }
+  virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
+};
+static AssertNonScavengableClosure assert_is_non_scavengable_closure;
+#endif
+
+void GenCollectedHeap::process_roots(bool activate_scope,
+                                     ScanningOption so,
+                                     OopClosure* strong_roots,
+                                     OopClosure* weak_roots,
+                                     CLDClosure* strong_cld_closure,
+                                     CLDClosure* weak_cld_closure,
+                                     CodeBlobClosure* code_roots) {
+  StrongRootsScope srs(this, activate_scope);
 
   // General roots.
-  SharedHeap::process_roots(activate_scope, so,
-                            not_older_gens, weak_roots,
-                            cld_closure, weak_cld_closure,
-                            code_closure);
+  assert(_strong_roots_parity != 0, "must have called prologue code");
+  assert(code_roots != NULL, "code root closure should always be set");
+  // _n_termination for _process_strong_tasks should be set up stream
+  // in a method not running in a GC worker.  Otherwise the GC worker
+  // could be trying to change the termination condition while the task
+  // is executing in another GC worker.
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_ClassLoaderDataGraph_oops_do)) {
+    ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
+  }
+
+  // Some CLDs contained in the thread frames should be considered strong.
+  // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
+  CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
+  // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
+  CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
+
+  Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
+    Universe::oops_do(strong_roots);
+  }
+  // Global (strong) JNI handles
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_JNIHandles_oops_do)) {
+    JNIHandles::oops_do(strong_roots);
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_ObjectSynchronizer_oops_do)) {
+    ObjectSynchronizer::oops_do(strong_roots);
+  }
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_FlatProfiler_oops_do)) {
+    FlatProfiler::oops_do(strong_roots);
+  }
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_Management_oops_do)) {
+    Management::oops_do(strong_roots);
+  }
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_jvmti_oops_do)) {
+    JvmtiExport::oops_do(strong_roots);
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_SystemDictionary_oops_do)) {
+    SystemDictionary::roots_oops_do(strong_roots, weak_roots);
+  }
+
+  // All threads execute the following. A specific chunk of buckets
+  // from the StringTable are the individual tasks.
+  if (weak_roots != NULL) {
+    if (CollectedHeap::use_parallel_gc_threads()) {
+      StringTable::possibly_parallel_oops_do(weak_roots);
+    } else {
+      StringTable::oops_do(weak_roots);
+    }
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_CodeCache_oops_do)) {
+    if (so & SO_ScavengeCodeCache) {
+      assert(code_roots != NULL, "must supply closure for code cache");
+
+      // We only visit parts of the CodeCache when scavenging.
+      CodeCache::scavenge_root_nmethods_do(code_roots);
+    }
+    if (so & SO_AllCodeCache) {
+      assert(code_roots != NULL, "must supply closure for code cache");
+
+      // CMSCollector uses this to do intermediate-strength collections.
+      // We scan the entire code cache, since CodeCache::do_unloading is not called.
+      CodeCache::blobs_do(code_roots);
+    }
+    // Verify that the code cache contents are not subject to
+    // movement by a scavenging collection.
+    DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
+    DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
+  }
+
+}
+
+void GenCollectedHeap::gen_process_roots(int level,
+                                         bool younger_gens_as_roots,
+                                         bool activate_scope,
+                                         ScanningOption so,
+                                         bool only_strong_roots,
+                                         OopsInGenClosure* not_older_gens,
+                                         OopsInGenClosure* older_gens,
+                                         CLDClosure* cld_closure) {
+  const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
+
+  bool is_moving_collection = false;
+  if (level == 0 || is_adjust_phase) {
+    // young collections are always moving
+    is_moving_collection = true;
+  }
+
+  MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
+  OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
+  CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
+
+  process_roots(activate_scope, so,
+                not_older_gens, weak_roots,
+                cld_closure, weak_cld_closure,
+                &mark_code_closure);
 
   if (younger_gens_as_roots) {
-    if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
+    if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
       if (level == 1) {
         not_older_gens->set_generation(_young_gen);
         _young_gen->oop_iterate(not_older_gens);
@@ -608,43 +721,18 @@
     older_gens->reset_generation();
   }
 
-  _gen_process_roots_tasks->all_tasks_completed();
+  _process_strong_tasks->all_tasks_completed();
 }
 
-void GenCollectedHeap::
-gen_process_roots(int level,
-                  bool younger_gens_as_roots,
-                  bool activate_scope,
-                  SharedHeap::ScanningOption so,
-                  bool only_strong_roots,
-                  OopsInGenClosure* not_older_gens,
-                  OopsInGenClosure* older_gens,
-                  CLDClosure* cld_closure) {
 
-  const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
-
-  bool is_moving_collection = false;
-  if (level == 0 || is_adjust_phase) {
-    // young collections are always moving
-    is_moving_collection = true;
-  }
-
-  MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
-  CodeBlobClosure* code_closure = &mark_code_closure;
-
-  gen_process_roots(level,
-                    younger_gens_as_roots,
-                    activate_scope, so,
-                    not_older_gens, only_strong_roots ? NULL : not_older_gens,
-                    older_gens,
-                    cld_closure, only_strong_roots ? NULL : cld_closure,
-                    code_closure);
-
-}
+class AlwaysTrueClosure: public BoolObjectClosure {
+public:
+  bool do_object_b(oop p) { return true; }
+};
+static AlwaysTrueClosure always_true;
 
 void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
-  SharedHeap::process_weak_roots(root_closure);
-  // "Local" "weak" refs
+  JNIHandles::weak_oops_do(&always_true, root_closure);
   _young_gen->ref_processor()->weak_oops_do(root_closure);
   _old_gen->ref_processor()->weak_oops_do(root_closure);
 }
@@ -1113,10 +1201,10 @@
 
 void GenCollectedHeap::print_tracing_info() const {
   if (TraceYoungGenTime) {
-    get_gen(0)->print_summary_info();
+    _young_gen->print_summary_info();
   }
   if (TraceOldGenTime) {
-    get_gen(1)->print_summary_info();
+    _old_gen->print_summary_info();
   }
 }
 
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -85,8 +85,7 @@
 
   // Data structure for claiming the (potentially) parallel tasks in
   // (gen-specific) roots processing.
-  SubTasksDone* _gen_process_roots_tasks;
-  SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
+  SubTasksDone* _process_strong_tasks;
 
   // Collects the given generation.
   void collect_generation(Generation* gen, bool full, size_t size, bool is_tlab,
@@ -373,27 +372,6 @@
   // collection.
   virtual bool is_maximal_no_gc() const;
 
-  // Return the generation before "gen".
-  Generation* prev_gen(Generation* gen) const {
-    guarantee(gen->level() == 1, "Out of bounds");
-    return _young_gen;
-  }
-
-  // Return the generation after "gen".
-  Generation* next_gen(Generation* gen) const {
-    guarantee(gen->level() == 0, "Out of bounds");
-    return _old_gen;
-  }
-
-  Generation* get_gen(int i) const {
-    guarantee(i == 0 || i == 1, "Out of bounds");
-    if (i == 0) {
-      return _young_gen;
-    } else {
-      return _old_gen;
-    }
-  }
-
   int n_gens() const {
     assert(_n_gens == gen_policy()->number_of_generations(), "Sanity");
     return _n_gens;
@@ -408,6 +386,7 @@
   static GenCollectedHeap* heap();
 
   void set_par_threads(uint t);
+  void set_n_termination(uint t);
 
   // Invoke the "do_oop" method of one of the closures "not_older_gens"
   // or "older_gens" on root locations for the generation at
@@ -421,11 +400,25 @@
   // The "so" argument determines which of the roots
   // the closure is applied to:
   // "SO_None" does none;
+  enum ScanningOption {
+    SO_None                =  0x0,
+    SO_AllCodeCache        =  0x8,
+    SO_ScavengeCodeCache   = 0x10
+  };
+
  private:
+  void process_roots(bool activate_scope,
+                     ScanningOption so,
+                     OopClosure* strong_roots,
+                     OopClosure* weak_roots,
+                     CLDClosure* strong_cld_closure,
+                     CLDClosure* weak_cld_closure,
+                     CodeBlobClosure* code_roots);
+
   void gen_process_roots(int level,
                          bool younger_gens_as_roots,
                          bool activate_scope,
-                         SharedHeap::ScanningOption so,
+                         ScanningOption so,
                          OopsInGenClosure* not_older_gens,
                          OopsInGenClosure* weak_roots,
                          OopsInGenClosure* older_gens,
@@ -440,7 +433,7 @@
   void gen_process_roots(int level,
                          bool younger_gens_as_roots,
                          bool activate_scope,
-                         SharedHeap::ScanningOption so,
+                         ScanningOption so,
                          bool only_strong_roots,
                          OopsInGenClosure* not_older_gens,
                          OopsInGenClosure* older_gens,
@@ -486,7 +479,7 @@
     assert(heap()->collector_policy()->is_generation_policy(),
            "the following definition may not be suitable for an n(>2)-generation system");
     return incremental_collection_failed() ||
-           (consult_young && !get_gen(0)->collection_attempt_is_safe());
+           (consult_young && !_young_gen->collection_attempt_is_safe());
   }
 
   // If a generation bails out of an incremental collection,
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -50,6 +50,7 @@
 #include "runtime/vmThread.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/events.hpp"
+#include "utilities/stack.inline.hpp"
 
 void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool clear_all_softrefs) {
   guarantee(level == 1, "We always collect both old and young.");
@@ -109,20 +110,16 @@
 
   deallocate_stacks();
 
-  // If compaction completely evacuated all generations younger than this
-  // one, then we can clear the card table.  Otherwise, we must invalidate
+  // If compaction completely evacuated the young generation then we
+  // can clear the card table.  Otherwise, we must invalidate
   // it (consider all cards dirty).  In the future, we might consider doing
   // compaction within generations only, and doing card-table sliding.
-  bool all_empty = true;
-  for (int i = 0; all_empty && i < level; i++) {
-    Generation* g = gch->get_gen(i);
-    all_empty = all_empty && gch->get_gen(i)->used() == 0;
-  }
   GenRemSet* rs = gch->rem_set();
-  Generation* old_gen = gch->get_gen(level);
+  Generation* old_gen = gch->old_gen();
+
   // Clear/invalidate below make use of the "prev_used_regions" saved earlier.
-  if (all_empty) {
-    // We've evacuated all generations below us.
+  if (gch->young_gen()->used() == 0) {
+    // We've evacuated the young generation.
     rs->clear_into_younger(old_gen);
   } else {
     // Invalidate the cards corresponding to the currently used
@@ -157,9 +154,8 @@
 
 void GenMarkSweep::allocate_stacks() {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  // Scratch request on behalf of oldest generation; will do no
-  // allocation.
-  ScratchBlock* scratch = gch->gather_scratch(gch->get_gen(gch->_n_gens-1), 0);
+  // Scratch request on behalf of old generation; will do no allocation.
+  ScratchBlock* scratch = gch->gather_scratch(gch->old_gen(), 0);
 
   // $$$ To cut a corner, we'll only use the first scratch block, and then
   // revert to malloc.
@@ -188,7 +184,7 @@
 }
 
 void GenMarkSweep::mark_sweep_phase1(int level,
-                                  bool clear_all_softrefs) {
+                                     bool clear_all_softrefs) {
   // Recursively traverse all live objects and mark them
   GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
   trace(" 1");
@@ -199,7 +195,8 @@
   // use OopsInGenClosure constructor which takes a generation,
   // as the Universe has not been created when the static constructors
   // are run.
-  follow_root_closure.set_orig_generation(gch->get_gen(level));
+  assert(level == 1, "We don't use mark-sweep on young generations");
+  follow_root_closure.set_orig_generation(gch->old_gen());
 
   // Need new claim bits before marking starts.
   ClassLoaderDataGraph::clear_claimed_marks();
@@ -207,7 +204,7 @@
   gch->gen_process_roots(level,
                          false, // Younger gens are not roots.
                          true,  // activate StrongRootsScope
-                         SharedHeap::SO_None,
+                         GenCollectedHeap::SO_None,
                          GenCollectedHeap::StrongRootsOnly,
                          &follow_root_closure,
                          &follow_root_closure,
@@ -287,12 +284,13 @@
   // use OopsInGenClosure constructor which takes a generation,
   // as the Universe has not been created when the static constructors
   // are run.
-  adjust_pointer_closure.set_orig_generation(gch->get_gen(level));
+  assert(level == 1, "We don't use mark-sweep on young generations.");
+  adjust_pointer_closure.set_orig_generation(gch->old_gen());
 
   gch->gen_process_roots(level,
                          false, // Younger gens are not roots.
                          true,  // activate StrongRootsScope
-                         SharedHeap::SO_AllCodeCache,
+                         GenCollectedHeap::SO_AllCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &adjust_pointer_closure,
                          &adjust_pointer_closure,
--- a/hotspot/src/share/vm/memory/generation.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/generation.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -153,9 +153,8 @@
 
 Generation* Generation::next_gen() const {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  int next = level() + 1;
-  if (next < gch->_n_gens) {
-    return gch->get_gen(next);
+  if (level() == 0) {
+    return gch->old_gen();
   } else {
     return NULL;
   }
--- a/hotspot/src/share/vm/memory/heapInspection.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/heapInspection.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -33,6 +33,7 @@
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/stack.inline.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #endif // INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -3131,7 +3131,7 @@
 void Metaspace::initialize_class_space(ReservedSpace rs) {
   // The reserved space size may be bigger because of alignment, esp with UseLargePages
   assert(rs.size() >= CompressedClassSpaceSize,
-         err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), CompressedClassSpaceSize));
+         err_msg(SIZE_FORMAT " != " SIZE_FORMAT, rs.size(), CompressedClassSpaceSize));
   assert(using_class_space(), "Must be using class space");
   _class_space_list = new VirtualSpaceList(rs);
   _chunk_manager_class = new ChunkManager(SpecializedChunk, ClassSmallChunk, ClassMediumChunk);
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -430,7 +430,7 @@
 
     // Split up and initialize the misc code and data spaces
     ReservedSpace* shared_rs = MetaspaceShared::shared_rs();
-    int metadata_size = SharedReadOnlySize+SharedReadWriteSize;
+    size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize;
     ReservedSpace shared_ro_rw = shared_rs->first_part(metadata_size);
     ReservedSpace misc_section = shared_rs->last_part(metadata_size);
 
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -32,7 +32,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/java.hpp"
-#include "services/management.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/workgroup.hpp"
 
@@ -40,32 +39,12 @@
 
 SharedHeap* SharedHeap::_sh;
 
-// The set of potentially parallel tasks in root scanning.
-enum SH_process_roots_tasks {
-  SH_PS_Universe_oops_do,
-  SH_PS_JNIHandles_oops_do,
-  SH_PS_ObjectSynchronizer_oops_do,
-  SH_PS_FlatProfiler_oops_do,
-  SH_PS_Management_oops_do,
-  SH_PS_SystemDictionary_oops_do,
-  SH_PS_ClassLoaderDataGraph_oops_do,
-  SH_PS_jvmti_oops_do,
-  SH_PS_CodeCache_oops_do,
-  // Leave this one last.
-  SH_PS_NumElements
-};
-
 SharedHeap::SharedHeap(CollectorPolicy* policy_) :
   CollectedHeap(),
   _collector_policy(policy_),
-  _strong_roots_scope(NULL),
   _strong_roots_parity(0),
-  _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
   _workers(NULL)
 {
-  if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
-    vm_exit_during_initialization("Failed necessary allocation.");
-  }
   _sh = this;  // ch is static, should be set only once.
   if (UseConcMarkSweepGC || UseG1GC) {
     _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads,
@@ -79,14 +58,6 @@
   }
 }
 
-int SharedHeap::n_termination() {
-  return _process_strong_tasks->n_threads();
-}
-
-void SharedHeap::set_n_termination(int t) {
-  _process_strong_tasks->set_n_threads(t);
-}
-
 bool SharedHeap::heap_lock_held_for_gc() {
   Thread* t = Thread::current();
   return    Heap_lock->owned_by_self()
@@ -97,31 +68,6 @@
 void SharedHeap::set_par_threads(uint t) {
   assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
   _n_par_threads = t;
-  _process_strong_tasks->set_n_threads(t);
-}
-
-#ifdef ASSERT
-class AssertNonScavengableClosure: public OopClosure {
-public:
-  virtual void do_oop(oop* p) {
-    assert(!Universe::heap()->is_in_partial_collection(*p),
-      "Referent should not be scavengable.");  }
-  virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
-};
-static AssertNonScavengableClosure assert_is_non_scavengable_closure;
-#endif
-
-SharedHeap::StrongRootsScope* SharedHeap::active_strong_roots_scope() const {
-  return _strong_roots_scope;
-}
-void SharedHeap::register_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
-  assert(_strong_roots_scope == NULL, "Should only have one StrongRootsScope active");
-  assert(scope != NULL, "Illegal argument");
-  _strong_roots_scope = scope;
-}
-void SharedHeap::unregister_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
-  assert(_strong_roots_scope == scope, "Wrong scope unregistered");
-  _strong_roots_scope = NULL;
 }
 
 void SharedHeap::change_strong_roots_parity() {
@@ -135,174 +81,15 @@
 }
 
 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
-  : MarkScope(activate), _sh(heap), _n_workers_done_with_threads(0)
+  : MarkScope(activate), _sh(heap)
 {
   if (_active) {
-    _sh->register_strong_roots_scope(this);
     _sh->change_strong_roots_parity();
     // Zero the claimed high water mark in the StringTable
     StringTable::clear_parallel_claimed_index();
   }
 }
 
-SharedHeap::StrongRootsScope::~StrongRootsScope() {
-  if (_active) {
-    _sh->unregister_strong_roots_scope(this);
-  }
-}
-
-Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false, Monitor::_safepoint_check_never);
-
-void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
-  // The Thread work barrier is only needed by G1 Class Unloading.
-  // No need to use the barrier if this is single-threaded code.
-  if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
-    uint new_value = (uint)Atomic::add(1, &_n_workers_done_with_threads);
-    if (new_value == n_workers) {
-      // This thread is last. Notify the others.
-      MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
-      _lock->notify_all();
-    }
-  }
-}
-
-void SharedHeap::StrongRootsScope::wait_until_all_workers_done_with_threads(uint n_workers) {
-  assert(UseG1GC,                          "Currently only used by G1");
-  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
-
-  // No need to use the barrier if this is single-threaded code.
-  if (n_workers > 0 && (uint)_n_workers_done_with_threads != n_workers) {
-    MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
-    while ((uint)_n_workers_done_with_threads != n_workers) {
-      _lock->wait(Mutex::_no_safepoint_check_flag, 0, false);
-    }
-  }
-}
-
-void SharedHeap::process_roots(bool activate_scope,
-                               ScanningOption so,
-                               OopClosure* strong_roots,
-                               OopClosure* weak_roots,
-                               CLDClosure* strong_cld_closure,
-                               CLDClosure* weak_cld_closure,
-                               CodeBlobClosure* code_roots) {
-  StrongRootsScope srs(this, activate_scope);
-
-  // General roots.
-  assert(_strong_roots_parity != 0, "must have called prologue code");
-  assert(code_roots != NULL, "code root closure should always be set");
-  // _n_termination for _process_strong_tasks should be set up stream
-  // in a method not running in a GC worker.  Otherwise the GC worker
-  // could be trying to change the termination condition while the task
-  // is executing in another GC worker.
-
-  // Iterating over the CLDG and the Threads are done early to allow G1 to
-  // first process the strong CLDs and nmethods and then, after a barrier,
-  // let the thread process the weak CLDs and nmethods.
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
-    ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
-  }
-
-  // Some CLDs contained in the thread frames should be considered strong.
-  // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
-  CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
-  // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
-  CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
-
-  Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
-
-  // This is the point where this worker thread will not find more strong CLDs/nmethods.
-  // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
-  active_strong_roots_scope()->mark_worker_done_with_threads(n_par_threads());
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
-    Universe::oops_do(strong_roots);
-  }
-  // Global (strong) JNI handles
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
-    JNIHandles::oops_do(strong_roots);
-
-  if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
-    ObjectSynchronizer::oops_do(strong_roots);
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
-    FlatProfiler::oops_do(strong_roots);
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
-    Management::oops_do(strong_roots);
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do))
-    JvmtiExport::oops_do(strong_roots);
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
-    SystemDictionary::roots_oops_do(strong_roots, weak_roots);
-  }
-
-  // All threads execute the following. A specific chunk of buckets
-  // from the StringTable are the individual tasks.
-  if (weak_roots != NULL) {
-    if (CollectedHeap::use_parallel_gc_threads()) {
-      StringTable::possibly_parallel_oops_do(weak_roots);
-    } else {
-      StringTable::oops_do(weak_roots);
-    }
-  }
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
-    if (so & SO_ScavengeCodeCache) {
-      assert(code_roots != NULL, "must supply closure for code cache");
-
-      // We only visit parts of the CodeCache when scavenging.
-      CodeCache::scavenge_root_nmethods_do(code_roots);
-    }
-    if (so & SO_AllCodeCache) {
-      assert(code_roots != NULL, "must supply closure for code cache");
-
-      // CMSCollector uses this to do intermediate-strength collections.
-      // We scan the entire code cache, since CodeCache::do_unloading is not called.
-      CodeCache::blobs_do(code_roots);
-    }
-    // Verify that the code cache contents are not subject to
-    // movement by a scavenging collection.
-    DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
-    DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
-  }
-
-  _process_strong_tasks->all_tasks_completed();
-}
-
-void SharedHeap::process_all_roots(bool activate_scope,
-                                   ScanningOption so,
-                                   OopClosure* roots,
-                                   CLDClosure* cld_closure,
-                                   CodeBlobClosure* code_closure) {
-  process_roots(activate_scope, so,
-                roots, roots,
-                cld_closure, cld_closure,
-                code_closure);
-}
-
-void SharedHeap::process_strong_roots(bool activate_scope,
-                                      ScanningOption so,
-                                      OopClosure* roots,
-                                      CLDClosure* cld_closure,
-                                      CodeBlobClosure* code_closure) {
-  process_roots(activate_scope, so,
-                roots, NULL,
-                cld_closure, NULL,
-                code_closure);
-}
-
-
-class AlwaysTrueClosure: public BoolObjectClosure {
-public:
-  bool do_object_b(oop p) { return true; }
-};
-static AlwaysTrueClosure always_true;
-
-void SharedHeap::process_weak_roots(OopClosure* root_closure) {
-  // Global (weak) JNI handles
-  JNIHandles::weak_oops_do(&always_true, root_closure);
-}
-
 void SharedHeap::set_barrier_set(BarrierSet* bs) {
   _barrier_set = bs;
   // Cached barrier set for fast access in oops
--- a/hotspot/src/share/vm/memory/sharedHeap.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/sharedHeap.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -61,18 +61,18 @@
 //    counts the number of tasks that have been done and then reset
 //    the SubTasksDone so that it can be used again.  When the number of
 //    tasks is set to the number of GC workers, then _n_threads must
-//    be set to the number of active GC workers. G1CollectedHeap,
-//    HRInto_G1RemSet, GenCollectedHeap and SharedHeap have SubTasksDone.
-//    This seems too many.
+//    be set to the number of active GC workers. G1RootProcessor and
+//    GenCollectedHeap have SubTasksDone.
 //    3) SequentialSubTasksDone has an _n_threads that is used in
 //    a way similar to SubTasksDone and has the same dependency on the
 //    number of active GC workers.  CompactibleFreeListSpace and Space
 //    have SequentialSubTasksDone's.
-// Example of using SubTasksDone and SequentialSubTasksDone
-// G1CollectedHeap::g1_process_roots()
-//  to SharedHeap::process_roots() and uses
-//  SubTasksDone* _process_strong_tasks to claim tasks.
-//  process_roots() calls
+//
+// Examples of using SubTasksDone and SequentialSubTasksDone:
+//  G1RootProcessor and GenCollectedHeap::process_roots() use
+//  SubTasksDone* _process_strong_tasks to claim tasks for workers
+//
+//  GenCollectedHeap::gen_process_roots() calls
 //      rem_set()->younger_refs_iterate()
 //  to scan the card table and which eventually calls down into
 //  CardTableModRefBS::par_non_clean_card_iterate_work().  This method
@@ -104,10 +104,6 @@
   friend class VM_GC_Operation;
   friend class VM_CGC_Operation;
 
-private:
-  // For claiming strong_roots tasks.
-  SubTasksDone* _process_strong_tasks;
-
 protected:
   // There should be only a single instance of "SharedHeap" in a program.
   // This is enforced with the protected constructor below, which will also
@@ -140,7 +136,6 @@
   static SharedHeap* heap() { return _sh; }
 
   void set_barrier_set(BarrierSet* bs);
-  SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
 
   // Does operations required after initialization has been done.
   virtual void post_initialize();
@@ -193,69 +188,19 @@
   // strong_roots_prologue calls change_strong_roots_parity, if
   // parallel tasks are enabled.
   class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
-    // Used to implement the Thread work barrier.
-    static Monitor* _lock;
-
     SharedHeap*   _sh;
-    volatile jint _n_workers_done_with_threads;
 
    public:
     StrongRootsScope(SharedHeap* heap, bool activate = true);
-    ~StrongRootsScope();
-
-    // Mark that this thread is done with the Threads work.
-    void mark_worker_done_with_threads(uint n_workers);
-    // Wait until all n_workers are done with the Threads work.
-    void wait_until_all_workers_done_with_threads(uint n_workers);
   };
   friend class StrongRootsScope;
 
-  // The current active StrongRootScope
-  StrongRootsScope* _strong_roots_scope;
-
-  StrongRootsScope* active_strong_roots_scope() const;
-
  private:
-  void register_strong_roots_scope(StrongRootsScope* scope);
-  void unregister_strong_roots_scope(StrongRootsScope* scope);
   void change_strong_roots_parity();
 
  public:
-  enum ScanningOption {
-    SO_None                =  0x0,
-    SO_AllCodeCache        =  0x8,
-    SO_ScavengeCodeCache   = 0x10
-  };
-
   FlexibleWorkGang* workers() const { return _workers; }
 
-  // Invoke the "do_oop" method the closure "roots" on all root locations.
-  // The "so" argument determines which roots the closure is applied to:
-  // "SO_None" does none;
-  // "SO_AllCodeCache" applies the closure to all elements of the CodeCache.
-  // "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache.
-  void process_roots(bool activate_scope,
-                     ScanningOption so,
-                     OopClosure* strong_roots,
-                     OopClosure* weak_roots,
-                     CLDClosure* strong_cld_closure,
-                     CLDClosure* weak_cld_closure,
-                     CodeBlobClosure* code_roots);
-  void process_all_roots(bool activate_scope,
-                         ScanningOption so,
-                         OopClosure* roots,
-                         CLDClosure* cld_closure,
-                         CodeBlobClosure* code_roots);
-  void process_strong_roots(bool activate_scope,
-                            ScanningOption so,
-                            OopClosure* roots,
-                            CLDClosure* cld_closure,
-                            CodeBlobClosure* code_roots);
-
-
-  // Apply "root_closure" to the JNI weak roots..
-  void process_weak_roots(OopClosure* root_closure);
-
   // The functions below are helper functions that a subclass of
   // "SharedHeap" can use in the implementation of its virtual
   // functions.
@@ -270,9 +215,6 @@
   // (such as process roots) subsequently.
   virtual void set_par_threads(uint t);
 
-  int n_termination();
-  void set_n_termination(int t);
-
   //
   // New methods from CollectedHeap
   //
@@ -284,8 +226,4 @@
                              size_t capacity);
 };
 
-inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) {
-  return static_cast<SharedHeap::ScanningOption>(static_cast<int>(so0) | static_cast<int>(so1));
-}
-
 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
--- a/hotspot/src/share/vm/memory/space.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/space.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -26,7 +26,6 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc_implementation/shared/liveRange.hpp"
-#include "gc_implementation/shared/markSweep.hpp"
 #include "gc_implementation/shared/spaceDecorator.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/blockOffsetTable.inline.hpp"
@@ -353,15 +352,6 @@
 void ContiguousSpace::mangle_unused_area_complete() {
   mangler()->mangle_unused_area_complete();
 }
-void ContiguousSpace::mangle_region(MemRegion mr) {
-  // Although this method uses SpaceMangler::mangle_region() which
-  // is not specific to a space, the when the ContiguousSpace version
-  // is called, it is always with regard to a space and this
-  // bounds checking is appropriate.
-  MemRegion space_mr(bottom(), end());
-  assert(space_mr.contains(mr), "Mangling outside space");
-  SpaceMangler::mangle_region(mr);
-}
 #endif  // NOT_PRODUCT
 
 void CompactibleSpace::initialize(MemRegion mr,
@@ -388,7 +378,7 @@
     cp->space->set_compaction_top(compact_top);
     cp->space = cp->space->next_compaction_space();
     if (cp->space == NULL) {
-      cp->gen = GenCollectedHeap::heap()->prev_gen(cp->gen);
+      cp->gen = GenCollectedHeap::heap()->young_gen();
       assert(cp->gen != NULL, "compaction must succeed");
       cp->space = cp->gen->first_compaction_space();
       assert(cp->space != NULL, "generation must have a first compaction space");
--- a/hotspot/src/share/vm/memory/space.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/space.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -128,11 +128,10 @@
 
   // For detecting GC bugs.  Should only be called at GC boundaries, since
   // some unused space may be used as scratch space during GC's.
-  // Default implementation does nothing. We also call this when expanding
-  // a space to satisfy an allocation request. See bug #4668531
-  virtual void mangle_unused_area() {}
-  virtual void mangle_unused_area_complete() {}
-  virtual void mangle_region(MemRegion mr) {}
+  // We also call this when expanding a space to satisfy an allocation
+  // request. See bug #4668531
+  virtual void mangle_unused_area() = 0;
+  virtual void mangle_unused_area_complete() = 0;
 
   // Testers
   bool is_empty() const              { return used() == 0; }
@@ -196,7 +195,7 @@
   // structure supporting these calls, possibly speeding up future calls.
   // The default implementation, however, is simply to call the const
   // version.
-  inline virtual HeapWord* block_start(const void* p);
+  virtual HeapWord* block_start(const void* p);
 
   // Requires "addr" to be the start of a chunk, and returns its size.
   // "addr + size" is required to be the start of a new chunk, or the end
@@ -559,8 +558,6 @@
   void mangle_unused_area() PRODUCT_RETURN;
   // Mangle [top, end)
   void mangle_unused_area_complete() PRODUCT_RETURN;
-  // Mangle the given MemRegion.
-  void mangle_region(MemRegion mr) PRODUCT_RETURN;
 
   // Do some sparse checking on the area that should have been mangled.
   void check_mangled_unused_area(HeapWord* limit) PRODUCT_RETURN;
--- a/hotspot/src/share/vm/memory/specialized_oop_closures.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "memory/specialized_oop_closures.hpp"
-#include "utilities/ostream.hpp"
-
-// For keeping stats on effectiveness.
-#ifndef PRODUCT
-#if ENABLE_SPECIALIZATION_STATS
-
-int SpecializationStats::_numCallsAll;
-
-int SpecializationStats::_numCallsTotal[NUM_Kinds];
-int SpecializationStats::_numCalls_nv[NUM_Kinds];
-
-int SpecializationStats::_numDoOopCallsTotal[NUM_Kinds];
-int SpecializationStats::_numDoOopCalls_nv[NUM_Kinds];
-
-void SpecializationStats::clear() {
-  _numCallsAll = 0;
-  for (int k = ik; k < NUM_Kinds; k++) {
-    _numCallsTotal[k] = 0;
-    _numCalls_nv[k] = 0;
-
-    _numDoOopCallsTotal[k] = 0;
-    _numDoOopCalls_nv[k] = 0;
-  }
-}
-
-void SpecializationStats::print() {
-  const char* header_format = "    %20s %10s %11s %10s";
-  const char* line_format   = "    %20s %10d %11d %9.2f%%";
-  int all_numCallsTotal =
-    _numCallsTotal[ik] + _numCallsTotal[irk] + _numCallsTotal[oa];
-  int all_numCalls_nv =
-    _numCalls_nv[ik] + _numCalls_nv[irk] + _numCalls_nv[oa];
-  gclog_or_tty->print_cr("\nOf %d oop_oop_iterate calls %d (%6.3f%%) are in (ik, irk, oa).",
-                _numCallsAll, all_numCallsTotal,
-                100.0 * (float)all_numCallsTotal / (float)_numCallsAll);
-  // irk calls are double-counted.
-  int real_ik_numCallsTotal = _numCallsTotal[ik] - _numCallsTotal[irk];
-  int real_ik_numCalls_nv   = _numCalls_nv[ik]   - _numCalls_nv[irk];
-  gclog_or_tty->print_cr("");
-  gclog_or_tty->print_cr(header_format, "oop_oop_iterate:", "calls", "non-virtual", "pct");
-  gclog_or_tty->print_cr(header_format,
-                "----------",
-                "----------",
-                "-----------",
-                "----------");
-  gclog_or_tty->print_cr(line_format, "all",
-                all_numCallsTotal,
-                all_numCalls_nv,
-                100.0 * (float)all_numCalls_nv / (float)all_numCallsTotal);
-  gclog_or_tty->print_cr(line_format, "ik",
-                real_ik_numCallsTotal, real_ik_numCalls_nv,
-                100.0 * (float)real_ik_numCalls_nv /
-                (float)real_ik_numCallsTotal);
-  gclog_or_tty->print_cr(line_format, "irk",
-                _numCallsTotal[irk], _numCalls_nv[irk],
-                100.0 * (float)_numCalls_nv[irk] / (float)_numCallsTotal[irk]);
-  gclog_or_tty->print_cr(line_format, "oa",
-                _numCallsTotal[oa], _numCalls_nv[oa],
-                100.0 * (float)_numCalls_nv[oa] / (float)_numCallsTotal[oa]);
-
-
-  gclog_or_tty->print_cr("");
-  gclog_or_tty->print_cr(header_format, "do_oop:", "calls", "non-virtual", "pct");
-  gclog_or_tty->print_cr(header_format,
-                "----------",
-                "----------",
-                "-----------",
-                "----------");
-  int all_numDoOopCallsTotal =
-    _numDoOopCallsTotal[ik] + _numDoOopCallsTotal[irk] + _numDoOopCallsTotal[oa];
-  int all_numDoOopCalls_nv =
-    _numDoOopCalls_nv[ik] + _numDoOopCalls_nv[irk] + _numDoOopCalls_nv[oa];
-  gclog_or_tty->print_cr(line_format, "all",
-                all_numDoOopCallsTotal, all_numDoOopCalls_nv,
-                100.0 * (float)all_numDoOopCalls_nv /
-                (float)all_numDoOopCallsTotal);
-  const char* kind_names[] = { "ik", "irk", "oa" };
-  for (int k = ik; k < NUM_Kinds; k++) {
-    gclog_or_tty->print_cr(line_format, kind_names[k],
-                  _numDoOopCallsTotal[k], _numDoOopCalls_nv[k],
-                  (_numDoOopCallsTotal[k] > 0 ?
-                   100.0 * (float)_numDoOopCalls_nv[k] /
-                   (float)_numDoOopCallsTotal[k]
-                   : 0.0));
-  }
-}
-
-#endif  // ENABLE_SPECIALIZATION_STATS
-#endif  // !PRODUCT
--- a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -60,21 +60,15 @@
 // This macro applies an argument macro to all OopClosures for which we
 // want specialized bodies of "oop_oop_iterate".  The arguments to "f" are:
 //   "f(closureType, non_virtual)"
-// where "closureType" is the name of the particular subclass of OopClosure,
+// where "closureType" is the name of the particular subclass of ExtendedOopClosure,
 // and "non_virtual" will be the string "_nv" if the closure type should
 // have its "do_oop" method invoked non-virtually, or else the
-// string "_v".  ("OopClosure" itself will be the only class in the latter
+// string "_v".  ("ExtendedOopClosure" itself will be the only class in the latter
 // category.)
 
 // This is split into several because of a Visual C++ 6.0 compiler bug
 // where very long macros cause the compiler to crash
 
-// Some other heap might define further specialized closures.
-#ifndef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
-#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
-        /* None */
-#endif
-
 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)       \
   f(ScanClosure,_nv)                                    \
   f(FastScanClosure,_nv)                                \
@@ -94,7 +88,7 @@
   SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
 
 #if INCLUDE_ALL_GCS
-#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)       \
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)     \
   f(MarkRefsIntoAndScanClosure,_nv)                     \
   f(Par_MarkRefsIntoAndScanClosure,_nv)                 \
   f(PushAndMarkClosure,_nv)                             \
@@ -102,8 +96,13 @@
   f(PushOrMarkClosure,_nv)                              \
   f(Par_PushOrMarkClosure,_nv)                          \
   f(CMSKeepAliveClosure,_nv)                            \
-  f(CMSInnerParMarkAndPushClosure,_nv)                  \
-  FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f)
+  f(CMSInnerParMarkAndPushClosure,_nv)
+#endif
+
+#if INCLUDE_ALL_GCS
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)       \
+  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)           \
+  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f)
 #else  // INCLUDE_ALL_GCS
 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)
 #endif // INCLUDE_ALL_GCS
@@ -144,13 +143,6 @@
 // The "root_class" is the most general class to define; this may be
 // "OopClosure" in some applications and "OopsInGenClosure" in others.
 
-
-// Some other heap might define further specialized closures.
-#ifndef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
-#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) \
-        /* None */
-#endif
-
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \
   f(ScanClosure,_nv)                                     \
   f(FastScanClosure,_nv)
@@ -158,8 +150,7 @@
 #if INCLUDE_ALL_GCS
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f) \
   f(ParScanWithBarrierClosure,_nv)                       \
-  f(ParScanWithoutBarrierClosure,_nv)                    \
-  FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
+  f(ParScanWithoutBarrierClosure,_nv)
 #else  // INCLUDE_ALL_GCS
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
 #endif // INCLUDE_ALL_GCS
@@ -174,93 +165,9 @@
 // We separate these out, because sometime the general one has
 // a different definition from the specialized ones, and sometimes it
 // doesn't.
-// NOTE:   One of the valid criticisms of this
-// specialize-oop_oop_iterate-for-specific-closures idiom is that it is
-// easy to have a silent performance bug: if you fail to de-virtualize,
-// things still work, just slower.  The "SpecializationStats" mode is
-// intended to at least make such a failure easy to detect.
-// *Not* using the ALL_SINCE_SAVE_MARKS_CLOSURES(f) macro defined
-// below means that *only* closures for which oop_oop_iterate specializations
-// exist above may be applied to "oops_since_save_marks".  That is,
-// this form of the performance bug is caught statically.  When you add
-// a definition for the general type, this property goes away.
-// Make sure you test with SpecializationStats to find such bugs
-// when introducing a new closure where you don't want virtual dispatch.
 
 #define ALL_SINCE_SAVE_MARKS_CLOSURES(f)                \
   f(OopsInGenClosure,_v)                                \
   SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
 
-// For keeping stats on effectiveness.
-#define ENABLE_SPECIALIZATION_STATS 0
-
-
-class SpecializationStats {
-public:
-  enum Kind {
-    ik,             // InstanceKlass
-    irk,            // InstanceRefKlass
-    oa,             // ObjArrayKlass
-    NUM_Kinds
-  };
-
-#if ENABLE_SPECIALIZATION_STATS
-private:
-  static bool _init;
-  static bool _wrapped;
-  static jint _numCallsAll;
-
-  static jint _numCallsTotal[NUM_Kinds];
-  static jint _numCalls_nv[NUM_Kinds];
-
-  static jint _numDoOopCallsTotal[NUM_Kinds];
-  static jint _numDoOopCalls_nv[NUM_Kinds];
-public:
-#endif
-  static void clear()  PRODUCT_RETURN;
-
-  static inline void record_call()  PRODUCT_RETURN;
-  static inline void record_iterate_call_v(Kind k)  PRODUCT_RETURN;
-  static inline void record_iterate_call_nv(Kind k)  PRODUCT_RETURN;
-  static inline void record_do_oop_call_v(Kind k)  PRODUCT_RETURN;
-  static inline void record_do_oop_call_nv(Kind k)  PRODUCT_RETURN;
-
-  static void print() PRODUCT_RETURN;
-};
-
-#ifndef PRODUCT
-#if ENABLE_SPECIALIZATION_STATS
-
-inline void SpecializationStats::record_call() {
-  Atomic::inc(&_numCallsAll);
-}
-inline void SpecializationStats::record_iterate_call_v(Kind k) {
-  Atomic::inc(&_numCallsTotal[k]);
-}
-inline void SpecializationStats::record_iterate_call_nv(Kind k) {
-  Atomic::inc(&_numCallsTotal[k]);
-  Atomic::inc(&_numCalls_nv[k]);
-}
-
-inline void SpecializationStats::record_do_oop_call_v(Kind k) {
-  Atomic::inc(&_numDoOopCallsTotal[k]);
-}
-inline void SpecializationStats::record_do_oop_call_nv(Kind k) {
-  Atomic::inc(&_numDoOopCallsTotal[k]);
-  Atomic::inc(&_numDoOopCalls_nv[k]);
-}
-
-#else   // !ENABLE_SPECIALIZATION_STATS
-
-inline void SpecializationStats::record_call() {}
-inline void SpecializationStats::record_iterate_call_v(Kind k) {}
-inline void SpecializationStats::record_iterate_call_nv(Kind k) {}
-inline void SpecializationStats::record_do_oop_call_v(Kind k) {}
-inline void SpecializationStats::record_do_oop_call_nv(Kind k) {}
-inline void SpecializationStats::clear() {}
-inline void SpecializationStats::print() {}
-
-#endif  // ENABLE_SPECIALIZATION_STATS
-#endif  // !PRODUCT
-
 #endif // SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
--- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -178,7 +178,6 @@
                                 bool   is_tlab) {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
 
-  SpecializationStats::clear();
   // Temporarily expand the span of our ref processor, so
   // refs discovery is over the entire heap, not just this generation
   ReferenceProcessorSpanMutator
@@ -195,8 +194,6 @@
   gc_timer->register_gc_end();
 
   gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
-
-  SpecializationStats::print();
 }
 
 HeapWord*
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -35,9 +35,6 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-# include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
-#endif // INCLUDE_ALL_GCS
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -30,6 +30,7 @@
 #include "memory/genOopClosures.inline.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
@@ -54,7 +55,6 @@
 int InstanceClassLoaderKlass::                                                  \
 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {                  \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
   int size = InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure);           \
                                                                                 \
   if_do_metadata_checked(closure, nv_suffix) {                                  \
@@ -74,7 +74,6 @@
 int InstanceClassLoaderKlass::                                                  \
 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {        \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
   int size = InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \
   return size;                                                                  \
 }
@@ -87,8 +86,6 @@
 oop_oop_iterate##nv_suffix##_m(oop obj,                                         \
                                OopClosureType* closure,                         \
                                MemRegion mr) {                                  \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr);   \
                                                                                 \
   if_do_metadata_checked(closure, nv_suffix) {                                  \
--- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
 #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -38,6 +38,7 @@
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceKlass.hpp"
@@ -2192,15 +2193,12 @@
 #define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)        \
                                                                              \
 int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
   /* header */                                                          \
   if_do_metadata_checked(closure, nv_suffix) {                          \
     closure->do_klass##nv_suffix(obj->klass());                         \
   }                                                                     \
   InstanceKlass_OOP_MAP_ITERATE(                                        \
     obj,                                                                \
-    SpecializationStats::                                               \
-      record_do_oop_call##nv_suffix(SpecializationStats::ik);           \
     (closure)->do_oop##nv_suffix(p),                                    \
     assert_is_in_closed_subset)                                         \
   return size_helper();                                                 \
@@ -2211,14 +2209,11 @@
                                                                                 \
 int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj,                \
                                               OopClosureType* closure) {        \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik); \
-                                                                                \
   assert_should_ignore_metadata(closure, nv_suffix);                            \
                                                                                 \
   /* instance variables */                                                      \
   InstanceKlass_OOP_MAP_REVERSE_ITERATE(                                        \
     obj,                                                                        \
-    SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::ik);\
     (closure)->do_oop##nv_suffix(p),                                            \
     assert_is_in_closed_subset)                                                 \
    return size_helper();                                                        \
@@ -2230,7 +2225,6 @@
 int InstanceKlass::oop_oop_iterate##nv_suffix##_m(oop obj,              \
                                                   OopClosureType* closure, \
                                                   MemRegion mr) {          \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
   if_do_metadata_checked(closure, nv_suffix) {                           \
     if (mr.contains(obj)) {                                              \
       closure->do_klass##nv_suffix(obj->klass());                        \
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -27,6 +27,7 @@
 
 #include "classfile/classLoaderData.hpp"
 #include "memory/referenceType.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/annotations.hpp"
 #include "oops/constMethod.hpp"
 #include "oops/fieldInfo.hpp"
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -30,6 +30,7 @@
 #include "memory/genOopClosures.inline.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/instanceOop.hpp"
@@ -250,8 +251,6 @@
 int InstanceMirrorKlass::                                                             \
 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {                        \
   /* Get size before changing pointers */                                             \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);      \
-                                                                                      \
   InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure);                            \
                                                                                       \
   if_do_metadata_checked(closure, nv_suffix) {                                        \
@@ -275,8 +274,6 @@
 int InstanceMirrorKlass::                                                             \
 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {              \
   /* Get size before changing pointers */                                             \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);      \
-                                                                                      \
   InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure);                  \
                                                                                       \
   if (UseCompressedOops) {                                                            \
@@ -294,8 +291,6 @@
 oop_oop_iterate##nv_suffix##_m(oop obj,                                               \
                                OopClosureType* closure,                               \
                                MemRegion mr) {                                        \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);      \
-                                                                                      \
   InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr);                    \
                                                                                       \
   if_do_metadata_checked(closure, nv_suffix) {                                        \
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -26,6 +26,7 @@
 #define SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP
 
 #include "classfile/systemDictionary.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "runtime/handles.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -30,6 +30,7 @@
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/genOopClosures.inline.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "utilities/preserveException.hpp"
@@ -260,7 +261,6 @@
       return size;                                                              \
     } else if (contains(referent_addr)) {                                       \
       /* treat referent as normal oop */                                        \
-      SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::irk);\
       closure->do_oop##nv_suffix(referent_addr);                                \
     }                                                                           \
   }                                                                             \
@@ -276,7 +276,6 @@
                                  INTPTR_FORMAT, disc_addr);                     \
         }                                                                       \
       )                                                                         \
-      SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::irk);\
       closure->do_oop##nv_suffix(disc_addr);                                    \
     }                                                                           \
   } else {                                                                      \
@@ -293,7 +292,6 @@
   }                                                                             \
   /* treat next as normal oop */                                                \
   if (contains(next_addr)) {                                                    \
-    SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::irk); \
     closure->do_oop##nv_suffix(next_addr);                                      \
   }                                                                             \
   return size;                                                                  \
@@ -309,8 +307,6 @@
 int InstanceRefKlass::                                                          \
 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {                  \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure);           \
                                                                                 \
   if (UseCompressedOops) {                                                      \
@@ -326,8 +322,6 @@
 int InstanceRefKlass::                                                          \
 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {        \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \
                                                                                 \
   if (UseCompressedOops) {                                                      \
@@ -345,8 +339,6 @@
 oop_oop_iterate##nv_suffix##_m(oop obj,                                         \
                                OopClosureType* closure,                         \
                                MemRegion mr) {                                  \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr);   \
   if (UseCompressedOops) {                                                      \
     InstanceRefKlass_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, mr.contains); \
--- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
 #define SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/oops/klass.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/klass.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -39,8 +39,8 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "trace/traceMacros.hpp"
-#include "utilities/stack.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/stack.inline.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -32,6 +32,7 @@
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
@@ -479,7 +480,6 @@
                                                                                 \
 int ObjArrayKlass::oop_oop_iterate##nv_suffix(oop obj,                          \
                                               OopClosureType* closure) {        \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
   assert (obj->is_array(), "obj must be array");                                \
   objArrayOop a = objArrayOop(obj);                                             \
   /* Get size before changing pointers. */                                      \
@@ -497,7 +497,6 @@
 int ObjArrayKlass::oop_oop_iterate##nv_suffix##_m(oop obj,                      \
                                                   OopClosureType* closure,      \
                                                   MemRegion mr) {               \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
   assert(obj->is_array(), "obj must be array");                                 \
   objArrayOop a  = objArrayOop(obj);                                            \
   /* Get size before changing pointers. */                                      \
@@ -519,7 +518,6 @@
 int ObjArrayKlass::oop_oop_iterate_range##nv_suffix(oop obj,                    \
                                                   OopClosureType* closure,      \
                                                   int start, int end) {         \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
   assert(obj->is_array(), "obj must be array");                                 \
   objArrayOop a  = objArrayOop(obj);                                            \
   /* Get size before changing pointers. */                                      \
--- a/hotspot/src/share/vm/oops/objArrayOop.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/objArrayOop.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
@@ -46,7 +47,6 @@
 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)                    \
                                                                                    \
 int objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) {  \
-  SpecializationStats::record_call();                                              \
   return ((ObjArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \
 }
 
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP
 #define SHARE_VM_OOPS_OBJARRAYOOP_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/arrayOop.hpp"
 
 // An objArrayOop is an array containing oops.
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -630,6 +630,30 @@
   return cas_set_mark(m, compare) == compare;
 }
 
+#if INCLUDE_ALL_GCS
+inline oop oopDesc::forward_to_atomic(oop p) {
+  markOop oldMark = mark();
+  markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p);
+  markOop curMark;
+
+  assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable");
+  assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this.");
+
+  while (!oldMark->is_marked()) {
+    curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark);
+    assert(is_forwarded(), "object should have been forwarded");
+    if (curMark == oldMark) {
+      return NULL;
+    }
+    // If the CAS was unsuccessful then curMark->is_marked()
+    // should return true as another thread has CAS'd in another
+    // forwarding pointer.
+    oldMark = curMark;
+  }
+  return forwardee();
+}
+#endif
+
 // Note that the forwardee is not the same thing as the displaced_mark.
 // The forwardee is used when copying during scavenge and mark-sweep.
 // It does need to clear the low two locking- and GC-related bits.
@@ -692,12 +716,10 @@
 #define OOP_ITERATE_DEFN(OopClosureType, nv_suffix)                        \
                                                                            \
 inline int oopDesc::oop_iterate(OopClosureType* blk) {                     \
-  SpecializationStats::record_call();                                      \
   return klass()->oop_oop_iterate##nv_suffix(this, blk);               \
 }                                                                          \
                                                                            \
 inline int oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) {       \
-  SpecializationStats::record_call();                                      \
   return klass()->oop_oop_iterate##nv_suffix##_m(this, blk, mr);       \
 }
 
@@ -721,7 +743,6 @@
 #define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix)              \
                                                                            \
 inline int oopDesc::oop_iterate_backwards(OopClosureType* blk) {           \
-  SpecializationStats::record_call();                                      \
   return klass()->oop_oop_iterate_backwards##nv_suffix(this, blk);     \
 }
 
--- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -54,28 +54,4 @@
   klass()->oop_follow_contents(cm, this);
 }
 
-inline oop oopDesc::forward_to_atomic(oop p) {
-  assert(ParNewGeneration::is_legal_forward_ptr(p),
-         "illegal forwarding pointer value.");
-  markOop oldMark = mark();
-  markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p);
-  markOop curMark;
-
-  assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable");
-  assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this.");
-
-  while (!oldMark->is_marked()) {
-    curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark);
-    assert(is_forwarded(), "object should have been forwarded");
-    if (curMark == oldMark) {
-      return NULL;
-    }
-    // If the CAS was unsuccessful then curMark->is_marked()
-    // should return true as another thread has CAS'd in another
-    // forwarding pointer.
-    oldMark = curMark;
-  }
-  return forwardee();
-}
-
 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1518,7 +1518,6 @@
   BarrierSet* bs = Universe::heap()->barrier_set();
   set_control(ctl);
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
       break;
@@ -1537,7 +1536,6 @@
 bool GraphKit::can_move_pre_barrier() const {
   BarrierSet* bs = Universe::heap()->barrier_set();
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       return true; // Can move it if no safepoint
 
@@ -1563,7 +1561,6 @@
   BarrierSet* bs = Universe::heap()->barrier_set();
   set_control(ctl);
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
       break;
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -135,8 +135,6 @@
 # include "memory/resourceArea.hpp"
 # include "memory/sharedHeap.hpp"
 # include "memory/space.hpp"
-# include "memory/space.inline.hpp"
-# include "memory/specialized_oop_closures.hpp"
 # include "memory/threadLocalAllocBuffer.hpp"
 # include "memory/threadLocalAllocBuffer.inline.hpp"
 # include "memory/universe.hpp"
@@ -310,7 +308,6 @@
 # include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
 # include "gc_implementation/g1/g1OopClosures.hpp"
 # include "gc_implementation/g1/g1_globals.hpp"
-# include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
 # include "gc_implementation/g1/ptrQueue.hpp"
 # include "gc_implementation/g1/satbQueue.hpp"
 # include "gc_implementation/parNew/parOopClosures.hpp"
--- a/hotspot/src/share/vm/prims/jvm.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -402,7 +402,7 @@
       PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
     } else {
       char as_chars[256];
-      jio_snprintf(as_chars, sizeof(as_chars), UINTX_FORMAT, MaxDirectMemorySize);
+      jio_snprintf(as_chars, sizeof(as_chars), SIZE_FORMAT, MaxDirectMemorySize);
       PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
     }
   }
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -295,6 +295,12 @@
   return hr->is_humongous();
 WB_END
 
+WB_ENTRY(jlong, WB_G1NumMaxRegions(JNIEnv* env, jobject o))
+  G1CollectedHeap* g1 = G1CollectedHeap::heap();
+  size_t nr = g1->max_regions();
+  return (jlong)nr;
+WB_END
+
 WB_ENTRY(jlong, WB_G1NumFreeRegions(JNIEnv* env, jobject o))
   G1CollectedHeap* g1 = G1CollectedHeap::heap();
   size_t nr = g1->num_free_regions();
@@ -318,6 +324,14 @@
 WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
   return (jint)HeapRegion::GrainBytes;
 WB_END
+
+WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
+  ResourceMark rm(THREAD);
+  G1CollectedHeap* g1h = G1CollectedHeap::heap();
+  MemoryUsage usage = g1h->get_auxiliary_data_memory_usage();
+  Handle h = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
+  return JNIHandles::make_local(env, h());
+WB_END
 #endif // INCLUDE_ALL_GCS
 
 #if INCLUDE_NMT
@@ -1305,9 +1319,12 @@
 #if INCLUDE_ALL_GCS
   {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
   {CC"g1IsHumongous",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
+  {CC"g1NumMaxRegions",    CC"()J",                   (void*)&WB_G1NumMaxRegions  },
   {CC"g1NumFreeRegions",   CC"()J",                   (void*)&WB_G1NumFreeRegions  },
   {CC"g1RegionSize",       CC"()I",                   (void*)&WB_G1RegionSize      },
   {CC"g1StartConcMarkCycle",       CC"()Z",           (void*)&WB_G1StartMarkCycle  },
+  {CC"g1AuxiliaryMemoryUsage", CC"()Ljava/lang/management/MemoryUsage;",
+                                                      (void*)&WB_G1AuxiliaryMemoryUsage  },
 #endif // INCLUDE_ALL_GCS
 #if INCLUDE_NMT
   {CC"NMTMalloc",           CC"(J)J",                 (void*)&WB_NMTMalloc          },
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -67,16 +67,16 @@
   }                                                                   \
 } while(0)
 
-char**  Arguments::_jvm_flags_array             = NULL;
-int     Arguments::_num_jvm_flags               = 0;
-char**  Arguments::_jvm_args_array              = NULL;
-int     Arguments::_num_jvm_args                = 0;
+char** Arguments::_jvm_flags_array              = NULL;
+int    Arguments::_num_jvm_flags                = 0;
+char** Arguments::_jvm_args_array               = NULL;
+int    Arguments::_num_jvm_args                 = 0;
 char*  Arguments::_java_command                 = NULL;
 SystemProperty* Arguments::_system_properties   = NULL;
 const char*  Arguments::_gc_log_filename        = NULL;
 bool   Arguments::_has_profile                  = false;
 size_t Arguments::_conservative_max_heap_alignment = 0;
-uintx  Arguments::_min_heap_size                = 0;
+size_t Arguments::_min_heap_size                = 0;
 uintx  Arguments::_min_heap_free_ratio          = 0;
 uintx  Arguments::_max_heap_free_ratio          = 0;
 Arguments::Mode Arguments::_mode                = _mixed;
@@ -1291,9 +1291,9 @@
     // NewSize was set on the command line and it is larger than
     // preferred_max_new_size.
     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
-      FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
+      FLAG_SET_ERGO(size_t, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
     } else {
-      FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
+      FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size);
     }
     if (PrintGCDetails && Verbose) {
       // Too early to use gclog_or_tty
@@ -1316,8 +1316,8 @@
       // Unless explicitly requested otherwise, make young gen
       // at least min_new, and at most preferred_max_new_size.
       if (FLAG_IS_DEFAULT(NewSize)) {
-        FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
-        FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
+        FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new));
+        FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize));
         if (PrintGCDetails && Verbose) {
           // Too early to use gclog_or_tty
           tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
@@ -1327,7 +1327,7 @@
       // so it's NewRatio x of NewSize.
       if (FLAG_IS_DEFAULT(OldSize)) {
         if (max_heap > NewSize) {
-          FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
+          FLAG_SET_ERGO(size_t, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
           if (PrintGCDetails && Verbose) {
             // Too early to use gclog_or_tty
             tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
@@ -1358,7 +1358,7 @@
       // OldPLAB sizing manually turned off: Use a larger default setting,
       // unless it was manually specified. This is because a too-low value
       // will slow down scavenges.
-      FLAG_SET_ERGO(uintx, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
+      FLAG_SET_ERGO(size_t, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
     } else {
       FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
     }
@@ -1560,7 +1560,7 @@
 
 void Arguments::select_gc() {
   if (!gc_selected()) {
-    ArgumentsExt::select_gc_ergonomically();
+    select_gc_ergonomically();
   }
 }
 
@@ -1738,7 +1738,7 @@
 }
 
 // Use static initialization to get the default before parsing
-static const uintx DefaultHeapBaseMinAddress = HeapBaseMinAddress;
+static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
 
 void Arguments::set_heap_size() {
   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
@@ -1778,14 +1778,14 @@
           // matches compressed oops printing flags
           if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
             jio_fprintf(defaultStream::error_stream(),
-                        "HeapBaseMinAddress must be at least " UINTX_FORMAT
-                        " (" UINTX_FORMAT "G) which is greater than value given "
-                        UINTX_FORMAT "\n",
+                        "HeapBaseMinAddress must be at least " SIZE_FORMAT
+                        " (" SIZE_FORMAT "G) which is greater than value given "
+                        SIZE_FORMAT "\n",
                         DefaultHeapBaseMinAddress,
                         DefaultHeapBaseMinAddress/G,
                         HeapBaseMinAddress);
           }
-          FLAG_SET_ERGO(uintx, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
+          FLAG_SET_ERGO(size_t, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
         }
       }
 
@@ -1810,7 +1810,7 @@
       // Cannot use gclog_or_tty yet.
       tty->print_cr("  Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
     }
-    FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max);
   }
 
   // If the minimum or initial heap_size have not been set or requested to be set
@@ -1832,14 +1832,14 @@
 
       if (PrintGCDetails && Verbose) {
         // Cannot use gclog_or_tty yet.
-        tty->print_cr("  Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial);
+        tty->print_cr("  Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
       }
-      FLAG_SET_ERGO(uintx, InitialHeapSize, (uintx)reasonable_initial);
+      FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial);
     }
     // If the minimum heap size has not been set (via -Xms),
     // synchronize with InitialHeapSize to avoid errors with the default value.
     if (min_heap_size() == 0) {
-      set_min_heap_size(MIN2((uintx)reasonable_minimum, InitialHeapSize));
+      set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize));
       if (PrintGCDetails && Verbose) {
         // Cannot use gclog_or_tty yet.
         tty->print_cr("  Minimum heap size " SIZE_FORMAT, min_heap_size());
@@ -1978,7 +1978,7 @@
   }
 
   if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
-    FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
+    FLAG_SET_CMDLINE(size_t, GCLogFileSize, 8*K);
     jio_fprintf(defaultStream::output_stream(),
                 "GCLogFileSize changed to minimum 8K\n");
   }
@@ -2062,7 +2062,7 @@
 }
 
 // Check consistency of GC selection
-bool Arguments::check_gc_consistency_user() {
+bool Arguments::check_gc_consistency() {
   check_gclog_consistency();
   // Ensure that the user has not selected conflicting sets
   // of collectors.
@@ -2206,7 +2206,7 @@
     FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
   }
 
-  status = status && check_gc_consistency_user();
+  status = status && check_gc_consistency();
   status = status && check_stack_pages();
 
   status = status && verify_percentage(CMSIncrementalSafetyFactor,
@@ -2335,7 +2335,7 @@
 
   status = status && verify_min_value(LogEventsBufferEntries, 1, "LogEventsBufferEntries");
 
-  status = status && verify_min_value(HeapSizePerGCThread, (uintx) os::vm_page_size(), "HeapSizePerGCThread");
+  status = status && verify_min_value(HeapSizePerGCThread, (size_t) os::vm_page_size(), "HeapSizePerGCThread");
 
   status = status && verify_min_value(GCTaskTimeStampEntries, 1, "GCTaskTimeStampEntries");
 
@@ -2750,8 +2750,8 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size);
-      FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size);
+      FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size);
+      FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size);
     // -Xms
     } else if (match_option(option, "-Xms", &tail)) {
       julong long_initial_heap_size = 0;
@@ -2763,10 +2763,10 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      set_min_heap_size((uintx)long_initial_heap_size);
+      set_min_heap_size((size_t)long_initial_heap_size);
       // Currently the minimum size and the initial heap sizes are the same.
       // Can be overridden with -XX:InitialHeapSize.
-      FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
+      FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size);
     // -Xmx
     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
       julong long_max_heap_size = 0;
@@ -2777,7 +2777,7 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
+      FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size);
     // Xmaxf
     } else if (match_option(option, "-Xmaxf", &tail)) {
       char* err;
@@ -2918,7 +2918,7 @@
       FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
       FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1);
       FLAG_SET_CMDLINE(bool, UseTLAB, false);
-      FLAG_SET_CMDLINE(uintx, NewSizeThreadIncrease, 16 * K);  // 20Kb per thread added to new generation
+      FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K);  // 20Kb per thread added to new generation
 
       // -Xinternalversion
     } else if (match_option(option, "-Xinternalversion")) {
@@ -3079,16 +3079,16 @@
       initHeapSize = limit_by_allocatable_memory(initHeapSize);
 
       if (FLAG_IS_DEFAULT(MaxHeapSize)) {
-         FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize);
-         FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize);
+         FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize);
+         FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize);
          // Currently the minimum size and the initial heap sizes are the same.
          set_min_heap_size(initHeapSize);
       }
       if (FLAG_IS_DEFAULT(NewSize)) {
          // Make the young generation 3/8ths of the total heap.
-         FLAG_SET_CMDLINE(uintx, NewSize,
+         FLAG_SET_CMDLINE(size_t, NewSize,
                                 ((julong)MaxHeapSize / (julong)8) * (julong)3);
-         FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize);
+         FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize);
       }
 
 #ifndef _ALLBSD_SOURCE  // UseLargePages is not yet supported on BSD.
@@ -3096,14 +3096,14 @@
 #endif
 
       // Increase some data structure sizes for efficiency
-      FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize);
+      FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize);
       FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
-      FLAG_SET_CMDLINE(uintx, TLABSize, 256*K);
+      FLAG_SET_CMDLINE(size_t, TLABSize, 256*K);
 
       // See the OldPLABSize comment below, but replace 'after promotion'
       // with 'after copying'.  YoungPLABSize is the size of the survivor
       // space per-gc-thread buffers.  The default is 4kw.
-      FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256*K);      // Note: this is in words
+      FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256*K);      // Note: this is in words
 
       // OldPLABSize is the size of the buffers in the old gen that
       // UseParallelGC uses to promote live data that doesn't fit in the
@@ -3118,7 +3118,7 @@
       // locality.  A minor effect may be that larger PLABs reduce the
       // number of PLAB allocation events during gc.  The value of 8kw
       // was arrived at by experimenting with specjbb.
-      FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K);  // Note: this is in words
+      FLAG_SET_CMDLINE(size_t, OldPLABSize, 8*K);  // Note: this is in words
 
       // Enable parallel GC and adaptive generation sizing
       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
@@ -3197,7 +3197,7 @@
       jio_fprintf(defaultStream::error_stream(),
         "Please use -XX:MarkStackSize in place of "
         "-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
-      FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size);
+      FLAG_SET_CMDLINE(size_t, MarkStackSize, stack_size);
     } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
       julong max_stack_size = 0;
       ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
@@ -3211,7 +3211,7 @@
       jio_fprintf(defaultStream::error_stream(),
          "Please use -XX:MarkStackSizeMax in place of "
          "-XX:CMSMarkStackSizeMax in the future\n");
-      FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size);
+      FLAG_SET_CMDLINE(size_t, MarkStackSizeMax, max_stack_size);
     } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
                match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
       uintx conc_threads = 0;
@@ -3234,7 +3234,7 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
+      FLAG_SET_CMDLINE(size_t, MaxDirectMemorySize, max_direct_memory_size);
 #if !INCLUDE_MANAGEMENT
     } else if (match_option(option, "-XX:+ManagementServer")) {
         jio_fprintf(defaultStream::error_stream(),
@@ -3841,7 +3841,7 @@
   set_shared_spaces_flags();
 
   // Check the GC selections again.
-  if (!ArgumentsExt::check_gc_consistency_ergo()) {
+  if (!check_gc_consistency()) {
     return JNI_EINVAL;
   }
 
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -477,8 +477,7 @@
   static bool verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio);
 
   // Check for consistency in the selection of the garbage collector.
-  static bool check_gc_consistency_user();        // Check user-selected gc
-  static inline bool check_gc_consistency_ergo(); // Check ergonomic-selected gc
+  static bool check_gc_consistency();        // Check user-selected gc
   static void check_deprecated_gc_flags();
   // Check consistency or otherwise of VM argument settings
   static bool check_vm_args_consistency();
@@ -531,8 +530,8 @@
   static bool has_profile()                 { return _has_profile; }
 
   // -Xms
-  static uintx min_heap_size()              { return _min_heap_size; }
-  static void  set_min_heap_size(uintx v)   { _min_heap_size = v;  }
+  static size_t min_heap_size()             { return _min_heap_size; }
+  static void  set_min_heap_size(size_t v)  { _min_heap_size = v;  }
 
   // Returns the original values of -XX:MinHeapFreeRatio and -XX:MaxHeapFreeRatio
   static uintx min_heap_free_ratio()        { return _min_heap_free_ratio; }
@@ -618,10 +617,6 @@
   return UseConcMarkSweepGC || UseG1GC || UseParallelGC || UseParallelOldGC || UseSerialGC;
 }
 
-bool Arguments::check_gc_consistency_ergo() {
-  return check_gc_consistency_user();
-}
-
 // Disable options not supported in this release, with a warning if they
 // were explicitly requested on the command-line
 #define UNSUPPORTED_OPTION(opt, description)                    \
--- a/hotspot/src/share/vm/runtime/arguments_ext.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/arguments_ext.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -30,9 +30,7 @@
 
 class ArgumentsExt: AllStatic {
 public:
-  static inline void select_gc_ergonomically();
   static inline void set_gc_specific_flags();
-  static inline bool check_gc_consistency_ergo();
   // The argument processing extension. Returns true if there is
   // no additional parsing needed in Arguments::parse() for the option.
   // Otherwise returns false.
@@ -40,16 +38,8 @@
   static inline void report_unsupported_options() { }
 };
 
-void ArgumentsExt::select_gc_ergonomically() {
-  Arguments::select_gc_ergonomically();
-}
-
 void ArgumentsExt::set_gc_specific_flags() {
   Arguments::set_gc_specific_flags();
 }
 
-bool ArgumentsExt::check_gc_consistency_ergo() {
-  return Arguments::check_gc_consistency_ergo();
-}
-
 #endif // SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
--- a/hotspot/src/share/vm/runtime/globals.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -193,19 +193,19 @@
 define_pd_global(intx, OnStackReplacePercentage,     0);
 define_pd_global(bool, ResizeTLAB,                   false);
 define_pd_global(intx, FreqInlineSize,               0);
-define_pd_global(intx, NewSizeThreadIncrease,        4*K);
+define_pd_global(size_t, NewSizeThreadIncrease,      4*K);
 define_pd_global(intx, InlineClassNatives,           true);
 define_pd_global(intx, InlineUnsafeOps,              true);
 define_pd_global(intx, InitialCodeCacheSize,         160*K);
 define_pd_global(intx, ReservedCodeCacheSize,        32*M);
 define_pd_global(intx, NonProfiledCodeHeapSize,      0);
 define_pd_global(intx, ProfiledCodeHeapSize,         0);
-define_pd_global(intx, NonNMethodCodeHeapSize,        32*M);
+define_pd_global(intx, NonNMethodCodeHeapSize,       32*M);
 
 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 define_pd_global(intx, CodeCacheMinBlockLength,      1);
 define_pd_global(intx, CodeCacheMinimumUseSpace,     200*K);
-define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(4*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(4*M));
 define_pd_global(bool, NeverActAsServerClassMachine, true);
 define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
 #define CI_COMPILER_COUNT 0
@@ -468,7 +468,7 @@
 // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version
 
 // A flag must be declared with one of the following types:
-// bool, intx, uintx, ccstr, double, or uint64_t.
+// bool, intx, uintx, size_t, ccstr, double, or uint64_t.
 // The type "ccstr" is an alias for "const char*" and is used
 // only in this file, because the macrology requires single-token type names.
 
@@ -540,7 +540,7 @@
   notproduct(bool, CheckCompressedOops, true,                               \
           "Generate checks in encoding/decoding code in debug VM")          \
                                                                             \
-  product_pd(uintx, HeapBaseMinAddress,                                     \
+  product_pd(size_t, HeapBaseMinAddress,                                    \
           "OS specific low limit for heap base address")                    \
                                                                             \
   product(uintx, HeapSearchSteps, 3 PPC64_ONLY(+17),                        \
@@ -606,7 +606,7 @@
   product(bool, UseNUMAInterleaving, false,                                 \
           "Interleave memory across NUMA nodes if available")               \
                                                                             \
-  product(uintx, NUMAInterleaveGranularity, 2*M,                            \
+  product(size_t, NUMAInterleaveGranularity, 2*M,                           \
           "Granularity to use for NUMA interleaving on Windows OS")         \
                                                                             \
   product(bool, ForceNUMA, false,                                           \
@@ -617,7 +617,7 @@
           "computing exponentially decaying average for "                   \
           "AdaptiveNUMAChunkSizing")                                        \
                                                                             \
-  product(uintx, NUMASpaceResizeRate, 1*G,                                  \
+  product(size_t, NUMASpaceResizeRate, 1*G,                                 \
           "Do not reallocate more than this amount per collection")         \
                                                                             \
   product(bool, UseAdaptiveNUMAChunkSizing, true,                           \
@@ -641,10 +641,10 @@
   product(bool, UseSHA, false,                                              \
           "Control whether SHA instructions can be used on SPARC")          \
                                                                             \
-  product(uintx, LargePageSizeInBytes, 0,                                   \
+  product(size_t, LargePageSizeInBytes, 0,                                  \
           "Large page size (0 to let VM choose the page size)")             \
                                                                             \
-  product(uintx, LargePageHeapSizeThreshold, 128*M,                         \
+  product(size_t, LargePageHeapSizeThreshold, 128*M,                        \
           "Use large pages if maximum heap is at least this big")           \
                                                                             \
   product(bool, ForceTimeHighResolution, false,                             \
@@ -966,11 +966,11 @@
           "directory) of the dump file (defaults to java_pid<pid>.hprof "   \
           "in the working directory)")                                      \
                                                                             \
-  develop(uintx, SegmentedHeapDumpThreshold, 2*G,                           \
+  develop(size_t, SegmentedHeapDumpThreshold, 2*G,                          \
           "Generate a segmented heap dump (JAVA PROFILE 1.0.2 format) "     \
           "when the heap usage is larger than this")                        \
                                                                             \
-  develop(uintx, HeapDumpSegmentSize, 1*G,                                  \
+  develop(size_t, HeapDumpSegmentSize, 1*G,                                 \
           "Approximate segment size when generating a segmented heap dump") \
                                                                             \
   develop(bool, BreakAtWarning, false,                                      \
@@ -1465,7 +1465,7 @@
           "Force dynamic selection of the number of "                       \
           "parallel threads parallel gc will use to aid debugging")         \
                                                                             \
-  product(uintx, HeapSizePerGCThread, ScaleForWordSize(64*M),               \
+  product(size_t, HeapSizePerGCThread, ScaleForWordSize(64*M),              \
           "Size of heap (bytes) per GC thread used in calculating the "     \
           "number of GC threads")                                           \
                                                                             \
@@ -1482,10 +1482,10 @@
   product(uintx, ConcGCThreads, 0,                                          \
           "Number of threads concurrent gc will use")                       \
                                                                             \
-  product(uintx, YoungPLABSize, 4096,                                       \
+  product(size_t, YoungPLABSize, 4096,                                      \
           "Size of young gen promotion LAB's (in HeapWords)")               \
                                                                             \
-  product(uintx, OldPLABSize, 1024,                                         \
+  product(size_t, OldPLABSize, 1024,                                        \
           "Size of old gen promotion LAB's (in HeapWords), or Number        \
           of blocks to attempt to claim when refilling CMS LAB's")          \
                                                                             \
@@ -1604,11 +1604,11 @@
   product(bool, PrintOldPLAB, false,                                        \
           "Print (old gen) promotion LAB's sizing decisions")               \
                                                                             \
-  product(uintx, CMSOldPLABMin, 16,                                         \
+  product(size_t, CMSOldPLABMin, 16,                                        \
           "Minimum size of CMS gen promotion LAB caches per worker "        \
           "per block size")                                                 \
                                                                             \
-  product(uintx, CMSOldPLABMax, 1024,                                       \
+  product(size_t, CMSOldPLABMax, 1024,                                      \
           "Maximum size of CMS gen promotion LAB caches per worker "        \
           "per block size")                                                 \
                                                                             \
@@ -1631,7 +1631,7 @@
   product(bool, AlwaysPreTouch, false,                                      \
           "Force all freshly committed pages to be pre-touched")            \
                                                                             \
-  product_pd(uintx, CMSYoungGenPerWorker,                                   \
+  product_pd(size_t, CMSYoungGenPerWorker,                                  \
           "The maximum size of young gen chosen by default per GC worker "  \
           "thread available")                                               \
                                                                             \
@@ -1723,10 +1723,10 @@
   develop(bool, CMSOverflowEarlyRestoration, false,                         \
           "Restore preserved marks early")                                  \
                                                                             \
-  product(uintx, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M),              \
+  product(size_t, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M),             \
           "Size of marking stack")                                          \
                                                                             \
-  product(uintx, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M),          \
+  product(size_t, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M),         \
           "Maximum size of marking stack")                                  \
                                                                             \
   notproduct(bool, CMSMarkStackOverflowALot, false,                         \
@@ -1749,10 +1749,10 @@
           "Time that we sleep between iterations when not given "           \
           "enough work per iteration")                                      \
                                                                             \
-  product(uintx, CMSRescanMultiple, 32,                                     \
+  product(size_t, CMSRescanMultiple, 32,                                    \
           "Size (in cards) of CMS parallel rescan task")                    \
                                                                             \
-  product(uintx, CMSConcMarkMultiple, 32,                                   \
+  product(size_t, CMSConcMarkMultiple, 32,                                  \
           "Size (in cards) of CMS concurrent MT marking task")              \
                                                                             \
   product(bool, CMSAbortSemantics, false,                                   \
@@ -1819,7 +1819,7 @@
   product(uintx, CMSRemarkVerifyVariant, 1,                                 \
           "Choose variant (1,2) of verification following remark")          \
                                                                             \
-  product(uintx, CMSScheduleRemarkEdenSizeThreshold, 2*M,                   \
+  product(size_t, CMSScheduleRemarkEdenSizeThreshold, 2*M,                  \
           "If Eden size is below this, do not try to schedule remark")      \
                                                                             \
   product(uintx, CMSScheduleRemarkEdenPenetration, 50,                      \
@@ -1853,7 +1853,7 @@
   product(bool, CMSYield, true,                                             \
           "Yield between steps of CMS")                                     \
                                                                             \
-  product(uintx, CMSBitMapYieldQuantum, 10*M,                               \
+  product(size_t, CMSBitMapYieldQuantum, 10*M,                              \
           "Bitmap operations should process at most this many bits "        \
           "between yields")                                                 \
                                                                             \
@@ -2033,7 +2033,7 @@
   product_pd(uint64_t, MaxRAM,                                              \
           "Real memory size (in bytes) used to set maximum heap size")      \
                                                                             \
-  product(uintx, ErgoHeapSizeLimit, 0,                                      \
+  product(size_t, ErgoHeapSizeLimit, 0,                                     \
           "Maximum ergonomically set heap size (in bytes); zero means use " \
           "MaxRAM / MaxRAMFraction")                                        \
                                                                             \
@@ -2176,7 +2176,7 @@
   product(uintx, InitialSurvivorRatio, 8,                                   \
           "Initial ratio of young generation/survivor space size")          \
                                                                             \
-  product(uintx, BaseFootPrintEstimate, 256*M,                              \
+  product(size_t, BaseFootPrintEstimate, 256*M,                             \
           "Estimate of footprint other than Java Heap")                     \
                                                                             \
   product(bool, UseGCOverheadLimit, true,                                   \
@@ -2327,7 +2327,7 @@
   develop(bool, TraceClassLoaderData, false,                                \
           "Trace class loader loader_data lifetime")                        \
                                                                             \
-  product(uintx, InitialBootClassLoaderMetaspaceSize,                       \
+  product(size_t, InitialBootClassLoaderMetaspaceSize,                      \
           NOT_LP64(2200*K) LP64_ONLY(4*M),                                  \
           "Initial size of the boot class loader data metaspace")           \
                                                                             \
@@ -2417,7 +2417,7 @@
           "Number of gclog files in rotation "                              \
           "(default: 0, no rotation)")                                      \
                                                                             \
-  product(uintx, GCLogFileSize, 8*K,                                        \
+  product(size_t, GCLogFileSize, 8*K,                                       \
           "GC log file size, requires UseGCLogFileRotation. "               \
           "Set to 0 to only trigger rotation via jcmd")                     \
                                                                             \
@@ -2955,11 +2955,11 @@
   notproduct(ccstrlist, SuppressErrorAt, "",                                \
           "List of assertions (file:line) to muzzle")                       \
                                                                             \
-  notproduct(uintx, HandleAllocationLimit, 1024,                            \
+  notproduct(size_t, HandleAllocationLimit, 1024,                           \
           "Threshold for HandleMark allocation when +TraceHandleAllocation "\
           "is used")                                                        \
                                                                             \
-  develop(uintx, TotalHandleAllocationLimit, 1024,                          \
+  develop(size_t, TotalHandleAllocationLimit, 1024,                         \
           "Threshold for total handle allocation when "                     \
           "+TraceHandleAllocation is used")                                 \
                                                                             \
@@ -3103,30 +3103,30 @@
           "Number of times to spin wait before inflation")                  \
                                                                             \
   /* gc parameters */                                                       \
-  product(uintx, InitialHeapSize, 0,                                        \
+  product(size_t, InitialHeapSize, 0,                                       \
           "Initial heap size (in bytes); zero means use ergonomics")        \
                                                                             \
-  product(uintx, MaxHeapSize, ScaleForWordSize(96*M),                       \
+  product(size_t, MaxHeapSize, ScaleForWordSize(96*M),                      \
           "Maximum heap size (in bytes)")                                   \
                                                                             \
-  product(uintx, OldSize, ScaleForWordSize(4*M),                            \
+  product(size_t, OldSize, ScaleForWordSize(4*M),                           \
           "Initial tenured generation size (in bytes)")                     \
                                                                             \
-  product(uintx, NewSize, ScaleForWordSize(1*M),                            \
+  product(size_t, NewSize, ScaleForWordSize(1*M),                           \
           "Initial new generation size (in bytes)")                         \
                                                                             \
-  product(uintx, MaxNewSize, max_uintx,                                     \
+  product(size_t, MaxNewSize, max_uintx,                                    \
           "Maximum new generation size (in bytes), max_uintx means set "    \
           "ergonomically")                                                  \
                                                                             \
-  product(uintx, PretenureSizeThreshold, 0,                                 \
+  product(size_t, PretenureSizeThreshold, 0,                                \
           "Maximum size in bytes of objects allocated in DefNew "           \
           "generation; zero means no maximum")                              \
                                                                             \
-  product(uintx, TLABSize, 0,                                               \
+  product(size_t, TLABSize, 0,                                              \
           "Starting TLAB size (in bytes); zero means set ergonomically")    \
                                                                             \
-  product(uintx, MinTLABSize, 2*K,                                          \
+  product(size_t, MinTLABSize, 2*K,                                         \
           "Minimum allowed TLAB size (in bytes)")                           \
                                                                             \
   product(uintx, TLABAllocationWeight, 35,                                  \
@@ -3147,17 +3147,17 @@
   product(uintx, NewRatio, 2,                                               \
           "Ratio of old/new generation sizes")                              \
                                                                             \
-  product_pd(uintx, NewSizeThreadIncrease,                                  \
+  product_pd(size_t, NewSizeThreadIncrease,                                 \
           "Additional size added to desired new generation size per "       \
           "non-daemon thread (in bytes)")                                   \
                                                                             \
-  product_pd(uintx, MetaspaceSize,                                          \
+  product_pd(size_t, MetaspaceSize,                                         \
           "Initial size of Metaspaces (in bytes)")                          \
                                                                             \
-  product(uintx, MaxMetaspaceSize, max_uintx,                               \
+  product(size_t, MaxMetaspaceSize, max_uintx,                              \
           "Maximum size of Metaspaces (in bytes)")                          \
                                                                             \
-  product(uintx, CompressedClassSpaceSize, 1*G,                             \
+  product(size_t, CompressedClassSpaceSize, 1*G,                            \
           "Maximum size of class area in Metaspace when compressed "        \
           "class pointers are used")                                        \
                                                                             \
@@ -3174,10 +3174,10 @@
   product(intx, SoftRefLRUPolicyMSPerMB, 1000,                              \
           "Number of milliseconds per MB of free space in the heap")        \
                                                                             \
-  product(uintx, MinHeapDeltaBytes, ScaleForWordSize(128*K),                \
+  product(size_t, MinHeapDeltaBytes, ScaleForWordSize(128*K),               \
           "The minimum change in heap space due to GC (in bytes)")          \
                                                                             \
-  product(uintx, MinMetaspaceExpansion, ScaleForWordSize(256*K),            \
+  product(size_t, MinMetaspaceExpansion, ScaleForWordSize(256*K),           \
           "The minimum expansion of Metaspace (in bytes)")                  \
                                                                             \
   product(uintx, MinMetaspaceFreeRatio,    40,                              \
@@ -3188,7 +3188,7 @@
           "The maximum percentage of Metaspace free after GC to avoid "     \
           "shrinking")                                                      \
                                                                             \
-  product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M),              \
+  product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M),             \
           "The maximum expansion of Metaspace without full GC (in bytes)")  \
                                                                             \
   product(uintx, QueuedAllocationWarningCount, 0,                           \
@@ -3279,10 +3279,10 @@
   product_pd(intx, CompilerThreadStackSize,                                 \
           "Compiler Thread Stack Size (in Kbytes)")                         \
                                                                             \
-  develop_pd(uintx, JVMInvokeMethodSlack,                                   \
+  develop_pd(size_t, JVMInvokeMethodSlack,                                  \
           "Stack space (bytes) required for JVM_InvokeMethod to complete")  \
                                                                             \
-  product(uintx, ThreadSafetyMargin, 50*M,                                  \
+  product(size_t, ThreadSafetyMargin, 50*M,                                 \
           "Thread safety margin is used on fixed-stack LinuxThreads (on "   \
           "Linux/x86 only) to prevent heap-stack collision. Set to 0 to "   \
           "disable this feature")                                           \
@@ -3670,7 +3670,7 @@
                                                                             \
   /* Properties for Java libraries  */                                      \
                                                                             \
-  product(uintx, MaxDirectMemorySize, 0,                                    \
+  product(size_t, MaxDirectMemorySize, 0,                                   \
           "Maximum total size of NIO direct-buffer allocations")            \
                                                                             \
   /* Flags used for temporary code during development  */                   \
@@ -3774,10 +3774,10 @@
           "If PrintSharedArchiveAndExit is true, also print the shared "    \
           "dictionary")                                                     \
                                                                             \
-  product(uintx, SharedReadWriteSize,  NOT_LP64(12*M) LP64_ONLY(16*M),      \
+  product(size_t, SharedReadWriteSize,  NOT_LP64(12*M) LP64_ONLY(16*M),     \
           "Size of read-write space for metadata (in bytes)")               \
                                                                             \
-  product(uintx, SharedReadOnlySize,  NOT_LP64(12*M) LP64_ONLY(16*M),       \
+  product(size_t, SharedReadOnlySize,  NOT_LP64(12*M) LP64_ONLY(16*M),      \
           "Size of read-only space for metadata (in bytes)")                \
                                                                             \
   product(uintx, SharedMiscDataSize,    NOT_LP64(2*M) LP64_ONLY(4*M),       \
--- a/hotspot/src/share/vm/runtime/handles.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/handles.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -83,7 +83,7 @@
   }
 
   // The thread local handle areas should not get very large
-  if (TraceHandleAllocation && handles_visited > TotalHandleAllocationLimit) {
+  if (TraceHandleAllocation && (size_t)handles_visited > TotalHandleAllocationLimit) {
 #ifdef ASSERT
     warning("%d: Visited in HandleMark : %d",
       _nof_handlemarks, handles_visited);
--- a/hotspot/src/share/vm/runtime/thread.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -87,8 +87,9 @@
 #include "utilities/defaultStream.hpp"
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
-#include "utilities/macros.hpp"
+#include "utilities/workgroup.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -536,7 +536,7 @@
   nonstatic_field(ContiguousSpace,             _concurrent_iteration_safe_limit,              HeapWord*)                             \
   nonstatic_field(ContiguousSpace,             _saved_mark_word,                              HeapWord*)                             \
                                                                                                                                      \
-  nonstatic_field(DefNewGeneration,            _next_gen,                                     Generation*)                           \
+  nonstatic_field(DefNewGeneration,            _old_gen,                                      Generation*)                           \
   nonstatic_field(DefNewGeneration,            _tenuring_threshold,                           uint)                                  \
   nonstatic_field(DefNewGeneration,            _age_table,                                    ageTable)                              \
   nonstatic_field(DefNewGeneration,            _eden_space,                                   ContiguousSpace*)                      \
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -1721,7 +1721,7 @@
   // Write the file header - use 1.0.2 for large heaps, otherwise 1.0.1
   size_t used = ch->used();
   const char* header;
-  if (used > (size_t)SegmentedHeapDumpThreshold) {
+  if (used > SegmentedHeapDumpThreshold) {
     set_segmented_dump();
     header = "JAVA PROFILE 1.0.2";
   } else {
--- a/hotspot/src/share/vm/services/lowMemoryDetector.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/services/lowMemoryDetector.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -28,6 +28,7 @@
 #include "memory/allocation.hpp"
 #include "services/memoryPool.hpp"
 #include "services/memoryService.hpp"
+#include "services/memoryUsage.hpp"
 
 // Low Memory Detection Support
 // Two memory alarms in the JDK (we called them sensors).
--- a/hotspot/src/share/vm/services/memoryPool.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/services/memoryPool.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -25,7 +25,9 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "memory/defNewGeneration.hpp"
 #include "memory/metaspace.hpp"
+#include "memory/space.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
@@ -34,8 +36,11 @@
 #include "services/management.hpp"
 #include "services/memoryManager.hpp"
 #include "services/memoryPool.hpp"
+#include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
-#include "utilities/globalDefinitions.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#endif
 
 MemoryPool::MemoryPool(const char* name,
                        PoolType type,
@@ -187,6 +192,10 @@
                       support_usage_threshold), _space(space) {
 }
 
+size_t ContiguousSpacePool::used_in_bytes() {
+  return space()->used();
+}
+
 MemoryUsage ContiguousSpacePool::get_memory_usage() {
   size_t maxSize   = (available_for_allocation() ? max_size() : 0);
   size_t used      = used_in_bytes();
@@ -204,6 +213,14 @@
                       support_usage_threshold), _gen(gen) {
 }
 
+size_t SurvivorContiguousSpacePool::used_in_bytes() {
+  return _gen->from()->used();
+}
+
+size_t SurvivorContiguousSpacePool::committed_in_bytes() {
+  return _gen->from()->capacity();
+}
+
 MemoryUsage SurvivorContiguousSpacePool::get_memory_usage() {
   size_t maxSize = (available_for_allocation() ? max_size() : 0);
   size_t used    = used_in_bytes();
@@ -222,6 +239,10 @@
                       support_usage_threshold), _space(space) {
 }
 
+size_t CompactibleFreeListSpacePool::used_in_bytes() {
+  return _space->used();
+}
+
 MemoryUsage CompactibleFreeListSpacePool::get_memory_usage() {
   size_t maxSize   = (available_for_allocation() ? max_size() : 0);
   size_t used      = used_in_bytes();
@@ -239,6 +260,10 @@
                       support_usage_threshold), _gen(gen) {
 }
 
+size_t GenerationPool::used_in_bytes() {
+  return _gen->used();
+}
+
 MemoryUsage GenerationPool::get_memory_usage() {
   size_t used      = used_in_bytes();
   size_t committed = _gen->capacity();
--- a/hotspot/src/share/vm/services/memoryPool.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/services/memoryPool.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -25,15 +25,9 @@
 #ifndef SHARE_VM_SERVICES_MEMORYPOOL_HPP
 #define SHARE_VM_SERVICES_MEMORYPOOL_HPP
 
-#include "gc_implementation/shared/mutableSpace.hpp"
-#include "memory/defNewGeneration.hpp"
 #include "memory/heap.hpp"
-#include "memory/space.hpp"
 #include "services/memoryUsage.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
-#endif // INCLUDE_ALL_GCS
 
 // A memory pool represents the memory area that the VM manages.
 // The Java virtual machine has at least one memory pool
@@ -43,6 +37,8 @@
 // both heap and non-heap memory.
 
 // Forward declaration
+class CompactibleFreeListSpace;
+class ContiguousSpace;
 class MemoryManager;
 class SensorInfo;
 class Generation;
@@ -162,7 +158,7 @@
 
   ContiguousSpace* space()              { return _space; }
   MemoryUsage get_memory_usage();
-  size_t used_in_bytes()                { return space()->used(); }
+  size_t used_in_bytes();
 };
 
 class SurvivorContiguousSpacePool : public CollectedMemoryPool {
@@ -178,12 +174,8 @@
 
   MemoryUsage get_memory_usage();
 
-  size_t used_in_bytes() {
-    return _gen->from()->used();
-  }
-  size_t committed_in_bytes() {
-    return _gen->from()->capacity();
-  }
+  size_t used_in_bytes();
+  size_t committed_in_bytes();
 };
 
 #if INCLUDE_ALL_GCS
@@ -198,7 +190,7 @@
                                bool support_usage_threshold);
 
   MemoryUsage get_memory_usage();
-  size_t used_in_bytes()            { return _space->used(); }
+  size_t used_in_bytes();
 };
 #endif // INCLUDE_ALL_GCS
 
@@ -210,7 +202,7 @@
   GenerationPool(Generation* gen, const char* name, PoolType type, bool support_usage_threshold);
 
   MemoryUsage get_memory_usage();
-  size_t used_in_bytes()                { return _gen->used(); }
+  size_t used_in_bytes();
 };
 
 class CodeHeapPool: public MemoryPool {
--- a/hotspot/src/share/vm/services/memoryService.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/services/memoryService.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -160,8 +160,8 @@
   _managers_list->append(_minor_gc_manager);
   _managers_list->append(_major_gc_manager);
 
-  add_generation_memory_pool(heap->get_gen(minor), _major_gc_manager, _minor_gc_manager);
-  add_generation_memory_pool(heap->get_gen(major), _major_gc_manager);
+  add_generation_memory_pool(heap->young_gen(), _major_gc_manager, _minor_gc_manager);
+  add_generation_memory_pool(heap->old_gen(), _major_gc_manager);
 }
 
 #if INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/services/memoryService.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/services/memoryService.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -57,13 +57,6 @@
     init_code_heap_pools_size = 9
   };
 
-  // index for minor and major generations
-  enum {
-    minor = 0,
-    major = 1,
-    n_gens = 2
-  };
-
   static GrowableArray<MemoryPool*>*    _pools_list;
   static GrowableArray<MemoryManager*>* _managers_list;
 
--- a/hotspot/src/share/vm/utilities/debug.cpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Sun Mar 29 09:20:27 2015 -0400
@@ -273,7 +273,7 @@
 }
 
 void report_insufficient_metaspace(size_t required_size) {
-  warning("\nThe MaxMetaspaceSize of " UINTX_FORMAT " bytes is not large enough.\n"
+  warning("\nThe MaxMetaspaceSize of " SIZE_FORMAT " bytes is not large enough.\n"
           "Either don't specify the -XX:MaxMetaspaceSize=<size>\n"
           "or increase the size to at least " SIZE_FORMAT ".\n",
           MaxMetaspaceSize, required_size);
--- a/hotspot/src/share/vm/utilities/debug.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/utilities/debug.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -222,9 +222,8 @@
 template<bool x> struct STATIC_ASSERT_FAILURE;
 template<> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; };
 
-#define STATIC_ASSERT(Cond)                             \
-  typedef char STATIC_ASSERT_FAILURE_ ## __LINE__ [     \
-    STATIC_ASSERT_FAILURE< (Cond) >::value ]
+#define STATIC_ASSERT(Cond) \
+  typedef char STATIC_ASSERT_DUMMY_TYPE[ STATIC_ASSERT_FAILURE< (Cond) >::value ]
 
 // out of shared space reporting
 enum SharedSpaceType {
--- a/hotspot/src/share/vm/utilities/ostream.hpp	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/src/share/vm/utilities/ostream.hpp	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -250,7 +250,7 @@
   /* If "force" sets true, force log file rotation from outside JVM */
   bool should_rotate(bool force) {
     return force ||
-             ((GCLogFileSize != 0) && ((uintx)_bytes_written >= GCLogFileSize));
+             ((GCLogFileSize != 0) && (_bytes_written >= (jlong)GCLogFileSize));
   }
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/gc/TestDisableExplicitGC.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 TestDisableExplicitGC
+ * @requires vm.opt.DisableExplicitGC == null
+ * @summary Verify GC behavior with DisableExplicitGC flag.
+ * @library /testlibrary
+ * @run main/othervm                             -XX:+PrintGCDetails TestDisableExplicitGC
+ * @run main/othervm/fail -XX:+DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC
+ * @run main/othervm      -XX:-DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC
+ */
+import java.lang.management.GarbageCollectorMXBean;
+import java.util.List;
+import static com.oracle.java.testlibrary.Asserts.*;
+
+public class TestDisableExplicitGC {
+
+    public static void main(String[] args) throws InterruptedException {
+        List<GarbageCollectorMXBean> list = java.lang.management.ManagementFactory.getGarbageCollectorMXBeans();
+        long collectionCountBefore = getCollectionCount(list);
+        System.gc();
+        long collectionCountAfter = getCollectionCount(list);
+        assertLT(collectionCountBefore, collectionCountAfter);
+    }
+
+    private static long getCollectionCount(List<GarbageCollectorMXBean> list) {
+        int collectionCount = 0;
+        for (GarbageCollectorMXBean gcMXBean : list) {
+            collectionCount += gcMXBean.getCollectionCount();
+        }
+        return collectionCount;
+    }
+}
--- a/hotspot/test/gc/g1/TestGCLogMessages.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestGCLogMessages.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,7 +23,7 @@
 
 /*
  * @test TestGCLogMessages
- * @bug 8035406 8027295 8035398 8019342 8027959 8048179
+ * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962
  * @summary Ensure that the PrintGCDetails output for a minor GC with G1
  * includes the expected necessary messages.
  * @key gc
@@ -34,131 +34,159 @@
 import com.oracle.java.testlibrary.OutputAnalyzer;
 
 public class TestGCLogMessages {
-  public static void main(String[] args) throws Exception {
-    testNormalLogs();
-    testWithToSpaceExhaustionLogs();
-  }
 
-  private static void testNormalLogs() throws Exception {
-
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                                              "-Xmx10M",
-                                                              GCTest.class.getName());
+    private enum Level {
+        OFF, FINER, FINEST;
+        public boolean lessOrEqualTo(Level other) {
+            return this.compareTo(other) < 0;
+        }
+    }
 
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+    private class LogMessageWithLevel {
+        String message;
+        Level level;
 
-    output.shouldNotContain("[Redirty Cards");
-    output.shouldNotContain("[Parallel Redirty");
-    output.shouldNotContain("[Redirtied Cards");
-    output.shouldNotContain("[Code Root Purge");
-    output.shouldNotContain("[String Dedup Fixup");
-    output.shouldNotContain("[Young Free CSet");
-    output.shouldNotContain("[Non-Young Free CSet");
-    output.shouldNotContain("[Humongous Register");
-    output.shouldNotContain("[Humongous Reclaim");
-    output.shouldHaveExitValue(0);
+        public LogMessageWithLevel(String message, Level level) {
+            this.message = message;
+            this.level = level;
+        }
+    };
 
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-XX:+UseStringDeduplication",
-                                               "-Xmx10M",
-                                               "-XX:+PrintGCDetails",
-                                               GCTest.class.getName());
-
-    output = new OutputAnalyzer(pb.start());
+    private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
+        // Ext Root Scan
+        new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("StringTable Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("Universe Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("JNI Handles Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("ObjectSynchronizer Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("FlatProfiler Roots", Level.FINEST),
+        new LogMessageWithLevel("Management Roots", Level.FINEST),
+        new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST),
+        new LogMessageWithLevel("CLDG Roots", Level.FINEST),
+        new LogMessageWithLevel("JVMTI Roots", Level.FINEST),
+        new LogMessageWithLevel("CodeCache Roots", Level.FINEST),
+        new LogMessageWithLevel("SATB Filtering", Level.FINEST),
+        new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST),
+        new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST),
+        new LogMessageWithLevel("Weak CLD Roots", Level.FINEST),
+        // Redirty Cards
+        new LogMessageWithLevel("Redirty Cards", Level.FINER),
+        new LogMessageWithLevel("Parallel Redirty", Level.FINEST),
+        new LogMessageWithLevel("Redirtied Cards", Level.FINEST),
+        // Misc Top-level
+        new LogMessageWithLevel("Code Root Purge", Level.FINER),
+        new LogMessageWithLevel("String Dedup Fixup", Level.FINER),
+        // Free CSet
+        new LogMessageWithLevel("Young Free CSet", Level.FINEST),
+        new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST),
+        // Humongous Eager Reclaim
+        new LogMessageWithLevel("Humongous Reclaim", Level.FINER),
+        new LogMessageWithLevel("Humongous Register", Level.FINER),
+    };
 
-    output.shouldContain("[Redirty Cards");
-    output.shouldNotContain("[Parallel Redirty");
-    output.shouldNotContain("[Redirtied Cards");
-    output.shouldContain("[Code Root Purge");
-    output.shouldContain("[String Dedup Fixup");
-    output.shouldNotContain("[Young Free CSet");
-    output.shouldNotContain("[Non-Young Free CSet");
-    output.shouldContain("[Humongous Register");
-    output.shouldNotContain("[Humongous Total");
-    output.shouldNotContain("[Humongous Candidate");
-    output.shouldContain("[Humongous Reclaim");
-    output.shouldNotContain("[Humongous Reclaimed");
-    output.shouldHaveExitValue(0);
+    void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
+        for (LogMessageWithLevel l : messages) {
+            if (level.lessOrEqualTo(l.level)) {
+                output.shouldNotContain(l.message);
+            } else {
+                output.shouldContain(l.message);
+            }
+        }
+    }
 
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-XX:+UseStringDeduplication",
-                                               "-Xmx10M",
-                                               "-XX:+PrintGCDetails",
-                                               "-XX:+UnlockExperimentalVMOptions",
-                                               "-XX:G1LogLevel=finest",
-                                               GCTest.class.getName());
+    public static void main(String[] args) throws Exception {
+        new TestGCLogMessages().testNormalLogs();
+        new TestGCLogMessages().testWithToSpaceExhaustionLogs();
+    }
+
+    private void testNormalLogs() throws Exception {
 
-    output = new OutputAnalyzer(pb.start());
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                                  "-Xmx10M",
+                                                                  GCTest.class.getName());
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, allLogMessages, Level.OFF);
+        output.shouldHaveExitValue(0);
 
-    output.shouldContain("[Redirty Cards");
-    output.shouldContain("[Parallel Redirty");
-    output.shouldContain("[Redirtied Cards");
-    output.shouldContain("[Code Root Purge");
-    output.shouldContain("[String Dedup Fixup");
-    output.shouldContain("[Young Free CSet");
-    output.shouldContain("[Non-Young Free CSet");
-    output.shouldContain("[Humongous Register");
-    output.shouldContain("[Humongous Total");
-    output.shouldContain("[Humongous Candidate");
-    output.shouldContain("[Humongous Reclaim");
-    output.shouldContain("[Humongous Reclaimed");
-    output.shouldHaveExitValue(0);
-  }
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                   "-XX:+UseStringDeduplication",
+                                                   "-Xmx10M",
+                                                   "-XX:+PrintGCDetails",
+                                                   GCTest.class.getName());
+
+        output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, allLogMessages, Level.FINER);
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                   "-XX:+UseStringDeduplication",
+                                                   "-Xmx10M",
+                                                   "-XX:+PrintGCDetails",
+                                                   "-XX:+UnlockExperimentalVMOptions",
+                                                   "-XX:G1LogLevel=finest",
+                                                   GCTest.class.getName());
 
-  private static void testWithToSpaceExhaustionLogs() throws Exception {
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-Xmx32M",
-                                               "-Xmn16M",
-                                               "-XX:+PrintGCDetails",
-                                               GCTestWithToSpaceExhaustion.class.getName());
+        output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, allLogMessages, Level.FINEST);
+        output.shouldHaveExitValue(0);
+    }
 
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("[Evacuation Failure");
-    output.shouldNotContain("[Recalculate Used");
-    output.shouldNotContain("[Remove Self Forwards");
-    output.shouldNotContain("[Restore RemSet");
-    output.shouldHaveExitValue(0);
+    LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] {
+        new LogMessageWithLevel("Evacuation Failure", Level.FINER),
+        new LogMessageWithLevel("Recalculate Used", Level.FINEST),
+        new LogMessageWithLevel("Remove Self Forwards", Level.FINEST),
+        new LogMessageWithLevel("Restore RemSet", Level.FINEST),
+    };
+
+    private void testWithToSpaceExhaustionLogs() throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                                  "-Xmx32M",
+                                                                  "-Xmn16M",
+                                                                  "-XX:+PrintGCDetails",
+                                                                  GCTestWithToSpaceExhaustion.class.getName());
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, exhFailureMessages, Level.FINER);
+        output.shouldHaveExitValue(0);
 
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-Xmx32M",
-                                               "-Xmn16M",
-                                               "-XX:+PrintGCDetails",
-                                               "-XX:+UnlockExperimentalVMOptions",
-                                               "-XX:G1LogLevel=finest",
-                                               GCTestWithToSpaceExhaustion.class.getName());
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                   "-Xmx32M",
+                                                   "-Xmn16M",
+                                                   "-XX:+PrintGCDetails",
+                                                   "-XX:+UnlockExperimentalVMOptions",
+                                                   "-XX:G1LogLevel=finest",
+                                                   GCTestWithToSpaceExhaustion.class.getName());
 
-    output = new OutputAnalyzer(pb.start());
-    output.shouldContain("[Evacuation Failure");
-    output.shouldContain("[Recalculate Used");
-    output.shouldContain("[Remove Self Forwards");
-    output.shouldContain("[Restore RemSet");
-    output.shouldHaveExitValue(0);
-  }
+        output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, exhFailureMessages, Level.FINEST);
+        output.shouldHaveExitValue(0);
+    }
 
-  static class GCTest {
-    private static byte[] garbage;
-    public static void main(String [] args) {
-      System.out.println("Creating garbage");
-      // create 128MB of garbage. This should result in at least one GC
-      for (int i = 0; i < 1024; i++) {
-        garbage = new byte[128 * 1024];
-      }
-      System.out.println("Done");
+    static class GCTest {
+        private static byte[] garbage;
+        public static void main(String [] args) {
+            System.out.println("Creating garbage");
+            // create 128MB of garbage. This should result in at least one GC
+            for (int i = 0; i < 1024; i++) {
+                garbage = new byte[128 * 1024];
+            }
+            System.out.println("Done");
+        }
     }
-  }
 
-  static class GCTestWithToSpaceExhaustion {
-    private static byte[] garbage;
-    private static byte[] largeObject;
-    public static void main(String [] args) {
-      largeObject = new byte[16*1024*1024];
-      System.out.println("Creating garbage");
-      // create 128MB of garbage. This should result in at least one GC,
-      // some of them with to-space exhaustion.
-      for (int i = 0; i < 1024; i++) {
-        garbage = new byte[128 * 1024];
-      }
-      System.out.println("Done");
+    static class GCTestWithToSpaceExhaustion {
+        private static byte[] garbage;
+        private static byte[] largeObject;
+        public static void main(String [] args) {
+            largeObject = new byte[16*1024*1024];
+            System.out.println("Creating garbage");
+            // create 128MB of garbage. This should result in at least one GC,
+            // some of them with to-space exhaustion.
+            for (int i = 0; i < 1024; i++) {
+                garbage = new byte[128 * 1024];
+            }
+            System.out.println("Done");
+        }
     }
-  }
 }
+
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -21,7 +21,7 @@
  * questions.
  */
 
-import static com.oracle.java.testlibrary.Asserts.assertLessThanOrEqual;
+import com.oracle.java.testlibrary.Asserts;
 import com.oracle.java.testlibrary.OutputAnalyzer;
 import com.oracle.java.testlibrary.Platform;
 import com.oracle.java.testlibrary.ProcessTools;
@@ -36,23 +36,29 @@
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
-import sun.misc.Unsafe;
+import sun.misc.Unsafe; // for ADDRESS_SIZE
+import sun.hotspot.WhiteBox;
 
 public class TestShrinkAuxiliaryData {
 
+    private static final int REGION_SIZE = 1024 * 1024;
+
     private final static String[] initialOpts = new String[]{
         "-XX:MinHeapFreeRatio=10",
         "-XX:MaxHeapFreeRatio=11",
         "-XX:+UseG1GC",
-        "-XX:G1HeapRegionSize=1m",
+        "-XX:G1HeapRegionSize=" + REGION_SIZE,
         "-XX:-ExplicitGCInvokesConcurrent",
-        "-XX:+PrintGCDetails"
+        "-XX:+PrintGCDetails",
+        "-XX:+UnlockDiagnosticVMOptions",
+        "-XX:+WhiteBoxAPI",
+        "-Xbootclasspath/a:.",
     };
 
-    private final int RSetCacheSize;
+    private final int hotCardTableSize;
 
-    protected TestShrinkAuxiliaryData(int RSetCacheSize) {
-        this.RSetCacheSize = RSetCacheSize;
+    protected TestShrinkAuxiliaryData(int hotCardTableSize) {
+        this.hotCardTableSize = hotCardTableSize;
     }
 
     protected void test() throws Exception {
@@ -60,16 +66,16 @@
         Collections.addAll(vmOpts, initialOpts);
 
         int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
-        if (maxCacheSize < RSetCacheSize) {
+        if (maxCacheSize < hotCardTableSize) {
             System.out.format("Skiping test for %d cache size due max cache size %d",
-                    RSetCacheSize, maxCacheSize
+                    hotCardTableSize, maxCacheSize
             );
             return;
         }
 
         printTestInfo(maxCacheSize);
 
-        vmOpts.add("-XX:G1ConcRSLogCacheSize=" + RSetCacheSize);
+        vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
         vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));
 
         // for 32 bits ObjectAlignmentInBytes is not a option
@@ -92,11 +98,13 @@
 
     private void performTest(List<String> opts) throws Exception {
         ProcessBuilder pb
-                       = ProcessTools.createJavaProcessBuilder(
-                opts.toArray(new String[opts.size()])
-        );
+                = ProcessTools.createJavaProcessBuilder(
+                        opts.toArray(new String[opts.size()])
+                );
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        System.out.println(output.getStdout());
+        System.err.println(output.getStderr());
         output.shouldHaveExitValue(0);
     }
 
@@ -107,12 +115,13 @@
         formatSymbols.setGroupingSeparator(' ');
         grouped.setDecimalFormatSymbols(formatSymbols);
 
-        System.out.format("Test will use %s bytes of memory of %s available%n"
+        System.out.format(
+                "Test will use %s bytes of memory of %s available%n"
                 + "Available memory is %s with %d bytes pointer size - can save %s pointers%n"
                 + "Max cache size: 2^%d = %s elements%n",
                 grouped.format(ShrinkAuxiliaryDataTest.getMemoryUsedByTest()),
-                grouped.format(Runtime.getRuntime().freeMemory()),
-                grouped.format(Runtime.getRuntime().freeMemory()
+                grouped.format(Runtime.getRuntime().maxMemory()),
+                grouped.format(Runtime.getRuntime().maxMemory()
                         - ShrinkAuxiliaryDataTest.getMemoryUsedByTest()),
                 Unsafe.ADDRESS_SIZE,
                 grouped.format((Runtime.getRuntime().freeMemory()
@@ -135,6 +144,7 @@
         if (availableMemory <= 0) {
             return 0;
         }
+
         long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE;
         return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount));
     }
@@ -142,17 +152,48 @@
     static class ShrinkAuxiliaryDataTest {
 
         public static void main(String[] args) throws IOException {
-            int iterateCount = DEFAULT_ITERATION_COUNT;
+
+            ShrinkAuxiliaryDataTest testCase = new ShrinkAuxiliaryDataTest();
 
-            if (args.length > 0) {
-                try {
-                    iterateCount = Integer.parseInt(args[0]);
-                } catch (NumberFormatException e) {
-                    //num_iterate remains default
-                }
+            if (!testCase.checkEnvApplicability()) {
+                return;
             }
 
-            new ShrinkAuxiliaryDataTest().test(iterateCount);
+            testCase.test();
+        }
+
+        /**
+         * Checks is this environment suitable to run this test
+         * - memory is enough to decommit (page size is not big)
+         * - RSet cache size is not too big
+         *
+         * @return true if test could run, false if test should be skipped
+         */
+        protected boolean checkEnvApplicability() {
+
+            int pageSize = WhiteBox.getWhiteBox().getVMPageSize();
+            System.out.println( "Page size = " + pageSize
+                    + " region size = " + REGION_SIZE
+                    + " aux data ~= " + (REGION_SIZE * 3 / 100));
+            // If auxdata size will be less than page size it wouldn't decommit.
+            // Auxiliary data size is about ~3.6% of heap size.
+            if (pageSize >= REGION_SIZE * 3 / 100) {
+                System.out.format("Skipping test for too large page size = %d",
+                       pageSize
+                );
+                return false;
+            }
+
+            if (REGION_SIZE * REGIONS_TO_ALLOCATE > Runtime.getRuntime().maxMemory()) {
+                System.out.format("Skipping test for too low available memory. "
+                        + "Need %d, available %d",
+                        REGION_SIZE * REGIONS_TO_ALLOCATE,
+                        Runtime.getRuntime().maxMemory()
+                );
+                return false;
+            }
+
+            return true;
         }
 
         class GarbageObject {
@@ -177,41 +218,54 @@
 
         private final List<GarbageObject> garbage = new ArrayList();
 
-        public void test(int num_iterate) throws IOException {
+        public void test() throws IOException {
+
+            MemoryUsage muFull, muFree, muAuxDataFull, muAuxDataFree;
+            float auxFull, auxFree;
 
             allocate();
             link();
             mutate();
-            deallocate();
+
+            muFull = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
+            long numUsedRegions = WhiteBox.getWhiteBox().g1NumMaxRegions()
+                    - WhiteBox.getWhiteBox().g1NumFreeRegions();
+            muAuxDataFull = WhiteBox.getWhiteBox().g1AuxiliaryMemoryUsage();
+            auxFull = (float)muAuxDataFull.getUsed() / numUsedRegions;
 
-            MemoryUsage muBeforeHeap
-                        = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-            MemoryUsage muBeforeNonHeap
-                        = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
+            System.out.format("Full aux data  ratio= %f, regions max= %d, used= %d\n",
+                    auxFull, WhiteBox.getWhiteBox().g1NumMaxRegions(), numUsedRegions
+            );
+
+            deallocate();
+            System.gc();
 
-            for (int i = 0; i < num_iterate; i++) {
-                allocate();
-                link();
-                mutate();
-                deallocate();
-            }
+            muFree = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
+            muAuxDataFree = WhiteBox.getWhiteBox().g1AuxiliaryMemoryUsage();
+
+            numUsedRegions = WhiteBox.getWhiteBox().g1NumMaxRegions()
+                    - WhiteBox.getWhiteBox().g1NumFreeRegions();
+            auxFree = (float)muAuxDataFree.getUsed() / numUsedRegions;
 
-            System.gc();
-            MemoryUsage muAfterHeap
-                        = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-            MemoryUsage muAfterNonHeap
-                        = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
+            System.out.format("Free aux data ratio= %f, regions max= %d, used= %d\n",
+                    auxFree, WhiteBox.getWhiteBox().g1NumMaxRegions(), numUsedRegions
+            );
 
-            assertLessThanOrEqual(muAfterHeap.getCommitted(), muBeforeHeap.getCommitted(),
-                    String.format("heap decommit failed - after > before: %d > %d",
-                            muAfterHeap.getCommitted(), muBeforeHeap.getCommitted()
+            Asserts.assertLessThanOrEqual(muFree.getCommitted(), muFull.getCommitted(),
+                    String.format("heap decommit failed - full > free: %d > %d",
+                            muFree.getCommitted(), muFull.getCommitted()
                     )
             );
 
-            if (muAfterHeap.getCommitted() < muBeforeHeap.getCommitted()) {
-                assertLessThanOrEqual(muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted(),
-                        String.format("non-heap decommit failed - after > before: %d > %d",
-                                muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted()
+            System.out.format("State               used   committed\n");
+            System.out.format("Full aux data: %10d %10d\n", muAuxDataFull.getUsed(), muAuxDataFull.getCommitted());
+            System.out.format("Free aux data: %10d %10d\n", muAuxDataFree.getUsed(), muAuxDataFree.getCommitted());
+
+            // if decommited check that aux data has same ratio
+            if (muFree.getCommitted() < muFull.getCommitted()) {
+                Asserts.assertLessThanOrEqual(auxFree, auxFull,
+                        String.format("auxiliary data decommit failed - full > free: %f > %f",
+                                auxFree, auxFull
                         )
                 );
             }
@@ -238,8 +292,7 @@
                 for (int i = 0; i < NUM_LINKS; i++) {
                     int regionToLink;
                     do {
-                        regionToLink = (int) (Math.random()
-                                * REGIONS_TO_ALLOCATE);
+                        regionToLink = (int) (Math.random() * REGIONS_TO_ALLOCATE);
                     } while (regionToLink == regionNumber);
 
                     // get random garbage object from random region
@@ -265,11 +318,8 @@
             return REGIONS_TO_ALLOCATE * REGION_SIZE;
         }
 
-        private static final int REGION_SIZE = 1024 * 1024;
-        private static final int DEFAULT_ITERATION_COUNT = 1;   // iterate main scenario
-        private static final int REGIONS_TO_ALLOCATE = 5;
+        private static final int REGIONS_TO_ALLOCATE = 100;
         private static final int NUM_OBJECTS_PER_REGION = 10;
         private static final int NUM_LINKS = 20; // how many links create for each object
-
     }
 }
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,11 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData00
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
+ * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
- * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ *        TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData00
  */
 public class TestShrinkAuxiliaryData00 {
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,12 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData05
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
- * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ *        TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData05
  */
 public class TestShrinkAuxiliaryData05 {
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,12 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData10
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData10
  */
 public class TestShrinkAuxiliaryData10 {
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,12 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData15
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData15
  */
 public class TestShrinkAuxiliaryData15 {
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,12 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData20
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData20
  */
 public class TestShrinkAuxiliaryData20 {
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,12 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData25
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData25
  */
 public class TestShrinkAuxiliaryData25 {
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,12 +23,15 @@
 
 /**
  * @test TestShrinkAuxiliaryData30
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData30
  */
 public class TestShrinkAuxiliaryData30 {
--- a/jaxp/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/jaxp/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -297,3 +297,4 @@
 57b26c883d54f45912bc3885ccad3c6b80960b1f jdk9-b52
 d5b5a010a16688f188f5a9247ed873f5100b530c jdk9-b53
 542c0c855ad467624cbedf11bff08e44b86b068d jdk9-b54
+2a460ce60ed47081f756f0cc0321d8e9ba7cac17 jdk9-b55
--- a/jaxws/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/jaxws/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -300,3 +300,4 @@
 1d1e7704eca9c77ebe6a8705d17ac568801f7a3b jdk9-b52
 b8fbe40efa97fe0753076ccc6dfc50747c7877d0 jdk9-b53
 83a0cf0e08788c33872e1fe3e87bf9a0d1e59eaa jdk9-b54
+ca481b0492c82cc38fa0e6b746305ed88c26b4fd jdk9-b55
--- a/jdk/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -297,3 +297,4 @@
 607ea68032cd4a4cf2c7a7a41fcb39602d6a75e2 jdk9-b52
 6cb5f5c34009630749a40cefe116d143f0b2583e jdk9-b53
 568a62ab7d764d7c74ac1d87387dbe500662b551 jdk9-b54
+d49e247dade61f29f771f09b2105857492241156 jdk9-b55
--- a/jdk/make/data/currency/CurrencyData.properties	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/data/currency/CurrencyData.properties	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -23,7 +23,10 @@
 # questions.
 #
 
-formatVersion=1
+# Version of the currency data format.
+#   1: initial
+#   2: Change in minor unit (allowing 4-9 digits)
+formatVersion=2
 
 # Version of the currency code information in this class.
 # It is a serial number that accompanies with each amendment.
@@ -36,7 +39,7 @@
 all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036-\
     AWG533-AYM945-AZM031-AZN944-BAM977-BBD052-BDT050-BEF056-BGL100-BGN975-BHD048-BIF108-\
     BMD060-BND096-BOB068-BOV984-BRL986-BSD044-BTN064-BWP072-BYB112-BYR974-\
-    BZD084-CAD124-CDF976-CHF756-CLF990-CLP152-CNY156-COP170-CRC188-CSD891-CUP192-CUC931-\
+    BZD084-CAD124-CDF976-CHE947-CHF756-CHW948-CLF990-CLP152-CNY156-COP170-COU970-CRC188-CSD891-CUP192-CUC931-\
     CVE132-CYP196-CZK203-DEM276-DJF262-DKK208-DOP214-DZD012-EEK233-EGP818-\
     ERN232-ESP724-ETB230-EUR978-FIM246-FJD242-FKP238-FRF250-GBP826-GEL981-\
     GHC288-GHS936-GIP292-GMD270-GNF324-GRD300-GTQ320-GWP624-GYD328-HKD344-HNL340-\
@@ -49,7 +52,7 @@
     PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
     SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
     SRD968-SRG740-SSP728-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
-    TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-\
+    TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
     UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
     XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
     XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\
@@ -579,16 +582,17 @@
 ZW=ZWL
 
 
-# List of currencies with 0, 1, OR 3 decimals for minor units, or where there
-# are no minor units defined. All others use 2 decimals.
+# List of currencies with non-2digit decimals for minor units,
+# or where there are no minor units defined. All others use 2 decimals.
 
 minor0=\
-    ADP-BEF-BIF-BYB-BYR-CLF-CLP-DJF-ESP-GNF-\
+    ADP-BEF-BIF-BYB-BYR-CLP-DJF-ESP-GNF-\
     GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-RWF-\
-    TPE-TRL-UGX-VND-VUV-XAF-XOF-XPF
-minor1=
+    TPE-TRL-UGX-UYI-VND-VUV-XAF-XOF-XPF
 minor3=\
     BHD-IQD-JOD-KWD-LYD-OMR-TND
+minor4=\
+    CLF
 minorUndefined=\
     XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-\
     XPT-XSU-XTS-XUA-XXX
--- a/jdk/make/gensrc/Gensrc-jdk.jconsole.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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.  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 GensrcCommon.gmk
-
-##########################################################################################
-# Version file for jconsole
-
-$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jconsole/sun/tools/jconsole/Version.java: \
-    $(JDK_TOPDIR)/src/jdk.jconsole/share/classes/sun/tools/jconsole/Version.java.template
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java
-	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
-	$(MV) $@.tmp $@
-
-GENSRC_JDK_JCONSOLE += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jconsole/sun/tools/jconsole/Version.java
-
-jdk.jconsole: $(GENSRC_JDK_JCONSOLE)
-
-all: jdk.jconsole
-
-.PHONY: all jdk.jconsole
--- a/jdk/make/lib/Lib-java.security.jgss.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/lib/Lib-java.security.jgss.gmk	Sun Mar 29 09:20:27 2015 -0400
@@ -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/make/lib/Lib-jdk.pack200.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/lib/Lib-jdk.pack200.gmk	Sun Mar 29 09:20:27 2015 -0400
@@ -42,6 +42,7 @@
     CFLAGS_release := -DPRODUCT, \
     DISABLED_WARNINGS_gcc := conversion-null sign-compare format-security \
         format-nonliteral parentheses, \
+    DISABLED_WARNINGS_clang := bool-conversion format-security, \
     DISABLED_WARNINGS_solstudio := truncwarn, \
     DISABLED_WARNINGS_microsoft := 4267 4018, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \
--- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers	Sun Mar 29 09:20:27 2015 -0400
@@ -243,7 +243,7 @@
 		getDefaultConfig;
                 Java_sun_font_FontConfigManager_getFontConfig;
                 Java_sun_font_FontConfigManager_getFontConfigAASettings;
-		Java_sun_awt_X11FontManager_getFontPathNative;
+		Java_sun_awt_FcFontManager_getFontPathNative;
 		Java_sun_font_SunFontManager_populateFontFileNameMap;
 
 		# CDE private entry point
--- a/jdk/make/mapfiles/libawt/mapfile-vers-linux	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/mapfiles/libawt/mapfile-vers-linux	Sun Mar 29 09:20:27 2015 -0400
@@ -270,7 +270,7 @@
 		getDefaultConfig;
                 Java_sun_font_FontConfigManager_getFontConfig;
                 Java_sun_font_FontConfigManager_getFontConfigAASettings;
-		Java_sun_awt_X11FontManager_getFontPathNative;
+		Java_sun_awt_FcFontManager_getFontPathNative;
 		Java_sun_font_SunFontManager_populateFontFileNameMap;
 
 		# CDE private entry point
--- a/jdk/make/mapfiles/libawt_headless/mapfile-vers	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers	Sun Mar 29 09:20:27 2015 -0400
@@ -65,7 +65,7 @@
                 Java_sun_font_FontConfigManager_getFontConfig;
                 Java_sun_font_FontConfigManager_getFontConfigAASettings;
                 Java_sun_font_FontConfigManager_getFontConfigVersion;
-                Java_sun_awt_X11FontManager_getFontPathNative;
+                Java_sun_awt_FcFontManager_getFontPathNative;
 
 		Java_sun_awt_FontDescriptor_initIDs;
 		Java_sun_awt_PlatformFont_initIDs;
--- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers	Sun Mar 29 09:20:27 2015 -0400
@@ -188,7 +188,7 @@
         Java_sun_font_FontConfigManager_getFontConfig;
         Java_sun_font_FontConfigManager_getFontConfigAASettings;
         Java_sun_font_FontConfigManager_getFontConfigVersion;
-	Java_sun_awt_X11FontManager_getFontPathNative;
+	Java_sun_awt_FcFontManager_getFontPathNative;
         Java_sun_awt_X11GraphicsEnvironment_initDisplay;
         Java_sun_awt_X11GraphicsEnvironment_initGLX;
 	Java_sun_awt_X11GraphicsEnvironment_initXRender;
--- a/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -33,6 +33,7 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.TimeZone;
 
@@ -72,10 +73,6 @@
     private static String formatVersion;
     private static String dataVersion;
     private static String validCurrencyCodes;
-    private static String currenciesWith0MinorUnitDecimals;
-    private static String currenciesWith1MinorUnitDecimal;
-    private static String currenciesWith3MinorUnitDecimal;
-    private static String currenciesWithMinorUnitsUndefined;
 
     // handy constants - must match definitions in java.util.Currency
     // magic number
@@ -83,29 +80,31 @@
     // number of characters from A to Z
     private static final int A_TO_Z = ('Z' - 'A') + 1;
     // entry for invalid country codes
-    private static final int INVALID_COUNTRY_ENTRY = 0x007F;
+    private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
     // entry for countries without currency
-    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
+    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
     // mask for simple case country entries
-    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
+    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
     // mask for simple case country entry final character
-    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
+    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
     // mask for simple case country entry default currency digits
-    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
+    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
     // shift count for simple case country entry default currency digits
     private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
+    // maximum number for simple case country entry default currency digits
+    private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
     // mask for special case country entries
-    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
+    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
     // mask for special case country index
-    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
+    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
     // delta from entry index component in main table to index into special case tables
     private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
     // mask for distinguishing simple and special case countries
     private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
     // mask for the numeric code of the currency
-    private static final int NUMERIC_CODE_MASK = 0x0003FF00;
+    private static final int NUMERIC_CODE_MASK = 0x000FFC00;
     // shift count for the numeric code of the currency
-    private static final int NUMERIC_CODE_SHIFT = 8;
+    private static final int NUMERIC_CODE_SHIFT = 10;
 
     // generated data
     private static int[] mainTable = new int[A_TO_Z * A_TO_Z];
@@ -120,7 +119,7 @@
     private static int[] specialCaseOldCurrenciesNumericCode = new int[maxSpecialCases];
     private static int[] specialCaseNewCurrenciesNumericCode = new int[maxSpecialCases];
 
-    private static final int maxOtherCurrencies = 70;
+    private static final int maxOtherCurrencies = 128;
     private static int otherCurrenciesCount = 0;
     private static StringBuffer otherCurrencies = new StringBuffer();
     private static int[] otherCurrenciesDefaultFractionDigits = new int[maxOtherCurrencies];
@@ -129,6 +128,11 @@
     // date format for parsing cut-over times
     private static SimpleDateFormat format;
 
+    // Minor Units
+    private static String[] currenciesWithDefinedMinorUnitDecimals =
+        new String[SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + 1];
+    private static String currenciesWithMinorUnitsUndefined;
+
     public static void main(String[] args) {
 
         // Look for "-o outputfilename" option
@@ -171,16 +175,14 @@
         formatVersion = (String) currencyData.get("formatVersion");
         dataVersion = (String) currencyData.get("dataVersion");
         validCurrencyCodes = (String) currencyData.get("all");
-        currenciesWith0MinorUnitDecimals  = (String) currencyData.get("minor0");
-        currenciesWith1MinorUnitDecimal  = (String) currencyData.get("minor1");
-        currenciesWith3MinorUnitDecimal  = (String) currencyData.get("minor3");
+        for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
+            currenciesWithDefinedMinorUnitDecimals[i]
+                = (String) currencyData.get("minor"+i);
+        }
         currenciesWithMinorUnitsUndefined  = (String) currencyData.get("minorUndefined");
         if (formatVersion == null ||
                 dataVersion == null ||
                 validCurrencyCodes == null ||
-                currenciesWith0MinorUnitDecimals == null ||
-                currenciesWith1MinorUnitDecimal == null ||
-                currenciesWith3MinorUnitDecimal == null ||
                 currenciesWithMinorUnitsUndefined == null) {
             throw new NullPointerException("not all required data is defined in input");
         }
@@ -207,7 +209,7 @@
                         if (currencyInfo.charAt(0) == firstChar && currencyInfo.charAt(1) == secondChar) {
                             checkCurrencyCode(currencyInfo);
                             int digits = getDefaultFractionDigits(currencyInfo);
-                            if (digits < 0 || digits > 3) {
+                            if (digits < 0 || digits > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
                                 throw new RuntimeException("fraction digits out of range for " + currencyInfo);
                             }
                             int numericCode= getNumericCode(currencyInfo);
@@ -231,13 +233,14 @@
     }
 
     private static int getDefaultFractionDigits(String currencyCode) {
-        if (currenciesWith0MinorUnitDecimals.indexOf(currencyCode) != -1) {
-            return 0;
-        } else if (currenciesWith1MinorUnitDecimal.indexOf(currencyCode) != -1) {
-            return 1;
-        } else if (currenciesWith3MinorUnitDecimal.indexOf(currencyCode) != -1) {
-            return 3;
-        } else if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
+        for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
+            if (Objects.nonNull(currenciesWithDefinedMinorUnitDecimals[i]) &&
+                currenciesWithDefinedMinorUnitDecimals[i].indexOf(currencyCode) != -1) {
+                return i;
+            }
+        }
+
+        if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
             return -1;
         } else {
             return 2;
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -61,6 +61,7 @@
 import javax.swing.JFileChooser;
 import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -698,7 +699,7 @@
             }
         };
         guiFrame = f;
-        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
         f.getContentPane().setLayout(new BorderLayout());
         f.getContentPane().add(Group.root.getJComponent(), BorderLayout.CENTER);
         JPanel p = new JPanel();
--- a/jdk/src/demo/share/jfc/SampleTree/SampleTree.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/demo/share/jfc/SampleTree/SampleTree.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -135,7 +135,7 @@
         panel.add("Center", sp);
         panel.add("South", constructOptionsPanel());
 
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
         frame.pack();
         frame.setVisible(true);
     }
--- a/jdk/src/demo/share/management/JTop/JTop.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/demo/share/management/JTop/JTop.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -410,7 +410,7 @@
     private static void createAndShowGUI(JPanel jtop) {
         // Create and set up the window.
         JFrame frame = new JFrame("JTop");
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 
         // Create and set up the content pane.
         JComponent contentPane = (JComponent) frame.getContentPane();
--- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/AllPermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/BasicPermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/DomainCombiner.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/KeyRep.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/KeyStoreSpi.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/Permissions.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/security/cert/Certificate.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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/Currency.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/Currency.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -140,11 +140,11 @@
     //   - maps country code to 32-bit int
     //   - 26*26 entries, corresponding to [A-Z]*[A-Z]
     //   - \u007F -> not valid country
-    //   - bits 18-31: unused
-    //   - bits 8-17: numeric code (0 to 1023)
-    //   - bit 7: 1 - special case, bits 0-4 indicate which one
+    //   - bits 20-31: unused
+    //   - bits 10-19: numeric code (0 to 1023)
+    //   - bit 9: 1 - special case, bits 0-4 indicate which one
     //            0 - simple country, bits 0-4 indicate final char of currency code
-    //   - bits 5-6: fraction digits for simple countries, 0 for special cases
+    //   - bits 5-8: fraction digits for simple countries, 0 for special cases
     //   - bits 0-4: final char for currency code for simple country, or ID of special case
     // - special case IDs:
     //   - 0: country has no currency
@@ -182,32 +182,34 @@
     // number of characters from A to Z
     private static final int A_TO_Z = ('Z' - 'A') + 1;
     // entry for invalid country codes
-    private static final int INVALID_COUNTRY_ENTRY = 0x007F;
+    private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
     // entry for countries without currency
-    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
+    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
     // mask for simple case country entries
-    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
+    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
     // mask for simple case country entry final character
-    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
+    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
     // mask for simple case country entry default currency digits
-    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
+    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
     // shift count for simple case country entry default currency digits
     private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
+    // maximum number for simple case country entry default currency digits
+    private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
     // mask for special case country entries
-    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
+    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
     // mask for special case country index
-    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
+    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
     // delta from entry index component in main table to index into special case tables
     private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
     // mask for distinguishing simple and special case countries
     private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
     // mask for the numeric code of the currency
-    private static final int NUMERIC_CODE_MASK = 0x0003FF00;
+    private static final int NUMERIC_CODE_MASK = 0x000FFC00;
     // shift count for the numeric code of the currency
-    private static final int NUMERIC_CODE_SHIFT = 8;
+    private static final int NUMERIC_CODE_SHIFT = 10;
 
     // Currency data format version
-    private static final int VALID_FORMAT_VERSION = 1;
+    private static final int VALID_FORMAT_VERSION = 2;
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
@@ -261,7 +263,7 @@
                         Set<String> keys = props.stringPropertyNames();
                         Pattern propertiesPattern =
                             Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" +
-                                "([0-3])\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
+                                "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
                                 "\\d{2}:\\d{2})?");
                         for (String key : keys) {
                            replaceCurrencyData(propertiesPattern,
@@ -682,7 +684,7 @@
      * @param ctry country code
      * @param curdata currency data.  This is a comma separated string that
      *    consists of "three-letter alphabet code", "three-digit numeric code",
-     *    and "one-digit (0,1,2, or 3) default fraction digit".
+     *    and "one-digit (0-9) default fraction digit".
      *    For example, "JPZ,392,0".
      *    An optional UTC date can be appended to the string (comma separated)
      *    to allow a currency change take effect after date specified.
@@ -721,8 +723,14 @@
 
         String code = m.group(1);
         int numeric = Integer.parseInt(m.group(2));
+        int entry = numeric << NUMERIC_CODE_SHIFT;
         int fraction = Integer.parseInt(m.group(3));
-        int entry = numeric << NUMERIC_CODE_SHIFT;
+        if (fraction > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
+            info("currency.properties entry for " + ctry +
+                " ignored since the fraction is more than " +
+                SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + ":" + curdata, null);
+            return;
+        }
 
         int index;
         for (index = 0; index < scOldCurrencies.length; index++) {
--- a/jdk/src/java.base/share/classes/java/util/Properties.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/Properties.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/DoublePipeline.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/IntPipeline.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/IntStream.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/LongPipeline.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/LongStream.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/ReferencePipeline.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/crypto/CipherInputStream.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/crypto/package.html	Sun Mar 29 09:20:27 2015 -0400
@@ -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&trade;
     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&trade;
        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&trade; Cryptography Architecture
       </b></a></li>
 </ul>
 
--- a/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Policy.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountLockedException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountNotFoundException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/ConfigurationSpi.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialNotFoundException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherSuite.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/MAC.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.desktop/macosx/classes/com/apple/laf/AquaMenuBarBorder.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuBarBorder.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, 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
@@ -25,46 +25,33 @@
 
 package com.apple.laf;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
 
 import javax.swing.border.Border;
 
+import sun.swing.SwingUtilities2;
+
+/**
+ * The class represents the border of a {@code JMenuBar}.
+ */
 public class AquaMenuBarBorder implements Border {
-    public AquaMenuBarBorder() {
-        super();
+
+    @Override
+    public void paintBorder(final Component c, final Graphics g, final int x,
+                            final int y, final int width, final int height) {
+        g.setColor(Color.gray);
+        SwingUtilities2.drawHLine(g, x, x + width - 1, y + height - 1);
     }
 
-    /**
-     * Paints the border for the specified component with the specified
-     * position and size.
-     * @param c the component for which this border is being painted
-     * @param g the paint graphics
-     * @param x the x position of the painted border
-     * @param y the y position of the painted border
-     * @param width the width of the painted border
-     * @param height the height of the painted border
-     */
-    public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
-        // for now we don't paint a border. We let the button paint it since there
-        // needs to be a strict ordering for aqua components.
-        //paintButton(c, g, x, y, width, height);
-        g.setColor(Color.gray);
-        g.drawLine(x, y + height - 1, x + width, y + height - 1);
-    }
-
-    /**
-     * Returns the insets of the border.
-     * @param c the component for which this border insets value applies
-     */
+    @Override
     public Insets getBorderInsets(final Component c) {
         return new Insets(0, 0, 1, 0);
     }
 
-    /**
-     * Returns whether or not the border is opaque.  If the border
-     * is opaque, it is responsible for filling in it's own
-     * background when painting.
-     */
+    @Override
     public boolean isBorderOpaque() {
         return false;
     }
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuUI.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuUI.java	Sun Mar 29 09:20:27 2015 -0400
@@ -148,11 +148,15 @@
 
             // In Aqua, we always have a menu delay, regardless of where the menu is.
             if (!(selectedPath.length > 0 && selectedPath[selectedPath.length - 1] == menu.getPopupMenu())) {
-                if (menu.getDelay() == 0) {
-                    appendPath(getPath(), menu.getPopupMenu());
-                } else {
-                    manager.setSelectedPath(getPath());
-                    setupPostTimer(menu);
+                // the condition below prevents from activating menu in other frame
+                if (!menu.isTopLevelMenu() || (selectedPath.length > 0 &&
+                        selectedPath[0] == menu.getParent())) {
+                    if (menu.getDelay() == 0) {
+                        appendPath(getPath(), menu.getPopupMenu());
+                    } else {
+                        manager.setSelectedPath(getPath());
+                        setupPostTimer(menu);
+                    }
                 }
             }
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Sun Mar 29 09:20:27 2015 -0400
@@ -488,6 +488,9 @@
         } else {
             deliverZoom(true);
 
+            // We need an up to date size of the peer, so we flush the native events
+            // to be sure that there are no setBounds requests in the queue.
+            LWCToolkit.flushNativeSelectors();
             this.normalBounds = peer.getBounds();
 
             GraphicsConfiguration config = getPeer().getGraphicsConfiguration();
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Sun Mar 29 09:20:27 2015 -0400
@@ -843,7 +843,7 @@
     /**
      * Just spin a single empty block synchronously.
      */
-    private static native void flushNativeSelectors();
+    static native void flushNativeSelectors();
 
     @Override
     public Clipboard createPlatformClipboard() {
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1104,6 +1104,11 @@
         currentImage++;  // After a successful write
     }
 
+    @Override
+    public boolean canWriteSequence() {
+        return true;
+    }
+
     public void prepareWriteSequence(IIOMetadata streamMetadata)
         throws IOException {
         setThreadLock();
--- a/jdk/src/java.desktop/share/classes/javax/swing/JFrame.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JFrame.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -128,16 +128,6 @@
                               TransferHandler.HasGetTransferHandler
 {
     /**
-     * The exit application default window close operation. If a window
-     * has this set as the close operation and is closed in an applet,
-     * a <code>SecurityException</code> may be thrown.
-     * It is recommended you only use this in an application.
-     *
-     * @since 1.3
-     */
-    public static final int EXIT_ON_CLOSE = 3;
-
-    /**
      * Key into the AppContext, used to check if should provide decorations
      * by default.
      */
@@ -352,7 +342,7 @@
      * objects.
      *
      * <li><code>EXIT_ON_CLOSE</code>
-     * (defined in <code>JFrame</code>):
+     * (defined in <code>WindowConstants</code>):
      * Exit the application using the <code>System</code>
      * <code>exit</code> method.  Use this only in applications.
      * </ul>
@@ -393,7 +383,9 @@
             operation != HIDE_ON_CLOSE &&
             operation != DISPOSE_ON_CLOSE &&
             operation != EXIT_ON_CLOSE) {
-            throw new IllegalArgumentException("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE");
+            throw new IllegalArgumentException("defaultCloseOperation must be"
+                    + " one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE,"
+                    + " DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE");
         }
 
         if (operation == EXIT_ON_CLOSE) {
@@ -861,7 +853,7 @@
             defaultCloseOperationString = "DISPOSE_ON_CLOSE";
         } else if (defaultCloseOperation == DO_NOTHING_ON_CLOSE) {
             defaultCloseOperationString = "DO_NOTHING_ON_CLOSE";
-        } else if (defaultCloseOperation == 3) {
+        } else if (defaultCloseOperation == EXIT_ON_CLOSE) {
             defaultCloseOperationString = "EXIT_ON_CLOSE";
         } else defaultCloseOperationString = "";
         String rootPaneString = (rootPane != null ?
--- a/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
  *
  *     private static void createAndShowGUI() {
  *         final JFrame frame = new JFrame();
- *         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ *         frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  *
  *         // work with the layer as with any other Swing component
  *         frame.add(createLayer());
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicBorders.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicBorders.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -37,6 +37,8 @@
 import java.awt.Color;
 import java.awt.Graphics;
 
+import sun.swing.SwingUtilities2;
+
 /**
  * Factory object that can vend Borders appropriate for the basic L &amp; F.
  * @author Georges Saab
@@ -453,10 +455,10 @@
             Color oldColor = g.getColor();
             g.translate(x, y);
             g.setColor(shadow);
-            g.drawLine(0, height-2, width, height-2);
+            SwingUtilities2.drawHLine(g, 0, width - 1, height - 2);
             g.setColor(highlight);
-            g.drawLine(0, height-1, width, height-1);
-            g.translate(-x,-y);
+            SwingUtilities2.drawHLine(g, 0, width - 1, height - 1);
+            g.translate(-x, -y);
             g.setColor(oldColor);
         }
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -40,6 +40,7 @@
 import java.awt.Window;
 
 import sun.swing.StringUIClientPropertyKey;
+import sun.swing.SwingUtilities2;
 
 
 /**
@@ -559,25 +560,22 @@
         protected static Insets borderInsets = new Insets( 1, 0, 1, 0 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
-            g.translate( x, y );
+            g.translate(x, y);
 
             if (MetalLookAndFeel.usingOcean()) {
-                // Only paint a border if we're not next to a horizontal
-                // toolbar
-                if ((c instanceof JMenuBar) && !MetalToolBarUI.doesMenuBarBorderToolBar((JMenuBar)c)) {
+                // Only paint a border if we're not next to a horizontal toolbar
+                if (c instanceof JMenuBar
+                        && !MetalToolBarUI.doesMenuBarBorderToolBar((JMenuBar)c)) {
                     g.setColor(MetalLookAndFeel.getControl());
-                    g.drawLine(0, h - 2, w, h - 2);
+                    SwingUtilities2.drawHLine(g, 0, w - 1, h - 2);
                     g.setColor(UIManager.getColor("MenuBar.borderColor"));
-                    g.drawLine(0, h - 1, w, h - 1);
+                    SwingUtilities2.drawHLine(g, 0, w - 1, h - 1);
                 }
+            } else {
+                g.setColor(MetalLookAndFeel.getControlShadow());
+                SwingUtilities2.drawHLine(g, 0, w - 1, h - 1);
             }
-            else {
-                g.setColor( MetalLookAndFeel.getControlShadow() );
-                g.drawLine( 0, h-1, w, h-1 );
-            }
-
-            g.translate( -x, -y );
-
+            g.translate(-x, -y);
         }
 
         public Insets getBorderInsets(Component c, Insets newInsets) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/table/TableColumn.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/javax/swing/table/TableColumn.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -25,15 +25,14 @@
 
 package javax.swing.table;
 
-import javax.swing.*;
-import javax.swing.border.*;
+import java.awt.Component;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.UIManager;
 import javax.swing.event.SwingPropertyChangeSupport;
-import java.lang.Integer;
-import java.awt.Color;
-import java.awt.Component;
-import java.io.Serializable;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 
 /**
  *  A <code>TableColumn</code> represents all the attributes of a column in a
@@ -744,19 +743,25 @@
 //
 
     /**
-     * Adds a <code>PropertyChangeListener</code> to the listener list.
-     * The listener is registered for all properties.
-     * <p>
-     * A <code>PropertyChangeEvent</code> will get fired in response to an
-     * explicit call to <code>setFont</code>, <code>setBackground</code>,
-     * or <code>setForeground</code> on the
-     * current component.  Note that if the current component is
-     * inheriting its foreground, background, or font from its
-     * container, then no event will be fired in response to a
-     * change in the inherited property.
+     * Adds a {@code PropertyChangeListener} to the listener list. The listener
+     * is registered for all bound properties of this class, including the
+     * following:
+     * <ul>
+     *    <li>this TableColumn's modelIndex ("modelIndex")</li>
+     *    <li>this TableColumn's identifier ("identifier")</li>
+     *    <li>this TableColumn's header value ("headerValue")</li>
+     *    <li>this TableColumn's header renderer ("headerRenderer")</li>
+     *    <li>this TableColumn's cell renderer ("cellRenderer")</li>
+     *    <li>this TableColumn's cell editor ("cellEditor")</li>
+     *    <li>this TableColumn's width ("width")</li>
+     *    <li>this TableColumn's preferred width ("preferredWidth")</li>
+     *    <li>this TableColumn's minimum width ("minWidth")</li>
+     *    <li>this TableColumn's maximum width ("maxWidth")</li>
+     *    <li>this TableColumn's resizable state ("isResizable")</li>
+     * </ul>
      *
-     * @param listener  the listener to be added
-     *
+     * @param  listener the listener to be added
+     * @see #removePropertyChangeListener(PropertyChangeListener)
      */
     public synchronized void addPropertyChangeListener(
                                 PropertyChangeListener listener) {
--- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, 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
@@ -40,7 +40,7 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
-import java.util.Objects;
+import java.util.Arrays;
 import java.util.Set;
 import java.util.HashSet;
 
@@ -74,12 +74,11 @@
     private volatile int numberOfFlavorListeners = 0;
 
     /**
-     * A set of <code>DataFlavor</code>s that is available on
-     * this clipboard. It is used for tracking changes
-     * of <code>DataFlavor</code>s available on this clipboard.
+     * A set of {@code DataFlavor}s that is available on this clipboard. It is
+     * used for tracking changes of {@code DataFlavor}s available on this
+     * clipboard. Can be {@code null}.
      */
-    private volatile Set<DataFlavor> currentDataFlavors;
-
+    private volatile long[] currentFormats;
 
     public SunClipboard(String name) {
         super(name);
@@ -362,11 +361,11 @@
             try {
                 openClipboard(null);
                 currentFormats = getClipboardFormats();
-            } catch (IllegalStateException exc) {
+            } catch (final IllegalStateException ignored) {
             } finally {
                 closeClipboard();
             }
-            currentDataFlavors = formatArrayAsDataFlavorSet(currentFormats);
+            this.currentFormats = currentFormats;
 
             registerClipboardViewerChecked();
         }
@@ -383,7 +382,7 @@
         }
         if (flavorListeners.remove(listener) && --numberOfFlavorListeners == 0) {
             unregisterClipboardViewerChecked();
-            currentDataFlavors = null;
+            currentFormats = null;
         }
     }
 
@@ -416,18 +415,16 @@
      * @param formats data formats that have just been retrieved from
      *        this clipboard
      */
-    public void checkChange(long[] formats) {
-        Set<DataFlavor> prevDataFlavors = currentDataFlavors;
-        currentDataFlavors = formatArrayAsDataFlavorSet(formats);
-
-        if (Objects.equals(prevDataFlavors, currentDataFlavors)) {
+    public final void checkChange(final long[] formats) {
+        if (Arrays.equals(formats, currentFormats)) {
             // we've been able to successfully get available on the clipboard
             // DataFlavors this and previous time and they are coincident;
             // don't notify
             return;
         }
+        currentFormats = formats;
 
-        for (AppContext appContext : AppContext.getAppContexts()) {
+        for (final AppContext appContext : AppContext.getAppContexts()) {
             if (appContext == null || appContext.isDisposed()) {
                 continue;
             }
--- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/PiscesCache.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/PiscesCache.java	Sun Mar 29 09:20:27 2015 -0400
@@ -167,6 +167,15 @@
         rowAARLE[row][1] = end;
     }
 
+    void getBBox(int bbox[]) {
+        // Since we add +1 to bboxX1,bboxY1 so when PTG asks for bbox,
+        // we will give after -1
+        bbox[0] = bboxX0;
+        bbox[1] = bboxY0;
+        bbox[2] = bboxX1 - 1;
+        bbox[3] = bboxY1 - 1;
+    }
+
     @Override
     public String toString() {
         String ret = "bbox = ["+
--- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/PiscesTileGenerator.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/PiscesTileGenerator.java	Sun Mar 29 09:20:27 2015 -0400
@@ -76,10 +76,7 @@
     }
 
     public void getBbox(int bbox[]) {
-        bbox[0] = cache.bboxX0;
-        bbox[1] = cache.bboxY0;
-        bbox[2] = cache.bboxX1;
-        bbox[3] = cache.bboxY1;
+        cache.getBBox(bbox);
         //System.out.println("bbox["+bbox[0]+", "+bbox[1]+" => "+bbox[2]+", "+bbox[3]+"]");
     }
 
--- a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Sun Mar 29 09:20:27 2015 -0400
@@ -2778,6 +2778,14 @@
     pb = &data->pixelBuf;
 
     if (setPixelBuffer(env, pb, buffer) == NOT_OK) {
+        if (scale != NULL) {
+            for (i = 0; i < numBands; i++) {
+                if (scale[i] != NULL) {
+                    free(scale[i]);
+                }
+            }
+            free(scale);
+        }
         return data->abortFlag;  // We already threw an out of memory exception
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/FcFontManager.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,108 @@
+/*
+ * 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 sun.awt;
+
+import sun.font.FcFontConfiguration;
+import sun.font.FontConfigManager;
+import sun.font.SunFontManager;
+
+/**
+ * A {@link sun.font.FontManager} that uses fontconfig to find system fonts.
+ */
+public class FcFontManager extends SunFontManager {
+
+    private FontConfigManager fcManager = null;
+
+    public synchronized FontConfigManager getFontConfigManager() {
+
+        if (fcManager == null) {
+            fcManager = new FontConfigManager();
+        }
+
+        return fcManager;
+    }
+
+    @Override
+    protected FontConfiguration createFontConfiguration() {
+        FcFontConfiguration fcFontConfig = new FcFontConfiguration(this);
+        if (fcFontConfig.init()) {
+            return fcFontConfig;
+        } else {
+            throw new InternalError("failed to initialize fontconfig");
+        }
+    }
+
+    @Override
+    public FontConfiguration createFontConfiguration(boolean preferLocaleFonts,
+                                                     boolean preferPropFonts) {
+        FcFontConfiguration fcFontConfig =
+            new FcFontConfiguration(this, preferLocaleFonts, preferPropFonts);
+        if (fcFontConfig.init()) {
+            return fcFontConfig;
+        } else {
+            throw new InternalError("failed to initialize fontconfig");
+        }
+    }
+
+    @Override
+    protected String[] getDefaultPlatformFont() {
+        final String[] info = new String[2];
+        getFontConfigManager().initFontConfigFonts(false);
+        FontConfigManager.FcCompFont[] fontConfigFonts =
+            getFontConfigManager().getFontConfigFonts();
+        for (int i=0; i<fontConfigFonts.length; i++) {
+            if ("sans".equals(fontConfigFonts[i].fcFamily) &&
+                0 == fontConfigFonts[i].style) {
+                info[0] = fontConfigFonts[i].firstFont.familyName;
+                info[1] = fontConfigFonts[i].firstFont.fontFile;
+                break;
+            }
+        }
+        /* Absolute last ditch attempt in the face of fontconfig problems.
+         * If we didn't match, pick the first, or just make something
+         * up so we don't NPE.
+         */
+        if (info[0] == null) {
+            if (fontConfigFonts.length > 0 &&
+                fontConfigFonts[0].firstFont.fontFile != null) {
+                info[0] = fontConfigFonts[0].firstFont.familyName;
+                info[1] = fontConfigFonts[0].firstFont.fontFile;
+            } else {
+                info[0] = "Dialog";
+                info[1] = "/dialog.ttf";
+            }
+        }
+        return info;
+    }
+
+    protected native String getFontPathNative(boolean noType1Fonts,
+                                              boolean isX11GE);
+
+    protected synchronized String getFontPath(boolean noType1Fonts) {
+        return getFontPathNative(noType1Fonts, false);
+    }
+
+}
--- a/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -29,11 +29,9 @@
 import java.awt.color.ColorSpace;
 import java.awt.image.*;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
 import sun.security.action.GetIntegerAction;
 import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
 import sun.java2d.opengl.OGLRenderQueue;
-import java.lang.reflect.InvocationTargetException;
 
 public abstract class UNIXToolkit extends SunToolkit
 {
@@ -73,16 +71,16 @@
             if (nativeGTKLoaded != null) {
                 // We've already attempted to load GTK, so just return the
                 // status of that attempt.
-                return nativeGTKLoaded.booleanValue();
+                return nativeGTKLoaded;
 
             } else if (nativeGTKAvailable != null) {
                 // We've already checked the availability of the native GTK
                 // libraries, so just return the status of that attempt.
-                return nativeGTKAvailable.booleanValue();
+                return nativeGTKAvailable;
 
             } else {
                 boolean success = check_gtk();
-                nativeGTKAvailable = Boolean.valueOf(success);
+                nativeGTKAvailable = success;
                 return success;
             }
         }
@@ -99,11 +97,10 @@
     public boolean loadGTK() {
         synchronized (GTK_LOCK) {
             if (nativeGTKLoaded == null) {
-                boolean success = load_gtk();
-                nativeGTKLoaded = Boolean.valueOf(success);
+                nativeGTKLoaded = load_gtk();
             }
         }
-        return nativeGTKLoaded.booleanValue();
+        return nativeGTKLoaded;
     }
 
     /**
@@ -252,6 +249,7 @@
 
     private native void nativeSync();
 
+    @Override
     public void sync() {
         // flush the X11 buffer
         nativeSync();
@@ -266,6 +264,8 @@
      * This requires that the Gnome properties have already been gathered.
      */
     public static final String FONTCONFIGAAHINT = "fontconfig/Antialias";
+
+    @Override
     protected RenderingHints getDesktopAAHints() {
 
         Object aaValue = getDesktopProperty("gnome.Xft/Antialias");
@@ -288,8 +288,8 @@
          * us to default to "OFF". I don't think that's the best guess.
          * So if its !=0 then lets assume AA.
          */
-        boolean aa = Boolean.valueOf(((aaValue instanceof Number) &&
-                                      ((Number)aaValue).intValue() != 0));
+        boolean aa = ((aaValue instanceof Number)
+                        && ((Number) aaValue).intValue() != 0);
         Object aaHint;
         if (aa) {
             String subpixOrder =
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11FontManager.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11FontManager.java	Sun Mar 29 09:20:27 2015 -0400
@@ -54,7 +54,7 @@
 /**
  * The X11 implementation of {@link FontManager}.
  */
-public final class X11FontManager extends SunFontManager {
+public final class X11FontManager extends FcFontManager {
 
     // constants identifying XLFD and font ID fields
     private static final int FOUNDRY_FIELD = 1;
@@ -154,8 +154,6 @@
       */
      private static String[] fontdirs = null;
 
-    private FontConfigManager fcManager = null;
-
     public static X11FontManager getInstance() {
         return (X11FontManager) SunFontManager.getInstance();
     }
@@ -784,51 +782,9 @@
                                       preferLocaleFonts, preferPropFonts);
     }
 
-    public synchronized native String getFontPathNative(boolean noType1Fonts);
-
     protected synchronized String getFontPath(boolean noType1Fonts) {
         isHeadless(); // make sure GE is inited, as its the X11 lock.
-        return getFontPathNative(noType1Fonts);
-    }
-
-    @Override
-    protected String[] getDefaultPlatformFont() {
-        final String[] info = new String[2];
-        getFontConfigManager().initFontConfigFonts(false);
-        FontConfigManager.FcCompFont[] fontConfigFonts =
-            getFontConfigManager().getFontConfigFonts();
-        for (int i=0; i<fontConfigFonts.length; i++) {
-            if ("sans".equals(fontConfigFonts[i].fcFamily) &&
-                0 == fontConfigFonts[i].style) {
-                info[0] = fontConfigFonts[i].firstFont.familyName;
-                info[1] = fontConfigFonts[i].firstFont.fontFile;
-                break;
-            }
-        }
-        /* Absolute last ditch attempt in the face of fontconfig problems.
-         * If we didn't match, pick the first, or just make something
-         * up so we don't NPE.
-         */
-        if (info[0] == null) {
-            if (fontConfigFonts.length > 0 &&
-                fontConfigFonts[0].firstFont.fontFile != null) {
-                info[0] = fontConfigFonts[0].firstFont.familyName;
-                info[1] = fontConfigFonts[0].firstFont.fontFile;
-            } else {
-                info[0] = "Dialog";
-                info[1] = "/dialog.ttf";
-            }
-        }
-        return info;
-    }
-
-    public synchronized FontConfigManager getFontConfigManager() {
-
-        if (fcManager == null) {
-            fcManager = new FontConfigManager();
-        }
-
-        return fcManager;
+        return getFontPathNative(noType1Fonts, true);
     }
 
     @Override
--- a/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java	Sun Mar 29 09:20:27 2015 -0400
@@ -39,10 +39,10 @@
 import java.util.HashSet;
 import java.util.Properties;
 import java.util.Scanner;
+import sun.awt.FcFontManager;
 import sun.awt.FontConfiguration;
 import sun.awt.FontDescriptor;
 import sun.awt.SunToolkit;
-import sun.awt.X11FontManager;
 import sun.font.CompositeFontDescriptor;
 import sun.font.FontManager;
 import sun.font.FontConfigManager.FontConfigInfo;
@@ -92,7 +92,7 @@
 
         setFontConfiguration();
         readFcInfo();
-        X11FontManager fm = (X11FontManager) fontManager;
+        FcFontManager fm = (FcFontManager) fontManager;
         FontConfigManager fcm = fm.getFontConfigManager();
         if (fcCompFonts == null) {
             fcCompFonts = fcm.loadFontConfig();
@@ -194,7 +194,7 @@
     @Override
     public String[] getPlatformFontNames() {
         HashSet<String> nameSet = new HashSet<String>();
-        X11FontManager fm = (X11FontManager) fontManager;
+        FcFontManager fm = (FcFontManager) fontManager;
         FontConfigManager fcm = fm.getFontConfigManager();
         FcCompFont[] fcCompFonts = fcm.loadFontConfig();
         for (int i=0; i<fcCompFonts.length; i++) {
@@ -235,7 +235,7 @@
     @Override
     public CompositeFontDescriptor[] get2DCompositeFontInfo() {
 
-        X11FontManager fm = (X11FontManager) fontManager;
+        FcFontManager fm = (FcFontManager) fontManager;
         FontConfigManager fcm = fm.getFontConfigManager();
         FcCompFont[] fcCompFonts = fcm.loadFontConfig();
 
@@ -368,7 +368,7 @@
     private void writeFcInfo() {
         Properties props = new Properties();
         props.setProperty("version", fileVersion);
-        X11FontManager fm = (X11FontManager) fontManager;
+        FcFontManager fm = (FcFontManager) fontManager;
         FontConfigManager fcm = fm.getFontConfigManager();
         FontConfigInfo fcInfo = fcm.getFontConfigInfo();
         props.setProperty("fcversion", Integer.toString(fcInfo.fcVersion));
@@ -427,7 +427,7 @@
             return;
         }
         Properties props = new Properties();
-        X11FontManager fm = (X11FontManager) fontManager;
+        FcFontManager fm = (FcFontManager) fontManager;
         FontConfigManager fcm = fm.getFontConfigManager();
         try {
             FileInputStream fis = new FileInputStream(fcFile);
--- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRSurfaceData.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRSurfaceData.java	Sun Mar 29 09:20:27 2015 -0400
@@ -548,8 +548,18 @@
                   peer.getColorModel().getPixelSize(), Transparency.OPAQUE);
 
             if (isXRDrawableValid()) {
-                initXRender(XRUtils.
-                    getPictureFormatForTransparency(Transparency.OPAQUE));
+                // If we have a 32 bit color model for the window it needs
+                // alpha to support translucency of the window so we need
+                // to get the ARGB32 XRender picture format else for
+                // 24 bit colormodel we need RGB24 or OPAQUE pictureformat.
+                if (peer.getColorModel().getPixelSize() == 32) {
+                     initXRender(XRUtils.
+                      getPictureFormatForTransparency(Transparency.TRANSLUCENT));
+                 }
+                 else {
+                     initXRender(XRUtils.
+                       getPictureFormatForTransparency(Transparency.OPAQUE));
+                 }
                 makePipes();
             }
         }
--- a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c	Sun Mar 29 09:20:27 2015 -0400
@@ -497,7 +497,7 @@
  * This also frees us from X11 APIs as JRE is required to function in
  * a "headless" mode where there is no Xserver.
  */
-static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
+static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1, jboolean isX11) {
 
     char **fcdirs = NULL, **x11dirs = NULL, **knowndirs = NULL, *path = NULL;
 
@@ -519,6 +519,7 @@
      * be initialised.
      */
 #ifndef HEADLESS
+    if (isX11) { // The following only works in an x11 environment.
 #if defined(__linux__)
     /* There's no headless build on linux ... */
     if (!AWTIsHeadless()) { /* .. so need to call a function to check */
@@ -538,6 +539,7 @@
 #if defined(__linux__)
     }
 #endif
+    }
 #endif /* !HEADLESS */
     path = mergePaths(fcdirs, x11dirs, knowndirs, noType1);
     if (fcdirs != NULL) {
@@ -555,13 +557,13 @@
     return path;
 }
 
-JNIEXPORT jstring JNICALL Java_sun_awt_X11FontManager_getFontPathNative
-(JNIEnv *env, jobject thiz, jboolean noType1) {
+JNIEXPORT jstring JNICALL Java_sun_awt_FcFontManager_getFontPathNative
+(JNIEnv *env, jobject thiz, jboolean noType1, jboolean isX11) {
     jstring ret;
     static char *ptr = NULL; /* retain result across calls */
 
     if (ptr == NULL) {
-        ptr = getPlatformFontPathChars(env, noType1);
+        ptr = getPlatformFontPathChars(env, noType1, isX11);
     }
     ret = (*env)->NewStringUTF(env, ptr);
     return ret;
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -33,6 +33,7 @@
 #include "jvm_md.h"
 #include "sizecalc.h"
 #include <jni_util.h>
+#include "awt.h"
 
 #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
 #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
@@ -890,6 +891,7 @@
      * BadMatch errors which we would normally ignore. The IO error handler
      * is preserved here, too, just for consistency.
     */
+    AWT_LOCK();
     handler = XSetErrorHandler(NULL);
     io_handler = XSetIOErrorHandler(NULL);
 
@@ -926,6 +928,7 @@
 
     XSetErrorHandler(handler);
     XSetIOErrorHandler(io_handler);
+    AWT_UNLOCK();
 
     /* Initialize widget array. */
     for (i = 0; i < _GTK_WIDGET_TYPE_SIZE; i++)
--- a/jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosKey.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/package-info.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Sun Mar 29 09:20:27 2015 -0400
@@ -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/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,11 @@
  */
 package sun.tools.attach;
 
+import com.sun.tools.attach.AttachOperationFailedException;
 import com.sun.tools.attach.AgentLoadException;
 import com.sun.tools.attach.AttachNotSupportedException;
 import com.sun.tools.attach.spi.AttachProvider;
+
 import java.io.InputStream;
 import java.io.IOException;
 import java.io.File;
@@ -189,6 +191,8 @@
         }
 
         if (completionStatus != 0) {
+            // read from the stream and use that as the error message
+            String message = readErrorMessage(sis);
             sis.close();
 
             // In the event of a protocol mismatch then the target VM
@@ -203,7 +207,11 @@
             if (cmd.equals("load")) {
                 throw new AgentLoadException("Failed to load agent library");
             } else {
-                throw new IOException("Command failed in target VM");
+                if (message == null) {
+                    throw new AttachOperationFailedException("Command failed in target VM");
+                } else {
+                    throw new AttachOperationFailedException(message);
+                }
             }
         }
 
--- a/jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c	Sun Mar 29 09:20:27 2015 -0400
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014 SAP AG. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -238,14 +238,14 @@
         len = remaining;
     }
 
-    RESTARTABLE(read(fd, buf+off, len), n);
+    RESTARTABLE(read(fd, buf, len), n);
     if (n == -1) {
         JNU_ThrowIOExceptionWithLastError(env, "read");
     } else {
         if (n == 0) {
             n = -1;     // EOF
         } else {
-            (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off));
+            (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf));
         }
     }
     return n;
--- a/jdk/src/jdk.compiler/share/classes/sun/tools/serialver/SerialVer.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/src/jdk.compiler/share/classes/sun/tools/serialver/SerialVer.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/Version.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.tools.jconsole;
+
+import java.io.PrintStream;
+import sun.tools.jconsole.Messages;
+
+public class Version {
+    private static final String jconsole_version =
+        System.getProperty("java.runtime.version");
+
+    public static void print(PrintStream ps) {
+        printFullVersion(ps);
+
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.runtime.name"),
+                                    System.getProperty("java.runtime.version")));
+
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.vm.name"),
+                                    System.getProperty("java.vm.version"),
+                                    System.getProperty("java.vm.info")));
+
+    }
+
+    public static void printFullVersion(PrintStream ps) {
+        ps.println(Resources.format(Messages.JCONSOLE_VERSION, jconsole_version));
+    }
+
+    static String getVersion() {
+        return jconsole_version;
+    }
+}
--- a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/Version.java.template	Fri Mar 27 12:43:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.tools.jconsole;
-
-import java.io.PrintStream;
-import sun.tools.jconsole.Messages;
-
-public class Version {
-    private static final String jconsole_version =
-        "@@jconsole_version@@";
-
-    public static void print(PrintStream ps) {
-        printFullVersion(ps);
-
-        ps.println(Resources.format(Messages.NAME_AND_BUILD,
-                                    System.getProperty("java.runtime.name"),
-                                    System.getProperty("java.runtime.version")));
-
-        ps.println(Resources.format(Messages.NAME_AND_BUILD,
-                                    System.getProperty("java.vm.name"),
-                                    System.getProperty("java.vm.version"),
-                                    System.getProperty("java.vm.info")));
-
-    }
-
-    public static void printFullVersion(PrintStream ps) {
-        ps.println(Resources.format(Messages.JCONSOLE_VERSION, jconsole_version));
-    }
-
-    static String getVersion() {
-        return jconsole_version;
-    }
-}
--- a/jdk/test/TEST.ROOT	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/TEST.ROOT	Sun Mar 29 09:20:27 2015 -0400
@@ -2,7 +2,7 @@
 # It also contains test-suite configuration information.
 
 # The list of keywords supported in the entire test suite
-keys=2d dnd i18n
+keys=2d dnd i18n intermittent
 
 # Tests that must run in othervm mode
 othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces javax/xml/jaxp/testng/validation
--- a/jdk/test/TEST.groups	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/TEST.groups	Sun Mar 29 09:20:27 2015 -0400
@@ -20,6 +20,31 @@
 #  questions.
 #
 
+###############################################################################
+#
+# Tiered testing definitions
+#
+
+tier1 = \
+    :jdk_lang \
+    :jdk_util \
+    :jdk_math
+
+tier2 = \
+    :jdk_io \
+    :jdk_nio \
+    :jdk_net \
+    :jdk_rmi \
+    :jdk_time \
+    :jdk_security \
+    :jdk_text \
+    :core_tools
+
+###############################################################################
+#
+# Other test definitions; generally smaller granularity than tiers
+#
+
 # java.lang package and VM runtime support
 jdk_lang = \
     java/lang \
--- a/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/com/sun/jdi/RunToExit.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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/com/sun/jndi/ldap/LdapTimeoutTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -26,6 +26,7 @@
  * @run main/othervm LdapTimeoutTest
  * @bug 7094377 8000487 6176036 7056489
  * @summary Timeout tests for ldap
+ * @key intermittent
  */
 
 import java.net.Socket;
--- a/jdk/test/java/awt/Choice/ItemStateChangeTest/ItemStateChangeTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/awt/Choice/ItemStateChangeTest/ItemStateChangeTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,15 +27,17 @@
   @summary awt Choice doesn't fire ItemStateChange when selecting item after select() call
   @author Oleg Pekhovskiy: area=awt-choice
   @library ../../regtesthelpers
+  @library ../../../../lib/testlibrary
   @build Util
+  @build jdk.testlibrary.OSInfo
   @run main ItemStateChangeTest
 */
 
 import test.java.awt.regtesthelpers.Util;
+import jdk.testlibrary.OSInfo;
 
 import java.awt.*;
 import java.awt.event.*;
-import sun.awt.OSInfo;
 
 public class ItemStateChangeTest extends Frame {
 
--- a/jdk/test/java/awt/Desktop/8064934/bug8064934.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/awt/Desktop/8064934/bug8064934.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,10 +25,11 @@
  * @bug 8064934
  * @summary Incorrect Exception message from java.awt.Desktop.open()
  * @author Dmitry Markov
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
  * @run main bug8064934
  */
-import sun.awt.OSInfo;
-
+import jdk.testlibrary.OSInfo;
 import java.awt.*;
 import java.io.File;
 import java.io.IOException;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Frame/MaximizedNormalBoundsUndecoratedTest/MaximizedNormalBoundsUndecoratedTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.awt.Frame;
+import java.awt.Toolkit;
+import java.awt.Dimension;
+/*
+ * @test
+ * @bug 8066436
+ * @summary Set the size of frame. Set extendedState Frame.MAXIMIZED_BOTH and Frame.NORMAL
+ *          sequentially for undecorated Frame and .
+ *          Check if resulted size is equal to original frame size.
+ * @run main MaximizedNormalBoundsUndecoratedTest
+ */
+
+
+public class MaximizedNormalBoundsUndecoratedTest {
+    private Frame frame;
+    public static void main(String args[]) {
+        if (!Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)
+                && !Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.NORMAL)) {
+            return;
+        }
+        MaximizedNormalBoundsUndecoratedTest test = new MaximizedNormalBoundsUndecoratedTest();
+        boolean doPass = true;
+        if( !test.doTest() ) {
+            System.out.println("Maximizing frame not saving correct normal bounds");
+            doPass = false;
+        }
+
+        if(!doPass) {
+            throw new RuntimeException("Maximizing frame not saving correct normal bounds");
+        }
+    }
+
+    boolean doTest() {
+        Dimension beforeMaximizeCalled = new Dimension(300,300);
+
+        frame = new Frame("Test Frame");
+        frame.setUndecorated(true);
+        frame.setFocusable(true);
+        frame.setSize(beforeMaximizeCalled);
+        frame.setVisible(true);
+        frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+        frame.setExtendedState(Frame.NORMAL);
+
+        Dimension afterMaximizedCalled= frame.getBounds().getSize();
+
+        frame.dispose();
+
+        if (beforeMaximizeCalled.equals(afterMaximizedCalled)) {
+            return true;
+        }
+        return false;
+    }
+}
--- a/jdk/test/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,6 +27,8 @@
   @summary REG: Menu does not disappear when clicked, keeping Choice's drop-down open, XToolkit
   @author andrei.dmitriev: area=awt.menu
   @library ../../regtesthelpers
+  @library ../../../../lib/testlibrary
+  @build jdk.testlibrary.OSInfo
   @build Util
   @run main OpensWithNoGrab
 */
@@ -34,7 +36,7 @@
 import java.awt.*;
 import java.awt.event.*;
 
-import sun.awt.OSInfo;
+import jdk.testlibrary.OSInfo;
 import test.java.awt.regtesthelpers.Util;
 
 public class OpensWithNoGrab
--- a/jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java	Sun Mar 29 09:20:27 2015 -0400
@@ -21,8 +21,7 @@
 * questions.
 */
 
-import sun.awt.OSInfo;
-
+import jdk.testlibrary.OSInfo;
 import java.awt.*;
 import java.awt.Robot;
 import java.awt.event.InputEvent;
@@ -38,6 +37,8 @@
  * @bug 8024185
  * @summary Native Mac OS X full screen does not work after showing the splash
  * @library ../
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
  * @build GenerateTestImage
  * @run main GenerateTestImage
  * @author Petr Pchelko area=awt.event
--- a/jdk/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,10 +27,13 @@
   @summary   Tests that key events with modifiers are not swallowed.
   @author    anton.tarasov: area=awt.focus
   @library   ../../../regtesthelpers
+  @library ../../../../../lib/testlibrary
+  @build jdk.testlibrary.OSInfo
   @build     Util
   @run       main SwallowKeyEvents
 */
 
+import jdk.testlibrary.OSInfo;
 import java.awt.AWTException;
 import java.awt.Frame;
 import java.awt.Robot;
@@ -49,7 +52,7 @@
     static Robot r;
 
     public static void main(String[] args) {
-        if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.WINDOWS) {
+        if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) {
             System.out.println("Skipped. Test not for MS Windows.");
             return;
         }
--- a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -41,6 +41,7 @@
  * @library /lib/testlibrary/jsr292 /lib/testlibrary/
  * @compile CatchExceptionTest.java
  * @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest
+ * @key intermittent
  */
 public class CatchExceptionTest {
     private static final List<Class<?>> ARGS_CLASSES;
--- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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);
-            }
-        }
-    }
-
 }
--- a/jdk/test/java/lang/ref/OOMEInReferenceHandler.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/lang/ref/OOMEInReferenceHandler.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,6 +27,7 @@
  * @summary Verify that the reference handler does not die after an OOME allocating the InterruptedException object
  * @run main/othervm -XX:-UseGCOverheadLimit -Xmx24M -XX:-UseTLAB OOMEInReferenceHandler
  * @author peter.levart@gmail.com
+ * @key intermittent
  */
 
 import java.lang.ref.*;
--- a/jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -42,6 +42,7 @@
  * @test
  * @bug 8007373
  * @summary jdk7 backward compatibility serialization problem
+ * @key intermittent
  */
 
 public class Inet6AddressSerializationTest {
--- a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,6 +27,7 @@
  * @summary SocketPermission tests for legacy socket types
  * @library ../../../lib/testlibrary
  * @run testng/othervm/policy=policy SocketPermissionTest
+ * @key intermittent
  */
 import java.io.IOException;
 import java.net.DatagramPacket;
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
  * @bug 4607272 6842687 6878369 6944810 7023403
  * @summary Unit test for AsynchronousSocketChannel
  * @run main Basic -skipSlowConnectTest
+ * @key intermittent
  */
 
 import java.nio.ByteBuffer;
--- a/jdk/test/java/nio/channels/Selector/Wakeup.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/nio/channels/Selector/Wakeup.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
  * @bug 6405995
  * @summary Unit test for selector wakeup and interruption
  * @library ..
+ * @key intermittent
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/channels/ServerSocketChannel/AdaptServerSocket.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/nio/channels/ServerSocketChannel/AdaptServerSocket.java	Sun Mar 29 09:20:27 2015 -0400
@@ -23,6 +23,7 @@
 
 /* @test
  * @summary Unit test for server-socket-channel adaptors
+ * @key intermittent
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh	Sun Mar 29 09:20:27 2015 -0400
@@ -24,12 +24,12 @@
 #
 
 # @test
-# @bug 4673940
-# @bug 4930794
+# @bug 4673940 4930794
 # @summary Unit tests for inetd feature
 #
 # @build StateTest StateTestService EchoTest EchoService CloseTest Launcher Util
 # @run shell run_tests.sh
+# @key intermittent
 
 os=`uname -s`
 
--- a/jdk/test/java/nio/file/FileStore/Basic.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/nio/file/FileStore/Basic.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
  * @bug 4313887 6873621 6979526 7006126 7020517
  * @summary Unit test for java.nio.file.FileStore
  * @library ..
+ * @key intermittent
  */
 
 import java.nio.file.*;
--- a/jdk/test/java/nio/file/Files/InterruptCopy.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/nio/file/Files/InterruptCopy.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
  * @bug 4313887 6993267
  * @summary Unit test for Sun-specific ExtendedCopyOption.INTERRUPTIBLE option
  * @library ..
+ * @key intermittent
  */
 
 import java.nio.file.*;
--- a/jdk/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java	Sun Mar 29 09:20:27 2015 -0400
@@ -39,6 +39,7 @@
  * @build TestLibrary RMID ActivateMe CheckActivateRef_Stub
  * @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=true CheckActivateRef
  * @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=false CheckActivateRef
+ * @key intermittent
  */
 
 import java.io.*;
--- a/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java	Sun Mar 29 09:20:27 2015 -0400
@@ -38,6 +38,7 @@
  * @library ../../testlibrary
  * @build TestLibrary ReferenceRegistryStub
  * @run main/othervm InterfaceHash
+ * @key intermittent
  */
 
 import java.lang.reflect.Constructor;
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java	Sun Mar 29 09:20:27 2015 -0400
@@ -31,6 +31,7 @@
  * @summary GC'ing objects whilst being exported to RMI should not cause exceptions
  * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
  * @run main/othervm GcDuringExport
+ * @key intermittent
  */
 
 import java.rmi.Remote;
--- a/jdk/test/java/util/Currency/CurrencyTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/Currency/CurrencyTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
- *    6488442 7036905 8039317
+ *    6488442 7036905 8039317 8074350 8074351
  * @summary Basic tests for Currency class.
  */
 
@@ -49,6 +49,7 @@
         testFractionDigits();
         testSerialization();
         testDisplayNames();
+        testFundsCodes();
     }
 
     static void testCurrencyCodeValidation() {
@@ -265,4 +266,41 @@
         }
     }
 
+    static void testFundsCodes() {
+        testValidCurrency("BOV");
+        testValidCurrency("CHE");
+        testValidCurrency("CHW");
+        testValidCurrency("CLF");
+        testValidCurrency("COU");
+        testValidCurrency("MXV");
+        testValidCurrency("USN");
+        testValidCurrency("UYI");
+
+        testFractionDigits("BOV", 2);
+        testFractionDigits("CHE", 2);
+        testFractionDigits("CHW", 2);
+        testFractionDigits("CLF", 4);
+        testFractionDigits("COU", 2);
+        testFractionDigits("MXV", 2);
+        testFractionDigits("USN", 2);
+        testFractionDigits("UYI", 0);
+
+        testNumericCode("BOV", 984);
+        testNumericCode("CHE", 947);
+        testNumericCode("CHW", 948);
+        testNumericCode("CLF", 990);
+        testNumericCode("COU", 970);
+        testNumericCode("MXV", 979);
+        testNumericCode("USN", 997);
+        testNumericCode("UYI", 940);
+    }
+
+    static void testNumericCode(String currencyCode, int expectedNumeric) {
+        int numeric = Currency.getInstance(currencyCode).getNumericCode();
+        if (numeric != expectedNumeric) {
+            throw new RuntimeException("Wrong numeric code for currency " +
+                    currencyCode +": expected " + expectedNumeric +
+                    ", got " + numeric);
+        }
+    }
 }
--- a/jdk/test/java/util/Currency/PropertiesTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/Currency/PropertiesTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@
         keys = p.stringPropertyNames();
         Pattern propertiesPattern =
             Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" +
-                "([0-3])\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
+                "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
                 "\\d{2}:\\d{2})?");
         for (String key: keys) {
             String val = p.getProperty(key);
@@ -135,14 +135,20 @@
                 // ignore this
                 continue;
             }
+
+            String code = m.group(1);
+            int numeric = Integer.parseInt(m.group(2));
+            int fraction = Integer.parseInt(m.group(3));
+            if (fraction > 9) {
+                System.out.println("Skipping since the fraction is greater than 9");
+                continue;
+            }
+
             Matcher mAfter = propertiesPattern.matcher(afterVal);
             mAfter.find();
 
-            String code = m.group(1);
             String codeAfter = mAfter.group(1);
-            int numeric = Integer.parseInt(m.group(2));
             int numericAfter = Integer.parseInt(mAfter.group(2));
-            int fraction = Integer.parseInt(m.group(3));
             int fractionAfter = Integer.parseInt(mAfter.group(3));
             if (code.equals(codeAfter) &&
                 (numeric == numericAfter)&&
--- a/jdk/test/java/util/Currency/PropertiesTest.sh	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/Currency/PropertiesTest.sh	Sun Mar 29 09:20:27 2015 -0400
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
 # 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 6332666 6863624 7180362 8003846
+# @bug 6332666 6863624 7180362 8003846 8074350 8074351
 # @summary tests the capability of replacing the currency data with user
 #     specified currency properties file
 # @build PropertiesTest
--- a/jdk/test/java/util/Currency/ValidateISO4217.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/Currency/ValidateISO4217.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
- *     8039317
+ *     8039317 8074350 8074351
  * @summary Validate ISO 4217 data for Currency class.
  */
 
@@ -93,7 +93,7 @@
 
     /* Codes that are obsolete, do not have related country */
     static final String otherCodes =
-        "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CLF-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
+        "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CHE-CHW-CLF-COU-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
 
     static boolean err = false;
 
--- a/jdk/test/java/util/Currency/currency.properties	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/Currency/currency.properties	Sun Mar 29 09:20:27 2015 -0400
@@ -1,20 +1,30 @@
 #
 # Test data for replacing the currency data
 #
-JP=JPZ,123,2
-ES=ESD,877,2
-US=euR,978,2,2001-01-01T00:00:00
+
+# valid entries
+CL=CLF,990,4
 CM=IED,111,2, 2004-01-01T00:70:00
+ES=ESD,877,2
+JP=JPZ,123,2
+MA=MAA,555,5
+MC=MCC,555,6
+MD=MDD,555,7
+ME=MEE,555,8
+MF=MFF,555,9
+NO=EUR   ,978  ,2,  2099-01-01T00:00:00
 SB=EUR,111,2, 2099-01-01T00:00:00
+US=euR,978,2,2001-01-01T00:00:00
 ZZ	=	ZZZ	,	999	,	3
-NO=EUR   ,978  ,2,  2099-01-01T00:00:00
 
 # invalid entries
-GB=123
+DE=2009-01-01T00:00:00,EUR,111,2
+FM=DED,194,2,eeee-01-01T00:00:00
 FR=zzzzz.123
-DE=2009-01-01T00:00:00,EUR,111,2
+GB=123
 IE=euR,111,2,#testcomment
+MG=MGG,990,10
+MX=SSS,493,2,2001-01-01-00-00-00
+PE=EUR   ,978  ,2,  20399-01-01T00:00:00
+MG=MGG,990,10
 =euR,111,2, 2099-01-01-00-00-00
-FM=DED,194,2,eeee-01-01T00:00:00
-PE=EUR   ,978  ,2,  20399-01-01T00:00:00
-MX=SSS,493,2,2001-01-01-00-00-00
--- a/jdk/test/java/util/Currency/tablea1.txt	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/Currency/tablea1.txt	Sun Mar 29 09:20:27 2015 -0400
@@ -5,7 +5,7 @@
 #
 
 # Version
-FILEVERSION=1
+FILEVERSION=2
 DATAVERSION=159
 
 # ISO 4217 currency data
@@ -55,7 +55,7 @@
 CF	XAF	950	0
 TD	XAF	950	0
 CL	CLP	152	0
-#CL	CLF	990	0
+#CL	CLF	990	4
 CN	CNY	156	2
 CX	AUD	36	2
 CC	AUD	36	2
@@ -265,6 +265,7 @@
 #US	USN	997	2
 UM	USD	840	2
 UY	UYU	858	2
+#UY	UYI	940	0
 UZ	UZS	860	2
 VU	VUV	548	0
 VE	VEF	937	2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Properties/Basic.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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!");
+        }
+    }
+}
--- a/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,6 +27,7 @@
 /*
  * @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
--- a/jdk/test/java/util/regex/RegExTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/regex/RegExTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountLargeTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CountTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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);
+        }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/shared/CanWriteSequence.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.Iterator;
+
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.spi.IIORegistry;
+import javax.imageio.spi.ImageWriterSpi;
+import javax.imageio.stream.ImageOutputStream;
+
+/**
+ * @test
+ * @bug 4958064
+ * @author Sergey Bylokhov
+ */
+public final class CanWriteSequence {
+
+    public static void main(final String[] args) throws Exception {
+        final IIORegistry registry = IIORegistry.getDefaultInstance();
+        final Iterator<ImageWriterSpi> iter =
+                registry.getServiceProviders(ImageWriterSpi.class,
+                        provider -> true, true);
+        // Validates all supported ImageWriters
+        while (iter.hasNext()) {
+            final ImageWriter writer = iter.next().createWriterInstance();
+            System.out.println("ImageWriter = " + writer);
+            test(writer);
+        }
+        System.out.println("Test passed");
+    }
+
+    private static void test(final ImageWriter writer) throws Exception {
+        final File file = File.createTempFile("temp", ".img");
+        file.deleteOnExit();
+        final FileOutputStream fos = new FileOutputStream(file);
+        final ImageOutputStream ios = ImageIO.createImageOutputStream(fos);
+        writer.setOutput(ios);
+        final IIOMetadata data = writer.getDefaultStreamMetadata(null);
+
+        if (writer.canWriteSequence()) {
+            writer.prepareWriteSequence(data);
+        } else {
+            try {
+                writer.prepareWriteSequence(data);
+                throw new RuntimeException(
+                        "UnsupportedOperationException was not thrown");
+            } catch (final UnsupportedOperationException ignored) {
+                // expected
+            }
+        }
+        writer.dispose();
+        ios.close();
+    }
+}
\ No newline at end of file
--- a/jdk/test/javax/net/ssl/TLS/TestJSSE.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/net/ssl/TLS/TestJSSE.java	Sun Mar 29 09:20:27 2015 -0400
@@ -70,6 +70,7 @@
  *        -DCLIENT_PROTOCOL=DEFAULT -Djdk.tls.client.protocols=TLSv1.2
  *        -DCIPHER=SSL_RSA_WITH_RC4_128_MD5
  *        TestJSSE javax.net.ssl.SSLHandshakeException
+ * @key intermittent
  *
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,541 @@
+/*
+ * 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
+ * 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.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.security.AccessControlContext;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import javax.security.auth.Subject;
+import javax.security.auth.x500.X500Principal;
+import jdk.testlibrary.ProcessTools;
+
+/**
+ * @test
+ * @bug 8048147
+ * @summary Check if proper AccessControlException is thrown
+ *          in case of nested Subject.doAs() invocations
+ *          when one of protection domains doesn't have permissions
+ *
+ * @library /lib/testlibrary
+ *
+ * @run main NestedActions jar NestedActionsACE.jar
+ *              NestedActionsACE.class Utils.class
+ * @run main NestedActions jar NestedActionsPAE.jar
+ *              NestedActionsPAE.class Utils.class
+ * @run main NestedActions jar NestedActionsOnePrincipal.jar
+ *              NestedActionsOnePrincipal.class Utils.class
+ * @run main NestedActions jar NestedActionsTwoPrincipals.jar
+ *              NestedActionsTwoPrincipals.class Utils.class
+ * @run main NestedActions jar WriteToFileAction.jar
+ *              WriteToFileAction.class
+ * @run main NestedActions jar WriteToFileNegativeAction.jar
+ *              WriteToFileNegativeAction.class
+ * @run main NestedActions jar WriteToFileExceptionAction.jar
+ *              WriteToFileExceptionAction.class
+ * @run main NestedActions jar ReadFromFileAction.jar
+ *              ReadFromFileAction.class
+ * @run main NestedActions jar ReadFromFileNegativeAction.jar
+ *              ReadFromFileNegativeAction.class
+ * @run main NestedActions jar ReadFromFileExceptionAction.jar
+ *              ReadFromFileExceptionAction.class
+ * @run main NestedActions jar ReadPropertyAction.jar
+ *              ReadPropertyAction.class
+ * @run main NestedActions jar ReadPropertyNegativeAction.jar
+ *              ReadPropertyNegativeAction.class
+ * @run main NestedActions jar ReadPropertyExceptionAction.jar
+ *              ReadPropertyExceptionAction.class ReadPropertyException.class
+ *
+ * @run main NestedActions NestedActionsACE policy.expect.ace
+ *              NestedActionsACE.jar WriteToFileNegativeAction.jar
+ *              ReadFromFileNegativeAction.jar ReadPropertyNegativeAction.jar
+ * @run main NestedActions NestedActionsPAE policy.expect.pae
+ *              NestedActionsPAE.jar WriteToFileExceptionAction.jar
+ *              ReadFromFileExceptionAction.jar ReadPropertyExceptionAction.jar
+ * @run main NestedActions NestedActionsOnePrincipal policy.one.principal
+ *              NestedActionsOnePrincipal.jar WriteToFileAction.jar
+ *              ReadFromFileAction.jar ReadPropertyAction.jar
+ * @run main NestedActions NestedActionsTwoPrincipals policy.two.principals
+ *              NestedActionsTwoPrincipals.jar WriteToFileAction.jar
+ *              ReadFromFileAction.jar ReadPropertyAction.jar
+ */
+public class NestedActions {
+
+    static final String file = "NestedActions.tmp";
+    static final String PS = System.getProperty("path.separator");
+    static final String FS = System.getProperty("file.separator");
+    static final String TEST_CLASSES = System.getProperty("test.classes");
+    static final String TEST_SOURCES = System.getProperty("test.src");
+    static final String JAVA_OPTS = System.getProperty("test.java.opts");
+    static final String JAVA = System.getProperty("java.home")
+            + FS + "bin" + FS + "java";
+
+    public static void main(String[] args) throws IOException {
+        if (args.length > 0) {
+            if ("jar".equals(args[0]) && args.length > 2) {
+                createJar(args[1],
+                    Arrays.copyOfRange(args, 2, args.length));
+            } else {
+                runJava(args);
+            }
+        } else {
+            throw new RuntimeException("Wrong parameters");
+        }
+    }
+
+    static void createJar(String dest, String... files) throws IOException {
+        System.out.println("Create " + dest + " with the following content:");
+        try (JarOutputStream jos = new JarOutputStream(
+                new FileOutputStream(dest), new Manifest())) {
+            for (String file : files) {
+                System.out.println("  " + file);
+                jos.putNextEntry(new JarEntry(file));
+                try (FileInputStream fis = new FileInputStream(
+                        TEST_CLASSES + FS + file)) {
+                    fis.transferTo(jos);
+                }
+            }
+        }
+    }
+
+    static void runJava(String[] args) {
+        if (args == null || args.length < 3) {
+            throw new IllegalArgumentException("wrong parameters");
+        }
+
+        List<String> cmds = new ArrayList<>();
+        cmds.add(JAVA);
+        StringBuilder sb = new StringBuilder();
+        cmds.add("-classpath");
+        for (int i=2; i<args.length; i++) {
+            sb.append(args[i]).append(PS);
+        }
+        cmds.add(sb.toString());
+        if (JAVA_OPTS != null && !JAVA_OPTS.isEmpty()) {
+            cmds.add(JAVA_OPTS);
+        }
+        cmds.add("-Djava.security.manager");
+        cmds.add("-Djava.security.policy=" + TEST_SOURCES + FS + args[1]);
+        cmds.add(args[0]);
+        try {
+            ProcessTools.executeCommand(cmds.toArray(new String[cmds.size()]))
+                    .shouldHaveExitValue(0);
+        } catch (Throwable e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
+
+/**
+ * Test for nested Subject.doAs() invocation:
+ *
+ * WriteToFileAction (CN=Duke principal) ->
+ *      ReadFromFileAction (CN=Duke principal) ->
+ *          ReadPropertyAction (CN=Duke principal)
+ *
+ * The test expects AccessControllException.
+ */
+class NestedActionsACE {
+
+    public static void main(String args[]) {
+        Subject subject = new Subject();
+        subject.getPrincipals().add(new X500Principal("CN=Duke"));
+        WriteToFileNegativeAction writeToFile
+                = new WriteToFileNegativeAction(NestedActions.file);
+        Subject.doAs(subject, writeToFile);
+    }
+}
+
+/**
+ * Test for nested Subject.doAs() invocation:
+ *
+ * WriteToFileAction (CN=Duke principal) ->
+ *      ReadFromFileAction (CN=Duke principal) ->
+ *          ReadPropertyAction (CN=Duke principal)
+ *
+ * The test expects PrivilegedActionException
+ * that caused by AccessControlEception.
+ */
+class NestedActionsPAE {
+
+    public static void main(String args[]) {
+        Subject subject = new Subject();
+        subject.getPrincipals().add(new X500Principal("CN=Duke"));
+        try {
+            WriteToFileExceptionAction writeToFile =
+                    new WriteToFileExceptionAction(NestedActions.file);
+            Subject.doAs(subject, writeToFile);
+            throw new RuntimeException(
+                    "Test failed: no PrivilegedActionException thrown");
+        } catch (PrivilegedActionException pae) {
+            System.out.println(
+                    "PrivilegedActionException thrown as expected: "
+                    + pae);
+
+            // check if AccessControlException caused PrivilegedActionException
+            Throwable exception = pae.getException();
+            do {
+                if (!(exception instanceof PrivilegedActionException)) {
+                    break;
+                }
+                exception = ((PrivilegedActionException) exception).
+                        getException();
+            } while (true);
+
+            if (!(exception instanceof ReadPropertyException)) {
+                throw new RuntimeException(
+                        "Test failed: PrivilegedActionException "
+                        + "was not caused by ReadPropertyException");
+            }
+
+            exception = exception.getCause();
+            if (!(exception instanceof AccessControlException)) {
+                throw new RuntimeException(
+                        "Test failed: PrivilegedActionException "
+                        + "was not caused by ReadPropertyException");
+            }
+
+            System.out.println(
+                    "Test passed: PrivilegedActionException "
+                    + "was caused by AccessControlException");
+        }
+    }
+}
+
+/**
+ * Test for nested Subject.doAs() invocation:
+ *
+ * WriteToFileAction (CN=Duke principal) ->
+ *      ReadFromFileAction (CN=Duke principal) ->
+ *          ReadPropertyAction (CN=Duke principal)
+ */
+class NestedActionsOnePrincipal {
+
+    public static void main(String args[]) {
+        Subject subject = new Subject();
+        subject.getPrincipals().add(new X500Principal("CN=Duke"));
+        WriteToFileAction writeToFile =
+                new WriteToFileAction(NestedActions.file);
+        Subject.doAs(subject, writeToFile);
+    }
+}
+
+/**
+ * Test for nested Subject.doAs() invocation:
+ *
+ * WriteToFileAction (CN=Duke principal) ->
+ *      ReadFromFileAction (CN=Duke principal) ->
+ *          ReadPropertyAction (CN=Java principal)
+ */
+class NestedActionsTwoPrincipals {
+
+    public static void main(String args[]) {
+        Subject subject = new Subject();
+        subject.getPrincipals().add(new X500Principal("CN=Duke"));
+        Subject anotherSubject = new Subject();
+        anotherSubject.getPrincipals().add(new X500Principal("CN=Java"));
+        ReadFromFileAction readFromFile
+                = new ReadFromFileAction(NestedActions.file, anotherSubject);
+        WriteToFileAction writeToFile
+                = new WriteToFileAction(NestedActions.file, readFromFile);
+        Subject.doAs(subject, writeToFile);
+    }
+}
+
+/**
+ * Helper class.
+ */
+class Utils {
+
+    static void readFile(String filename) {
+        System.out.println("ReadFromFileAction: try to read " + filename);
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        System.out.println("principals = " + subject.getPrincipals());
+        try (FileInputStream fis = new FileInputStream(filename)) {
+            // do nothing
+        } catch (IOException e) {
+            throw new RuntimeException("Unexpected IOException", e);
+        }
+    }
+
+    static void writeFile(String filename) {
+        System.out.println("WriteToFileAction: try to write to " + filename);
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        System.out.println("principals = " + subject.getPrincipals());
+        try (BufferedOutputStream bos = new BufferedOutputStream(
+                new FileOutputStream(filename))) {
+            bos.write(0);
+            bos.flush();
+        } catch (IOException e) {
+            throw new RuntimeException("Unexpected IOException", e);
+        }
+    }
+
+}
+
+class WriteToFileAction implements PrivilegedAction {
+
+    private final String filename;
+    private final PrivilegedAction nextAction;
+
+    WriteToFileAction(String filename, PrivilegedAction nextAction) {
+        this.filename = filename;
+        this.nextAction = nextAction;
+    }
+
+    WriteToFileAction(String filename) {
+        this(filename, new ReadFromFileAction(filename));
+    }
+
+    @Override
+    public Object run() {
+        Utils.writeFile(filename);
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        return Subject.doAs(subject, nextAction);
+    }
+
+}
+
+class ReadFromFileAction implements PrivilegedAction {
+
+    private final String filename;
+    private final Subject anotherSubject;
+
+    ReadFromFileAction(String filename) {
+        this(filename, null);
+    }
+
+    ReadFromFileAction(String filename, Subject anotherSubject) {
+        this.filename = filename;
+        this.anotherSubject = anotherSubject;
+    }
+
+    @Override
+    public Object run() {
+        Utils.readFile(filename);
+
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        ReadPropertyAction readProperty = new ReadPropertyAction();
+        if (anotherSubject != null) {
+            return Subject.doAs(anotherSubject, readProperty);
+        } else {
+            return Subject.doAs(subject, readProperty);
+        }
+    }
+
+}
+
+class ReadPropertyAction implements PrivilegedAction {
+
+    @Override
+    public java.lang.Object run() {
+        System.out.println("ReadPropertyAction: "
+                + "try to read 'java.class.path' property");
+
+        AccessControlContext acc = AccessController.getContext();
+        Subject s = Subject.getSubject(acc);
+        System.out.println("principals = " + s.getPrincipals());
+        System.out.println("java.class.path = "
+                + System.getProperty("java.class.path"));
+
+        return null;
+    }
+
+}
+
+class WriteToFileNegativeAction implements PrivilegedAction {
+
+    private final String filename;
+
+    public WriteToFileNegativeAction(String filename) {
+        this.filename = filename;
+    }
+
+    @Override
+    public Object run() {
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        System.out.println("principals = " + subject.getPrincipals());
+
+        try {
+            Utils.writeFile(filename);
+            new File(filename).delete();
+            throw new RuntimeException(
+                    "Test failed: no AccessControlException thrown");
+        } catch (AccessControlException ace) {
+            System.out.println(
+                    "AccessControlException thrown as expected: "
+                    + ace.getMessage());
+        }
+
+        ReadFromFileNegativeAction readFromFile
+                = new ReadFromFileNegativeAction(filename);
+        return Subject.doAs(subject, readFromFile);
+    }
+
+}
+
+class ReadFromFileNegativeAction implements PrivilegedAction {
+
+    private final String filename;
+
+    public ReadFromFileNegativeAction(String filename) {
+        this.filename = filename;
+    }
+
+    @Override
+    public Object run() {
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        System.out.println("principals = " + subject.getPrincipals());
+
+        try {
+            Utils.readFile(filename);
+            throw new RuntimeException(
+                    "Test failed: no AccessControlException thrown");
+        } catch (AccessControlException ace) {
+            System.out.println(
+                    "AccessControlException thrown as expected: "
+                    + ace.getMessage());
+        }
+
+        ReadPropertyNegativeAction readProperty =
+                new ReadPropertyNegativeAction();
+        return Subject.doAs(subject, readProperty);
+    }
+
+}
+
+class ReadPropertyNegativeAction implements PrivilegedAction {
+
+    @Override
+    public java.lang.Object run() {
+        System.out.println("Try to read 'java.class.path' property");
+
+        AccessControlContext acc = AccessController.getContext();
+        Subject s = Subject.getSubject(acc);
+        System.out.println("principals = " + s.getPrincipals());
+
+        try {
+            System.out.println("java.class.path = "
+                    + System.getProperty("java.class.path"));
+            throw new RuntimeException(
+                    "Test failed: no AccessControlException thrown");
+        } catch (AccessControlException ace) {
+            System.out.println(
+                    "AccessControlException thrown as expected: "
+                    + ace.getMessage());
+        }
+
+        return null;
+    }
+
+}
+
+class WriteToFileExceptionAction implements PrivilegedExceptionAction {
+
+    private final String filename;
+
+    WriteToFileExceptionAction(String filename) {
+        this.filename = filename;
+    }
+
+    @Override
+    public Object run() throws Exception {
+        Utils.writeFile(filename);
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        ReadFromFileExceptionAction readFromFile =
+                new ReadFromFileExceptionAction(filename);
+        return Subject.doAs(subject, readFromFile);
+    }
+
+}
+
+class ReadFromFileExceptionAction implements PrivilegedExceptionAction {
+
+    private final String filename;
+
+    ReadFromFileExceptionAction(String filename) {
+        this.filename = filename;
+    }
+
+    @Override
+    public Object run() throws Exception {
+        Utils.readFile(filename);
+        AccessControlContext acc = AccessController.getContext();
+        Subject subject = Subject.getSubject(acc);
+        ReadPropertyExceptionAction readProperty =
+                new ReadPropertyExceptionAction();
+        return Subject.doAs(subject, readProperty);
+    }
+
+}
+
+class ReadPropertyExceptionAction implements PrivilegedExceptionAction {
+
+    @Override
+    public java.lang.Object run() throws Exception {
+        System.out.println("Try to read 'java.class.path' property");
+
+        AccessControlContext acc = AccessController.getContext();
+        Subject s = Subject.getSubject(acc);
+        System.out.println("principals = " + s.getPrincipals());
+
+        try {
+            System.out.println("java.class.path = "
+                    + System.getProperty("java.class.path"));
+            throw new RuntimeException(
+                    "Test failed: no AccessControlException thrown");
+        } catch (AccessControlException ace) {
+            System.out.println(
+                    "AccessControlException thrown as expected: "
+                    + ace.getMessage());
+            throw new ReadPropertyException(ace);
+        }
+    }
+
+}
+
+class ReadPropertyException extends Exception {
+
+    ReadPropertyException(Throwable cause) {
+        super(cause);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/Subject/doAs/policy.expect.ace	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,27 @@
+// this code has limited permissions that should cause ACE
+grant codeBase "file:NestedActionsACE.jar" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "modifyPrincipals";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "path.separator", "read";
+    permission java.util.PropertyPermission "file.separator", "read";
+    permission java.util.PropertyPermission "test.classes", "read";
+    permission java.util.PropertyPermission "test.src", "read";
+    permission java.util.PropertyPermission "test.java.opts", "read";
+    permission java.util.PropertyPermission "java.home", "read";
+};
+
+grant codeBase "file:WriteToFileNegativeAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission java.security.AllPermission;
+};
+
+grant codeBase "file:ReadFromFileNegativeAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission java.security.AllPermission;
+};
+
+grant codeBase "file:ReadPropertyNegativeAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission java.security.AllPermission;
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/Subject/doAs/policy.expect.pae	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,19 @@
+grant codeBase "file:NestedActionsPAE.jar" {
+    permission java.security.AllPermission;
+};
+
+grant codeBase "file:WriteToFileExceptionAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission java.security.AllPermission;
+};
+
+grant codeBase "file:ReadFromFileExceptionAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission java.security.AllPermission;
+};
+
+// this code has limited permissions that should cause ACE
+grant codeBase "file:ReadPropertyExceptionAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission javax.security.auth.AuthPermission "getSubject";
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/Subject/doAs/policy.one.principal	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,36 @@
+grant codeBase "file:NestedActionsOnePrincipal.jar" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "modifyPrincipals";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "path.separator", "read";
+    permission java.util.PropertyPermission "file.separator", "read";
+    permission java.util.PropertyPermission "test.classes", "read";
+    permission java.util.PropertyPermission "test.src", "read";
+    permission java.util.PropertyPermission "test.java.opts", "read";
+    permission java.util.PropertyPermission "java.home", "read";
+    permission java.util.PropertyPermission "java.class.path", "read";
+    permission java.io.FilePermission "NestedActions.tmp", "read,write";
+};
+
+grant codeBase "file:WriteToFileAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "java.class.path", "read";
+    permission java.io.FilePermission "NestedActions.tmp", "read,write";
+};
+
+grant codeBase "file:ReadFromFileAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "java.class.path", "read";
+    permission java.io.FilePermission "NestedActions.tmp", "read";
+};
+
+grant codeBase "file:ReadPropertyAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "java.class.path", "read";
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/Subject/doAs/policy.two.principals	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,37 @@
+grant codeBase "file:NestedActionsTwoPrincipals.jar" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "modifyPrincipals";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "path.separator", "read";
+    permission java.util.PropertyPermission "file.separator", "read";
+    permission java.util.PropertyPermission "test.classes", "read";
+    permission java.util.PropertyPermission "test.src", "read";
+    permission java.util.PropertyPermission "test.java.opts", "read";
+    permission java.util.PropertyPermission "java.home", "read";
+    permission java.util.PropertyPermission "java.class.path", "read";
+    permission java.io.FilePermission "NestedActions.tmp", "read,write,delete";
+};
+
+grant codeBase "file:WriteToFileAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission javax.security.auth.AuthPermission "modifyPrincipals";
+    permission java.util.PropertyPermission "java.class.path", "read";
+    permission java.io.FilePermission "NestedActions.tmp", "read,write";
+};
+
+grant codeBase "file:ReadFromFileAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Duke"{
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "java.class.path", "read";
+    permission java.io.FilePermission "NestedActions.tmp", "read";
+};
+
+grant codeBase "file:ReadPropertyAction.jar"
+        Principal javax.security.auth.x500.X500Principal "cn=Java" {
+    permission javax.security.auth.AuthPermission "getSubject";
+    permission javax.security.auth.AuthPermission "doAs";
+    permission java.util.PropertyPermission "java.class.path", "read";
+};
\ No newline at end of file
--- a/jdk/test/javax/swing/JButton/4796987/bug4796987.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/swing/JButton/4796987/bug4796987.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,14 +27,15 @@
  * @summary XP Only: JButton.setBorderPainted() does not work with XP L&F
  * @author Alexander Scherbatiy
  * @library ../../regtesthelpers
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
  * @build Util
  * @run main bug4796987
  */
 
+import jdk.testlibrary.OSInfo;
 import java.awt.*;
 import javax.swing.*;
-import sun.awt.OSInfo;
-import sun.awt.SunToolkit;
 import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
 
 public class bug4796987 {
@@ -51,7 +52,6 @@
     }
 
     private static void testButtonBorder() throws Exception {
-        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
         Robot robot = new Robot();
         robot.setAutoDelay(50);
 
@@ -62,7 +62,7 @@
             }
         });
 
-        toolkit.realSync();
+        robot.waitForIdle();
         Thread.sleep(500);
 
         Point p1 = Util.getCenterPoint(button1);
--- a/jdk/test/javax/swing/JFileChooser/8062561/bug8062561.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/swing/JFileChooser/8062561/bug8062561.java	Sun Mar 29 09:20:27 2015 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+import jdk.testlibrary.OSInfo;
 import java.awt.Robot;
 import java.awt.event.KeyEvent;
 import java.io.File;
@@ -31,12 +32,13 @@
 import javax.swing.JFileChooser;
 import javax.swing.SwingUtilities;
 import javax.swing.filechooser.FileSystemView;
-import sun.awt.OSInfo;
 
 /**
  * @test
  * @bug 8062561
  * @summary File system view returns null default directory
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
  * @run main/othervm bug8062561 GENERATE_POLICY
  * @run main/othervm/policy=security.policy bug8062561 CHECK_DEFAULT_DIR run
  */
@@ -72,7 +74,7 @@
         File defaultDirectory = FileSystemView.getFileSystemView().
                 getDefaultDirectory();
         if (defaultDirectory != null) {
-            throw new RuntimeException("File system default directory is null!");
+            throw new RuntimeException("File system default directory must be null! (FilePermission has not been granted in our policy file).");
         }
     }
     private static volatile JFileChooser fileChooser;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,198 @@
+/*
+ * 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 8072900
+@summary Mouse events are captured by the wrong menu in OS X
+@author Anton Nashatyrev
+@run main WrongSelectionOnMouseOver
+*/
+
+import javax.swing.*;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+
+public class WrongSelectionOnMouseOver implements Runnable {
+
+    CountDownLatch firstMenuSelected = new CountDownLatch(1);
+    CountDownLatch secondMenuMouseEntered = new CountDownLatch(1);
+    CountDownLatch secondMenuSelected = new CountDownLatch(1);
+
+    JMenu m1, m2;
+
+    private UIManager.LookAndFeelInfo laf;
+    JFrame frame1;
+    JFrame frame2;
+
+    public WrongSelectionOnMouseOver(UIManager.LookAndFeelInfo laf) throws Exception {
+        this.laf = laf;
+    }
+
+    private void createUI() throws Exception {
+        System.out.println("Testing UI: " + laf);
+        UIManager.setLookAndFeel(laf.getClassName());
+
+        {
+            frame1 = new JFrame("Frame1");
+            JMenuBar mb = new JMenuBar();
+            m1 = new JMenu("File");
+            JMenuItem i1 = new JMenuItem("Save");
+            JMenuItem i2 = new JMenuItem("Load");
+
+            m1.addMenuListener(new MenuListener() {
+                @Override
+                public void menuSelected(MenuEvent e) {
+                    firstMenuSelected.countDown();
+                    System.out.println("Menu1: menuSelected");
+                }
+
+                @Override
+                public void menuDeselected(MenuEvent e) {
+                    System.out.println("Menu1: menuDeselected");
+                }
+
+                @Override
+                public void menuCanceled(MenuEvent e) {
+                    System.out.println("Menu1: menuCanceled");
+                }
+            });
+
+            frame1.setJMenuBar(mb);
+            mb.add(m1);
+            m1.add(i1);
+            m1.add(i2);
+
+            frame1.setLayout(new FlowLayout());
+            frame1.setBounds(200, 200, 200, 200);
+
+            frame1.setVisible(true);
+        }
+
+        {
+            frame2 = new JFrame("Frame2");
+            JMenuBar mb = new JMenuBar();
+            m2 = new JMenu("File");
+            JMenuItem i1 = new JMenuItem("Save");
+            JMenuItem i2 = new JMenuItem("Load");
+
+            m2.addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseEntered(MouseEvent e) {
+                    secondMenuMouseEntered.countDown();
+                    System.out.println("WrongSelectionOnMouseOver.mouseEntered");
+                }
+            });
+
+            m2.addMenuListener(new MenuListener() {
+                @Override
+                public void menuSelected(MenuEvent e) {
+                    secondMenuSelected.countDown();
+                    System.out.println("Menu2: menuSelected");
+                }
+
+                @Override
+                public void menuDeselected(MenuEvent e) {
+                    System.out.println("Menu2: menuDeselected");
+                }
+
+                @Override
+                public void menuCanceled(MenuEvent e) {
+                    System.out.println("Menu2: menuCanceled");
+                }
+            });
+
+            frame2.setJMenuBar(mb);
+            mb.add(m2);
+            m2.add(i1);
+            m2.add(i2);
+
+            frame2.setLayout(new FlowLayout());
+            frame2.setBounds(400, 200, 200, 200);
+
+            frame2.setVisible(true);
+        }
+    }
+
+    public void disposeUI() {
+        frame1.dispose();
+        frame2.dispose();
+    }
+
+    @Override
+    public void run() {
+        try {
+            if (frame1 == null) {
+                createUI();
+            } else {
+                disposeUI();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public void test() throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(100);
+
+        robot.waitForIdle();
+
+        robot.mouseMove((int) m1.getLocationOnScreen().getX() + 5,
+                (int) m1.getLocationOnScreen().getY() + 5);
+        robot.mousePress(MouseEvent.BUTTON1_MASK);
+        robot.mouseRelease(MouseEvent.BUTTON1_MASK);
+
+        if (!firstMenuSelected.await(5, TimeUnit.SECONDS)) {
+            throw new RuntimeException("Menu has not been selected.");
+        };
+
+        robot.mouseMove((int) m2.getLocationOnScreen().getX() + 5,
+                (int) m2.getLocationOnScreen().getY() + 5);
+
+        if (!secondMenuMouseEntered.await(5, TimeUnit.SECONDS)) {
+            throw new RuntimeException("MouseEntered event missed for the second menu");
+        };
+
+        if (secondMenuSelected.await(1, TimeUnit.SECONDS)) {
+            throw new RuntimeException("The second menu has been selected");
+        };
+    }
+
+    public static void main(final String[] args) throws Exception {
+        for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
+            WrongSelectionOnMouseOver test = new WrongSelectionOnMouseOver(laf);
+            SwingUtilities.invokeAndWait(test);
+            test.test();
+            SwingUtilities.invokeAndWait(test);
+        }
+        System.out.println("Test passed");
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,135 @@
+/*
+ * 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.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE;
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+
+/**
+ * @test
+ * @bug 8073795
+ * @summary JMenuBar has incorrect border when the window is on retina display.
+ * @author Sergey Bylokhov
+ * @run main/othervm MisplacedBorder
+ * @run main/othervm -Dswing.metalTheme=steel MisplacedBorder
+ */
+public final class MisplacedBorder implements Runnable {
+
+    public static final int W = 400;
+    public static final int H = 400;
+
+    public static void main(final String[] args) throws Exception {
+        for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
+            SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
+            SwingUtilities.invokeAndWait(new MisplacedBorder());
+        }
+        System.out.println("Test passed");
+    }
+
+    @Override
+    public void run() {
+        final JMenuBar menubar = new JMenuBar();
+        menubar.add(new JMenu(""));
+        menubar.add(new JMenu(""));
+        final JFrame frame = new JFrame();
+        frame.setUndecorated(true);
+        frame.setJMenuBar(menubar);
+        frame.setSize(W / 3, H / 3);
+        frame.setLocationRelativeTo(null);
+        frame.setVisible(true);
+
+        // draw menu bar using standard order.
+        final BufferedImage bi1 = step1(menubar);
+
+        // draw menu border on top of the menu bar, nothing should be changed.
+        final BufferedImage bi2 = step2(menubar);
+        frame.dispose();
+
+        for (int x = 0; x < W; ++x) {
+            for (int y = 0; y < H; ++y) {
+                if (bi1.getRGB(x, y) != bi2.getRGB(x, y)) {
+                    try {
+                        ImageIO.write(bi1, "png", new File("image1.png"));
+                        ImageIO.write(bi2, "png", new File("image2.png"));
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                    throw new RuntimeException("Failed: wrong color");
+                }
+            }
+        }
+    }
+
+    /**
+     * Draws standard JMenuBar.
+     */
+    private BufferedImage step1(final JMenuBar menubar) {
+        final BufferedImage bi1 = new BufferedImage(W, H, TYPE_INT_ARGB_PRE);
+        final Graphics2D g2d = bi1.createGraphics();
+        g2d.scale(2, 2);
+        g2d.setColor(Color.RED);
+        g2d.fillRect(0, 0, W, H);
+        menubar.paintAll(g2d);
+        g2d.dispose();
+        return bi1;
+    }
+
+    /**
+     * Draws standard JMenuBar and border on top of it.
+     */
+    private BufferedImage step2(final JMenuBar menubar) {
+        final BufferedImage bi2 = new BufferedImage(W, H, TYPE_INT_ARGB_PRE);
+        final Graphics2D g2d2 = bi2.createGraphics();
+        g2d2.scale(2, 2);
+        g2d2.setColor(Color.RED);
+        g2d2.fillRect(0, 0, W, H);
+        menubar.paintAll(g2d2);
+        menubar.getBorder().paintBorder(menubar, g2d2, menubar.getX(), menubar
+                .getX(), menubar.getWidth(), menubar.getHeight());
+        g2d2.dispose();
+        return bi2;
+    }
+
+    private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
+        try {
+            UIManager.setLookAndFeel(laf.getClassName());
+            System.out.println("LookAndFeel: " + laf.getClassName());
+        } catch (ClassNotFoundException | InstantiationException |
+                UnsupportedLookAndFeelException | IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
\ No newline at end of file
--- a/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,9 +27,12 @@
  * @summary Tests duplicate mnemonics
  * @author Peter Zhelezniakov
  * @library ../../regtesthelpers
+ * @library ../../../../lib/testlibrary
+ * @build jdk.testlibrary.OSInfo
  * @build Util
  * @run main bug6827786
  */
+import jdk.testlibrary.OSInfo;
 import java.awt.*;
 import java.awt.event.KeyEvent;
 import javax.swing.*;
@@ -63,7 +66,7 @@
         checkfocus();
 
         // select menu
-        if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.MACOSX) {
+        if (OSInfo.getOSType() == OSInfo.OSType.MACOSX) {
             Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_F);
         } else {
             Util.hitKeys(robot, KeyEvent.VK_ALT, KeyEvent.VK_F);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/*
+ @test
+ @bug 8056151
+ @summary Switching to GTK L&F on-the-fly leads to X Window System error RenderBadPicture
+ @run main/othervm -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel -Dsun.java2d.xrender=T RenderBadPictureCrash
+ */
+
+import java.awt.Color;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import javax.swing.UIManager;
+
+public class RenderBadPictureCrash {
+
+    public static void main(String[] args) throws InterruptedException, InvocationTargetException {
+        SwingUtilities.invokeAndWait(() -> {
+            JFrame f = new JFrame();
+            f.setUndecorated(true);
+            f.setBackground(new Color(0, 0, 0, 0));
+            f.setSize(200, 300);
+            f.setVisible(true);
+
+            try {
+                UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+            } catch (Exception e) {
+                System.err.println(e);
+                System.err.println("Could not set GTKLookAndFeel, skipping this test");
+            } finally {
+                f.dispose();
+            }
+        });
+    }
+
+}
--- a/jdk/test/javax/xml/ws/8033113/WsImportTest.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/xml/ws/8033113/WsImportTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/xml/ws/8046817/GenerateEnumSchema.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/xml/ws/clientjar/TestWsImport.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/javax/xml/ws/ebcdic/WsImportTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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/java2d/XRSurfaceData/ComponentResizeTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import java.awt.Component;
+import javax.swing.JOptionPane;
+
+/**
+ * @test
+ * @bug 8039345
+ * @author Prasanta Sadhukhan
+ * @run main/manual ComponentResizeTest
+ * @summary Resizes JFrame so that component drawn inside it gets repainted
+ * without leaving any trails
+ */
+public class ComponentResizeTest {
+
+    private static JFrame demoFrame;
+
+    public static void testresize() throws Exception {
+        Thread.sleep(5000);
+        for (int i = 0; i < 20; i++) {
+            SwingUtilities.invokeLater(() -> {
+                demoFrame.setSize(demoFrame.getWidth() + 5, demoFrame.getHeight() + 5);
+            });
+            Thread.sleep(1000);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            JOptionPane.showMessageDialog(
+                    (Component) null,
+                    "The test creates a transparent JFrame and resizes the JFrame. Please verify JFrame is transparent and components (like JButton, checkbox) move without leaving any trails",
+                    "information", JOptionPane.INFORMATION_MESSAGE);
+            createAndShowGUI();
+        });
+
+        try {
+            testresize();
+        } finally {
+            SwingUtilities.invokeLater(() -> {
+                demoFrame.dispose();
+            });
+        }
+
+        SwingUtilities.invokeAndWait(() -> {
+            int confirm = JOptionPane.showConfirmDialog(
+                    (Component) null,
+                    "Did the component resize work without leaving any trails?",
+                    "alert", JOptionPane.YES_NO_OPTION);
+            if (confirm == JOptionPane.YES_OPTION) {
+                System.out.println("Test passed");
+            } else {
+                System.out.println("Test failed");
+                throw new RuntimeException("Component resize leaves trail");
+            }
+        });
+    }
+
+    private static void createAndShowGUI() {
+        demoFrame = new JFrame();
+        demoFrame.setSize(300, 300);
+        demoFrame.setLayout(new FlowLayout());
+        demoFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        demoFrame.setUndecorated(true);
+        demoFrame.setBackground(new Color(0f, 0, 0, 0.1f));
+        JCheckBox b = new JCheckBox("Whatever");
+        demoFrame.paintAll(null);
+        b.setOpaque(true);
+        demoFrame.add(b);
+        demoFrame.add(new JButton());
+        demoFrame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/java2d/pisces/OpenJDKFillBug.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,173 @@
+/*
+ * 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.awt.Color;
+import java.awt.Composite;
+import java.awt.CompositeContext;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.awt.image.RasterFormatException;
+
+/**
+ * @test
+ * @bug 8048782
+ * @summary Test program that demonstrates PiscesRendering bug in
+ * OpenJDK 1.7.0.60 (and probably in all other OpenJDK versions, too).
+ */
+
+public class OpenJDKFillBug
+{
+    /**
+     * Test program that demonstrates a bug in OpenJDK 1.7.0.60 (and
+     * probably in all other OpenJDK versions, too). To see the bug, simply run
+     * the 'main' program with OpenJDK. The bug makes the 'g2d.fill'
+     * method fail with the following exception:
+     *
+     * This bug is found in OpenJDK but also is present in OracleJDK
+     * if run with
+     * -Dsun.java2d.renderer=sun.java2d.pisces.PiscesRenderingEngine
+     *
+     * The bug is related to sun.java2d.pisces.PiscesCache constructor
+     * that accepts '(int minx,int miny,int maxx,int maxy)' arguments:
+     * the internal 'bboxX1' and 'bboxY1' are set to values one greater
+     * than given maximum X and Y values. Those maximum values are then
+     * later used in AAShapePipe' class 'renderTiles' method, where a
+     * Y/X loop eventually calls 'GeneralCompositePipe' class
+     * 'renderPathTile' method. In that method, the operation will
+     * eventually call 'IntegerInterleavedRaster' class
+     * 'createWritableChild' method with arguments:
+     *
+     * <UL>
+     * <LI>x=800
+     * <LI>y=0
+     * <LI>width=2 (this value is too high: should be 1)
+     * <LI>height=32
+     * <LI>x0=0
+     * <LI>y0=0
+     * <LI>bandList[]=null
+     * </UL>
+     *
+     * This calls for a sub-raster with bounds that fall outside the
+     * original raster, and therefore the 'createWritableChild' method
+     * correctly throws 'RasterFormatException'.
+     *
+     * The bug is closely related to the use of a custom Composite
+     * implementation, which are quite rare. The application where this
+     * bug was first detected implements a high-quality PDF rendering
+     * engine that needs custom Composite operations to properly
+     * implement PDF advanced color blending and masking operators.
+     */
+
+    public static void main(String args[])
+    {
+        BufferedImage bi = new BufferedImage(801,1202,
+                                             BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+        GeneralPath gp = new GeneralPath();
+        AffineTransform m = new AffineTransform(2.483489907915543,
+                                                0.0,
+                                                0.0,
+                                                -2.4844977263331955,
+                                                0.0,
+                                                1202.0);
+        Composite c = new CustomComposite();
+
+        gp.moveTo(-4.511, -14.349);
+        gp.lineTo(327.489, -14.349);
+        gp.lineTo(327.489, 494.15);
+        gp.lineTo(-4.511, 494.15);
+        gp.closePath();
+
+        g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
+                             RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+        g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
+                             RenderingHints.VALUE_RENDER_QUALITY);
+        g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
+                             RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST,
+                             Integer.valueOf(140));
+        g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
+                             RenderingHints.VALUE_DITHER_ENABLE);
+        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                             RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
+        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                             RenderingHints.VALUE_ANTIALIAS_ON);
+        g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
+                             RenderingHints.VALUE_STROKE_NORMALIZE);
+        g2d.setPaint(Color.red);
+        g2d.setComposite(c);
+        g2d.setTransform(m);
+        try {
+            g2d.fill(gp);
+        } catch (RasterFormatException rfe) {
+            System.out.println("Test failed");
+            throw new RuntimeException("xmax/ymax rounding cause RasterFormatException: " + rfe);
+        }
+        g2d.dispose();
+        System.out.println("Test passed");
+    }
+
+    // === CustomComposite ===
+
+    /**
+     * Dummy custom Composite implementation.
+     */
+
+    public static class CustomComposite implements Composite
+    {
+        @Override
+        public CompositeContext createContext(ColorModel srcColorModel,
+                                              ColorModel dstColorModel,
+                                              RenderingHints hints)
+        {
+            return new CustomCompositeContext();
+        }
+
+        // === CustomCompositeContext ===
+
+        /**
+         * Dummy custom CompositeContext implementation.
+         */
+
+        public static class CustomCompositeContext implements CompositeContext
+        {
+
+            @Override
+            public void dispose()
+            {
+                // NOP
+            }
+
+            @Override
+            public void compose(Raster src,Raster dstIn,WritableRaster dstOut)
+            {
+                // NOP
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/provider/certpath/OCSP/OCSPSingleExtensions.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Sun Mar 29 09:20:27 2015 -0400
@@ -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	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -297,3 +297,4 @@
 ee20efe0255d7ac6e06e88e06f7c72f6c6da7bf9 jdk9-b52
 99ff00581f3633c1787bec21f2a8f3a2ffe57665 jdk9-b53
 ed34864f3b43a7df394fce6c3f0bc86b70a5d686 jdk9-b54
+32a2e724988499e6f68611a65168c5f2fde0f6b9 jdk9-b55
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Sun Mar 29 09:20:27 2015 -0400
@@ -31,10 +31,12 @@
 import java.util.EnumSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
 
 import javax.lang.model.type.*;
 
 import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Types.MapVisitor;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import static com.sun.tools.javac.code.BoundKind.*;
@@ -218,33 +220,81 @@
 
     /** An abstract class for mappings from types to types
      */
-    public static abstract class Mapping {
-        private String name;
-        public Mapping(String name) {
-            this.name = name;
+    public static abstract class TypeMapping<S> extends Types.MapVisitor<S> implements Function<Type, Type> {
+
+        @Override
+        public Type apply(Type type) {
+            return visit(type);
+        }
+
+        List<Type> visit(List<Type> ts, S s) {
+            return ts.map(t -> visit(t, s));
+        }
+
+        @Override
+        public Type visitClassType(ClassType t, S s) {
+            Type outer = t.getEnclosingType();
+            Type outer1 = visit(outer, s);
+            List<Type> typarams = t.getTypeArguments();
+            List<Type> typarams1 = visit(typarams, s);
+            if (outer1 == outer && typarams1 == typarams) return t;
+            else return new ClassType(outer1, typarams1, t.tsym, t.metadata);
+        }
+
+        @Override
+        public Type visitWildcardType(WildcardType wt, S s) {
+            Type t = wt.type;
+            if (t != null)
+                t = visit(t, s);
+            if (t == wt.type)
+                return wt;
+            else
+                return new WildcardType(t, wt.kind, wt.tsym, wt.bound, wt.metadata);
         }
-        public abstract Type apply(Type t);
-        public String toString() {
-            return name;
+
+        @Override
+        public Type visitArrayType(ArrayType t, S s) {
+            Type elemtype = t.elemtype;
+            Type elemtype1 = visit(elemtype, s);
+            if (elemtype1 == elemtype) return t;
+            else return new ArrayType(elemtype1, t.tsym, t.metadata);
+        }
+
+        @Override
+        public Type visitMethodType(MethodType t, S s) {
+            List<Type> argtypes = t.argtypes;
+            Type restype = t.restype;
+            List<Type> thrown = t.thrown;
+            List<Type> argtypes1 = visit(argtypes, s);
+            Type restype1 = visit(restype, s);
+            List<Type> thrown1 = visit(thrown, s);
+            if (argtypes1 == argtypes &&
+                restype1 == restype &&
+                thrown1 == thrown) return t;
+            else return new MethodType(argtypes1, restype1, thrown1, t.tsym);
+        }
+
+        @Override
+        public Type visitCapturedType(CapturedType t, S s) {
+            return visitTypeVar(t, s);
+        }
+
+        @Override
+        public Type visitForAll(ForAll t, S s) {
+            return visit(t.qtype, s);
         }
     }
 
     /** map a type function over all immediate descendants of this type
      */
-    public Type map(Mapping f) {
-        return this;
+    public <Z> Type map(TypeMapping<Z> mapping, Z arg) {
+        return mapping.visit(this, arg);
     }
 
-    /** map a type function over a list of types
+    /** map a type function over all immediate descendants of this type (no arg version)
      */
-    public static List<Type> map(List<Type> ts, Mapping f) {
-        if (ts.nonEmpty()) {
-            List<Type> tail1 = map(ts.tail, f);
-            Type t = f.apply(ts.head);
-            if (tail1 != ts.tail || t != ts.head)
-                return tail1.prepend(t);
-        }
-        return ts;
+    public <Z> Type map(TypeMapping<Z> mapping) {
+        return mapping.visit(this, null);
     }
 
     /** Define a constant type, of the same kind as this type
@@ -775,17 +825,6 @@
             return s.toString();
         }
 
-        public Type map(Mapping f) {
-            //- System.err.println("   (" + this + ").map(" + f + ")");//DEBUG
-            Type t = type;
-            if (t != null)
-                t = f.apply(t);
-            if (t == type)
-                return this;
-            else
-                return new WildcardType(t, kind, tsym, bound, metadata);
-        }
-
         @DefinedBy(Api.LANGUAGE_MODEL)
         public Type getExtendsBound() {
             if (kind == EXTENDS)
@@ -1009,15 +1048,6 @@
                 allparams().isEmpty();
         }
 
-        public Type map(Mapping f) {
-            Type outer = getEnclosingType();
-            Type outer1 = f.apply(outer);
-            List<Type> typarams = getTypeArguments();
-            List<Type> typarams1 = map(typarams, f);
-            if (outer1 == outer && typarams1 == typarams) return this;
-            else return new ClassType(outer1, typarams1, tsym, metadata);
-        }
-
         public boolean contains(Type elem) {
             return
                 elem == this
@@ -1248,12 +1278,6 @@
             };
         }
 
-        public Type map(Mapping f) {
-            Type elemtype1 = f.apply(elemtype);
-            if (elemtype1 == elemtype) return this;
-            else return new ArrayType(elemtype1, tsym, metadata);
-        }
-
         public boolean contains(Type elem) {
             return elem == this || elemtype.contains(elem);
         }
@@ -1345,16 +1369,6 @@
                 restype != null && restype.isErroneous();
         }
 
-        public Type map(Mapping f) {
-            List<Type> argtypes1 = map(argtypes, f);
-            Type restype1 = f.apply(restype);
-            List<Type> thrown1 = map(thrown, f);
-            if (argtypes1 == argtypes &&
-                restype1 == restype &&
-                thrown1 == thrown) return this;
-            else return new MethodType(argtypes1, restype1, thrown1, tsym);
-        }
-
         public boolean contains(Type elem) {
             return elem == this || contains(argtypes, elem) || restype.contains(elem) || contains(thrown, elem);
         }
@@ -1647,10 +1661,6 @@
             return qtype.isErroneous();
         }
 
-        public Type map(Mapping f) {
-            return f.apply(qtype);
-        }
-
         public boolean contains(Type elem) {
             return qtype.contains(elem);
         }
@@ -1820,7 +1830,7 @@
         }
 
         protected void addBound(InferenceBound ib, Type bound, Types types, boolean update) {
-            Type bound2 = toTypeVarMap.apply(bound).baseType();
+            Type bound2 = bound.map(toTypeVarMap).baseType();
             List<Type> prevBounds = bounds.get(ib);
             for (Type b : prevBounds) {
                 //check for redundancy - use strict version of isSameType on tvars
@@ -1831,15 +1841,10 @@
             notifyChange(EnumSet.of(ib));
         }
         //where
-            Type.Mapping toTypeVarMap = new Mapping("toTypeVarMap") {
+            TypeMapping<Void> toTypeVarMap = new TypeMapping<Void>() {
                 @Override
-                public Type apply(Type t) {
-                    if (t.hasTag(UNDETVAR)) {
-                        UndetVar uv = (UndetVar)t;
-                        return uv.inst != null ? uv.inst : uv.qtype;
-                    } else {
-                        return t.map(this);
-                    }
+                public Type visitUndetVar(UndetVar uv, Void _unused) {
+                    return uv.inst != null ? uv.inst : uv.qtype;
                 }
             };
 
@@ -2110,7 +2115,6 @@
         public Type getEnclosingType()           { return this; }
         public Type getReturnType()              { return this; }
         public Type asSub(Symbol sym)            { return this; }
-        public Type map(Mapping f)               { return this; }
 
         public boolean isGenType(Type t)         { return true; }
         public boolean isErroneous()             { return true; }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Sun Mar 29 09:20:27 2015 -0400
@@ -32,6 +32,8 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.WeakHashMap;
+import java.util.function.BiPredicate;
+import java.util.stream.Collector;
 
 import javax.tools.JavaFileObject;
 
@@ -1766,10 +1768,11 @@
 
     // <editor-fold defaultstate="collapsed" desc="cvarLowerBounds">
     public List<Type> cvarLowerBounds(List<Type> ts) {
-        return map(ts, cvarLowerBoundMapping);
+        return ts.map(cvarLowerBoundMapping);
     }
-    private final Mapping cvarLowerBoundMapping = new Mapping("cvarLowerBound") {
-            public Type apply(Type t) {
+        private final TypeMapping<Void> cvarLowerBoundMapping = new TypeMapping<Void>() {
+            @Override
+            public Type visitCapturedType(CapturedType t, Void _unused) {
                 return cvarLowerBound(t);
             }
         };
@@ -1879,9 +1882,15 @@
     /**
      * Mapping to take element type of an arraytype
      */
-    private Mapping elemTypeFun = new Mapping ("elemTypeFun") {
-        public Type apply(Type t) {
-            return elemtype(skipTypeVars(t, false));
+    private TypeMapping<Void> elemTypeFun = new TypeMapping<Void>() {
+        @Override
+        public Type visitArrayType(ArrayType t, Void _unused) {
+            return t.elemtype;
+        }
+
+        @Override
+        public Type visitTypeVar(TypeVar t, Void _unused) {
+            return visit(skipTypeVars(t, false));
         }
     };
 
@@ -2177,7 +2186,7 @@
         }
         }
     // where
-        private SimpleVisitor<Type, Boolean> erasure = new SimpleVisitor<Type, Boolean>() {
+        private TypeMapping<Boolean> erasure = new TypeMapping<Boolean>() {
             private Type combineMetadata(final Type ty,
                                          final TypeMetadata md) {
                 if (!md.isEmpty()) {
@@ -2202,8 +2211,8 @@
                 if (t.isPrimitive())
                     return t; /*fast special case*/
                 else {
-                    Type erased = t.map(recurse ? erasureRecFun : erasureFun);
-                    return combineMetadata(erased, t.getMetadata());
+                    //other cases already handled
+                    return combineMetadata(t, t.getMetadata());
                 }
             }
 
@@ -2223,23 +2232,10 @@
                 Type erased = erasure(t.bound, recurse);
                 return combineMetadata(erased, t.getMetadata());
             }
-
-            @Override
-            public Type visitErrorType(ErrorType t, Boolean recurse) {
-                return t;
-            }
         };
 
-    private Mapping erasureFun = new Mapping ("erasure") {
-            public Type apply(Type t) { return erasure(t); }
-        };
-
-    private Mapping erasureRecFun = new Mapping ("erasureRecursive") {
-        public Type apply(Type t) { return erasureRecursive(t); }
-    };
-
     public List<Type> erasure(List<Type> ts) {
-        return Type.map(ts, erasureFun);
+        return erasure.visit(ts, false);
     }
 
     public Type erasureRecursive(Type t) {
@@ -2247,7 +2243,7 @@
     }
 
     public List<Type> erasureRecursive(List<Type> ts) {
-        return Type.map(ts, erasureRecFun);
+        return erasure.visit(ts, true);
     }
     // </editor-fold>
 
@@ -3177,15 +3173,18 @@
      *  changing all recursive bounds from old to new list.
      */
     public List<Type> newInstances(List<Type> tvars) {
-        List<Type> tvars1 = Type.map(tvars, newInstanceFun);
+        List<Type> tvars1 = tvars.map(newInstanceFun);
         for (List<Type> l = tvars1; l.nonEmpty(); l = l.tail) {
             TypeVar tv = (TypeVar) l.head;
             tv.bound = subst(tv.bound, tvars, tvars1);
         }
         return tvars1;
     }
-    private static final Mapping newInstanceFun = new Mapping("newInstanceFun") {
-            public Type apply(Type t) { return new TypeVar(t.tsym, t.getUpperBound(), t.getLowerBound(), t.getMetadata()); }
+        private static final TypeMapping<Void> newInstanceFun = new TypeMapping<Void>() {
+            @Override
+            public TypeVar visitTypeVar(TypeVar t, Void _unused) {
+                return new TypeVar(t.tsym, t.getUpperBound(), t.getLowerBound(), t.getMetadata());
+            }
         };
     // </editor-fold>
 
@@ -3409,41 +3408,86 @@
     }
 
     /**
+     * Collect types into a new closure (using a @code{ClosureHolder})
+     */
+    public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
+        return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
+                ClosureHolder::add,
+                ClosureHolder::merge,
+                ClosureHolder::closure);
+    }
+    //where
+        class ClosureHolder {
+            List<Type> closure;
+            final boolean minClosure;
+            final BiPredicate<Type, Type> shouldSkip;
+
+            ClosureHolder(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
+                this.closure = List.nil();
+                this.minClosure = minClosure;
+                this.shouldSkip = shouldSkip;
+            }
+
+            void add(Type type) {
+                closure = insert(closure, type, shouldSkip);
+            }
+
+            ClosureHolder merge(ClosureHolder other) {
+                closure = union(closure, other.closure, shouldSkip);
+                return this;
+            }
+
+            List<Type> closure() {
+                return minClosure ? closureMin(closure) : closure;
+            }
+        }
+
+    BiPredicate<Type, Type> basicClosureSkip = (t1, t2) -> t1.tsym == t2.tsym;
+
+    /**
      * Insert a type in a closure
      */
-    public List<Type> insert(List<Type> cl, Type t) {
+    public List<Type> insert(List<Type> cl, Type t, BiPredicate<Type, Type> shouldSkip) {
         if (cl.isEmpty()) {
             return cl.prepend(t);
-        } else if (t.tsym == cl.head.tsym) {
+        } else if (shouldSkip.test(t, cl.head)) {
             return cl;
         } else if (t.tsym.precedes(cl.head.tsym, this)) {
             return cl.prepend(t);
         } else {
             // t comes after head, or the two are unrelated
-            return insert(cl.tail, t).prepend(cl.head);
+            return insert(cl.tail, t, shouldSkip).prepend(cl.head);
         }
     }
 
+    public List<Type> insert(List<Type> cl, Type t) {
+        return insert(cl, t, basicClosureSkip);
+    }
+
     /**
      * Form the union of two closures
      */
-    public List<Type> union(List<Type> cl1, List<Type> cl2) {
+    public List<Type> union(List<Type> cl1, List<Type> cl2, BiPredicate<Type, Type> shouldSkip) {
         if (cl1.isEmpty()) {
             return cl2;
         } else if (cl2.isEmpty()) {
             return cl1;
-        } else if (cl1.head.tsym == cl2.head.tsym) {
-            return union(cl1.tail, cl2.tail).prepend(cl1.head);
+        } else if (shouldSkip.test(cl1.head, cl2.head)) {
+            return union(cl1.tail, cl2.tail, shouldSkip).prepend(cl1.head);
         } else if (cl1.head.tsym.precedes(cl2.head.tsym, this)) {
-            return union(cl1.tail, cl2).prepend(cl1.head);
+            return union(cl1.tail, cl2, shouldSkip).prepend(cl1.head);
         } else if (cl2.head.tsym.precedes(cl1.head.tsym, this)) {
-            return union(cl1, cl2.tail).prepend(cl2.head);
+            return union(cl1, cl2.tail, shouldSkip).prepend(cl2.head);
         } else {
             // unrelated types
-            return union(cl1.tail, cl2).prepend(cl1.head);
+            return union(cl1.tail, cl2, shouldSkip).prepend(cl1.head);
         }
     }
 
+    public List<Type> union(List<Type> cl1, List<Type> cl2) {
+        return union(cl1, cl2, basicClosureSkip);
+    }
+
     /**
      * Intersect two closures
      */
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Sun Mar 29 09:20:27 2015 -0400
@@ -40,11 +40,13 @@
 import com.sun.tools.javac.code.Scope.WriteableScope;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Types.FunctionDescriptorLookupError;
 import com.sun.tools.javac.comp.Check.CheckContext;
 import com.sun.tools.javac.comp.DeferredAttr.AttrMode;
 import com.sun.tools.javac.comp.Infer.InferenceContext;
 import com.sun.tools.javac.comp.Infer.FreeTypeListener;
 import com.sun.tools.javac.jvm.*;
+import com.sun.tools.javac.resources.CompilerProperties.Fragments;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.tree.JCTree.JCPolyExpression.*;
@@ -2871,6 +2873,16 @@
                             names.empty, List.of(fExpr.targets.head), ABSTRACT);
                     if (csym != null) {
                         chk.checkImplementations(env.tree, csym, csym);
+                        try {
+                            //perform an additional functional interface check on the synthetic class,
+                            //as there may be spurious errors for raw targets - because of existing issues
+                            //with membership and inheritance (see JDK-8074570).
+                            csym.flags_field |= INTERFACE;
+                            types.findDescriptorType(csym.type);
+                        } catch (FunctionDescriptorLookupError err) {
+                            resultInfo.checkContext.report(fExpr,
+                                    diags.fragment(Fragments.NoSuitableFunctionalIntfInst(fExpr.targets.head)));
+                        }
                     }
                 } catch (Types.FunctionDescriptorLookupError ex) {
                     JCDiagnostic cause = ex.getDiagnostic();
@@ -2942,7 +2954,7 @@
     public void visitBinary(JCBinary tree) {
         // Attribute arguments.
         Type left = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.lhs, env));
-        Type right = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.rhs, env));
+        Type right = chk.checkNonVoid(tree.rhs.pos(), attribExpr(tree.rhs, env));
         // Find operator.
         Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag(), left, right);
         Type owntype = types.createErrorType(tree.type);
@@ -3722,7 +3734,7 @@
             DeferredAttr.DeferredTypeMap checkDeferredMap =
                 deferredAttr.new DeferredTypeMap(DeferredAttr.AttrMode.CHECK, sym, env.info.pendingResolutionPhase);
 
-            argtypes = Type.map(argtypes, checkDeferredMap);
+            argtypes = argtypes.map(checkDeferredMap);
 
             if (noteWarner.hasNonSilentLint(LintCategory.UNCHECKED)) {
                 chk.warnUnchecked(env.tree.pos(),
@@ -3730,7 +3742,7 @@
                         kindName(sym),
                         sym.name,
                         rs.methodArguments(sym.type.getParameterTypes()),
-                        rs.methodArguments(Type.map(argtypes, checkDeferredMap)),
+                        rs.methodArguments(argtypes.map(checkDeferredMap)),
                         kindName(sym.location()),
                         sym.location());
                owntype = new MethodType(owntype.getParameterTypes(),
@@ -3754,7 +3766,7 @@
                     return new Pair<>(sym, diag);
                 }
             };
-            List<Type> argtypes2 = Type.map(argtypes,
+            List<Type> argtypes2 = argtypes.map(
                     rs.new ResolveDeferredRecoveryMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
             JCDiagnostic errDiag = errSym.getDiagnostic(JCDiagnostic.DiagnosticType.ERROR,
                     env.tree, sym, site, sym.name, argtypes2, typeargtypes);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,6 +27,7 @@
 
 import com.sun.source.tree.LambdaExpressionTree.BodyKind;
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Type.TypeMapping;
 import com.sun.tools.javac.comp.Resolve.ResolveError;
 import com.sun.tools.javac.resources.CompilerProperties.Fragments;
 import com.sun.tools.javac.tree.*;
@@ -44,7 +45,6 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -300,13 +300,6 @@
         }
     };
 
-    DeferredTypeCompleter dummyCompleter = new DeferredTypeCompleter() {
-        public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
-            Assert.check(deferredAttrContext.mode == AttrMode.CHECK);
-            return dt.tree.type = Type.stuckType;
-        }
-    };
-
     /**
      * Policy for detecting stuck expressions. Different criteria might cause
      * an expression to be judged as stuck, depending on whether the check
@@ -849,33 +842,24 @@
     /** an empty deferred attribution context - all methods throw exceptions */
     final DeferredAttrContext emptyDeferredAttrContext;
 
-    /** The AttrMode to descriptive name mapping */
-    private static final EnumMap<AttrMode, String> deferredTypeMapDescriptions;
-    static {
-        deferredTypeMapDescriptions = new EnumMap<>(AttrMode.class);
-        deferredTypeMapDescriptions.put(AttrMode.CHECK, "deferredTypeMap[CHECK]");
-        deferredTypeMapDescriptions.put(AttrMode.SPECULATIVE, "deferredTypeMap[SPECULATIVE]");
-    }
-
     /**
      * Map a list of types possibly containing one or more deferred types
      * into a list of ordinary types. Each deferred type D is mapped into a type T,
      * where T is computed by retrieving the type that has already been
      * computed for D during a previous deferred attribution round of the given kind.
      */
-    class DeferredTypeMap extends Type.Mapping {
+    class DeferredTypeMap extends TypeMapping<Void> {
         DeferredAttrContext deferredAttrContext;
 
         protected DeferredTypeMap(AttrMode mode, Symbol msym, MethodResolutionPhase phase) {
-            super(deferredTypeMapDescriptions.get(mode));
             this.deferredAttrContext = new DeferredAttrContext(mode, msym, phase,
                     infer.emptyContext, emptyDeferredAttrContext, types.noWarnings);
         }
 
         @Override
-        public Type apply(Type t) {
+        public Type visitType(Type t, Void _unused) {
             if (!t.hasTag(DEFERRED)) {
-                return t.map(this);
+                return super.visitType(t, null);
             } else {
                 DeferredType dt = (DeferredType)t;
                 return typeOf(dt);
@@ -928,7 +912,7 @@
                     return chk.checkNonVoid(pos, super.check(pos, found));
                 }
             });
-            return super.apply(dt);
+            return super.visit(dt);
         }
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.comp;
 
+import com.sun.tools.javac.code.Type.TypeMapping;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.JCTypeCast;
 import com.sun.tools.javac.tree.TreeInfo;
@@ -477,7 +478,7 @@
                 restype = syms.objectType;
         }
 
-        List<Type> paramtypes = Type.map(argtypes, new ImplicitArgType(spMethod, resolveContext.step));
+        List<Type> paramtypes = argtypes.map(new ImplicitArgType(spMethod, resolveContext.step));
         List<Type> exType = spMethod != null ?
             spMethod.getThrownTypes() :
             List.of(syms.throwableType); // make it throw all exceptions
@@ -495,9 +496,16 @@
                 (rs.deferredAttr).super(AttrMode.SPECULATIVE, msym, phase);
             }
 
-            public Type apply(Type t) {
-                t = types.erasure(super.apply(t));
-                if (t.hasTag(BOT))
+            @Override
+            public Type visitClassType(ClassType t, Void aVoid) {
+                return types.erasure(t);
+            }
+
+            @Override
+            public Type visitType(Type t, Void _unused) {
+                if (t.hasTag(DEFERRED)) {
+                    return visit(super.visitType(t, null));
+                } else if (t.hasTag(BOT))
                     // nulls type as the marker type Null (which has no instances)
                     // infer as java.lang.Void for now
                     t = types.boxedClass(syms.voidType).type;
@@ -865,7 +873,8 @@
             @Override
             public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
-                List<Type> boundList = uv.getBounds(InferenceBound.UPPER);
+                List<Type> boundList = uv.getBounds(InferenceBound.UPPER).stream()
+                        .collect(infer.types.closureCollector(true, infer.types::isSameType));
                 List<Type> boundListTail = boundList.tail;
                 while (boundList.nonEmpty()) {
                     List<Type> tmpTail = boundListTail;
@@ -2046,23 +2055,19 @@
         List<FreeTypeListener> freetypeListeners = List.nil();
 
         public InferenceContext(List<Type> inferencevars) {
-            this.undetvars = Type.map(inferencevars, fromTypeVarFun);
+            this.undetvars = inferencevars.map(fromTypeVarFun);
             this.inferencevars = inferencevars;
         }
         //where
-            Mapping fromTypeVarFun = new Mapping("fromTypeVarFunWithBounds") {
-                // mapping that turns inference variables into undet vars
-                public Type apply(Type t) {
-                    if (t.hasTag(TYPEVAR)) {
-                        TypeVar tv = (TypeVar)t;
-                        if (tv.isCaptured()) {
-                            return new CapturedUndetVar((CapturedType)tv, types);
-                        } else {
-                            return new UndetVar(tv, types);
-                        }
-                    } else {
-                        return t.map(this);
-                    }
+            TypeMapping<Void> fromTypeVarFun = new TypeMapping<Void>() {
+                @Override
+                public Type visitTypeVar(TypeVar tv, Void aVoid) {
+                    return new UndetVar(tv, types);
+                }
+
+                @Override
+                public Type visitCapturedType(CapturedType t, Void aVoid) {
+                    return new CapturedUndetVar(t, types);
                 }
             };
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Sun Mar 29 09:20:27 2015 -0400
@@ -232,8 +232,7 @@
             }
         }
         String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
-        List<Type> argtypes2 = Type.map(argtypes,
-                    deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
+        List<Type> argtypes2 = argtypes.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
         JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
                 site.tsym, mostSpecificPos, currentResolutionContext.step,
                 methodArguments(argtypes2),
@@ -2259,7 +2258,7 @@
                         (typeargtypes == null || !Type.isErroneous(typeargtypes));
         }
         public List<Type> getArgumentTypes(ResolveError errSym, Symbol accessedSym, Name name, List<Type> argtypes) {
-            return Type.map(argtypes, new ResolveDeferredRecoveryMap(AttrMode.SPECULATIVE, accessedSym, currentResolutionContext.step));
+            return argtypes.map(new ResolveDeferredRecoveryMap(AttrMode.SPECULATIVE, accessedSym, currentResolutionContext.step));
         }
     };
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Sun Mar 29 09:20:27 2015 -0400
@@ -56,6 +56,7 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.Kind.*;
+import static com.sun.tools.javac.code.TypeTag.ARRAY;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.jvm.ClassFile.*;
@@ -2006,6 +2007,15 @@
         }
         if (saveParameterNames)
             setParameterNames(m, type);
+
+        if ((flags & VARARGS) != 0) {
+            final Type last = type.getParameterTypes().last();
+            if (last == null || !last.hasTag(ARRAY)) {
+                m.flags_field &= ~VARARGS;
+                throw badClassFile("malformed.vararg.method", m);
+            }
+        }
+
         return m;
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Sun Mar 29 09:20:27 2015 -0400
@@ -1847,6 +1847,9 @@
 compiler.misc.undecl.type.var=\
     undeclared type variable: {0}
 
+compiler.misc.malformed.vararg.method=\
+    class file contains malformed variable arity method: {0}
+
 compiler.misc.wrong.version=\
     class file has wrong version {0}.{1}, should be {2}.{3}
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java	Sun Mar 29 09:20:27 2015 -0400
@@ -33,6 +33,7 @@
 import java.util.AbstractCollection;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
+import java.util.function.Function;
 import java.util.stream.Collector;
 
 /** A class for generic linked lists. Links are supposed to be
@@ -417,6 +418,17 @@
     }
 
     @SuppressWarnings("unchecked")
+    public <Z> List<Z> map(Function<A, Z> mapper) {
+        if (nonEmpty()) {
+            List<Z> tail1 = tail.map(mapper);
+            Z head1 = mapper.apply(head);
+            if (tail1 != tail || head1 != head)
+                return tail1.prepend(head1);
+        }
+        return (List<Z>)this;
+    }
+
+    @SuppressWarnings("unchecked")
     public static <T> List<T> convert(Class<T> klass, List<?> list) {
         if (list == null)
             return null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8071847/T8071847.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,108 @@
+/*
+ * 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 8071847
+ * @summary Verify proper termination when instance initialization method uses invalid flags
+ * @compile  T8071847.java
+ * @run main T8071847
+*/
+
+
+import java.io.*;
+import java.util.*;
+
+public class T8071847 {
+    String testclass="invalidFlags.class";
+    String testclassHexString =
+    "CAFEBABE00000031000D0A0003000A07000B07000C0100063C696E69743E0100" +
+    "03282956010004436F646501000F4C696E654E756D6265725461626C6501000A" +
+    "536F7572636546696C65010009546573742E6A6176610C0004000501000C696E" +
+    "76616C6964466C6167730100106A6176612F6C616E672F4F626A656374002000" +
+    "02000300000000000100A000040005000100060000001D00010001000000052A" +
+    "B70001B10000000100070000000600010000000100010008000000020009";
+
+    String testJavaFile = "testInvalidFlags.java";
+    String testJavaSource ="public class testInvalidFlags extends invalidFlags {" +
+        "invalidFlags c = null;" +
+        "public testInvalidFlags() {  c = new invalidFlags(); }" +
+        "public static void main(String... args) { " +
+        "new testInvalidFlags();}}";
+
+    public static void main(String[] args) throws Exception {
+        new  T8071847().run();
+    }
+
+    public void run() throws IOException {
+        writeHexFile(testclass,testclassHexString);
+        writeTestFile(testJavaFile, testJavaSource);
+        javac(testJavaFile);
+    }
+
+    File writeTestFile(String fname, String source) throws IOException {
+        File f = new File(fname);
+        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+        out.println(source);
+        out.close();
+        return f;
+    }
+
+    byte[] hexToByte(String str) {
+        char[] CA = str.toCharArray();
+        byte[] byteArry = new byte[str.length()/2];
+        int bi = 0;
+        for (int i = 0; i<CA.length ; i+=2) {
+            char c1 = CA[i], c2=CA[i+1];
+            byteArry[bi++] = (byte)((Character.digit((int)c1,16)<<4) +
+                             Character.digit((int)c2,16));
+        }
+        return byteArry;
+    }
+
+    File writeHexFile(String classFileName, String hexString) throws IOException {
+        File f = new File(classFileName);
+        FileOutputStream output  = new FileOutputStream(f);
+        output.write(hexToByte(hexString));
+        output.close();
+        return f;
+    }
+
+    String javac(String className) {
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+        int rc = 0;
+        List<String> javacArgs = new ArrayList<>();
+        javacArgs.addAll(Arrays.asList("-XDrawDiagnostics", "-cp", ".", "-d", ".", className));
+        rc = com.sun.tools.javac.Main.compile(
+            javacArgs.toArray(new String[javacArgs.size()]),out);
+        out.close();
+        if (rc > 1) {
+            System.out.println(sw.toString());
+            throw new Error("javac " + className + " failed. rc=" + rc);
+        }
+        if (rc != 1 || !sw.toString().contains("compiler.misc.malformed.vararg.method"))
+            throw new RuntimeException("Unexpected output" + sw.toString());
+        return sw.toString();
+    }
+}
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt	Fri Mar 27 12:43:45 2015 +0100
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt	Sun Mar 29 09:20:27 2015 -0400
@@ -87,6 +87,7 @@
 compiler.misc.unable.to.access.file                     # ClassFile
 compiler.misc.undecl.type.var                           # ClassReader
 compiler.misc.unicode.str.not.supported                 # ClassReader
+compiler.misc.malformed.vararg.method                   # ClassReader
 compiler.misc.verbose.retro                             # UNUSED
 compiler.misc.verbose.retro.with                        # UNUSED
 compiler.misc.verbose.retro.with.list                   # UNUSED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/expression/BinopVoidTest.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,14 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 8074148
+ * @summary Attr.visitBinary flags error at wrong position
+ *
+ * @compile/fail/ref=BinopVoidTest.out -XDrawDiagnostics  BinopVoidTest.java
+ */
+
+class BinopVoidTest {
+    void foo() {}
+    int x = 10 + foo();
+    int y = foo() + 10;
+    int z = foo() + foo();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/expression/BinopVoidTest.out	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,5 @@
+BinopVoidTest.java:11:21: compiler.err.void.not.allowed.here
+BinopVoidTest.java:12:16: compiler.err.void.not.allowed.here
+BinopVoidTest.java:13:16: compiler.err.void.not.allowed.here
+BinopVoidTest.java:13:24: compiler.err.void.not.allowed.here
+4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8048838/T8048838.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8048838
+ * @summary type inference performance regression
+ * @compile T8048838.java
+ */
+class T8048838 {
+
+    <T1 extends T2, T2 extends T3, T3 extends T4, T4 extends T5, T5 extends T6, T6 extends T7,
+            T7 extends T8, T8 extends T9, T9 extends T10, T10 extends T11, T11 extends T12,
+            T12 extends T13, T13 extends T14, T14 extends T15, T15 extends T16, T16 extends T17,
+            T17 extends T18, T18 extends T19, T19 extends T20, T20 extends T21, T21 extends T22,
+            T22 extends T23, T23 extends T24, T24 extends T25, T25 extends T26, T26 extends T27,
+            T27 extends T28, T28 extends T29, T29 extends T30, T30 extends T31, T31 extends T32,
+            T32 extends T33, T33 extends T34, T34 extends T35, T35 extends T36, T36 extends T37,
+            T37 extends T38, T38 extends T39, T39 extends T40, T40 extends T41, T41 extends T42,
+            T42 extends T43, T43 extends T44, T44 extends T45, T45 extends T46, T46 extends T47,
+            T47 extends T48, T48 extends T49, T49 extends T50, T50 extends T51, T51 extends T52,
+            T52 extends T53, T53 extends T54, T54 extends T55, T55 extends T56, T56 extends T57,
+            T57 extends T58, T58 extends T59, T59 extends T60, T60 extends T61, T61 extends T62,
+            T62 extends T63, T63 extends T64, T64 extends T65, T65 extends T66, T66 extends T67,
+            T67 extends T68, T68 extends T69, T69 extends T70, T70 extends T71, T71 extends T72,
+            T72 extends T73, T73 extends T74, T74 extends T75, T75 extends T76, T76 extends T77,
+            T77 extends T78, T78 extends T79, T79 extends T80, T80 extends T81, T81 extends T82,
+            T82 extends T83, T83 extends T84, T84 extends T85, T85 extends T86, T86 extends T87,
+            T87 extends T88, T88 extends T89, T89 extends T90, T90 extends T91, T91 extends T92,
+            T92 extends T93, T93 extends T94, T94 extends T95, T95 extends T96, T96 extends T97,
+            T97 extends T98, T98 extends T99, T99 extends T100, T100 extends Integer>
+    T1 foo(T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7, T8 x8, T9 x9, T10 x10, T11 x11, T12 x12,
+           T13 x13, T14 x14, T15 x15, T16 x16, T17 x17, T18 x18, T19 x19, T20 x20, T21 x21, T22 x22,
+           T23 x23, T24 x24, T25 x25, T26 x26, T27 x27, T28 x28, T29 x29, T30 x30, T31 x31, T32 x32,
+           T33 x33, T34 x34, T35 x35, T36 x36, T37 x37, T38 x38, T39 x39, T40 x40, T41 x41, T42 x42,
+           T43 x43, T44 x44, T45 x45, T46 x46, T47 x47, T48 x48, T49 x49, T50 x50, T51 x51, T52 x52,
+           T53 x53, T54 x54, T55 x55, T56 x56, T57 x57, T58 x58, T59 x59, T60 x60, T61 x61, T62 x62,
+           T63 x63, T64 x64, T65 x65, T66 x66, T67 x67, T68 x68, T69 x69, T70 x70, T71 x71, T72 x72,
+           T73 x73, T74 x74, T75 x75, T76 x76, T77 x77, T78 x78, T79 x79, T80 x80, T81 x81, T82 x82,
+           T83 x83, T84 x84, T85 x85, T86 x86, T87 x87, T88 x88, T89 x89, T90 x90, T91 x91, T92 x92,
+           T93 x93, T94 x94, T95 x95, T96 x96, T97 x97, T98 x98, T99 x99, T100 x100) { return null; }
+
+    Object test() {
+        return foo(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, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
+                43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+                64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+                85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100); // type inference expected
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8074381/T8074381a.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,33 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8074381
+ * @summary java.lang.AssertionError during compiling
+ * @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
+ */
+class T8074381a {
+    interface Sup<X> {
+        boolean m(X x);
+    }
+
+    interface Sub<X> extends Sup<String> {
+        boolean m(String s);
+    }
+
+    void testRaw() {
+        Sub s1 = c -> true;
+        Sub s2 = Boolean::new;
+        Sub s3 = new Sub() {
+            @Override
+            public boolean m(String o) { return true; }
+        };
+    }
+
+    void testNonRaw() {
+        Sub<Integer> s1 = c -> true;
+        Sub<Integer> s2 = Boolean::new;
+        Sub<Integer> s3 = new Sub<Integer>() {
+            @Override
+            public boolean m(String o) { return true; }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8074381/T8074381a.out	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,4 @@
+T8074381a.java:17:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
+T8074381a.java:18:18: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: T8074381a.Sub)
+T8074381a.java:19:28: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: T8074381a$1, m(java.lang.Object), T8074381a.Sup
+3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8074381/T8074381b.java	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,44 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8074381
+ * @summary java.lang.AssertionError during compiling
+ * @compile/fail/ref=T8074381b.out -XDrawDiagnostics T8074381b.java
+ */
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+
+class T8074381b {
+
+    @SuppressWarnings("unchecked")
+    public Invocation resolve(Handler handler) {
+        return new Invocation((t) -> handler.handle((String) t));
+    }
+
+    public static class Handler {
+        public void handle(String s) {
+            System.out.println(s);
+        }
+    }
+
+    public static class Invocation<T> {
+        public final ThrowingConsumer<T> consumer;
+
+        public Invocation(final ThrowingConsumer<T> consumer) {
+            this.consumer = consumer;
+        }
+    }
+
+    @FunctionalInterface
+    public interface ThrowingConsumer<T> extends BiConsumer<T,Consumer<Throwable>> {
+        @Override
+        default void accept(final T elem, final Consumer<Throwable> errorHandler) {
+            try {
+                acceptThrows(elem);
+            } catch (final Throwable e) {
+                errorHandler.accept(e);
+            }
+        }
+
+        void acceptThrows(T elem) throws Throwable;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8074381/T8074381b.out	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,2 @@
+T8074381b.java:14:16: compiler.err.cant.apply.symbol: kindname.constructor, Invocation, T8074381b.ThrowingConsumer, @383, kindname.class, T8074381b.Invocation<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.no.suitable.functional.intf.inst: T8074381b.ThrowingConsumer))
+1 error
--- a/make/CompileJavaModules.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ b/make/CompileJavaModules.gmk	Sun Mar 29 09:20:27 2015 -0400
@@ -90,12 +90,16 @@
 
 ################################################################################
 
+java.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
+
+################################################################################
+
 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_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
 
@@ -336,6 +340,7 @@
 
 ################################################################################
 
+jdk.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:-com.sun.tools.*'
 jdk.compiler_COPY := javax.tools.JavaCompilerTool
 jdk.compiler_CLEAN_FILES := $(wildcard \
     $(patsubst %, $(JDK_TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \
--- a/make/Images.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ b/make/Images.gmk	Sun Mar 29 09:20:27 2015 -0400
@@ -494,29 +494,16 @@
 
   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
+  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
+      SRC := $(OUTPUT_ROOT), \
+      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
+      FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
 
-  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
+  SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
 
   $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
-      SRC := $(SUPPORT_OUTPUTDIR)/native, \
-      DEST := $(SYMBOLS_IMAGE_DIR)/gcov/jdk, \
+      SRC := $(OUTPUT_ROOT), \
+      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
       FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
 
   SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
--- a/make/common/JavaCompilation.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ b/make/common/JavaCompilation.gmk	Sun Mar 29 09:20:27 2015 -0400
@@ -369,7 +369,7 @@
 	$(MKDIR) -p $$(@D)
 	export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
 	    | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
-	        -e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \
+	        -e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ 	]*#.*/#/g' \
 	    | $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \
 	    | $(SED) -e '/^#/d' -e '/^$$$$/d' \
 	        -e :a -e '/\\$$$$/N; s/\\\n//; ta' \
--- a/make/common/NativeCompilation.gmk	Fri Mar 27 12:43:45 2015 +0100
+++ b/make/common/NativeCompilation.gmk	Sun Mar 29 09:20:27 2015 -0400
@@ -60,7 +60,7 @@
     -e 's|Note: including file: *||' \
     -e 's|\\|/|g' \
     -e 's|^\([a-zA-Z]\):|$(UNIX_PATH_PREFIX)/\1|g' \
-    -e '/$(subst /,\/,$(TOPDIR))/!d' \
+    -e '\|$(TOPDIR)|I !d' \
     -e 's|$$$$| \\|g' \
     #
 
@@ -153,7 +153,7 @@
 	      exit `cat $$($1_$2_DEP).exitvalue`
 	  $(RM) $$($1_$2_DEP).exitvalue
 	  ($(ECHO) $$@: \\ \
-	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) > $$($1_$2_DEP)
+	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) | $(SORT) -u > $$($1_$2_DEP)
         endif
         # Create a dependency target file from the dependency file.
         # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
@@ -392,12 +392,6 @@
     $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
@@ -415,6 +409,9 @@
     endif
   endif
 
+  # If no C++ flags are explicitly set, default to using the C flags.
+  # After that, we can set additional C++ flags that should not interfere
+  # with the mechanism for copying the C flags by default.
   ifeq ($$($1_CXXFLAGS),)
     $1_CXXFLAGS:=$$($1_CFLAGS)
   endif
@@ -427,6 +424,12 @@
     $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
   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 (NONE, $$($1_OPTIMIZATION))
     $1_EXTRA_CFLAGS += $(C_O_FLAG_NONE)
     $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NONE)
--- a/nashorn/.hgtags	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/.hgtags	Sun Mar 29 09:20:27 2015 -0400
@@ -288,3 +288,4 @@
 fada76c29db9c792ad7127e674ef5337e15d2225 jdk9-b52
 6cd23482ca9bd0caa6bfa6bf9064251178083d17 jdk9-b53
 26460b897225010a4c7664eaff7a71f1156cacb3 jdk9-b54
+b2b332e64b7b2e06e25bccae9c0c0b585a03b4b5 jdk9-b55
--- a/nashorn/samples/findwith.js	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/samples/findwith.js	Sun Mar 29 09:20:27 2015 -0400
@@ -52,7 +52,6 @@
 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);
@@ -92,7 +91,3 @@
 } 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/prettyprinter.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,642 @@
+/*
+ * 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.
+ */
+
+/**
+ * This script is a AST pretty printer for ECMAScript. It uses
+ * Nashorn parser API to parser given script and uses tree visitor
+ * to pretty print the AST to stdout as a script string.
+ */
+
+var File = Java.type("java.io.File");
+var file = arguments.length == 0? new File(__FILE__) : new File(arguments[0]);
+if (! file.isFile()) {
+    print(arguments[0] + " is not a file");
+    exit(1);
+}
+
+// Java classes used
+var ArrayAccess = Java.type("jdk.nashorn.api.tree.ArrayAccessTree");
+var Block = Java.type("jdk.nashorn.api.tree.BlockTree");
+var FunctionDeclaration = Java.type("jdk.nashorn.api.tree.FunctionDeclarationTree");
+var FunctionExpression = Java.type("jdk.nashorn.api.tree.FunctionExpressionTree");
+var Identifier = Java.type("jdk.nashorn.api.tree.IdentifierTree");
+var Kind = Java.type("jdk.nashorn.api.tree.Tree.Kind");
+var MemberSelect = Java.type("jdk.nashorn.api.tree.MemberSelectTree");
+var ObjectLiteral = Java.type("jdk.nashorn.api.tree.ObjectLiteralTree");
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES5_1");
+var System = Java.type("java.lang.System");
+
+// make a nashorn parser
+var parser = Parser.create("-scripting", "--const-as-var");
+
+// symbols for nashorn operators
+var operatorSymbols = {
+    POSTFIX_INCREMENT: "++", 
+    POSTFIX_DECREMENT: "--",
+    PREFIX_INCREMENT: "++", 
+    PREFIX_DECREMENT: "--",
+    UNARY_PLUS: "+",
+    UNARY_MINUS: "-",
+    BITWISE_COMPLEMENT: "~",
+    LOGICAL_COMPLEMENT: "!",
+    DELETE: "delete ",
+    TYPEOF: "typeof ",
+    VOID: "void ", 
+    COMMA: ",",
+    MULTIPLY: "*", 
+    DIVIDE: "/", 
+    REMINDER: "%", 
+    PLUS: "+",
+    MINUS: "-",
+    LEFT_SHIFT: "<<",
+    RIGHT_SHIFT: ">>",
+    UNSIGNED_RIGHT_SHIFT: ">>>",
+    LESS_THAN: "<",
+    GREATER_THAN: ">",
+    LESS_THAN_EQUAL: "<=",
+    GREATER_THAN_EQUAL: ">=", 
+    IN: "in", 
+    EQUAL_TO: "==",
+    NOT_EQUAL_TO: "!=",
+    STRICT_EQUAL_TO: "===",
+    STRICT_NOT_EQUAL_TO: "!==",
+    AND: "&",
+    XOR: "^",
+    OR: "|", 
+    CONDITIONAL_AND: "&&", 
+    CONDITIONAL_OR: "||",
+    MULTIPLY_ASSIGNMENT: "*=",
+    DIVIDE_ASSIGNMENT: "/=",
+    REMINDER_ASSIGNMENT: "%=",
+    PLUS_ASSIGNMENT: "+=",
+    MINUS_ASSIGNMENT: "-=",
+    LEFT_SHIFT_ASSIGNMENT: "<<=",
+    RIGHT_SHIFT_ASSIGNMENT: ">>=",
+    UNSIGNED_RIGHT_SHIFT_ASSIGNMENT: ">>>=",
+    AND_ASSIGNMENT: "&=",
+    XOR_ASSIGNMENT: "^=",
+    OR_ASSIGNMENT: "|="
+};
+
+function operatorOf(kind) {
+     var name = kind.name();
+     if (name in operatorSymbols) {
+         return operatorSymbols[name];
+     }
+     throw "invalid operator: " + name;
+}
+
+var gprint = print;
+
+function prettyPrint(file) {
+    var ast = parser.parse(file, gprint);
+    if (!ast) {
+        // failed to parse. don't print anything!
+        return;
+    }
+
+    // AST visitor
+    var visitor;
+    // current indent level
+    var indentLevel = 0;
+    var out = System.out;
+
+    function print(obj) {
+        out.print(String(obj));
+    }
+
+    function println(obj) {
+        obj?  out.println(String(obj)) : out.println();
+    }
+
+    // semicolon and end-of-line
+    function eol() {
+        println(";");
+    }
+
+    // print indentation - 4 spaces per level
+    function indent() {
+        for (var i = 0; i < indentLevel; i++) {
+            // 4 spaces per indent level
+            print("    ");
+        }
+    }
+
+    // escape string literals
+    function escapeString(str) {
+        // FIXME: incomplete, revisit again!
+        return str.replace(/[\\"']/g, '\\$&')
+    }
+
+    // print a single statement (could be a block too)
+    function printStatement(stat, extra, end) {
+        if (stat instanceof Block) {
+            println(" {");
+            printStatements(stat.statements, extra);
+            indent();
+            print('}');
+            typeof end != "undefined"? print(end) : println();
+        } else {
+            println();
+            indentLevel++;
+            try {
+                stat.accept(visitor, extra);
+            } finally {
+                indentLevel--;
+            }
+        }
+    }
+
+    // print a statement list
+    function printStatements(stats, extra) {
+        indentLevel++;
+        try {
+            for each (var stat in stats) {
+                stat.accept(visitor, extra);
+            }
+        } finally {
+            indentLevel--;
+        }
+    }
+
+    // function arguments, array literal elements.
+    function printCommaList(args, extra) {
+        var len = args.length;
+        for (var i = 0; i < len; i++) {
+            args[i].accept(visitor, extra);
+            if (i != len - 1) {
+                print(", ");
+            }
+        }
+    }
+
+    // print function declarations and expressions
+    function printFunction(func, extra, end) {
+        // extra lines around function declarations for clarity
+        var funcDecl = (func instanceof FunctionDeclaration);
+        if (funcDecl) {
+            println();
+            indent();
+        }
+        print("function ");
+        if (func.name) {
+            print(func.name);
+        }
+        printFunctionBody(func, extra, end);
+        if (funcDecl) {
+            println();
+        }
+    }
+
+    // print function declaration/expression body
+    function printFunctionBody(func, extra, end) {
+        print('(');
+        var params = func.parameters;
+        if (params) {
+            printCommaList(params);
+        }
+        print(')');
+        printStatement(func.body, extra, end);
+    }
+
+    // print object literal property
+    function printProperty(node, extra, comma) {
+        var key = node.key;
+        var val = node.value;
+        var getter = node.getter;
+        var setter = node.setter;
+
+        if (getter) {
+            print("get ");
+        } else if (setter) {
+            print("set ");
+        }
+
+        if (typeof key == "string") {
+            print(key);
+        } else {
+            key.accept(visitor, extra);
+        }
+
+        if (val) {
+            print(": ");
+            if (val instanceof FunctionExpression) {
+                printFunction(val, extra, comma? ',' : undefined);
+            } else {
+                val.accept(visitor, extra);
+                if (comma) print(',');
+            }
+        } else if (getter) {
+            printFunctionBody(getter, extra, comma? ',' : undefined);
+        } else if (setter) {
+            printFunctionBody(setter, extra, comma? ',' : undefined);
+        }
+    }
+
+
+    ast.accept(visitor = new (Java.extend(SimpleTreeVisitor)) {
+         visitAssignment: function(node, extra) {
+             node.variable.accept(visitor, extra);
+             print(" = ");
+             node.expression.accept(visitor, extra);
+         },
+
+         visitCompoundAssignment: function(node, extra) {
+             node.variable.accept(visitor, extra);
+             print(' ' + operatorOf(node.kind) + ' ');
+             node.expression.accept(visitor, extra);
+         },
+
+         visitBinary: function(node, extra) {
+             node.leftOperand.accept(visitor, extra);
+             print(' ' + operatorOf(node.kind) + ' ');
+             node.rightOperand.accept(visitor, extra);
+         },
+
+         visitBlock: function(node, extra) {
+             indent();
+             println('{');
+             printStatements(node.statements, extra);
+             indent();
+             println('}');
+         },
+
+         visitBreak: function(node, extra) {
+             indent();
+             print("break");
+             if (node.label) {
+                 print(' ' + node.label);
+             }
+             eol();
+         },
+
+         visitCase: function(node, extra) {
+             var expr = node.expression;
+             indent();
+             if (expr) {
+                 print("case ");
+                 expr.accept(visitor, extra);
+                 println(':');
+             } else {
+                 println("default:");
+             }
+
+             printStatements(node.statements, extra);
+         },
+
+         visitCatch: function(node, extra) {
+             indent();
+             print("catch (" + node.parameter.name);
+             var cond = node.condition;
+             if (cond) {
+                 print(" if ");
+                 cond.accept(visitor, extra);
+             }
+             print(')');
+             printStatement(node.block);
+         },
+
+         visitConditionalExpression: function(node, extra) {
+             print('(');
+             node.condition.accept(visitor, extra);
+             print(" ? ");
+             node.trueExpression.accept(visitor, extra);
+             print(" : ");
+             node.falseExpression.accept(visitor, extra);
+             print(')');
+         },
+
+         visitContinue: function(node, extra) {
+             indent();
+             print("continue");
+             if (node.label) {
+                 print(' ' + node.label);
+             }
+             eol();
+         },
+
+         visitDebugger: function(node, extra) {
+             indent();
+             print("debugger");
+             eol();
+         },
+
+         visitDoWhileLoop: function(node, extra) {
+             indent();
+             print("do");
+             printStatement(node.statement, extra);
+             indent();
+             print("while (");
+             node.condition.accept(visitor, extra);
+             print(')');
+             eol();
+         },
+
+         visitExpressionStatement: function(node, extra) {
+             indent();
+             var expr = node.expression;
+             var objLiteral = expr instanceof ObjectLiteral;
+             if (objLiteral) {
+                 print('(');
+             }
+
+             expr.accept(visitor, extra);
+             if (objLiteral) {
+                 print(')');
+             }
+             eol();
+         },
+
+         visitForLoop: function(node, extra) {
+             indent();
+             print("for (");
+             if (node.initializer) {
+                node.initializer.accept(visitor, extra);
+             }
+
+             print(';');
+             if (node.condition) {
+                node.condition.accept(visitor, extra);
+             }
+             print(';');
+             if (node.update) {
+                node.update.accept(visitor, extra);
+             }
+             print(')');
+             printStatement(node.statement);
+         },
+
+         visitForInLoop: function(node, extra) {
+             indent();
+             print("for ");
+             if (node.forEach) {
+                 print("each ");
+             }
+             print('(');
+             node.variable.accept(visitor, extra);
+             print(" in ");
+             node.expression.accept(visitor, extra);
+             print(')');
+             printStatement(node.statement);
+         },
+
+         visitFunctionCall: function(node, extra) {
+             var func = node.functionSelect;
+             // We need parens around function selected
+             // in many non-simple cases. Eg. function
+             // expression created and called immediately.
+             // Such parens are not preserved in AST and so
+             // introduce here.
+             var simpleFunc =
+                 (func instanceof ArrayAccess) ||
+                 (func instanceof Identifier) ||
+                 (func instanceof MemberSelect);
+             if (! simpleFunc) {
+                 print('(');
+             }
+             func.accept(visitor, extra);
+             if (! simpleFunc) {
+                 print(')');
+             }
+             print('(');
+             printCommaList(node.arguments, extra);
+             print(')');
+         },
+
+         visitFunctionDeclaration: function(node, extra) {
+             printFunction(node, extra);
+         },
+
+         visitFunctionExpression: function(node, extra) {
+             printFunction(node, extra);
+         },
+
+         visitIdentifier: function(node, extra) {
+             print(node.name);
+         },
+
+         visitIf: function(node, extra) {
+             indent();
+             print("if (");
+             node.condition.accept(visitor, extra);
+             print(')');
+             printStatement(node.thenStatement);
+             var el = node.elseStatement;
+             if (el) {
+                 indent();
+                 print("else");
+                 printStatement(el);
+             }
+         },
+
+         visitArrayAccess: function(node, extra) {
+             node.expression.accept(visitor, extra);
+             print('[');
+             node.index.accept(visitor, extra);
+             print(']');
+         },
+
+         visitArrayLiteral: function(node, extra) {
+             print('[');
+             printCommaList(node.elements);
+             print(']');
+         },
+
+         visitLabeledStatement: function(node, extra) {
+             indent();
+             print(node.label);
+             print(':');
+             printStatement(node.statement);
+         },
+
+         visitLiteral: function(node, extra) {
+             var val = node.value;
+             if (typeof val == "string") {
+                 print("'" + escapeString(val) + "'");
+             } else {
+                 print(val);
+             }
+         },
+
+         visitParenthesized: function(node, extra) {
+             print('(');
+             node.expression.accept(visitor, extra);
+             print(')');
+         },
+
+         visitReturn: function(node, extra) {
+             indent();
+             print("return");
+             if (node.expression) {
+                 print(' ');
+                 node.expression.accept(visitor, extra);
+             }
+             eol();
+         },
+
+         visitMemberSelect: function(node, extra) {
+             node.expression.accept(visitor, extra);
+             print('.' + node.identifier);
+         },
+
+         visitNew: function(node, extra) {
+             print("new ");
+             node.constructorExpression.accept(visitor, extra);
+         },
+
+         visitObjectLiteral: function(node, extra) {
+             println('{');
+             indentLevel++;
+             try {
+                 var props = node.properties;
+                 var len = props.length;
+                 for (var p = 0; p < len; p++) {
+                     var last = (p == len - 1);
+                     indent();
+                     printProperty(props[p], extra, !last);
+                     println();
+                 }
+             } finally {
+                 indentLevel--;
+             }
+             indent();
+             print('}');
+         },
+
+         visitRegExpLiteral: function(node, extra) {
+             print('/' + node.pattern + '/');
+             print(node.options);
+         },
+
+         visitEmptyStatement: function(node, extra) {
+             indent();
+             eol();
+         },
+
+         visitSwitch: function(node, extra) {
+             indent();
+             print("switch (");
+             node.expression.accept(visitor, extra);
+             println(") {");
+             indentLevel++;
+             try {
+                 for each (var c in node.cases) {
+                     c.accept(visitor, extra);
+                 }
+             } finally {
+                 indentLevel--;
+             }
+             indent();
+             println('}');
+         },
+
+         visitThrow: function(node, extra) {
+             indent();
+             print("throw ");
+             node.expression.accept(visitor, extra);
+             eol();
+         },
+
+         visitCompilationUnit: function(node, extra) {
+             for each (var stat in node.sourceElements) {
+                 stat.accept(visitor, extra);
+             }
+         },
+
+         visitTry: function(node, extra) {
+             indent();
+             print("try");
+             printStatement(node.block);
+             var catches = node.catches;
+             for each (var c in catches) {
+                 c.accept(visitor, extra);
+             }
+             var finallyBlock = node.finallyBlock;
+             if (finallyBlock) {
+                 indent();
+                 print("finally");
+                 printStatement(finallyBlock);
+             }
+         },
+
+         visitInstanceOf: function(node, extra) {
+             node.expression.accept(visitor, extra);
+             print(" instanceof ");
+             node.type.accept(visitor, extra);
+         },
+
+         visitUnary: function(node, extra) {
+             var kind = node.kind;
+             var prefix = kind != Kind.POSTFIX_INCREMENT && kind != Kind.POSTFIX_DECREMENT;
+             if (prefix) {
+                 print(operatorOf(kind));
+             }
+             node.expression.accept(visitor, extra);
+             if (!prefix) {
+                 print(operatorOf(kind));
+             }
+         },
+
+         visitVariable: function(node, extra) {
+             indent();
+             print("var " + node.name);
+             var init = node.initializer;
+             if (init) {
+                 print(" = ");
+                 if (init instanceof FunctionExpression) {
+                     printFunction(init, extra, "");
+                 } else {
+                     init.accept(visitor, extra);
+                 }
+             }
+             eol();
+         },
+
+         visitWhileLoop: function(node, extra) {
+             indent();
+             print("while (");
+             node.condition.accept(visitor, extra);
+             print(')');
+             printStatement(node.statement);
+         },
+
+         visitWith: function(node, extra) {
+             indent();
+             print("with (");
+             node.scope.accept(visitor, extra);
+             print(')');
+             printStatement(node.statement);
+         }
+    }, null);
+}
+
+prettyPrint(file);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java	Sun Mar 29 09:20:27 2015 -0400
@@ -44,6 +44,7 @@
      *
      * @return the condition expression
      */
+    @Override
     ExpressionTree getCondition();
 
     /**
@@ -51,5 +52,6 @@
      *
      * @return the statement
      */
+    @Override
     StatementTree getStatement();
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java	Sun Mar 29 09:20:27 2015 -0400
@@ -57,6 +57,7 @@
      *
      * @return the statement
      */
+    @Override
     StatementTree getStatement();
 
     /**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTreeImpl.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTreeImpl.java	Sun Mar 29 09:20:27 2015 -0400
@@ -43,7 +43,7 @@
         assert node.getInit() instanceof FunctionNode : "function expected";
         funcNode = (FunctionNode)node.getInit();
         assert funcNode.isDeclared() : "function declaration expected";
-        funcName = node.getName().getName();
+        funcName = funcNode.isAnonymous()? null : node.getName().getName();
         this.params = params;
         this.body = body;
     }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java	Sun Mar 29 09:20:27 2015 -0400
@@ -25,6 +25,7 @@
 package jdk.nashorn.api.tree;
 
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.BinaryNode;
@@ -92,7 +93,7 @@
 
         final Block body = node.getBody();
         return new CompilationUnitTreeImpl(node,
-                translateStats(body != null? body.getStatements() : null));
+                translateStats(body != null? getOrderedStatements(body.getStatements()) : null));
     }
 
     @Override
@@ -103,25 +104,7 @@
 
     @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;
+        return handleBlock(block, false);
     }
 
     @Override
@@ -245,7 +228,7 @@
 
         final List<? extends ExpressionTree> paramTrees
                     = translateExprs(functionNode.getParameters());
-        final BlockTree blockTree = (BlockTree) translateBlock(functionNode.getBody());
+        final BlockTree blockTree = (BlockTree) translateBlock(functionNode.getBody(), true);
         curExpr = new FunctionExpressionTreeImpl(functionNode, paramTrees, blockTree);
 
         return false;
@@ -420,7 +403,7 @@
 
             final List<? extends ExpressionTree> paramTrees
                     = translateExprs(funcNode.getParameters());
-            final BlockTree blockTree = (BlockTree) translateBlock(funcNode.getBody());
+            final BlockTree blockTree = (BlockTree) translateBlock(funcNode.getBody(), true);
             curStat = new FunctionDeclarationTreeImpl(varNode, paramTrees, blockTree);
         } else {
             curStat = new VariableTreeImpl(varNode, translateExpr(initNode));
@@ -453,14 +436,51 @@
     }
 
     private StatementTree translateBlock(final Block blockNode) {
+        return translateBlock(blockNode, false);
+    }
+
+    private StatementTree translateBlock(final Block blockNode, final boolean sortStats) {
         if (blockNode == null) {
             return null;
         }
         curStat = null;
-        blockNode.accept(this);
+        handleBlock(blockNode, sortStats);
         return curStat;
     }
 
+    private boolean handleBlock(final Block block, final boolean sortStats) {
+        // 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;
+                }
+                default: {
+                    // fall through
+                    break;
+                }
+            }
+        }
+
+        final List<? extends Statement> stats = block.getStatements();
+        curStat = new BlockTreeImpl(block,
+            translateStats(sortStats? getOrderedStatements(stats) : stats));
+        return false;
+    }
+
+    private List<? extends Statement> getOrderedStatements(final List<? extends Statement> stats) {
+        final List<? extends Statement> statList = new ArrayList<>(stats);
+        statList.sort(Comparator.comparingInt(Node::getSourceOrder));
+        return statList;
+    }
+
     private List<? extends StatementTree> translateStats(final List<? extends Statement> stats) {
         if (stats == null) {
             return null;
@@ -511,7 +531,7 @@
         return curStat;
     }
 
-    private IdentifierTree translateIdent(final IdentNode ident) {
+    private static IdentifierTree translateIdent(final IdentNode ident) {
         return new IdentifierTreeImpl(ident);
     }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParserImpl.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParserImpl.java	Sun Mar 29 09:20:27 2015 -0400
@@ -139,7 +139,7 @@
         }
     }
 
-    private CompilationUnitTree translate(final FunctionNode node) {
+    private static CompilationUnitTree translate(final FunctionNode node) {
         return new IRTranslator().translate(node);
     }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java	Sun Mar 29 09:20:27 2015 -0400
@@ -43,6 +43,7 @@
      *
      * @return the condition expression
      */
+    @Override
     ExpressionTree getCondition();
 
     /**
@@ -50,5 +51,6 @@
      *
      * @return the statement contained
      */
+    @Override
     StatementTree getStatement();
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java	Sun Mar 29 09:20:27 2015 -0400
@@ -183,6 +183,17 @@
         return start;
     }
 
+    /**
+     * Integer to sort nodes in source order. This order is
+     * used by parser API to sort statements in correct order.
+     * By default, this is the start position of this node.
+     *
+     * @return int code to sort this node.
+     */
+    public int getSourceOrder() {
+        return getStart();
+    }
+
     @Override
     protected Object clone() {
         try {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/VarNode.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/VarNode.java	Sun Mar 29 09:20:27 2015 -0400
@@ -45,6 +45,13 @@
     /** Is this a var statement (as opposed to a "var" in a for loop statement) */
     private final int flags;
 
+    /**
+     * source order id to be used for this node. If this is -1, then we
+     * the default which is start position of this node. See also the
+     * method Node::getSourceOrder.
+     */
+    private final int sourceOrder;
+
     /** Flag for ES6 LET declaration */
     public static final int IS_LET                       = 1 << 0;
 
@@ -71,6 +78,7 @@
 
     private VarNode(final VarNode varNode, final IdentNode name, final Expression init, final int flags) {
         super(varNode);
+        this.sourceOrder = -1;
         this.name = init == null ? name : name.setIsInitializedHere();
         this.init = init;
         this.flags = flags;
@@ -79,22 +87,42 @@
     /**
      * Constructor
      *
-     * @param lineNumber line number
-     * @param token      token
-     * @param finish     finish
-     * @param name       name of variable
-     * @param init       init node or null if just a declaration
-     * @param flags      flags
+     * @param lineNumber  line number
+     * @param token       token
+     * @param finish      finish
+     * @param name        name of variable
+     * @param init        init node or null if just a declaration
+     * @param flags       flags
      */
     public VarNode(final int lineNumber, final long token, final int finish, final IdentNode name, final Expression init, final int flags) {
+        this(lineNumber, token, -1, finish, name, init, flags);
+    }
+
+    /**
+     * Constructor
+     *
+     * @param lineNumber  line number
+     * @param token       token
+     * @param sourceOrder source order
+     * @param finish      finish
+     * @param name        name of variable
+     * @param init        init node or null if just a declaration
+     * @param flags       flags
+     */
+    public VarNode(final int lineNumber, final long token, final int sourceOrder, final int finish, final IdentNode name, final Expression init, final int flags) {
         super(lineNumber, token, finish);
-
+        this.sourceOrder = sourceOrder;
         this.name  = init == null ? name : name.setIsInitializedHere();
         this.init  = init;
         this.flags = flags;
     }
 
     @Override
+    public int getSourceOrder() {
+        return sourceOrder == -1? super.getSourceOrder() : sourceOrder;
+    }
+
+    @Override
     public boolean isAssignment() {
         return hasInit();
     }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java	Sun Mar 29 09:20:27 2015 -0400
@@ -26,7 +26,9 @@
 package jdk.nashorn.internal.objects;
 
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+
 import java.nio.ByteBuffer;
+
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
 import jdk.nashorn.internal.objects.annotations.Function;
@@ -101,7 +103,7 @@
         }
 
         if (args.length == 0) {
-            throw new RuntimeException("missing length argument");
+            return new NativeArrayBuffer(0);
         }
 
         return new NativeArrayBuffer(JSType.toInt32(args[0]));
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java	Sun Mar 29 09:20:27 2015 -0400
@@ -1066,6 +1066,10 @@
      * @param isStatement True if a statement (not used in a FOR.)
      */
     private List<VarNode> variableStatement(final TokenType varType, final boolean isStatement) {
+        return variableStatement(varType, isStatement, -1);
+    }
+
+    private List<VarNode> variableStatement(final TokenType varType, final boolean isStatement, final int sourceOrder) {
         // VAR tested in caller.
         next();
 
@@ -1104,7 +1108,7 @@
             }
 
             // Allocate var node.
-            final VarNode var = new VarNode(varLine, varToken, finish, name.setIsDeclaredHere(), init, varFlags);
+            final VarNode var = new VarNode(varLine, varToken, sourceOrder, finish, name.setIsDeclaredHere(), init, varFlags);
             vars.add(var);
             appendStatement(var);
 
@@ -1211,6 +1215,10 @@
     private void forStatement() {
         final long forToken = token;
         final int forLine = line;
+        // start position of this for statement. This is used
+        // for sort order for variables declared in the initialzer
+        // part of this 'for' statement (if any).
+        final int forStart = Token.descPosition(forToken);
         // When ES6 for-let is enabled we create a container block to capture the LET.
         final int startLine = start;
         final ParserContextBlockNode outer = useBlockScope() ? newBlock() : null;
@@ -1243,7 +1251,7 @@
             switch (type) {
             case VAR:
                 // Var declaration captured in for outer block.
-                vars = variableStatement(type, false);
+                vars = variableStatement(type, false, forStart);
                 break;
             case SEMICOLON:
                 break;
@@ -1253,12 +1261,12 @@
                         flags |= ForNode.PER_ITERATION_SCOPE;
                     }
                     // LET/CONST declaration captured in container block created above.
-                    vars = variableStatement(type, false);
+                    vars = variableStatement(type, false, forStart);
                     break;
                 }
                 if (env._const_as_var && type == CONST) {
                     // Var declaration captured in for outer block.
-                    vars = variableStatement(TokenType.VAR, false);
+                    vars = variableStatement(TokenType.VAR, false, forStart);
                     break;
                 }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java	Sun Mar 29 09:20:27 2015 -0400
@@ -27,7 +27,6 @@
 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;
@@ -595,7 +594,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 reduce such busy-loop relinking while the function is being recompiled on a different thread.
+     * basically does is minimize 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
@@ -603,27 +602,20 @@
      * function can't be further deoptimized).
      */
     private synchronized HandleAndAssumptions getValidOptimisticInvocation(final Supplier<MethodHandle> invocationSupplier) {
-        for(int i = 0; i < 2; ++i) {
+        for(;;) {
             final MethodHandle handle = invocationSupplier.get();
             final SwitchPoint assumptions = canBeDeoptimized() ? optimismInfo.optimisticAssumptions : null;
-            if(i == 0 && assumptions != null && assumptions.hasBeenInvalidated()) {
+            if(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, 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.
+                // 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.
                 try {
-                    wait(1000L);
+                    wait();
                 } catch (final InterruptedException e) {
                     // Intentionally ignored. There's nothing meaningful we can do if we're interrupted
                 }
@@ -631,7 +623,6 @@
                 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/PropertyMap.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java	Sun Mar 29 09:20:27 2015 -0400
@@ -330,12 +330,15 @@
      * Indicate that proto itself has changed in hierarchy somewhere.
      */
     synchronized void invalidateAllProtoGetSwitchPoints() {
-        if (protoGetSwitches != null && !protoGetSwitches.isEmpty()) {
-            if (Context.DEBUG) {
-                protoInvalidations += protoGetSwitches.size();
+        if (protoGetSwitches != null) {
+            final int size = protoGetSwitches.size();
+            if (size > 0) {
+                if (Context.DEBUG) {
+                    protoInvalidations += size;
+                }
+                SwitchPoint.invalidateAll(protoGetSwitches.values().toArray(new SwitchPoint[size]));
+                protoGetSwitches.clear();
             }
-            SwitchPoint.invalidateAll(protoGetSwitches.values().toArray(new SwitchPoint[protoGetSwitches.values().size()]));
-            protoGetSwitches.clear();
         }
     }
 
@@ -375,7 +378,8 @@
         }
     }
 
-    // Update the free slots bitmap for a property that has been deleted and/or added.
+    // Update the free slots bitmap for a property that has been deleted and/or added. This method is not synchronized
+    // as it is always invoked on a newly created instance.
     private void updateFreeSlots(final Property oldProperty, final Property newProperty) {
         // Free slots bitset is possibly shared with parent map, so we must clone it before making modifications.
         boolean freeSlotsCloned = false;
@@ -425,7 +429,7 @@
      *
      * @return New {@link PropertyMap} with {@link Property} added.
      */
-    public PropertyMap addProperty(final Property property) {
+    public synchronized PropertyMap addProperty(final Property property) {
         if (listeners != null) {
             listeners.propertyAdded(property);
         }
@@ -434,9 +438,9 @@
         if (newMap == null) {
             final PropertyHashMap newProperties = properties.immutableAdd(property);
             newMap = new PropertyMap(this, newProperties);
-            addToHistory(property, newMap);
             newMap.updateFlagsAndBoundaries(property);
             newMap.updateFreeSlots(null, property);
+            addToHistory(property, newMap);
         }
 
         return newMap;
@@ -449,7 +453,7 @@
      *
      * @return New {@link PropertyMap} with {@link Property} removed or {@code null} if not found.
      */
-    public PropertyMap deleteProperty(final Property property) {
+    public synchronized PropertyMap deleteProperty(final Property property) {
         if (listeners != null) {
             listeners.propertyDeleted(property);
         }
@@ -881,8 +885,7 @@
      * @param newProto New prototype object to replace oldProto.
      * @return New {@link PropertyMap} with prototype changed.
      */
-    public PropertyMap changeProto(final ScriptObject newProto) {
-
+    public synchronized PropertyMap changeProto(final ScriptObject newProto) {
         final PropertyMap nextMap = checkProtoHistory(newProto);
         if (nextMap != null) {
             return nextMap;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java	Sun Mar 29 09:20:27 2015 -0400
@@ -109,7 +109,10 @@
      */
     public static void main(final String[] args) {
         try {
-            System.exit(main(System.in, System.out, System.err, args));
+            final int exitCode = main(System.in, System.out, System.err, args);
+            if (exitCode != SUCCESS) {
+                System.exit(exitCode);
+            }
         } catch (final IOException e) {
             System.err.println(e); //bootstrapping, Context.err may not exist
             System.exit(IO_ERROR);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8075090.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,72 @@
+/*
+ * 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-8075090: Add tests for the basic failure of try/finally compilation
+ *
+ * @test
+ * @run
+ */
+
+(function() {
+    var finallyExpected = false;
+    try {
+        for(var i = 0; i < 2; ++i) {
+            if(i == 1) {
+                continue;
+            }
+        }
+        finallyExpected = true;
+    } finally {
+        Assert.assertTrue(finallyExpected);
+    }
+})();
+
+(function() {
+    var finallyExpected = false;
+    try {
+        for(var i = 0; i < 2; ++i) {
+            if(i == 1) {
+                break;
+            }
+        }
+        finallyExpected = true;
+    } finally {
+        Assert.assertTrue(finallyExpected);
+    }
+})();
+
+(function() {
+    var finallyExpected = false;
+    try {
+        L1: {
+            if ((function(){return true})()) {
+                break L1;
+            }
+            Assert.fail(); // unreachable
+        }
+        finallyExpected = true;
+    } finally {
+        Assert.assertTrue(finallyExpected);
+    }
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8075207.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8075207: Nashorn parser API returns StatementTree objects in out of order
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var ExpressionStatementTree = Java.type("jdk.nashorn.api.tree.ExpressionStatementTree");
+var FunctionDeclarationTree = Java.type("jdk.nashorn.api.tree.FunctionDeclarationTree");
+var VariableTree = Java.type("jdk.nashorn.api.tree.VariableTree");
+
+var parser = Parser.create();
+
+var ast = parser.parse("hello.js", <<CODE
+
+var hello = 'hello';
+
+function print_hello() {
+    var x = 2;
+    print(hello);
+    function inner_func() {}
+    var y = function() {
+        var PI = Math.PI;
+        function inner2() {}
+        var E = Math.E;
+    }
+}
+
+var hello = "hello 2";
+
+CODE, print);
+
+var stats = ast.sourceElements;
+Assert.assertTrue(stats.get(0) instanceof VariableTree);
+Assert.assertTrue(stats.get(1) instanceof FunctionDeclarationTree);
+Assert.assertTrue(stats.get(2) instanceof VariableTree);
+
+var print_hello = stats.get(1);
+Assert.assertEquals(print_hello.name, "print_hello");
+var print_hello_stats = print_hello.body.statements;
+Assert.assertTrue(print_hello_stats.get(0) instanceof VariableTree);
+Assert.assertTrue(print_hello_stats.get(1) instanceof ExpressionStatementTree);
+Assert.assertTrue(print_hello_stats.get(2) instanceof FunctionDeclarationTree);
+Assert.assertTrue(print_hello_stats.get(3) instanceof VariableTree);
+
+var anonFunc = print_hello_stats.get(3).initializer;
+var anonFunc_stats = anonFunc.body.statements;
+Assert.assertTrue(anonFunc_stats.get(0) instanceof VariableTree);
+Assert.assertTrue(anonFunc_stats.get(1) instanceof FunctionDeclarationTree);
+Assert.assertTrue(anonFunc_stats.get(2) instanceof VariableTree);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8075448.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8075448: nashorn parser API returns init variable tree object of a for
+ * loop after for loop statement tree object 
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var ForLoopTree = Java.type("jdk.nashorn.api.tree.ForLoopTree");
+var VariableTree = Java.type("jdk.nashorn.api.tree.VariableTree");
+var parser = Parser.create();
+
+var code = <<EOF
+for (var i = 0; i < 10; i++)
+    print("hello");
+EOF;
+
+var ast = parser.parse("test.js", code, print);
+var stats = ast.sourceElements;
+
+Assert.assertTrue(stats[0] instanceof VariableTree);
+Assert.assertEquals(stats[0].name, "i");
+Assert.assertTrue(stats[1] instanceof ForLoopTree);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8075454.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8075454: Anonymous functions have internal names exposed via parser API
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var parser = Parser.create();
+
+var ast = parser.parse("test.js", <<EOF
+
+function(x) {
+  return x*x
+}
+
+EOF, print);
+
+Assert.assertNull(ast.sourceElements[0].name);
--- a/nashorn/test/script/basic/typedarrays.js	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/test/script/basic/typedarrays.js	Sun Mar 29 09:20:27 2015 -0400
@@ -28,6 +28,17 @@
  * @run
  */
 
+//JDK-8066217, constructor for arraybuffer not behaving as per spec
+function checkLength(ab, l) {
+    if (ab.byteLength != l) {
+        throw "length error: " + ab.byteLength + " != " + l;
+    }
+}
+checkLength(new ArrayBuffer(), 0);
+checkLength(new ArrayBuffer(0), 0);
+checkLength(new ArrayBuffer(1024), 1024);
+checkLength(new ArrayBuffer(1,2,3), 1);
+checkLength(new ArrayBuffer([17]), 17);
 
 var typeDefinitions = [
 Int8Array,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parser-args.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /**
+  * @bug 8068303
+  * @test
+  * @option -scripting
+  * @run
+  */
+
+load(__DIR__ + "/../assert.js")
+
+var Parser = Java.type('jdk.nashorn.api.tree.Parser')
+
+
+var code = <<EOF
+    const a= 1;
+EOF
+
+try {
+    Parser.create().parse("const.js", code, null)
+    fail("Parser need to throw exception there")
+} catch (e) {}
+
+try {
+    Parser.create("--const-as-var").parse("const.js", code, null)
+} catch (e) {
+    fail("Parser failed with exception :" + e)
+}
+
+var code = <<EOF
+    try {
+        that()
+    } catch (e if e instanceof TypeError) {
+        handle()
+    } catch (e) {
+        rest()
+    }
+EOF
+
+try {
+    Parser.create("-nse").parse("const.js", code, null)
+    fail("Parser need to throw exception there")
+} catch (e) {
+}
+
+try {
+    Parser.create().parse("extension.js", code, null)
+} catch (e) {
+    fail("Parser failed with exception :" + e)
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/parser.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,92 @@
+/*
+ * 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 8068303
+  * @option -scripting
+  * @run
+  */
+
+load(__DIR__ + "/../assert.js")
+
+var Parser = Java.type('jdk.nashorn.api.tree.Parser')
+var Nashorn = Java.type('jdk.nashorn.api.scripting.NashornScriptEngineFactory')
+var File = java.io.File
+var Reader = java.io.FileReader
+
+
+var test_dir = __DIR__ + "/parsertests"
+var files = new File(test_dir).listFiles()
+
+// File source
+for (var i in files) {
+    var parser = Parser.create("-scripting", "--const-as-var", "-doe")
+    try {
+        var tree = parser.parse(files[i], null);
+        Assert.assertNotNull(tree);
+    }
+    catch (e) {
+        fail("Parser failed with message :" + e)
+    }
+}
+
+// Reader source
+for (var i in files) {
+    var parser =  Parser.create("-scripting", "--const-as-var", "-doe")
+    try {
+        var tree = parser.parse(files[i].getName(), new Reader(files[i]), null)
+        Assert.assertNotNull(tree);
+    } catch (e) {
+        fail("Parser failed with message :" + e)
+    }
+
+}
+
+// URL source
+for (var i in files) {
+    var parser =  Parser.create("-scripting", "--const-as-var", "-doe")
+    try {
+        var tree = parser.parse(files[i].toURI().toURL(), null)
+        Assert.assertNotNull(tree);
+    } catch (e) {
+        fail("Parser failed with message :" + e)
+    }
+}
+
+// ScriptObjectMirror
+
+for (var i in files) {
+    var parser =  Parser.create("-scripting", "--const-as-var", "-doe")
+    var engine = new Nashorn().getScriptEngine("-scripting", "--const-as-var", "-doe")
+    try {
+        engine.compile(new Reader(files[i]))
+        var mirror = engine.createBindings()
+        mirror['name'] = mirror['script'] = files[i].getName()
+        var tree = parser.parse(mirror, null)
+        Assert.assertNotNull(tree);
+    } catch (e) {
+        fail("Parser failed with message :" + e)
+    }
+}
+
--- a/nashorn/test/script/nosecurity/parserapi.js.EXPECTED	Fri Mar 27 12:43:45 2015 +0100
+++ b/nashorn/test/script/nosecurity/parserapi.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -1364,32 +1364,6 @@
       ]
     },
     {
-      "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",
@@ -1495,6 +1469,32 @@
       "endPosition": "1347",
       "kind": "EXPRESSION_STATEMENT",
       "startPosition": "1333"
+    },
+    {
+      "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": []
     }
   ],
   "sourceName": "parsertests/functions.js",
@@ -3976,6 +3976,17 @@
   "kind": "COMPILATION_UNIT",
   "sourceElements": [
     {
+      "expression": {
+        "endPosition": "1133",
+        "kind": "STRING_LITERAL",
+        "value": "use strict",
+        "startPosition": "1123"
+      },
+      "endPosition": "1133",
+      "kind": "EXPRESSION_STATEMENT",
+      "startPosition": "1123"
+    },
+    {
       "endPosition": "1165",
       "kind": "FUNCTION",
       "name": "f",
@@ -4000,17 +4011,6 @@
       "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",
@@ -4919,808 +4919,6 @@
       "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",
@@ -6991,6 +6189,808 @@
       "startPosition": "1972"
     },
     {
+      "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": {
         "endPosition": "3909",
         "kind": "FUNCTION_INVOCATION",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/array_access.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 representation array access tree.
+ * 
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+    array[1]
+
+    { array[test()] }
+
+    function a () {
+        array[null]
+    }
+
+    var x = {
+        test1 : array[-1],
+        test2 : [array[array[NaN]]]
+    }
+EOF
+
+parse("array_access.js", code, "-nse", new (Java.extend(visitor, {
+    visitArrayAccess : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/array_access.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,109 @@
+[
+  {
+    "expression": {
+      "endPosition": "9",
+      "kind": "IDENTIFIER",
+      "name": "array",
+      "startPosition": "4"
+    },
+    "endPosition": "12",
+    "kind": "ARRAY_ACCESS",
+    "index": {
+      "endPosition": "11",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "10"
+    },
+    "startPosition": "4"
+  },
+  {
+    "expression": {
+      "endPosition": "25",
+      "kind": "IDENTIFIER",
+      "name": "array",
+      "startPosition": "20"
+    },
+    "endPosition": "33",
+    "kind": "ARRAY_ACCESS",
+    "index": {
+      "endPosition": "32",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "30",
+        "kind": "IDENTIFIER",
+        "name": "test",
+        "startPosition": "26"
+      },
+      "arguments": [],
+      "startPosition": "26"
+    },
+    "startPosition": "20"
+  },
+  {
+    "expression": {
+      "endPosition": "70",
+      "kind": "IDENTIFIER",
+      "name": "array",
+      "startPosition": "65"
+    },
+    "endPosition": "76",
+    "kind": "ARRAY_ACCESS",
+    "index": {
+      "endPosition": "75",
+      "kind": "NULL_LITERAL",
+      "value": "null",
+      "startPosition": "71"
+    },
+    "startPosition": "65"
+  },
+  {
+    "expression": {
+      "endPosition": "119",
+      "kind": "IDENTIFIER",
+      "name": "array",
+      "startPosition": "114"
+    },
+    "endPosition": "123",
+    "kind": "ARRAY_ACCESS",
+    "index": {
+      "expression": {
+        "endPosition": "122",
+        "kind": "NUMBER_LITERAL",
+        "value": "1",
+        "startPosition": "121"
+      },
+      "endPosition": "122",
+      "kind": "MINUS",
+      "startPosition": "120"
+    },
+    "startPosition": "114"
+  },
+  {
+    "expression": {
+      "endPosition": "147",
+      "kind": "IDENTIFIER",
+      "name": "array",
+      "startPosition": "142"
+    },
+    "endPosition": "159",
+    "kind": "ARRAY_ACCESS",
+    "index": {
+      "expression": {
+        "endPosition": "153",
+        "kind": "IDENTIFIER",
+        "name": "array",
+        "startPosition": "148"
+      },
+      "endPosition": "158",
+      "kind": "ARRAY_ACCESS",
+      "index": {
+        "endPosition": "157",
+        "kind": "IDENTIFIER",
+        "name": "NaN",
+        "startPosition": "154"
+      },
+      "startPosition": "148"
+    },
+    "startPosition": "142"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/array_literal.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation array literal tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+
+var x = [];
+var y = [1, 43, 5, 45,];
+var z = [34,,,4];
+var k = [ {}, { x: 3 }, "hello" ];
+
+EOF
+
+
+parse("array_literal.js", code, "-nse", new (Java.extend(visitor, {
+    visitArrayLiteral : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/array_literal.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,105 @@
+[
+  {
+    "endPosition": "11",
+    "kind": "ARRAY_LITERAL",
+    "elements": [],
+    "startPosition": "9"
+  },
+  {
+    "endPosition": "36",
+    "kind": "ARRAY_LITERAL",
+    "elements": [
+      {
+        "endPosition": "23",
+        "kind": "NUMBER_LITERAL",
+        "value": "1",
+        "startPosition": "22"
+      },
+      {
+        "endPosition": "27",
+        "kind": "NUMBER_LITERAL",
+        "value": "43",
+        "startPosition": "25"
+      },
+      {
+        "endPosition": "30",
+        "kind": "NUMBER_LITERAL",
+        "value": "5",
+        "startPosition": "29"
+      },
+      {
+        "endPosition": "34",
+        "kind": "NUMBER_LITERAL",
+        "value": "45",
+        "startPosition": "32"
+      }
+    ],
+    "startPosition": "21"
+  },
+  {
+    "endPosition": "54",
+    "kind": "ARRAY_LITERAL",
+    "elements": [
+      {
+        "endPosition": "49",
+        "kind": "NUMBER_LITERAL",
+        "value": "34",
+        "startPosition": "47"
+      },
+      null,
+      null,
+      {
+        "endPosition": "53",
+        "kind": "NUMBER_LITERAL",
+        "value": "4",
+        "startPosition": "52"
+      }
+    ],
+    "startPosition": "46"
+  },
+  {
+    "endPosition": "89",
+    "kind": "ARRAY_LITERAL",
+    "elements": [
+      {
+        "endPosition": "68",
+        "kind": "OBJECT_LITERAL",
+        "startPosition": "66",
+        "properties": []
+      },
+      {
+        "endPosition": "78",
+        "kind": "OBJECT_LITERAL",
+        "startPosition": "70",
+        "properties": [
+          {
+            "getter": "null",
+            "endPosition": "74",
+            "kind": "PROPERTY",
+            "setter": "null",
+            "value": {
+              "endPosition": "76",
+              "kind": "NUMBER_LITERAL",
+              "value": "3",
+              "startPosition": "75"
+            },
+            "startPosition": "72",
+            "key": {
+              "endPosition": "73",
+              "kind": "IDENTIFIER",
+              "name": "x",
+              "startPosition": "72"
+            }
+          }
+        ]
+      },
+      {
+        "endPosition": "86",
+        "kind": "STRING_LITERAL",
+        "value": "hello",
+        "startPosition": "81"
+      }
+    ],
+    "startPosition": "64"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/assignment.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation assignment expression tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+a = 1
+b = 2;
+c = {}
+d = undefined
+e = NaN
+f = function () {}
+g = function () {"use strict";}
+
+EOF
+
+parse("assignment.js", code, "-nse", new (Java.extend(visitor, {
+    visitAssignment : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/assignment.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,149 @@
+[
+  {
+    "expression": {
+      "endPosition": "5",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "4"
+    },
+    "endPosition": "5",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "1",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "0"
+    },
+    "startPosition": "0"
+  },
+  {
+    "expression": {
+      "endPosition": "11",
+      "kind": "NUMBER_LITERAL",
+      "value": "2",
+      "startPosition": "10"
+    },
+    "endPosition": "11",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "7",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "6"
+    },
+    "startPosition": "6"
+  },
+  {
+    "expression": {
+      "endPosition": "19",
+      "kind": "OBJECT_LITERAL",
+      "startPosition": "17",
+      "properties": []
+    },
+    "endPosition": "19",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "14",
+      "kind": "IDENTIFIER",
+      "name": "c",
+      "startPosition": "13"
+    },
+    "startPosition": "13"
+  },
+  {
+    "expression": {
+      "endPosition": "33",
+      "kind": "IDENTIFIER",
+      "name": "undefined",
+      "startPosition": "24"
+    },
+    "endPosition": "33",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "21",
+      "kind": "IDENTIFIER",
+      "name": "d",
+      "startPosition": "20"
+    },
+    "startPosition": "20"
+  },
+  {
+    "expression": {
+      "endPosition": "41",
+      "kind": "IDENTIFIER",
+      "name": "NaN",
+      "startPosition": "38"
+    },
+    "endPosition": "41",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "35",
+      "kind": "IDENTIFIER",
+      "name": "e",
+      "startPosition": "34"
+    },
+    "startPosition": "34"
+  },
+  {
+    "expression": {
+      "endPosition": "58",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "59",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "58"
+      },
+      "strict": "false",
+      "startPosition": "58",
+      "parameters": []
+    },
+    "endPosition": "58",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "43",
+      "kind": "IDENTIFIER",
+      "name": "f",
+      "startPosition": "42"
+    },
+    "startPosition": "42"
+  },
+  {
+    "expression": {
+      "endPosition": "77",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "91",
+        "kind": "BLOCK",
+        "statements": [
+          {
+            "expression": {
+              "endPosition": "89",
+              "kind": "STRING_LITERAL",
+              "value": "use strict",
+              "startPosition": "79"
+            },
+            "endPosition": "89",
+            "kind": "EXPRESSION_STATEMENT",
+            "startPosition": "79"
+          }
+        ],
+        "startPosition": "77"
+      },
+      "strict": "true",
+      "startPosition": "77",
+      "parameters": []
+    },
+    "endPosition": "77",
+    "kind": "ASSIGNMENT",
+    "variable": {
+      "endPosition": "62",
+      "kind": "IDENTIFIER",
+      "name": "g",
+      "startPosition": "61"
+    },
+    "startPosition": "61"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/assignmentExpr.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+*
+* This code is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+* version 2 for more details (a copy is included in the LICENSE file that
+* accompanied this code).
+*
+* You should have received a copy of the GNU General Public License version
+* 2 along with this work; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* Please 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 representation assignment expression tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+xyz += 314;
+xyz -= 314;
+xyz *= 314;
+xyz /= 314;
+xyz %= 314;
+xyz <<= 314;
+xyz >>= 314;
+xyz >>>= 314;
+xyz &= 314;
+xyz ^= 314;
+xyz |= 314;
+
+EOF
+
+
+parse("assignmentExpr.js", code, "-nse", new (Java.extend(visitor, {
+    visitCompoundAssignment : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/assignmentExpr.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,189 @@
+[
+  {
+    "expression": {
+      "endPosition": "10",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "7"
+    },
+    "endPosition": "10",
+    "kind": "PLUS_ASSIGNMENT",
+    "variable": {
+      "endPosition": "3",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "0"
+    },
+    "startPosition": "0"
+  },
+  {
+    "expression": {
+      "endPosition": "22",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "19"
+    },
+    "endPosition": "22",
+    "kind": "MINUS_ASSIGNMENT",
+    "variable": {
+      "endPosition": "15",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "12"
+    },
+    "startPosition": "12"
+  },
+  {
+    "expression": {
+      "endPosition": "34",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "31"
+    },
+    "endPosition": "34",
+    "kind": "MULTIPLY_ASSIGNMENT",
+    "variable": {
+      "endPosition": "27",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "24"
+    },
+    "startPosition": "24"
+  },
+  {
+    "expression": {
+      "endPosition": "46",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "43"
+    },
+    "endPosition": "46",
+    "kind": "DIVIDE_ASSIGNMENT",
+    "variable": {
+      "endPosition": "39",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "36"
+    },
+    "startPosition": "36"
+  },
+  {
+    "expression": {
+      "endPosition": "58",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "55"
+    },
+    "endPosition": "58",
+    "kind": "REMAINDER_ASSIGNMENT",
+    "variable": {
+      "endPosition": "51",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "48"
+    },
+    "startPosition": "48"
+  },
+  {
+    "expression": {
+      "endPosition": "71",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "68"
+    },
+    "endPosition": "71",
+    "kind": "LEFT_SHIFT_ASSIGNMENT",
+    "variable": {
+      "endPosition": "63",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "60"
+    },
+    "startPosition": "60"
+  },
+  {
+    "expression": {
+      "endPosition": "84",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "81"
+    },
+    "endPosition": "84",
+    "kind": "RIGHT_SHIFT_ASSIGNMENT",
+    "variable": {
+      "endPosition": "76",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "73"
+    },
+    "startPosition": "73"
+  },
+  {
+    "expression": {
+      "endPosition": "98",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "95"
+    },
+    "endPosition": "98",
+    "kind": "UNSIGNED_RIGHT_SHIFT_ASSIGNMENT",
+    "variable": {
+      "endPosition": "89",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "86"
+    },
+    "startPosition": "86"
+  },
+  {
+    "expression": {
+      "endPosition": "110",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "107"
+    },
+    "endPosition": "110",
+    "kind": "AND_ASSIGNMENT",
+    "variable": {
+      "endPosition": "103",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "100"
+    },
+    "startPosition": "100"
+  },
+  {
+    "expression": {
+      "endPosition": "122",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "119"
+    },
+    "endPosition": "122",
+    "kind": "XOR_ASSIGNMENT",
+    "variable": {
+      "endPosition": "115",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "112"
+    },
+    "startPosition": "112"
+  },
+  {
+    "expression": {
+      "endPosition": "134",
+      "kind": "NUMBER_LITERAL",
+      "value": "314",
+      "startPosition": "131"
+    },
+    "endPosition": "134",
+    "kind": "OR_ASSIGNMENT",
+    "variable": {
+      "endPosition": "127",
+      "kind": "IDENTIFIER",
+      "name": "xyz",
+      "startPosition": "124"
+    },
+    "startPosition": "124"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/binaryExpr.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation binary expression tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+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;
+
+EOF
+
+
+parse("binaryExpr.js", code, "-nse", new (Java.extend(visitor, {
+    visitBinary : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/binaryExpr.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,359 @@
+[
+  {
+    "leftOperand": {
+      "endPosition": "1",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "0"
+    },
+    "endPosition": "5",
+    "kind": "MULTIPLY",
+    "rightOperand": {
+      "endPosition": "5",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "4"
+    },
+    "startPosition": "0"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "7",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "6"
+    },
+    "endPosition": "11",
+    "kind": "DIVIDE",
+    "rightOperand": {
+      "endPosition": "11",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "10"
+    },
+    "startPosition": "6"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "14",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "13"
+    },
+    "endPosition": "18",
+    "kind": "REMAINDER",
+    "rightOperand": {
+      "endPosition": "18",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "17"
+    },
+    "startPosition": "13"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "21",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "20"
+    },
+    "endPosition": "25",
+    "kind": "PLUS",
+    "rightOperand": {
+      "endPosition": "25",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "24"
+    },
+    "startPosition": "20"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "28",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "27"
+    },
+    "endPosition": "32",
+    "kind": "MINUS",
+    "rightOperand": {
+      "endPosition": "32",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "31"
+    },
+    "startPosition": "27"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "35",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "34"
+    },
+    "endPosition": "40",
+    "kind": "LEFT_SHIFT",
+    "rightOperand": {
+      "endPosition": "40",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "39"
+    },
+    "startPosition": "34"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "43",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "42"
+    },
+    "endPosition": "48",
+    "kind": "RIGHT_SHIFT",
+    "rightOperand": {
+      "endPosition": "48",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "47"
+    },
+    "startPosition": "42"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "51",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "50"
+    },
+    "endPosition": "57",
+    "kind": "UNSIGNED_RIGHT_SHIFT",
+    "rightOperand": {
+      "endPosition": "57",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "56"
+    },
+    "startPosition": "50"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "60",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "59"
+    },
+    "endPosition": "64",
+    "kind": "LESS_THAN",
+    "rightOperand": {
+      "endPosition": "64",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "63"
+    },
+    "startPosition": "59"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "67",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "66"
+    },
+    "endPosition": "71",
+    "kind": "GREATER_THAN",
+    "rightOperand": {
+      "endPosition": "71",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "70"
+    },
+    "startPosition": "66"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "74",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "73"
+    },
+    "endPosition": "79",
+    "kind": "LESS_THAN_EQUAL",
+    "rightOperand": {
+      "endPosition": "79",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "78"
+    },
+    "startPosition": "73"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "82",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "81"
+    },
+    "endPosition": "87",
+    "kind": "GREATER_THAN_EQUAL",
+    "rightOperand": {
+      "endPosition": "87",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "86"
+    },
+    "startPosition": "81"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "106",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "105"
+    },
+    "endPosition": "111",
+    "kind": "EQUAL_TO",
+    "rightOperand": {
+      "endPosition": "111",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "110"
+    },
+    "startPosition": "105"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "114",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "113"
+    },
+    "endPosition": "119",
+    "kind": "NOT_EQUAL_TO",
+    "rightOperand": {
+      "endPosition": "119",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "118"
+    },
+    "startPosition": "113"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "122",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "121"
+    },
+    "endPosition": "128",
+    "kind": "STRICT_EQUAL_TO",
+    "rightOperand": {
+      "endPosition": "128",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "127"
+    },
+    "startPosition": "121"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "131",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "130"
+    },
+    "endPosition": "137",
+    "kind": "STRICT_NOT_EQUAL_TO",
+    "rightOperand": {
+      "endPosition": "137",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "136"
+    },
+    "startPosition": "130"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "140",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "139"
+    },
+    "endPosition": "144",
+    "kind": "AND",
+    "rightOperand": {
+      "endPosition": "144",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "143"
+    },
+    "startPosition": "139"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "147",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "146"
+    },
+    "endPosition": "151",
+    "kind": "XOR",
+    "rightOperand": {
+      "endPosition": "151",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "150"
+    },
+    "startPosition": "146"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "154",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "153"
+    },
+    "endPosition": "158",
+    "kind": "OR",
+    "rightOperand": {
+      "endPosition": "158",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "157"
+    },
+    "startPosition": "153"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "161",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "160"
+    },
+    "endPosition": "166",
+    "kind": "CONDITIONAL_AND",
+    "rightOperand": {
+      "endPosition": "166",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "165"
+    },
+    "startPosition": "160"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "169",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "168"
+    },
+    "endPosition": "174",
+    "kind": "CONDITIONAL_OR",
+    "rightOperand": {
+      "endPosition": "174",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "173"
+    },
+    "startPosition": "168"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/block.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation block tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+{}
+{ print("hello"); }
+function a () {
+    return 2 + 1;
+}
+EOF
+
+
+parse("block.js", code, "-nse", new (Java.extend(visitor, {
+    visitBlock : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/block.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,68 @@
+[
+  {
+    "endPosition": "2",
+    "kind": "BLOCK",
+    "statements": [],
+    "startPosition": "0"
+  },
+  {
+    "endPosition": "22",
+    "kind": "BLOCK",
+    "statements": [
+      {
+        "expression": {
+          "endPosition": "19",
+          "kind": "FUNCTION_INVOCATION",
+          "functionSelect": {
+            "endPosition": "10",
+            "kind": "IDENTIFIER",
+            "name": "print",
+            "startPosition": "5"
+          },
+          "arguments": [
+            {
+              "endPosition": "17",
+              "kind": "STRING_LITERAL",
+              "value": "hello",
+              "startPosition": "12"
+            }
+          ],
+          "startPosition": "5"
+        },
+        "endPosition": "19",
+        "kind": "EXPRESSION_STATEMENT",
+        "startPosition": "5"
+      }
+    ],
+    "startPosition": "3"
+  },
+  {
+    "endPosition": "56",
+    "kind": "BLOCK",
+    "statements": [
+      {
+        "expression": {
+          "leftOperand": {
+            "endPosition": "51",
+            "kind": "NUMBER_LITERAL",
+            "value": "2",
+            "startPosition": "50"
+          },
+          "endPosition": "55",
+          "kind": "PLUS",
+          "rightOperand": {
+            "endPosition": "55",
+            "kind": "NUMBER_LITERAL",
+            "value": "1",
+            "startPosition": "54"
+          },
+          "startPosition": "50"
+        },
+        "endPosition": "56",
+        "kind": "RETURN",
+        "startPosition": "43"
+      }
+    ],
+    "startPosition": "37"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/breakStat.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,56 @@
+/*
+ * 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 representation break statement tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+while (true) { break; };
+loop: { while (true) { break loop } };
+loop: { for (;;) { break loop } };
+do break; while(true)
+switch(a) {
+    case 1:
+    case 2:
+        break
+    default:
+        break;
+}
+
+
+EOF
+
+
+parse("breakStat.js", code, "-nse", new (Java.extend(visitor, {
+    visitBreak : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/breakStat.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,38 @@
+[
+  {
+    "endPosition": "21",
+    "kind": "BREAK",
+    "label": "null",
+    "startPosition": "15"
+  },
+  {
+    "endPosition": "58",
+    "kind": "BREAK",
+    "label": "loop",
+    "startPosition": "48"
+  },
+  {
+    "endPosition": "93",
+    "kind": "BREAK",
+    "label": "loop",
+    "startPosition": "83"
+  },
+  {
+    "endPosition": "108",
+    "kind": "BREAK",
+    "label": "null",
+    "startPosition": "102"
+  },
+  {
+    "endPosition": "170",
+    "kind": "BREAK",
+    "label": "null",
+    "startPosition": "165"
+  },
+  {
+    "endPosition": "198",
+    "kind": "BREAK",
+    "label": "null",
+    "startPosition": "192"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/case.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation case tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+switch (e) {
+    case 1:
+    case 2:
+    case 3:
+        break; 
+    default:
+}
+label:
+switch (a) {
+    case 1:
+        break
+    case 2:
+        break label
+    case 3:
+        break
+}
+
+EOF
+
+parse("breakStat.js", code, "-nse", new (Java.extend(visitor, {
+    visitCase : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/case.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,109 @@
+[
+  {
+    "expression": {
+      "endPosition": "23",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "22"
+    },
+    "endPosition": "24",
+    "kind": "CASE",
+    "statements": [],
+    "startPosition": "17"
+  },
+  {
+    "expression": {
+      "endPosition": "35",
+      "kind": "NUMBER_LITERAL",
+      "value": "2",
+      "startPosition": "34"
+    },
+    "endPosition": "36",
+    "kind": "CASE",
+    "statements": [],
+    "startPosition": "29"
+  },
+  {
+    "expression": {
+      "endPosition": "47",
+      "kind": "NUMBER_LITERAL",
+      "value": "3",
+      "startPosition": "46"
+    },
+    "endPosition": "63",
+    "kind": "CASE",
+    "statements": [
+      {
+        "endPosition": "63",
+        "kind": "BREAK",
+        "label": "null",
+        "startPosition": "57"
+      }
+    ],
+    "startPosition": "41"
+  },
+  {
+    "expression": "null",
+    "endPosition": "77",
+    "kind": "CASE",
+    "statements": [],
+    "startPosition": "69"
+  },
+  {
+    "expression": {
+      "endPosition": "110",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "109"
+    },
+    "endPosition": "125",
+    "kind": "CASE",
+    "statements": [
+      {
+        "endPosition": "125",
+        "kind": "BREAK",
+        "label": "null",
+        "startPosition": "120"
+      }
+    ],
+    "startPosition": "104"
+  },
+  {
+    "expression": {
+      "endPosition": "136",
+      "kind": "NUMBER_LITERAL",
+      "value": "2",
+      "startPosition": "135"
+    },
+    "endPosition": "157",
+    "kind": "CASE",
+    "statements": [
+      {
+        "endPosition": "157",
+        "kind": "BREAK",
+        "label": "label",
+        "startPosition": "146"
+      }
+    ],
+    "startPosition": "130"
+  },
+  {
+    "expression": {
+      "endPosition": "168",
+      "kind": "NUMBER_LITERAL",
+      "value": "3",
+      "startPosition": "167"
+    },
+    "endPosition": "183",
+    "kind": "CASE",
+    "statements": [
+      {
+        "endPosition": "183",
+        "kind": "BREAK",
+        "label": "null",
+        "startPosition": "178"
+      }
+    ],
+    "startPosition": "162"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/compilationUnitTree.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 all tree
+ *
+ * @bug 8068306
+ * @subtest
+ */
+
+var a = 1
+var b = function () {
+    print(a)
+}
+
+var c = {
+    x : function (a, b, c) {
+        return a * b - c;
+    },
+    i : []
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/condExpr.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation case tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+
+a? b : c;
+
+EOF
+
+parse("condExpr.js", code, "-nse", new (Java.extend(visitor, {
+    visitConditionalExpression : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/condExpr.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,25 @@
+[
+  {
+    "condition": {
+      "endPosition": "2",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "1"
+    },
+    "endPosition": "9",
+    "kind": "CONDITIONAL_EXPRESSION",
+    "trueExpression": {
+      "endPosition": "5",
+      "kind": "IDENTIFIER",
+      "name": "b",
+      "startPosition": "4"
+    },
+    "falseExpression": {
+      "endPosition": "9",
+      "kind": "IDENTIFIER",
+      "name": "c",
+      "startPosition": "8"
+    },
+    "startPosition": "2"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/continueStat.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation continue tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+var code = <<EOF
+
+while (true) { continue; };
+begin: { while (true) { continue begin; } };
+start: { for(;;) { continue start; } };
+do continue; while(false)
+label:do continue label; while(true)
+
+EOF
+
+parse("continueStat.js", code, "-nse", new (Java.extend(visitor, {
+    visitContinue : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/continueStat.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,32 @@
+[
+  {
+    "endPosition": "25",
+    "kind": "CONTINUE",
+    "label": "null",
+    "startPosition": "16"
+  },
+  {
+    "endPosition": "68",
+    "kind": "CONTINUE",
+    "label": "begin",
+    "startPosition": "53"
+  },
+  {
+    "endPosition": "108",
+    "kind": "CONTINUE",
+    "label": "start",
+    "startPosition": "93"
+  },
+  {
+    "endPosition": "126",
+    "kind": "CONTINUE",
+    "label": "null",
+    "startPosition": "117"
+  },
+  {
+    "endPosition": "164",
+    "kind": "CONTINUE",
+    "label": "label",
+    "startPosition": "149"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/debuggerStat.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation continue tree.
+ *
+ * @bug 8068306
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+debugger;
+
+EOF
+
+parse("debugger.js", code, "-nse", new (Java.extend(visitor, {
+    visitDebugger : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/debuggerStat.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,7 @@
+[
+  {
+    "endPosition": "9",
+    "kind": "DEBUGGER",
+    "startPosition": "0"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/diagnostic.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 8068304
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__  + "utils.js")
+
+var code = <<EOF
+    var a = { k:1, k:2 }
+EOF
+
+parseDiagnostic(code, "-strict")
+
+var code = <<EOF
+    var x = {}
+    with(x) {}
+EOF
+
+parseDiagnostic(code, "-strict")
+
+var code = <<EOF
+    var eval = "test value";
+EOF
+
+parseDiagnostic(code, "-strict")
+
+var code = <<EOF
+    var arguments = "test value";
+EOF
+
+parseDiagnostic(code, "-strict")
+
+var code = <<EOF
+    	if (true) {
+    		function a () {}
+    	}
+EOF
+
+parseDiagnostic(code, "-strict")
+
+var code = <<EOF
+    var a = { get x() {}, get x() {}};
+    var a = { set x() {}, set x() {}};
+EOF
+
+parseDiagnostic(code, "-strict")
+
+var code = <<EOF
+    /([a-z])+(/;
+    /([a-z])+/h;
+EOF
+
+parseDiagnostic(code, "-strict")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/diagnostic.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,95 @@
+[
+  {
+    "fileName": "test.js",
+    "code": "ident (19, 1)",
+    "columnNumber": "19",
+    "kind": "ERROR",
+    "position": "19",
+    "message": "test.js:1:19 Property \"k\" already defined\n    var a = { k:1, k:2 }\n                   ^",
+    "lineNumber": "1"
+  }
+]
+[
+  {
+    "fileName": "test.js",
+    "code": "with (19, 4)",
+    "columnNumber": "4",
+    "kind": "ERROR",
+    "position": "19",
+    "message": "test.js:2:4 \"with\" statement cannot be used in strict mode\n    with(x) {}\n    ^",
+    "lineNumber": "2"
+  }
+]
+[
+  {
+    "fileName": "test.js",
+    "code": "ident (8, 4)",
+    "columnNumber": "8",
+    "kind": "ERROR",
+    "position": "8",
+    "message": "test.js:1:8 \"eval\" cannot be used as variable name in strict mode\n    var eval = \"test value\";\n        ^",
+    "lineNumber": "1"
+  }
+]
+[
+  {
+    "fileName": "test.js",
+    "code": "ident (8, 9)",
+    "columnNumber": "8",
+    "kind": "ERROR",
+    "position": "8",
+    "message": "test.js:1:8 \"arguments\" cannot be used as variable name in strict mode\n    var arguments = \"test value\";\n        ^",
+    "lineNumber": "1"
+  }
+]
+[
+  {
+    "fileName": "test.js",
+    "code": "function (23, 8)",
+    "columnNumber": "6",
+    "kind": "ERROR",
+    "position": "23",
+    "message": "test.js:2:6 In strict mode, function declarations can only occur at program or function body level. You should use a function expression here instead.\n    \t\tfunction a () {}\n    \t\t^",
+    "lineNumber": "2"
+  }
+]
+[
+  {
+    "fileName": "test.js",
+    "code": "ident (26, 3)",
+    "columnNumber": "26",
+    "kind": "ERROR",
+    "position": "26",
+    "message": "test.js:1:26 Property \"x\" already defined\n    var a = { get x() {}, get x() {}};\n                          ^",
+    "lineNumber": "1"
+  },
+  {
+    "fileName": "test.js",
+    "code": "ident (65, 3)",
+    "columnNumber": "26",
+    "kind": "ERROR",
+    "position": "65",
+    "message": "test.js:2:26 Property \"x\" already defined\n    var a = { set x() {}, set x() {}};\n                          ^",
+    "lineNumber": "2"
+  }
+]
+[
+  {
+    "fileName": "test.js",
+    "code": "; (15, 1)",
+    "columnNumber": "15",
+    "kind": "ERROR",
+    "position": "15",
+    "message": "test.js:1:15 Unclosed group near index 9\n([a-z])+(\n         ^\n    /([a-z])+(/;\n               ^",
+    "lineNumber": "1"
+  },
+  {
+    "fileName": "test.js",
+    "code": "; (32, 1)",
+    "columnNumber": "15",
+    "kind": "ERROR",
+    "position": "32",
+    "message": "test.js:2:15 Unsupported RegExp flag: h\n    /([a-z])+/h;\n               ^",
+    "lineNumber": "2"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/dowhile.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation continue tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+do {} while(false)
+do {break;} while(true)
+label:
+do {break label;} while(a == 2)
+do{do{}while(func1())}while(a + b > 20)
+
+do call();while(NaN)
+
+EOF
+
+parse("dowhile.js", code, "-nse", new (Java.extend(visitor, {
+    visitDoWhileLoop : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/dowhile.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,169 @@
+[
+  {
+    "condition": {
+      "endPosition": "18",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "false",
+      "startPosition": "13"
+    },
+    "endPosition": "19",
+    "kind": "DO_WHILE_LOOP",
+    "statement": {
+      "endPosition": "6",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "4"
+    },
+    "startPosition": "1"
+  },
+  {
+    "condition": {
+      "endPosition": "42",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "true",
+      "startPosition": "38"
+    },
+    "endPosition": "43",
+    "kind": "DO_WHILE_LOOP",
+    "statement": {
+      "endPosition": "31",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "endPosition": "30",
+          "kind": "BREAK",
+          "label": "null",
+          "startPosition": "24"
+        }
+      ],
+      "startPosition": "23"
+    },
+    "startPosition": "20"
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "endPosition": "76",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "75"
+      },
+      "endPosition": "81",
+      "kind": "EQUAL_TO",
+      "rightOperand": {
+        "endPosition": "81",
+        "kind": "NUMBER_LITERAL",
+        "value": "2",
+        "startPosition": "80"
+      },
+      "startPosition": "75"
+    },
+    "endPosition": "82",
+    "kind": "DO_WHILE_LOOP",
+    "statement": {
+      "endPosition": "68",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "endPosition": "67",
+          "kind": "BREAK",
+          "label": "label",
+          "startPosition": "55"
+        }
+      ],
+      "startPosition": "54"
+    },
+    "startPosition": "51"
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "leftOperand": {
+          "endPosition": "112",
+          "kind": "IDENTIFIER",
+          "name": "a",
+          "startPosition": "111"
+        },
+        "endPosition": "116",
+        "kind": "PLUS",
+        "rightOperand": {
+          "endPosition": "116",
+          "kind": "IDENTIFIER",
+          "name": "b",
+          "startPosition": "115"
+        },
+        "startPosition": "111"
+      },
+      "endPosition": "121",
+      "kind": "GREATER_THAN",
+      "rightOperand": {
+        "endPosition": "121",
+        "kind": "NUMBER_LITERAL",
+        "value": "20",
+        "startPosition": "119"
+      },
+      "startPosition": "111"
+    },
+    "endPosition": "122",
+    "kind": "DO_WHILE_LOOP",
+    "statement": {
+      "endPosition": "105",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": {
+            "endPosition": "103",
+            "kind": "FUNCTION_INVOCATION",
+            "functionSelect": {
+              "endPosition": "101",
+              "kind": "IDENTIFIER",
+              "name": "func1",
+              "startPosition": "96"
+            },
+            "arguments": [],
+            "startPosition": "96"
+          },
+          "endPosition": "104",
+          "kind": "DO_WHILE_LOOP",
+          "statement": {
+            "endPosition": "90",
+            "kind": "BLOCK",
+            "statements": [],
+            "startPosition": "88"
+          },
+          "startPosition": "86"
+        }
+      ],
+      "startPosition": "85"
+    },
+    "startPosition": "83"
+  },
+  {
+    "condition": {
+      "endPosition": "143",
+      "kind": "IDENTIFIER",
+      "name": "NaN",
+      "startPosition": "140"
+    },
+    "endPosition": "144",
+    "kind": "DO_WHILE_LOOP",
+    "statement": {
+      "expression": {
+        "endPosition": "133",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "131",
+          "kind": "IDENTIFIER",
+          "name": "call",
+          "startPosition": "127"
+        },
+        "arguments": [],
+        "startPosition": "127"
+      },
+      "endPosition": "133",
+      "kind": "EXPRESSION_STATEMENT",
+      "startPosition": "127"
+    },
+    "startPosition": "124"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/empty.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation empty tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+;
+var a = 1;;
+1;
+
+EOF
+
+parse("empty.js", code, "--empty-statements", new (Java.extend(visitor, {
+    visitEmptyStatement : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/empty.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,12 @@
+[
+  {
+    "endPosition": "2",
+    "kind": "EMPTY_STATEMENT",
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "14",
+    "kind": "EMPTY_STATEMENT",
+    "startPosition": "13"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/erroneous.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation erroneous tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+(1 + 2;
+x *;
+while;
+break;
+continue;
+
+EOF
+
+
+
+parse("erroneous.js", code, "-nse", new (Java.extend(visitor, {
+    visitErroneous : function (node, obj) {
+        obj.push(convert(node))
+    }
+})), function (message) {})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/erroneous.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,27 @@
+[
+  {
+    "endPosition": "8",
+    "kind": "ERROR",
+    "startPosition": "7"
+  },
+  {
+    "endPosition": "13",
+    "kind": "ERROR",
+    "startPosition": "12"
+  },
+  {
+    "endPosition": "20",
+    "kind": "ERROR",
+    "startPosition": "19"
+  },
+  {
+    "endPosition": "27",
+    "kind": "ERROR",
+    "startPosition": "26"
+  },
+  {
+    "endPosition": "37",
+    "kind": "ERROR",
+    "startPosition": "36"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/for.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation for loop tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+for (i=0; someExpr;) {}
+for(;;){}
+for(var i=0; i < 4; i+=5) {}
+for(var i=0; i < 4; i++) {}
+for(i=0, j=2, x=4; x < 6; j++, x+=2, i*=x) {}
+
+EOF
+
+parse("forloop.js", code, "-nse", new (Java.extend(visitor, {
+    visitForLoop : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/for.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,281 @@
+[
+  {
+    "condition": {
+      "endPosition": "19",
+      "kind": "IDENTIFIER",
+      "name": "someExpr",
+      "startPosition": "11"
+    },
+    "endPosition": "24",
+    "kind": "FOR_LOOP",
+    "statement": {
+      "endPosition": "24",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "22"
+    },
+    "update": "null",
+    "startPosition": "1",
+    "initializer": {
+      "expression": {
+        "endPosition": "9",
+        "kind": "NUMBER_LITERAL",
+        "value": "0",
+        "startPosition": "8"
+      },
+      "endPosition": "9",
+      "kind": "ASSIGNMENT",
+      "variable": {
+        "endPosition": "7",
+        "kind": "IDENTIFIER",
+        "name": "i",
+        "startPosition": "6"
+      },
+      "startPosition": "6"
+    }
+  },
+  {
+    "condition": "null",
+    "endPosition": "34",
+    "kind": "FOR_LOOP",
+    "statement": {
+      "endPosition": "34",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "32"
+    },
+    "update": "null",
+    "startPosition": "25",
+    "initializer": "null"
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "endPosition": "49",
+        "kind": "IDENTIFIER",
+        "name": "i",
+        "startPosition": "48"
+      },
+      "endPosition": "53",
+      "kind": "LESS_THAN",
+      "rightOperand": {
+        "endPosition": "53",
+        "kind": "NUMBER_LITERAL",
+        "value": "4",
+        "startPosition": "52"
+      },
+      "startPosition": "48"
+    },
+    "endPosition": "63",
+    "kind": "FOR_LOOP",
+    "statement": {
+      "endPosition": "63",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "61"
+    },
+    "update": {
+      "expression": {
+        "endPosition": "59",
+        "kind": "NUMBER_LITERAL",
+        "value": "5",
+        "startPosition": "58"
+      },
+      "endPosition": "59",
+      "kind": "PLUS_ASSIGNMENT",
+      "variable": {
+        "endPosition": "56",
+        "kind": "IDENTIFIER",
+        "name": "i",
+        "startPosition": "55"
+      },
+      "startPosition": "55"
+    },
+    "startPosition": "35",
+    "initializer": "null"
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "endPosition": "78",
+        "kind": "IDENTIFIER",
+        "name": "i",
+        "startPosition": "77"
+      },
+      "endPosition": "82",
+      "kind": "LESS_THAN",
+      "rightOperand": {
+        "endPosition": "82",
+        "kind": "NUMBER_LITERAL",
+        "value": "4",
+        "startPosition": "81"
+      },
+      "startPosition": "77"
+    },
+    "endPosition": "91",
+    "kind": "FOR_LOOP",
+    "statement": {
+      "endPosition": "91",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "89"
+    },
+    "update": {
+      "expression": {
+        "endPosition": "85",
+        "kind": "IDENTIFIER",
+        "name": "i",
+        "startPosition": "84"
+      },
+      "endPosition": "87",
+      "kind": "POSTFIX_INCREMENT",
+      "startPosition": "84"
+    },
+    "startPosition": "64",
+    "initializer": "null"
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "endPosition": "112",
+        "kind": "IDENTIFIER",
+        "name": "x",
+        "startPosition": "111"
+      },
+      "endPosition": "116",
+      "kind": "LESS_THAN",
+      "rightOperand": {
+        "endPosition": "116",
+        "kind": "NUMBER_LITERAL",
+        "value": "6",
+        "startPosition": "115"
+      },
+      "startPosition": "111"
+    },
+    "endPosition": "137",
+    "kind": "FOR_LOOP",
+    "statement": {
+      "endPosition": "137",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "135"
+    },
+    "update": {
+      "leftOperand": {
+        "leftOperand": {
+          "expression": {
+            "endPosition": "119",
+            "kind": "IDENTIFIER",
+            "name": "j",
+            "startPosition": "118"
+          },
+          "endPosition": "121",
+          "kind": "POSTFIX_INCREMENT",
+          "startPosition": "118"
+        },
+        "endPosition": "127",
+        "kind": "COMMA",
+        "rightOperand": {
+          "expression": {
+            "endPosition": "127",
+            "kind": "NUMBER_LITERAL",
+            "value": "2",
+            "startPosition": "126"
+          },
+          "endPosition": "127",
+          "kind": "PLUS_ASSIGNMENT",
+          "variable": {
+            "endPosition": "124",
+            "kind": "IDENTIFIER",
+            "name": "x",
+            "startPosition": "123"
+          },
+          "startPosition": "123"
+        },
+        "startPosition": "118"
+      },
+      "endPosition": "133",
+      "kind": "COMMA",
+      "rightOperand": {
+        "expression": {
+          "endPosition": "133",
+          "kind": "IDENTIFIER",
+          "name": "x",
+          "startPosition": "132"
+        },
+        "endPosition": "133",
+        "kind": "MULTIPLY_ASSIGNMENT",
+        "variable": {
+          "endPosition": "130",
+          "kind": "IDENTIFIER",
+          "name": "i",
+          "startPosition": "129"
+        },
+        "startPosition": "129"
+      },
+      "startPosition": "118"
+    },
+    "startPosition": "92",
+    "initializer": {
+      "leftOperand": {
+        "leftOperand": {
+          "expression": {
+            "endPosition": "99",
+            "kind": "NUMBER_LITERAL",
+            "value": "0",
+            "startPosition": "98"
+          },
+          "endPosition": "99",
+          "kind": "ASSIGNMENT",
+          "variable": {
+            "endPosition": "97",
+            "kind": "IDENTIFIER",
+            "name": "i",
+            "startPosition": "96"
+          },
+          "startPosition": "96"
+        },
+        "endPosition": "104",
+        "kind": "COMMA",
+        "rightOperand": {
+          "expression": {
+            "endPosition": "104",
+            "kind": "NUMBER_LITERAL",
+            "value": "2",
+            "startPosition": "103"
+          },
+          "endPosition": "104",
+          "kind": "ASSIGNMENT",
+          "variable": {
+            "endPosition": "102",
+            "kind": "IDENTIFIER",
+            "name": "j",
+            "startPosition": "101"
+          },
+          "startPosition": "101"
+        },
+        "startPosition": "96"
+      },
+      "endPosition": "109",
+      "kind": "COMMA",
+      "rightOperand": {
+        "expression": {
+          "endPosition": "109",
+          "kind": "NUMBER_LITERAL",
+          "value": "4",
+          "startPosition": "108"
+        },
+        "endPosition": "109",
+        "kind": "ASSIGNMENT",
+        "variable": {
+          "endPosition": "107",
+          "kind": "IDENTIFIER",
+          "name": "x",
+          "startPosition": "106"
+        },
+        "startPosition": "106"
+      },
+      "startPosition": "96"
+    }
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/forin.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation for-in loop tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+for (i in obj) {}
+for (var i in obj) {}
+[].forEach(function(i, v){})
+
+EOF
+
+parse("forinloop.js", code, "-nse", new (Java.extend(visitor, {
+    visitForInLoop : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/forin.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,50 @@
+[
+  {
+    "expression": {
+      "endPosition": "14",
+      "kind": "IDENTIFIER",
+      "name": "obj",
+      "startPosition": "11"
+    },
+    "endPosition": "18",
+    "kind": "FOR_IN_LOOP",
+    "forEach": "false",
+    "variable": {
+      "endPosition": "7",
+      "kind": "IDENTIFIER",
+      "name": "i",
+      "startPosition": "6"
+    },
+    "statement": {
+      "endPosition": "18",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "16"
+    },
+    "startPosition": "1"
+  },
+  {
+    "expression": {
+      "endPosition": "36",
+      "kind": "IDENTIFIER",
+      "name": "obj",
+      "startPosition": "33"
+    },
+    "endPosition": "40",
+    "kind": "FOR_IN_LOOP",
+    "forEach": "false",
+    "variable": {
+      "endPosition": "29",
+      "kind": "IDENTIFIER",
+      "name": "i",
+      "startPosition": "28"
+    },
+    "statement": {
+      "endPosition": "40",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "38"
+    },
+    "startPosition": "19"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/functionCall.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation function call tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+func1()
+func2(a, b, c)
+func3(4, n * m);
+obj.call();
+obj.call(x, b());
+(function(){})();
+(function(){"use strict";})();
+(function(){})(2);
+(function(a, b){})(2);
+
+EOF
+
+parse("functionCall.js", code, "-nse", new (Java.extend(visitor, {
+    visitFunctionCall : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/functionCall.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,255 @@
+[
+  {
+    "endPosition": "8",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "6",
+      "kind": "IDENTIFIER",
+      "name": "func1",
+      "startPosition": "1"
+    },
+    "arguments": [],
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "23",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "14",
+      "kind": "IDENTIFIER",
+      "name": "func2",
+      "startPosition": "9"
+    },
+    "arguments": [
+      {
+        "endPosition": "16",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "15"
+      },
+      {
+        "endPosition": "19",
+        "kind": "IDENTIFIER",
+        "name": "b",
+        "startPosition": "18"
+      },
+      {
+        "endPosition": "22",
+        "kind": "IDENTIFIER",
+        "name": "c",
+        "startPosition": "21"
+      }
+    ],
+    "startPosition": "9"
+  },
+  {
+    "endPosition": "39",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "29",
+      "kind": "IDENTIFIER",
+      "name": "func3",
+      "startPosition": "24"
+    },
+    "arguments": [
+      {
+        "endPosition": "31",
+        "kind": "NUMBER_LITERAL",
+        "value": "4",
+        "startPosition": "30"
+      },
+      {
+        "leftOperand": {
+          "endPosition": "34",
+          "kind": "IDENTIFIER",
+          "name": "n",
+          "startPosition": "33"
+        },
+        "endPosition": "38",
+        "kind": "MULTIPLY",
+        "rightOperand": {
+          "endPosition": "38",
+          "kind": "IDENTIFIER",
+          "name": "m",
+          "startPosition": "37"
+        },
+        "startPosition": "33"
+      }
+    ],
+    "startPosition": "24"
+  },
+  {
+    "endPosition": "51",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "identifier": "call",
+      "expression": {
+        "endPosition": "44",
+        "kind": "IDENTIFIER",
+        "name": "obj",
+        "startPosition": "41"
+      },
+      "endPosition": "49",
+      "kind": "MEMBER_SELECT",
+      "startPosition": "41"
+    },
+    "arguments": [],
+    "startPosition": "41"
+  },
+  {
+    "endPosition": "69",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "identifier": "call",
+      "expression": {
+        "endPosition": "56",
+        "kind": "IDENTIFIER",
+        "name": "obj",
+        "startPosition": "53"
+      },
+      "endPosition": "61",
+      "kind": "MEMBER_SELECT",
+      "startPosition": "53"
+    },
+    "arguments": [
+      {
+        "endPosition": "63",
+        "kind": "IDENTIFIER",
+        "name": "x",
+        "startPosition": "62"
+      },
+      {
+        "endPosition": "68",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "66",
+          "kind": "IDENTIFIER",
+          "name": "b",
+          "startPosition": "65"
+        },
+        "arguments": [],
+        "startPosition": "65"
+      }
+    ],
+    "startPosition": "53"
+  },
+  {
+    "endPosition": "87",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "82",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "83",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "82"
+      },
+      "strict": "false",
+      "startPosition": "82",
+      "parameters": []
+    },
+    "arguments": [],
+    "startPosition": "71"
+  },
+  {
+    "endPosition": "118",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "100",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "114",
+        "kind": "BLOCK",
+        "statements": [
+          {
+            "expression": {
+              "endPosition": "112",
+              "kind": "STRING_LITERAL",
+              "value": "use strict",
+              "startPosition": "102"
+            },
+            "endPosition": "112",
+            "kind": "EXPRESSION_STATEMENT",
+            "startPosition": "102"
+          }
+        ],
+        "startPosition": "100"
+      },
+      "strict": "true",
+      "startPosition": "100",
+      "parameters": []
+    },
+    "arguments": [],
+    "startPosition": "89"
+  },
+  {
+    "endPosition": "137",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "131",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "132",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "131"
+      },
+      "strict": "false",
+      "startPosition": "131",
+      "parameters": []
+    },
+    "arguments": [
+      {
+        "endPosition": "136",
+        "kind": "NUMBER_LITERAL",
+        "value": "2",
+        "startPosition": "135"
+      }
+    ],
+    "startPosition": "120"
+  },
+  {
+    "endPosition": "160",
+    "kind": "FUNCTION_INVOCATION",
+    "functionSelect": {
+      "endPosition": "154",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "155",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "154"
+      },
+      "strict": "false",
+      "startPosition": "154",
+      "parameters": [
+        {
+          "endPosition": "150",
+          "kind": "IDENTIFIER",
+          "name": "a",
+          "startPosition": "149"
+        },
+        {
+          "endPosition": "153",
+          "kind": "IDENTIFIER",
+          "name": "b",
+          "startPosition": "152"
+        }
+      ]
+    },
+    "arguments": [
+      {
+        "endPosition": "159",
+        "kind": "NUMBER_LITERAL",
+        "value": "2",
+        "startPosition": "158"
+      }
+    ],
+    "startPosition": "139"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/functionDeclaration.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation function declaration tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+function a () {}
+function d(){
+    function e () {print(a)}
+}
+function f(a, b){print(a)}
+function j(a, b){"use strict";}
+
+EOF
+
+parse("functionDeclaration.js", code, "-nse", new (Java.extend(visitor, {
+    visitFunctionDeclaration : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/functionDeclaration.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,161 @@
+[
+  {
+    "endPosition": "17",
+    "kind": "FUNCTION",
+    "name": "a",
+    "body": {
+      "endPosition": "16",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "15"
+    },
+    "strict": "false",
+    "startPosition": "1",
+    "parameters": []
+  },
+  {
+    "endPosition": "62",
+    "kind": "FUNCTION",
+    "name": "d",
+    "body": {
+      "endPosition": "60",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "endPosition": "60",
+          "kind": "FUNCTION",
+          "name": "e",
+          "body": {
+            "endPosition": "59",
+            "kind": "BLOCK",
+            "statements": [
+              {
+                "expression": {
+                  "endPosition": "59",
+                  "kind": "FUNCTION_INVOCATION",
+                  "functionSelect": {
+                    "endPosition": "56",
+                    "kind": "IDENTIFIER",
+                    "name": "print",
+                    "startPosition": "51"
+                  },
+                  "arguments": [
+                    {
+                      "endPosition": "58",
+                      "kind": "IDENTIFIER",
+                      "name": "a",
+                      "startPosition": "57"
+                    }
+                  ],
+                  "startPosition": "51"
+                },
+                "endPosition": "59",
+                "kind": "EXPRESSION_STATEMENT",
+                "startPosition": "51"
+              }
+            ],
+            "startPosition": "50"
+          },
+          "strict": "false",
+          "startPosition": "36",
+          "parameters": []
+        }
+      ],
+      "startPosition": "30"
+    },
+    "strict": "false",
+    "startPosition": "18",
+    "parameters": []
+  },
+  {
+    "endPosition": "89",
+    "kind": "FUNCTION",
+    "name": "f",
+    "body": {
+      "endPosition": "88",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "endPosition": "88",
+            "kind": "FUNCTION_INVOCATION",
+            "functionSelect": {
+              "endPosition": "85",
+              "kind": "IDENTIFIER",
+              "name": "print",
+              "startPosition": "80"
+            },
+            "arguments": [
+              {
+                "endPosition": "87",
+                "kind": "IDENTIFIER",
+                "name": "a",
+                "startPosition": "86"
+              }
+            ],
+            "startPosition": "80"
+          },
+          "endPosition": "88",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "80"
+        }
+      ],
+      "startPosition": "79"
+    },
+    "strict": "false",
+    "startPosition": "63",
+    "parameters": [
+      {
+        "endPosition": "75",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "74"
+      },
+      {
+        "endPosition": "78",
+        "kind": "IDENTIFIER",
+        "name": "b",
+        "startPosition": "77"
+      }
+    ]
+  },
+  {
+    "endPosition": "121",
+    "kind": "FUNCTION",
+    "name": "j",
+    "body": {
+      "endPosition": "120",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "endPosition": "118",
+            "kind": "STRING_LITERAL",
+            "value": "use strict",
+            "startPosition": "108"
+          },
+          "endPosition": "118",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "108"
+        }
+      ],
+      "startPosition": "106"
+    },
+    "strict": "true",
+    "startPosition": "90",
+    "parameters": [
+      {
+        "endPosition": "102",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "101"
+      },
+      {
+        "endPosition": "105",
+        "kind": "IDENTIFIER",
+        "name": "b",
+        "startPosition": "104"
+      }
+    ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/functionExpr.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation function expression tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+var a = function () {}
+var b = function (x, y) {}
+var c = function (x, y) {"use strict"}
+var e = function () { return function (){"use strict"}}
+
+
+EOF
+
+parse("functionExpr.js", code, "-nse", new (Java.extend(visitor, {
+    visitFunctionExpression : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/functionExpr.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,128 @@
+[
+  {
+    "endPosition": "21",
+    "kind": "FUNCTION_EXPRESSION",
+    "name": "null",
+    "body": {
+      "endPosition": "22",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "21"
+    },
+    "strict": "false",
+    "startPosition": "21",
+    "parameters": []
+  },
+  {
+    "endPosition": "48",
+    "kind": "FUNCTION_EXPRESSION",
+    "name": "null",
+    "body": {
+      "endPosition": "49",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "48"
+    },
+    "strict": "false",
+    "startPosition": "48",
+    "parameters": [
+      {
+        "endPosition": "43",
+        "kind": "IDENTIFIER",
+        "name": "x",
+        "startPosition": "42"
+      },
+      {
+        "endPosition": "46",
+        "kind": "IDENTIFIER",
+        "name": "y",
+        "startPosition": "45"
+      }
+    ]
+  },
+  {
+    "endPosition": "75",
+    "kind": "FUNCTION_EXPRESSION",
+    "name": "null",
+    "body": {
+      "endPosition": "87",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "endPosition": "87",
+            "kind": "STRING_LITERAL",
+            "value": "use strict",
+            "startPosition": "77"
+          },
+          "endPosition": "87",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "77"
+        }
+      ],
+      "startPosition": "75"
+    },
+    "strict": "true",
+    "startPosition": "75",
+    "parameters": [
+      {
+        "endPosition": "70",
+        "kind": "IDENTIFIER",
+        "name": "x",
+        "startPosition": "69"
+      },
+      {
+        "endPosition": "73",
+        "kind": "IDENTIFIER",
+        "name": "y",
+        "startPosition": "72"
+      }
+    ]
+  },
+  {
+    "endPosition": "110",
+    "kind": "FUNCTION_EXPRESSION",
+    "name": "null",
+    "body": {
+      "endPosition": "144",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "endPosition": "130",
+            "kind": "FUNCTION_EXPRESSION",
+            "name": "null",
+            "body": {
+              "endPosition": "142",
+              "kind": "BLOCK",
+              "statements": [
+                {
+                  "expression": {
+                    "endPosition": "142",
+                    "kind": "STRING_LITERAL",
+                    "value": "use strict",
+                    "startPosition": "132"
+                  },
+                  "endPosition": "142",
+                  "kind": "EXPRESSION_STATEMENT",
+                  "startPosition": "132"
+                }
+              ],
+              "startPosition": "130"
+            },
+            "strict": "true",
+            "startPosition": "130",
+            "parameters": []
+          },
+          "endPosition": "144",
+          "kind": "RETURN",
+          "startPosition": "112"
+        }
+      ],
+      "startPosition": "110"
+    },
+    "strict": "false",
+    "startPosition": "110",
+    "parameters": []
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/identifier.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation identifier tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+undefined
+NaN
+a
+a23
+var_name
+_underscore
+$dollar
+
+EOF
+
+parse("identifier.js", code, "-nse", new (Java.extend(visitor, {
+    visitIdentifier : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/identifier.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,44 @@
+[
+  {
+    "endPosition": "10",
+    "kind": "IDENTIFIER",
+    "name": "undefined",
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "14",
+    "kind": "IDENTIFIER",
+    "name": "NaN",
+    "startPosition": "11"
+  },
+  {
+    "endPosition": "16",
+    "kind": "IDENTIFIER",
+    "name": "a",
+    "startPosition": "15"
+  },
+  {
+    "endPosition": "20",
+    "kind": "IDENTIFIER",
+    "name": "a23",
+    "startPosition": "17"
+  },
+  {
+    "endPosition": "29",
+    "kind": "IDENTIFIER",
+    "name": "var_name",
+    "startPosition": "21"
+  },
+  {
+    "endPosition": "41",
+    "kind": "IDENTIFIER",
+    "name": "_underscore",
+    "startPosition": "30"
+  },
+  {
+    "endPosition": "49",
+    "kind": "IDENTIFIER",
+    "name": "$dollar",
+    "startPosition": "42"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/if.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation if-else tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+if (true) {}
+if (false) {}
+if (a) print(a)
+if ("STR") {}
+if ( a > 10) {} else {}
+if (a) {} else if (b) {} else {}
+
+EOF
+
+parse("if.js", code, "-nse", new (Java.extend(visitor, {
+    visitIf : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/if.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,166 @@
+[
+  {
+    "condition": {
+      "endPosition": "9",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "true",
+      "startPosition": "5"
+    },
+    "elseStatement": "null",
+    "endPosition": "13",
+    "kind": "IF",
+    "startPosition": "1",
+    "thenStatement": {
+      "endPosition": "13",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "11"
+    }
+  },
+  {
+    "condition": {
+      "endPosition": "23",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "false",
+      "startPosition": "18"
+    },
+    "elseStatement": "null",
+    "endPosition": "27",
+    "kind": "IF",
+    "startPosition": "14",
+    "thenStatement": {
+      "endPosition": "27",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "25"
+    }
+  },
+  {
+    "condition": {
+      "endPosition": "33",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "32"
+    },
+    "elseStatement": "null",
+    "endPosition": "43",
+    "kind": "IF",
+    "startPosition": "28",
+    "thenStatement": {
+      "expression": {
+        "endPosition": "43",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "40",
+          "kind": "IDENTIFIER",
+          "name": "print",
+          "startPosition": "35"
+        },
+        "arguments": [
+          {
+            "endPosition": "42",
+            "kind": "IDENTIFIER",
+            "name": "a",
+            "startPosition": "41"
+          }
+        ],
+        "startPosition": "35"
+      },
+      "endPosition": "43",
+      "kind": "EXPRESSION_STATEMENT",
+      "startPosition": "35"
+    }
+  },
+  {
+    "condition": {
+      "endPosition": "52",
+      "kind": "STRING_LITERAL",
+      "value": "STR",
+      "startPosition": "49"
+    },
+    "elseStatement": "null",
+    "endPosition": "57",
+    "kind": "IF",
+    "startPosition": "44",
+    "thenStatement": {
+      "endPosition": "57",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "55"
+    }
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "endPosition": "64",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "63"
+      },
+      "endPosition": "69",
+      "kind": "GREATER_THAN",
+      "rightOperand": {
+        "endPosition": "69",
+        "kind": "NUMBER_LITERAL",
+        "value": "10",
+        "startPosition": "67"
+      },
+      "startPosition": "63"
+    },
+    "elseStatement": {
+      "endPosition": "81",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "79"
+    },
+    "endPosition": "81",
+    "kind": "IF",
+    "startPosition": "58",
+    "thenStatement": {
+      "endPosition": "73",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "71"
+    }
+  },
+  {
+    "condition": {
+      "endPosition": "87",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "86"
+    },
+    "elseStatement": {
+      "condition": {
+        "endPosition": "102",
+        "kind": "IDENTIFIER",
+        "name": "b",
+        "startPosition": "101"
+      },
+      "elseStatement": {
+        "endPosition": "114",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "112"
+      },
+      "endPosition": "114",
+      "kind": "IF",
+      "startPosition": "97",
+      "thenStatement": {
+        "endPosition": "106",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "104"
+      }
+    },
+    "endPosition": "114",
+    "kind": "IF",
+    "startPosition": "82",
+    "thenStatement": {
+      "endPosition": "91",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "89"
+    }
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/instanceof.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Or1cle 1nd/or its 1ffili1tes. 1ll rights reserved.
+ * DO NOT 1LTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HE1DER.
+ *
+ * This code is free softw1re; you c1n redistri2ute it 1nd/or modify it
+ * under the terms of the GNU Gener1l Pu2lic License version 2 only, 1s
+ * pu2lished 2y the Free Softw1re Found1tion.
+ *
+ * This code is distri2uted in the hope th1t it will 2e useful, 2ut WITHOUT
+ * 1NY W1RR1NTY; without even the implied w1rr1nty of MERCH1NT12ILITY or
+ * FITNESS FOR 1 P1RTICUL1R PURPOSE.  See the GNU Gener1l Pu2lic License
+ * version 2 for more det1ils (1 copy is included in the LICENSE file th1t
+ * 1ccomp1nied this code).
+ *
+ * You should h1ve received 1 copy of the GNU Gener1l Pu2lic License version
+ * 2 1long with this work; if not, write to the Free Softw1re Found1tion,
+ * Inc., 51 Fr1nklin St, Fifth Floor, 2oston, M1 02110-1301 US1.
+ *
+ * Ple1se cont1ct Or1cle, 500 Or1cle P1rkw1y, Redwood Shores, C1 94065 US1
+ * or visit www.or1cle.com if you need 1ddition1l inform1tion or h1ve 1ny
+ * questions.
+ */
+
+/**
+ * Tests to check representation instanceof statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+a instanceof Array
+a() instanceof Object
+1 instanceof a
+2 instanceof a()
+C.prototype instanceof Object
+"str" instanceof obj.member
+
+EOF
+
+parse("instanceof.js", code, "-nse", new (Java.extend(visitor, {
+    visitInstanceOf : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/instanceof.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,224 @@
+[
+  {
+    "leftOperand": {
+      "endPosition": "2",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "1"
+    },
+    "expression": {
+      "endPosition": "2",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "1"
+    },
+    "endPosition": "19",
+    "kind": "INSTANCE_OF",
+    "rightOperand": {
+      "endPosition": "19",
+      "kind": "IDENTIFIER",
+      "name": "Array",
+      "startPosition": "14"
+    },
+    "type": {
+      "endPosition": "19",
+      "kind": "IDENTIFIER",
+      "name": "Array",
+      "startPosition": "14"
+    },
+    "startPosition": "1"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "23",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "21",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "20"
+      },
+      "arguments": [],
+      "startPosition": "20"
+    },
+    "expression": {
+      "endPosition": "23",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "21",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "20"
+      },
+      "arguments": [],
+      "startPosition": "20"
+    },
+    "endPosition": "41",
+    "kind": "INSTANCE_OF",
+    "rightOperand": {
+      "endPosition": "41",
+      "kind": "IDENTIFIER",
+      "name": "Object",
+      "startPosition": "35"
+    },
+    "type": {
+      "endPosition": "41",
+      "kind": "IDENTIFIER",
+      "name": "Object",
+      "startPosition": "35"
+    },
+    "startPosition": "20"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "43",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "42"
+    },
+    "expression": {
+      "endPosition": "43",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "42"
+    },
+    "endPosition": "56",
+    "kind": "INSTANCE_OF",
+    "rightOperand": {
+      "endPosition": "56",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "55"
+    },
+    "type": {
+      "endPosition": "56",
+      "kind": "IDENTIFIER",
+      "name": "a",
+      "startPosition": "55"
+    },
+    "startPosition": "42"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "58",
+      "kind": "NUMBER_LITERAL",
+      "value": "2",
+      "startPosition": "57"
+    },
+    "expression": {
+      "endPosition": "58",
+      "kind": "NUMBER_LITERAL",
+      "value": "2",
+      "startPosition": "57"
+    },
+    "endPosition": "73",
+    "kind": "INSTANCE_OF",
+    "rightOperand": {
+      "endPosition": "73",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "71",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "70"
+      },
+      "arguments": [],
+      "startPosition": "70"
+    },
+    "type": {
+      "endPosition": "73",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "71",
+        "kind": "IDENTIFIER",
+        "name": "a",
+        "startPosition": "70"
+      },
+      "arguments": [],
+      "startPosition": "70"
+    },
+    "startPosition": "57"
+  },
+  {
+    "leftOperand": {
+      "identifier": "prototype",
+      "expression": {
+        "endPosition": "75",
+        "kind": "IDENTIFIER",
+        "name": "C",
+        "startPosition": "74"
+      },
+      "endPosition": "85",
+      "kind": "MEMBER_SELECT",
+      "startPosition": "74"
+    },
+    "expression": {
+      "identifier": "prototype",
+      "expression": {
+        "endPosition": "75",
+        "kind": "IDENTIFIER",
+        "name": "C",
+        "startPosition": "74"
+      },
+      "endPosition": "85",
+      "kind": "MEMBER_SELECT",
+      "startPosition": "74"
+    },
+    "endPosition": "103",
+    "kind": "INSTANCE_OF",
+    "rightOperand": {
+      "endPosition": "103",
+      "kind": "IDENTIFIER",
+      "name": "Object",
+      "startPosition": "97"
+    },
+    "type": {
+      "endPosition": "103",
+      "kind": "IDENTIFIER",
+      "name": "Object",
+      "startPosition": "97"
+    },
+    "startPosition": "74"
+  },
+  {
+    "leftOperand": {
+      "endPosition": "108",
+      "kind": "STRING_LITERAL",
+      "value": "str",
+      "startPosition": "105"
+    },
+    "expression": {
+      "endPosition": "108",
+      "kind": "STRING_LITERAL",
+      "value": "str",
+      "startPosition": "105"
+    },
+    "endPosition": "131",
+    "kind": "INSTANCE_OF",
+    "rightOperand": {
+      "identifier": "member",
+      "expression": {
+        "endPosition": "124",
+        "kind": "IDENTIFIER",
+        "name": "obj",
+        "startPosition": "121"
+      },
+      "endPosition": "131",
+      "kind": "MEMBER_SELECT",
+      "startPosition": "121"
+    },
+    "type": {
+      "identifier": "member",
+      "expression": {
+        "endPosition": "124",
+        "kind": "IDENTIFIER",
+        "name": "obj",
+        "startPosition": "121"
+      },
+      "endPosition": "131",
+      "kind": "MEMBER_SELECT",
+      "startPosition": "121"
+    },
+    "startPosition": "105"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/labelledStat.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation labeled statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+begin: { for (;;) break begin };
+begin: { while (true) break begin };
+begin: { while (false) continue begin };
+begin: { for (;;) continue begin };
+begin: { do continue begin; while(false);};
+begin: { do break begin; while(true);};
+
+EOF
+
+parse("labeledStat.js", code, "-nse", new (Java.extend(visitor, {
+    visitLabeledStatement : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/labelledStat.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,176 @@
+[
+  {
+    "endPosition": "32",
+    "kind": "LABELED_STATEMENT",
+    "statement": {
+      "endPosition": "32",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": "null",
+          "endPosition": "30",
+          "kind": "FOR_LOOP",
+          "statement": {
+            "endPosition": "30",
+            "kind": "BREAK",
+            "label": "begin",
+            "startPosition": "19"
+          },
+          "update": "null",
+          "startPosition": "10",
+          "initializer": "null"
+        }
+      ],
+      "startPosition": "8"
+    },
+    "label": "begin",
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "69",
+    "kind": "LABELED_STATEMENT",
+    "statement": {
+      "endPosition": "69",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": {
+            "endPosition": "54",
+            "kind": "BOOLEAN_LITERAL",
+            "value": "true",
+            "startPosition": "50"
+          },
+          "endPosition": "67",
+          "kind": "WHILE_LOOP",
+          "statement": {
+            "endPosition": "67",
+            "kind": "BREAK",
+            "label": "begin",
+            "startPosition": "56"
+          },
+          "startPosition": "43"
+        }
+      ],
+      "startPosition": "41"
+    },
+    "label": "begin",
+    "startPosition": "34"
+  },
+  {
+    "endPosition": "110",
+    "kind": "LABELED_STATEMENT",
+    "statement": {
+      "endPosition": "110",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": {
+            "endPosition": "92",
+            "kind": "BOOLEAN_LITERAL",
+            "value": "false",
+            "startPosition": "87"
+          },
+          "endPosition": "108",
+          "kind": "WHILE_LOOP",
+          "statement": {
+            "endPosition": "108",
+            "kind": "CONTINUE",
+            "label": "begin",
+            "startPosition": "94"
+          },
+          "startPosition": "80"
+        }
+      ],
+      "startPosition": "78"
+    },
+    "label": "begin",
+    "startPosition": "71"
+  },
+  {
+    "endPosition": "146",
+    "kind": "LABELED_STATEMENT",
+    "statement": {
+      "endPosition": "146",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": "null",
+          "endPosition": "144",
+          "kind": "FOR_LOOP",
+          "statement": {
+            "endPosition": "144",
+            "kind": "CONTINUE",
+            "label": "begin",
+            "startPosition": "130"
+          },
+          "update": "null",
+          "startPosition": "121",
+          "initializer": "null"
+        }
+      ],
+      "startPosition": "119"
+    },
+    "label": "begin",
+    "startPosition": "112"
+  },
+  {
+    "endPosition": "190",
+    "kind": "LABELED_STATEMENT",
+    "statement": {
+      "endPosition": "190",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": {
+            "endPosition": "187",
+            "kind": "BOOLEAN_LITERAL",
+            "value": "false",
+            "startPosition": "182"
+          },
+          "endPosition": "189",
+          "kind": "DO_WHILE_LOOP",
+          "statement": {
+            "endPosition": "175",
+            "kind": "CONTINUE",
+            "label": "begin",
+            "startPosition": "160"
+          },
+          "startPosition": "157"
+        }
+      ],
+      "startPosition": "155"
+    },
+    "label": "begin",
+    "startPosition": "148"
+  },
+  {
+    "endPosition": "230",
+    "kind": "LABELED_STATEMENT",
+    "statement": {
+      "endPosition": "230",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "condition": {
+            "endPosition": "227",
+            "kind": "BOOLEAN_LITERAL",
+            "value": "true",
+            "startPosition": "223"
+          },
+          "endPosition": "229",
+          "kind": "DO_WHILE_LOOP",
+          "statement": {
+            "endPosition": "216",
+            "kind": "BREAK",
+            "label": "begin",
+            "startPosition": "204"
+          },
+          "startPosition": "201"
+        }
+      ],
+      "startPosition": "199"
+    },
+    "label": "begin",
+    "startPosition": "192"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/literal.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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 representation literal statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+1
+null
+hello
+false
+"use strict";
+
+EOF
+
+parse("literal.js", code, "-nse", new (Java.extend(visitor, {
+    visitLiteral : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/literal.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,26 @@
+[
+  {
+    "endPosition": "2",
+    "kind": "NUMBER_LITERAL",
+    "value": "1",
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "7",
+    "kind": "NULL_LITERAL",
+    "value": "null",
+    "startPosition": "3"
+  },
+  {
+    "endPosition": "19",
+    "kind": "BOOLEAN_LITERAL",
+    "value": "false",
+    "startPosition": "14"
+  },
+  {
+    "endPosition": "31",
+    "kind": "STRING_LITERAL",
+    "value": "use strict",
+    "startPosition": "21"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/memberSelect.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation member select tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+object.field
+object.method()
+this.null
+Array.prototype
+
+EOF
+
+parse("memberSelect.js", code, "-nse", new (Java.extend(visitor, {
+    visitMemberSelect : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/memberSelect.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,50 @@
+[
+  {
+    "identifier": "field",
+    "expression": {
+      "endPosition": "7",
+      "kind": "IDENTIFIER",
+      "name": "object",
+      "startPosition": "1"
+    },
+    "endPosition": "13",
+    "kind": "MEMBER_SELECT",
+    "startPosition": "1"
+  },
+  {
+    "identifier": "method",
+    "expression": {
+      "endPosition": "20",
+      "kind": "IDENTIFIER",
+      "name": "object",
+      "startPosition": "14"
+    },
+    "endPosition": "27",
+    "kind": "MEMBER_SELECT",
+    "startPosition": "14"
+  },
+  {
+    "identifier": "null",
+    "expression": {
+      "endPosition": "34",
+      "kind": "IDENTIFIER",
+      "name": "this",
+      "startPosition": "30"
+    },
+    "endPosition": "39",
+    "kind": "MEMBER_SELECT",
+    "startPosition": "30"
+  },
+  {
+    "identifier": "prototype",
+    "expression": {
+      "endPosition": "45",
+      "kind": "IDENTIFIER",
+      "name": "Array",
+      "startPosition": "40"
+    },
+    "endPosition": "55",
+    "kind": "MEMBER_SELECT",
+    "startPosition": "40"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/new.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation new statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+new Object()
+new Array()
+new function (a,b,c) {}
+new func
+new obj.init
+
+EOF
+
+parse("new.js", code, "-nse", new (Java.extend(visitor, {
+    visitNew : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/new.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,120 @@
+[
+  {
+    "constructorExpression": {
+      "endPosition": "13",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "11",
+        "kind": "IDENTIFIER",
+        "name": "Object",
+        "startPosition": "5"
+      },
+      "arguments": [],
+      "startPosition": "5"
+    },
+    "endPosition": "13",
+    "kind": "NEW",
+    "startPosition": "1"
+  },
+  {
+    "constructorExpression": {
+      "endPosition": "25",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "23",
+        "kind": "IDENTIFIER",
+        "name": "Array",
+        "startPosition": "18"
+      },
+      "arguments": [],
+      "startPosition": "18"
+    },
+    "endPosition": "25",
+    "kind": "NEW",
+    "startPosition": "14"
+  },
+  {
+    "constructorExpression": {
+      "endPosition": "49",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "47",
+        "kind": "FUNCTION_EXPRESSION",
+        "name": "null",
+        "body": {
+          "endPosition": "48",
+          "kind": "BLOCK",
+          "statements": [],
+          "startPosition": "47"
+        },
+        "strict": "false",
+        "startPosition": "47",
+        "parameters": [
+          {
+            "endPosition": "41",
+            "kind": "IDENTIFIER",
+            "name": "a",
+            "startPosition": "40"
+          },
+          {
+            "endPosition": "43",
+            "kind": "IDENTIFIER",
+            "name": "b",
+            "startPosition": "42"
+          },
+          {
+            "endPosition": "45",
+            "kind": "IDENTIFIER",
+            "name": "c",
+            "startPosition": "44"
+          }
+        ]
+      },
+      "arguments": [],
+      "startPosition": "47"
+    },
+    "endPosition": "49",
+    "kind": "NEW",
+    "startPosition": "26"
+  },
+  {
+    "constructorExpression": {
+      "endPosition": "58",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "58",
+        "kind": "IDENTIFIER",
+        "name": "func",
+        "startPosition": "54"
+      },
+      "arguments": [],
+      "startPosition": "54"
+    },
+    "endPosition": "58",
+    "kind": "NEW",
+    "startPosition": "50"
+  },
+  {
+    "constructorExpression": {
+      "endPosition": "71",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "identifier": "init",
+        "expression": {
+          "endPosition": "66",
+          "kind": "IDENTIFIER",
+          "name": "obj",
+          "startPosition": "63"
+        },
+        "endPosition": "71",
+        "kind": "MEMBER_SELECT",
+        "startPosition": "63"
+      },
+      "arguments": [],
+      "startPosition": "66"
+    },
+    "endPosition": "71",
+    "kind": "NEW",
+    "startPosition": "59"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/objectLiteral.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation object literal tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+({ foo: 343 })
+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 } };
+
+
+EOF
+
+parse("objectLiteral.js", code, "-nse", new (Java.extend(visitor, {
+    visitObjectLiteral : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/objectLiteral.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,310 @@
+[
+  {
+    "endPosition": "14",
+    "kind": "OBJECT_LITERAL",
+    "startPosition": "2",
+    "properties": [
+      {
+        "getter": "null",
+        "endPosition": "8",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": {
+          "endPosition": "12",
+          "kind": "NUMBER_LITERAL",
+          "value": "343",
+          "startPosition": "9"
+        },
+        "startPosition": "4",
+        "key": {
+          "endPosition": "7",
+          "kind": "IDENTIFIER",
+          "name": "foo",
+          "startPosition": "4"
+        }
+      }
+    ]
+  },
+  {
+    "endPosition": "24",
+    "kind": "OBJECT_LITERAL",
+    "startPosition": "22",
+    "properties": []
+  },
+  {
+    "endPosition": "45",
+    "kind": "OBJECT_LITERAL",
+    "startPosition": "30",
+    "properties": [
+      {
+        "getter": "null",
+        "endPosition": "34",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": {
+          "endPosition": "37",
+          "kind": "NUMBER_LITERAL",
+          "value": "10",
+          "startPosition": "35"
+        },
+        "startPosition": "32",
+        "key": {
+          "endPosition": "33",
+          "kind": "IDENTIFIER",
+          "name": "x",
+          "startPosition": "32"
+        }
+      },
+      {
+        "getter": "null",
+        "endPosition": "41",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": {
+          "endPosition": "43",
+          "kind": "NUMBER_LITERAL",
+          "value": "2",
+          "startPosition": "42"
+        },
+        "startPosition": "39",
+        "key": {
+          "endPosition": "40",
+          "kind": "IDENTIFIER",
+          "name": "y",
+          "startPosition": "39"
+        }
+      }
+    ]
+  },
+  {
+    "endPosition": "70",
+    "kind": "OBJECT_LITERAL",
+    "startPosition": "51",
+    "properties": [
+      {
+        "getter": "null",
+        "endPosition": "57",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": {
+          "endPosition": "60",
+          "kind": "NUMBER_LITERAL",
+          "value": "10",
+          "startPosition": "58"
+        },
+        "startPosition": "54",
+        "key": {
+          "endPosition": "55",
+          "kind": "STRING_LITERAL",
+          "value": "x",
+          "startPosition": "54"
+        }
+      },
+      {
+        "getter": "null",
+        "endPosition": "66",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": {
+          "endPosition": "68",
+          "kind": "NUMBER_LITERAL",
+          "value": "2",
+          "startPosition": "67"
+        },
+        "startPosition": "63",
+        "key": {
+          "endPosition": "64",
+          "kind": "STRING_LITERAL",
+          "value": "y",
+          "startPosition": "63"
+        }
+      }
+    ]
+  },
+  {
+    "endPosition": "132",
+    "kind": "OBJECT_LITERAL",
+    "startPosition": "76",
+    "properties": [
+      {
+        "getter": {
+          "endPosition": "86",
+          "kind": "FUNCTION_EXPRESSION",
+          "name": "null",
+          "body": {
+            "endPosition": "101",
+            "kind": "BLOCK",
+            "statements": [
+              {
+                "expression": {
+                  "endPosition": "101",
+                  "kind": "IDENTIFIER",
+                  "name": "xValue",
+                  "startPosition": "95"
+                },
+                "endPosition": "101",
+                "kind": "RETURN",
+                "startPosition": "88"
+              }
+            ],
+            "startPosition": "86"
+          },
+          "strict": "false",
+          "startPosition": "86",
+          "parameters": []
+        },
+        "endPosition": "103",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": "null",
+        "startPosition": "78",
+        "key": {
+          "endPosition": "83",
+          "kind": "IDENTIFIER",
+          "name": "x",
+          "startPosition": "82"
+        }
+      },
+      {
+        "getter": {
+          "endPosition": "113",
+          "kind": "FUNCTION_EXPRESSION",
+          "name": "null",
+          "body": {
+            "endPosition": "128",
+            "kind": "BLOCK",
+            "statements": [
+              {
+                "expression": {
+                  "endPosition": "128",
+                  "kind": "IDENTIFIER",
+                  "name": "yValue",
+                  "startPosition": "122"
+                },
+                "endPosition": "128",
+                "kind": "RETURN",
+                "startPosition": "115"
+              }
+            ],
+            "startPosition": "113"
+          },
+          "strict": "false",
+          "startPosition": "113",
+          "parameters": []
+        },
+        "endPosition": "130",
+        "kind": "PROPERTY",
+        "setter": "null",
+        "value": "null",
+        "startPosition": "105",
+        "key": {
+          "endPosition": "110",
+          "kind": "IDENTIFIER",
+          "name": "y",
+          "startPosition": "109"
+        }
+      }
+    ]
+  },
+  {
+    "endPosition": "206",
+    "kind": "OBJECT_LITERAL",
+    "startPosition": "138",
+    "properties": [
+      {
+        "getter": {
+          "endPosition": "150",
+          "kind": "FUNCTION_EXPRESSION",
+          "name": "null",
+          "body": {
+            "endPosition": "168",
+            "kind": "BLOCK",
+            "statements": [
+              {
+                "expression": {
+                  "identifier": "_foo",
+                  "expression": {
+                    "endPosition": "163",
+                    "kind": "IDENTIFIER",
+                    "name": "this",
+                    "startPosition": "159"
+                  },
+                  "endPosition": "168",
+                  "kind": "MEMBER_SELECT",
+                  "startPosition": "159"
+                },
+                "endPosition": "168",
+                "kind": "RETURN",
+                "startPosition": "152"
+              }
+            ],
+            "startPosition": "150"
+          },
+          "strict": "false",
+          "startPosition": "150",
+          "parameters": []
+        },
+        "endPosition": "170",
+        "kind": "PROPERTY",
+        "setter": {
+          "endPosition": "185",
+          "kind": "FUNCTION_EXPRESSION",
+          "name": "null",
+          "body": {
+            "endPosition": "202",
+            "kind": "BLOCK",
+            "statements": [
+              {
+                "expression": {
+                  "expression": {
+                    "endPosition": "202",
+                    "kind": "IDENTIFIER",
+                    "name": "val",
+                    "startPosition": "199"
+                  },
+                  "endPosition": "202",
+                  "kind": "ASSIGNMENT",
+                  "variable": {
+                    "identifier": "_foo",
+                    "expression": {
+                      "endPosition": "191",
+                      "kind": "IDENTIFIER",
+                      "name": "this",
+                      "startPosition": "187"
+                    },
+                    "endPosition": "196",
+                    "kind": "MEMBER_SELECT",
+                    "startPosition": "187"
+                  },
+                  "startPosition": "187"
+                },
+                "endPosition": "202",
+                "kind": "EXPRESSION_STATEMENT",
+                "startPosition": "187"
+              }
+            ],
+            "startPosition": "185"
+          },
+          "strict": "false",
+          "startPosition": "185",
+          "parameters": [
+            {
+              "endPosition": "183",
+              "kind": "IDENTIFIER",
+              "name": "val",
+              "startPosition": "180"
+            }
+          ]
+        },
+        "value": "null",
+        "startPosition": "140",
+        "key": {
+          "endPosition": "147",
+          "kind": "IDENTIFIER",
+          "name": "foo",
+          "startPosition": "144"
+        }
+      }
+    ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/property.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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 representation property tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+var o = {
+ foo :'test',
+ _foo: call(),
+ $foo: function () {},
+ fo42: {}
+}
+
+EOF
+
+parse("property.js", code, "-nse", new (Java.extend(visitor, {
+    visitProperty : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/property.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,92 @@
+[
+  {
+    "getter": "null",
+    "endPosition": "17",
+    "kind": "PROPERTY",
+    "setter": "null",
+    "value": {
+      "endPosition": "22",
+      "kind": "STRING_LITERAL",
+      "value": "test",
+      "startPosition": "18"
+    },
+    "startPosition": "12",
+    "key": {
+      "endPosition": "15",
+      "kind": "IDENTIFIER",
+      "name": "foo",
+      "startPosition": "12"
+    }
+  },
+  {
+    "getter": "null",
+    "endPosition": "31",
+    "kind": "PROPERTY",
+    "setter": "null",
+    "value": {
+      "endPosition": "38",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "36",
+        "kind": "IDENTIFIER",
+        "name": "call",
+        "startPosition": "32"
+      },
+      "arguments": [],
+      "startPosition": "32"
+    },
+    "startPosition": "26",
+    "key": {
+      "endPosition": "30",
+      "kind": "IDENTIFIER",
+      "name": "_foo",
+      "startPosition": "26"
+    }
+  },
+  {
+    "getter": "null",
+    "endPosition": "46",
+    "kind": "PROPERTY",
+    "setter": "null",
+    "value": {
+      "endPosition": "59",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "60",
+        "kind": "BLOCK",
+        "statements": [],
+        "startPosition": "59"
+      },
+      "strict": "false",
+      "startPosition": "59",
+      "parameters": []
+    },
+    "startPosition": "41",
+    "key": {
+      "endPosition": "45",
+      "kind": "IDENTIFIER",
+      "name": "$foo",
+      "startPosition": "41"
+    }
+  },
+  {
+    "getter": "null",
+    "endPosition": "69",
+    "kind": "PROPERTY",
+    "setter": "null",
+    "value": {
+      "endPosition": "72",
+      "kind": "OBJECT_LITERAL",
+      "startPosition": "70",
+      "properties": []
+    },
+    "startPosition": "64",
+    "key": {
+      "endPosition": "68",
+      "kind": "IDENTIFIER",
+      "name": "fo42",
+      "startPosition": "64"
+    }
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/regexp.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation regexp expression tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+/[abc]/i;
+/([^abc])*([a-z])+([^0-9])?(x|y)/ig.test();
+/^\w\W\n\f\0$/igm;
+
+EOF
+
+parse("regexp.js", code, "-nse", new (Java.extend(visitor, {
+    visitRegExpLiteral : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/regexp.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,23 @@
+[
+  {
+    "endPosition": "9",
+    "kind": "REGEXP_LITERAL",
+    "options": "i",
+    "pattern": "[abc]",
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "46",
+    "kind": "REGEXP_LITERAL",
+    "options": "ig",
+    "pattern": "([^abc])*([a-z])+([^0-9])?(x|y)",
+    "startPosition": "11"
+  },
+  {
+    "endPosition": "72",
+    "kind": "REGEXP_LITERAL",
+    "options": "igm",
+    "pattern": "^\\w\\W\\n\\f\\0$",
+    "startPosition": "55"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/return.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,65 @@
+/*
+ * 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 representation return expression tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+function a () {
+    return 1;
+}
+function b () {
+    return function () {
+        return {}
+    }
+}
+function c() {
+    for(;;) {
+        return;
+    }
+    return
+}
+
+function d () {
+    while(true) {
+        return
+    }
+}
+
+EOF
+
+parse("return.js", code, "-nse", new (Java.extend(visitor, {
+    visitReturn : function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/return.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,62 @@
+[
+  {
+    "expression": {
+      "endPosition": "29",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "28"
+    },
+    "endPosition": "30",
+    "kind": "RETURN",
+    "startPosition": "21"
+  },
+  {
+    "expression": {
+      "endPosition": "72",
+      "kind": "FUNCTION_EXPRESSION",
+      "name": "null",
+      "body": {
+        "endPosition": "91",
+        "kind": "BLOCK",
+        "statements": [
+          {
+            "expression": {
+              "endPosition": "91",
+              "kind": "OBJECT_LITERAL",
+              "startPosition": "89",
+              "properties": []
+            },
+            "endPosition": "91",
+            "kind": "RETURN",
+            "startPosition": "82"
+          }
+        ],
+        "startPosition": "72"
+      },
+      "strict": "false",
+      "startPosition": "72",
+      "parameters": []
+    },
+    "endPosition": "97",
+    "kind": "RETURN",
+    "startPosition": "53"
+  },
+  {
+    "expression": "null",
+    "endPosition": "144",
+    "kind": "RETURN",
+    "startPosition": "137"
+  },
+  {
+    "expression": "null",
+    "endPosition": "161",
+    "kind": "RETURN",
+    "startPosition": "155"
+  },
+  {
+    "expression": "null",
+    "endPosition": "213",
+    "kind": "RETURN",
+    "startPosition": "207"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/switch.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 representation switch statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+switch (key) {};
+switch (key) {
+    case 2: hello();
+    break;
+};
+switch (key) {
+    case 4: hello(); break;
+    case 2: world(); break;
+    default: break
+};
+
+EOF
+
+parse("switch.js", code, "-nse", new (Java.extend(visitor, {
+    visitSwitch: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/switch.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,162 @@
+[
+  {
+    "cases": [],
+    "expression": {
+      "endPosition": "12",
+      "kind": "IDENTIFIER",
+      "name": "key",
+      "startPosition": "9"
+    },
+    "endPosition": "16",
+    "kind": "SWITCH",
+    "startPosition": "1"
+  },
+  {
+    "cases": [
+      {
+        "expression": {
+          "endPosition": "43",
+          "kind": "NUMBER_LITERAL",
+          "value": "2",
+          "startPosition": "42"
+        },
+        "endPosition": "64",
+        "kind": "CASE",
+        "statements": [
+          {
+            "expression": {
+              "endPosition": "52",
+              "kind": "FUNCTION_INVOCATION",
+              "functionSelect": {
+                "endPosition": "50",
+                "kind": "IDENTIFIER",
+                "name": "hello",
+                "startPosition": "45"
+              },
+              "arguments": [],
+              "startPosition": "45"
+            },
+            "endPosition": "52",
+            "kind": "EXPRESSION_STATEMENT",
+            "startPosition": "45"
+          },
+          {
+            "endPosition": "64",
+            "kind": "BREAK",
+            "label": "null",
+            "startPosition": "58"
+          }
+        ],
+        "startPosition": "37"
+      }
+    ],
+    "expression": {
+      "endPosition": "29",
+      "kind": "IDENTIFIER",
+      "name": "key",
+      "startPosition": "26"
+    },
+    "endPosition": "66",
+    "kind": "SWITCH",
+    "startPosition": "18"
+  },
+  {
+    "cases": [
+      {
+        "expression": {
+          "endPosition": "93",
+          "kind": "NUMBER_LITERAL",
+          "value": "4",
+          "startPosition": "92"
+        },
+        "endPosition": "110",
+        "kind": "CASE",
+        "statements": [
+          {
+            "expression": {
+              "endPosition": "102",
+              "kind": "FUNCTION_INVOCATION",
+              "functionSelect": {
+                "endPosition": "100",
+                "kind": "IDENTIFIER",
+                "name": "hello",
+                "startPosition": "95"
+              },
+              "arguments": [],
+              "startPosition": "95"
+            },
+            "endPosition": "102",
+            "kind": "EXPRESSION_STATEMENT",
+            "startPosition": "95"
+          },
+          {
+            "endPosition": "110",
+            "kind": "BREAK",
+            "label": "null",
+            "startPosition": "104"
+          }
+        ],
+        "startPosition": "87"
+      },
+      {
+        "expression": {
+          "endPosition": "121",
+          "kind": "NUMBER_LITERAL",
+          "value": "2",
+          "startPosition": "120"
+        },
+        "endPosition": "138",
+        "kind": "CASE",
+        "statements": [
+          {
+            "expression": {
+              "endPosition": "130",
+              "kind": "FUNCTION_INVOCATION",
+              "functionSelect": {
+                "endPosition": "128",
+                "kind": "IDENTIFIER",
+                "name": "world",
+                "startPosition": "123"
+              },
+              "arguments": [],
+              "startPosition": "123"
+            },
+            "endPosition": "130",
+            "kind": "EXPRESSION_STATEMENT",
+            "startPosition": "123"
+          },
+          {
+            "endPosition": "138",
+            "kind": "BREAK",
+            "label": "null",
+            "startPosition": "132"
+          }
+        ],
+        "startPosition": "115"
+      },
+      {
+        "expression": "null",
+        "endPosition": "157",
+        "kind": "CASE",
+        "statements": [
+          {
+            "endPosition": "157",
+            "kind": "BREAK",
+            "label": "null",
+            "startPosition": "152"
+          }
+        ],
+        "startPosition": "143"
+      }
+    ],
+    "expression": {
+      "endPosition": "79",
+      "kind": "IDENTIFIER",
+      "name": "key",
+      "startPosition": "76"
+    },
+    "endPosition": "159",
+    "kind": "SWITCH",
+    "startPosition": "68"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/throw.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation throw statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+throw err;
+throw 'wrong';
+throw new TypeError;
+throw new TypeError('not an array');
+throw { msg: 'wrong!' };
+
+EOF
+
+parse("throw.js", code, "-nse", new (Java.extend(visitor, {
+    visitThrow: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/throw.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,106 @@
+[
+  {
+    "expression": {
+      "endPosition": "10",
+      "kind": "IDENTIFIER",
+      "name": "err",
+      "startPosition": "7"
+    },
+    "endPosition": "11",
+    "kind": "THROW",
+    "startPosition": "1"
+  },
+  {
+    "expression": {
+      "endPosition": "24",
+      "kind": "STRING_LITERAL",
+      "value": "wrong",
+      "startPosition": "19"
+    },
+    "endPosition": "26",
+    "kind": "THROW",
+    "startPosition": "12"
+  },
+  {
+    "expression": {
+      "constructorExpression": {
+        "endPosition": "46",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "46",
+          "kind": "IDENTIFIER",
+          "name": "TypeError",
+          "startPosition": "37"
+        },
+        "arguments": [],
+        "startPosition": "37"
+      },
+      "endPosition": "46",
+      "kind": "NEW",
+      "startPosition": "33"
+    },
+    "endPosition": "47",
+    "kind": "THROW",
+    "startPosition": "27"
+  },
+  {
+    "expression": {
+      "constructorExpression": {
+        "endPosition": "83",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "67",
+          "kind": "IDENTIFIER",
+          "name": "TypeError",
+          "startPosition": "58"
+        },
+        "arguments": [
+          {
+            "endPosition": "81",
+            "kind": "STRING_LITERAL",
+            "value": "not an array",
+            "startPosition": "69"
+          }
+        ],
+        "startPosition": "58"
+      },
+      "endPosition": "83",
+      "kind": "NEW",
+      "startPosition": "54"
+    },
+    "endPosition": "84",
+    "kind": "THROW",
+    "startPosition": "48"
+  },
+  {
+    "expression": {
+      "endPosition": "108",
+      "kind": "OBJECT_LITERAL",
+      "startPosition": "91",
+      "properties": [
+        {
+          "getter": "null",
+          "endPosition": "97",
+          "kind": "PROPERTY",
+          "setter": "null",
+          "value": {
+            "endPosition": "105",
+            "kind": "STRING_LITERAL",
+            "value": "wrong!",
+            "startPosition": "99"
+          },
+          "startPosition": "93",
+          "key": {
+            "endPosition": "96",
+            "kind": "IDENTIFIER",
+            "name": "msg",
+            "startPosition": "93"
+          }
+        }
+      ]
+    },
+    "endPosition": "109",
+    "kind": "THROW",
+    "startPosition": "85"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/try.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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 representation try statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+try { } catch (e) { }
+try { } catch (e) { } finally {}
+try { } finally {}
+try { } catch (e) { handle() }
+try { that() } catch (e) { handle() } finally { clean() }
+
+EOF
+
+parse("throw.js", code, "-nse", new (Java.extend(visitor, {
+    visitTry: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/try.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,230 @@
+[
+  {
+    "endPosition": "22",
+    "kind": "TRY",
+    "catches": [
+      {
+        "condition": "null",
+        "endPosition": "22",
+        "kind": "CATCH",
+        "parameter": {
+          "endPosition": "17",
+          "kind": "IDENTIFIER",
+          "name": "e",
+          "startPosition": "16"
+        },
+        "block": {
+          "endPosition": "22",
+          "kind": "BLOCK",
+          "statements": [],
+          "startPosition": "19"
+        },
+        "startPosition": "9"
+      }
+    ],
+    "block": {
+      "endPosition": "8",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "5"
+    },
+    "finallyBlock": "null",
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "55",
+    "kind": "TRY",
+    "catches": [
+      {
+        "condition": "null",
+        "endPosition": "44",
+        "kind": "CATCH",
+        "parameter": {
+          "endPosition": "39",
+          "kind": "IDENTIFIER",
+          "name": "e",
+          "startPosition": "38"
+        },
+        "block": {
+          "endPosition": "44",
+          "kind": "BLOCK",
+          "statements": [],
+          "startPosition": "41"
+        },
+        "startPosition": "31"
+      }
+    ],
+    "block": {
+      "endPosition": "30",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "27"
+    },
+    "finallyBlock": {
+      "endPosition": "55",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "53"
+    },
+    "startPosition": "23"
+  },
+  {
+    "endPosition": "74",
+    "kind": "TRY",
+    "catches": [],
+    "block": {
+      "endPosition": "63",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "60"
+    },
+    "finallyBlock": {
+      "endPosition": "74",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "72"
+    },
+    "startPosition": "56"
+  },
+  {
+    "endPosition": "105",
+    "kind": "TRY",
+    "catches": [
+      {
+        "condition": "null",
+        "endPosition": "105",
+        "kind": "CATCH",
+        "parameter": {
+          "endPosition": "91",
+          "kind": "IDENTIFIER",
+          "name": "e",
+          "startPosition": "90"
+        },
+        "block": {
+          "endPosition": "105",
+          "kind": "BLOCK",
+          "statements": [
+            {
+              "expression": {
+                "endPosition": "103",
+                "kind": "FUNCTION_INVOCATION",
+                "functionSelect": {
+                  "endPosition": "101",
+                  "kind": "IDENTIFIER",
+                  "name": "handle",
+                  "startPosition": "95"
+                },
+                "arguments": [],
+                "startPosition": "95"
+              },
+              "endPosition": "103",
+              "kind": "EXPRESSION_STATEMENT",
+              "startPosition": "95"
+            }
+          ],
+          "startPosition": "93"
+        },
+        "startPosition": "83"
+      }
+    ],
+    "block": {
+      "endPosition": "82",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "79"
+    },
+    "finallyBlock": "null",
+    "startPosition": "75"
+  },
+  {
+    "endPosition": "163",
+    "kind": "TRY",
+    "catches": [
+      {
+        "condition": "null",
+        "endPosition": "143",
+        "kind": "CATCH",
+        "parameter": {
+          "endPosition": "129",
+          "kind": "IDENTIFIER",
+          "name": "e",
+          "startPosition": "128"
+        },
+        "block": {
+          "endPosition": "143",
+          "kind": "BLOCK",
+          "statements": [
+            {
+              "expression": {
+                "endPosition": "141",
+                "kind": "FUNCTION_INVOCATION",
+                "functionSelect": {
+                  "endPosition": "139",
+                  "kind": "IDENTIFIER",
+                  "name": "handle",
+                  "startPosition": "133"
+                },
+                "arguments": [],
+                "startPosition": "133"
+              },
+              "endPosition": "141",
+              "kind": "EXPRESSION_STATEMENT",
+              "startPosition": "133"
+            }
+          ],
+          "startPosition": "131"
+        },
+        "startPosition": "121"
+      }
+    ],
+    "block": {
+      "endPosition": "120",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "endPosition": "118",
+            "kind": "FUNCTION_INVOCATION",
+            "functionSelect": {
+              "endPosition": "116",
+              "kind": "IDENTIFIER",
+              "name": "that",
+              "startPosition": "112"
+            },
+            "arguments": [],
+            "startPosition": "112"
+          },
+          "endPosition": "118",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "112"
+        }
+      ],
+      "startPosition": "110"
+    },
+    "finallyBlock": {
+      "endPosition": "163",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "endPosition": "161",
+            "kind": "FUNCTION_INVOCATION",
+            "functionSelect": {
+              "endPosition": "159",
+              "kind": "IDENTIFIER",
+              "name": "clean",
+              "startPosition": "154"
+            },
+            "arguments": [],
+            "startPosition": "154"
+          },
+          "endPosition": "161",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "154"
+        }
+      ],
+      "startPosition": "152"
+    },
+    "startPosition": "106"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/unary.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,56 @@
+/*
+ * 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 representation unary expressions tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+x++;
+x--;
+delete x;
+void x;
+typeof x;
+++x;
+--x;
++x;
+-x;
+~x;
+!x;
+
+EOF
+
+parse("unary.js", code, "-nse", new (Java.extend(visitor, {
+    visitUnary: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/unary.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,123 @@
+[
+  {
+    "expression": {
+      "endPosition": "2",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "1"
+    },
+    "endPosition": "4",
+    "kind": "POSTFIX_INCREMENT",
+    "startPosition": "1"
+  },
+  {
+    "expression": {
+      "endPosition": "7",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "6"
+    },
+    "endPosition": "9",
+    "kind": "POSTFIX_DECREMENT",
+    "startPosition": "6"
+  },
+  {
+    "expression": {
+      "endPosition": "19",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "18"
+    },
+    "endPosition": "19",
+    "kind": "DELETE",
+    "startPosition": "11"
+  },
+  {
+    "expression": {
+      "endPosition": "27",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "26"
+    },
+    "endPosition": "27",
+    "kind": "VOID",
+    "startPosition": "21"
+  },
+  {
+    "expression": {
+      "endPosition": "37",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "36"
+    },
+    "endPosition": "37",
+    "kind": "TYPEOF",
+    "startPosition": "29"
+  },
+  {
+    "expression": {
+      "endPosition": "42",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "41"
+    },
+    "endPosition": "42",
+    "kind": "PREFIX_INCREMENT",
+    "startPosition": "39"
+  },
+  {
+    "expression": {
+      "endPosition": "47",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "46"
+    },
+    "endPosition": "47",
+    "kind": "PREFIX_DECREMENT",
+    "startPosition": "44"
+  },
+  {
+    "expression": {
+      "endPosition": "51",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "50"
+    },
+    "endPosition": "51",
+    "kind": "PLUS",
+    "startPosition": "49"
+  },
+  {
+    "expression": {
+      "endPosition": "55",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "54"
+    },
+    "endPosition": "55",
+    "kind": "MINUS",
+    "startPosition": "53"
+  },
+  {
+    "expression": {
+      "endPosition": "59",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "58"
+    },
+    "endPosition": "59",
+    "kind": "BITWISE_COMPLEMENT",
+    "startPosition": "57"
+  },
+  {
+    "expression": {
+      "endPosition": "63",
+      "kind": "IDENTIFIER",
+      "name": "x",
+      "startPosition": "62"
+    },
+    "endPosition": "63",
+    "kind": "LOGICAL_COMPLEMENT",
+    "startPosition": "61"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/utils.js	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,82 @@
+/*
+ * 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
+ */
+
+var parser = Java.type('jdk.nashorn.api.tree.Parser');
+var tree = Java.type('jdk.nashorn.api.tree.Tree');
+var list = Java.type('java.util.List');
+var visitor = Java.type('jdk.nashorn.api.tree.SimpleTreeVisitorES5_1');
+var file = Java.type('java.io.File')
+var cls = Java.type('java.lang.Class')
+
+function convert (value) {
+    if (!value) {
+        return value;
+    }
+    var  obj = Object.bindProperties({}, value)
+    var result = {}
+    for (var i in obj) {
+        var val = obj[i]
+        if (typeof(val) == 'object') {
+            if (val instanceof cls) {
+                continue;
+            }
+            if (val instanceof tree) {
+                result[i] = convert(val)
+            }
+            else if (val instanceof list) {
+                var lst = []
+                for (var j in val) {
+                    lst.push(convert(val[j]))
+                }
+                result[i] = lst
+            }
+            else {
+                result[i] = String(val)
+            }
+        } else if (typeof(val) != 'function') {
+            result[i] = String(val)
+        }
+    }
+    return result
+}
+
+function parse(name, code, args, visitor, listener) {
+    var tree =  parser.create(args).parse(name, code, listener || null)
+    var results = []
+    tree.accept(visitor, results)
+    print(JSON.stringify(results, null, 2))
+}
+
+
+function parseDiagnostic (code, args) {
+    var messages = new Array()
+    var tree = parser.create(args).parse("test.js",  code, function (message) {
+        messages.push(convert(message))
+    })
+    print(JSON.stringify(messages, null, 2))
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/variable.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 representation variable statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+var a
+var x = 1
+var x23, $y = 1, _z
+
+EOF
+
+parse("variable.js", code, "-nse", new (Java.extend(visitor, {
+    visitVariable: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/variable.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,47 @@
+[
+  {
+    "endPosition": "6",
+    "kind": "VARIABLE",
+    "name": "a",
+    "startPosition": "5",
+    "initializer": "null"
+  },
+  {
+    "endPosition": "16",
+    "kind": "VARIABLE",
+    "name": "x",
+    "startPosition": "11",
+    "initializer": {
+      "endPosition": "16",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "15"
+    }
+  },
+  {
+    "endPosition": "24",
+    "kind": "VARIABLE",
+    "name": "x23",
+    "startPosition": "21",
+    "initializer": "null"
+  },
+  {
+    "endPosition": "32",
+    "kind": "VARIABLE",
+    "name": "$y",
+    "startPosition": "26",
+    "initializer": {
+      "endPosition": "32",
+      "kind": "NUMBER_LITERAL",
+      "value": "1",
+      "startPosition": "31"
+    }
+  },
+  {
+    "endPosition": "36",
+    "kind": "VARIABLE",
+    "name": "_z",
+    "startPosition": "34",
+    "initializer": "null"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/while.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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 representation while statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+while(true);
+while(false) {}
+while(2 > 1) {}
+label:while(fun()) { break label}
+label:while(!fun()) continue label;
+while(true) continue
+
+EOF
+
+parse("while.js", code, "-nse", new (Java.extend(visitor, {
+    visitWhileLoop: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/while.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,138 @@
+[
+  {
+    "condition": {
+      "endPosition": "11",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "true",
+      "startPosition": "7"
+    },
+    "endPosition": "13",
+    "kind": "WHILE_LOOP",
+    "statement": {
+      "endPosition": "13",
+      "kind": "EMPTY_STATEMENT",
+      "startPosition": "12"
+    },
+    "startPosition": "1"
+  },
+  {
+    "condition": {
+      "endPosition": "25",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "false",
+      "startPosition": "20"
+    },
+    "endPosition": "29",
+    "kind": "WHILE_LOOP",
+    "statement": {
+      "endPosition": "29",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "27"
+    },
+    "startPosition": "14"
+  },
+  {
+    "condition": {
+      "leftOperand": {
+        "endPosition": "37",
+        "kind": "NUMBER_LITERAL",
+        "value": "2",
+        "startPosition": "36"
+      },
+      "endPosition": "41",
+      "kind": "GREATER_THAN",
+      "rightOperand": {
+        "endPosition": "41",
+        "kind": "NUMBER_LITERAL",
+        "value": "1",
+        "startPosition": "40"
+      },
+      "startPosition": "36"
+    },
+    "endPosition": "45",
+    "kind": "WHILE_LOOP",
+    "statement": {
+      "endPosition": "45",
+      "kind": "BLOCK",
+      "statements": [],
+      "startPosition": "43"
+    },
+    "startPosition": "30"
+  },
+  {
+    "condition": {
+      "endPosition": "63",
+      "kind": "FUNCTION_INVOCATION",
+      "functionSelect": {
+        "endPosition": "61",
+        "kind": "IDENTIFIER",
+        "name": "fun",
+        "startPosition": "58"
+      },
+      "arguments": [],
+      "startPosition": "58"
+    },
+    "endPosition": "79",
+    "kind": "WHILE_LOOP",
+    "statement": {
+      "endPosition": "79",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "endPosition": "78",
+          "kind": "BREAK",
+          "label": "label",
+          "startPosition": "67"
+        }
+      ],
+      "startPosition": "65"
+    },
+    "startPosition": "52"
+  },
+  {
+    "condition": {
+      "expression": {
+        "endPosition": "98",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "96",
+          "kind": "IDENTIFIER",
+          "name": "fun",
+          "startPosition": "93"
+        },
+        "arguments": [],
+        "startPosition": "93"
+      },
+      "endPosition": "98",
+      "kind": "LOGICAL_COMPLEMENT",
+      "startPosition": "92"
+    },
+    "endPosition": "115",
+    "kind": "WHILE_LOOP",
+    "statement": {
+      "endPosition": "115",
+      "kind": "CONTINUE",
+      "label": "label",
+      "startPosition": "100"
+    },
+    "startPosition": "86"
+  },
+  {
+    "condition": {
+      "endPosition": "126",
+      "kind": "BOOLEAN_LITERAL",
+      "value": "true",
+      "startPosition": "122"
+    },
+    "endPosition": "136",
+    "kind": "WHILE_LOOP",
+    "statement": {
+      "endPosition": "136",
+      "kind": "CONTINUE",
+      "label": "null",
+      "startPosition": "128"
+    },
+    "startPosition": "116"
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/with.js	Sun Mar 29 09:20:27 2015 -0400
@@ -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.
+ */
+
+/**
+ * Tests to check representation with statement tree.
+ *
+ * @test
+ * @bug 8068306
+ * @option -scripting
+ * @run
+ */
+
+load(__DIR__ + "utils.js")
+
+
+var code = <<EOF
+
+with (scope) { x = y };
+with ({x:'test'}) print(x)
+with ({}) {
+    z = this.x
+}
+
+EOF
+
+parse("with.js", code, "-nse", new (Java.extend(visitor, {
+    visitWith: function (node, obj) {
+        obj.push(convert(node))
+    }
+})))
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/treeapi/with.js.EXPECTED	Sun Mar 29 09:20:27 2015 -0400
@@ -0,0 +1,143 @@
+[
+  {
+    "endPosition": "23",
+    "kind": "WITH",
+    "scope": {
+      "endPosition": "12",
+      "kind": "IDENTIFIER",
+      "name": "scope",
+      "startPosition": "7"
+    },
+    "statement": {
+      "endPosition": "23",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "expression": {
+              "endPosition": "21",
+              "kind": "IDENTIFIER",
+              "name": "y",
+              "startPosition": "20"
+            },
+            "endPosition": "21",
+            "kind": "ASSIGNMENT",
+            "variable": {
+              "endPosition": "17",
+              "kind": "IDENTIFIER",
+              "name": "x",
+              "startPosition": "16"
+            },
+            "startPosition": "16"
+          },
+          "endPosition": "21",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "16"
+        }
+      ],
+      "startPosition": "14"
+    },
+    "startPosition": "1"
+  },
+  {
+    "endPosition": "51",
+    "kind": "WITH",
+    "scope": {
+      "endPosition": "41",
+      "kind": "OBJECT_LITERAL",
+      "startPosition": "31",
+      "properties": [
+        {
+          "getter": "null",
+          "endPosition": "34",
+          "kind": "PROPERTY",
+          "setter": "null",
+          "value": {
+            "endPosition": "39",
+            "kind": "STRING_LITERAL",
+            "value": "test",
+            "startPosition": "35"
+          },
+          "startPosition": "32",
+          "key": {
+            "endPosition": "33",
+            "kind": "IDENTIFIER",
+            "name": "x",
+            "startPosition": "32"
+          }
+        }
+      ]
+    },
+    "statement": {
+      "expression": {
+        "endPosition": "51",
+        "kind": "FUNCTION_INVOCATION",
+        "functionSelect": {
+          "endPosition": "48",
+          "kind": "IDENTIFIER",
+          "name": "print",
+          "startPosition": "43"
+        },
+        "arguments": [
+          {
+            "endPosition": "50",
+            "kind": "IDENTIFIER",
+            "name": "x",
+            "startPosition": "49"
+          }
+        ],
+        "startPosition": "43"
+      },
+      "endPosition": "51",
+      "kind": "EXPRESSION_STATEMENT",
+      "startPosition": "43"
+    },
+    "startPosition": "25"
+  },
+  {
+    "endPosition": "80",
+    "kind": "WITH",
+    "scope": {
+      "endPosition": "60",
+      "kind": "OBJECT_LITERAL",
+      "startPosition": "58",
+      "properties": []
+    },
+    "statement": {
+      "endPosition": "80",
+      "kind": "BLOCK",
+      "statements": [
+        {
+          "expression": {
+            "expression": {
+              "identifier": "x",
+              "expression": {
+                "endPosition": "76",
+                "kind": "IDENTIFIER",
+                "name": "this",
+                "startPosition": "72"
+              },
+              "endPosition": "78",
+              "kind": "MEMBER_SELECT",
+              "startPosition": "72"
+            },
+            "endPosition": "78",
+            "kind": "ASSIGNMENT",
+            "variable": {
+              "endPosition": "69",
+              "kind": "IDENTIFIER",
+              "name": "z",
+              "startPosition": "68"
+            },
+            "startPosition": "68"
+          },
+          "endPosition": "78",
+          "kind": "EXPRESSION_STATEMENT",
+          "startPosition": "68"
+        }
+      ],
+      "startPosition": "62"
+    },
+    "startPosition": "52"
+  }
+]
--- a/test/lib/sun/hotspot/WhiteBox.java	Fri Mar 27 12:43:45 2015 +0100
+++ b/test/lib/sun/hotspot/WhiteBox.java	Sun Mar 29 09:20:27 2015 -0400
@@ -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
@@ -27,6 +27,7 @@
 import java.lang.reflect.Executable;
 import java.util.Arrays;
 import java.util.List;
+import java.util.function.BiFunction;
 import java.util.function.Function;
 import java.util.stream.Stream;
 import java.security.BasicPermission;
@@ -250,6 +251,23 @@
     }
     return offset;
   }
+  public native Boolean getMethodBooleanOption(Executable method, String name);
+  public native Long    getMethodIntxOption(Executable method, String name);
+  public native Long    getMethodUintxOption(Executable method, String name);
+  public native Double  getMethodDoubleOption(Executable method, String name);
+  public native String  getMethodStringOption(Executable method, String name);
+  private final List<BiFunction<Executable,String,Object>> methodOptionGetters
+      = Arrays.asList(this::getMethodBooleanOption, this::getMethodIntxOption,
+          this::getMethodUintxOption, this::getMethodDoubleOption,
+          this::getMethodStringOption);
+
+  public Object getMethodOption(Executable method, String name) {
+    return methodOptionGetters.stream()
+                              .map(f -> f.apply(method, name))
+                              .filter(x -> x != null)
+                              .findAny()
+                              .orElse(null);
+  }
 
   // Safepoint Checking
   public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);